2021-03-30 Ruben Turcios <rubent_22@apple.com> Cherry-pick r275214. rdar://problem/76032705 [LFC][Integration] Elements that overflow inline-blocks are not hit tested correctly https://bugs.webkit.org/show_bug.cgi?id=223932 rdar://75888718 Reviewed by Zalan Bujtas. Source/WebCore: If an inline block has overflowing children (for example due to negative margin) we may fail to hit test them. Test: fast/inline-block/hit-test-negative-margin-child.html * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::hitTest): Always descend into inline blocks even if their run didn't hit. LayoutTests: * fast/inline-block/hit-test-negative-margin-child-expected.txt: Added. * fast/inline-block/hit-test-negative-margin-child.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275214 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-03-30 Antti Koivisto <antti@apple.com> [LFC][Integration] Elements that overflow inline-blocks are not hit tested correctly https://bugs.webkit.org/show_bug.cgi?id=223932 rdar://75888718 Reviewed by Zalan Bujtas. If an inline block has overflowing children (for example due to negative margin) we may fail to hit test them. Test: fast/inline-block/hit-test-negative-margin-child.html * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::hitTest): Always descend into inline blocks even if their run didn't hit. 2021-03-22 Russell Epstein <repstein@apple.com> Cherry-pick r274846. rdar://problem/75706510 Use JSValueInWrappedObject to keep the JSObject alive for QuickTimePluginReplacement https://bugs.webkit.org/show_bug.cgi?id=223561 <rdar://75634407> Reviewed by Geoffrey Garen. This patch replaces QuickTimePluginReplacement's m_scriptObject member variable by JSValueInWrappedObject in HTMLPlugInElement and hooks it up with the slot visitor. Also use WeakPtr instead of a raw pointer for the back reference to the plugin element in QuickTimePluginReplacement and YouTubePluginReplacement. * Modules/plugins/PluginReplacement.h: (WebCore::PluginReplacement::InstallResult): Added; a boolean indicating the installation had succeeded and the script object for QuickTimePluginReplacement. (WebCore::PluginReplacement::scriptObject): Deleted. * Modules/plugins/QuickTimePluginReplacement.h: * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::QuickTimePluginReplacement::QuickTimePluginReplacement): Deployed WeakPtr. (WebCore::QuickTimePluginReplacement::~QuickTimePluginReplacement): Removed the superflous de-initialization of the member variables. (WebCore::QuickTimePluginReplacement::installReplacement): Now returns JSValue instead of storing it in m_scriptObject. * Modules/plugins/YouTubePluginReplacement.cpp: (WebCore::YouTubePluginReplacement::YouTubePluginReplacement): Deployed WeakPtr. (WebCore::YouTubePluginReplacement::installReplacement): * Modules/plugins/YouTubePluginReplacement.h: * bindings/scripts/CodeGeneratorJS.pm: (InstanceNeedsVisitChildren): Generate visitChildren when an IDL has Plugin attribute. (GenerateImplementation): Visit the newly added JSValueInWrappedObject. * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot): Store the script object returned by QuickTimePluginReplacement::installReplacement in the newly added member variable. (WebCore::HTMLPlugInElement::scriptObjectForPluginReplacement): Updated. * html/HTMLPlugInElement.h: (WebCore::HTMLPlugInElement::pluginReplacementScriptObject): Added. Used by visitChildren. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274846 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-03-22 Ryosuke Niwa <rniwa@webkit.org> Use JSValueInWrappedObject to keep the JSObject alive for QuickTimePluginReplacement https://bugs.webkit.org/show_bug.cgi?id=223561 <rdar://75634407> Reviewed by Geoffrey Garen. This patch replaces QuickTimePluginReplacement's m_scriptObject member variable by JSValueInWrappedObject in HTMLPlugInElement and hooks it up with the slot visitor. Also use WeakPtr instead of a raw pointer for the back reference to the plugin element in QuickTimePluginReplacement and YouTubePluginReplacement. * Modules/plugins/PluginReplacement.h: (WebCore::PluginReplacement::InstallResult): Added; a boolean indicating the installation had succeeded and the script object for QuickTimePluginReplacement. (WebCore::PluginReplacement::scriptObject): Deleted. * Modules/plugins/QuickTimePluginReplacement.h: * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::QuickTimePluginReplacement::QuickTimePluginReplacement): Deployed WeakPtr. (WebCore::QuickTimePluginReplacement::~QuickTimePluginReplacement): Removed the superflous de-initialization of the member variables. (WebCore::QuickTimePluginReplacement::installReplacement): Now returns JSValue instead of storing it in m_scriptObject. * Modules/plugins/YouTubePluginReplacement.cpp: (WebCore::YouTubePluginReplacement::YouTubePluginReplacement): Deployed WeakPtr. (WebCore::YouTubePluginReplacement::installReplacement): * Modules/plugins/YouTubePluginReplacement.h: * bindings/scripts/CodeGeneratorJS.pm: (InstanceNeedsVisitChildren): Generate visitChildren when an IDL has Plugin attribute. (GenerateImplementation): Visit the newly added JSValueInWrappedObject. * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot): Store the script object returned by QuickTimePluginReplacement::installReplacement in the newly added member variable. (WebCore::HTMLPlugInElement::scriptObjectForPluginReplacement): Updated. * html/HTMLPlugInElement.h: (WebCore::HTMLPlugInElement::pluginReplacementScriptObject): Added. Used by visitChildren. 2021-03-22 Russell Epstein <repstein@apple.com> Cherry-pick r274796. rdar://problem/75712824 [iOS] Composition text is not initially highlighted when typing in text fields using Pinyin keyboard https://bugs.webkit.org/show_bug.cgi?id=223563 <rdar://problem/75564516> Reviewed by Antti Koivisto. Source/WebCore: When enabling line layout integration, composition highlights on iOS don't appear when typing an input string using the Pinyin keyboard for the first time. This is because the text renderer for the inserted composition text does not contain inline text boxes when painting the composition text on iOS, so the marked text painting codepath is never triggered. On macOS, this isn't an issue because the process of setting the composition changes the selection, which then changes the highlight state of the `RenderText`, which subsequently calls into `ensureLineBoxes()`. However, since selections are drawn using UIKit in the UI process on iOS, we don't end up ensuring that inline text boxes are constructed for the inserted text. To address this, we follow macOS behavior by ensuring line box construction on the rendered composition text when setting the composition. Test: editing/input/composition-underline-in-search-field.html * editing/Editor.cpp: (WebCore::Editor::setComposition): LayoutTests: Add a test to verify that marked text underlines show up in search fields. * editing/input/composition-underline-in-search-field-expected-mismatch.html: Added. * editing/input/composition-underline-in-search-field.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274796 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-03-22 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Composition text is not initially highlighted when typing in text fields using Pinyin keyboard https://bugs.webkit.org/show_bug.cgi?id=223563 <rdar://problem/75564516> Reviewed by Antti Koivisto. When enabling line layout integration, composition highlights on iOS don't appear when typing an input string using the Pinyin keyboard for the first time. This is because the text renderer for the inserted composition text does not contain inline text boxes when painting the composition text on iOS, so the marked text painting codepath is never triggered. On macOS, this isn't an issue because the process of setting the composition changes the selection, which then changes the highlight state of the `RenderText`, which subsequently calls into `ensureLineBoxes()`. However, since selections are drawn using UIKit in the UI process on iOS, we don't end up ensuring that inline text boxes are constructed for the inserted text. To address this, we follow macOS behavior by ensuring line box construction on the rendered composition text when setting the composition. Test: editing/input/composition-underline-in-search-field.html * editing/Editor.cpp: (WebCore::Editor::setComposition): 2021-03-17 Ruben Turcios <rubent_22@apple.com> Cherry-pick r274573. rdar://problem/75538213 Degraded ScriptProcessorNode performance/quality for (14.0.3+ and iOS 14.4.1+) https://bugs.webkit.org/show_bug.cgi?id=223380 Reviewed by Geoffrey Garen. By extending the scope of the lock in ScriptProcessorNode::process(), r273542 essentially disabled double-buffering and thus negatively impacted rendering quality. To address the issue, we now have 2 locks, one per rendering buffer (since we're using double buffering) and only grab the lock we require when interacting with the buffers for this index. This maintains thread-safety while re-enabling double buffering. * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::createInputBufferForJS const): Avoid duplicate call to topologyMatches() since copyTo() already calls it internally and returns false when !topologyMatches(). (WebCore::ScriptProcessorNode::process): * Modules/webaudio/ScriptProcessorNode.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274573 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-03-17 Chris Dumez <cdumez@apple.com> Degraded ScriptProcessorNode performance/quality for (14.0.3+ and iOS 14.4.1+) https://bugs.webkit.org/show_bug.cgi?id=223380 Reviewed by Geoffrey Garen. By extending the scope of the lock in ScriptProcessorNode::process(), r273542 essentially disabled double-buffering and thus negatively impacted rendering quality. To address the issue, we now have 2 locks, one per rendering buffer (since we're using double buffering) and only grab the lock we require when interacting with the buffers for this index. This maintains thread-safety while re-enabling double buffering. * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::createInputBufferForJS const): Avoid duplicate call to topologyMatches() since copyTo() already calls it internally and returns false when !topologyMatches(). (WebCore::ScriptProcessorNode::process): * Modules/webaudio/ScriptProcessorNode.h: 2021-03-08 Russell Epstein <repstein@apple.com> Cherry-pick r273894. rdar://problem/75178487 AVAudioSessionCaptureDeviceManager::retrieveAudioSessionCaptureDevices is unnecessarily creating a NSArray twice https://bugs.webkit.org/show_bug.cgi?id=222732 Reviewed by Eric Carlson. Before the patch, [m_audioSession availableInputs] was called twice. This creates two NSArray which is not create from a memory standpoint. There is also the risk that the two NSArrays have two different size, in which case Vector::uncheckedAppend would fail. Cannot be easily tested, no observable change expected. * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: (WebCore::AVAudioSessionCaptureDeviceManager::retrieveAudioSessionCaptureDevices const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273894 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-03-04 Youenn Fablet <youenn@apple.com> AVAudioSessionCaptureDeviceManager::retrieveAudioSessionCaptureDevices is unnecessarily creating a NSArray twice https://bugs.webkit.org/show_bug.cgi?id=222732 Reviewed by Eric Carlson. Before the patch, [m_audioSession availableInputs] was called twice. This creates two NSArray which is not create from a memory standpoint. There is also the risk that the two NSArrays have two different size, in which case Vector::uncheckedAppend would fail. Cannot be easily tested, no observable change expected. * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: (WebCore::AVAudioSessionCaptureDeviceManager::retrieveAudioSessionCaptureDevices const): 2021-03-04 Alan Coon <alancoon@apple.com> Cherry-pick r273901. rdar://problem/75058982 window proxy of detached iframe doesn't respect updates to global values https://bugs.webkit.org/show_bug.cgi?id=206445 Reviewed by Chris Dumez. Source/WebCore: According to the html spec the frame should only be needing for COOP access violation reporting, which we don't support. This patch removes our old behavior of blocking stores to windows that have been detached. I also removed some stale caching code from getOwnPropertySlotByIndex since it's only accessed once now. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): (WebCore::JSDOMWindow::doPutPropertySecurityCheck): (WebCore::JSDOMWindow::put): (WebCore::JSDOMWindow::putByIndex): LayoutTests: * fast/frames/iframe-detached-window-still-writable-eval-expected.txt: Added. * fast/frames/iframe-detached-window-still-writable-eval.html: Added. * fast/frames/iframe-detached-window-still-writable-expected.txt: Added. * fast/frames/iframe-detached-window-still-writable.html: Added. * http/tests/dom/cross-origin-detached-window-properties-expected.txt: * http/tests/dom/cross-origin-detached-window-properties.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273901 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-03-04 Keith Miller <keith_miller@apple.com> window proxy of detached iframe doesn't respect updates to global values https://bugs.webkit.org/show_bug.cgi?id=206445 Reviewed by Chris Dumez. According to the html spec the frame should only be needing for COOP access violation reporting, which we don't support. This patch removes our old behavior of blocking stores to windows that have been detached. I also removed some stale caching code from getOwnPropertySlotByIndex since it's only accessed once now. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): (WebCore::JSDOMWindow::doPutPropertySecurityCheck): (WebCore::JSDOMWindow::put): (WebCore::JSDOMWindow::putByIndex): 2021-03-04 Alan Coon <alancoon@apple.com> Cherry-pick r273842. rdar://problem/75049263 Crash under SubresourceLoader::notifyDone() https://bugs.webkit.org/show_bug.cgi?id=222683 <rdar://70342402> Reviewed by Geoffrey Garen. We were crashing doing a null-dereference of m_documentLoader under SubresourceLoader::notifyDone(). This adds null checks for m_documentLoader similarly to what is already done elsewhere in ResourceLoader. No new tests, I do not know how to reproduce this. * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::notifyDone): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273842 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-03-03 Chris Dumez <cdumez@apple.com> Crash under SubresourceLoader::notifyDone() https://bugs.webkit.org/show_bug.cgi?id=222683 <rdar://70342402> Reviewed by Geoffrey Garen. We were crashing doing a null-dereference of m_documentLoader under SubresourceLoader::notifyDone(). This adds null checks for m_documentLoader similarly to what is already done elsewhere in ResourceLoader. No new tests, I do not know how to reproduce this. * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::notifyDone): 2021-03-02 Russell Epstein <repstein@apple.com> Apply patch. rdar://problem/74944257 2021-03-02 Ryosuke Niwa <rniwa@webkit.org> Merge r272331. <rdar://problem/74901291> Optimize PointerCaptureController::elementWasRemoved() https://bugs.webkit.org/show_bug.cgi?id=221316 Reviewed by Ryosuke Niwa. Speedometer profiles show HashTable iteration code under PointerCaptureController::elementWasRemoved() because we always add a hash entry for the mouse pointer. Optimize away by setting a flag that's only true if any element is referenced by pointer capture. * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::pointerCaptureElement const): (WebCore::PointerCaptureController::setPointerCapture): (WebCore::PointerCaptureController::releasePointerCapture): (WebCore::PointerCaptureController::hasPointerCapture): (WebCore::PointerCaptureController::pointerLockWasApplied): (WebCore::PointerCaptureController::elementWasRemoved): (WebCore::PointerCaptureController::reset): (WebCore::PointerCaptureController::updateHaveAnyCapturingElement): (WebCore::PointerCaptureController::touchWithIdentifierWasRemoved): (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier const): (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier const): (WebCore::PointerCaptureController::pointerCaptureElement): Deleted. (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier): Deleted. (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier): Deleted. * page/PointerCaptureController.h: 2021-02-03 Simon Fraser <simon.fraser@apple.com> Optimize PointerCaptureController::elementWasRemoved() https://bugs.webkit.org/show_bug.cgi?id=221316 Reviewed by Ryosuke Niwa. Speedometer profiles show HashTable iteration code under PointerCaptureController::elementWasRemoved() because we always add a hash entry for the mouse pointer. Optimize away by setting a flag that's only true if any element is referenced by pointer capture. * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::pointerCaptureElement const): (WebCore::PointerCaptureController::setPointerCapture): (WebCore::PointerCaptureController::releasePointerCapture): (WebCore::PointerCaptureController::hasPointerCapture): (WebCore::PointerCaptureController::pointerLockWasApplied): (WebCore::PointerCaptureController::elementWasRemoved): (WebCore::PointerCaptureController::reset): (WebCore::PointerCaptureController::updateHaveAnyCapturingElement): (WebCore::PointerCaptureController::touchWithIdentifierWasRemoved): (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier const): (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier const): (WebCore::PointerCaptureController::pointerCaptureElement): Deleted. (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier): Deleted. (WebCore::PointerCaptureController::preventsCompatibilityMouseEventsForIdentifier): Deleted. * page/PointerCaptureController.h: 2021-03-01 Ryosuke Niwa <rniwa@webkit.org> Merge r272299. <rdar://problem/73917813> Avoid a virtual function call in HTMLFormControlElement::isDisabledOrReadOnly() https://bugs.webkit.org/show_bug.cgi?id=221319 Reviewed by Wenson Hsieh. Avoid calling isDisabledFormControl() which is a virtual function on Element. HTMLFormControlElement is the only class in its hierarchy that implements this, so we can just copy its implementation. * html/HTMLFormControlElement.h: (WebCore::HTMLFormControlElement::isDisabledOrReadOnly const): 2021-02-02 Simon Fraser <simon.fraser@apple.com> Avoid a virtual function call in HTMLFormControlElement::isDisabledOrReadOnly() https://bugs.webkit.org/show_bug.cgi?id=221319 Reviewed by Wenson Hsieh. Avoid calling isDisabledFormControl() which is a virtual function on Element. HTMLFormControlElement is the only class in its hierarchy that implements this, so we can just copy its implementation. * html/HTMLFormControlElement.h: (WebCore::HTMLFormControlElement::isDisabledOrReadOnly const): 2021-03-01 Ryosuke Niwa <rniwa@webkit.org> Merge r272298. <rdar://problem/73917640> Avoid a virtual function call in HTMLInputElement::value() https://bugs.webkit.org/show_bug.cgi?id=221318 Reviewed by Wenson Hsieh. Only file upload controls override getTypeSpecificValue(), so to avoid a virtual function call, check the type first via canHaveTypeSpecificValue(). * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::value const): * html/InputType.h: (WebCore::InputType::canHaveTypeSpecificValue const): 2021-02-02 Simon Fraser <simon.fraser@apple.com> Avoid a virtual function call in HTMLInputElement::value() https://bugs.webkit.org/show_bug.cgi?id=221318 Reviewed by Wenson Hsieh. Only file upload controls override getTypeSpecificValue(), so to avoid a virtual function call, check the type first via canHaveTypeSpecificValue(). * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::value const): * html/InputType.h: (WebCore::InputType::canHaveTypeSpecificValue const): 2021-03-01 Ryosuke Niwa <rniwa@webkit.org> Merge r272180. <rdar://problem/74901291> Devirtualize InputType::supportsValidation() https://bugs.webkit.org/show_bug.cgi?id=221216 Reviewed by Yusuke Suzuki. InputType::supportsValidation() can just check the type. Use an OptionSet<> of exclusions for clarity. * html/ButtonInputType.cpp: (WebCore::ButtonInputType::supportsValidation const): Deleted. * html/ButtonInputType.h: * html/HiddenInputType.cpp: (WebCore::HiddenInputType::supportsValidation const): Deleted. * html/HiddenInputType.h: * html/ImageInputType.cpp: (WebCore::ImageInputType::supportsValidation const): Deleted. * html/ImageInputType.h: * html/InputType.cpp: (WebCore::InputType::supportsValidation const): Deleted. * html/InputType.h: (WebCore::InputType::supportsValidation const): * html/ResetInputType.cpp: (WebCore::ResetInputType::supportsValidation const): Deleted. * html/ResetInputType.h: 2021-02-01 Simon Fraser <simon.fraser@apple.com> Devirtualize InputType::supportsValidation() https://bugs.webkit.org/show_bug.cgi?id=221216 Reviewed by Yusuke Suzuki. InputType::supportsValidation() can just check the type. Use an OptionSet<> of exclusions for clarity. * html/ButtonInputType.cpp: (WebCore::ButtonInputType::supportsValidation const): Deleted. * html/ButtonInputType.h: * html/HiddenInputType.cpp: (WebCore::HiddenInputType::supportsValidation const): Deleted. * html/HiddenInputType.h: * html/ImageInputType.cpp: (WebCore::ImageInputType::supportsValidation const): Deleted. * html/ImageInputType.h: * html/InputType.cpp: (WebCore::InputType::supportsValidation const): Deleted. * html/InputType.h: (WebCore::InputType::supportsValidation const): * html/ResetInputType.cpp: (WebCore::ResetInputType::supportsValidation const): Deleted. * html/ResetInputType.h: 2021-03-01 Ryosuke Niwa <rniwa@webkit.org> Merge r272097. <rdar://problem/73781798> Devirtualize some functions on InputType https://bugs.webkit.org/show_bug.cgi?id=221121 Reviewed by Yusuke Suzuki. Virtual functions on InputType show up in Speedometer profiles. We can make many of these virtual functions non-virtual by just switching on the input type. * dom/Element.cpp: * html/BaseCheckableInputType.cpp: (WebCore::BaseCheckableInputType::isCheckable): Deleted. * html/BaseCheckableInputType.h: * html/BaseTextInputType.cpp: (WebCore::BaseTextInputType::isTextType const): Deleted. * html/BaseTextInputType.h: * html/ButtonInputType.cpp: (WebCore::ButtonInputType::isTextButton const): Deleted. * html/ButtonInputType.h: * html/CheckboxInputType.cpp: (WebCore::CheckboxInputType::isCheckbox const): Deleted. * html/CheckboxInputType.h: * html/ColorInputType.cpp: (WebCore::ColorInputType::isColorControl const): Deleted. * html/ColorInputType.h: * html/DateInputType.cpp: (WebCore::DateInputType::isDateField const): Deleted. * html/DateInputType.h: * html/DateTimeLocalInputType.cpp: (WebCore::DateTimeLocalInputType::isDateTimeLocalField const): Deleted. * html/DateTimeLocalInputType.h: * html/EmailInputType.cpp: (WebCore::EmailInputType::isEmailField const): Deleted. * html/EmailInputType.h: * html/FileInputType.cpp: (WebCore::FileInputType::isFileUpload const): Deleted. * html/FileInputType.h: * html/FormAssociatedElement.h: * html/HTMLFormControlElement.h: * html/HiddenInputType.cpp: (WebCore::HiddenInputType::isHiddenType const): Deleted. * html/HiddenInputType.h: * html/ImageInputType.cpp: (WebCore::ImageInputType::isImageButton const): Deleted. (WebCore::ImageInputType::isEnumeratable): Deleted. * html/ImageInputType.h: * html/InputType.cpp: (WebCore::InputType::isTextType const): (WebCore::InputType::isTextField const): (WebCore::InputType::isTextButton const): (WebCore::InputType::isInteractiveContent const): (WebCore::InputType::supportLabels const): (WebCore::InputType::isEnumeratable): (WebCore::InputType::isCheckable): (WebCore::InputType::isRangeControl const): Deleted. (WebCore::InputType::isRadioButton const): Deleted. (WebCore::InputType::isSearchField const): Deleted. (WebCore::InputType::isHiddenType const): Deleted. (WebCore::InputType::isPasswordField const): Deleted. (WebCore::InputType::isCheckbox const): Deleted. (WebCore::InputType::isEmailField const): Deleted. (WebCore::InputType::isFileUpload const): Deleted. (WebCore::InputType::isImageButton const): Deleted. (WebCore::InputType::isNumberField const): Deleted. (WebCore::InputType::isSubmitButton const): Deleted. (WebCore::InputType::isTelephoneField const): Deleted. (WebCore::InputType::isURLField const): Deleted. (WebCore::InputType::isDateField const): Deleted. (WebCore::InputType::isDateTimeField const): Deleted. (WebCore::InputType::isDateTimeLocalField const): Deleted. (WebCore::InputType::isMonthField const): Deleted. (WebCore::InputType::isTimeField const): Deleted. (WebCore::InputType::isWeekField const): Deleted. (WebCore::InputType::isColorControl const): Deleted. * html/InputType.h: (WebCore::InputType::isCheckbox const): (WebCore::InputType::isColorControl const): (WebCore::InputType::isDateField const): (WebCore::InputType::isDateTimeField const): (WebCore::InputType::isDateTimeLocalField const): (WebCore::InputType::isEmailField const): (WebCore::InputType::isFileUpload const): (WebCore::InputType::isHiddenType const): (WebCore::InputType::isImageButton const): (WebCore::InputType::isMonthField const): (WebCore::InputType::isNumberField const): (WebCore::InputType::isPasswordField const): (WebCore::InputType::isRadioButton const): (WebCore::InputType::isRangeControl const): (WebCore::InputType::isSearchField const): (WebCore::InputType::isSubmitButton const): (WebCore::InputType::isTelephoneField const): (WebCore::InputType::isTimeField const): (WebCore::InputType::isURLField const): (WebCore::InputType::isWeekField const): * html/MonthInputType.cpp: (WebCore::MonthInputType::isMonthField const): Deleted. * html/MonthInputType.h: * html/NumberInputType.cpp: (WebCore::NumberInputType::isNumberField const): Deleted. * html/NumberInputType.h: * html/PasswordInputType.cpp: (WebCore::PasswordInputType::isPasswordField const): Deleted. * html/PasswordInputType.h: * html/RadioInputType.cpp: (WebCore::RadioInputType::isRadioButton const): Deleted. * html/RadioInputType.h: * html/RangeInputType.cpp: (WebCore::RangeInputType::isRangeControl const): Deleted. * html/RangeInputType.h: * html/ResetInputType.cpp: (WebCore::ResetInputType::isTextButton const): Deleted. * html/ResetInputType.h: * html/SearchInputType.cpp: (WebCore::SearchInputType::isSearchField const): Deleted. * html/SearchInputType.h: * html/SubmitInputType.cpp: (WebCore::SubmitInputType::isSubmitButton const): Deleted. (WebCore::SubmitInputType::isTextButton const): Deleted. * html/SubmitInputType.h: * html/TelephoneInputType.cpp: (WebCore::TelephoneInputType::isTelephoneField const): Deleted. * html/TelephoneInputType.h: * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::isTextField const): Deleted. * html/TextFieldInputType.h: * html/TimeInputType.cpp: (WebCore::TimeInputType::isTimeField const): Deleted. * html/TimeInputType.h: * html/URLInputType.cpp: (WebCore::URLInputType::isURLField const): Deleted. * html/URLInputType.h: * html/WeekInputType.cpp: (WebCore::WeekInputType::isWeekField const): Deleted. * html/WeekInputType.h: 2021-01-29 Simon Fraser <simon.fraser@apple.com> Devirtualize some functions on InputType https://bugs.webkit.org/show_bug.cgi?id=221121 Reviewed by Yusuke Suzuki. Virtual functions on InputType show up in Speedometer profiles. We can make many of these virtual functions non-virtual by just switching on the input type. * dom/Element.cpp: * html/BaseCheckableInputType.cpp: (WebCore::BaseCheckableInputType::isCheckable): Deleted. * html/BaseCheckableInputType.h: * html/BaseTextInputType.cpp: (WebCore::BaseTextInputType::isTextType const): Deleted. * html/BaseTextInputType.h: * html/ButtonInputType.cpp: (WebCore::ButtonInputType::isTextButton const): Deleted. * html/ButtonInputType.h: * html/CheckboxInputType.cpp: (WebCore::CheckboxInputType::isCheckbox const): Deleted. * html/CheckboxInputType.h: * html/ColorInputType.cpp: (WebCore::ColorInputType::isColorControl const): Deleted. * html/ColorInputType.h: * html/DateInputType.cpp: (WebCore::DateInputType::isDateField const): Deleted. * html/DateInputType.h: * html/DateTimeLocalInputType.cpp: (WebCore::DateTimeLocalInputType::isDateTimeLocalField const): Deleted. * html/DateTimeLocalInputType.h: * html/EmailInputType.cpp: (WebCore::EmailInputType::isEmailField const): Deleted. * html/EmailInputType.h: * html/FileInputType.cpp: (WebCore::FileInputType::isFileUpload const): Deleted. * html/FileInputType.h: * html/FormAssociatedElement.h: * html/HTMLFormControlElement.h: * html/HiddenInputType.cpp: (WebCore::HiddenInputType::isHiddenType const): Deleted. * html/HiddenInputType.h: * html/ImageInputType.cpp: (WebCore::ImageInputType::isImageButton const): Deleted. (WebCore::ImageInputType::isEnumeratable): Deleted. * html/ImageInputType.h: * html/InputType.cpp: (WebCore::InputType::isTextType const): (WebCore::InputType::isTextField const): (WebCore::InputType::isTextButton const): (WebCore::InputType::isInteractiveContent const): (WebCore::InputType::supportLabels const): (WebCore::InputType::isEnumeratable): (WebCore::InputType::isCheckable): (WebCore::InputType::isRangeControl const): Deleted. (WebCore::InputType::isRadioButton const): Deleted. (WebCore::InputType::isSearchField const): Deleted. (WebCore::InputType::isHiddenType const): Deleted. (WebCore::InputType::isPasswordField const): Deleted. (WebCore::InputType::isCheckbox const): Deleted. (WebCore::InputType::isEmailField const): Deleted. (WebCore::InputType::isFileUpload const): Deleted. (WebCore::InputType::isImageButton const): Deleted. (WebCore::InputType::isNumberField const): Deleted. (WebCore::InputType::isSubmitButton const): Deleted. (WebCore::InputType::isTelephoneField const): Deleted. (WebCore::InputType::isURLField const): Deleted. (WebCore::InputType::isDateField const): Deleted. (WebCore::InputType::isDateTimeField const): Deleted. (WebCore::InputType::isDateTimeLocalField const): Deleted. (WebCore::InputType::isMonthField const): Deleted. (WebCore::InputType::isTimeField const): Deleted. (WebCore::InputType::isWeekField const): Deleted. (WebCore::InputType::isColorControl const): Deleted. * html/InputType.h: (WebCore::InputType::isCheckbox const): (WebCore::InputType::isColorControl const): (WebCore::InputType::isDateField const): (WebCore::InputType::isDateTimeField const): (WebCore::InputType::isDateTimeLocalField const): (WebCore::InputType::isEmailField const): (WebCore::InputType::isFileUpload const): (WebCore::InputType::isHiddenType const): (WebCore::InputType::isImageButton const): (WebCore::InputType::isMonthField const): (WebCore::InputType::isNumberField const): (WebCore::InputType::isPasswordField const): (WebCore::InputType::isRadioButton const): (WebCore::InputType::isRangeControl const): (WebCore::InputType::isSearchField const): (WebCore::InputType::isSubmitButton const): (WebCore::InputType::isTelephoneField const): (WebCore::InputType::isTimeField const): (WebCore::InputType::isURLField const): (WebCore::InputType::isWeekField const): * html/MonthInputType.cpp: (WebCore::MonthInputType::isMonthField const): Deleted. * html/MonthInputType.h: * html/NumberInputType.cpp: (WebCore::NumberInputType::isNumberField const): Deleted. * html/NumberInputType.h: * html/PasswordInputType.cpp: (WebCore::PasswordInputType::isPasswordField const): Deleted. * html/PasswordInputType.h: * html/RadioInputType.cpp: (WebCore::RadioInputType::isRadioButton const): Deleted. * html/RadioInputType.h: * html/RangeInputType.cpp: (WebCore::RangeInputType::isRangeControl const): Deleted. * html/RangeInputType.h: * html/ResetInputType.cpp: (WebCore::ResetInputType::isTextButton const): Deleted. * html/ResetInputType.h: * html/SearchInputType.cpp: (WebCore::SearchInputType::isSearchField const): Deleted. * html/SearchInputType.h: * html/SubmitInputType.cpp: (WebCore::SubmitInputType::isSubmitButton const): Deleted. (WebCore::SubmitInputType::isTextButton const): Deleted. * html/SubmitInputType.h: * html/TelephoneInputType.cpp: (WebCore::TelephoneInputType::isTelephoneField const): Deleted. * html/TelephoneInputType.h: * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::isTextField const): Deleted. * html/TextFieldInputType.h: * html/TimeInputType.cpp: (WebCore::TimeInputType::isTimeField const): Deleted. * html/TimeInputType.h: * html/URLInputType.cpp: (WebCore::URLInputType::isURLField const): Deleted. * html/URLInputType.h: * html/WeekInputType.cpp: (WebCore::WeekInputType::isWeekField const): Deleted. * html/WeekInputType.h: 2021-03-02 Alan Coon <alancoon@apple.com> Cherry-pick r273656. rdar://problem/74883345 REGRESSION(r272004): transform transition with delay doesn't behave correctly https://bugs.webkit.org/show_bug.cgi?id=222545 <rdar://problem/74865413> Reviewed by Dean Jackson. Source/WebCore: To support accelerated animations of individual transform properties, we introduced the notion of non-interpolating animations to apply the underlying value for a given property before applying the actual animations for this property with additivity set to true. These non-interpolating animations were meant to last between the time at which animations were committed and the effective start of the first animation for that property, accounting for any delay. However, we neglected to handle the case where that first animation had a fill mode that would make it fill backwards, such as CSS Transitions. In that situation, the animation would have its first keyframe applied on top of the underlying value, effectively applying the underlying value twice with additivity. We now only add these non-interpolating animations if the first animation has a delay and does not fill backwards. Test: webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateAnimations): LayoutTests: Add a new test where an element with a non-identity transform starts a transform transition with a long delay. Prior to this patch, this test failed because, while in the delay phase, the transition would mean the underlying transform was applied twice: once by the non-interpolating animation generated for the underlying "transform" value, and once by the first keyframe of the transition since it fills backwards. * webanimations/transform-transition-with-delay-on-forced-layer-with-transform-expected.html: Added. * webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273656 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-03-01 Antoine Quint <graouts@webkit.org> REGRESSION(r272004): transform transition with delay doesn't behave correctly https://bugs.webkit.org/show_bug.cgi?id=222545 <rdar://problem/74865413> Reviewed by Dean Jackson. To support accelerated animations of individual transform properties, we introduced the notion of non-interpolating animations to apply the underlying value for a given property before applying the actual animations for this property with additivity set to true. These non-interpolating animations were meant to last between the time at which animations were committed and the effective start of the first animation for that property, accounting for any delay. However, we neglected to handle the case where that first animation had a fill mode that would make it fill backwards, such as CSS Transitions. In that situation, the animation would have its first keyframe applied on top of the underlying value, effectively applying the underlying value twice with additivity. We now only add these non-interpolating animations if the first animation has a delay and does not fill backwards. Test: webanimations/transform-transition-with-delay-on-forced-layer-with-transform.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateAnimations): 2021-03-01 Alan Coon <alancoon@apple.com> Cherry-pick r273564. rdar://problem/74886738 [Cocoa] Register VP9 decoders when PlatformMediaSessionManager is created https://bugs.webkit.org/show_bug.cgi?id=222473 <rdar://problem/74790242> Reviewed by Eric Carlson. Source/WebCore: Currently, VP9 decoders are registered when a Web page is created in the WebContent process. Instead, VP9 decoders can be registered when PlatformMediaSessionManager is created, which should be a slight performance improvement, since calls into media frameworks will then not be made unconditionally when creating a Web page, but delayed until required. No new tests, covered by existing tests. * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::setShouldEnableVP9Decoder): (WebCore::PlatformMediaSessionManager::shouldEnableVP9Decoder): (WebCore::PlatformMediaSessionManager::setShouldEnableVP8Decoder): (WebCore::PlatformMediaSessionManager::shouldEnableVP8Decoder): (WebCore::PlatformMediaSessionManager::setShouldEnableVP9SWDecoder): (WebCore::PlatformMediaSessionManager::shouldEnableVP9SWDecoder): * platform/audio/PlatformMediaSessionManager.h: * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::MediaSessionManagerCocoa): Source/WebKit: Currently, VP9 decoders are registered when a Web page is created in the WebContent process. Instead, VP9 decoders can be registered when PlatformMediaSessionManager is created, which should be a slight performance improvement, since calls into media frameworks will then not be made unconditionally when creating a Web page, but delayed until required. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_lastNavigationWasAppBound): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::enableVP9Decoder): Deleted. (WebKit::WebProcess::enableVP8SWDecoder): Deleted. (WebKit::WebProcess::enableVP9SWDecoder): Deleted. * WebProcess/WebProcess.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273564 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-26 Per Arne <pvollan@apple.com> [Cocoa] Register VP9 decoders when PlatformMediaSessionManager is created https://bugs.webkit.org/show_bug.cgi?id=222473 <rdar://problem/74790242> Reviewed by Eric Carlson. Currently, VP9 decoders are registered when a Web page is created in the WebContent process. Instead, VP9 decoders can be registered when PlatformMediaSessionManager is created, which should be a slight performance improvement, since calls into media frameworks will then not be made unconditionally when creating a Web page, but delayed until required. No new tests, covered by existing tests. * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::setShouldEnableVP9Decoder): (WebCore::PlatformMediaSessionManager::shouldEnableVP9Decoder): (WebCore::PlatformMediaSessionManager::setShouldEnableVP8Decoder): (WebCore::PlatformMediaSessionManager::shouldEnableVP8Decoder): (WebCore::PlatformMediaSessionManager::setShouldEnableVP9SWDecoder): (WebCore::PlatformMediaSessionManager::shouldEnableVP9SWDecoder): * platform/audio/PlatformMediaSessionManager.h: * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::MediaSessionManagerCocoa): 2021-02-26 Alan Coon <alancoon@apple.com> Cherry-pick r273558. rdar://problem/74800042 Unreviewed, address post-landing review feedback for r273542. Update a comment and fix a check that was reversed. * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::createOutputBufferForJS const): (WebCore::ScriptProcessorNode::process): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273558 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-26 Chris Dumez <cdumez@apple.com> Unreviewed, address post-landing review feedback for r273542. Update a comment and fix a check that was reversed. * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::createOutputBufferForJS const): (WebCore::ScriptProcessorNode::process): 2021-02-26 Alan Coon <alancoon@apple.com> Cherry-pick r273542. rdar://problem/74800042 Fix threading issue in ScriptProcessorNode::process() https://bugs.webkit.org/show_bug.cgi?id=222447 <rdar://74700526> Reviewed by Jer Noble. It was possible for the audio thread (in ScriptProcessorNode::process()) and the main thread (via ScriptProcessorNode::fireProcessEvent()) to access the same m_inputBuffers / m_outputBuffers concurrently, causing crashes. The m_processLock was supposed to avoid this. However, the scope of the locking in ScriptProcessorNode::process() was insufficient to protect us. ScriptProcessorNode::process() now grabs the lock very early, before interacting with any buffers and we make sure not to modify the buffers when we are unable to grab the lock. Also, to make sure that the m_inputBuffers / m_outputBuffers are modified by the main thread only during the scope of the fireProcessEvent() function (during which we hold the processLock), we no longer pass our internal buffers to the JS process event handler. Instead, we pass new buffers to JS and memcpy to and from them. While this is less efficient, this is actually required because the script could store the buffers it is given and modify them outside the scope of the process event handler. * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::AudioBuffer): (WebCore::AudioBuffer::topologyMatches const): (WebCore::AudioBuffer::copyTo const): (WebCore::AudioBuffer::clone const): * Modules/webaudio/AudioBuffer.h: * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::createInputBufferForJS const): (WebCore::ScriptProcessorNode::createOutputBufferForJS const): (WebCore::ScriptProcessorNode::process): (WebCore::ScriptProcessorNode::fireProcessEvent): * Modules/webaudio/ScriptProcessorNode.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273542 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-25 Chris Dumez <cdumez@apple.com> Fix threading issue in ScriptProcessorNode::process() https://bugs.webkit.org/show_bug.cgi?id=222447 <rdar://74700526> Reviewed by Jer Noble. It was possible for the audio thread (in ScriptProcessorNode::process()) and the main thread (via ScriptProcessorNode::fireProcessEvent()) to access the same m_inputBuffers / m_outputBuffers concurrently, causing crashes. The m_processLock was supposed to avoid this. However, the scope of the locking in ScriptProcessorNode::process() was insufficient to protect us. ScriptProcessorNode::process() now grabs the lock very early, before interacting with any buffers and we make sure not to modify the buffers when we are unable to grab the lock. Also, to make sure that the m_inputBuffers / m_outputBuffers are modified by the main thread only during the scope of the fireProcessEvent() function (during which we hold the processLock), we no longer pass our internal buffers to the JS process event handler. Instead, we pass new buffers to JS and memcpy to and from them. While this is less efficient, this is actually required because the script could store the buffers it is given and modify them outside the scope of the process event handler. * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::AudioBuffer): (WebCore::AudioBuffer::topologyMatches const): (WebCore::AudioBuffer::copyTo const): (WebCore::AudioBuffer::clone const): * Modules/webaudio/AudioBuffer.h: * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::createInputBufferForJS const): (WebCore::ScriptProcessorNode::createOutputBufferForJS const): (WebCore::ScriptProcessorNode::process): (WebCore::ScriptProcessorNode::fireProcessEvent): * Modules/webaudio/ScriptProcessorNode.h: 2021-02-26 Alan Coon <alancoon@apple.com> Cherry-pick r273512. rdar://problem/74799698 REGRESSION(r269957): Empty font names passed to canvas2d cause all text routines to crash https://bugs.webkit.org/show_bug.cgi?id=222402 <rdar://problem/72621268> Reviewed by Darin Adler and Chris Lord. Source/WebCore: It looks like it was simply an oversight from that patch. If the font name is empty, CanvasRenderingContext2D::setFont() will set the font object to one that doesn't have its internal FontCascadeFonts pointer set. Tests: fast/text/canvas-font-resolution-2.html fast/text/canvas-font-resolution.html * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::setFont): * html/canvas/CanvasRenderingContext2DBase.h: (WebCore::CanvasRenderingContext2DBase::FontProxy::isPopulated const): * style/StyleResolveForFontRaw.cpp: (WebCore::Style::resolveForFontRaw): LayoutTests: * fast/text/canvas-font-resolution-2-expected.html: Added. * fast/text/canvas-font-resolution-2.html: Added. * fast/text/canvas-font-resolution-expected.txt: Added. * fast/text/canvas-font-resolution.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273512 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-25 Myles C. Maxfield <mmaxfield@apple.com> REGRESSION(r269957): Empty font names passed to canvas2d cause all text routines to crash https://bugs.webkit.org/show_bug.cgi?id=222402 <rdar://problem/72621268> Reviewed by Darin Adler and Chris Lord. It looks like it was simply an oversight from that patch. If the font name is empty, CanvasRenderingContext2D::setFont() will set the font object to one that doesn't have its internal FontCascadeFonts pointer set. Tests: fast/text/canvas-font-resolution-2.html fast/text/canvas-font-resolution.html * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::setFont): * html/canvas/CanvasRenderingContext2DBase.h: (WebCore::CanvasRenderingContext2DBase::FontProxy::isPopulated const): * style/StyleResolveForFontRaw.cpp: (WebCore::Style::resolveForFontRaw): 2021-02-26 Alan Coon <alancoon@apple.com> Cherry-pick r273498. rdar://problem/74800989 [iOS] Crash when playing Dolby Atmos audio tracks with AVAudioTimePitchAlgorithmTimeDomain https://bugs.webkit.org/show_bug.cgi?id=222420 <rdar://74612532> Reviewed by Eric Carlson. CoreAudio throws an assertion when using the TimeDomain pitch-correction algorithm on tracks with > 2 channels. To work around this assertion for now, only set the pitch-correction algorithm when the playbackRate is set to a non 0 or 1 value. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPreservesPitch): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPitchCorrectionAlgorithm): (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatusDidChange): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273498 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-25 Jer Noble <jer.noble@apple.com> [iOS] Crash when playing Dolby Atmos audio tracks with AVAudioTimePitchAlgorithmTimeDomain https://bugs.webkit.org/show_bug.cgi?id=222420 <rdar://74612532> Reviewed by Eric Carlson. CoreAudio throws an assertion when using the TimeDomain pitch-correction algorithm on tracks with > 2 channels. To work around this assertion for now, only set the pitch-correction algorithm when the playbackRate is set to a non 0 or 1 value. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPreservesPitch): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPitchCorrectionAlgorithm): (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatusDidChange): 2021-02-26 Alan Coon <alancoon@apple.com> Cherry-pick r273539. rdar://problem/74798808 Emoji sequences with constituents in the UBLOCK_SYMBOLS_AND_PICTOGRAPHS_EXTENDED_A Unicode block don't get combined properly https://bugs.webkit.org/show_bug.cgi?id=222438 <rdar://problem/74382039> Reviewed by Zalan Bujtas. Source/WebCore: Just add UBLOCK_SYMBOLS_AND_PICTOGRAPHS_EXTENDED_A to the list. We have to do some workarounds because not all versions of ICU include this value. Luckily, these workarounds are compile-time-only, because we we're only using this value to compare to a value produced by ICU (not a value we pass into ICU). Test: fast/text/mending-heart.html * platform/text/CharacterProperties.h: (WebCore::isEmojiGroupCandidate): LayoutTests: * fast/text/mending-heart-expected.txt: Added. * fast/text/mending-heart.html: Added. * platform/ios/TestExpectations: * platform/mac/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273539 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-25 Myles C. Maxfield <mmaxfield@apple.com> Emoji sequences with constituents in the UBLOCK_SYMBOLS_AND_PICTOGRAPHS_EXTENDED_A Unicode block don't get combined properly https://bugs.webkit.org/show_bug.cgi?id=222438 <rdar://problem/74382039> Reviewed by Zalan Bujtas. Just add UBLOCK_SYMBOLS_AND_PICTOGRAPHS_EXTENDED_A to the list. We have to do some workarounds because not all versions of ICU include this value. Luckily, these workarounds are compile-time-only, because we we're only using this value to compare to a value produced by ICU (not a value we pass into ICU). Test: fast/text/mending-heart.html * platform/text/CharacterProperties.h: (WebCore::isEmojiGroupCandidate): 2021-02-25 Russell Epstein <repstein@apple.com> Cherry-pick r273442. rdar://problem/74753214 Regression(r269481) Kugou Music: Can not leave "MV" category after selecting it https://bugs.webkit.org/show_bug.cgi?id=222380 <rdar://74602294> Reviewed by Geoffrey Garen. The new behavior in r269481 aligns us with the specification and with Blink so I am adding a linked-on-after to maintain pre-r269481 behavior until Apps get rebuilt against the new SDK. * html/HTMLDocument.cpp: (WebCore::HTMLDocument::supportedPropertyNames const): * page/Quirks.cpp: (WebCore::Quirks::shouldOmitHTMLDocumentSupportedPropertyNames): * page/Quirks.h: * platform/cocoa/VersionChecks.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273442 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-24 Chris Dumez <cdumez@apple.com> Regression(r269481) Kugou Music: Can not leave "MV" category after selecting it https://bugs.webkit.org/show_bug.cgi?id=222380 <rdar://74602294> Reviewed by Geoffrey Garen. The new behavior in r269481 aligns us with the specification and with Blink so I am adding a linked-on-after to maintain pre-r269481 behavior until Apps get rebuilt against the new SDK. * html/HTMLDocument.cpp: (WebCore::HTMLDocument::supportedPropertyNames const): * page/Quirks.cpp: (WebCore::Quirks::shouldOmitHTMLDocumentSupportedPropertyNames): * page/Quirks.h: * platform/cocoa/VersionChecks.h: 2021-02-25 Russell Epstein <repstein@apple.com> Cherry-pick r273501. rdar://problem/74760623 [Cocoa] Files from webmfiles.org do not play through MSE https://bugs.webkit.org/show_bug.cgi?id=222403 <rdar://74640660> Reviewed by Eric Carlson. Source/WebCore: Test: media/media-source/media-source-webm-vp8-malformed-header.html As per RFC 6386, each VP8 frame begins with a three-byte (minimum) frame header, with extra bytes if that preamble indicates that the frame is a keyframe. Files from webmfiles.org (and others) have valid frame headers for keyframes, but invalid or no header for interframes; these interframes' headers, when parsed, erroneously report they are keyframes, and thus the optional extra bytes are parsed, fail parsing, and generate an error. Rather than drop frames when parsing fails, just assume the frame is an interframe, and proceed normally. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::VideoTrackData::consumeFrameData): LayoutTests: * platform/mac-bigsur/media/media-source/content/test-vp8-malformed-header-manifest.json: Added. * platform/mac-bigsur/media/media-source/content/test-vp8-malformed-header.webm: Added. * platform/mac-bigsur/media/media-source/media-source-webm-vp8-malformed-header-expected.txt: Added. * platform/mac-bigsur/media/media-source/media-source-webm-vp8-malformed-header.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273501 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-25 Jer Noble <jer.noble@apple.com> [Cocoa] Files from webmfiles.org do not play through MSE https://bugs.webkit.org/show_bug.cgi?id=222403 <rdar://74640660> Reviewed by Eric Carlson. Test: media/media-source/media-source-webm-vp8-malformed-header.html As per RFC 6386, each VP8 frame begins with a three-byte (minimum) frame header, with extra bytes if that preamble indicates that the frame is a keyframe. Files from webmfiles.org (and others) have valid frame headers for keyframes, but invalid or no header for interframes; these interframes' headers, when parsed, erroneously report they are keyframes, and thus the optional extra bytes are parsed, fail parsing, and generate an error. Rather than drop frames when parsing fails, just assume the frame is an interframe, and proceed normally. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::VideoTrackData::consumeFrameData): 2021-02-25 Russell Epstein <repstein@apple.com> Cherry-pick r273499. rdar://problem/74766327 Avoid setting page muted state if unchanged https://bugs.webkit.org/show_bug.cgi?id=222395 Reviewed by Brent Fulgham. Return early in Page::setMuted if muted state did not change. No new tests, covered by existing tests. * page/Page.cpp: (WebCore::Page::setMuted): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273499 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-25 Per Arne Vollan <pvollan@apple.com> Avoid setting page muted state if unchanged https://bugs.webkit.org/show_bug.cgi?id=222395 Reviewed by Brent Fulgham. Return early in Page::setMuted if muted state did not change. No new tests, covered by existing tests. * page/Page.cpp: (WebCore::Page::setMuted): 2021-02-25 Russell Epstein <repstein@apple.com> Cherry-pick r273477. rdar://problem/74766196 Avoid heap allocation for EventContexts https://bugs.webkit.org/show_bug.cgi?id=222095 <rdar://problem/74586915> Reviewed by Simon Fraser. This patch merges all subclasses of EventContext into itself to avoid heap allocation for each EventContext in EventPath::m_path. It also merges Node::handleLocalEvents into EventContext's handleLocalEvents to avoid the extra virtual function call. No new tests since there should be no observable behavioral differences. * dom/EventContext.cpp: (WebCore::EventContext::EventContext): Moved to the header to be inlined. (WebCore::EventContext::handleLocalEvents const): Merged handleLocalEvents of HTMLFormElement and Node. Moved the code to handle related target and touch targets from MouseOrFocusEventContext and TouchEventContext as they have been merged into this class. Also special case dispatching an event on window to preserve the behavior of WindowEventContext. (WebCore::EventContext::initializeTouchLists): Added. Creates TouchList objects. (WebCore::EventContext::isUnreachableNode const): Moved from the header. (WebCore::EventContext::isMouseOrFocusEventContext const): Deleted. (WebCore::EventContext::isTouchEventContext const): Deleted. (WebCore::MouseOrFocusEventContext::MouseOrFocusEventContext): Deleted. (WebCore::MouseOrFocusEventContext::handleLocalEvents const): Deleted. (WebCore::MouseOrFocusEventContext::isMouseOrFocusEventContext const): Deleted. (WebCore::TouchEventContext::TouchEventContext): Deleted. (WebCore::TouchEventContext::handleLocalEvents const): Deleted. (WebCore::TouchEventContext::isTouchEventContext const): Deleted. (WebCore::TouchEventContext::checkReachability const): Deleted. Merged into handleLocalEvents. * dom/EventContext.h: (WebCore::EventContext::isMouseOrFocusEventContext const): Now simply checks m_type. (WebCore::EventContext::isTouchEventContext const): Ditto. (WebCore::EventContext::isWindowContext const): Ditto. (WebCore::EventContext::relatedTarget const): Moved from MouseOrFocusEventContext. (WebCore::EventContext::setRelatedTarget): Ditto. (WebCore::EventContext::touchList): Moved from TouchEventContext. (WebCore::m_contextNodeIsFormElement): Added. Caching this state here instead of checking it at every event context during dispatching in EventContext::handleLocalEvents seems to be important to get a speed up in Intel processors. Apple silicons don't seem to be affected by this. (WebCore::m_type): Added. (WebCore::MouseOrFocusEventContext): Deleted. (WebCore::MouseOrFocusEventContext::relatedTarget const): Deleted. (WebCore::TouchEventContext): Deleted. (WebCore::EventContext::EventContext): Moved from cpp file to be inlined here. (WebCore::EventContext::isUnreachableNode const): Moved into cpp as this is only used for asserting shadow DOM related conditions. (WebCore::EventContext::touchList): Renamed from TouchEventContext::touchList. (isType): Deleted. * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): Deleted the variant that takes a vector of elements since it's not used anywhere. * dom/EventDispatcher.h: * dom/EventPath.cpp: (WebCore::WindowEventContext): Deleted. (WebCore::EventPath::EventPath): Avoid calling setRelatedTarget if related target is not a node or the path is empty. These were early return conditions in setRelatedTarget before this patch. (WebCore::EventPath::buildPath): Always create EventContext. Dramatically simplifies the code. (WebCore::EventPath::setRelatedTarget): Moved the early exit to EventPath::EventPath. (WebCore::EventPath::retargetTouch): (WebCore::EventPath::retargetTouchList): (WebCore::EventPath::retargetTouchLists): (WebCore::EventPath::EventPath): Deleted the variant which takes a vector of elements as it's not used anywhere. * dom/EventPath.h: (WebCore::EventPath::contextAt const): (WebCore::EventPath::contextAt): (WebCore::EventPath::m_path): Now allocates EventContext in place. The size of the inline buffer has been reduced to 16 entries for EventContext from 32 entries for std::unique_ptr<EventContext> since the former is considerably larger than the latter. * dom/Node.cpp: (WebCore::Node::handleLocalEvents): Deleted. Merged into EventContext::handleLocalEvents. * dom/Node.h: * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::handleLocalEvents): Ditto. * html/HTMLFormElement.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273477 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-25 Ryosuke Niwa <rniwa@webkit.org> Avoid heap allocation for EventContexts https://bugs.webkit.org/show_bug.cgi?id=222095 <rdar://problem/74586915> Reviewed by Simon Fraser. This patch merges all subclasses of EventContext into itself to avoid heap allocation for each EventContext in EventPath::m_path. It also merges Node::handleLocalEvents into EventContext's handleLocalEvents to avoid the extra virtual function call. No new tests since there should be no observable behavioral differences. * dom/EventContext.cpp: (WebCore::EventContext::EventContext): Moved to the header to be inlined. (WebCore::EventContext::handleLocalEvents const): Merged handleLocalEvents of HTMLFormElement and Node. Moved the code to handle related target and touch targets from MouseOrFocusEventContext and TouchEventContext as they have been merged into this class. Also special case dispatching an event on window to preserve the behavior of WindowEventContext. (WebCore::EventContext::initializeTouchLists): Added. Creates TouchList objects. (WebCore::EventContext::isUnreachableNode const): Moved from the header. (WebCore::EventContext::isMouseOrFocusEventContext const): Deleted. (WebCore::EventContext::isTouchEventContext const): Deleted. (WebCore::MouseOrFocusEventContext::MouseOrFocusEventContext): Deleted. (WebCore::MouseOrFocusEventContext::handleLocalEvents const): Deleted. (WebCore::MouseOrFocusEventContext::isMouseOrFocusEventContext const): Deleted. (WebCore::TouchEventContext::TouchEventContext): Deleted. (WebCore::TouchEventContext::handleLocalEvents const): Deleted. (WebCore::TouchEventContext::isTouchEventContext const): Deleted. (WebCore::TouchEventContext::checkReachability const): Deleted. Merged into handleLocalEvents. * dom/EventContext.h: (WebCore::EventContext::isMouseOrFocusEventContext const): Now simply checks m_type. (WebCore::EventContext::isTouchEventContext const): Ditto. (WebCore::EventContext::isWindowContext const): Ditto. (WebCore::EventContext::relatedTarget const): Moved from MouseOrFocusEventContext. (WebCore::EventContext::setRelatedTarget): Ditto. (WebCore::EventContext::touchList): Moved from TouchEventContext. (WebCore::m_contextNodeIsFormElement): Added. Caching this state here instead of checking it at every event context during dispatching in EventContext::handleLocalEvents seems to be important to get a speed up in Intel processors. Apple silicons don't seem to be affected by this. (WebCore::m_type): Added. (WebCore::MouseOrFocusEventContext): Deleted. (WebCore::MouseOrFocusEventContext::relatedTarget const): Deleted. (WebCore::TouchEventContext): Deleted. (WebCore::EventContext::EventContext): Moved from cpp file to be inlined here. (WebCore::EventContext::isUnreachableNode const): Moved into cpp as this is only used for asserting shadow DOM related conditions. (WebCore::EventContext::touchList): Renamed from TouchEventContext::touchList. (isType): Deleted. * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): Deleted the variant that takes a vector of elements since it's not used anywhere. * dom/EventDispatcher.h: * dom/EventPath.cpp: (WebCore::WindowEventContext): Deleted. (WebCore::EventPath::EventPath): Avoid calling setRelatedTarget if related target is not a node or the path is empty. These were early return conditions in setRelatedTarget before this patch. (WebCore::EventPath::buildPath): Always create EventContext. Dramatically simplifies the code. (WebCore::EventPath::setRelatedTarget): Moved the early exit to EventPath::EventPath. (WebCore::EventPath::retargetTouch): (WebCore::EventPath::retargetTouchList): (WebCore::EventPath::retargetTouchLists): (WebCore::EventPath::EventPath): Deleted the variant which takes a vector of elements as it's not used anywhere. * dom/EventPath.h: (WebCore::EventPath::contextAt const): (WebCore::EventPath::contextAt): (WebCore::EventPath::m_path): Now allocates EventContext in place. The size of the inline buffer has been reduced to 16 entries for EventContext from 32 entries for std::unique_ptr<EventContext> since the former is considerably larger than the latter. * dom/Node.cpp: (WebCore::Node::handleLocalEvents): Deleted. Merged into EventContext::handleLocalEvents. * dom/Node.h: * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::handleLocalEvents): Ditto. * html/HTMLFormElement.h: 2021-02-25 Russell Epstein <repstein@apple.com> Cherry-pick r273438. rdar://problem/74753272 Regression(r268700) postMessage changes prototype of basic types https://bugs.webkit.org/show_bug.cgi?id=222228 <rdar://problem/74612853> Reviewed by Geoffrey Garen. Source/WebCore: r268700 updated ScriptExecutionContext::globalObject() to call: `WebCore::globalObject(mainThreadNormalWorld(), downcast<Document>(*this).page())` instead of `frame ? frame->script().globalObject(mainThreadNormalWorld()) : nullptr` This was not right for subframes because globalObject() gets the globalObject from the page's main frame instead of the document's frame. This patch gets rid of the error-prone WebCore::globalObject() taking in a Page* and replaces it with one taking in a Frame* to avoid such issues in the future. Test: fast/dom/Window/postMessage-Object-prototype.html * bindings/js/ScriptState.cpp: (WebCore::globalObject): * bindings/js/ScriptState.h: * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::globalObject): * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::addSelfToGlobalObjectInWorld): (WebCore::InspectorFrontendHost::showContextMenu): LayoutTests: Add layout test coverage. * fast/dom/Window/postMessage-Object-prototype-expected.txt: Added. * fast/dom/Window/postMessage-Object-prototype.html: Added. * fast/dom/Window/resources/postMessage-Object-prototype-frame.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273438 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-24 Chris Dumez <cdumez@apple.com> Regression(r268700) postMessage changes prototype of basic types https://bugs.webkit.org/show_bug.cgi?id=222228 <rdar://problem/74612853> Reviewed by Geoffrey Garen. r268700 updated ScriptExecutionContext::globalObject() to call: `WebCore::globalObject(mainThreadNormalWorld(), downcast<Document>(*this).page())` instead of `frame ? frame->script().globalObject(mainThreadNormalWorld()) : nullptr` This was not right for subframes because globalObject() gets the globalObject from the page's main frame instead of the document's frame. This patch gets rid of the error-prone WebCore::globalObject() taking in a Page* and replaces it with one taking in a Frame* to avoid such issues in the future. Test: fast/dom/Window/postMessage-Object-prototype.html * bindings/js/ScriptState.cpp: (WebCore::globalObject): * bindings/js/ScriptState.h: * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::globalObject): * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::addSelfToGlobalObjectInWorld): (WebCore::InspectorFrontendHost::showContextMenu): 2021-02-25 Russell Epstein <repstein@apple.com> Cherry-pick r273415. rdar://problem/74763807 Move PostResolutionCallbackDisabler to resolveComputedStyle https://bugs.webkit.org/show_bug.cgi?id=222350 Reviewed by Ryosuke Niwa. It can be constructed and deleted repeatedly in styleForElementIgnoringPendingStylesheets when resolveComputedStyle calls it in a loop. * dom/Document.cpp: (WebCore::Document::styleForElementIgnoringPendingStylesheets): * dom/Element.cpp: (WebCore::Element::resolveComputedStyle): (WebCore::Element::resolvePseudoElementStyle): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273415 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-24 Antti Koivisto <antti@apple.com> Move PostResolutionCallbackDisabler to resolveComputedStyle https://bugs.webkit.org/show_bug.cgi?id=222350 Reviewed by Ryosuke Niwa. It can be constructed and deleted repeatedly in styleForElementIgnoringPendingStylesheets when resolveComputedStyle calls it in a loop. * dom/Document.cpp: (WebCore::Document::styleForElementIgnoringPendingStylesheets): * dom/Element.cpp: (WebCore::Element::resolveComputedStyle): (WebCore::Element::resolvePseudoElementStyle): 2021-02-25 Russell Epstein <repstein@apple.com> Cherry-pick r273385. rdar://problem/74753323 Runtime-disabled CSS features still appear enabled via CSS.supports() https://bugs.webkit.org/show_bug.cgi?id=222280 rdar://74595641 Reviewed by Sam Weinig. Source/WebCore: When parsing CSS.supports() for a runtime-disabled property, we'd successfully parse a CSS-wide keyword like "inherit" and report that the property is supported. We need to explicitly check for runtime-disabled properties. Tests: css3/color-filters/color-filter-exposed-if-disabled.html fast/css/scroll-behavior-exposed-if-disabled.html * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::isPropertyRuntimeDisabled const): (WebCore::CSSParserImpl::consumeDeclaration): * css/parser/CSSParserImpl.h: LayoutTests: * css3/color-filters/color-filter-exposed-if-disabled-expected.txt: Added. Fails tracked in webkit.org/b/217626 * css3/color-filters/color-filter-exposed-if-disabled.html: Added. * fast/css/overscroll-behavior-invalidate-if-disabled-expected.txt: * fast/css/overscroll-behavior-invalidate-if-disabled.html: * fast/css/scroll-behavior-exposed-if-disabled-expected.txt: Added. * fast/css/scroll-behavior-exposed-if-disabled.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273385 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-24 Simon Fraser <simon.fraser@apple.com> Runtime-disabled CSS features still appear enabled via CSS.supports() https://bugs.webkit.org/show_bug.cgi?id=222280 rdar://74595641 Reviewed by Sam Weinig. When parsing CSS.supports() for a runtime-disabled property, we'd successfully parse a CSS-wide keyword like "inherit" and report that the property is supported. We need to explicitly check for runtime-disabled properties. Tests: css3/color-filters/color-filter-exposed-if-disabled.html fast/css/scroll-behavior-exposed-if-disabled.html * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::isPropertyRuntimeDisabled const): (WebCore::CSSParserImpl::consumeDeclaration): * css/parser/CSSParserImpl.h: 2021-02-25 Russell Epstein <repstein@apple.com> Cherry-pick r273314. rdar://problem/74753323 aspect-ratio shows in computed style when disabled https://bugs.webkit.org/show_bug.cgi?id=222286 Patch by Rob Buis <rbuis@igalia.com> on 2021-02-23 Reviewed by Simon Fraser. Source/WebCore: Make aspect-ratio invisible from style when disabled. Test: fast/css/aspect-ratio-invalidate-if-disabled.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSProperties.json: Tools: Add support for disabling aspect-ratio in wk1. * DumpRenderTree/TestOptions.cpp: (WTR::TestOptions::defaults): LayoutTests: Add test. * fast/css/aspect-ratio-invalidate-if-disabled-expected.txt: Added. * fast/css/aspect-ratio-invalidate-if-disabled.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273314 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-23 Rob Buis <rbuis@igalia.com> aspect-ratio shows in computed style when disabled https://bugs.webkit.org/show_bug.cgi?id=222286 Reviewed by Simon Fraser. Make aspect-ratio invisible from style when disabled. Test: fast/css/aspect-ratio-invalidate-if-disabled.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSProperties.json: 2021-01-25 Chris Dumez <cdumez@apple.com> Unreviewed, add missing header includes to address build issues. * Modules/webauthn/AuthenticationExtensionsClientOutputs.h: 2021-02-25 Alan Coon <alancoon@apple.com> Cherry-pick r272039. rdar://problem/74451201 [GPUP][MSE] A video element does not fire “canplaythrough” event if SourceBuffer.abort() is called https://bugs.webkit.org/show_bug.cgi?id=220964 Reviewed by Jer Noble. Source/WebCore: This patch removes `initializationSegmentIsHandledSemaphore` from both `SourceBufferParserAVFObjC` and `SourceBufferParserWebM`, and implements a media sample cache mechanism in `SourceBufferPrivateAVFObjC` to ensure that "Coded Frame Processing" steps execute after `SourceBufferPrivate` has handled the initialization segment and enabled video/audio tracks. Without the cache mechanism, some media samples following the initialization segment may be dropped when we run `SourceBufferPrivateAVFObjC` in the GPU process, and the media element won't fire "canplaythrough" event because it cannot change its ready state to a value greater than HAVE_METADATA. This patch also implements the mechanism to make sure `SourceBufferPrivateAVFObjC::appendCompleted()` runs after all media samples have gone through the "Coded Frame Processing" steps, so that the source buffer object will fire "update" and "updateend" event after the parser has completedly parsed the appended buffer. * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm: (WebCore::SourceBufferParserAVFObjC::SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::~SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::appendData): Add a parameter "CompletionHandler" to notify the caller that the parser has parsed the whole buffer. (WebCore::SourceBufferParserAVFObjC::flushPendingMediaData): (WebCore::SourceBufferParserAVFObjC::resetParserState): (WebCore::SourceBufferParserAVFObjC::invalidate): (WebCore::SourceBufferParserAVFObjC::didParseStreamDataAsAsset): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData): After `SourceBufferPrivateClient` has done the configuration with the initialization segment, we need to push the cached media samples (if any) to `SourceBufferPrivate` to run the "Coded Frame Processing" steps. And we need to call "appendCompleted()" if there is a pending callback. (WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackId): `SourceBufferPrivateAVFObjC` needs to cache the media sample if the initialization segment has not been processed by `SourceBufferPrivateClient` yet. (WebCore::SourceBufferPrivateAVFObjC::append): We need to postpone the "appendCompleted()" callback if there are cached media samples. (WebCore::SourceBufferPrivateAVFObjC::appendCompleted): (WebCore::SourceBufferPrivateAVFObjC::abort): (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer): (WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID): Deleted. * platform/graphics/cocoa/SourceBufferParser.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::SourceBufferParserWebM): (WebCore::SourceBufferParserWebM::~SourceBufferParserWebM): (WebCore::SourceBufferParserWebM::appendData): (WebCore::SourceBufferParserWebM::flushPendingMediaData): (WebCore::SourceBufferParserWebM::resetParserState): (WebCore::SourceBufferParserWebM::invalidate): (WebCore::SourceBufferParserWebM::OnClusterBegin): * platform/graphics/cocoa/SourceBufferParserWebM.h: Source/WebKit: * Shared/mac/MediaFormatReader/MediaFormatReader.cpp: (WebKit::MediaFormatReader::parseByteSource): LayoutTests: * gpu-process/TestExpectations: * media/media-source/media-source-webm-append-buffer-after-abort-expected.txt: Added. * media/media-source/media-source-webm-append-buffer-after-abort.html: Added. * platform/mac/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272039 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-28 Peng Liu <peng.liu6@apple.com> [GPUP][MSE] A video element does not fire “canplaythrough” event if SourceBuffer.abort() is called https://bugs.webkit.org/show_bug.cgi?id=220964 Reviewed by Jer Noble. This patch removes `initializationSegmentIsHandledSemaphore` from both `SourceBufferParserAVFObjC` and `SourceBufferParserWebM`, and implements a media sample cache mechanism in `SourceBufferPrivateAVFObjC` to ensure that "Coded Frame Processing" steps execute after `SourceBufferPrivate` has handled the initialization segment and enabled video/audio tracks. Without the cache mechanism, some media samples following the initialization segment may be dropped when we run `SourceBufferPrivateAVFObjC` in the GPU process, and the media element won't fire "canplaythrough" event because it cannot change its ready state to a value greater than HAVE_METADATA. This patch also implements the mechanism to make sure `SourceBufferPrivateAVFObjC::appendCompleted()` runs after all media samples have gone through the "Coded Frame Processing" steps, so that the source buffer object will fire "update" and "updateend" event after the parser has completedly parsed the appended buffer. * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm: (WebCore::SourceBufferParserAVFObjC::SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::~SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::appendData): Add a parameter "CompletionHandler" to notify the caller that the parser has parsed the whole buffer. (WebCore::SourceBufferParserAVFObjC::flushPendingMediaData): (WebCore::SourceBufferParserAVFObjC::resetParserState): (WebCore::SourceBufferParserAVFObjC::invalidate): (WebCore::SourceBufferParserAVFObjC::didParseStreamDataAsAsset): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData): After `SourceBufferPrivateClient` has done the configuration with the initialization segment, we need to push the cached media samples (if any) to `SourceBufferPrivate` to run the "Coded Frame Processing" steps. And we need to call "appendCompleted()" if there is a pending callback. (WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackId): `SourceBufferPrivateAVFObjC` needs to cache the media sample if the initialization segment has not been processed by `SourceBufferPrivateClient` yet. (WebCore::SourceBufferPrivateAVFObjC::append): We need to postpone the "appendCompleted()" callback if there are cached media samples. (WebCore::SourceBufferPrivateAVFObjC::appendCompleted): (WebCore::SourceBufferPrivateAVFObjC::abort): (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer): (WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID): Deleted. * platform/graphics/cocoa/SourceBufferParser.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::SourceBufferParserWebM): (WebCore::SourceBufferParserWebM::~SourceBufferParserWebM): (WebCore::SourceBufferParserWebM::appendData): (WebCore::SourceBufferParserWebM::flushPendingMediaData): (WebCore::SourceBufferParserWebM::resetParserState): (WebCore::SourceBufferParserWebM::invalidate): (WebCore::SourceBufferParserWebM::OnClusterBegin): * platform/graphics/cocoa/SourceBufferParserWebM.h: 2021-02-24 Russell Epstein <repstein@apple.com> Cherry-pick r272906. rdar://problem/74410175 [LFC][Integration] Pass child inline block scroll overflow to parent https://bugs.webkit.org/show_bug.cgi?id=221958 rdar://74050874 Reviewed by Zalan Bujtas. Source/WebCore: Integrated LFC fails to pass through overflow from nested inline blocks. Test: fast/overflow/inline-block-scroll-overflow.html * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::InlineContentBuilder): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const): Find the associated RenderBox and collect overflow from it. * layout/integration/LayoutIntegrationInlineContentBuilder.h: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): LayoutTests: * fast/overflow/inline-block-scroll-overflow-expected.html: Added. * fast/overflow/inline-block-scroll-overflow.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272906 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-16 Antti Koivisto <antti@apple.com> [LFC][Integration] Pass child inline block scroll overflow to parent https://bugs.webkit.org/show_bug.cgi?id=221958 rdar://74050874 Reviewed by Zalan Bujtas. Integrated LFC fails to pass through overflow from nested inline blocks. Test: fast/overflow/inline-block-scroll-overflow.html * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::InlineContentBuilder): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const): Find the associated RenderBox and collect overflow from it. * layout/integration/LayoutIntegrationInlineContentBuilder.h: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): 2021-02-24 Russell Epstein <repstein@apple.com> Cherry-pick r272977. rdar://problem/74500812 REGRESSION (r266695): Unable to scroll the menu in 北京114预约挂号 official account - WeChat https://bugs.webkit.org/show_bug.cgi?id=221948 <rdar://problem/71661277> Reviewed by Simon Fraser. r266695 caused this to regress, but it actually is a progression, because all browsers agree that this content, as it exists in the app, doesn't scroll. So, we don't want to revert the change itself, because it's a good change, but we also want to make sure that WeChat continues to work. So, we can temporarily quirk one particular element in the WeChat app, until the the content can be fixed (<rdar://problem/74377902>). Because this is a WeChat-specific quirk, it is untestable. I tested manually. * page/Quirks.cpp: (WebCore::Quirks::needsWeChatScrollingQuirk const): * page/Quirks.h: * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isWechat): * platform/cocoa/VersionChecks.h: * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272977 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-16 Myles C. Maxfield <mmaxfield@apple.com> REGRESSION (r266695): Unable to scroll the menu in 北京114预约挂号 official account - WeChat https://bugs.webkit.org/show_bug.cgi?id=221948 <rdar://problem/71661277> Reviewed by Simon Fraser. r266695 caused this to regress, but it actually is a progression, because all browsers agree that this content, as it exists in the app, doesn't scroll. So, we don't want to revert the change itself, because it's a good change, but we also want to make sure that WeChat continues to work. So, we can temporarily quirk one particular element in the WeChat app, until the the content can be fixed (<rdar://problem/74377902>). Because this is a WeChat-specific quirk, it is untestable. I tested manually. * page/Quirks.cpp: (WebCore::Quirks::needsWeChatScrollingQuirk const): * page/Quirks.h: * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isWechat): * platform/cocoa/VersionChecks.h: * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const): 2021-02-24 Russell Epstein <repstein@apple.com> Cherry-pick r272911. rdar://problem/74501076 MediaRecorder.stop() does not work correctly when recording has been paused. https://bugs.webkit.org/show_bug.cgi?id=221916 <rdar://problem/74366154> Reviewed by Eric Carlson. LayoutTests/imported/w3c: * web-platform-tests/mediacapture-record/MediaRecorder-pause-resume-expected.txt: * web-platform-tests/mediacapture-record/MediaRecorder-pause-resume.html: Source/WebCore: Proceed with stop steps in case of paused state, and not only in case of recording state. Covered by added WPT test. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::stopRecordingInternal): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272911 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-16 Youenn Fablet <youenn@apple.com> MediaRecorder.stop() does not work correctly when recording has been paused. https://bugs.webkit.org/show_bug.cgi?id=221916 <rdar://problem/74366154> Reviewed by Eric Carlson. Proceed with stop steps in case of paused state, and not only in case of recording state. Covered by added WPT test. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::stopRecordingInternal): 2021-02-24 Russell Epstein <repstein@apple.com> Cherry-pick r272544. rdar://problem/74409562 [Cocoa] Encrypted media segments should generate a parser error if no encrypted media handler is present. https://bugs.webkit.org/show_bug.cgi?id=221496 Reviewed by Eric Carlson. The WebM format reader does not support encrypted media parsing, so the parser must generate an error rather than continuing to parse encrypted media data. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::OnElementEnd): (WebCore::SourceBufferParserWebM::OnTrackEntry): * platform/graphics/cocoa/SourceBufferParserWebM.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272544 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-08 Jer Noble <jer.noble@apple.com> [Cocoa] Encrypted media segments should generate a parser error if no encrypted media handler is present. https://bugs.webkit.org/show_bug.cgi?id=221496 Reviewed by Eric Carlson. The WebM format reader does not support encrypted media parsing, so the parser must generate an error rather than continuing to parse encrypted media data. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::OnElementEnd): (WebCore::SourceBufferParserWebM::OnTrackEntry): * platform/graphics/cocoa/SourceBufferParserWebM.h: 2021-02-24 Russell Epstein <repstein@apple.com> Cherry-pick r272359. rdar://problem/74451201 [MSE] Move the call to didParseInitializationDataCallback() from the beginning of a cluster to the end of "tracks" element https://bugs.webkit.org/show_bug.cgi?id=221120 Reviewed by Daniel Bates. Source/WebCore: This patch updates the WebM parser regarding the timing to call didParseInitializationDataCallback() based on a discussion with Jer. Based on the spec, https://w3c.github.io/mse-byte-stream-format-webm/#webm-init-segments, "The user agent MUST accept and ignore any elements other than an EBML Header or a Cluster that occur before, in between, or after the Segment Information and Tracks elements." So the parser should have collected all required information of the initialization segment when it finishes parsing the "Tracks" element. Tests: media/media-source/media-source-webm.html * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::OnElementEnd): (WebCore::SourceBufferParserWebM::OnClusterBegin): LayoutTests: * media/media-source/media-source-webm-expected.txt: * media/media-source/media-source-webm.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272359 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-03 Peng Liu <peng.liu6@apple.com> [MSE] Move the call to didParseInitializationDataCallback() from the beginning of a cluster to the end of "tracks" element https://bugs.webkit.org/show_bug.cgi?id=221120 Reviewed by Daniel Bates. This patch updates the WebM parser regarding the timing to call didParseInitializationDataCallback() based on a discussion with Jer. Based on the spec, https://w3c.github.io/mse-byte-stream-format-webm/#webm-init-segments, "The user agent MUST accept and ignore any elements other than an EBML Header or a Cluster that occur before, in between, or after the Segment Information and Tracks elements." So the parser should have collected all required information of the initialization segment when it finishes parsing the "Tracks" element. Tests: media/media-source/media-source-webm.html * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::OnElementEnd): (WebCore::SourceBufferParserWebM::OnClusterBegin): 2021-02-23 Alan Coon <alancoon@apple.com> Cherry-pick r273264. rdar://problem/74622873 REGRESSION (r266695): twitch.tv: when in fullscreen, WebKit continually does 350ms layouts. Firefox and Chrome do not https://bugs.webkit.org/show_bug.cgi?id=222202 <rdar://problem/74537782> Reviewed by Simon Fraser. PerformanceTests: New performance test for nested column flexboxes with percentage heights. * Layout/nested-column-flexboxes-relative-height.html: Added. Source/WebCore: The problem was that we were doing the initial layout for the children of the flex container twice in those cases where the child inline axis was not the main axis (for example with column flex containers in horizontal writing modes). Refactored the code (specially the way we clear overriding sizes) so that we only do it once. This saves tons of layouts in pages with nested column flexboxes with relative heights. No new tests as there is no change in functionality, we're removing duplicate extra layouts. We're however adding a new performance test for column flexboxes with percentage heights. With this patch we go from 3.5 layout/s to 145 layout/s which is ~4000% better. Inspired by Blink's crrev.com/c/1614058 by <cbiesinger@chromium.org>. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild): Do not unconditionally clear overriding sizes. Also removed relayoutChildren which is now unused. Do not layout the item, that should have been done in computeInnerFlexBaseSizeForChild() before. Added ASSERTs to verify that child's intrinsic main size was cached as a consequence of the previous layout. (WebCore::RenderFlexibleBox::constructFlexItem): Do not pass relayoutChildren to computeInnerFlexBaseSizeForChild. Also no need to update it after laying out the child. * rendering/RenderFlexibleBox.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273264 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-22 Sergio Villar Senin <svillar@igalia.com> REGRESSION (r266695): twitch.tv: when in fullscreen, WebKit continually does 350ms layouts. Firefox and Chrome do not https://bugs.webkit.org/show_bug.cgi?id=222202 <rdar://problem/74537782> Reviewed by Simon Fraser. The problem was that we were doing the initial layout for the children of the flex container twice in those cases where the child inline axis was not the main axis (for example with column flex containers in horizontal writing modes). Refactored the code (specially the way we clear overriding sizes) so that we only do it once. This saves tons of layouts in pages with nested column flexboxes with relative heights. No new tests as there is no change in functionality, we're removing duplicate extra layouts. We're however adding a new performance test for column flexboxes with percentage heights. With this patch we go from 3.5 layout/s to 145 layout/s which is ~4000% better. Inspired by Blink's crrev.com/c/1614058 by <cbiesinger@chromium.org>. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild): Do not unconditionally clear overriding sizes. Also removed relayoutChildren which is now unused. Do not layout the item, that should have been done in computeInnerFlexBaseSizeForChild() before. Added ASSERTs to verify that child's intrinsic main size was cached as a consequence of the previous layout. (WebCore::RenderFlexibleBox::constructFlexItem): Do not pass relayoutChildren to computeInnerFlexBaseSizeForChild. Also no need to update it after laying out the child. * rendering/RenderFlexibleBox.h: 2021-02-23 Alan Coon <alancoon@apple.com> Cherry-pick r273220. rdar://problem/74623537 [Paint Timing] Return early from contentful paint check when no contentful pixels/characters at all https://bugs.webkit.org/show_bug.cgi?id=222245 Reviewed by Simon Fraser. Bail from recursive contenful-paint check if there are no pixels/text characters in the entire document. Covered by existing tests, an optimization only. * dom/Document.cpp: (WebCore::Document::enqueuePaintTimingEntryIfNeeded): * page/FrameView.cpp: (WebCore::FrameView::hasContenfulDescendants const): * page/FrameView.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273220 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-21 Noam Rosenthal <noam@webkit.org> [Paint Timing] Return early from contentful paint check when no contentful pixels/characters at all https://bugs.webkit.org/show_bug.cgi?id=222245 Reviewed by Simon Fraser. Bail from recursive contenful-paint check if there are no pixels/text characters in the entire document. Covered by existing tests, an optimization only. * dom/Document.cpp: (WebCore::Document::enqueuePaintTimingEntryIfNeeded): * page/FrameView.cpp: (WebCore::FrameView::hasContenfulDescendants const): * page/FrameView.h: 2021-02-23 Alan Coon <alancoon@apple.com> Cherry-pick r273158. rdar://problem/74623451 Allow to use BigInt as key identifier https://bugs.webkit.org/show_bug.cgi?id=222165 Reviewed by Darin Adler. Source/WebCore: Allow to pass a BigInt as key id so as to use all of SFrame key ID 8 bytes. A RangeError is thrown if BigInt is more than 64 bits. Update the implementation to use a Vector instead of a map to keep the keys. This allows to also use 0 and 2^64-1 values that HashMap reserves for its personal use. Covered by updated test. * Modules/mediastream/RTCRtpSFrameTransform.idl: * Modules/mediastream/RTCRtpSFrameTransformer.cpp: (WebCore::RTCRtpSFrameTransformer::setEncryptionKey): (WebCore::RTCRtpSFrameTransformer::updateEncryptionKey): (WebCore::RTCRtpSFrameTransformer::decryptFrame): * Modules/mediastream/RTCRtpSFrameTransformer.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSRTCRtpSFrameTransformCustom.cpp: Added. (WebCore::JSRTCRtpSFrameTransform::setEncryptionKey): LayoutTests: * webrtc/sframe-keys-expected.txt: * webrtc/sframe-keys.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273158 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-19 Youenn Fablet <youenn@apple.com> Allow to use BigInt as key identifier https://bugs.webkit.org/show_bug.cgi?id=222165 Reviewed by Darin Adler. Allow to pass a BigInt as key id so as to use all of SFrame key ID 8 bytes. A RangeError is thrown if BigInt is more than 64 bits. Update the implementation to use a Vector instead of a map to keep the keys. This allows to also use 0 and 2^64-1 values that HashMap reserves for its personal use. Covered by updated test. * Modules/mediastream/RTCRtpSFrameTransform.idl: * Modules/mediastream/RTCRtpSFrameTransformer.cpp: (WebCore::RTCRtpSFrameTransformer::setEncryptionKey): (WebCore::RTCRtpSFrameTransformer::updateEncryptionKey): (WebCore::RTCRtpSFrameTransformer::decryptFrame): * Modules/mediastream/RTCRtpSFrameTransformer.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSRTCRtpSFrameTransformCustom.cpp: Added. (WebCore::JSRTCRtpSFrameTransform::setEncryptionKey): 2021-02-23 Alan Coon <alancoon@apple.com> Cherry-pick r273129. rdar://problem/74623422 Scrolling on https://www.apple.com/ipad-air/ can jitter on certain sections https://bugs.webkit.org/show_bug.cgi?id=222136 rdar://71881767 Reviewed by Zalan Bujtas. Source/WebCore: On macOS computers with 16MB of memory, https://www.apple.com/ipad-air/ can trigger the "conservative" compositing mode where RenderLayerCompositor tries to reduce the number of composited layers. On this particular page, a "will-change: transform" element with an overflow:hidden ancestor triggers some bad compositing bounds geometry computation (webkit.org/b/222092, webkit.org/b/222124) which has the end result of changing the composited bounds of the "position:sticky" layer on every scroll. This results in layer contents temporarily appearing stretched or in the wrong place (webkit.org/b/222132). For now, do a conservative fix to avoid this problem, which is to continue to allow "will-change: transform" to trigger compositing on macOS in conservative mode. This actually reduces memory use on this page, because webkit.org/b/222092 was triggering excessively large backing store. Tested by compositing/layer-creation/compositing-policy.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const): LayoutTests: * platform/mac/compositing/layer-creation/compositing-policy-expected.txt: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273129 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-18 Simon Fraser <simon.fraser@apple.com> Scrolling on https://www.apple.com/ipad-air/ can jitter on certain sections https://bugs.webkit.org/show_bug.cgi?id=222136 rdar://71881767 Reviewed by Zalan Bujtas. On macOS computers with 16MB of memory, https://www.apple.com/ipad-air/ can trigger the "conservative" compositing mode where RenderLayerCompositor tries to reduce the number of composited layers. On this particular page, a "will-change: transform" element with an overflow:hidden ancestor triggers some bad compositing bounds geometry computation (webkit.org/b/222092, webkit.org/b/222124) which has the end result of changing the composited bounds of the "position:sticky" layer on every scroll. This results in layer contents temporarily appearing stretched or in the wrong place (webkit.org/b/222132). For now, do a conservative fix to avoid this problem, which is to continue to allow "will-change: transform" to trigger compositing on macOS in conservative mode. This actually reduces memory use on this page, because webkit.org/b/222092 was triggering excessively large backing store. Tested by compositing/layer-creation/compositing-policy.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const): 2021-02-23 Alan Coon <alancoon@apple.com> Cherry-pick r272358. rdar://problem/74622890 Avoid an ancestor walk in HTMLFormControlElement::computeWillValidate() https://bugs.webkit.org/show_bug.cgi?id=221357 Reviewed by Ryosuke Niwa. HTMLFormControlElement::computeWillValidate() does an ancestor DOM walk to look for enclosing data list elements, but these are fairly uncommon so we can avoid this work if we know the Document has none. * dom/Document.h: (WebCore::Document::hasDataListElements const): (WebCore::Document::incrementDataListElementCount): (WebCore::Document::decrementDataListElementCount): * dom/Element.cpp: (WebCore::Element::removedFromAncestor): Avoid fetching the page twice. * html/HTMLDataListElement.cpp: (WebCore::HTMLDataListElement::HTMLDataListElement): (WebCore::HTMLDataListElement::~HTMLDataListElement): (WebCore::HTMLDataListElement::didMoveToNewDocument): * html/HTMLDataListElement.h: * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::computeWillValidate const): * page/PointerLockController.cpp: (WebCore::PointerLockController::elementWasRemoved): Renamed for consistency. (WebCore::PointerLockController::elementRemoved): Deleted. * page/PointerLockController.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272358 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-03 Simon Fraser <simon.fraser@apple.com> Avoid an ancestor walk in HTMLFormControlElement::computeWillValidate() https://bugs.webkit.org/show_bug.cgi?id=221357 Reviewed by Ryosuke Niwa. HTMLFormControlElement::computeWillValidate() does an ancestor DOM walk to look for enclosing data list elements, but these are fairly uncommon so we can avoid this work if we know the Document has none. * dom/Document.h: (WebCore::Document::hasDataListElements const): (WebCore::Document::incrementDataListElementCount): (WebCore::Document::decrementDataListElementCount): * dom/Element.cpp: (WebCore::Element::removedFromAncestor): Avoid fetching the page twice. * html/HTMLDataListElement.cpp: (WebCore::HTMLDataListElement::HTMLDataListElement): (WebCore::HTMLDataListElement::~HTMLDataListElement): (WebCore::HTMLDataListElement::didMoveToNewDocument): * html/HTMLDataListElement.h: * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::computeWillValidate const): * page/PointerLockController.cpp: (WebCore::PointerLockController::elementWasRemoved): Renamed for consistency. (WebCore::PointerLockController::elementRemoved): Deleted. * page/PointerLockController.h: 2021-02-23 Alan Coon <alancoon@apple.com> Cherry-pick r272354. rdar://problem/74622963 Avoid frequent calls to HTMLFormControlElement::updateValidity() when constructing form control elements https://bugs.webkit.org/show_bug.cgi?id=221320 Reviewed by Geoffrey Garen. HTMLFormControlElement::updateValidity() can get called multiple times inside HTMLInputElement::parserDidSetAttributes(), so add a simple delaying scope so that validity is only updated once at the end. * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::endDelayingUpdateValidity): (WebCore::HTMLFormControlElement::computeWillValidate const): (WebCore::HTMLFormControlElement::updateValidity): * html/HTMLFormControlElement.h: (WebCore::HTMLFormControlElement::startDelayingUpdateValidity): (WebCore::DelayedUpdateValidityScope::DelayedUpdateValidityScope): (WebCore::DelayedUpdateValidityScope::~DelayedUpdateValidityScope): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parserDidSetAttributes): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272354 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-03 Simon Fraser <simon.fraser@apple.com> Avoid frequent calls to HTMLFormControlElement::updateValidity() when constructing form control elements https://bugs.webkit.org/show_bug.cgi?id=221320 Reviewed by Geoffrey Garen. HTMLFormControlElement::updateValidity() can get called multiple times inside HTMLInputElement::parserDidSetAttributes(), so add a simple delaying scope so that validity is only updated once at the end. * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::endDelayingUpdateValidity): (WebCore::HTMLFormControlElement::computeWillValidate const): (WebCore::HTMLFormControlElement::updateValidity): * html/HTMLFormControlElement.h: (WebCore::HTMLFormControlElement::startDelayingUpdateValidity): (WebCore::DelayedUpdateValidityScope::DelayedUpdateValidityScope): (WebCore::DelayedUpdateValidityScope::~DelayedUpdateValidityScope): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parserDidSetAttributes): 2021-02-17 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272626. rdar://problem/74410222 Descendants of row and column headers should expose the aria-sort attribute. https://bugs.webkit.org/show_bug.cgi?id=221590 Reviewed by Chris Fleizach. Source/WebCore: Tests: accessibility/aria-sort.html accessibility/ios-simulator/aria-sort-ios.html Walk up the accessibility hierarchy to check for an inherited aria-sort attribute present in a row or column header ancestor. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::sortDirection const): LayoutTests: Expanded this test to include the case where the header contains a child element that must also expose the aria-sort attribute inherited from its parent. * accessibility/aria-sort-expected.txt: * accessibility/aria-sort.html: * accessibility/ios-simulator/aria-sort-ios-expected.txt: * accessibility/ios-simulator/aria-sort-ios.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272626 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-09 Andres Gonzalez <andresg_22@apple.com> Descendants of row and column headers should expose the aria-sort attribute. https://bugs.webkit.org/show_bug.cgi?id=221590 Reviewed by Chris Fleizach. Tests: accessibility/aria-sort.html accessibility/ios-simulator/aria-sort-ios.html Walk up the accessibility hierarchy to check for an inherited aria-sort attribute present in a row or column header ancestor. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::sortDirection const): 2021-02-17 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272165. rdar://problem/74032536 Use user media permission prompt for speech recognition https://bugs.webkit.org/show_bug.cgi?id=221082 rdar://problem/73372499 Patch by Sihui Liu <sihui_liu@appe.com> on 2021-02-01 Reviewed by Youenn Fablet. Source/WebCore: Add frame identifier to SpeechRecognitionRequest as it is needed for checking user media permission. Updated existing tests for changed behavior. * Modules/speech/SpeechRecognition.cpp: (WebCore::SpeechRecognition::startRecognition): * Modules/speech/SpeechRecognitionConnection.h: * Modules/speech/SpeechRecognitionRequest.h: (WebCore::SpeechRecognitionRequest::frameIdentifier const): * Modules/speech/SpeechRecognitionRequestInfo.h: (WebCore::SpeechRecognitionRequestInfo::encode const): (WebCore::SpeechRecognitionRequestInfo::decode): * page/DummySpeechRecognitionProvider.h: Source/WebKit: Make SpeechRecognitionPermissionManager ask UserMediaPermissionRequestManagerProxy for user permission on microphone. * UIProcess/SpeechRecognitionPermissionManager.cpp: (WebKit::SpeechRecognitionPermissionManager::request): (WebKit::SpeechRecognitionPermissionManager::startProcessingRequest): (WebKit::SpeechRecognitionPermissionManager::requestUserPermission): * UIProcess/SpeechRecognitionPermissionManager.h: * UIProcess/SpeechRecognitionPermissionRequest.h: (WebKit::SpeechRecognitionPermissionRequest::create): (WebKit::SpeechRecognitionPermissionRequest::frameIdentifier const): (WebKit::SpeechRecognitionPermissionRequest::SpeechRecognitionPermissionRequest): * UIProcess/SpeechRecognitionServer.cpp: (WebKit::SpeechRecognitionServer::start): (WebKit::SpeechRecognitionServer::requestPermissionForRequest): * UIProcess/SpeechRecognitionServer.h: * UIProcess/SpeechRecognitionServer.messages.in: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest): (WebKit::UserMediaPermissionRequestManagerProxy::grantRequest): (WebKit::UserMediaPermissionRequestManagerProxy::checkUserMediaPermissionForSpeechRecognition): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::create): (WebKit::UserMediaPermissionRequestProxy::decisionCompletionHandler): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestSpeechRecognitionPermission): (WebKit::WebPageProxy::requestUserMediaPermissionForSpeechRecognition): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::createSpeechRecognitionServer): * WebProcess/WebCoreSupport/WebSpeechRecognitionConnection.cpp: (WebKit::WebSpeechRecognitionConnection::start): * WebProcess/WebCoreSupport/WebSpeechRecognitionConnection.h: Tools: * TestWebKitAPI/Tests/WebKitCocoa/SpeechRecognition.mm: (-[SpeechRecognitionUIDelegate _webView:requestMediaCaptureAuthorization:decisionHandler:]): LayoutTests: * fast/speechrecognition/permission-error.html: * fast/speechrecognition/start-recognition-in-removed-iframe-expected.txt: * fast/speechrecognition/start-recognition-in-removed-iframe.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272165 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-01 Sihui Liu <sihui_liu@appe.com> Use user media permission prompt for speech recognition https://bugs.webkit.org/show_bug.cgi?id=221082 rdar://problem/73372499 Reviewed by Youenn Fablet. Add frame identifier to SpeechRecognitionRequest as it is needed for checking user media permission. Updated existing tests for changed behavior. * Modules/speech/SpeechRecognition.cpp: (WebCore::SpeechRecognition::startRecognition): * Modules/speech/SpeechRecognitionConnection.h: * Modules/speech/SpeechRecognitionRequest.h: (WebCore::SpeechRecognitionRequest::frameIdentifier const): * Modules/speech/SpeechRecognitionRequestInfo.h: (WebCore::SpeechRecognitionRequestInfo::encode const): (WebCore::SpeechRecognitionRequestInfo::decode): * page/DummySpeechRecognitionProvider.h: 2021-02-17 Ruben Turcios <rubent_22@apple.com> Cherry-pick r271636. rdar://problem/74452635 Update media state for active speech recognition as it uses audio capture https://bugs.webkit.org/show_bug.cgi?id=220667 Patch by Sihui Liu <sihui_liu@appe.com> on 2021-01-19 Reviewed by Youenn Fablet. Source/WebCore: To make sure the media capture state is correctly sent to client. API test: WebKit2.SpeechRecognitionMediaCaptureStateChange * Modules/speech/SpeechRecognition.cpp: (WebCore::SpeechRecognition::startRecognition): (WebCore::SpeechRecognition::stop): (WebCore::SpeechRecognition::didStartCapturingAudio): (WebCore::SpeechRecognition::didStopCapturingAudio): * Modules/speech/SpeechRecognition.h: * Modules/speech/SpeechRecognitionConnection.h: * dom/Document.cpp: (WebCore::Document::setActiveSpeechRecognition): (WebCore::Document::updateIsPlayingMedia): * dom/Document.h: * page/DummySpeechRecognitionProvider.h: Source/WebKit: * WebProcess/WebCoreSupport/WebSpeechRecognitionConnection.cpp: (WebKit::WebSpeechRecognitionConnection::unregisterClient): * WebProcess/WebCoreSupport/WebSpeechRecognitionConnection.h: Tools: * TestWebKitAPI/Tests/WebKitCocoa/SpeechRecognition.mm: (-[SpeechRecognitionUIDelegate _webView:mediaCaptureStateDidChange:]): (TestWebKitAPI::TEST): (-[SpeechRecognitionPermissionUIDelegate _webView:requestSpeechRecognitionPermissionForOrigin:decisionHandler:]): Deleted. (-[SpeechRecognitionPermissionUIDelegate _webView:requestMediaCaptureAuthorization:decisionHandler:]): Deleted. (-[SpeechRecognitionPermissionUIDelegate _webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:]): Deleted. (-[SpeechRecognitionPermissionUIDelegate webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]): Deleted. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271636 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-19 Sihui Liu <sihui_liu@appe.com> Update media state for active speech recognition as it uses audio capture https://bugs.webkit.org/show_bug.cgi?id=220667 Reviewed by Youenn Fablet. To make sure the media capture state is correctly sent to client. API test: WebKit2.SpeechRecognitionMediaCaptureStateChange * Modules/speech/SpeechRecognition.cpp: (WebCore::SpeechRecognition::startRecognition): (WebCore::SpeechRecognition::stop): (WebCore::SpeechRecognition::didStartCapturingAudio): (WebCore::SpeechRecognition::didStopCapturingAudio): * Modules/speech/SpeechRecognition.h: * Modules/speech/SpeechRecognitionConnection.h: * dom/Document.cpp: (WebCore::Document::setActiveSpeechRecognition): (WebCore::Document::updateIsPlayingMedia): * dom/Document.h: * page/DummySpeechRecognitionProvider.h: 2021-02-17 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272490. rdar://problem/74409784 Add support for aria-sort change notifications. https://bugs.webkit.org/show_bug.cgi?id=221495 Reviewed by Chris Fleizach. Source/WebCore: Test: accessibility/aria-sort-changed-notification.html This patch adds support for aria-sort changes. Some code cleanup by using the notificationPlatformName helper function. * accessibility/AXLogger.cpp: (WebCore::operator<<): Logging of the new notification. * accessibility/AXObjectCache.cpp: Handles the aria-sort change notification. Updates the isolated tree. (WebCore::AXObjectCache::handleAttributeChange): (WebCore::AXObjectCache::updateIsolatedTree): * accessibility/AXObjectCache.h: * accessibility/ios/AXObjectCacheIOS.mm: (WebCore::AXObjectCache::notificationPlatformName): Helper to map AXCore notifications to platform notifications. (WebCore::AXObjectCache::postPlatformNotification): Handles the AXSortDirectionChanged notification. Some code cleanup using the notificationPlatformName helper. * accessibility/ios/WebAccessibilityObjectWrapperIOS.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper postNotification:]): To be overridden by system AX bundles. (-[WebAccessibilityObjectWrapper accessibilitySortDirection]): Only ascending and descending sort directions are relevant for clients. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateNodeProperty): Updates the SortDirection property. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postPlatformNotification): Handles the AXSortDirectionChanged notification. Tools: * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: (WTR::AccessibilityUIElement::sortDirection const): * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::AccessibilityUIElement::sortDirection const): * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: (WTR::AccessibilityUIElement::currentStateValue const): (WTR::AccessibilityUIElement::sortDirection const): LayoutTests: * accessibility/aria-sort-changed-notification-expected.txt: Added. * accessibility/aria-sort-changed-notification.html: Added. * accessibility/aria-sort-expected.txt: * accessibility/aria-sort.html: Calls sortDirection property on the JS accessible element instead of retrieving the aria-sort attribute. This matches more accurately what an actual client would do. Changed the expected file accordingly. * accessibility/ios-simulator/aria-sort-ios-expected.txt: * accessibility/ios-simulator/aria-sort-ios.html: Same as in the Mac test above. * platform/ios/TestExpectations: Added the new test to be run on the ios-simulator. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272490 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-08 Andres Gonzalez <andresg_22@apple.com> Add support for aria-sort change notifications. https://bugs.webkit.org/show_bug.cgi?id=221495 Reviewed by Chris Fleizach. Test: accessibility/aria-sort-changed-notification.html This patch adds support for aria-sort changes. Some code cleanup by using the notificationPlatformName helper function. * accessibility/AXLogger.cpp: (WebCore::operator<<): Logging of the new notification. * accessibility/AXObjectCache.cpp: Handles the aria-sort change notification. Updates the isolated tree. (WebCore::AXObjectCache::handleAttributeChange): (WebCore::AXObjectCache::updateIsolatedTree): * accessibility/AXObjectCache.h: * accessibility/ios/AXObjectCacheIOS.mm: (WebCore::AXObjectCache::notificationPlatformName): Helper to map AXCore notifications to platform notifications. (WebCore::AXObjectCache::postPlatformNotification): Handles the AXSortDirectionChanged notification. Some code cleanup using the notificationPlatformName helper. * accessibility/ios/WebAccessibilityObjectWrapperIOS.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper postNotification:]): To be overridden by system AX bundles. (-[WebAccessibilityObjectWrapper accessibilitySortDirection]): Only ascending and descending sort directions are relevant for clients. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateNodeProperty): Updates the SortDirection property. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postPlatformNotification): Handles the AXSortDirectionChanged notification. 2021-02-17 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272067. rdar://problem/74444347 Support for aria-current state changed notifications. https://bugs.webkit.org/show_bug.cgi?id=221074 Reviewed by Chris Fleizach. Source/WebCore: Test: accessibility/aria-current-state-changed-notification.html Added handling of the AXCurrentStateChanged notification for Mac and iOS ports. This notification is fired when the aria-current attribute changes. Handling of this notification is required to properly update the accessibility properties of the target object and convey them to assistive technology clients. * accessibility/AXLogger.cpp: (WebCore::operator<<): Renamed notification anumerand. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAttributeChange): * accessibility/AXObjectCache.h: * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/ios/AXObjectCacheIOS.mm: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/ios/WebAccessibilityObjectWrapperIOS.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityDOMIdentifier]): (-[WebAccessibilityObjectWrapper postCurrentStateChangedNotification]): (-[WebAccessibilityObjectWrapper accessibilityCurrentState]): (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]): Renamed to accessibilityCurrentState. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postPlatformNotification): Tools: Added AccessibilityUIElement::domIdentifier and currentStateValue used in LayoutTests/accessibility/aria-current-state-changed-notification.html. * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: (WTR::AccessibilityUIElement::domIdentifier const): Non-Cocoa implementation. (WTR::AccessibilityUIElement::currentStateValue const): Non-Cocoa implementation. * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::AccessibilityUIElement::domIdentifier const): (WTR::AccessibilityUIElement::stringAttributeValue): (WTR::AccessibilityUIElement::currentStateValue const): * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: (WTR::AccessibilityUIElement::domIdentifier const): (WTR::AccessibilityUIElement::currentStateValue const): LayoutTests: * accessibility/aria-current-state-changed-notification-expected.txt: Added. * accessibility/aria-current-state-changed-notification.html: Added. * accessibility/aria-current.html: Use AccessibilityUIElement::currentStateValue for consistency and to match closely how actual clients will invoke this functionality. * platform/gtk/TestExpectations: * platform/ios-wk1/TestExpectations: * platform/ios/TestExpectations: * platform/mac-wk1/TestExpectations: * platform/win/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272067 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-29 Andres Gonzalez <andresg_22@apple.com> Support for aria-current state changed notifications. https://bugs.webkit.org/show_bug.cgi?id=221074 Reviewed by Chris Fleizach. Test: accessibility/aria-current-state-changed-notification.html Added handling of the AXCurrentStateChanged notification for Mac and iOS ports. This notification is fired when the aria-current attribute changes. Handling of this notification is required to properly update the accessibility properties of the target object and convey them to assistive technology clients. * accessibility/AXLogger.cpp: (WebCore::operator<<): Renamed notification anumerand. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAttributeChange): * accessibility/AXObjectCache.h: * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/ios/AXObjectCacheIOS.mm: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/ios/WebAccessibilityObjectWrapperIOS.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityDOMIdentifier]): (-[WebAccessibilityObjectWrapper postCurrentStateChangedNotification]): (-[WebAccessibilityObjectWrapper accessibilityCurrentState]): (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]): Renamed to accessibilityCurrentState. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postPlatformNotification): 2021-02-17 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272755. rdar://problem/74409916 Unreviewed, reverting r270578. https://bugs.webkit.org/show_bug.cgi?id=221110 Caused incorrect image layout inside a flexbox container. LayoutTests/imported/w3c: * web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-row-013-expected.txt: * web-platform-tests/css/css-flexbox/image-as-flexitem-size-003-expected.txt: * web-platform-tests/css/css-flexbox/image-as-flexitem-size-003v-expected.txt: * web-platform-tests/css/css-flexbox/image-as-flexitem-size-004-expected.txt: * web-platform-tests/css/css-flexbox/image-as-flexitem-size-004v-expected.txt: Source/WebCore: * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing const): (WebCore::RenderFlexibleBox::childCrossSizeIsDefinite const): LayoutTests: * TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272755 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-11 Said Abou-Hallawa <said@apple.com> Unreviewed, reverting r270578. https://bugs.webkit.org/show_bug.cgi?id=221110 Caused incorrect image layout inside a flexbox container. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing const): (WebCore::RenderFlexibleBox::childCrossSizeIsDefinite const): 2021-02-23 Alan Coon <alancoon@apple.com> Cherry-pick r272678. rdar://problem/74410058 WebCore::createBusFromInMemoryAudioFile() may crash under ExtAudioFileRead() https://bugs.webkit.org/show_bug.cgi?id=221642 <rdar://72789841> Reviewed by Geoffrey Garen. The crash seems to indicate we are passing an AudioBufferList to ExtAudioFileRead() that contains a null buffer. It is not obvious how this is happening but I have made the following changes: 1. createAudioBufferList() / destroyAudioListBuffer() implementation is now shared on both macOS and iOS. The implementation now uses fastCalloc and returns null in case of failure to allocate. 2. createAudioBufferList() was renamed to tryCreateAudioBufferList() to make it clear it can return null. All call sites now properly deal with tryCreateAudioBufferList() potentially return null 3. Add a new validateAudioBufferList() function which makes sure that the AudioBufferList we are about to pass to ExtAudioFileRead() does not contain any null buffer. In case of validation failure, we log an error, generate a simulated crash log and early return gracefully instead of crashing later on. 4. Added more assertions to help catch bugs. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/cocoa/AudioFileReaderCocoa.cpp: Added. (WebCore::tryCreateAudioBufferList): (WebCore::destroyAudioBufferList): (WebCore::validateAudioBufferList): * platform/audio/cocoa/AudioFileReaderCocoa.h: Added. * platform/audio/ios/AudioFileReaderIOS.cpp: (WebCore::AudioFileReader::createBus): (WebCore::createAudioBufferList): Deleted. (WebCore::destroyAudioBufferList): Deleted. * platform/audio/mac/AudioFileReaderMac.cpp: (WebCore::AudioFileReader::createBus): (WebCore::createAudioBufferList): Deleted. (WebCore::destroyAudioBufferList): Deleted. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272678 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-10 Chris Dumez <cdumez@apple.com> WebCore::createBusFromInMemoryAudioFile() may crash under ExtAudioFileRead() https://bugs.webkit.org/show_bug.cgi?id=221642 <rdar://72789841> Reviewed by Geoffrey Garen. The crash seems to indicate we are passing an AudioBufferList to ExtAudioFileRead() that contains a null buffer. It is not obvious how this is happening but I have made the following changes: 1. createAudioBufferList() / destroyAudioListBuffer() implementation is now shared on both macOS and iOS. The implementation now uses fastCalloc and returns null in case of failure to allocate. 2. createAudioBufferList() was renamed to tryCreateAudioBufferList() to make it clear it can return null. All call sites now properly deal with tryCreateAudioBufferList() potentially return null 3. Add a new validateAudioBufferList() function which makes sure that the AudioBufferList we are about to pass to ExtAudioFileRead() does not contain any null buffer. In case of validation failure, we log an error, generate a simulated crash log and early return gracefully instead of crashing later on. 4. Added more assertions to help catch bugs. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/cocoa/AudioFileReaderCocoa.cpp: Added. (WebCore::tryCreateAudioBufferList): (WebCore::destroyAudioBufferList): (WebCore::validateAudioBufferList): * platform/audio/cocoa/AudioFileReaderCocoa.h: Added. * platform/audio/ios/AudioFileReaderIOS.cpp: (WebCore::AudioFileReader::createBus): (WebCore::createAudioBufferList): Deleted. (WebCore::destroyAudioBufferList): Deleted. * platform/audio/mac/AudioFileReaderMac.cpp: (WebCore::AudioFileReader::createBus): (WebCore::createAudioBufferList): Deleted. (WebCore::destroyAudioBufferList): Deleted. 2021-02-17 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272504. rdar://problem/74409474 NetworkRTCSocketCocoa extractDataMessages should not read too much data https://bugs.webkit.org/show_bug.cgi?id=221544 Reviewed by Eric Carlson. Source/WebCore: Move STUN/TURN message parsing to its own file routine so that we can add API test. Code is taken from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocketCocoa.mm. Fix the test verifying we can actually read a message given its expected length. Covered by API test. * Headers.cmake: * Modules/mediastream/STUNMessageParsing.cpp: Added. (WebCore::isStunMessage): (WebCore::getSTUNOrTURNMessageLengths): (WebCore::extractSTUNOrTURNMessages): (WebCore::extractDataMessages): (WebCore::extractMessages): * Modules/mediastream/STUNMessageParsing.h: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Source/WebKit: * NetworkProcess/webrtc/NetworkRTCSocketCocoa.mm: Make use of WebCore method. Tools: * TestWebKitAPI/Tests/WebCore/STUNMessageParsingTest.cpp: Added. (TestWebKitAPI::TEST): * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272504 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-08 Youenn Fablet <youenn@apple.com> NetworkRTCSocketCocoa extractDataMessages should not read too much data https://bugs.webkit.org/show_bug.cgi?id=221544 Reviewed by Eric Carlson. Move STUN/TURN message parsing to its own file routine so that we can add API test. Code is taken from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocketCocoa.mm. Fix the test verifying we can actually read a message given its expected length. Covered by API test. * Headers.cmake: * Modules/mediastream/STUNMessageParsing.cpp: Added. (WebCore::isStunMessage): (WebCore::getSTUNOrTURNMessageLengths): (WebCore::extractSTUNOrTURNMessages): (WebCore::extractDataMessages): (WebCore::extractMessages): * Modules/mediastream/STUNMessageParsing.h: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2021-02-19 Alan Coon <alancoon@apple.com> Cherry-pick r273069. rdar://problem/74500798 Backgrounding a page that is playing and capturing audio will stop audio playing https://bugs.webkit.org/show_bug.cgi?id=222032 <rdar://problem/74389497> Reviewed by Eric Carlson. When a page gets backgrounded while capturing, it will continue doing capture, as can be seen with the red status bar. In that case, for video conferencing, it makes sense that audio being played continues playing, at least for MediaStreamTrack. The red status bar is an indication that the call is continuing. Also, for MediaStreamTrack, audio and video content are not buffered: they are played or discarded. The media player, whenever not visible, will stop processing video but will continue processing audio if not interrupted. This makes it working for websites using video elements for both audio and video, which is more common than websites using video elements for video and audio elements for audio. Manually tested. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273069 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-18 Youenn Fablet <youenn@apple.com> Backgrounding a page that is playing and capturing audio will stop audio playing https://bugs.webkit.org/show_bug.cgi?id=222032 <rdar://problem/74389497> Reviewed by Eric Carlson. When a page gets backgrounded while capturing, it will continue doing capture, as can be seen with the red status bar. In that case, for video conferencing, it makes sense that audio being played continues playing, at least for MediaStreamTrack. The red status bar is an indication that the call is continuing. Also, for MediaStreamTrack, audio and video content are not buffered: they are played or discarded. The media player, whenever not visible, will stop processing video but will continue processing audio if not interrupted. This makes it working for websites using video elements for both audio and video, which is more common than websites using video elements for video and audio elements for audio. Manually tested. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const): 2021-02-19 Alan Coon <alancoon@apple.com> Cherry-pick r273003. rdar://problem/74500696 Animated keyframe style needs to go through full style adjuster https://bugs.webkit.org/show_bug.cgi?id=222036 rdar://72421747 Reviewed by Zalan Bujtas. Source/WebCore: We can create unadjusted styles via keyframe animations and those may cause problems in rendering. Test: fast/animation/animation-position-crash.html * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::adjustAnimatedStyle): Make this a member function and invoke Adjuster::adjust. Simplify the z-index adjustment since it is mostly handled by adjust. * style/StyleAdjuster.h: * style/StyleTreeResolver.cpp: Always use style adjuster for keyframe animation. (WebCore::Style::TreeResolver::createAnimatedElementUpdate): LayoutTests: * fast/animation/animation-position-crash-expected.html: Added. * fast/animation/animation-position-crash.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273003 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-17 Antti Koivisto <antti@apple.com> Animated keyframe style needs to go through full style adjuster https://bugs.webkit.org/show_bug.cgi?id=222036 rdar://72421747 Reviewed by Zalan Bujtas. We can create unadjusted styles via keyframe animations and those may cause problems in rendering. Test: fast/animation/animation-position-crash.html * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::adjustAnimatedStyle): Make this a member function and invoke Adjuster::adjust. Simplify the z-index adjustment since it is mostly handled by adjust. * style/StyleAdjuster.h: * style/StyleTreeResolver.cpp: Always use style adjuster for keyframe animation. (WebCore::Style::TreeResolver::createAnimatedElementUpdate): 2021-02-19 Alan Coon <alancoon@apple.com> Cherry-pick r272931. rdar://problem/74500616 RenderElement::containingBlockForAbsolutePosition may call RenderObject::containingBlock recursively https://bugs.webkit.org/show_bug.cgi?id=221976 <rdar://problem/72775667> Reviewed by Simon Fraser. When a RenderInline happens to be absolute positioned (this is a highly incorrect state, see webkit.org/b/221994), containingBlockForAbsolutePosition() calls containingBlock() with |this| and in return containingBlock() calls back on containingBlockForAbsolutePosition() with the same renderer. This patch ensures that we always call containingBlock() from containingBlockForAbsolutePosition() with an ancestor -mostly with the parent(). * rendering/RenderElement.cpp: (WebCore::RenderElement::containingBlockForAbsolutePosition const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272931 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-16 Zalan Bujtas <zalan@apple.com> RenderElement::containingBlockForAbsolutePosition may call RenderObject::containingBlock recursively https://bugs.webkit.org/show_bug.cgi?id=221976 <rdar://problem/72775667> Reviewed by Simon Fraser. When a RenderInline happens to be absolute positioned (this is a highly incorrect state, see webkit.org/b/221994), containingBlockForAbsolutePosition() calls containingBlock() with |this| and in return containingBlock() calls back on containingBlockForAbsolutePosition() with the same renderer. This patch ensures that we always call containingBlock() from containingBlockForAbsolutePosition() with an ancestor -mostly with the parent(). * rendering/RenderElement.cpp: (WebCore::RenderElement::containingBlockForAbsolutePosition const): 2021-02-19 Alan Coon <alancoon@apple.com> Cherry-pick r272927. rdar://problem/74500651 REGRESSION(r271515): ::marker fired at wrong time https://bugs.webkit.org/show_bug.cgi?id=221961 <rdar://problem/74397846> Reviewed by Dean Jackson. Source/WebCore: Restore the order in which we generate CSS Animations for pseudo-elements as it was prior to r271515. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveElement): LayoutTests: Remove flakiness for this test since it didn't allow us to spot the regression introduced by r271515. * TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272927 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-16 Antoine Quint <graouts@webkit.org> REGRESSION(r271515): ::marker fired at wrong time https://bugs.webkit.org/show_bug.cgi?id=221961 <rdar://problem/74397846> Reviewed by Dean Jackson. Restore the order in which we generate CSS Animations for pseudo-elements as it was prior to r271515. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveElement): 2021-02-19 Alan Coon <alancoon@apple.com> Cherry-pick r272913. rdar://problem/74500965 AVAudioSessionCaptureDeviceManager should disable its audio session in a background thread https://bugs.webkit.org/show_bug.cgi?id=221949 <rdar://problem/74315824> Reviewed by Eric Carlson. Manually tested. * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: (WebCore::AVAudioSessionCaptureDeviceManager::disableAllDevicesQuery): Hop to a background thread before disabling the audio session. Abort if audio session is no longer marked as unneeded. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272913 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-16 Youenn Fablet <youenn@apple.com> AVAudioSessionCaptureDeviceManager should disable its audio session in a background thread https://bugs.webkit.org/show_bug.cgi?id=221949 <rdar://problem/74315824> Reviewed by Eric Carlson. Manually tested. * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: (WebCore::AVAudioSessionCaptureDeviceManager::disableAllDevicesQuery): Hop to a background thread before disabling the audio session. Abort if audio session is no longer marked as unneeded. 2021-02-19 Alan Coon <alancoon@apple.com> Cherry-pick r272379. rdar://problem/74500599 Supplementary code points (U+10000 - U+10FFFF) are not shaped correctly in the fast text codepath https://bugs.webkit.org/show_bug.cgi?id=221356 <rdar://problem/72555297> Reviewed by Zalan Bujtas. Source/WebCore: Supplementary code points are represented in UTF-16 as two adjacent (surrogate) code units. When we map code points to glyphs, we were originally mapping these two code units to a single glyph. However, shaping routines require that the number of code units and glyphs be equal, by injecting a 0 glyph for the trailing surrogate. Luckily, we don't actually have to delete these extra 0 glyphs, because the shaping engine will do that for us. Test: fast/text/multi-code-unit-simple-path.html * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::advanceInternal): LayoutTests: * fast/text/multi-code-unit-simple-path-expected-mismatch.html: Added. * fast/text/multi-code-unit-simple-path.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272379 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-04 Myles C. Maxfield <mmaxfield@apple.com> Supplementary code points (U+10000 - U+10FFFF) are not shaped correctly in the fast text codepath https://bugs.webkit.org/show_bug.cgi?id=221356 <rdar://problem/72555297> Reviewed by Zalan Bujtas. Supplementary code points are represented in UTF-16 as two adjacent (surrogate) code units. When we map code points to glyphs, we were originally mapping these two code units to a single glyph. However, shaping routines require that the number of code units and glyphs be equal, by injecting a 0 glyph for the trailing surrogate. Luckily, we don't actually have to delete these extra 0 glyphs, because the shaping engine will do that for us. Test: fast/text/multi-code-unit-simple-path.html * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::advanceInternal): 2021-02-17 Alan Coon <alancoon@apple.com> Cherry-pick r272345. rdar://problem/74195248 [WebAuthn] Allow one user gesture free prompt for each navigation https://bugs.webkit.org/show_bug.cgi?id=220897 <rdar://problem/73541303> Reviewed by Brent Fulgham. Source/WebCore: * Modules/webauthn/AuthenticatorCoordinator.cpp: (WebCore::AuthenticatorCoordinator::resetUserGestureRequirement): * Modules/webauthn/AuthenticatorCoordinator.h: * Modules/webauthn/AuthenticatorCoordinatorClient.h: * page/Quirks.cpp: * page/Quirks.cpp.h: * replay/UserInputBridge.cpp: (WebCore::UserInputBridge::loadRequest): (WebCore::UserInputBridge::reloadFrame): Adds the ability to reset the user gesture requirement flag for user initiated reloads and quirks. Source/WebKit: This is a quirk that only allows certain websites. Covered by existing tests. * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::filterTransports const): (WebKit::AuthenticatorManager::runPanel): (WebKit::AuthenticatorManager::runPresenter): Cancel the whole WebAuthn operation if no user gesture is indicated. * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: (WebKit::WebAuthenticatorCoordinator::makeCredential): (WebKit::WebAuthenticatorCoordinator::getAssertion): * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.h: Set a boolean to indicate a free coupon for each navigation. Tools: * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm: (TestWebKitAPI::TEST): LayoutTests: * http/wpt/webauthn/ctap-hid-failure.https-expected.txt: * http/wpt/webauthn/ctap-hid-success.https-expected.txt: * http/wpt/webauthn/ctap-nfc-failure.https-expected.txt: * http/wpt/webauthn/idl.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure-hid.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure-local-silent.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure-local.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure-nfc.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure-u2f-silent.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure-u2f.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-success-hid.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-success-local.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-success-nfc.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-success-u2f.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure-hid.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure-local-silent.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure-local.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure-nfc.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure-u2f-silent.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure-u2f.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-success-hid.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-success-local.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-success-nfc.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-success-u2f.https-expected.txt: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272345 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-03 Jiewen Tan <jiewen_tan@apple.com> [WebAuthn] Allow one user gesture free prompt for each navigation https://bugs.webkit.org/show_bug.cgi?id=220897 <rdar://problem/73541303> Reviewed by Brent Fulgham. * Modules/webauthn/AuthenticatorCoordinator.cpp: (WebCore::AuthenticatorCoordinator::resetUserGestureRequirement): * Modules/webauthn/AuthenticatorCoordinator.h: * Modules/webauthn/AuthenticatorCoordinatorClient.h: * page/Quirks.cpp: * page/Quirks.cpp.h: * replay/UserInputBridge.cpp: (WebCore::UserInputBridge::loadRequest): (WebCore::UserInputBridge::reloadFrame): Adds the ability to reset the user gesture requirement flag for user initiated reloads and quirks. 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272880. rdar://problem/74409363 Crash under WorkerThreadableLoader::MainThreadBridge::notifyIsDone() https://bugs.webkit.org/show_bug.cgi?id=221906 <rdar://74225448> Reviewed by Alex Christensen. * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::computeIsDone): r267227 added this function and this was the first case where the DocumentThreadableLoader would do an async operation and ref itself during the operation. I believe this was the source of the crash as this could cause DocumentThreadableLoader to outlive its client. When DocumentThreadableLoader::notifyIsDone() would get called later on, m_client may be bad. To maintain pre-r267227 behavior, we now capture a WeakPtr to |this| instead of a Ref<>, so that we don't unnecessarily extend the lifetime of the DocumentThreadableLoader. * loader/DocumentThreadableLoader.h: (WebCore::DocumentThreadableLoader::clearClient): Add new clearClient() function to DocumentThreadableLoader so that the client can clear the raw pointer the DocumentThreadableLoader holds to it before getting destroyed. I wanted to use WeakPtr but this did not work out due to multithreading. * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::MainThreadBridge::destroy): Before destroying itself, WorkerThreadableLoader::MainThreadBridge now clears the raw pointer to it that DocumentThreadableLoader holds. This is important since DocumentThreadableLoader is RefCounted and its lifetime may get extended past the MainThreadBridge. * loader/WorkerThreadableLoader.h: Use tighter typing for clarity. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272880 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-15 Chris Dumez <cdumez@apple.com> Crash under WorkerThreadableLoader::MainThreadBridge::notifyIsDone() https://bugs.webkit.org/show_bug.cgi?id=221906 <rdar://74225448> Reviewed by Alex Christensen. * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::computeIsDone): r267227 added this function and this was the first case where the DocumentThreadableLoader would do an async operation and ref itself during the operation. I believe this was the source of the crash as this could cause DocumentThreadableLoader to outlive its client. When DocumentThreadableLoader::notifyIsDone() would get called later on, m_client may be bad. To maintain pre-r267227 behavior, we now capture a WeakPtr to |this| instead of a Ref<>, so that we don't unnecessarily extend the lifetime of the DocumentThreadableLoader. * loader/DocumentThreadableLoader.h: (WebCore::DocumentThreadableLoader::clearClient): Add new clearClient() function to DocumentThreadableLoader so that the client can clear the raw pointer the DocumentThreadableLoader holds to it before getting destroyed. I wanted to use WeakPtr but this did not work out due to multithreading. * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::MainThreadBridge::destroy): Before destroying itself, WorkerThreadableLoader::MainThreadBridge now clears the raw pointer to it that DocumentThreadableLoader holds. This is important since DocumentThreadableLoader is RefCounted and its lifetime may get extended past the MainThreadBridge. * loader/WorkerThreadableLoader.h: Use tighter typing for clarity. 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272856. rdar://problem/74410114 [LFC][IFC] Do not re-measure wrapped content https://bugs.webkit.org/show_bug.cgi?id=221874 Reviewed by Antti Koivisto. This patch addresses the performance issue with extremely long content when the content gets re-measured many time while performing line breaking. When a certain text content does not fit the line we can 1. keep it on the current line and let it overflow or 2. wrap the entire content to the next line or 3. split it somewhere in the middle. In case of 2 and 3 this overflowing content turns into the leading content on the subsequent line. Now due to ligature (#3) and position dependent glyph sizing(#2) we need to remeasure this leading content again. However with unreasonably long content and relatively small horizontal constraint, this could lead to repeated, continuous text measuring. In this patch we turn the overflow width into the leading width so that we measure the long text content only once. (FIXME: This should be turned into a generic "use the overflow content as-is when turning it into leading content") * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::layoutInlineContent): (WebCore::Layout::LineBuilder::computedIntrinsicWidth): (WebCore::Layout::LineBuilder::placeInlineContent): (WebCore::Layout::LineBuilder::candidateContentForLine): (WebCore::Layout::LineBuilder::handleInlineContent): * layout/inlineformatting/InlineLineBuilder.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272856 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-15 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Do not re-measure wrapped content https://bugs.webkit.org/show_bug.cgi?id=221874 Reviewed by Antti Koivisto. This patch addresses the performance issue with extremely long content when the content gets re-measured many time while performing line breaking. When a certain text content does not fit the line we can 1. keep it on the current line and let it overflow or 2. wrap the entire content to the next line or 3. split it somewhere in the middle. In case of 2 and 3 this overflowing content turns into the leading content on the subsequent line. Now due to ligature (#3) and position dependent glyph sizing(#2) we need to remeasure this leading content again. However with unreasonably long content and relatively small horizontal constraint, this could lead to repeated, continuous text measuring. In this patch we turn the overflow width into the leading width so that we measure the long text content only once. (FIXME: This should be turned into a generic "use the overflow content as-is when turning it into leading content") * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::layoutInlineContent): (WebCore::Layout::LineBuilder::computedIntrinsicWidth): (WebCore::Layout::LineBuilder::placeInlineContent): (WebCore::Layout::LineBuilder::candidateContentForLine): (WebCore::Layout::LineBuilder::handleInlineContent): * layout/inlineformatting/InlineLineBuilder.h: 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272841. rdar://problem/74409856 [iOS] MobileSafari crashes at WebCore: WebCore::VideoFullscreenInterfaceAVKit::doEnterFullscreen https://bugs.webkit.org/show_bug.cgi?id=221863 <rdar://73861140> Patch by Jean-Yves Avenard <jya@apple.com> on 2021-02-14 Reviewed by Darin Adler. On iPad, it's possible for AVKit to fail due to racing requests to exit full screen and enter full screen. The enterFullscreenHandler would attempt to immediately re-enter full screen. For now we bail-out early to avoid the crash. In a follow-up patch we will ensure that the condition to enter fullscreen while there's a pending operation to exit fullscreen can't occur. No new tests, can't reproduce. Analysis has been entirely theoretical. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::enterFullscreenHandler): Exit early if error returned. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272841 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-14 Jean-Yves Avenard <jya@apple.com> [iOS] MobileSafari crashes at WebCore: WebCore::VideoFullscreenInterfaceAVKit::doEnterFullscreen https://bugs.webkit.org/show_bug.cgi?id=221863 <rdar://73861140> Reviewed by Darin Adler. On iPad, it's possible for AVKit to fail due to racing requests to exit full screen and enter full screen. The enterFullscreenHandler would attempt to immediately re-enter full screen. For now we bail-out early to avoid the crash. In a follow-up patch we will ensure that the condition to enter fullscreen while there's a pending operation to exit fullscreen can't occur. No new tests, can't reproduce. Analysis has been entirely theoretical. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::enterFullscreenHandler): Exit early if error returned. 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272829. rdar://problem/74409245 [Mac] Sound does not play on YouTube after switching back to foreground https://bugs.webkit.org/show_bug.cgi?id=221858 <rdar://70602677> Reviewed by Eric Carlson. Source/WebCore: Test: platform/mac/media/unmute-after-loading.html Remove a stray, unnecessary reset of a cached muted state which kept mute state from being changed the first time after loading. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): * testing/Internals.cpp: (WebCore::Internals::privatePlayerMuted): * testing/Internals.h: * testing/Internals.idl: * testing/Internals.mm: (WebCore::Internals::privatePlayerMuted): LayoutTests: * platform/mac/media/unmute-after-loading-expected.txt: Added. * platform/mac/media/unmute-after-loading.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272829 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-12 Jer Noble <jer.noble@apple.com> [Mac] Sound does not play on YouTube after switching back to foreground https://bugs.webkit.org/show_bug.cgi?id=221858 <rdar://70602677> Reviewed by Eric Carlson. Test: platform/mac/media/unmute-after-loading.html Remove a stray, unnecessary reset of a cached muted state which kept mute state from being changed the first time after loading. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): * testing/Internals.cpp: (WebCore::Internals::privatePlayerMuted): * testing/Internals.h: * testing/Internals.idl: * testing/Internals.mm: (WebCore::Internals::privatePlayerMuted): 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272777. rdar://problem/74410399 Nullopt crash in DOMSelection::getRangeAt https://bugs.webkit.org/show_bug.cgi?id=221786 Reviewed by Darin Adler. No new tests since we don't have any way to reproduce this crash. * page/DOMSelection.cpp: (WebCore::DOMSelection::getRangeAt): Added a nullopt check with an assertion. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272777 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-12 Ryosuke Niwa <rniwa@webkit.org> Nullopt crash in DOMSelection::getRangeAt https://bugs.webkit.org/show_bug.cgi?id=221786 Reviewed by Darin Adler. No new tests since we don't have any way to reproduce this crash. * page/DOMSelection.cpp: (WebCore::DOMSelection::getRangeAt): Added a nullopt check with an assertion. 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272703. rdar://problem/74409698 Reduce the overhead of DocumentFragment in innerHTML & outerHTML https://bugs.webkit.org/show_bug.cgi?id=221535 <rdar://problem/73861015> Reviewed by Geoffrey Garen. Source/WebCore: This patch reduces the overhead of using DocumentFragment in innerHTMl and outerHTML setters by 1. Cache DocumentFragment used for innerHTML and outerHTML. 2. Adding a fast path to removeAllChildrenWithScriptAssertion when removing child nodes from (1) immediately before appending it to the new parent. This is safe for now since no DOM nodes or API store information about its root node or parent node when it's DocumentFragment, and and there are no node flags to be updated or invalidated since we're removing already-disconnected nodes to which no script ever had access up until this point. We release-assert these conditions before going into the fast path. No new tests since there should be no observable behavior change. * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Added a fast path. See above. * dom/Document.cpp: (WebCore::Document::commonTeardown): Clear m_documentFragmentForInnerOuterHTML as it would keep the ownewr document (this Document) alive otherwise. (WebCore::Document::documentFragmentForInnerOuterHTML): Added. Lazily create a DocumentFragment used to parse the fragment for innerHTML and outerHTML setters. Remove any child nodes left in the document fragment in the case the last call to replaceChildrenWithFragment took a fast path for a single text node, which case we don't remove any child nodes from DocumentFragment. * dom/Document.h: * dom/DocumentFragment.h: (WebCore::DocumentFragment::setIsDocumentFragmentForInnerOuterHTML): Added. * dom/Node.h: (WebCore::Node::isDocumentFragmentForInnerOuterHTML const): Added. * editing/markup.cpp: (WebCore::createFragmentForMarkup): Extracted from createFragmentForInnerOuterHTML to share code between createFragmentForInnerOuterHTML and createContextualFragment. (WebCore::createFragmentForInnerOuterHTML): Reuse the fragment in createFragmentForMarkup. (WebCore::createContextualFragment): Don't reuse the fragment in createFragmentForMarkup as this function is used by Range::createContextualFragment which exposes the document fragment to arbitrary author scripts. (WebCore::hasOneChild): Deleted since we now have Node::hasOneChild. (WebCore::hasOneTextChild): Use Node::hasOneChild. (WebCore::replaceChildrenWithFragment): Added assertions to make sure we don't have any child nodes left after replacing the children. Source/WTF: Added a helper function for writing assertions. * wtf/WeakPtr.h: (WTF::WeakPtrFactory::isInitialized const): Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272703 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-10 Ryosuke Niwa <rniwa@webkit.org> Reduce the overhead of DocumentFragment in innerHTML & outerHTML https://bugs.webkit.org/show_bug.cgi?id=221535 <rdar://problem/73861015> Reviewed by Geoffrey Garen. This patch reduces the overhead of using DocumentFragment in innerHTMl and outerHTML setters by 1. Cache DocumentFragment used for innerHTML and outerHTML. 2. Adding a fast path to removeAllChildrenWithScriptAssertion when removing child nodes from (1) immediately before appending it to the new parent. This is safe for now since no DOM nodes or API store information about its root node or parent node when it's DocumentFragment, and and there are no node flags to be updated or invalidated since we're removing already-disconnected nodes to which no script ever had access up until this point. We release-assert these conditions before going into the fast path. No new tests since there should be no observable behavior change. * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Added a fast path. See above. * dom/Document.cpp: (WebCore::Document::commonTeardown): Clear m_documentFragmentForInnerOuterHTML as it would keep the ownewr document (this Document) alive otherwise. (WebCore::Document::documentFragmentForInnerOuterHTML): Added. Lazily create a DocumentFragment used to parse the fragment for innerHTML and outerHTML setters. Remove any child nodes left in the document fragment in the case the last call to replaceChildrenWithFragment took a fast path for a single text node, which case we don't remove any child nodes from DocumentFragment. * dom/Document.h: * dom/DocumentFragment.h: (WebCore::DocumentFragment::setIsDocumentFragmentForInnerOuterHTML): Added. * dom/Node.h: (WebCore::Node::isDocumentFragmentForInnerOuterHTML const): Added. * editing/markup.cpp: (WebCore::createFragmentForMarkup): Extracted from createFragmentForInnerOuterHTML to share code between createFragmentForInnerOuterHTML and createContextualFragment. (WebCore::createFragmentForInnerOuterHTML): Reuse the fragment in createFragmentForMarkup. (WebCore::createContextualFragment): Don't reuse the fragment in createFragmentForMarkup as this function is used by Range::createContextualFragment which exposes the document fragment to arbitrary author scripts. (WebCore::hasOneChild): Deleted since we now have Node::hasOneChild. (WebCore::hasOneTextChild): Use Node::hasOneChild. (WebCore::replaceChildrenWithFragment): Added assertions to make sure we don't have any child nodes left after replacing the children. 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272633. rdar://problem/74410421 REGRESSION: (r272458): [BigSur Debug] ASSERTION FAILED: m_haveAddedMediaUsageManagerSession in WebCore::MediaElementSession::updateMediaUsageIfChanged() https://bugs.webkit.org/show_bug.cgi?id=221634 <rdar://problem/74161017> Reviewed by Ryosuke Niwa. No new tests, this fixes an assertion in an existing test. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::MediaElementSession): (WebCore::MediaElementSession::addMediaUsageManagerSessionIfNecessary): (WebCore::MediaElementSession::inActiveDocumentChanged): (WebCore::MediaElementSession::updateMediaUsageIfChanged): (WebCore::MediaElementSession::addedMediaUsageManagerSessionIfNecessary): Deleted. * html/MediaElementSession.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272633 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-09 Eric Carlson <eric.carlson@apple.com> REGRESSION: (r272458): [BigSur Debug] ASSERTION FAILED: m_haveAddedMediaUsageManagerSession in WebCore::MediaElementSession::updateMediaUsageIfChanged() https://bugs.webkit.org/show_bug.cgi?id=221634 <rdar://problem/74161017> Reviewed by Ryosuke Niwa. No new tests, this fixes an assertion in an existing test. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::MediaElementSession): (WebCore::MediaElementSession::addMediaUsageManagerSessionIfNecessary): (WebCore::MediaElementSession::inActiveDocumentChanged): (WebCore::MediaElementSession::updateMediaUsageIfChanged): (WebCore::MediaElementSession::addedMediaUsageManagerSessionIfNecessary): Deleted. * html/MediaElementSession.h: 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272622. rdar://problem/74410599 Reduce the overhead of HTMLDocumentParser in innerHTML setter https://bugs.webkit.org/show_bug.cgi?id=221596 Reviewed by Simon Fraser. This patch reduces the overhead of HTMLDocumentParser for innerHTML. This appears to be ~0.5% Speedometer progression. No new tests since there should be no observable behavior differences. * dom/ScriptableDocumentParser.h: (WebCore::ScriptableDocumentParser:isWaitingForScripts): Removed since this abstract virtual function is only used in HTMLDocumentParser. * html/FTPDirectoryDocument.cpp: (WebCore::FTPDirectoryDocument::isWaitingForScripts): Removed. There are no scripts in ftp directory document but there is no need to override it here. * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::pumpTokenizer): Exit early when we're parsing a fragment to avoid accessing the scheduler, preloader, and document loader for various things since they're all irrelevant for fragment parsing. (WebCore::HTMLDocumentParser::isWaitingForScripts const): Return false immediately when parsing a document fragment as a fast path. * html/parser/HTMLDocumentParser.h: * xml/parser/XMLDocumentParser.cpp: (WebCore::XMLDocumentParser::isWaitingForScripts const): Removed. Unused. * xml/parser/XMLDocumentParser.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272622 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-09 Ryosuke Niwa <rniwa@webkit.org> Reduce the overhead of HTMLDocumentParser in innerHTML setter https://bugs.webkit.org/show_bug.cgi?id=221596 Reviewed by Simon Fraser. This patch reduces the overhead of HTMLDocumentParser for innerHTML. This appears to be ~0.5% Speedometer progression. No new tests since there should be no observable behavior differences. * dom/ScriptableDocumentParser.h: (WebCore::ScriptableDocumentParser:isWaitingForScripts): Removed since this abstract virtual function is only used in HTMLDocumentParser. * html/FTPDirectoryDocument.cpp: (WebCore::FTPDirectoryDocument::isWaitingForScripts): Removed. There are no scripts in ftp directory document but there is no need to override it here. * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::pumpTokenizer): Exit early when we're parsing a fragment to avoid accessing the scheduler, preloader, and document loader for various things since they're all irrelevant for fragment parsing. (WebCore::HTMLDocumentParser::isWaitingForScripts const): Return false immediately when parsing a document fragment as a fast path. * html/parser/HTMLDocumentParser.h: * xml/parser/XMLDocumentParser.cpp: (WebCore::XMLDocumentParser::isWaitingForScripts const): Removed. Unused. * xml/parser/XMLDocumentParser.h: 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272602. rdar://problem/74409444 [LFC][IFC] Disable BIDI processing for modern line layout https://bugs.webkit.org/show_bug.cgi?id=221615 Reviewed by Sam Weinig. This was added in preparation for BIDI content support but we are not there yet. Let's just disable it for now. * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272602 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-09 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Disable BIDI processing for modern line layout https://bugs.webkit.org/show_bug.cgi?id=221615 Reviewed by Sam Weinig. This was added in preparation for BIDI content support but we are not there yet. Let's just disable it for now. * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const): 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272583. rdar://problem/74409637 MediaStream-backed video elements should not compute the mediaType based on track muted states https://bugs.webkit.org/show_bug.cgi?id=221601 Reviewed by Eric Carlson. Source/WebCore: In case of entering background, two things happen: - video elements get paused - local video capture track gets muted When entering foreground: - video element should resume but did not as the local video track was muted and video element was considered as an audio element. - local video capture track gets unmuted but this is too late. To fix this, compute hasVideo/hasAudio based on available tracks, no matter their active state. Test: fast/mediastream/MediaStream-video-element-enter-background.html * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasVideo const): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAudio const): LayoutTests: * fast/mediastream/MediaStream-video-element-enter-background-expected.txt: Added. * fast/mediastream/MediaStream-video-element-enter-background.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272583 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-09 Youenn Fablet <youenn@apple.com> MediaStream-backed video elements should not compute the mediaType based on track muted states https://bugs.webkit.org/show_bug.cgi?id=221601 Reviewed by Eric Carlson. In case of entering background, two things happen: - video elements get paused - local video capture track gets muted When entering foreground: - video element should resume but did not as the local video track was muted and video element was considered as an audio element. - local video capture track gets unmuted but this is too late. To fix this, compute hasVideo/hasAudio based on available tracks, no matter their active state. Test: fast/mediastream/MediaStream-video-element-enter-background.html * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasVideo const): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAudio const): 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272567. rdar://problem/74410033 REGRESSION (r269458): yahoo.com social / comments bar shows as transparent when scrolling page https://bugs.webkit.org/show_bug.cgi?id=221582 Source/WebCore: <rdar://problem/73795359> Reviewed by Tim Horton. Fix some copypasta in r269458 that resulted in scrolling state fixed nodes failing to get the right dirty bits after attach, resulting bad viewport constraint data. Test: scrollingcoordinator/fixed-node-reattach.html * page/scrolling/ScrollingStateFixedNode.cpp: (WebCore::ScrollingStateFixedNode::applicableProperties const): LayoutTests: Reviewed by Tim Horton. * scrollingcoordinator/fixed-node-reattach-expected.html: Added. * scrollingcoordinator/fixed-node-reattach.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272567 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-08 Simon Fraser <simon.fraser@apple.com> REGRESSION (r269458): yahoo.com social / comments bar shows as transparent when scrolling page https://bugs.webkit.org/show_bug.cgi?id=221582 <rdar://problem/73795359> Reviewed by Tim Horton. Fix some copypasta in r269458 that resulted in scrolling state fixed nodes failing to get the right dirty bits after attach, resulting bad viewport constraint data. Test: scrollingcoordinator/fixed-node-reattach.html * page/scrolling/ScrollingStateFixedNode.cpp: (WebCore::ScrollingStateFixedNode::applicableProperties const): 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272550. rdar://problem/74409264 Make the UserContentController for ServiceWorker pages be non-optional. <rdar://problem/71434565> and https://bugs.webkit.org/show_bug.cgi?id=221503 Reviewed by Alex Christensen. Source/WebCore: * loader/EmptyClients.cpp: (WebCore::pageConfigurationWithEmptyClients): * page/Page.cpp: (WebCore::Page::Page): * page/PageConfiguration.cpp: (WebCore::PageConfiguration::PageConfiguration): * page/PageConfiguration.h: Source/WebKit: Normal Pages always have a UserContentProvider, even if they just create an empty default one. Same should be true for ServiceWorkers. * Shared/ServiceWorkerInitializationData.cpp: (WebKit::ServiceWorkerInitializationData::decode): * Shared/ServiceWorkerInitializationData.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::userContentControllerIdentifierForServiceWorkers): (WebKit::WebProcessPool::createWebPage): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::enableServiceWorkers): * UIProcess/WebProcessProxy.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::m_userContentController): (WebKit::m_userAgent): Deleted. * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_limitsNavigationsToAppBoundDomains): Source/WebKitLegacy/mac: * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Source/WebKitLegacy/win: * WebView.cpp: (WebView::initWithFrame): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272550 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-08 Brady Eidson <beidson@apple.com> Make the UserContentController for ServiceWorker pages be non-optional. <rdar://problem/71434565> and https://bugs.webkit.org/show_bug.cgi?id=221503 Reviewed by Alex Christensen. * loader/EmptyClients.cpp: (WebCore::pageConfigurationWithEmptyClients): * page/Page.cpp: (WebCore::Page::Page): * page/PageConfiguration.cpp: (WebCore::PageConfiguration::PageConfiguration): * page/PageConfiguration.h: 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272495. rdar://problem/74409320 [macOS] Return key binding for date inputs conflicts with return to submit form https://bugs.webkit.org/show_bug.cgi?id=221532 <rdar://problem/74039204> Reviewed by Wenson Hsieh. Source/WebCore: Currently, pressing the return key within a focused date input presents the calendar view, rather than submitting an associated form. This is a usability issue for keyboard users, and is different from the behavior in Chrome. This patch matches the behavior in Chrome, and makes it so that a return keypress submits an associated form. However, since the return key is now reserved for form submission, we need a new key to present the calendar view for the date input. Chrome and Firefox use the space key for this functionality, so this patch matches that behavior. Note that r267281 updated date inputs to focus the next editable component when pressing the space key. This behavior is now removed in favor of presenting the calendar. Other separator keys, and arrow keys, can still be used to focus the next editable component. Tests: fast/forms/date/date-editable-components/date-picker-show-on-space-keypress.html fast/forms/date/date-editable-components/form-submit-on-return-keypress.html * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::handleKeypressEvent): Date and time inputs are BaseClickableWithKeyInputTypes. This gives them activation behavior on return and space keypresses, similar to button and color inputs. However, since date/time inputs are closer to textfields, than buttons, we elide activation behavior on a return keypress, allowing the event to submit an associated form. Activation behavior on a space keypress is supported by going through the existing code path. * html/shadow/DateTimeFieldElement.cpp: (WebCore::DateTimeFieldElement::defaultKeyboardEventHandler): Remove "Space" from the list of separator keys that focus the next editable component. LayoutTests: Added tests to verify that pressing the space key in a focused date input presents a calendar view, and pressing the enter key in a focused date input submits a form. Rebaselined existing tests to account for the fact that the space key no longer focuses the next editable component within a date input. * fast/forms/date/date-editable-components/date-editable-components-keyboard-events-expected.txt: * fast/forms/date/date-editable-components/date-editable-components-keyboard-events.html: * fast/forms/date/date-editable-components/date-picker-show-on-space-keypress-expected.txt: Added. * fast/forms/date/date-editable-components/date-picker-show-on-space-keypress.html: Added. * fast/forms/date/date-editable-components/form-submit-on-return-keypress-expected.txt: Added. * fast/forms/date/date-editable-components/form-submit-on-return-keypress.html: Added. * fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-editable-components-keyboard-events-expected.txt: * fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-editable-components-keyboard-events.html: * fast/forms/month/month-editable-components/month-editable-components-keyboard-events-expected.txt: * fast/forms/month/month-editable-components/month-editable-components-keyboard-events.html: * fast/forms/time/time-editable-components/time-editable-components-keyboard-events-expected.txt: * fast/forms/time/time-editable-components/time-editable-components-keyboard-events.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272495 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-08 Aditya Keerthi <akeerthi@apple.com> [macOS] Return key binding for date inputs conflicts with return to submit form https://bugs.webkit.org/show_bug.cgi?id=221532 <rdar://problem/74039204> Reviewed by Wenson Hsieh. Currently, pressing the return key within a focused date input presents the calendar view, rather than submitting an associated form. This is a usability issue for keyboard users, and is different from the behavior in Chrome. This patch matches the behavior in Chrome, and makes it so that a return keypress submits an associated form. However, since the return key is now reserved for form submission, we need a new key to present the calendar view for the date input. Chrome and Firefox use the space key for this functionality, so this patch matches that behavior. Note that r267281 updated date inputs to focus the next editable component when pressing the space key. This behavior is now removed in favor of presenting the calendar. Other separator keys, and arrow keys, can still be used to focus the next editable component. Tests: fast/forms/date/date-editable-components/date-picker-show-on-space-keypress.html fast/forms/date/date-editable-components/form-submit-on-return-keypress.html * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::handleKeypressEvent): Date and time inputs are BaseClickableWithKeyInputTypes. This gives them activation behavior on return and space keypresses, similar to button and color inputs. However, since date/time inputs are closer to textfields, than buttons, we elide activation behavior on a return keypress, allowing the event to submit an associated form. Activation behavior on a space keypress is supported by going through the existing code path. * html/shadow/DateTimeFieldElement.cpp: (WebCore::DateTimeFieldElement::defaultKeyboardEventHandler): Remove "Space" from the list of separator keys that focus the next editable component. 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272488. rdar://problem/74410510 Perform layout before running Editor::findString https://bugs.webkit.org/show_bug.cgi?id=220384 Patch by Frédéric Wang <fwang@igalia.com> on 2021-02-08 Reviewed by Ryosuke Niwa. This ensures that the layout is up-to-date before performing any search. Also disable any post-resolution that could cause more changes to happen. * editing/Editor.cpp: (WebCore::Editor::findString): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272488 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-08 Frédéric Wang <fwang@igalia.com> Perform layout before running Editor::findString https://bugs.webkit.org/show_bug.cgi?id=220384 Reviewed by Ryosuke Niwa. This ensures that the layout is up-to-date before performing any search. Also disable any post-resolution that could cause more changes to happen. * editing/Editor.cpp: (WebCore::Editor::findString): 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272483. rdar://problem/74409975 Nullptr crash in editingIgnoresContent via InsertParagraphSeparatorCommand::doApply https://bugs.webkit.org/show_bug.cgi?id=220349 Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2021-02-08 Reviewed by Ryosuke Niwa. Add an early return to InsertParagraphSeparatorCommand::doApply if insert position is null. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::insertNodeBefore): Return early if a InsertNodeBeforeCommand can't be created. * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply): Abort the insertion if the insert position is null. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272483 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-08 Carlos Garcia Campos <cgarcia@igalia.com> Nullptr crash in editingIgnoresContent via InsertParagraphSeparatorCommand::doApply https://bugs.webkit.org/show_bug.cgi?id=220349 Reviewed by Ryosuke Niwa. Add an early return to InsertParagraphSeparatorCommand::doApply if insert position is null. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::insertNodeBefore): Return early if a InsertNodeBeforeCommand can't be created. * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply): Abort the insertion if the insert position is null. 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272439. rdar://problem/74409122 [Cocoa] CRASH in MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer() https://bugs.webkit.org/show_bug.cgi?id=221490 <rdar://73966316> Reviewed by Eric Carlson. Add null-checks to every use of player() in SourceBufferPrivateAVFObjC. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData): (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::appendCompleted): (WebCore::SourceBufferPrivateAVFObjC::destroyParser): (WebCore::SourceBufferPrivateAVFObjC::destroyRenderers): (WebCore::SourceBufferPrivateAVFObjC::readyState const): (WebCore::SourceBufferPrivateAVFObjC::setReadyState): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::flushVideo): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed): (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): (WebCore::SourceBufferPrivateAVFObjC::player const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272439 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-05 Jer Noble <jer.noble@apple.com> [Cocoa] CRASH in MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer() https://bugs.webkit.org/show_bug.cgi?id=221490 <rdar://73966316> Reviewed by Eric Carlson. Add null-checks to every use of player() in SourceBufferPrivateAVFObjC. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData): (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::appendCompleted): (WebCore::SourceBufferPrivateAVFObjC::destroyParser): (WebCore::SourceBufferPrivateAVFObjC::destroyRenderers): (WebCore::SourceBufferPrivateAVFObjC::readyState const): (WebCore::SourceBufferPrivateAVFObjC::setReadyState): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::flushVideo): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed): (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): (WebCore::SourceBufferPrivateAVFObjC::player const): 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272435. rdar://problem/74410448 [LFC][Integration] Hit testing broken for descendants of pointer-events:none boxes https://bugs.webkit.org/show_bug.cgi?id=221460 Reviewed by Zalan Bujtas. Source/WebCore: Descendants of pointer-events:none boxes may still be hittestable if they override the value. LFC integration hit testing code didn't take this into account. Test: fast/events/hittest-pointer-event-none-descendants.html * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::hitTest): Replaced and inline-block boxes do the visibility/pointer-events test themselves. This code just needs to take care of text boxes. LayoutTests: * fast/events/hittest-pointer-event-none-descendants-expected.html: Added. * fast/events/hittest-pointer-event-none-descendants.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272435 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-05 Antti Koivisto <antti@apple.com> [LFC][Integration] Hit testing broken for descendants of pointer-events:none boxes https://bugs.webkit.org/show_bug.cgi?id=221460 Reviewed by Zalan Bujtas. Descendants of pointer-events:none boxes may still be hittestable if they override the value. LFC integration hit testing code didn't take this into account. Test: fast/events/hittest-pointer-event-none-descendants.html * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::hitTest): Replaced and inline-block boxes do the visibility/pointer-events test themselves. This code just needs to take care of text boxes. 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272394. rdar://problem/74409285 Avoid creating JS wrapper on a removed node when the subtree is not observable https://bugs.webkit.org/show_bug.cgi?id=221243 <rdar://problem/73719386> Reviewed by Geoffrey Garen. Prior to this patch, WebKit forced the creation the JS wrapper on the root DOM node of a removed subtree to avoid script observable deletion of nodes. This is necessary because DOM nodes are reference counted in the C++ side, and while a DOM node keeps its child nodes alive, it won't keep its parent node alive to avoid reference cycles (leaks). If we didn't force the creation of the JS wrapper and the root node of the removed subtree didn't have any external reference to it in C++ side, we would happily delete it and all its descendant nodes above any subtree with a JS wrapper or an external C++ reference. While this turned out to be an effective strategy for implementing DOM nodes' GC semantics correctly, it has a significant runtime and memory cost - the latter is because we don't collect the JS wrappers of DOM nodes once they're created until they're ready to be destructed. This patch introduces a new optimization to avoid creating these JS wrappers when the removed subtree won't be observable by scripts in the future. The current heuristic is to check if the removed node has any external reference to it (i.e. refCount() > 0 excluding any reference counting that happens within our algorithm). This is sufficient because a given node should not be observable at a later time unless it has an external reference to it. This is ~0.5% progression on Speedometer-2.0 on MacBookAir7,2. To do this, we take advantage of the fact notifyChildNodeRemoved already traverses each removed subtree, and check if any of them has a reference count greater than 1 (greater than 1 because notifyChildNodeRemoved itself increments node's reference count before calling itself on child nodes). Note that we exclude the root node of the removed subtree as these JS wrapper creation is only needed to keep the root node alive. If the root node is already kept alive by some external reference to it, there is no need to keep it alive again by creating a JS wrapper on it. No new tests since existing tests such as fast/dom/gc-3.html covers it. * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Call willCreatePossiblyOrphanedTreeByRemoval if the removed subtree contains an observable node. (WebCore::ContainerNode::removeNodeWithScriptAssertion): Ditto. (WebCore::ContainerNode::removeSelfOrChildNodesForInsertion): Renamed from collectChildrenAndRemoveFromOldParent. Avoid collecting the removed nodes in this function in addition to removeAllChildrenWithScriptAssertion. (WebCore::ContainerNode::insertBefore): (WebCore::ContainerNode::replaceChild): (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): (WebCore::dispatchChildRemovalEvents): Don't call willCreatePossiblyOrphanedTreeByRemoval here. * dom/ContainerNode.h: * dom/ContainerNodeAlgorithms.cpp: (WebCore::observabilityOfRemovedNode): Added. Checks the observability of a node excluding the root node of the removed subtree since it needs a special case in removeAllChildrenWithScriptAssertion. As notifyNodeRemovedFromDocument and notifyNodeRemovedFromTree ref's each child node before recursing on itself, we check refCount() > 1 here. (WebCore::updateObservability): Added. A helper function to update RemovedSubtreeObservability. (WebCore::notifyNodeRemovedFromDocument): Now returns RemovedSubtreeObservability, (WebCore::notifyNodeRemovedFromTree): Ditto. (WebCore::notifyChildNodeRemoved): Ditto. * dom/ContainerNodeAlgorithms.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272394 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-04 Ryosuke Niwa <rniwa@webkit.org> Avoid creating JS wrapper on a removed node when the subtree is not observable https://bugs.webkit.org/show_bug.cgi?id=221243 <rdar://problem/73719386> Reviewed by Geoffrey Garen. Prior to this patch, WebKit forced the creation the JS wrapper on the root DOM node of a removed subtree to avoid script observable deletion of nodes. This is necessary because DOM nodes are reference counted in the C++ side, and while a DOM node keeps its child nodes alive, it won't keep its parent node alive to avoid reference cycles (leaks). If we didn't force the creation of the JS wrapper and the root node of the removed subtree didn't have any external reference to it in C++ side, we would happily delete it and all its descendant nodes above any subtree with a JS wrapper or an external C++ reference. While this turned out to be an effective strategy for implementing DOM nodes' GC semantics correctly, it has a significant runtime and memory cost - the latter is because we don't collect the JS wrappers of DOM nodes once they're created until they're ready to be destructed. This patch introduces a new optimization to avoid creating these JS wrappers when the removed subtree won't be observable by scripts in the future. The current heuristic is to check if the removed node has any external reference to it (i.e. refCount() > 0 excluding any reference counting that happens within our algorithm). This is sufficient because a given node should not be observable at a later time unless it has an external reference to it. This is ~0.5% progression on Speedometer-2.0 on MacBookAir7,2. To do this, we take advantage of the fact notifyChildNodeRemoved already traverses each removed subtree, and check if any of them has a reference count greater than 1 (greater than 1 because notifyChildNodeRemoved itself increments node's reference count before calling itself on child nodes). Note that we exclude the root node of the removed subtree as these JS wrapper creation is only needed to keep the root node alive. If the root node is already kept alive by some external reference to it, there is no need to keep it alive again by creating a JS wrapper on it. No new tests since existing tests such as fast/dom/gc-3.html covers it. * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Call willCreatePossiblyOrphanedTreeByRemoval if the removed subtree contains an observable node. (WebCore::ContainerNode::removeNodeWithScriptAssertion): Ditto. (WebCore::ContainerNode::removeSelfOrChildNodesForInsertion): Renamed from collectChildrenAndRemoveFromOldParent. Avoid collecting the removed nodes in this function in addition to removeAllChildrenWithScriptAssertion. (WebCore::ContainerNode::insertBefore): (WebCore::ContainerNode::replaceChild): (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): (WebCore::dispatchChildRemovalEvents): Don't call willCreatePossiblyOrphanedTreeByRemoval here. * dom/ContainerNode.h: * dom/ContainerNodeAlgorithms.cpp: (WebCore::observabilityOfRemovedNode): Added. Checks the observability of a node excluding the root node of the removed subtree since it needs a special case in removeAllChildrenWithScriptAssertion. As notifyNodeRemovedFromDocument and notifyNodeRemovedFromTree ref's each child node before recursing on itself, we check refCount() > 1 here. (WebCore::updateObservability): Added. A helper function to update RemovedSubtreeObservability. (WebCore::notifyNodeRemovedFromDocument): Now returns RemovedSubtreeObservability, (WebCore::notifyNodeRemovedFromTree): Ditto. (WebCore::notifyChildNodeRemoved): Ditto. * dom/ContainerNodeAlgorithms.h: 2021-02-16 Ruben Turcios <rubent_22@apple.com> Cherry-pick r272390. rdar://problem/74409535 AX: expose focusable elements even if element or ancestor has aria-hidden=true https://bugs.webkit.org/show_bug.cgi?id=220534 <rdar://problem/71865875> Reviewed by Zalan Bujtas. Source/WebCore: ARIA states that if an item is focused, then it should override aria-hidden status. https://github.com/w3c/aria/pull/1387/files Test: accessibility/focusable-inside-hidden.html * accessibility/AXObjectCache.cpp: (WebCore::isNodeAriaVisible): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isAXHidden const): (WebCore::AccessibilityObject::setIsIgnoredFromParentDataForChild): LayoutTests: * accessibility/focusable-inside-hidden-expected.txt: Added. * accessibility/focusable-inside-hidden.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272390 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-04 Chris Fleizach <cfleizach@apple.com> AX: expose focusable elements even if element or ancestor has aria-hidden=true https://bugs.webkit.org/show_bug.cgi?id=220534 <rdar://problem/71865875> Reviewed by Zalan Bujtas. ARIA states that if an item is focused, then it should override aria-hidden status. https://github.com/w3c/aria/pull/1387/files Test: accessibility/focusable-inside-hidden.html * accessibility/AXObjectCache.cpp: (WebCore::isNodeAriaVisible): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isAXHidden const): (WebCore::AccessibilityObject::setIsIgnoredFromParentDataForChild): 2021-02-10 Alan Coon <alancoon@apple.com> Revert r272541. rdar://problem/74208306 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r272345. rdar://problem/74032500 [WebAuthn] Allow one user gesture free prompt for each navigation https://bugs.webkit.org/show_bug.cgi?id=220897 <rdar://problem/73541303> Reviewed by Brent Fulgham. Source/WebCore: * Modules/webauthn/AuthenticatorCoordinator.cpp: (WebCore::AuthenticatorCoordinator::resetUserGestureRequirement): * Modules/webauthn/AuthenticatorCoordinator.h: * Modules/webauthn/AuthenticatorCoordinatorClient.h: * page/Quirks.cpp: * page/Quirks.cpp.h: * replay/UserInputBridge.cpp: (WebCore::UserInputBridge::loadRequest): (WebCore::UserInputBridge::reloadFrame): Adds the ability to reset the user gesture requirement flag for user initiated reloads and quirks. Source/WebKit: This is a quirk that only allows certain websites. Covered by existing tests. * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::filterTransports const): (WebKit::AuthenticatorManager::runPanel): (WebKit::AuthenticatorManager::runPresenter): Cancel the whole WebAuthn operation if no user gesture is indicated. * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: (WebKit::WebAuthenticatorCoordinator::makeCredential): (WebKit::WebAuthenticatorCoordinator::getAssertion): * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.h: Set a boolean to indicate a free coupon for each navigation. Tools: * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm: (TestWebKitAPI::TEST): LayoutTests: * http/wpt/webauthn/ctap-hid-failure.https-expected.txt: * http/wpt/webauthn/ctap-hid-success.https-expected.txt: * http/wpt/webauthn/ctap-nfc-failure.https-expected.txt: * http/wpt/webauthn/idl.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure-hid.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure-local-silent.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure-local.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure-nfc.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure-u2f-silent.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure-u2f.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-failure.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-success-hid.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-success-local.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-success-nfc.https-expected.txt: * http/wpt/webauthn/public-key-credential-create-success-u2f.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure-hid.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure-local-silent.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure-local.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure-nfc.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure-u2f-silent.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure-u2f.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-failure.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-success-hid.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-success-local.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-success-nfc.https-expected.txt: * http/wpt/webauthn/public-key-credential-get-success-u2f.https-expected.txt: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272345 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-03 Jiewen Tan <jiewen_tan@apple.com> [WebAuthn] Allow one user gesture free prompt for each navigation https://bugs.webkit.org/show_bug.cgi?id=220897 <rdar://problem/73541303> Reviewed by Brent Fulgham. * Modules/webauthn/AuthenticatorCoordinator.cpp: (WebCore::AuthenticatorCoordinator::resetUserGestureRequirement): * Modules/webauthn/AuthenticatorCoordinator.h: * Modules/webauthn/AuthenticatorCoordinatorClient.h: * page/Quirks.cpp: * page/Quirks.cpp.h: * replay/UserInputBridge.cpp: (WebCore::UserInputBridge::loadRequest): (WebCore::UserInputBridge::reloadFrame): Adds the ability to reset the user gesture requirement flag for user initiated reloads and quirks. 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r272422. rdar://problem/74033021 Make sure click attribution is processed in case of redirected kept alive loads https://bugs.webkit.org/show_bug.cgi?id=221453 <rdar://problem/70896640> Reviewed by John Wilander. Source/WebCore: Test: http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::addSubresourceLoader): Update assertion to cope with keep alive fetches which are similar to beacon/ping loads. Source/WebKit: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest): Move the click attribution processing before kept alive check. LayoutTests: * http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive-expected.txt: Added. * http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive.html: Added. * http/tests/privateClickMeasurement/resources/redirectToConversion.php: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272422 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-05 Youenn Fablet <youenn@apple.com> Make sure click attribution is processed in case of redirected kept alive loads https://bugs.webkit.org/show_bug.cgi?id=221453 <rdar://problem/70896640> Reviewed by John Wilander. Test: http/tests/privateClickMeasurement/attribution-conversion-through-fetch-keepalive.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::addSubresourceLoader): Update assertion to cope with keep alive fetches which are similar to beacon/ping loads. 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r272368. rdar://problem/74032667 [macOS] Selecting a date on datetime-local inputs unexpectedly adds second and millisecond fields https://bugs.webkit.org/show_bug.cgi?id=221350 <rdar://problem/73943517> Reviewed by Devin Rousso. Source/WebCore: Currently, when setting the value of a datetime-local input using the picker, the length of the current value of the input is used to determine whether or not to return a value with second/millisecond precision. This is approach is incorrect, since the value could be empty, while the step attribute can specify second/millisecond precision. To fix, ensure the DateTimeChooserParameters knows whether the input has second and millisecond fields. That information can then be used by the UIProcess to return a correctly formatted value to the WebProcess. Test: fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-choose-value-from-picker.html * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::handleDOMActivateEvent): (WebCore::BaseDateAndTimeInputType::didChangeValueFromControl): (WebCore::BaseDateAndTimeInputType::setupDateTimeChooserParameters): Moved this method from HTMLInputElement to the input type, since it is specific to date/time input types, and to leverage the existing shouldHaveSecondField and shouldHaveMillisecondField methods when building the DateTimeChooserParameters. * html/BaseDateAndTimeInputType.h: * html/HTMLInputElement.cpp: * html/HTMLInputElement.h: * platform/DateTimeChooserParameters.h: Added hasSecondField and hasMillisecondField members, so that the UIProcess knows whether or not to return a string that contains seconds/milliseconds. (WebCore::DateTimeChooserParameters::encode const): (WebCore::DateTimeChooserParameters::decode): Source/WebKit: * UIProcess/mac/WebDateTimePickerMac.mm: (-[WKDateTimePicker updatePicker:]): (-[WKDateTimePicker dateFormatStringForType:]): Do not use the length of the value to determine whether or seconds and milliseconds should be present, since the value can be empty. Instead, use the new information in DateTimeChooserParameters, matching the visual appearance of the input. Tools: Added a method to UIScriptController to simulate selecting a date using the presented date picker. * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: * TestRunnerShared/UIScriptContext/UIScriptController.h: (WTR::UIScriptController::chooseDateTimePickerValue): * WebKitTestRunner/mac/UIScriptControllerMac.h: * WebKitTestRunner/mac/UIScriptControllerMac.mm: (WTR::UIScriptControllerMac::chooseDateTimePickerValue): LayoutTests: Added a test to to verify that the presence of seconds and milliseconds in the value of a datetime-local input after selecting a date using the picker matches the configuration. * fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-choose-value-from-picker-expected.txt: Added. * fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-choose-value-from-picker.html: Added. * resources/ui-helper.js: (window.UIHelper.chooseDateTimePickerValue): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272368 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-04 Aditya Keerthi <akeerthi@apple.com> [macOS] Selecting a date on datetime-local inputs unexpectedly adds second and millisecond fields https://bugs.webkit.org/show_bug.cgi?id=221350 <rdar://problem/73943517> Reviewed by Devin Rousso. Currently, when setting the value of a datetime-local input using the picker, the length of the current value of the input is used to determine whether or not to return a value with second/millisecond precision. This is approach is incorrect, since the value could be empty, while the step attribute can specify second/millisecond precision. To fix, ensure the DateTimeChooserParameters knows whether the input has second and millisecond fields. That information can then be used by the UIProcess to return a correctly formatted value to the WebProcess. Test: fast/forms/datetimelocal/datetimelocal-editable-components/datetimelocal-choose-value-from-picker.html * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::handleDOMActivateEvent): (WebCore::BaseDateAndTimeInputType::didChangeValueFromControl): (WebCore::BaseDateAndTimeInputType::setupDateTimeChooserParameters): Moved this method from HTMLInputElement to the input type, since it is specific to date/time input types, and to leverage the existing shouldHaveSecondField and shouldHaveMillisecondField methods when building the DateTimeChooserParameters. * html/BaseDateAndTimeInputType.h: * html/HTMLInputElement.cpp: * html/HTMLInputElement.h: * platform/DateTimeChooserParameters.h: Added hasSecondField and hasMillisecondField members, so that the UIProcess knows whether or not to return a string that contains seconds/milliseconds. (WebCore::DateTimeChooserParameters::encode const): (WebCore::DateTimeChooserParameters::decode): 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r272353. rdar://problem/74105476 [Cocoa] WebM audio goes out-of-sync or stops playing after a seek https://bugs.webkit.org/show_bug.cgi?id=221354 <rdar://73471690> Reviewed by Eric Carlson. Source/WebCore: Add a new flag to MediaSample indicating whether the sample has any information about whether it is an sync-sample or not, and expose that through a new method hasSyncInfo(). Drive-by Fix: Force all video samples to contain a sample attachments dictionary, whether or not the sample is sync. Drive-by Fix #2: SampleMap does an equality comparison for `flags() == MediaSample::IsSync`. This breaks as soon as any sample has both `IsSync` and any other flag. Replace with a specific call to `isSync()` instead. * platform/MediaSample.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::doesCMSampleBufferHaveSyncInfo): (WebCore::MediaSampleAVFObjC::flags const): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::VideoTrackData::createSampleBuffer): Source/WebKit: The MTPluginFormatReader will attempt to determine whether an audio sample needs priming frames by querying for, among other things, its "syncInfo". Previously, we had just presumed all samples without a sample attachment dictionary were sync samples, and reported them as such from MediaSampleCursor, but this causes the format reader plugin to walk backwards all the way to the beginning of the audio track looking for priming samples. Instead, since the sample in question has no sync info (it was synthesized by MediaSample), return kCMBaseObjectError_ValueNotAvailable in this case, which causes the plugin format reader to assume all samples are both sync and do not require explicit priming frames. * Shared/mac/MediaFormatReader/MediaSampleCursor.cpp: (WebKit::MediaSampleCursor::getSampleTiming const): (WebKit::MediaSampleCursor::getSyncInfo const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272353 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-03 Jer Noble <jer.noble@apple.com> [Cocoa] WebM audio goes out-of-sync or stops playing after a seek https://bugs.webkit.org/show_bug.cgi?id=221354 <rdar://73471690> Reviewed by Eric Carlson. Add a new flag to MediaSample indicating whether the sample has any information about whether it is an sync-sample or not, and expose that through a new method hasSyncInfo(). Drive-by Fix: Force all video samples to contain a sample attachments dictionary, whether or not the sample is sync. Drive-by Fix #2: SampleMap does an equality comparison for `flags() == MediaSample::IsSync`. This breaks as soon as any sample has both `IsSync` and any other flag. Replace with a specific call to `isSync()` instead. * platform/MediaSample.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::doesCMSampleBufferHaveSyncInfo): (WebCore::MediaSampleAVFObjC::flags const): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::VideoTrackData::createSampleBuffer): 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r272303. rdar://problem/74105623 Animation of "rotate" or "scale" property does not correctly account for static "translate" property https://bugs.webkit.org/show_bug.cgi?id=219894 <rdar://problem/72342798> Unreviewed build fix for Mojave. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateAnimations): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272303 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-01 Antoine Quint <graouts@webkit.org> Animation of "rotate" or "scale" property does not correctly account for static "translate" property https://bugs.webkit.org/show_bug.cgi?id=219894 <rdar://problem/72342798> Unreviewed build fix for Mojave. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateAnimations): 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r272234. rdar://problem/74105068 [macOS] Force loading the HEIF reader symbols before transcoding any HEIF image https://bugs.webkit.org/show_bug.cgi?id=221191 <rdar://problem/70942158> Reviewed by Tim Horton. Source/WebCore: Transcoding the HEIF images requires loading the HEIF reader symbols which is not happening in macOS Catalina. A workaround for this bug in WebKit is to call CGImageSourceGetCount() for the CGImageSource of the HEIF image. * platform/graphics/cg/ImageUtilitiesCG.cpp: (WebCore::transcodeImage): Source/WTF: Add a HAVE macro for the fix of <rdar://problem/59589723>. * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272234 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-02 Said Abou-Hallawa <said@apple.com> [macOS] Force loading the HEIF reader symbols before transcoding any HEIF image https://bugs.webkit.org/show_bug.cgi?id=221191 <rdar://problem/70942158> Reviewed by Tim Horton. Transcoding the HEIF images requires loading the HEIF reader symbols which is not happening in macOS Catalina. A workaround for this bug in WebKit is to call CGImageSourceGetCount() for the CGImageSource of the HEIF image. * platform/graphics/cg/ImageUtilitiesCG.cpp: (WebCore::transcodeImage): 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r272214. rdar://problem/74032646 Unreviewed, address post-landing review comment by Darin Adler for r272211. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::cookiesForURL): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272214 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-02 Chris Dumez <cdumez@apple.com> Unreviewed, address post-landing review comment by Darin Adler for r272211. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::cookiesForURL): 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r272211. rdar://problem/74032646 Crash under NetworkStorageSession::cookiesForSession() https://bugs.webkit.org/show_bug.cgi?id=221227 <rdar://71975008> Reviewed by Geoffrey Garen. Retain NSArray of cookies in NetworkStorageSession::cookiesForSession() for clearer lifetime management. This is a speculative fix for <rdar://71975008>. * platform/network/NetworkStorageSession.h: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::httpCookies const): (WebCore::cookiesForURL): (WebCore::NetworkStorageSession::httpCookiesForURL const): (WebCore::NetworkStorageSession::cookiesForURL const): (WebCore::NetworkStorageSession::cookiesForSession const): (WebCore::NetworkStorageSession::getRawCookies const): (WebCore::NetworkStorageSession::deleteCookie const): (WebCore::NetworkStorageSession::getHostnamesWithCookies): (WebCore::NetworkStorageSession::deleteCookiesForHostnames): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272211 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-02 Chris Dumez <cdumez@apple.com> Crash under NetworkStorageSession::cookiesForSession() https://bugs.webkit.org/show_bug.cgi?id=221227 <rdar://71975008> Reviewed by Geoffrey Garen. Retain NSArray of cookies in NetworkStorageSession::cookiesForSession() for clearer lifetime management. This is a speculative fix for <rdar://71975008>. * platform/network/NetworkStorageSession.h: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::httpCookies const): (WebCore::cookiesForURL): (WebCore::NetworkStorageSession::httpCookiesForURL const): (WebCore::NetworkStorageSession::cookiesForURL const): (WebCore::NetworkStorageSession::cookiesForSession const): (WebCore::NetworkStorageSession::getRawCookies const): (WebCore::NetworkStorageSession::deleteCookie const): (WebCore::NetworkStorageSession::getHostnamesWithCookies): (WebCore::NetworkStorageSession::deleteCookiesForHostnames): 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r272201. rdar://problem/74105623 Animation of "rotate" or "scale" property does not correctly account for static "translate" property https://bugs.webkit.org/show_bug.cgi?id=219894 <rdar://problem/72342798> Reviewed by Dean Jackson. Source/WebCore: The CSS transform-related properties are designed to be applied in a specific order, guaranteeing that "translate" is applied prior to both "scale" and "rotate". Since Core Animation has no concept of these individual transform-related CSS properties, we use additive Core Animation animations to apply the value of each CSS property, using non-interpolating animations set to start at the earliest time in the Core Animation timeline and lasting forever to set the value of any underlying, non-animated value. As such, in an example where an element would have a static "translate" property set as well as a "rotate" or "scale" animation, we would yield the following animations, added in this order: 1. non-interpolating animation beginning at 1s setting the identity transform (the "clean slate" animation) 2. interpolating animation beginning at a time > 1s for the "scale" or "rotate" animation 3. non-interpolating animation beginning at 1s setting the "translate" value Note that animations 2 and 3 are additive and thus added in the inverse order that we expect animations to be applied. Due to a peculiarity of Core Animation (introduced in macOS 10.15), additive animations are applied in an inverse order, hence the build-time flag CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED. However, Core Animation will first sort all animations based on their begin time, only respecting the order in which animations are added when their begin time is equal. This means that in practice, our animations were applied in the order 1, 3, 2, and thus the "translate" property was applied after the "rotate" or "scale" animation. In order to address this, we now create a CAAnimationGroup for each set of animations created for a given CSS property. Each of these groups shares the same begin time, 1s, to allow for "forever" non-interpolating animations to be applied, but also to set a common base time for animations to be applied in the expected order. Tests: webanimations/relative-ordering-of-translate-and-rotate-properties-accelerated.html webanimations/relative-ordering-of-translate-and-scale-properties-accelerated.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateAnimations): * platform/graphics/ca/GraphicsLayerCA.h: (WebCore::GraphicsLayerCA::LayerPropertyAnimation::computedBeginTime const): LayoutTests: Add two new tests that ensure that translate is indeed applied before rotate and scale. * webanimations/relative-ordering-of-translate-and-rotate-properties-accelerated-expected.html: Added. * webanimations/relative-ordering-of-translate-and-rotate-properties-accelerated.html: Added. * webanimations/relative-ordering-of-translate-and-scale-properties-accelerated-expected.html: Added. * webanimations/relative-ordering-of-translate-and-scale-properties-accelerated.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272201 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-01 Antoine Quint <graouts@webkit.org> Animation of "rotate" or "scale" property does not correctly account for static "translate" property https://bugs.webkit.org/show_bug.cgi?id=219894 <rdar://problem/72342798> Reviewed by Dean Jackson. The CSS transform-related properties are designed to be applied in a specific order, guaranteeing that "translate" is applied prior to both "scale" and "rotate". Since Core Animation has no concept of these individual transform-related CSS properties, we use additive Core Animation animations to apply the value of each CSS property, using non-interpolating animations set to start at the earliest time in the Core Animation timeline and lasting forever to set the value of any underlying, non-animated value. As such, in an example where an element would have a static "translate" property set as well as a "rotate" or "scale" animation, we would yield the following animations, added in this order: 1. non-interpolating animation beginning at 1s setting the identity transform (the "clean slate" animation) 2. interpolating animation beginning at a time > 1s for the "scale" or "rotate" animation 3. non-interpolating animation beginning at 1s setting the "translate" value Note that animations 2 and 3 are additive and thus added in the inverse order that we expect animations to be applied. Due to a peculiarity of Core Animation (introduced in macOS 10.15), additive animations are applied in an inverse order, hence the build-time flag CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED. However, Core Animation will first sort all animations based on their begin time, only respecting the order in which animations are added when their begin time is equal. This means that in practice, our animations were applied in the order 1, 3, 2, and thus the "translate" property was applied after the "rotate" or "scale" animation. In order to address this, we now create a CAAnimationGroup for each set of animations created for a given CSS property. Each of these groups shares the same begin time, 1s, to allow for "forever" non-interpolating animations to be applied, but also to set a common base time for animations to be applied in the expected order. Tests: webanimations/relative-ordering-of-translate-and-rotate-properties-accelerated.html webanimations/relative-ordering-of-translate-and-scale-properties-accelerated.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateAnimations): * platform/graphics/ca/GraphicsLayerCA.h: (WebCore::GraphicsLayerCA::LayerPropertyAnimation::computedBeginTime const): 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r272188. rdar://problem/74032553 [Cocoa] Disable interstitial events on AVPlayerItem. https://bugs.webkit.org/show_bug.cgi?id=221215 Reviewed by Eric Carlson. Source/WebCore: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Source/WebCore/PAL: * pal/spi/cocoa/AVFoundationSPI.h: Source/WTF: * wtf/PlatformHave.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272188 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-01 Jer Noble <jer.noble@apple.com> [Cocoa] Disable interstitial events on AVPlayerItem. https://bugs.webkit.org/show_bug.cgi?id=221215 Reviewed by Eric Carlson. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r272185. rdar://problem/74032429 REGRESSION (iOS 14.2): Can't play html audio with muted attribute https://bugs.webkit.org/show_bug.cgi?id=219295 <rdar://problem/71863148> Reviewed by Eric Carlson. In r266844, we added a power-saving feature that would disable the audio decoder for initially muted media elements. However, this caused an issue for .mp3 files, where the duration of the track is computed by the decoder, and not the parser. Since the goal of the power-saving feature was to reduce the CPU cost for decoding a muted audio track on a <video> element, partially revert this change by making it apply only to <video> elements and not <audio> ones. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272185 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-01 Jer Noble <jer.noble@apple.com> REGRESSION (iOS 14.2): Can't play html audio with muted attribute https://bugs.webkit.org/show_bug.cgi?id=219295 <rdar://problem/71863148> Reviewed by Eric Carlson. In r266844, we added a power-saving feature that would disable the audio decoder for initially muted media elements. However, this caused an issue for .mp3 files, where the duration of the track is computed by the decoder, and not the parser. Since the goal of the power-saving feature was to reduce the CPU cost for decoding a muted audio track on a <video> element, partially revert this change by making it apply only to <video> elements and not <audio> ones. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r272178. rdar://problem/74105398 Allow support for CAAnimationGroup https://bugs.webkit.org/show_bug.cgi?id=221209 Reviewed by Dean Jackson, Sam Weinig and Simon Fraser. In order to fix bug 219894, we need to use Core Animation's CAAnimationGroup and its Source/WebCore: setAnimations() method. This patch adds a new "Group" type to PlatformCAAnimation and platform-specific integration for Windows and Cocoa ports. * platform/graphics/ca/PlatformCAAnimation.cpp: (WebCore::operator<<): * platform/graphics/ca/PlatformCAAnimation.h: * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h: * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: (WebCore::PlatformCAAnimationCocoa::PlatformCAAnimationCocoa): (WebCore::PlatformCAAnimationCocoa::keyPath const): (WebCore::PlatformCAAnimationCocoa::setTimingFunction): (WebCore::PlatformCAAnimationCocoa::isAdditive const): (WebCore::PlatformCAAnimationCocoa::setAdditive): (WebCore::PlatformCAAnimationCocoa::valueFunction const): (WebCore::PlatformCAAnimationCocoa::setValueFunction): (WebCore::PlatformCAAnimationCocoa::setFromValue): (WebCore::PlatformCAAnimationCocoa::copyFromValueFrom): (WebCore::PlatformCAAnimationCocoa::setToValue): (WebCore::PlatformCAAnimationCocoa::copyToValueFrom): (WebCore::PlatformCAAnimationCocoa::setValues): (WebCore::PlatformCAAnimationCocoa::copyValuesFrom): (WebCore::PlatformCAAnimationCocoa::setKeyTimes): (WebCore::PlatformCAAnimationCocoa::copyKeyTimesFrom): (WebCore::PlatformCAAnimationCocoa::setTimingFunctions): (WebCore::PlatformCAAnimationCocoa::copyTimingFunctionsFrom): (WebCore::PlatformCAAnimationCocoa::setAnimations): (WebCore::PlatformCAAnimationCocoa::copyAnimationsFrom): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::addAnimationForKey): (WebCore::PlatformCALayerCocoa::animationForKey): * platform/graphics/ca/win/PlatformCAAnimationWin.cpp: (PlatformCAAnimationWin::PlatformCAAnimationWin): (PlatformCAAnimationWin::setAnimations): (PlatformCAAnimationWin::copyAnimationsFrom): * platform/graphics/ca/win/PlatformCAAnimationWin.h: Source/WebKit: setAnimations() method. Add support for the new "Group" PlatformCAAnimation type for the remote animations. * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h: * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: (WebKit::PlatformCAAnimationRemote::Properties::encode const): (WebKit::PlatformCAAnimationRemote::Properties::decode): (WebKit::PlatformCAAnimationRemote::copy const): (WebKit::PlatformCAAnimationRemote::setAnimations): (WebKit::PlatformCAAnimationRemote::copyAnimationsFrom): (WebKit::createAnimation): (WebKit::addAnimationToLayer): (WebKit::operator<<): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272178 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-01 Antoine Quint <graouts@webkit.org> Allow support for CAAnimationGroup https://bugs.webkit.org/show_bug.cgi?id=221209 Reviewed by Dean Jackson, Sam Weinig and Simon Fraser. In order to fix bug 219894, we need to use Core Animation's CAAnimationGroup and its setAnimations() method. This patch adds a new "Group" type to PlatformCAAnimation and platform-specific integration for Windows and Cocoa ports. * platform/graphics/ca/PlatformCAAnimation.cpp: (WebCore::operator<<): * platform/graphics/ca/PlatformCAAnimation.h: * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h: * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: (WebCore::PlatformCAAnimationCocoa::PlatformCAAnimationCocoa): (WebCore::PlatformCAAnimationCocoa::keyPath const): (WebCore::PlatformCAAnimationCocoa::setTimingFunction): (WebCore::PlatformCAAnimationCocoa::isAdditive const): (WebCore::PlatformCAAnimationCocoa::setAdditive): (WebCore::PlatformCAAnimationCocoa::valueFunction const): (WebCore::PlatformCAAnimationCocoa::setValueFunction): (WebCore::PlatformCAAnimationCocoa::setFromValue): (WebCore::PlatformCAAnimationCocoa::copyFromValueFrom): (WebCore::PlatformCAAnimationCocoa::setToValue): (WebCore::PlatformCAAnimationCocoa::copyToValueFrom): (WebCore::PlatformCAAnimationCocoa::setValues): (WebCore::PlatformCAAnimationCocoa::copyValuesFrom): (WebCore::PlatformCAAnimationCocoa::setKeyTimes): (WebCore::PlatformCAAnimationCocoa::copyKeyTimesFrom): (WebCore::PlatformCAAnimationCocoa::setTimingFunctions): (WebCore::PlatformCAAnimationCocoa::copyTimingFunctionsFrom): (WebCore::PlatformCAAnimationCocoa::setAnimations): (WebCore::PlatformCAAnimationCocoa::copyAnimationsFrom): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::addAnimationForKey): (WebCore::PlatformCALayerCocoa::animationForKey): * platform/graphics/ca/win/PlatformCAAnimationWin.cpp: (PlatformCAAnimationWin::PlatformCAAnimationWin): (PlatformCAAnimationWin::setAnimations): (PlatformCAAnimationWin::copyAnimationsFrom): * platform/graphics/ca/win/PlatformCAAnimationWin.h: 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r272166. rdar://problem/74032437 ReadableStream C++ methods should check for exception https://bugs.webkit.org/show_bug.cgi?id=215376 <rdar://problem/66816192> Reviewed by Alex Christensen. Source/WebCore: Refactor code to catch and handle exceptions in case of ReadableStream methods. Exceptions can happen in case of worker being abruptly terminated, which can only be tested flakily. In case of tee, if an exception happens, we return a WTF::nullopt. Test: streams/readable-stream-tee-worker.html * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::clone): * bindings/js/ReadableStream.cpp: (WebCore::invokeReadableStreamFunction): (WebCore::ReadableStream::pipeTo): (WebCore::ReadableStream::tee): (WebCore::ReadableStream::lock): (WebCore::checkReadableStream): * bindings/js/ReadableStream.h: LayoutTests: * streams/readable-stream-tee-worker-expected.txt: Added. * streams/readable-stream-tee-worker.html: Added. * streams/readable-stream-tee.js: Added. (teeRepetitively): (test): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272166 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-02-01 Youenn Fablet <youenn@apple.com> ReadableStream C++ methods should check for exception https://bugs.webkit.org/show_bug.cgi?id=215376 <rdar://problem/66816192> Reviewed by Alex Christensen. Refactor code to catch and handle exceptions in case of ReadableStream methods. Exceptions can happen in case of worker being abruptly terminated, which can only be tested flakily. In case of tee, if an exception happens, we return a WTF::nullopt. Test: streams/readable-stream-tee-worker.html * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::clone): * bindings/js/ReadableStream.cpp: (WebCore::invokeReadableStreamFunction): (WebCore::ReadableStream::pipeTo): (WebCore::ReadableStream::tee): (WebCore::ReadableStream::lock): (WebCore::checkReadableStream): * bindings/js/ReadableStream.h: 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r271686. rdar://problem/74032451 Further propagate ChildChange::Source to optimize HTMLInputElement creation https://bugs.webkit.org/show_bug.cgi?id=220785 Reviewed by Ryosuke Niwa. This patch further propagates ChildChange::Source to optimize HTMLInputElement creation. We add appendChild method taking ChildChange::Source to transparently pick the efficient one based on the parameter. * dom/ContainerNode.cpp: (WebCore::ContainerNode::appendChild): * dom/ContainerNode.h: * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/ColorInputType.cpp: (WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/FileInputType.cpp: (WebCore::FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/RangeInputType.cpp: (WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271686 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-20 Yusuke Suzuki <ysuzuki@apple.com> Further propagate ChildChange::Source to optimize HTMLInputElement creation https://bugs.webkit.org/show_bug.cgi?id=220785 Reviewed by Ryosuke Niwa. This patch further propagates ChildChange::Source to optimize HTMLInputElement creation. We add appendChild method taking ChildChange::Source to transparently pick the efficient one based on the parameter. * dom/ContainerNode.cpp: (WebCore::ContainerNode::appendChild): * dom/ContainerNode.h: * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/ColorInputType.cpp: (WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/FileInputType.cpp: (WebCore::FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/RangeInputType.cpp: (WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): 2021-02-08 Russell Epstein <repstein@apple.com> Cherry-pick r271672. rdar://problem/74105677 Accelerate HTMLInputElement creation https://bugs.webkit.org/show_bug.cgi?id=220758 Reviewed by Simon Fraser. HTMLInputElement creation is too slow. 1. InputType is excessively using virtual dispatching, which is too slow for hot path. 2. HTMLInputElement creates internal elements as a shadow DOM and its creation is too generic. 3. We are setting inner text element's editability in a very generic way. This allocates ElementData for each elements while attributes are almost the same. In this patch, 1. We add m_type field in InputType, and for the hot path, we attempt to devirtualize things due to performance problem. 2. We pass "parsing phase" information to shadow DOM creation to make them fast. 3. We initialize editibility when creating TextControlInnerTextElement. And we use parserSetAttributes to set shared ElementData. This is faster and less memory. 4. We also shrink sizeof(Style::Scope) to reduce size of allocation when using shadow DOM. This change offers 1% progression in Speedometer2/jQuery. * html/BaseButtonInputType.h: (WebCore::BaseButtonInputType::BaseButtonInputType): * html/BaseCheckableInputType.h: (WebCore::BaseCheckableInputType::BaseCheckableInputType): * html/BaseClickableWithKeyInputType.h: (WebCore::BaseClickableWithKeyInputType::BaseClickableWithKeyInputType): * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::isSteppableSlow const): (WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): (WebCore::BaseDateAndTimeInputType::isSteppable const): Deleted. (WebCore::BaseDateAndTimeInputType::createShadowSubtree): Deleted. * html/BaseDateAndTimeInputType.h: (WebCore::BaseDateAndTimeInputType::BaseDateAndTimeInputType): * html/BaseTextInputType.h: (WebCore::BaseTextInputType::BaseTextInputType): * html/ButtonInputType.h: * html/CheckboxInputType.h: * html/ColorInputType.cpp: (WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): (WebCore::ColorInputType::createShadowSubtree): Deleted. * html/ColorInputType.h: * html/DateInputType.cpp: (WebCore::DateInputType::DateInputType): * html/DateInputType.h: * html/DateTimeLocalInputType.h: * html/EmailInputType.h: * html/FileInputType.cpp: (WebCore::FileInputType::FileInputType): (WebCore::FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): (WebCore::FileInputType::createShadowSubtree): Deleted. * html/FileInputType.h: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::didAddUserAgentShadowRoot): (WebCore::HTMLInputElement::isValid const): (WebCore::HTMLInputElement::updateType): * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::didAddUserAgentShadowRoot): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability): * html/HiddenInputType.h: * html/ImageInputType.cpp: (WebCore::ImageInputType::ImageInputType): * html/ImageInputType.h: * html/InputType.cpp: (WebCore::InputType::isInvalid const): (WebCore::InputType::createShadowSubtreeAndUpdateInnerTextElementEditability): (WebCore::InputType::isSteppable const): (WebCore::InputType::createShadowSubtree): Deleted. * html/InputType.h: (WebCore::InputType::InputType): (WebCore::InputType::isSteppableSlow const): (WebCore::isInvalidInputType): * html/MonthInputType.h: * html/NumberInputType.cpp: (WebCore::NumberInputType::isSteppableSlow const): (WebCore::NumberInputType::isSteppable const): Deleted. * html/NumberInputType.h: * html/PasswordInputType.h: * html/RadioInputType.h: * html/RangeInputType.cpp: (WebCore::RangeInputType::RangeInputType): (WebCore::RangeInputType::isSteppableSlow const): (WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): (WebCore::RangeInputType::isSteppable const): Deleted. (WebCore::RangeInputType::createShadowSubtree): Deleted. * html/RangeInputType.h: * html/ResetInputType.h: * html/SearchInputType.cpp: (WebCore::SearchInputType::SearchInputType): (WebCore::SearchInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): (WebCore::SearchInputType::createShadowSubtree): Deleted. * html/SearchInputType.h: * html/SubmitInputType.h: * html/TelephoneInputType.h: * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::TextFieldInputType): (WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): (WebCore::TextFieldInputType::createShadowSubtree): Deleted. * html/TextFieldInputType.h: * html/TextInputType.h: * html/TimeInputType.cpp: (WebCore::TimeInputType::TimeInputType): * html/TimeInputType.h: * html/URLInputType.h: * html/WeekInputType.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerTextElement::create): (WebCore::TextControlInnerTextElement::updateInnerTextElementEditabilityImpl): * html/shadow/TextControlInnerElements.h: * style/StyleScope.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271672 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-20 Yusuke Suzuki <ysuzuki@apple.com> Accelerate HTMLInputElement creation https://bugs.webkit.org/show_bug.cgi?id=220758 Reviewed by Simon Fraser. HTMLInputElement creation is too slow. 1. InputType is excessively using virtual dispatching, which is too slow for hot path. 2. HTMLInputElement creates internal elements as a shadow DOM and its creation is too generic. 3. We are setting inner text element's editability in a very generic way. This allocates ElementData for each elements while attributes are almost the same. In this patch, 1. We add m_type field in InputType, and for the hot path, we attempt to devirtualize things due to performance problem. 2. We pass "parsing phase" information to shadow DOM creation to make them fast. 3. We initialize editibility when creating TextControlInnerTextElement. And we use parserSetAttributes to set shared ElementData. This is faster and less memory. 4. We also shrink sizeof(Style::Scope) to reduce size of allocation when using shadow DOM. This change offers 1% progression in Speedometer2/jQuery. * html/BaseButtonInputType.h: (WebCore::BaseButtonInputType::BaseButtonInputType): * html/BaseCheckableInputType.h: (WebCore::BaseCheckableInputType::BaseCheckableInputType): * html/BaseClickableWithKeyInputType.h: (WebCore::BaseClickableWithKeyInputType::BaseClickableWithKeyInputType): * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::isSteppableSlow const): (WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): (WebCore::BaseDateAndTimeInputType::isSteppable const): Deleted. (WebCore::BaseDateAndTimeInputType::createShadowSubtree): Deleted. * html/BaseDateAndTimeInputType.h: (WebCore::BaseDateAndTimeInputType::BaseDateAndTimeInputType): * html/BaseTextInputType.h: (WebCore::BaseTextInputType::BaseTextInputType): * html/ButtonInputType.h: * html/CheckboxInputType.h: * html/ColorInputType.cpp: (WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): (WebCore::ColorInputType::createShadowSubtree): Deleted. * html/ColorInputType.h: * html/DateInputType.cpp: (WebCore::DateInputType::DateInputType): * html/DateInputType.h: * html/DateTimeLocalInputType.h: * html/EmailInputType.h: * html/FileInputType.cpp: (WebCore::FileInputType::FileInputType): (WebCore::FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): (WebCore::FileInputType::createShadowSubtree): Deleted. * html/FileInputType.h: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::didAddUserAgentShadowRoot): (WebCore::HTMLInputElement::isValid const): (WebCore::HTMLInputElement::updateType): * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::didAddUserAgentShadowRoot): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability): * html/HiddenInputType.h: * html/ImageInputType.cpp: (WebCore::ImageInputType::ImageInputType): * html/ImageInputType.h: * html/InputType.cpp: (WebCore::InputType::isInvalid const): (WebCore::InputType::createShadowSubtreeAndUpdateInnerTextElementEditability): (WebCore::InputType::isSteppable const): (WebCore::InputType::createShadowSubtree): Deleted. * html/InputType.h: (WebCore::InputType::InputType): (WebCore::InputType::isSteppableSlow const): (WebCore::isInvalidInputType): * html/MonthInputType.h: * html/NumberInputType.cpp: (WebCore::NumberInputType::isSteppableSlow const): (WebCore::NumberInputType::isSteppable const): Deleted. * html/NumberInputType.h: * html/PasswordInputType.h: * html/RadioInputType.h: * html/RangeInputType.cpp: (WebCore::RangeInputType::RangeInputType): (WebCore::RangeInputType::isSteppableSlow const): (WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): (WebCore::RangeInputType::isSteppable const): Deleted. (WebCore::RangeInputType::createShadowSubtree): Deleted. * html/RangeInputType.h: * html/ResetInputType.h: * html/SearchInputType.cpp: (WebCore::SearchInputType::SearchInputType): (WebCore::SearchInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): (WebCore::SearchInputType::createShadowSubtree): Deleted. * html/SearchInputType.h: * html/SubmitInputType.h: * html/TelephoneInputType.h: * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::TextFieldInputType): (WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): (WebCore::TextFieldInputType::createShadowSubtree): Deleted. * html/TextFieldInputType.h: * html/TextInputType.h: * html/TimeInputType.cpp: (WebCore::TimeInputType::TimeInputType): * html/TimeInputType.h: * html/URLInputType.h: * html/WeekInputType.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerTextElement::create): (WebCore::TextControlInnerTextElement::updateInnerTextElementEditabilityImpl): * html/shadow/TextControlInnerElements.h: * style/StyleScope.h: 2021-02-03 Russell Epstein <repstein@apple.com> Apply patch. rdar://problem/73890906 2021-02-03 Peng Liu <peng.liu6@apple.com> Twitter PiP video pauses when scrolling https://bugs.webkit.org/show_bug.cgi?id=220887 This patch adds two quirks (requiresUserGestureToPauseInPictureInPicture and requiresUserGestureToLoadInPictureInPicture) for twitter.com, so that when we scroll the page while a video is in picture-in-picture, the video won't pause or close. This patch also fixes a race condition related to function MediaElementSession::playbackPermitted() by adding a parameter (MediaPlaybackOperation) to it. Because of the race condition, we cannot resume a paused video in a picture-in-picture window on some sites (e.g., twitter.com). That happens because when we click the play button on the picture-in-picture window to resume a video, MediaElementSession::playbackPermitted() will be called by HTMLMediaElement::mediaPlayerDidAddAudioTrack() when HTMLMediaElement::pause() returns false (means the playback has already been resumed), so the request to add audio track will be rejected due to the requiresUserGestureToPauseInPictureInPicture quirk and the video will be paused. This patch fixes this race condition by enabling the requiresUserGestureToPauseInPictureInPicture quirk only when the playback operation is "pause". Reviewed by Eric Carlson. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::load): (WebCore::HTMLMediaElement::pause): (WebCore::HTMLMediaElement::suspendPlayback): We should use pauseInternal() instead of pause() here, otherwise, it will be prevented by the requiresUserGestureToPauseInPictureInPicture quirk. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::playbackPermitted const): * html/MediaElementSession.h: * page/Quirks.cpp: (WebCore::Quirks::requiresUserGestureToPauseInPictureInPicture const): (WebCore::Quirks::requiresUserGestureToLoadInPictureInPicture const): * page/Quirks.h: 2021-02-03 Russell Epstein <repstein@apple.com> Apply patch. rdar://problem/73904694 2021-02-03 Jer Noble <jer.noble@apple.com> Facebook pauses video in PiP during scroll https://bugs.webkit.org/show_bug.cgi?id=220581 <rdar://67273166> Reviewed by Eric Carlson. Add a Quirk which blocks Facebook from pausing videos in Picture-in-Picture mode without that pause() occurring during a User Gesture. This blocks Facebook from pausing a PiP'd video when the <video> element hosting that video scrolls out of the viewport, without blocking Facebook's own custom pause control from working correctly. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::playbackPermitted const): * page/Quirks.cpp: (WebCore::Quirks::requiresUserGestureToPauseInPictureInPicture const): * page/Quirks.h: 2021-02-03 Russell Epstein <repstein@apple.com> Cherry-pick r271898. rdar://problem/73935028 ScopedHighPerformanceGPURequest.h not marked framework private https://bugs.webkit.org/show_bug.cgi?id=220989 Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-01-26 Reviewed by Simon Fraser. The header was listed twice in the project, causing build failures. No new tests, build fix. * WebCore.xcodeproj/project.pbxproj: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271898 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-26 Kimmo Kinnunen <kkinnunen@apple.com> ScopedHighPerformanceGPURequest.h not marked framework private https://bugs.webkit.org/show_bug.cgi?id=220989 Reviewed by Simon Fraser. The header was listed twice in the project, causing build failures. No new tests, build fix. * WebCore.xcodeproj/project.pbxproj: 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271730. rdar://problem/73890237 Scroll-chaining not triggering before complete end of overscroll https://bugs.webkit.org/show_bug.cgi?id=219960 <rdar://problem/72595521> Reviewed by Tim Horton. Source/WebCore: Scroll latching for momentum scrolls was too sticky; it would keep latching to the same scroller within a 100ms of the last event that was handled, which was exacerbated by the fact that ScrollController can go into "ignoreMomentumScrolls" mode which results in no visible scrolling but continued consumption of momentum wheel events. Fix by releasing the latch as soon as we see the end of a momentum scroll, so that we always re-evaluate latching at the start of the next gesture. Tested by fast/scrolling/latching/nested-cross-axis-latch-expiration.html * page/scrolling/ScrollingTreeLatchingController.cpp: (WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent): LayoutTests: Adjusted test for new behavior. No longer need WK1 result. * fast/scrolling/latching/nested-cross-axis-latch-expiration-expected.txt: * fast/scrolling/latching/nested-cross-axis-latch-expiration.html: * platform/mac-wk1/fast/scrolling/latching/nested-cross-axis-latch-expiration-expected.txt: Removed. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271730 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-21 Simon Fraser <simon.fraser@apple.com> Scroll-chaining not triggering before complete end of overscroll https://bugs.webkit.org/show_bug.cgi?id=219960 <rdar://problem/72595521> Reviewed by Tim Horton. Scroll latching for momentum scrolls was too sticky; it would keep latching to the same scroller within a 100ms of the last event that was handled, which was exacerbated by the fact that ScrollController can go into "ignoreMomentumScrolls" mode which results in no visible scrolling but continued consumption of momentum wheel events. Fix by releasing the latch as soon as we see the end of a momentum scroll, so that we always re-evaluate latching at the start of the next gesture. Tested by fast/scrolling/latching/nested-cross-axis-latch-expiration.html * page/scrolling/ScrollingTreeLatchingController.cpp: (WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271701. rdar://problem/73889964 Source/WebCore: REGRESSION (Async overflow): Scroll stutters/blocked with nested scrolling https://bugs.webkit.org/show_bug.cgi?id=219923 <rdar://72390196> Reviewed by Sam Weinig. When handling wheel events in overflow:scroll areas which are only scrollable on one axis, particularly when nested, we need to account for the different scrollability on each axis in a couple of places. First, address the FIXME in ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection() by consulting node scrollability; this prevents attempts to rubberband on a non-scrollable axis. Second, ScrollController should only allow stretching on a scrollable axis. The effects of these changes are that we no longer keep sending events to a node which ends up not handling them; this resulted in latching "timing out", re-hit-testing in the middle of a gesture and causing stuttery position changes on a different scroller. Tests: fast/scrolling/latching/nested-cross-axis-latch-expiration.html fast/scrolling/latching/overflow-hidden-on-one-axis.html * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection const): * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): * rendering/RenderLayerScrollableArea.cpp: (WebCore::RenderLayerScrollableArea::scrollTo): Add the scrollingNodeID to the logging. LayoutTests: REGRESSION (?): Scroll stutters/blocked with nested scrolling https://bugs.webkit.org/show_bug.cgi?id=219923 <rdar://72390196> Reviewed by Sam Weinig. * fast/scrolling/latching/nested-cross-axis-latch-expiration-expected.txt: Added. * fast/scrolling/latching/nested-cross-axis-latch-expiration.html: Added. * fast/scrolling/latching/overflow-hidden-on-one-axis-expected.txt: Added. * fast/scrolling/latching/overflow-hidden-on-one-axis.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271701 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-21 Simon Fraser <simon.fraser@apple.com> REGRESSION (Async overflow): Scroll stutters/blocked with nested scrolling https://bugs.webkit.org/show_bug.cgi?id=219923 <rdar://72390196> Reviewed by Sam Weinig. When handling wheel events in overflow:scroll areas which are only scrollable on one axis, particularly when nested, we need to account for the different scrollability on each axis in a couple of places. First, address the FIXME in ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection() by consulting node scrollability; this prevents attempts to rubberband on a non-scrollable axis. Second, ScrollController should only allow stretching on a scrollable axis. The effects of these changes are that we no longer keep sending events to a node which ends up not handling them; this resulted in latching "timing out", re-hit-testing in the middle of a gesture and causing stuttery position changes on a different scroller. Tests: fast/scrolling/latching/nested-cross-axis-latch-expiration.html fast/scrolling/latching/overflow-hidden-on-one-axis.html * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection const): * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): * rendering/RenderLayerScrollableArea.cpp: (WebCore::RenderLayerScrollableArea::scrollTo): Add the scrollingNodeID to the logging. 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r272073. rdar://problem/73847891 font-stretch is not applied to system-ui https://bugs.webkit.org/show_bug.cgi?id=221103 <rdar://problem/73719139> Reviewed by Darin Adler. Source/WebCore: We just never hooked it up. Tests: fast/text/system-font-width-2.html fast/text/system-font-width-3.html fast/text/system-font-width-4.html fast/text/system-font-width-5.html fast/text/system-font-width-6.html fast/text/system-font-width-7.html fast/text/system-font-width-8.html fast/text/system-font-width-9.html fast/text/system-font-width.html * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: (WebCore::SystemFontDatabaseCoreText::createSystemUIFont): (WebCore::SystemFontDatabaseCoreText::createSystemDesignFont): (WebCore::SystemFontDatabaseCoreText::createTextStyleFont): (WebCore::SystemFontDatabaseCoreText::createFontByApplyingWeightWidthItalicsAndFallbackBehavior): (WebCore::mapWeight): (WebCore::mapWidth): (WebCore::SystemFontDatabaseCoreText::systemFontParameters): (WebCore::SystemFontDatabaseCoreText::createFontByApplyingWeightItalicsAndFallbackBehavior): Deleted. * platform/graphics/cocoa/SystemFontDatabaseCoreText.h: (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::operator== const): (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::hash const): Source/WebCore/PAL: * pal/spi/cocoa/CoreTextSPI.h: Source/WTF: * wtf/PlatformHave.h: LayoutTests: * fast/text/system-font-width-2-expected-mismatch.html: Added. * fast/text/system-font-width-2.html: Added. * fast/text/system-font-width-3-expected-mismatch.html: Added. * fast/text/system-font-width-3.html: Added. * fast/text/system-font-width-4-expected-mismatch.html: Added. * fast/text/system-font-width-4.html: Added. * fast/text/system-font-width-5-expected.html: Added. * fast/text/system-font-width-5.html: Added. * fast/text/system-font-width-6-expected-mismatch.html: Added. * fast/text/system-font-width-6.html: Added. * fast/text/system-font-width-7-expected-mismatch.html: Added. * fast/text/system-font-width-7.html: Added. * fast/text/system-font-width-8-expected-mismatch.html: Added. * fast/text/system-font-width-8.html: Added. * fast/text/system-font-width-9-expected-mismatch.html: Added. * fast/text/system-font-width-9.html: Added. * fast/text/system-font-width-expected-mismatch.html: Added. * fast/text/system-font-width.html: Added. * platform/ios/TestExpectations: * platform/mac/TestExpectations: * platform/win/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272073 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-29 Myles C. Maxfield <mmaxfield@apple.com> font-stretch is not applied to system-ui https://bugs.webkit.org/show_bug.cgi?id=221103 <rdar://problem/73719139> Reviewed by Darin Adler. We just never hooked it up. Tests: fast/text/system-font-width-2.html fast/text/system-font-width-3.html fast/text/system-font-width-4.html fast/text/system-font-width-5.html fast/text/system-font-width-6.html fast/text/system-font-width-7.html fast/text/system-font-width-8.html fast/text/system-font-width-9.html fast/text/system-font-width.html * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: (WebCore::SystemFontDatabaseCoreText::createSystemUIFont): (WebCore::SystemFontDatabaseCoreText::createSystemDesignFont): (WebCore::SystemFontDatabaseCoreText::createTextStyleFont): (WebCore::SystemFontDatabaseCoreText::createFontByApplyingWeightWidthItalicsAndFallbackBehavior): (WebCore::mapWeight): (WebCore::mapWidth): (WebCore::SystemFontDatabaseCoreText::systemFontParameters): (WebCore::SystemFontDatabaseCoreText::createFontByApplyingWeightItalicsAndFallbackBehavior): Deleted. * platform/graphics/cocoa/SystemFontDatabaseCoreText.h: (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::operator== const): (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::hash const): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r272024. rdar://problem/73847822 AX: Long narrow tables should not be made in data tables unnecessarily https://bugs.webkit.org/show_bug.cgi?id=221061 <rdar://problem/73681149> Reviewed by Zalan Bujtas. Source/WebCore: Some web authors use long columns/rows of cells for layout purposes. We shouldn't automatically turn these into data tables based on row count only. Instead let's ensure there are at least two rows/cols of content before automatically turning into a data table. Test: accessibility/narrow-tables-ignored.html * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable const): LayoutTests: * accessibility/narrow-tables-ignored-expected.txt: Added. * accessibility/narrow-tables-ignored.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272024 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-28 Chris Fleizach <cfleizach@apple.com> AX: Long narrow tables should not be made in data tables unnecessarily https://bugs.webkit.org/show_bug.cgi?id=221061 <rdar://problem/73681149> Reviewed by Zalan Bujtas. Some web authors use long columns/rows of cells for layout purposes. We shouldn't automatically turn these into data tables based on row count only. Instead let's ensure there are at least two rows/cols of content before automatically turning into a data table. Test: accessibility/narrow-tables-ignored.html * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable const): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271958. rdar://problem/73887977 Use SFTranscription instead of SFTranscriptionSegment for SpeechRecognitionAlternative https://bugs.webkit.org/show_bug.cgi?id=221026 Patch by Sihui Liu <sihui_liu@appe.com> on 2021-01-27 Reviewed by Youenn Fablet. So SpeechRecognitionAlternative contains a sentence instead of a word, which matches Blink's behavior. Manually tested in MiniBrowser. * Modules/speech/cocoa/WebSpeechRecognizerTask.mm: (-[WebSpeechRecognizerTaskImpl callbackWithTranscriptions:isFinal:]): (-[WebSpeechRecognizerTaskImpl speechRecognitionTask:didHypothesizeTranscription:]): (-[WebSpeechRecognizerTaskImpl speechRecognitionTask:didFinishRecognition:]): (-[WebSpeechRecognizerTaskImpl callbackWithResult:isFinal:]): Deleted. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271958 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-27 Sihui Liu <sihui_liu@appe.com> Use SFTranscription instead of SFTranscriptionSegment for SpeechRecognitionAlternative https://bugs.webkit.org/show_bug.cgi?id=221026 Reviewed by Youenn Fablet. So SpeechRecognitionAlternative contains a sentence instead of a word, which matches Blink's behavior. Manually tested in MiniBrowser. * Modules/speech/cocoa/WebSpeechRecognizerTask.mm: (-[WebSpeechRecognizerTaskImpl callbackWithTranscriptions:isFinal:]): (-[WebSpeechRecognizerTaskImpl speechRecognitionTask:didHypothesizeTranscription:]): (-[WebSpeechRecognizerTaskImpl speechRecognitionTask:didFinishRecognition:]): (-[WebSpeechRecognizerTaskImpl callbackWithResult:isFinal:]): Deleted. 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271930. rdar://problem/73886919 REGRESSION (r271584): Hovering slowly over and out of "Top 100" items on liberation.fr does not restore animated state https://bugs.webkit.org/show_bug.cgi?id=220862 <rdar://problem/73501684> Reviewed by Simon Fraser. Source/WebCore: The optimization in r271584 fails to invalidate hover/active style when clearing the existing state under some circumstances. Test: fast/selectors/hover-invalidation-descendant-clear.html * dom/Document.cpp: (WebCore::Document::updateHoverActiveState): We would do descendant invalidation when changing the hover/active state of the rootmost changing element. However since the state of descendants was changed before this invalidation happened we would try to invalidate them in a tree that was already in the new state. Fix by scoping the descendant invalidation over all changes. * dom/Element.cpp: (WebCore::Element::setActive): (WebCore::Element::setHovered): Switch to new 3-state enum type that allows us to skip descendant invalidation that has already been done by the caller. Skope it to Style namepace. * dom/Element.h: * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::setActive): * html/HTMLAnchorElement.h: * html/HTMLLabelElement.cpp: (WebCore::HTMLLabelElement::setActive): (WebCore::HTMLLabelElement::setHovered): * html/HTMLLabelElement.h: * html/shadow/SpinButtonElement.cpp: (WebCore::SpinButtonElement::setHovered): * html/shadow/SpinButtonElement.h: * style/PseudoClassChangeInvalidation.cpp: (WebCore::Style::PseudoClassChangeInvalidation::computeInvalidation): * style/PseudoClassChangeInvalidation.h: (WebCore::Style::PseudoClassChangeInvalidation::PseudoClassChangeInvalidation): * style/StyleValidity.h: LayoutTests: * fast/selectors/hover-invalidation-descendant-clear-expected.html: Added. * fast/selectors/hover-invalidation-descendant-clear.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271930 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-26 Antti Koivisto <antti@apple.com> REGRESSION (r271584): Hovering slowly over and out of "Top 100" items on liberation.fr does not restore animated state https://bugs.webkit.org/show_bug.cgi?id=220862 <rdar://problem/73501684> Reviewed by Simon Fraser. The optimization in r271584 fails to invalidate hover/active style when clearing the existing state under some circumstances. Test: fast/selectors/hover-invalidation-descendant-clear.html * dom/Document.cpp: (WebCore::Document::updateHoverActiveState): We would do descendant invalidation when changing the hover/active state of the rootmost changing element. However since the state of descendants was changed before this invalidation happened we would try to invalidate them in a tree that was already in the new state. Fix by scoping the descendant invalidation over all changes. * dom/Element.cpp: (WebCore::Element::setActive): (WebCore::Element::setHovered): Switch to new 3-state enum type that allows us to skip descendant invalidation that has already been done by the caller. Skope it to Style namepace. * dom/Element.h: * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::setActive): * html/HTMLAnchorElement.h: * html/HTMLLabelElement.cpp: (WebCore::HTMLLabelElement::setActive): (WebCore::HTMLLabelElement::setHovered): * html/HTMLLabelElement.h: * html/shadow/SpinButtonElement.cpp: (WebCore::SpinButtonElement::setHovered): * html/shadow/SpinButtonElement.h: * style/PseudoClassChangeInvalidation.cpp: (WebCore::Style::PseudoClassChangeInvalidation::computeInvalidation): * style/PseudoClassChangeInvalidation.h: (WebCore::Style::PseudoClassChangeInvalidation::PseudoClassChangeInvalidation): * style/StyleValidity.h: 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271880. rdar://problem/73889737 WebGL power preference and discrete/internal gpu selection implemented incorrectly with ANGLE https://bugs.webkit.org/show_bug.cgi?id=220843 Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-01-26 Reviewed by Dean Jackson. Source/WebCore: Use ANGLE extension EGL_ANGLE_power_preference to signal to ANGLE that the underlying CGL context should be updated as a response to display reconfiguration signal. This ensures that ANGLE state stays consistent with the actual CGL context behavior, as we don't change the context behind ANGLE's back. Remove the feature where the context GPU is selected based on the display the window is on. This cannot work with the logic of "powerPreference = "high-performance" goes to discrete GPU". Also, this cannot work with ANGLE at all, since all contexts are backed by a single platform context. Thus all contexts will use the same underlying GPU. No new tests due to the test runner missing features. The bug blockers track the testing. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::isHighPerformanceContext): * page/Chrome.cpp: (WebCore::Chrome::windowScreenDidChange): * platform/graphics/GraphicsContextGL.h: * platform/graphics/RemoteGraphicsContextGLProxyBase.cpp: * platform/graphics/RemoteGraphicsContextGLProxyBase.h: * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::create): (WebCore::GraphicsContextGLOpenGL::createShared): (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::setContextVisibility): (WebCore::GraphicsContextGLOpenGL::displayWasReconfigured): (WebCore::GraphicsContextGLOpenGL::simulateContextChanged): * platform/graphics/mac/GraphicsChecksMac.cpp: Added. (WebCore::attachToAppleGraphicsControl): (WebCore::hasMuxCapability): (WebCore::hasLowAndHighPowerGPUs): * platform/graphics/mac/GraphicsChecksMac.h: Copied from Source/WebKit/WebProcess/WebCoreSupport/mac/WebSwitchingGPUClient.h. * platform/graphics/mac/ScopedHighPerformanceGPURequest.h: Copied from Source/WebCore/platform/graphics/mac/SwitchingGPUClient.h. (WebCore::ScopedHighPerformanceGPURequest::ScopedHighPerformanceGPURequest): (WebCore::ScopedHighPerformanceGPURequest::~ScopedHighPerformanceGPURequest): (WebCore::ScopedHighPerformanceGPURequest::operator=): (WebCore::ScopedHighPerformanceGPURequest::acquire): * platform/graphics/mac/SwitchingGPUClient.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp: (WebCore::GraphicsContextGLOpenGLManager::displayWasReconfigured): (WebCore::GraphicsContextGLOpenGLManager::addContext): (WebCore::GraphicsContextGLOpenGLManager::removeContext): * platform/graphics/opengl/GraphicsContextGLOpenGLManager.h: * testing/Internals.cpp: Source/WebKit: Move the high-performance GPU shutdown timer from individual web processes to the main class in the ui process. This simplifies the implementation and reduces the number of timers. * UIProcess/mac/HighPerformanceGPUManager.h: * UIProcess/mac/HighPerformanceGPUManager.mm: (WebKit::HighPerformanceGPUManager::HighPerformanceGPUManager): (WebKit::HighPerformanceGPUManager::removeProcessRequiringHighPerformance): (WebKit::HighPerformanceGPUManager::updateState): * WebProcess/WebCoreSupport/mac/WebSwitchingGPUClient.cpp: (WebKit::WebSwitchingGPUClient::requestHighPerformanceGPU): (WebKit::WebSwitchingGPUClient::releaseHighPerformanceGPU): * WebProcess/WebCoreSupport/mac/WebSwitchingGPUClient.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271880 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-26 Kimmo Kinnunen <kkinnunen@apple.com> WebGL power preference and discrete/internal gpu selection implemented incorrectly with ANGLE https://bugs.webkit.org/show_bug.cgi?id=220843 Reviewed by Dean Jackson. Use ANGLE extension EGL_ANGLE_power_preference to signal to ANGLE that the underlying CGL context should be updated as a response to display reconfiguration signal. This ensures that ANGLE state stays consistent with the actual CGL context behavior, as we don't change the context behind ANGLE's back. Remove the feature where the context GPU is selected based on the display the window is on. This cannot work with the logic of "powerPreference = "high-performance" goes to discrete GPU". Also, this cannot work with ANGLE at all, since all contexts are backed by a single platform context. Thus all contexts will use the same underlying GPU. No new tests due to the test runner missing features. The bug blockers track the testing. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::isHighPerformanceContext): * page/Chrome.cpp: (WebCore::Chrome::windowScreenDidChange): * platform/graphics/GraphicsContextGL.h: * platform/graphics/RemoteGraphicsContextGLProxyBase.cpp: * platform/graphics/RemoteGraphicsContextGLProxyBase.h: * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::create): (WebCore::GraphicsContextGLOpenGL::createShared): (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::setContextVisibility): (WebCore::GraphicsContextGLOpenGL::displayWasReconfigured): (WebCore::GraphicsContextGLOpenGL::simulateContextChanged): * platform/graphics/mac/GraphicsChecksMac.cpp: Added. (WebCore::attachToAppleGraphicsControl): (WebCore::hasMuxCapability): (WebCore::hasLowAndHighPowerGPUs): * platform/graphics/mac/GraphicsChecksMac.h: Copied from Source/WebKit/WebProcess/WebCoreSupport/mac/WebSwitchingGPUClient.h. * platform/graphics/mac/ScopedHighPerformanceGPURequest.h: Copied from Source/WebCore/platform/graphics/mac/SwitchingGPUClient.h. (WebCore::ScopedHighPerformanceGPURequest::ScopedHighPerformanceGPURequest): (WebCore::ScopedHighPerformanceGPURequest::~ScopedHighPerformanceGPURequest): (WebCore::ScopedHighPerformanceGPURequest::operator=): (WebCore::ScopedHighPerformanceGPURequest::acquire): * platform/graphics/mac/SwitchingGPUClient.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp: (WebCore::GraphicsContextGLOpenGLManager::displayWasReconfigured): (WebCore::GraphicsContextGLOpenGLManager::addContext): (WebCore::GraphicsContextGLOpenGLManager::removeContext): * platform/graphics/opengl/GraphicsContextGLOpenGLManager.h: * testing/Internals.cpp: 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271797. rdar://problem/73847580 Activate simulcast through addTransceiver https://bugs.webkit.org/show_bug.cgi?id=173262 <rdar://problem/32713416> Reviewed by Eric Carlson. LayoutTests/imported/w3c: * web-platform-tests/webrtc/RTCPeerConnection-addTransceiver.https-expected.txt: * web-platform-tests/webrtc/RTCPeerConnection-transceivers.https-expected.txt: * web-platform-tests/webrtc/protocol/simulcast-offer-expected.txt: Source/WebCore: Update WebIDL according latest version of the spec. Add binding code to go from WebIDL to webrtc backend for sendEncodings parameters. Minor refactoring to bring to web pages information on addTransceiver failures. Covered by rebased tests. * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCRtpEncodingParameters.idl: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered): (WebCore::LibWebRTCMediaEndpoint::createTransceiverBackends): (WebCore::LibWebRTCMediaEndpoint::addTransceiver): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::addTransceiverFromTrackOrKind): * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::fromRTCEncodingParameters): (WebCore::fromRtpTransceiverInit): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271797 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-25 Youenn Fablet <youenn@apple.com> Activate simulcast through addTransceiver https://bugs.webkit.org/show_bug.cgi?id=173262 <rdar://problem/32713416> Reviewed by Eric Carlson. Update WebIDL according latest version of the spec. Add binding code to go from WebIDL to webrtc backend for sendEncodings parameters. Minor refactoring to bring to web pages information on addTransceiver failures. Covered by rebased tests. * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCRtpEncodingParameters.idl: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered): (WebCore::LibWebRTCMediaEndpoint::createTransceiverBackends): (WebCore::LibWebRTCMediaEndpoint::addTransceiver): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::addTransceiverFromTrackOrKind): * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::fromRTCEncodingParameters): (WebCore::fromRtpTransceiverInit): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271796. rdar://problem/73847788 AX: @alt and bounds ignored when using img[src] points to an inaccessible SVG https://bugs.webkit.org/show_bug.cgi?id=160705 <rdar://problem/27771579> Reviewed by Chris Fleizach and Darin Adler. Source/WebCore: Tests: accessibility/img-with-svg-source.html accessibility/ios-simulator/img-with-svg-source.html The problem was caused by AccessibilityRenderObject::determineAccessibilityRole that was returning AccessibilityRole::SVGRoot for all images with a remote SVG source, regardless whether the SVG hierarchy contained some accessibility data or not. This resulted in VoiceOver reading the image like an empty group on Mac, or completely ignoring the image on iOS. The solution in this patch is to only return AccessibilityRole::SVGRoot if the SVG has some accessibility conveyable data. Added the method AccessibilitySVGRoot::hasAccessibleContent for this purpose. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::determineAccessibilityRole): (WebCore::AccessibilityRenderObject::remoteSVGRootElement const): Comment was missplaced, moved it to the right place. (WebCore::AccessibilityRenderObject::addRemoteSVGChildren): * accessibility/AccessibilitySVGRoot.cpp: (WebCore::AccessibilitySVGRoot::hasAccessibleContent const): * accessibility/AccessibilitySVGRoot.h: LayoutTests: * accessibility/img-with-svg-source-expected.txt: Added. * accessibility/img-with-svg-source.html: Added. * accessibility/ios-simulator/img-with-svg-source-expected.txt: Added. * accessibility/ios-simulator/img-with-svg-source.html: Added. * accessibility/svg-shape-labelled-expected.txt: * accessibility/svg-shape-labelled.html: Removed the <img> test cases since they are covered correctly in the new test img-with-svg-source.html. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271796 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-25 Andres Gonzalez <andresg_22@apple.com> AX: @alt and bounds ignored when using img[src] points to an inaccessible SVG https://bugs.webkit.org/show_bug.cgi?id=160705 <rdar://problem/27771579> Reviewed by Chris Fleizach and Darin Adler. Tests: accessibility/img-with-svg-source.html accessibility/ios-simulator/img-with-svg-source.html The problem was caused by AccessibilityRenderObject::determineAccessibilityRole that was returning AccessibilityRole::SVGRoot for all images with a remote SVG source, regardless whether the SVG hierarchy contained some accessibility data or not. This resulted in VoiceOver reading the image like an empty group on Mac, or completely ignoring the image on iOS. The solution in this patch is to only return AccessibilityRole::SVGRoot if the SVG has some accessibility conveyable data. Added the method AccessibilitySVGRoot::hasAccessibleContent for this purpose. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::determineAccessibilityRole): (WebCore::AccessibilityRenderObject::remoteSVGRootElement const): Comment was missplaced, moved it to the right place. (WebCore::AccessibilityRenderObject::addRemoteSVGChildren): * accessibility/AccessibilitySVGRoot.cpp: (WebCore::AccessibilitySVGRoot::hasAccessibleContent const): * accessibility/AccessibilitySVGRoot.h: 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271790. rdar://problem/73847621 AX: iOS: VO: Web: Column Names Not Announced https://bugs.webkit.org/show_bug.cgi?id=220829 <rdar://problem/73469037> Reviewed by Zalan Bujtas. Source/WebCore: We no longer use containedInTraits, but mean to override the tableAncestor methods. Those need to account for the three types of tables. Test: accessibility/ios-simulator/table-ancestory.html * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]): (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]): Tools: * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: (WTR::AccessibilityUIElement::isInTable const): (WTR::AccessibilityUIElement::isInLandmark const): (WTR::AccessibilityUIElement::isInList const): * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::AccessibilityUIElement::isInTable const): (WTR::AccessibilityUIElement::isInLandmark const): (WTR::AccessibilityUIElement::isInList const): LayoutTests: * accessibility/ios-simulator/table-ancestory.html: Added. * accessibility/ios-simulator/table-ancestory-expected.txt: Added. * accessibility/ios-simulator/tables-lists.html: Updated. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271790 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-25 Chris Fleizach <cfleizach@apple.com> AX: iOS: VO: Web: Column Names Not Announced https://bugs.webkit.org/show_bug.cgi?id=220829 <rdar://problem/73469037> Reviewed by Zalan Bujtas. We no longer use containedInTraits, but mean to override the tableAncestor methods. Those need to account for the three types of tables. Test: accessibility/ios-simulator/table-ancestory.html * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]): (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271733. rdar://problem/73887744 Protect against sampleRate being 0 in IIRFilter::tailTime() https://bugs.webkit.org/show_bug.cgi?id=220837 <rdar://73395924> Reviewed by Eric Carlson. * platform/audio/IIRFilter.cpp: (WebCore::IIRFilter::tailTime): Return early if sampleRate is 0 (invalid). Add a release assertion to make sure that numberOfBlocks is greater than 0 since this is the size of the |magnitude| array and we access magnitude[0] later on. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271733 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-21 Chris Dumez <cdumez@apple.com> Protect against sampleRate being 0 in IIRFilter::tailTime() https://bugs.webkit.org/show_bug.cgi?id=220837 <rdar://73395924> Reviewed by Eric Carlson. * platform/audio/IIRFilter.cpp: (WebCore::IIRFilter::tailTime): Return early if sampleRate is 0 (invalid). Add a release assertion to make sure that numberOfBlocks is greater than 0 since this is the size of the |magnitude| array and we access magnitude[0] later on. 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271696. rdar://problem/73887913 Check for TURN username/credentials sizes in RTCPeerConnection constructor https://bugs.webkit.org/show_bug.cgi?id=220789 Reviewed by Eric Carlson. Source/WebCore: Covered by updated test. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::iceServersFromConfiguration): LayoutTests: * webrtc/stun-server-filtering-expected.txt: * webrtc/stun-server-filtering.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271696 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-21 Youenn Fablet <youenn@apple.com> Check for TURN username/credentials sizes in RTCPeerConnection constructor https://bugs.webkit.org/show_bug.cgi?id=220789 Reviewed by Eric Carlson. Covered by updated test. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::iceServersFromConfiguration): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271651. rdar://problem/73889797 REGRESSION (Big Sur): position:absolute elements inside nested overflow:scroll don't track scrolling https://bugs.webkit.org/show_bug.cgi?id=220761 <rdar://problem/69075263> Reviewed by Antti Koivisto. Source/WebCore: When a position:absolute element is inside nested overflow scroll, and its containing block is the outer scroller, then we failed to make a positioning scrolling tree node for it, so it would fail to track during async scrolling. The bug was that RenderLayerCompositor::layerScrollBehahaviorRelativeToCompositedAncestor() failed to deal with nested scrollers. The correct question to ask when determining if we need a "Moves" node is "is there an overflow scroll layer between this layer and its composited ancestor". Previously, we would just find the enclosing scroller (with the same scrolling scope) and assume we didn't need a node. We can also simplify the "Stationary" code path to just ask about scrolling scopes. Tests: scrollingcoordinator/ios/absolute-in-nested-overflow-scroll-intermediate-stacking-2.html scrollingcoordinator/ios/absolute-in-nested-overflow-scroll-intermediate-stacking.html scrollingcoordinator/ios/absolute-in-nested-overflow-scroll.html scrollingcoordinator/scrolling-tree/absolute-in-nested-overflow-scroll.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerScrollBehahaviorRelativeToCompositedAncestor): (WebCore::isScrolledByOverflowScrollLayer): Deleted. (WebCore::enclosingCompositedScrollingLayer): Deleted. LayoutTests: Add a scrolling tree dump test, and three iOS interactive tests, since testing scrolling-tree-only behaviors is easier on iOS than macOS. absolute-in-nested-overflow-scroll.html is the basic test. The two "stacking" variants have an opacity layer below and above the inner scroller to test some more layer configurations. * platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-in-nested-overflow-scroll-expected.txt: Added. * scrollingcoordinator/ios/absolute-in-nested-overflow-scroll-expected.html: Added. * scrollingcoordinator/ios/absolute-in-nested-overflow-scroll-intermediate-stacking-2-expected.html: Added. * scrollingcoordinator/ios/absolute-in-nested-overflow-scroll-intermediate-stacking-2.html: Added. * scrollingcoordinator/ios/absolute-in-nested-overflow-scroll-intermediate-stacking-expected.html: Added. * scrollingcoordinator/ios/absolute-in-nested-overflow-scroll-intermediate-stacking.html: Added. * scrollingcoordinator/ios/absolute-in-nested-overflow-scroll.html: Added. * scrollingcoordinator/scrolling-tree/absolute-in-nested-overflow-scroll-expected.txt: Added. * scrollingcoordinator/scrolling-tree/absolute-in-nested-overflow-scroll.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271651 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-19 Simon Fraser <simon.fraser@apple.com> REGRESSION (Big Sur): position:absolute elements inside nested overflow:scroll don't track scrolling https://bugs.webkit.org/show_bug.cgi?id=220761 <rdar://problem/69075263> Reviewed by Antti Koivisto. When a position:absolute element is inside nested overflow scroll, and its containing block is the outer scroller, then we failed to make a positioning scrolling tree node for it, so it would fail to track during async scrolling. The bug was that RenderLayerCompositor::layerScrollBehahaviorRelativeToCompositedAncestor() failed to deal with nested scrollers. The correct question to ask when determining if we need a "Moves" node is "is there an overflow scroll layer between this layer and its composited ancestor". Previously, we would just find the enclosing scroller (with the same scrolling scope) and assume we didn't need a node. We can also simplify the "Stationary" code path to just ask about scrolling scopes. Tests: scrollingcoordinator/ios/absolute-in-nested-overflow-scroll-intermediate-stacking-2.html scrollingcoordinator/ios/absolute-in-nested-overflow-scroll-intermediate-stacking.html scrollingcoordinator/ios/absolute-in-nested-overflow-scroll.html scrollingcoordinator/scrolling-tree/absolute-in-nested-overflow-scroll.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerScrollBehahaviorRelativeToCompositedAncestor): (WebCore::isScrolledByOverflowScrollLayer): Deleted. (WebCore::enclosingCompositedScrollingLayer): Deleted. 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271744. rdar://problem/73886483 Denying storage access on playstation.com then clicking sign-in fails to show the prompt again https://bugs.webkit.org/show_bug.cgi?id=220838 <rdar://problem/73477444> Reviewed by Alex Christensen. Temporary cross-page storage access in the Web Process for quirks should only be granted if the user hits "Allow" on the prompt. This was causing the prompt to fail to show if a user clicks "Don't Allow" then tries to sign in, then sign-in would fail without storage access in the Network Process. * page/Quirks.cpp: (WebCore::Quirks::requestStorageAccessAndHandleClick const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271744 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-22 Kate Cheney <katherine_cheney@apple.com> Denying storage access on playstation.com then clicking sign-in fails to show the prompt again https://bugs.webkit.org/show_bug.cgi?id=220838 <rdar://problem/73477444> Reviewed by Alex Christensen. Temporary cross-page storage access in the Web Process for quirks should only be granted if the user hits "Allow" on the prompt. This was causing the prompt to fail to show if a user clicks "Don't Allow" then tries to sign in, then sign-in would fail without storage access in the Network Process. * page/Quirks.cpp: (WebCore::Quirks::requestStorageAccessAndHandleClick const): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r272004. rdar://problem/73890647 REGRESSION(r268615): images flicker on apple.com/ios/ios-14 https://bugs.webkit.org/show_bug.cgi?id=221054 <rdar://problem/72880447> Reviewed by Dean Jackson. Source/WebCore: When we added support for accelerated animations of individual transform properties in r268615 (bug 217842), we made it so that base values of each transform-related property had a non-interpolating animation in the Core Animation animations list that would combine with interpolating animations for that property as additive animations. Prior to any of those animations, we'd reset the combined transform with an identity transform as another non-interpolating animation. However, we neglected to consider the case where one of the interpolating animations would not start right away if a positive delay was set. In the case of this apple.com page, the target element would be composited due to a "will-change: transform" style, and a non-animated "transform" was set as well as an animation for the "transform" property with a delay. Since we had a "transform" animation, we'd create a Core Animation animations lists as follows: 1. non-interpolating, non-additive animation set to the identity matrix 2. interpolating, additive animation with the keyframes set in the CSS animation, with a begin time set to the current time plus the specified delay The result of this was that during the animation delay, the static "transform" property was overridden by animation #1 until animation #2 would kick in. We now make it so that for each transform-related property, we create a non-interpoloating, additive animation to represent the static value for that property for the duration of any potential delay until the first interpolating animation for this property starts. In this example, the Core Animation animations list is now as follows: 1. non-interpolating, non-additive animation set to the identity matrix 2. non-interpolating, additive animation set to the static transform value 3. interpolating, additive animation with the keyframes set in the CSS animation, with a begin time set to the current time plus the specified delay We implement this with a new lambda function within GraphicsLayerCA::updateAnimations() called addAnimationsForProperty() which adds a non-interpolating animation in two cases: 1. if there is no animation for this property at all, making it last forever 2. if all animations have a delay, making it last until the first animation starts Tests: webanimations/multiple-transform-properties-and-multiple-transform-properties-animation-with-delay-on-forced-layer.html webanimations/rotate-property-and-rotate-animation-with-delay-on-forced-layer.html webanimations/scale-property-and-scale-animation-with-delay-on-forced-layer.html webanimations/transform-property-and-transform-animation-with-delay-on-forced-layer.html webanimations/translate-property-and-translate-animation-with-delay-on-forced-layer.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateAnimations): LayoutTests: Add a series of tests ensuring that starting an animation for transform-related properties does not clobber the static value for this property. We only run those tests on WK2 because running those in WK1 is flaky as there doesn't seem to be a solid test utility to determine that Core Animation animations have been committed, even with long delays that would make tests run slow. * TestExpectations: * platform/ios-wk2/TestExpectations: * platform/mac-wk2/TestExpectations: * webanimations/multiple-transform-properties-and-multiple-transform-properties-animation-with-delay-on-forced-layer-expected.html: Added. * webanimations/multiple-transform-properties-and-multiple-transform-properties-animation-with-delay-on-forced-layer.html: Added. * webanimations/resources/wait-until-animations-are-committed.js: Added. * webanimations/rotate-property-and-rotate-animation-with-delay-on-forced-layer-expected.html: Added. * webanimations/rotate-property-and-rotate-animation-with-delay-on-forced-layer.html: Added. * webanimations/scale-property-and-scale-animation-with-delay-on-forced-layer-expected.html: Added. * webanimations/scale-property-and-scale-animation-with-delay-on-forced-layer.html: Added. * webanimations/transform-property-and-transform-animation-with-delay-on-forced-layer-expected.html: Added. * webanimations/transform-property-and-transform-animation-with-delay-on-forced-layer.html: Added. * webanimations/translate-property-and-translate-animation-with-delay-on-forced-layer-expected.html: Added. * webanimations/translate-property-and-translate-animation-with-delay-on-forced-layer.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272004 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-27 Antoine Quint <graouts@webkit.org> REGRESSION(r268615): images flicker on apple.com/ios/ios-14 https://bugs.webkit.org/show_bug.cgi?id=221054 <rdar://problem/72880447> Reviewed by Dean Jackson. When we added support for accelerated animations of individual transform properties in r268615 (bug 217842), we made it so that base values of each transform-related property had a non-interpolating animation in the Core Animation animations list that would combine with interpolating animations for that property as additive animations. Prior to any of those animations, we'd reset the combined transform with an identity transform as another non-interpolating animation. However, we neglected to consider the case where one of the interpolating animations would not start right away if a positive delay was set. In the case of this apple.com page, the target element would be composited due to a "will-change: transform" style, and a non-animated "transform" was set as well as an animation for the "transform" property with a delay. Since we had a "transform" animation, we'd create a Core Animation animations lists as follows: 1. non-interpolating, non-additive animation set to the identity matrix 2. interpolating, additive animation with the keyframes set in the CSS animation, with a begin time set to the current time plus the specified delay The result of this was that during the animation delay, the static "transform" property was overridden by animation #1 until animation #2 would kick in. We now make it so that for each transform-related property, we create a non-interpoloating, additive animation to represent the static value for that property for the duration of any potential delay until the first interpolating animation for this property starts. In this example, the Core Animation animations list is now as follows: 1. non-interpolating, non-additive animation set to the identity matrix 2. non-interpolating, additive animation set to the static transform value 3. interpolating, additive animation with the keyframes set in the CSS animation, with a begin time set to the current time plus the specified delay We implement this with a new lambda function within GraphicsLayerCA::updateAnimations() called addAnimationsForProperty() which adds a non-interpolating animation in two cases: 1. if there is no animation for this property at all, making it last forever 2. if all animations have a delay, making it last until the first animation starts Tests: webanimations/multiple-transform-properties-and-multiple-transform-properties-animation-with-delay-on-forced-layer.html webanimations/rotate-property-and-rotate-animation-with-delay-on-forced-layer.html webanimations/scale-property-and-scale-animation-with-delay-on-forced-layer.html webanimations/transform-property-and-transform-animation-with-delay-on-forced-layer.html webanimations/translate-property-and-translate-animation-with-delay-on-forced-layer.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateAnimations): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271861. rdar://problem/73890854 [iOS] Obscured elements should not be focusable using the accessory bar https://bugs.webkit.org/show_bug.cgi?id=220929 <rdar://problem/73239409> Reviewed by Tim Horton. Source/WebCore: * rendering/HitTestResult.h: Export function so it can be called from WebKit layer. Source/WebKit: Currently, assistable elements hidden behind unassistable elements can be focused using the next/previous buttons on the accessory bar. This behavior is undesirable since users cannot see the focused element, but are still presented UI to enter information into the element. While the current behavior has been longstanding, its undesirability was exposed after r269059, which made it possible to use the accessory bar to focus elements across focusable scopes. As a result, it became possible to focus a hidden input field on appleid.apple.com using the accessory bar. Note that the hidden field is inside a subframe, which was previously excluded from accessory bar next/previous operations. However, the same bug would still exist even if the field was not inside a subframe, which means that r269059 is not the root cause of the issue, but simply exposed a larger underlying problem. To prevent obscured elements from being focusable using the accessory bar, we now use hit testing to determine whether or not an element is obscured, before considering the element "assistable". Test: fast/forms/ios/accessory-bar-navigation-obscured-input.html * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::isObscuredElement): An element is considered obscured if a hit test at its center position relative to the main document targets a different element. (WebKit::nextAssistableElement): Obscured elements should not be assistable. LayoutTests: * fast/forms/ios/accessory-bar-navigation-obscured-input-expected.txt: Added. * fast/forms/ios/accessory-bar-navigation-obscured-input.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271861 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-25 Aditya Keerthi <akeerthi@apple.com> [iOS] Obscured elements should not be focusable using the accessory bar https://bugs.webkit.org/show_bug.cgi?id=220929 <rdar://problem/73239409> Reviewed by Tim Horton. * rendering/HitTestResult.h: Export function so it can be called from WebKit layer. 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271786. rdar://problem/73890368 [iOS WK2] theverge.com - rubber band scrolling at the top of the page causes an abrupt jump https://bugs.webkit.org/show_bug.cgi?id=220886 <rdar://71177566> Reviewed by Sam Weinig. Source/WebCore: theverge.com on iOS is a page that has long main thread stalls with forced layouts on a timer that alter the page height; this caused the post-layout updateScrollbars() called from FrameView::adjustViewSize() to call scrollToPosition() after adjusting the scroll position to the allowed range. If the page laid out while rubberbanding was happening, the current scroll position would be negative, then clamped to 0, then sent to the UI process as a requested scroll to 0, triggering the jump to top in the UI process. There's existing code to prevent this from happening if we know that rubberbanding is happening; this patch makes isRubberBandInProgress() work for iOS WK2. It does so by having updateVisibleContentRects() push information about rubberbanding nodes onto RemoteScrollingCoordinator. We remove an unnecessary shouldUpdateScrollLayerPositionSynchronously() check in FrameView::isRubberBandInProgress() - if it's true, then the scrolling coordinator won't see any rubberbanding nodes anyway. Test: fast/scrolling/ios/content-size-change-during-rubberband.html * page/FrameView.cpp: (WebCore::FrameView::isRubberBandInProgress const): * page/FrameView.h: * platform/ScrollView.cpp: (WebCore::ScrollView::updateScrollbars): Source/WebKit: theverge.com on iOS is a page that has long main thread stalls with forced layouts on a timer that alter the page height; this caused the post-layout updateScrollbars() called from FrameView::adjustViewSize() to call scrollToPosition() after adjusting the scroll position to the allowed range. If the page laid out while rubberbanding was happening, the current scroll position would be negative, then clamped to 0, then sent to the UI process as a requested scroll to 0, triggering the jump to top in the UI process. There's existing code to prevent this from happening if we know that rubberbanding is happening; this patch makes isRubberBandInProgress() work for iOS WK2. It does so by having updateVisibleContentRects() push information about rubberbanding nodes onto RemoteScrollingCoordinator. We remove an unnecessary shouldUpdateScrollLayerPositionSynchronously() check in FrameView::isRubberBandInProgress() - if it's true, then the scrolling coordinator won't see any rubberbanding nodes anyway. * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h: * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm: (WebKit::RemoteScrollingCoordinator::addNodeWithActiveRubberBanding): (WebKit::RemoteScrollingCoordinator::removeNodeWithActiveRubberBanding): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): Tools: Add test infrastructure to allow UIScriptController::scrollToOffset() and UIScriptController::immediateScrollToOffset() to take an options argument with a 'unconstrained' property, which allows scrolling to unstable offset to simulate rubberbanding. * DumpRenderTree/ios/UIScriptControllerIOS.h: * DumpRenderTree/ios/UIScriptControllerIOS.mm: (WTR::contentOffsetBoundedIfNecessary): (WTR::UIScriptControllerIOS::scrollToOffset): (WTR::UIScriptControllerIOS::immediateScrollToOffset): (WTR::contentOffsetBoundedInValidRange): Deleted. * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: * TestRunnerShared/UIScriptContext/UIScriptController.h: (WTR::UIScriptController::scrollToOffset): (WTR::UIScriptController::immediateScrollToOffset): * TestRunnerShared/UIScriptContext/UIScriptControllerShared.cpp: (WTR::toScrollToOptions): * WebKitTestRunner/ios/UIScriptControllerIOS.h: * WebKitTestRunner/ios/UIScriptControllerIOS.mm: (WTR::contentOffsetBoundedIfNecessary): (WTR::UIScriptControllerIOS::scrollToOffset): (WTR::UIScriptControllerIOS::immediateScrollToOffset): (WTR::contentOffsetBoundedInValidRange): Deleted. LayoutTests: Add test infrastructure to allow UIScriptController::scrollToOffset() and UIScriptController::immediateScrollToOffset() to take an options argument with a 'unconstrained' property, which allows scrolling to unstable offset to simulate rubberbanding. * fast/scrolling/ios/content-size-change-during-rubberband-expected.txt: Added. * fast/scrolling/ios/content-size-change-during-rubberband.html: Added. * resources/ui-helper.js: (window.UIHelper.scrollTo.return.new.Promise.): (window.UIHelper.scrollTo.return.new.Promise): (window.UIHelper.scrollTo): (window.UIHelper.immediateScrollTo): (window.UIHelper.immediateUnstableScrollTo): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271786 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-24 Simon Fraser <simon.fraser@apple.com> [iOS WK2] theverge.com - rubber band scrolling at the top of the page causes an abrupt jump https://bugs.webkit.org/show_bug.cgi?id=220886 <rdar://71177566> Reviewed by Sam Weinig. theverge.com on iOS is a page that has long main thread stalls with forced layouts on a timer that alter the page height; this caused the post-layout updateScrollbars() called from FrameView::adjustViewSize() to call scrollToPosition() after adjusting the scroll position to the allowed range. If the page laid out while rubberbanding was happening, the current scroll position would be negative, then clamped to 0, then sent to the UI process as a requested scroll to 0, triggering the jump to top in the UI process. There's existing code to prevent this from happening if we know that rubberbanding is happening; this patch makes isRubberBandInProgress() work for iOS WK2. It does so by having updateVisibleContentRects() push information about rubberbanding nodes onto RemoteScrollingCoordinator. We remove an unnecessary shouldUpdateScrollLayerPositionSynchronously() check in FrameView::isRubberBandInProgress() - if it's true, then the scrolling coordinator won't see any rubberbanding nodes anyway. Test: fast/scrolling/ios/content-size-change-during-rubberband.html * page/FrameView.cpp: (WebCore::FrameView::isRubberBandInProgress const): * page/FrameView.h: * platform/ScrollView.cpp: (WebCore::ScrollView::updateScrollbars): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271770. rdar://problem/73890671 REGRESSION(r266148) Cancelling a navigation in decidePolicyForNavigationAction should not suspend the previous document's font loading timer https://bugs.webkit.org/show_bug.cgi?id=220882 <rdar://problem/71634501> Patch by Alex Christensen <achristensen@webkit.org> on 2021-01-22 Reviewed by Brady Eidson. Source/WebCore: Things like the load event and didFinishNavigation wait until loading of things like fonts and iframes has completed. If we navigate to a document that immediately tries to navigate to a different document after starting the loads of fonts, then we momentarily have two DocumentLoaders with m_frame pointing to the same main frame. If we cancel that second navigation using WKNavigationActionPolicyCancel, then it calls DocumentLoader::stopLoading on the second DocumentLoader. This is fine. This is the way things have worked for a very long time. r266148 introduced a call to the document's font loader's suspendFontLoadingTimer inside of DocumentLoader::stopLoading which is also fine. What is not fine is the way we get that document. Using m_frame->document() in this case gets us the first document, which may still be loading fonts that we do still want. Using this->document() only returns non-null if this DocumentLoader is the DocumentLoader that was used to load the Frame's Document, and in this case the DocumentLoader should only stop the font loading timer if that is true. I added an API test that reproduces the issue before but not after this fix. For further verification, you can replace server.request() in my API test with a request to the URL in the radar ending in "Authentication.htm" and verify it times out before the fix but not after. This is close to the largest amount of time spent per character changed I've ever written to change "m_frame" to "this". * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::stopLoading): Tools: * TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm: (TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271770 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-22 Alex Christensen <achristensen@webkit.org> REGRESSION(r266148) Cancelling a navigation in decidePolicyForNavigationAction should not suspend the previous document's font loading timer https://bugs.webkit.org/show_bug.cgi?id=220882 <rdar://problem/71634501> Reviewed by Brady Eidson. Things like the load event and didFinishNavigation wait until loading of things like fonts and iframes has completed. If we navigate to a document that immediately tries to navigate to a different document after starting the loads of fonts, then we momentarily have two DocumentLoaders with m_frame pointing to the same main frame. If we cancel that second navigation using WKNavigationActionPolicyCancel, then it calls DocumentLoader::stopLoading on the second DocumentLoader. This is fine. This is the way things have worked for a very long time. r266148 introduced a call to the document's font loader's suspendFontLoadingTimer inside of DocumentLoader::stopLoading which is also fine. What is not fine is the way we get that document. Using m_frame->document() in this case gets us the first document, which may still be loading fonts that we do still want. Using this->document() only returns non-null if this DocumentLoader is the DocumentLoader that was used to load the Frame's Document, and in this case the DocumentLoader should only stop the font loading timer if that is true. I added an API test that reproduces the issue before but not after this fix. For further verification, you can replace server.request() in my API test with a request to the URL in the radar ending in "Authentication.htm" and verify it times out before the fix but not after. This is close to the largest amount of time spent per character changed I've ever written to change "m_frame" to "this". * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::stopLoading): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271761. rdar://problem/73890346 Crash under FFTFrame::fftSetupForSize() https://bugs.webkit.org/show_bug.cgi?id=220866 <rdar://73199504> Reviewed by Darin Adler. Follow-up to r271751 to address comment from Darin Adler. Stop using the double-checked locking pattern as it is likely not safe [1]. [1] http://erdani.org/publications/DDJ_Jul_Aug_2004_revised.pdf * platform/audio/mac/FFTFrameMac.cpp: (WebCore::fftSetups): (WebCore::FFTFrame::fftSetupForSize): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271761 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-22 Chris Dumez <cdumez@apple.com> Crash under FFTFrame::fftSetupForSize() https://bugs.webkit.org/show_bug.cgi?id=220866 <rdar://73199504> Reviewed by Darin Adler. Follow-up to r271751 to address comment from Darin Adler. Stop using the double-checked locking pattern as it is likely not safe [1]. [1] http://erdani.org/publications/DDJ_Jul_Aug_2004_revised.pdf * platform/audio/mac/FFTFrameMac.cpp: (WebCore::fftSetups): (WebCore::FFTFrame::fftSetupForSize): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271760. rdar://problem/73890156 AX: AT-synthesized key events for common user actions (increment/decrement) are detectably different in many ways, potentially causing both web app breakage and AT identification https://bugs.webkit.org/show_bug.cgi?id=220675 <rdar://problem/73263977> Reviewed by Zalan Bujtas. Source/WebCore: Test: accessibility/keyevents-for-actions-mimic-real-key-events.html When accessibility posts keyboard events in response to ax actions, they should mimic real key events so as to be indistinguishable. https://github.com/WICG/aom/blob/gh-pages/explainer.md#deprecated-keyboardevent-object-properties-optional * accessibility/AccessibilityNodeObject.cpp: (WebCore::dispatchSimulatedKeyboardUpDownEvent): (WebCore::InitializeLegacyKeyInitProperties): (WebCore::AccessibilityNodeObject::performDismissAction): (WebCore::AccessibilityNodeObject::postKeyboardKeysForValueChange): * dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::KeyboardEvent): (WebCore::KeyboardEvent::create): * dom/KeyboardEvent.h: * dom/UIEvent.cpp: (WebCore::UIEvent::UIEvent): * dom/UIEvent.h: (WebCore::UIEvent::create): * dom/UIEventWithKeyState.h: (WebCore::UIEventWithKeyState::UIEventWithKeyState): LayoutTests: * accessibility/keyevents-for-actions-mimic-real-key-events-expected.txt: Added. * accessibility/keyevents-for-actions-mimic-real-key-events.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271760 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-22 Chris Fleizach <cfleizach@apple.com> AX: AT-synthesized key events for common user actions (increment/decrement) are detectably different in many ways, potentially causing both web app breakage and AT identification https://bugs.webkit.org/show_bug.cgi?id=220675 <rdar://problem/73263977> Reviewed by Zalan Bujtas. Test: accessibility/keyevents-for-actions-mimic-real-key-events.html When accessibility posts keyboard events in response to ax actions, they should mimic real key events so as to be indistinguishable. https://github.com/WICG/aom/blob/gh-pages/explainer.md#deprecated-keyboardevent-object-properties-optional * accessibility/AccessibilityNodeObject.cpp: (WebCore::dispatchSimulatedKeyboardUpDownEvent): (WebCore::InitializeLegacyKeyInitProperties): (WebCore::AccessibilityNodeObject::performDismissAction): (WebCore::AccessibilityNodeObject::postKeyboardKeysForValueChange): * dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::KeyboardEvent): (WebCore::KeyboardEvent::create): * dom/KeyboardEvent.h: * dom/UIEvent.cpp: (WebCore::UIEvent::UIEvent): * dom/UIEvent.h: (WebCore::UIEvent::create): * dom/UIEventWithKeyState.h: (WebCore::UIEventWithKeyState::UIEventWithKeyState): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271751. rdar://problem/73890346 Crash under FFTFrame::fftSetupForSize() https://bugs.webkit.org/show_bug.cgi?id=220866 <rdar://73199504> Reviewed by Eric Carlson. Source/WebCore: The crash was caused by FFTFrame::fftSetupForSize() but being called concurrently from "HRTF database loader" threads. This patch makes FFTFrame::fftSetupForSize() thread safe to address the issue. Test: webaudio/Panner/PannerNode-crash.html * platform/audio/mac/FFTFrameMac.cpp: (WebCore::fftSetups): (WebCore::FFTFrame::fftSetupForSize): LayoutTests: Add layout test coverage. * webaudio/Panner/PannerNode-crash-expected.txt: Added. * webaudio/Panner/PannerNode-crash.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271751 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-22 Chris Dumez <cdumez@apple.com> Crash under FFTFrame::fftSetupForSize() https://bugs.webkit.org/show_bug.cgi?id=220866 <rdar://73199504> Reviewed by Eric Carlson. The crash was caused by FFTFrame::fftSetupForSize() but being called concurrently from "HRTF database loader" threads. This patch makes FFTFrame::fftSetupForSize() thread safe to address the issue. Test: webaudio/Panner/PannerNode-crash.html * platform/audio/mac/FFTFrameMac.cpp: (WebCore::fftSetups): (WebCore::FFTFrame::fftSetupForSize): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271704. rdar://problem/73890824 [Payment Request] increment the current version https://bugs.webkit.org/show_bug.cgi?id=220807 <rdar://problem/68622300> Reviewed by Andy Estes. * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm: (WebCore::PaymentAPIVersion::current): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271704 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-21 Devin Rousso <drousso@apple.com> [Payment Request] increment the current version https://bugs.webkit.org/show_bug.cgi?id=220807 <rdar://problem/68622300> Reviewed by Andy Estes. * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm: (WebCore::PaymentAPIVersion::current): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271644. rdar://problem/73890311 [css-multicol] OOM with 1px height columns https://bugs.webkit.org/show_bug.cgi?id=220490 Reviewed by Ryosuke Niwa. Source/WebCore: Test: fast/multicol/newmulticol/zero-height-columns-oom-crash.html Multicol sometimes computes <= 0 heights for the columns. For all those cases the code was adjusting them to 1px values apparently to avoid creating an "infinite" amount of columns. However that adjustment was precisely causing OOM situations in those cases where there was a relatively large amount of free space. In those cases the code was creating dozens of thousands of 1px height columns (with all their associated structures) until we run out of memory. Using zero heights in those cases seem sane because it's already being properly handled in the current code. * rendering/RenderMultiColumnSet.cpp: (WebCore::RenderMultiColumnSet::heightAdjustedForSetOffset const): cap negative heights to 0. LayoutTests: * fast/multicol/newmulticol/zero-height-columns-oom-crash-expected.txt: Added. * fast/multicol/newmulticol/zero-height-columns-oom-crash.html: Added. * imported/blink/fast/pagination/first-letter-inherit-all-crash-expected.txt: Updated expectations. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271644 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-18 Sergio Villar Senin <svillar@igalia.com> [css-multicol] OOM with 1px height columns https://bugs.webkit.org/show_bug.cgi?id=220490 Reviewed by Ryosuke Niwa. Test: fast/multicol/newmulticol/zero-height-columns-oom-crash.html Multicol sometimes computes <= 0 heights for the columns. For all those cases the code was adjusting them to 1px values apparently to avoid creating an "infinite" amount of columns. However that adjustment was precisely causing OOM situations in those cases where there was a relatively large amount of free space. In those cases the code was creating dozens of thousands of 1px height columns (with all their associated structures) until we run out of memory. Using zero heights in those cases seem sane because it's already being properly handled in the current code. * rendering/RenderMultiColumnSet.cpp: (WebCore::RenderMultiColumnSet::heightAdjustedForSetOffset const): cap negative heights to 0. 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271635. rdar://problem/73890109 Elements in a table are incorrectly selected in JavaScript. https://bugs.webkit.org/show_bug.cgi?id=220607 Reviewed by Wenson Hsieh. Source/WebCore: After the fix for https://bugs.webkit.org/show_bug.cgi?id=130844 in https://trac.webkit.org/changeset/260207/webkit a regression was found for table cell selections through JavaScript. The previous fix was for an issue in the difference between how PositionIterator and Position calculated if it was canonical (::isCandidate) in the cases where the renderer was a BR. Instead of only converging isCandidate for BR, this function in PositionIterator was completely subsumed by just calling the implementation for Position. While there are many similarities, there are important differences, especially in the table code, therefore PositionIterator::isCandidate is being reinstated, but with the convergence in the BR case only. Also, moved the check added in http://webkit.org/b/211864 so it will cover cases that were missed due to this code being wrong while that fix was added. Test: editing/selection/editable-table-cell-selection.html * dom/PositionIterator.cpp: (WebCore::PositionIterator::isCandidate const): * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply): LayoutTests: * editing/execCommand/null_calc_primitive_value_for_css_property.html: Added ending tag that was missing and does not affect the issue the test was verifying. * editing/inserting/insert-list-in-table-cell-07-expected.txt: Restored expected text file to original output. * editing/selection/editable-table-cell-selection-expected.txt: Added. * editing/selection/editable-table-cell-selection.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271635 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-19 Megan Gardner <megan_gardner@apple.com> Elements in a table are incorrectly selected in JavaScript. https://bugs.webkit.org/show_bug.cgi?id=220607 Reviewed by Wenson Hsieh. After the fix for https://bugs.webkit.org/show_bug.cgi?id=130844 in https://trac.webkit.org/changeset/260207/webkit a regression was found for table cell selections through JavaScript. The previous fix was for an issue in the difference between how PositionIterator and Position calculated if it was canonical (::isCandidate) in the cases where the renderer was a BR. Instead of only converging isCandidate for BR, this function in PositionIterator was completely subsumed by just calling the implementation for Position. While there are many similarities, there are important differences, especially in the table code, therefore PositionIterator::isCandidate is being reinstated, but with the convergence in the BR case only. Also, moved the check added in http://webkit.org/b/211864 so it will cover cases that were missed due to this code being wrong while that fix was added. Test: editing/selection/editable-table-cell-selection.html * dom/PositionIterator.cpp: (WebCore::PositionIterator::isCandidate const): * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply): 2021-02-02 Alan Coon <alancoon@apple.com> Cherry-pick r271521. rdar://problem/73890570 Mark only child for layout https://bugs.webkit.org/show_bug.cgi?id=218554 Patch by Rob Buis <rbuis@igalia.com> on 2021-01-15 Reviewed by Antti Koivisto. Mark only child for layout in applyStretchAlignmentToChildIfNeeded. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271521 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-15 Rob Buis <rbuis@igalia.com> Mark only child for layout https://bugs.webkit.org/show_bug.cgi?id=218554 Reviewed by Antti Koivisto. Mark only child for layout in applyStretchAlignmentToChildIfNeeded. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded): 2021-02-01 Alan Coon <alancoon@apple.com> Cherry-pick r271933. rdar://problem/73838863 REGRESSION (r268947) Some table elements become blank when scroll-bar is toggled https://bugs.webkit.org/show_bug.cgi?id=221016 <rdar://72881404> Reviewed by Zalan Bujtas. Source/WebCore: FloatingObject aliased the state of layer->isSelfPainting() in its m_shouldPaint, so when compositing code changed isSelfPaintingLayer() for a layer that is also a float post-layout, FloatingObject was left in a state where it didn't paint. Fix by dissociating FloatingObject's shouldPaint from the state of the layer. Rename shouldPaint() to paintsFloat() for clarity (multiple FloatingObjects in different block flows can represent the same float, and only one paints the float). Test: compositing/scrolling/async-overflow-scrolling/self-painting-layer-float.html * rendering/FloatingObjects.cpp: (WebCore::FloatingObject::FloatingObject): (WebCore::FloatingObject::create): (WebCore::FloatingObject::cloneForNewParent const): (WebCore::FloatingObject::shouldPaint const): (WebCore::operator<<): * rendering/FloatingObjects.h: (WebCore::FloatingObject::paintsFloat const): (WebCore::FloatingObject::setPaintsFloat): (WebCore::FloatingObject::shouldPaint const): Deleted. (WebCore::FloatingObject::setShouldPaint): Deleted. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::repaintOverhangingFloats): (WebCore::RenderBlockFlow::paintFloats): (WebCore::RenderBlockFlow::insertFloatingObject): (WebCore::RenderBlockFlow::addOverhangingFloats): (WebCore::RenderBlockFlow::hitTestFloats): (WebCore::RenderBlockFlow::adjustForBorderFit const): LayoutTests: * compositing/scrolling/async-overflow-scrolling/self-painting-layer-float-expected.html: Added. * compositing/scrolling/async-overflow-scrolling/self-painting-layer-float.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271933 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-26 Simon Fraser <simon.fraser@apple.com> REGRESSION (r268947) Some table elements become blank when scroll-bar is toggled https://bugs.webkit.org/show_bug.cgi?id=221016 <rdar://72881404> Reviewed by Zalan Bujtas. FloatingObject aliased the state of layer->isSelfPainting() in its m_shouldPaint, so when compositing code changed isSelfPaintingLayer() for a layer that is also a float post-layout, FloatingObject was left in a state where it didn't paint. Fix by dissociating FloatingObject's shouldPaint from the state of the layer. Rename shouldPaint() to paintsFloat() for clarity (multiple FloatingObjects in different block flows can represent the same float, and only one paints the float). Test: compositing/scrolling/async-overflow-scrolling/self-painting-layer-float.html * rendering/FloatingObjects.cpp: (WebCore::FloatingObject::FloatingObject): (WebCore::FloatingObject::create): (WebCore::FloatingObject::cloneForNewParent const): (WebCore::FloatingObject::shouldPaint const): (WebCore::operator<<): * rendering/FloatingObjects.h: (WebCore::FloatingObject::paintsFloat const): (WebCore::FloatingObject::setPaintsFloat): (WebCore::FloatingObject::shouldPaint const): Deleted. (WebCore::FloatingObject::setShouldPaint): Deleted. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::repaintOverhangingFloats): (WebCore::RenderBlockFlow::paintFloats): (WebCore::RenderBlockFlow::insertFloatingObject): (WebCore::RenderBlockFlow::addOverhangingFloats): (WebCore::RenderBlockFlow::hitTestFloats): (WebCore::RenderBlockFlow::adjustForBorderFit const): 2021-02-01 Alan Coon <alancoon@apple.com> Cherry-pick r271906. rdar://problem/73838863 Make showRenderTree() dump FloatingObjects https://bugs.webkit.org/show_bug.cgi?id=220991 Reviewed by Zalan Bujtas. It's useful to see which RenderBlockFlows have floating object sets and which floating objects they contain, so dump that in render tree dumps. Other minor logging/initializer cleanup. * rendering/FloatingObjects.cpp: (WebCore::operator<<): (WebCore::FloatingObjects::FloatingObjects): * rendering/FloatingObjects.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::outputFloatingObjects const): * rendering/RenderBlockFlow.h: * rendering/RenderObject.cpp: (WebCore::RenderObject::outputRenderSubTreeAndMark const): * rendering/RenderView.cpp: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271906 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-26 Simon Fraser <simon.fraser@apple.com> Make showRenderTree() dump FloatingObjects https://bugs.webkit.org/show_bug.cgi?id=220991 Reviewed by Zalan Bujtas. It's useful to see which RenderBlockFlows have floating object sets and which floating objects they contain, so dump that in render tree dumps. Other minor logging/initializer cleanup. * rendering/FloatingObjects.cpp: (WebCore::operator<<): (WebCore::FloatingObjects::FloatingObjects): * rendering/FloatingObjects.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::outputFloatingObjects const): * rendering/RenderBlockFlow.h: * rendering/RenderObject.cpp: (WebCore::RenderObject::outputRenderSubTreeAndMark const): * rendering/RenderView.cpp: 2021-02-01 Alan Coon <alancoon@apple.com> Cherry-pick r272059. rdar://problem/73838832 REGRESSION(r262893): feComponentTransfer is not rendered correctly on Retina display https://bugs.webkit.org/show_bug.cgi?id=220576 Reviewed by Simon Fraser. Source/WebCore: convertImageDataToColorSpace() creates a temporary ImageBuffer with the size of m_premultipliedImageResult. This ImageBuffer has to be scaled with the filterScale(). But the size of m_premultipliedImageResult is scaled with the filterScale(). This means, convertImageDataToColorSpace() applies the filterScale() twice to the temporary ImageBuffer. The fix is to create the temporary ImageBuffer with the unscaled size of the input ImageData and scale it with the filterScale(). Test: fast/hidpi/filters-component-transfer.html * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::convertImageDataToColorSpace): (WebCore::FilterEffect::copyPremultipliedResult): LayoutTests: * fast/hidpi/filters-component-transfer-expected.html: Added. * fast/hidpi/filters-component-transfer.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272059 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-29 Said Abou-Hallawa <said@apple.com> REGRESSION(r262893): feComponentTransfer is not rendered correctly on Retina display https://bugs.webkit.org/show_bug.cgi?id=220576 Reviewed by Simon Fraser. convertImageDataToColorSpace() creates a temporary ImageBuffer with the size of m_premultipliedImageResult. This ImageBuffer has to be scaled with the filterScale(). But the size of m_premultipliedImageResult is scaled with the filterScale(). This means, convertImageDataToColorSpace() applies the filterScale() twice to the temporary ImageBuffer. The fix is to create the temporary ImageBuffer with the unscaled size of the input ImageData and scale it with the filterScale(). Test: fast/hidpi/filters-component-transfer.html * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::convertImageDataToColorSpace): (WebCore::FilterEffect::copyPremultipliedResult): 2021-02-01 Alan Coon <alancoon@apple.com> Cherry-pick r272054. rdar://problem/73838900 [css-flexbox] REGRESSION(r266695): content inside a `<button>` inside a flex container has a height of `0` without a declared `min-height` https://bugs.webkit.org/show_bug.cgi?id=220946 Reviewed by Zalan Bujtas. Source/WebCore: Test: css3/flexbox/percentage-descendants-of-skipped-flex-item.html r252620 added an optimization which saves layouts for flexbox containers' descendants with percentage heights. That optimization relies on a hash map of percentage height descendants that is filled in with calls to addPercentHeightDescendant(). FlexibleBoxImpl's like RenderButton might wrap their children in anonymous blocks. Those anonymous blocks are skipped for percentage height calculations in RenderBox::computePercentageLogicalHeight() and thus addPercentHeightDescendant() is never called for them. This means that hasPercentageHeightDescendants() would always wrongly return false for a child of a <button> with a percentage height. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::childHasPercentHeightDescendants const): Renamed from hasPercentHeightDescendants in order not to clash with RenderBlock method. It now also checks whether flex items skipped from percentage height calculations are the containing blocks of any percentage height descendant of the flex container (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): (WebCore::RenderFlexibleBox::hasPercentHeightDescendants const): Deleted. * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/percentage-descendants-of-skipped-flex-item-expected.html: Added. * css3/flexbox/percentage-descendants-of-skipped-flex-item.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272054 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-28 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] REGRESSION(r266695): content inside a `<button>` inside a flex container has a height of `0` without a declared `min-height` https://bugs.webkit.org/show_bug.cgi?id=220946 Reviewed by Zalan Bujtas. Test: css3/flexbox/percentage-descendants-of-skipped-flex-item.html r252620 added an optimization which saves layouts for flexbox containers' descendants with percentage heights. That optimization relies on a hash map of percentage height descendants that is filled in with calls to addPercentHeightDescendant(). FlexibleBoxImpl's like RenderButton might wrap their children in anonymous blocks. Those anonymous blocks are skipped for percentage height calculations in RenderBox::computePercentageLogicalHeight() and thus addPercentHeightDescendant() is never called for them. This means that hasPercentageHeightDescendants() would always wrongly return false for a child of a <button> with a percentage height. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::childHasPercentHeightDescendants const): Renamed from hasPercentHeightDescendants in order not to clash with RenderBlock method. It now also checks whether flex items skipped from percentage height calculations are the containing blocks of any percentage height descendant of the flex container (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): (WebCore::RenderFlexibleBox::hasPercentHeightDescendants const): Deleted. * rendering/RenderFlexibleBox.h: 2021-02-01 Alan Coon <alancoon@apple.com> Cherry-pick r272043. rdar://problem/73838798 [ Big Sur ] media/media-source/media-source-webm-init-inside-segment.html is failing https://bugs.webkit.org/show_bug.cgi?id=220552 <rdar://problem/73048070> Patch by Jean-Yves Avenard <jya@apple.com> on 2021-01-28 Reviewed by Jer Noble. Source/WebCore: No new tests - fixes an existing test. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::supportedAudioCodecs): Don't make the webm supported codec conditional. This change makes the webm audio support consistent with video support. supportedAudioCodecs is used by the libwebm parser to determine which codec IDs are to be rejected outright. If a codec id that isn't supported is encountered a parsing error will be thrown, which ultimately causes a HTML audio or video error. If webkit is compiled without opus or vorbis support, in this particular case we do not want an error to be produced but instead ignore the track. LayoutTests: * platform/mac/TestExpectations: unskip test git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272043 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-28 Jean-Yves Avenard <jya@apple.com> [ Big Sur ] media/media-source/media-source-webm-init-inside-segment.html is failing https://bugs.webkit.org/show_bug.cgi?id=220552 <rdar://problem/73048070> Reviewed by Jer Noble. No new tests - fixes an existing test. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::supportedAudioCodecs): Don't make the webm supported codec conditional. This change makes the webm audio support consistent with video support. supportedAudioCodecs is used by the libwebm parser to determine which codec IDs are to be rejected outright. If a codec id that isn't supported is encountered a parsing error will be thrown, which ultimately causes a HTML audio or video error. If webkit is compiled without opus or vorbis support, in this particular case we do not want an error to be produced but instead ignore the track. 2021-02-01 Alan Coon <alancoon@apple.com> Cherry-pick r271939. rdar://problem/73838846 [Mac] MediaSampleCursor::stepInOrderedMap can hang when stepping to the end of a track that hasn't been fully parsed https://bugs.webkit.org/show_bug.cgi?id=220555 <rdar://problem/72910000> Reviewed by Eric Carlson. Source/WebCore: Test: http/tests/media/video-canplaythrough-webm.html * platform/graphics/FloatSize.h: Exported toJSONObject. Source/WebKit: When a container has multiple tracks, CoreMedia determines the overall duration by creating a cursor at a presentation time of +infinity then asking for its timing info, the expectation being that the cursor will clamp itself to the track duration and report that in MediaSampleCursor::getSampleTiming. Previously, this could result in a hang for tracks that had not yet finished parsing, as MediaSampleCursor was designed to wait for samples outside the playable range. With this change, MediaSampleCursor no longer waits for samples outside the playable range but rather reports clamped timing info without waiting for a sample. If CoreMedia asks for information that requires a sample (e.g., sample location), MediaSampleCursor will respond with `kMTPluginSampleCursorError_LocationNotAvailable`. So that CoreMedia can determine the range of playable samples, this patch implements MediaSampleCursor::getPlayableHorizon. To simplify this implementation, MediaSampleCursor now assumes that decode time equals presentation time (for video tracks) or is invalid (for audio tracks). While here, also added media logging that helped debug this issue. Test: http/tests/media/video-canplaythrough-webm.html * Shared/mac/MediaFormatReader/MediaSampleByteRange.cpp: (WebKit::MediaSampleByteRange::MediaSampleByteRange): Asserted our assmpution about the relationship between presentation time and decode time. * Shared/mac/MediaFormatReader/MediaSampleCursor.cpp: (WebKit::assumedDecodeTime): Added to compute decode time from presentation time and a nominal sample. (WebKit::upperBound): Changed to compute the decode key based on assumed decode time. (WebKit::stepIterator): Removed the MediaTime specialization. (WebKit::stepTime): Added to step a MediaTime rather than an iterator. (WebKit::MediaSampleCursor::MediaSampleCursor): Initialized logging. (WebKit::MediaSampleCursor::locateIterator const): Changed to find an iterator based on presentation time and assumed decode time. (WebKit::MediaSampleCursor::locateMediaSample const): Ditto. (WebKit::MediaSampleCursor::locateTiming const): Added to locate timing info even if no sample is available. (WebKit::MediaSampleCursor::stepInOrderedMap): Changed to call getSampleMap, and removed the MediaTime specialization. (WebKit::MediaSampleCursor::stepInPresentationTime): Added to replace the MediaTime specialization of stepInOrderedMap. (WebKit::MediaSampleCursor::getSampleMap const): Added to call MediaTrackReader::waitForSample and return as soon as at least one sample is available. Returns kMTPluginSampleCursorError_NoSamples if the track finishes parsing with no samples. (WebKit::MediaSampleCursor::getMediaSample const): Changed to call getSampleMap. (WebKit::MediaSampleCursor::getTiming const): Added to get timing info. (WebKit::MediaSampleCursor::copyProperty): Added logging. (WebKit::MediaSampleCursor::stepInDecodeOrderAndReportStepsTaken): Changed to call the new version of stepInOrderedMap. (WebKit::MediaSampleCursor::stepInPresentationOrderAndReportStepsTaken): Ditto. (WebKit::MediaSampleCursor::stepByDecodeTime): Changed to call stepInPresentationTime. (WebKit::MediaSampleCursor::stepByPresentationTime): Ditto. (WebKit::MediaSampleCursor::compareInDecodeOrder const): Changed to call getTiming. (WebKit::MediaSampleCursor::getSampleTiming const): Ditto. (WebKit::MediaSampleCursor::getPlayableHorizon const): Implemented by taking the difference between the last sample's end time and the cursor's presentation time. (WebKit::MediaSampleCursor::logChannel const): Added. (WebKit::makeIterator): Deleted. (WebKit::makeTime): Deleted. (WebKit::MediaSampleCursor::createAtDecodedSample): Deleted. * Shared/mac/MediaFormatReader/MediaSampleCursor.h: (WebKit::MediaSampleCursor::logger const): Configured logging. (WebKit::MediaSampleCursor::logClassName const): Ditto. (WebKit::MediaSampleCursor::logIdentifier const): Ditto. * Shared/mac/MediaFormatReader/MediaTrackReader.cpp: (WebKit::MediaTrackReader::mediaTypeString const): Ditto. (WebKit::MediaTrackReader::nextSampleCursorLogIdentifier const): Ditto. * Shared/mac/MediaFormatReader/MediaTrackReader.h: LayoutTests: * http/conf/mime.types: Added an entry for video/webm. * http/tests/media/resources/long-test-vp9-vorbis.webm: Added. * http/tests/media/video-canplaythrough-webm-expected.txt: Added. * http/tests/media/video-canplaythrough-webm.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271939 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-27 Andy Estes <aestes@apple.com> [Mac] MediaSampleCursor::stepInOrderedMap can hang when stepping to the end of a track that hasn't been fully parsed https://bugs.webkit.org/show_bug.cgi?id=220555 <rdar://problem/72910000> Reviewed by Eric Carlson. Test: http/tests/media/video-canplaythrough-webm.html * platform/graphics/FloatSize.h: Exported toJSONObject. 2021-02-01 Alan Coon <alancoon@apple.com> Cherry-pick r271609. rdar://problem/73838888 REGRESSION (r270964): Hovering cursor over Earth animation causes flashing red distortion on GitHub.com https://bugs.webkit.org/show_bug.cgi?id=220612 <rdar://problem/73175210> Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-01-19 Reviewed by Dean Jackson. When reading the display buffer for WebKit snapshots, use READ_FRAMEBUFFER on WebGL2 and FRAMEBUFFER on WebGL1. Fixes the case where WebGL2 contexts would get broken because taking a snapshot would overwrite the framebuffer attachment. No new tests, snapshots are not tested at the moment. * platform/graphics/angle/GraphicsContextGLANGLEUtilities.h: (WebCore::ScopedRestoreReadFramebufferBinding::framebufferTarget const): * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::readCompositedResults): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271609 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-19 Kimmo Kinnunen <kkinnunen@apple.com> REGRESSION (r270964): Hovering cursor over Earth animation causes flashing red distortion on GitHub.com https://bugs.webkit.org/show_bug.cgi?id=220612 <rdar://problem/73175210> Reviewed by Dean Jackson. When reading the display buffer for WebKit snapshots, use READ_FRAMEBUFFER on WebGL2 and FRAMEBUFFER on WebGL1. Fixes the case where WebGL2 contexts would get broken because taking a snapshot would overwrite the framebuffer attachment. No new tests, snapshots are not tested at the moment. * platform/graphics/angle/GraphicsContextGLANGLEUtilities.h: (WebCore::ScopedRestoreReadFramebufferBinding::framebufferTarget const): * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::readCompositedResults): 2021-01-29 Alan Coon <alancoon@apple.com> Cherry-pick r271551. rdar://problem/73473686 Scroll position is lost when homing out and resuming Safari on iOS https://bugs.webkit.org/show_bug.cgi?id=220676 Reviewed by Tim Horton. When homing out on iOS, UIKit snapshotting causes multiple web view resizes, which runs the dynamicViewportSizeUpdate() logic. This can trigger programmatic scrolls via FrameView::setContentsSize(), which get stored in the scrolling state tree. When that tree is committed on resume, we then erroneously apply the programmatic scrolls. Fix by ignoring requested scroll positions updates when snapshotting, as we do when we're in the page cache. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271551 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-15 Simon Fraser <simon.fraser@apple.com> Scroll position is lost when homing out and resuming Safari on iOS https://bugs.webkit.org/show_bug.cgi?id=220676 Reviewed by Tim Horton. When homing out on iOS, UIKit snapshotting causes multiple web view resizes, which runs the dynamicViewportSizeUpdate() logic. This can trigger programmatic scrolls via FrameView::setContentsSize(), which get stored in the scrolling state tree. When that tree is committed on resume, we then erroneously apply the programmatic scrolls. Fix by ignoring requested scroll positions updates when snapshotting, as we do when we're in the page cache. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate): 2021-01-29 Alan Coon <alancoon@apple.com> Cherry-pick r271515. rdar://problem/73473627 REGRESSION(r269813): PLT5 regressed by 0.5% https://bugs.webkit.org/show_bug.cgi?id=220652 <rdar://problem/71517335> Reviewed by Antti Koivisto. In r269813 we added support for animating more pseudo-elements besides ::after and ::before. However, the only other pseudo-element we realistically should be supporting animations for at this juncture is ::marker. So instead of calling Style::TreeResolver::resolvePseudoStyle() for all public pseudo-elements, we call it for ::after, ::before and ::marker alone. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveElement): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271515 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-15 Antoine Quint <graouts@webkit.org> REGRESSION(r269813): PLT5 regressed by 0.5% https://bugs.webkit.org/show_bug.cgi?id=220652 <rdar://problem/71517335> Reviewed by Antti Koivisto. In r269813 we added support for animating more pseudo-elements besides ::after and ::before. However, the only other pseudo-element we realistically should be supporting animations for at this juncture is ::marker. So instead of calling Style::TreeResolver::resolvePseudoStyle() for all public pseudo-elements, we call it for ::after, ::before and ::marker alone. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveElement): 2021-01-29 Alan Coon <alancoon@apple.com> Cherry-pick r271507. rdar://problem/73473467 [Cocoa] Strip DataDetectors links when copying content to the pasteboard https://bugs.webkit.org/show_bug.cgi?id=220526 <rdar://problem/71045590> Reviewed by Ryosuke Niwa. Source/WebCore: Currently, when DataDetectors links are written to the pasteboard when copied. This is problematic, since clicking on a DataDetector link outside of a valid context results in an attempt to open an invalid URL. Instead, DataDetectors links should be stripped when copied. To remove the link, while preserving any custom styles, the <a> element created by Data Detection is replaced with a <span> element. Any attributes and styles added by WebKit are removed as a part of this transformation. Tests: editing/pasteboard/copy-paste-data-detected-links.html CopyRTF.StripsDataDetectedLinks PasteWebArchive.StripsDataDetectedLinks * editing/cocoa/DataDetection.h: * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::isDataDetectorElement): Add a helper to check if an element was created through Data Detection. * editing/cocoa/HTMLConverter.mm: (HTMLConverter::_addLinkForElement): Do not add NSLinkAttributeName for DataDetectors links. (HTMLConverter::_exitElement): Factor out link creation logic. * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::spanReplacementForElement): Centralize the logic that determines whether or not an element should be replaced by a <span>. Previously, this only applied to <slot> elements. Now, it applies to <slot> and DataDetectors links. (WebCore::StyledMarkupAccumulator::appendStartTag): If the element was created through DataDetection, append a <span> rather than an <a>, to drop the link. The DataDetectors and href attributes are also dropped from the markup string. Finally, remove the text decoration style that was added by WebKit to style the DataDetectors link. (WebCore::StyledMarkupAccumulator::appendEndTag): Consult shouldReplaceElementWithSpan when appending the end tag. Tools: Added API tests to verify DataDetectors links are not preserved when copying/pasting WebArchives and rich text. * TestWebKitAPI/Tests/WebKitCocoa/CopyRTF.mm: (StripsDataDetectorsLinks): * TestWebKitAPI/Tests/WebKitCocoa/PasteWebArchive.mm: (StripsDataDetectorsLinks): LayoutTests: Added a test which copies content containing two data detected links and verifies that the links are removed. * editing/pasteboard/copy-paste-data-detected-links-expected.txt: Added. * editing/pasteboard/copy-paste-data-detected-links.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271507 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-14 Aditya Keerthi <akeerthi@apple.com> [Cocoa] Strip DataDetectors links when copying content to the pasteboard https://bugs.webkit.org/show_bug.cgi?id=220526 <rdar://problem/71045590> Reviewed by Ryosuke Niwa. Currently, when DataDetectors links are written to the pasteboard when copied. This is problematic, since clicking on a DataDetector link outside of a valid context results in an attempt to open an invalid URL. Instead, DataDetectors links should be stripped when copied. To remove the link, while preserving any custom styles, the <a> element created by Data Detection is replaced with a <span> element. Any attributes and styles added by WebKit are removed as a part of this transformation. Tests: editing/pasteboard/copy-paste-data-detected-links.html CopyRTF.StripsDataDetectedLinks PasteWebArchive.StripsDataDetectedLinks * editing/cocoa/DataDetection.h: * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::isDataDetectorElement): Add a helper to check if an element was created through Data Detection. * editing/cocoa/HTMLConverter.mm: (HTMLConverter::_addLinkForElement): Do not add NSLinkAttributeName for DataDetectors links. (HTMLConverter::_exitElement): Factor out link creation logic. * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::spanReplacementForElement): Centralize the logic that determines whether or not an element should be replaced by a <span>. Previously, this only applied to <slot> elements. Now, it applies to <slot> and DataDetectors links. (WebCore::StyledMarkupAccumulator::appendStartTag): If the element was created through DataDetection, append a <span> rather than an <a>, to drop the link. The DataDetectors and href attributes are also dropped from the markup string. Finally, remove the text decoration style that was added by WebKit to style the DataDetectors link. (WebCore::StyledMarkupAccumulator::appendEndTag): Consult shouldReplaceElementWithSpan when appending the end tag. 2021-01-29 Alan Coon <alancoon@apple.com> Cherry-pick r271503. rdar://problem/73473503 Add a quirk to disable "return to element fullscreen from picture-in-picture" for some sites https://bugs.webkit.org/show_bug.cgi?id=220606 Reviewed by Eric Carlson. Source/WebCore: For iPads, we add the support of "return to element fullscreen from picture-in-picture" in r265562. Unfortunately, some sites do not set element's styles properly when a video returns to fullscreen from picture-in-picture. This patch adds a quirk to disable the feature for those sites for now. * page/Quirks.cpp: (WebCore::Quirks::blocksReturnToFullscreenFromPictureInPictureQuirk const): * page/Quirks.h: * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::setupFullscreen): (VideoFullscreenInterfaceAVKit::didStartPictureInPicture): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::setUpFullscreen): Source/WebKit: * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in: * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID): * UIProcess/WebFullScreenManagerProxy.cpp: (WebKit::WebFullScreenManagerProxy::blocksReturnToFullscreenFromPictureInPicture const): (WebKit::WebFullScreenManagerProxy::enterFullScreen): * UIProcess/WebFullScreenManagerProxy.h: * UIProcess/WebFullScreenManagerProxy.messages.in: * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullScreenWindowController enterFullScreen]): (-[WKFullScreenWindowController didEnterPictureInPicture]): * WebProcess/FullScreen/WebFullScreenManager.cpp: (WebKit::WebFullScreenManager::enterFullScreenForElement): * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp: (WebKit::InjectedBundlePageFullScreenClient::enterFullScreenForElement): * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h: * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271503 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-14 Peng Liu <peng.liu6@apple.com> Add a quirk to disable "return to element fullscreen from picture-in-picture" for some sites https://bugs.webkit.org/show_bug.cgi?id=220606 Reviewed by Eric Carlson. For iPads, we add the support of "return to element fullscreen from picture-in-picture" in r265562. Unfortunately, some sites do not set element's styles properly when a video returns to fullscreen from picture-in-picture. This patch adds a quirk to disable the feature for those sites for now. * page/Quirks.cpp: (WebCore::Quirks::blocksReturnToFullscreenFromPictureInPictureQuirk const): * page/Quirks.h: * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::setupFullscreen): (VideoFullscreenInterfaceAVKit::didStartPictureInPicture): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::setUpFullscreen): 2021-01-29 Alan Coon <alancoon@apple.com> Cherry-pick r271459. rdar://problem/73473665 [macOS] "Correct Spelling Automatically" menu items are inconsistent when autocorrect="off" https://bugs.webkit.org/show_bug.cgi?id=220598 <rdar://problem/71713611> Reviewed by Tim Horton. Source/WebCore: Disable the context menu item to toggle automatic spelling correction, as well as the menu bar item to toggle automatic spelling correction, in the case where the autocorrect attribute is set to "off". See below for more details. Tests: editing/mac/spelling/disable-automatic-spelling-correction-context-menu-item.html DisableAutomaticSpellingCorrection.AutocorrectAttribute * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::canEnableAutomaticSpellingCorrection const): Factor out logic for checking the `autocorrect` attribute into a separate helper function; this is used to determine whether or not we should enable both the context menu item and menu item in the menu bar. (WebCore::AlternativeTextController::isAutomaticSpellingCorrectionEnabled): * editing/AlternativeTextController.h: (WebCore::AlternativeTextController::UNLESS_ENABLED): * editing/Editor.cpp: (WebCore::Editor::canEnableAutomaticSpellingCorrection const): * editing/Editor.h: * page/ContextMenuController.cpp: (WebCore::ContextMenuController::checkOrEnableIfNeeded const): Source/WebKit: Plumb the new `canEnableAutomaticSpellingCorrection` flag through `EditorState` to the UI process, where we can consult it when validating user interface items (namely, the "Correct Spelling Automatically" menu item, which corresponds to the `-toggleAutomaticSpellingCorrection:` selector). * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode const): (WebKit::EditorState::PostLayoutData::decode): (WebKit::operator<<): * Shared/EditorState.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::validateUserInterfaceItem): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::getPlatformEditorState const): Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/mac/DisableAutomaticSpellingCorrection.mm: Added. Add a new API test to verify that the `NSMenuItem` for toggling automatic spelling correction is invalid when editing inside a form control with autocorrect="off". * WebKitTestRunner/InjectedBundle/EventSendingController.cpp: (WTR::getMenuItemEnabledCallback): Add the readonly `enabled` JS property on context menu items. See the new layout test, editing/mac/spelling/disable-automatic-spelling-correction-context-menu-item.html, for more information. LayoutTests: Add a new API test to verify that the context menu item to toggle "Correct Spelling Automatically" is disabled when autocorrect="off". * editing/mac/spelling/disable-automatic-spelling-correction-context-menu-item-expected.txt: Added. * editing/mac/spelling/disable-automatic-spelling-correction-context-menu-item.html: Added. * platform/mac-wk1/TestExpectations: Disable the test in DumpRenderTree, due to lack of support for context menu testing in WebKit1. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271459 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-13 Wenson Hsieh <wenson_hsieh@apple.com> [macOS] "Correct Spelling Automatically" menu items are inconsistent when autocorrect="off" https://bugs.webkit.org/show_bug.cgi?id=220598 <rdar://problem/71713611> Reviewed by Tim Horton. Disable the context menu item to toggle automatic spelling correction, as well as the menu bar item to toggle automatic spelling correction, in the case where the autocorrect attribute is set to "off". See below for more details. Tests: editing/mac/spelling/disable-automatic-spelling-correction-context-menu-item.html DisableAutomaticSpellingCorrection.AutocorrectAttribute * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::canEnableAutomaticSpellingCorrection const): Factor out logic for checking the `autocorrect` attribute into a separate helper function; this is used to determine whether or not we should enable both the context menu item and menu item in the menu bar. (WebCore::AlternativeTextController::isAutomaticSpellingCorrectionEnabled): * editing/AlternativeTextController.h: (WebCore::AlternativeTextController::UNLESS_ENABLED): * editing/Editor.cpp: (WebCore::Editor::canEnableAutomaticSpellingCorrection const): * editing/Editor.h: * page/ContextMenuController.cpp: (WebCore::ContextMenuController::checkOrEnableIfNeeded const): 2021-01-29 Alan Coon <alancoon@apple.com> Cherry-pick r271414. rdar://problem/73473727 REGRESSION (r265044): [macOS] Safari autocorrects text when typing in login field on amazon.com https://bugs.webkit.org/show_bug.cgi?id=220556 <rdar://problem/71602937> Reviewed by Darin Adler. Source/WebCore: Add an internal testing hook to ask an input element whether it has disabled spellchecking (except for text replacement). * testing/Internals.cpp: (WebCore::Internals::isSpellcheckDisabledExceptTextReplacement const): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: Restores the implementation of `WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled`, which was removed in r265044, with the reasoning that the code was unused. However, Safari still uses this SPI on macOS to prevent automatic spelling correction from triggering when editing form fields that are AutoFillable. Test: WebKit.DisableSpellcheck * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp: (WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled): Tools: Add an API test that uses WebKit C API (`WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled`) to disable or enable spellchecking on input elements. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKitCocoa/DisableSpellcheck.mm: Added. * TestWebKitAPI/Tests/WebKitCocoa/DisableSpellcheckPlugIn.mm: Added. (-[DisableSpellcheckPlugIn webProcessPlugIn:didCreateBrowserContextController:]): (-[DisableSpellcheckPlugIn webProcessPlugInBrowserContextController:didClearWindowObjectForFrame:inScriptWorld:]): (-[DisableSpellcheckPlugIn webProcessPlugInBrowserContextController:didFinishLoadForFrame:]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271414 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-12 Wenson Hsieh <wenson_hsieh@apple.com> REGRESSION (r265044): [macOS] Safari autocorrects text when typing in login field on amazon.com https://bugs.webkit.org/show_bug.cgi?id=220556 <rdar://problem/71602937> Reviewed by Darin Adler. Add an internal testing hook to ask an input element whether it has disabled spellchecking (except for text replacement). * testing/Internals.cpp: (WebCore::Internals::isSpellcheckDisabledExceptTextReplacement const): * testing/Internals.h: * testing/Internals.idl: 2021-01-29 Alan Coon <alancoon@apple.com> Cherry-pick r271388. rdar://problem/73473676 Safari 14 on 2x display renders NYS DMV page as blurry https://bugs.webkit.org/show_bug.cgi?id=220528 <rdar://problem/71440246> Reviewed by Tim Horton. Source/WebCore: Certain combinations of nested perspective and transform cause Core Animation to rasterize at unit scale, which makes layers blurry on Retina displays. Enable code that was already used on iOS to set layer rasterization scale. Test: compositing/contents-scale/hidpi-tests/rasterization-scale.html * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::setContentsScale): LayoutTests: * compositing/contents-scale/hidpi-tests/rasterization-scale-expected.html: Added. * compositing/contents-scale/hidpi-tests/rasterization-scale.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271388 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-11 Simon Fraser <simon.fraser@apple.com> Safari 14 on 2x display renders NYS DMV page as blurry https://bugs.webkit.org/show_bug.cgi?id=220528 <rdar://problem/71440246> Reviewed by Tim Horton. Certain combinations of nested perspective and transform cause Core Animation to rasterize at unit scale, which makes layers blurry on Retina displays. Enable code that was already used on iOS to set layer rasterization scale. Test: compositing/contents-scale/hidpi-tests/rasterization-scale.html * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::setContentsScale): 2021-01-29 Alan Coon <alancoon@apple.com> Cherry-pick r271379. rdar://problem/73473604 Keep newly created IDBObjectStores in deleted map when IDBTransaction is aborted https://bugs.webkit.org/show_bug.cgi?id=220483 <rdar://problem/71934293> Patch by Sihui Liu <sihui_liu@appe.com> on 2021-01-11 Reviewed by Darin Adler. Source/WebCore: When an upgrade transaction is aborted, we move objects from m_deletedObjectStores to m_referencedObjectStores to revert the deletion operation. When updating m_referencedObjectStores, we did not check whether key already exists (this can happen when an object store gets deleted and a new object store with the same name is created; see updated layout test). Therefore, some object store in m_referencedObjectStores would be replaced and destroyed (since m_referencedObjectStores holds unique pointers) when the object store is referenced by JS object. Test: storage/indexeddb/modern/abort-objectstore-info.html * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::internalAbort): LayoutTests: * storage/indexeddb/modern/abort-objectstore-info-expected.txt: * storage/indexeddb/modern/abort-objectstore-info-private-expected.txt: * storage/indexeddb/modern/resources/abort-objectstore-info.js: (prepareDatabase): (secondUpgradeNeeded): (checkState): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271379 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-11 Sihui Liu <sihui_liu@appe.com> Keep newly created IDBObjectStores in deleted map when IDBTransaction is aborted https://bugs.webkit.org/show_bug.cgi?id=220483 <rdar://problem/71934293> Reviewed by Darin Adler. When an upgrade transaction is aborted, we move objects from m_deletedObjectStores to m_referencedObjectStores to revert the deletion operation. When updating m_referencedObjectStores, we did not check whether key already exists (this can happen when an object store gets deleted and a new object store with the same name is created; see updated layout test). Therefore, some object store in m_referencedObjectStores would be replaced and destroyed (since m_referencedObjectStores holds unique pointers) when the object store is referenced by JS object. Test: storage/indexeddb/modern/abort-objectstore-info.html * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::internalAbort): 2021-01-29 Alan Coon <alancoon@apple.com> Cherry-pick r271368. rdar://problem/73473690 Keep newly created IDBIndex objects in deleted map when IDBTransaction is aborted https://bugs.webkit.org/show_bug.cgi?id=220489 <rdar://problem/70498831> Patch by Sihui Liu <sihui_liu@appe.com> on 2021-01-11 Reviewed by Youenn Fablet. Source/WebCore: When an upgrade transaction is aborted, we move objects from m_deletedIndexes to m_referencedIndexes to revert the index deletion operation. When updating m_referencedIndexes, we did not check whether key already exists. Therefore, some indexes in m_referencedIndexes would be replaced and destroyed (since m_referencedIndexes holds unique pointers) when the index is still referenced by JS. Tests: storage/indexeddb/modern/abort-index-info-private.html storage/indexeddb/modern/abort-index-info.html * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::rollbackForVersionChangeAbort): LayoutTests: * storage/indexeddb/modern/abort-index-info-expected.txt: Added. * storage/indexeddb/modern/abort-index-info-private-expected.txt: Added. * storage/indexeddb/modern/abort-index-info-private.html: Added. * storage/indexeddb/modern/abort-index-info.html: Added. * storage/indexeddb/modern/resources/abort-index-info.js: Added. (prepareDatabase): (versionChangeSuccessCallback.secondRequest.onerror): (versionChangeSuccessCallback): (secondUpgradeNeeded): (checkState): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271368 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-11 Sihui Liu <sihui_liu@appe.com> Keep newly created IDBIndex objects in deleted map when IDBTransaction is aborted https://bugs.webkit.org/show_bug.cgi?id=220489 <rdar://problem/70498831> Reviewed by Youenn Fablet. When an upgrade transaction is aborted, we move objects from m_deletedIndexes to m_referencedIndexes to revert the index deletion operation. When updating m_referencedIndexes, we did not check whether key already exists. Therefore, some indexes in m_referencedIndexes would be replaced and destroyed (since m_referencedIndexes holds unique pointers) when the index is still referenced by JS. Tests: storage/indexeddb/modern/abort-index-info-private.html storage/indexeddb/modern/abort-index-info.html * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::rollbackForVersionChangeAbort): 2021-01-29 Alan Coon <alancoon@apple.com> Cherry-pick r271619. rdar://problem/73461349 REGRESSION(r269865) Mail's context menu when right clicking on a link does not contain correct entries https://bugs.webkit.org/show_bug.cgi?id=220745 Patch by Alex Christensen <achristensen@webkit.org> on 2021-01-19 Reviewed by Tim Horton. Source/WebCore: r269865 broke binary compatibility by changing the values of many WebCore::ContextMenuAction values and many WKContextMenuItemTag values, and not in the same way. In WebContextMenuProxyMac::getContextMenuItem we call NSMenuItem setTag: with the value from WebCore::ContextMenuAction and mail compares those values with values from WKContextMenuItemTag in our C API. This isn't ideal, but we need to retain binary compatibility. * platform/ContextMenuItem.h: Source/WebKit: * Shared/API/c/WKContextMenuItem.cpp: Add a bunch of static_asserts to verify that our binary values correspond to each other and don't change. * Shared/API/c/WKContextMenuItemTypes.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271619 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-19 Alex Christensen <achristensen@webkit.org> REGRESSION(r269865) Mail's context menu when right clicking on a link does not contain correct entries https://bugs.webkit.org/show_bug.cgi?id=220745 Reviewed by Tim Horton. r269865 broke binary compatibility by changing the values of many WebCore::ContextMenuAction values and many WKContextMenuItemTag values, and not in the same way. In WebContextMenuProxyMac::getContextMenuItem we call NSMenuItem setTag: with the value from WebCore::ContextMenuAction and mail compares those values with values from WKContextMenuItemTag in our C API. This isn't ideal, but we need to retain binary compatibility. * platform/ContextMenuItem.h: 2021-01-28 Alan Coon <alancoon@apple.com> Cherry-pick r271873. rdar://problem/73722521 REGRESSION (r270874): Some React Native apps are reported broken on iOS https://bugs.webkit.org/show_bug.cgi?id=220809 Reviewed by Saam Barati. Source/JavaScriptCore: r270874 fixed for/in shadowing issue by introducing an invariant: a property returned by getOwn*PropertyNames() in DontEnumPropertiesMode::Exclude should be reported as [[Enumerable]] by getOwnPropertySlot(). Otherwise, for/in skips the property, which causes RN apps to break. Since there is no way to enforce this invariant for opaque API objects like JSCallbackObject, this change skips [[Enumerable]] check for them by introducing GetOwnPropertySlotMayBeWrongAboutDontEnum out of line type info flag. Also, this patch reverts JSCallbackObject::getOwnPropertySlot() changes of r270874 that are no longer necessary and observable (via Object.getOwnPropertyDescriptor). * API/JSCallbackObject.h: * API/JSCallbackObjectFunctions.h: (JSC::JSCallbackObject<Parent>::getOwnPropertySlot): * API/tests/testapiScripts/testapi.js: * runtime/JSObject.cpp: (JSC::JSObject::hasEnumerableProperty const): * runtime/JSTypeInfo.h: (JSC::TypeInfo::getOwnPropertySlotMayBeWrongAboutDontEnum const): Source/WebCore: * bridge/runtime_object.h: Source/WebKit: * WebProcess/Plugins/Netscape/JSNPObject.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271873 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-25 Alexey Shvayka <shvaikalesh@gmail.com> REGRESSION (r270874): Some React Native apps are reported broken on iOS https://bugs.webkit.org/show_bug.cgi?id=220809 Reviewed by Saam Barati. * bridge/runtime_object.h: 2021-01-27 Alan Coon <alancoon@apple.com> Cherry-pick r271620. rdar://problem/73678115 Web Inspector: Font Details sidebar - Fractional variation axis ranges/default values are rounded. https://bugs.webkit.org/show_bug.cgi?id=220474 Reviewed by BJ Burg. Source/WebCore: Use float instead of int for variation axis range and defaults, as these values can be fractional. * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::FontVariationAxis::FontVariationAxis): (WebCore::FontPlatformData::FontVariationAxis::defaultValue const): (WebCore::FontPlatformData::FontVariationAxis::minimumValue const): (WebCore::FontPlatformData::FontVariationAxis::maximumValue const): Source/WebInspectorUI: Fixes Font Details sidebar display of variation axis values, ranges, and defaults to show fractional precision when such precision is present. * Localizations/en.lproj/localizedStrings.js: * UserInterface/Views/FontDetailsPanel.js: (WI.FontDetailsPanel.prototype.refresh): (WI.FontDetailsPanel.prototype._formatSimpleSingleValue): (WI.FontDetailsPanel.prototype._formatVariationValue): (WI.FontDetailsPanel.prototype._createVariationValueElement): (WI.FontDetailsPanel.prototype._formatAxisValueAsString): - Show fractional values with between 0 and 2 decimal places. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271620 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-19 Patrick Angle <pangle@apple.com> Web Inspector: Font Details sidebar - Fractional variation axis ranges/default values are rounded. https://bugs.webkit.org/show_bug.cgi?id=220474 Reviewed by BJ Burg. Use float instead of int for variation axis range and defaults, as these values can be fractional. * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::FontVariationAxis::FontVariationAxis): (WebCore::FontPlatformData::FontVariationAxis::defaultValue const): (WebCore::FontPlatformData::FontVariationAxis::minimumValue const): (WebCore::FontPlatformData::FontVariationAxis::maximumValue const): 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271531. rdar://problem/73586664 Playback fails at marketwatch.com https://bugs.webkit.org/show_bug.cgi?id=220646 <rdar://72950166> Reviewed by Xabier Rodriguez-Calvar. Source/WebCore: Test: media/media-play-promise-reject-play-notallowed-audio.html When audio playback is blocked by settings, the HTMLMediaElement must load its source media's metadata in order to determine whether the media should be allowed to play without a user gesture. If a play promise is pending, the expectation is that those promises will reject with a NotAllowedError to indicate that a user gesture is needed. However, by calling pauseInternal() to block (possibly) existing playback, this causes those promises to be rejected with an AbortError, as if the pause() method had been called. Call scheduleRejectPendingPlayPromises() with NotAllowedError to ensure the correct error is used to reject. Drive-by fix: no reason to dispatch and call rejectPendingPlayPromises() or resolvePendingPlayPromises() if there are no promises to reject or resolve, and not calling these methods makes the logs less noisy. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::scheduleResolvePendingPlayPromises): (WebCore::HTMLMediaElement::scheduleRejectPendingPlayPromises): (WebCore::HTMLMediaElement::setVolume): (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): (WebCore::HTMLMediaElement::updateShouldPlay): LayoutTests: * media/media-play-promise-reject-play-notallowed-audio-expected.txt: Added. * media/media-play-promise-reject-play-notallowed-audio.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271531 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-15 Jer Noble <jer.noble@apple.com> Playback fails at marketwatch.com https://bugs.webkit.org/show_bug.cgi?id=220646 <rdar://72950166> Reviewed by Xabier Rodriguez-Calvar. Test: media/media-play-promise-reject-play-notallowed-audio.html When audio playback is blocked by settings, the HTMLMediaElement must load its source media's metadata in order to determine whether the media should be allowed to play without a user gesture. If a play promise is pending, the expectation is that those promises will reject with a NotAllowedError to indicate that a user gesture is needed. However, by calling pauseInternal() to block (possibly) existing playback, this causes those promises to be rejected with an AbortError, as if the pause() method had been called. Call scheduleRejectPendingPlayPromises() with NotAllowedError to ensure the correct error is used to reject. Drive-by fix: no reason to dispatch and call rejectPendingPlayPromises() or resolvePendingPlayPromises() if there are no promises to reject or resolve, and not calling these methods makes the logs less noisy. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::scheduleResolvePendingPlayPromises): (WebCore::HTMLMediaElement::scheduleRejectPendingPlayPromises): (WebCore::HTMLMediaElement::setVolume): (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): (WebCore::HTMLMediaElement::updateShouldPlay): 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271799. rdar://problem/73581832 PCM: Use different well-known locations for triggering and reporting attribution https://bugs.webkit.org/show_bug.cgi?id=220902 <rdar://problem/73550632> Reviewed by Brent Fulgham. The discussion in W3C Privacy CG concluded that we should use distinct well-known URL paths for websites triggering attribution and for the browser reporting attribution (https://github.com/privacycg/private-click-measurement/issues/59). This patch changes the one location to these two: /.well-known/private-click-measurement/trigger-attribution /.well-known/private-click-measurement/report-attribution Source/WebCore: Existing tests updated. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::parseAttributionRequest): (WebCore::PrivateClickMeasurement::reportURL const): Tools: * TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm: (TestWebKitAPI::TEST): LayoutTests: * http/tests/privateClickMeasurement/resources/redirectToConversion.php: * http/tests/privateClickMeasurement/resources/redirectToConversionOnIPAddress.php: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271799 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-25 John Wilander <wilander@apple.com> PCM: Use different well-known locations for triggering and reporting attribution https://bugs.webkit.org/show_bug.cgi?id=220902 <rdar://problem/73550632> Reviewed by Brent Fulgham. The discussion in W3C Privacy CG concluded that we should use distinct well-known URL paths for websites triggering attribution and for the browser reporting attribution (https://github.com/privacycg/private-click-measurement/issues/59). This patch changes the one location to these two: /.well-known/private-click-measurement/trigger-attribution /.well-known/private-click-measurement/report-attribution Existing tests updated. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::parseAttributionRequest): (WebCore::PrivateClickMeasurement::reportURL const): 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271618. rdar://problem/73477509 REGRESSION(r266695) Range control with custom track width sized incorrectly https://bugs.webkit.org/show_bug.cgi?id=220608 Reviewed by Zalan Bujtas. Source/WebCore: Test: fast/forms/range/input-range-sizing-fixed-size.html In r266695 we modified the way min-{width|height}: auto was computed for flexbox elements. That broke the sizing of input range controls that were working under the assumption that min-{width|height} was 0. We have to force it in the UA CSS in order to keep the same behaviour. * css/html.css: (input[type="range"]::-webkit-slider-container, input[type="range"]::-webkit-media-slider-container): force min-width: 0. LayoutTests: New test case to verify that input range controls are sized correctly with specified widths. * fast/forms/range/input-range-sizing-fixed-size-expected.html: Added. * fast/forms/range/input-range-sizing-fixed-size.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271618 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-19 Sergio Villar Senin <svillar@igalia.com> REGRESSION(r266695) Range control with custom track width sized incorrectly https://bugs.webkit.org/show_bug.cgi?id=220608 Reviewed by Zalan Bujtas. Test: fast/forms/range/input-range-sizing-fixed-size.html In r266695 we modified the way min-{width|height}: auto was computed for flexbox elements. That broke the sizing of input range controls that were working under the assumption that min-{width|height} was 0. We have to force it in the UA CSS in order to keep the same behaviour. * css/html.css: (input[type="range"]::-webkit-slider-container, input[type="range"]::-webkit-media-slider-container): force min-width: 0. 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271589. rdar://problem/73477370 Apple Mail AX, VoiceOver: When composing a new email message, moving VO focus to the message body field does not bring keyboard focus along. https://bugs.webkit.org/show_bug.cgi?id=220672 <rdar://problem/73045466> Reviewed by Darin Adler. The call to AccessibilityObject::setFocused to set the focus to the scroll view needs to happen before the check for canSetFocusAttribute. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::setFocused): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271589 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-18 Andres Gonzalez <andresg_22@apple.com> Apple Mail AX, VoiceOver: When composing a new email message, moving VO focus to the message body field does not bring keyboard focus along. https://bugs.webkit.org/show_bug.cgi?id=220672 <rdar://problem/73045466> Reviewed by Darin Adler. The call to AccessibilityObject::setFocused to set the focus to the scroll view needs to happen before the check for canSetFocusAttribute. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::setFocused): 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271587. rdar://problem/73477379 Fix for LayoutTests/accessibility/canvas-fallback-content.html in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=220644 Reviewed by Chris Fleizach. Source/WebCore: Tests: accessibility/canvas-fallback-content.html accessibility/canvas-fallback-content-2.html - Updates the accessibility isolated tree when the ARIA role attribute changes for a DOM element. - Modified tests to use Promises and retrieve accessible elements by IDs so that they work in both isolated tree mode on and off. * accessibility/AXLogger.cpp: (WebCore::operator<<): Added new value to the AXNotification enum. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAriaRoleChanged): Updates the isolated tree when an ARIA role attribute changes. (WebCore::AXObjectCache::updateIsolatedTree): Handles the AXAriaRoleChanged notification. * accessibility/AXObjectCache.h: LayoutTests: * accessibility/canvas-fallback-content-2-expected.txt: Removed the checks for the document.activeElement since the goal here is not to test this method. * accessibility/canvas-fallback-content-2.html: Retrieved the accessibility Objects by ID directly from the accessibilityController. This simplifies the code since it is not necessary to set focus to the object via the document, to then retrieve the focused accessibility element. This works for isolated tree mode on and off. * accessibility/canvas-fallback-content.html: Kept the focus manipulations but used Promises to make it work in both isolated mode on and off. * platform/win/accessibility/canvas-fallback-content-expected.txt: Deleted. * platform/win/TestExpectations: Skip since this test was already failing in win. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271587 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-18 Andres Gonzalez <andresg_22@apple.com> Fix for LayoutTests/accessibility/canvas-fallback-content.html in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=220644 Reviewed by Chris Fleizach. Tests: accessibility/canvas-fallback-content.html accessibility/canvas-fallback-content-2.html - Updates the accessibility isolated tree when the ARIA role attribute changes for a DOM element. - Modified tests to use Promises and retrieve accessible elements by IDs so that they work in both isolated tree mode on and off. * accessibility/AXLogger.cpp: (WebCore::operator<<): Added new value to the AXNotification enum. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAriaRoleChanged): Updates the isolated tree when an ARIA role attribute changes. (WebCore::AXObjectCache::updateIsolatedTree): Handles the AXAriaRoleChanged notification. * accessibility/AXObjectCache.h: 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271584. rdar://problem/73473616 Optimize :hover/:active style invalidation for deep trees and descendant selectors https://bugs.webkit.org/show_bug.cgi?id=220711 Reviewed by Zalan Bujtas. Hover and active states are flipped for the entire ancestor chain. We compute invalidation for each flipped element separately. If the selectors are of form ':active .descendant' then each of these invalidations needs to traverse the whole subtree, leading to O(n^2) behavior. We really only need to traverse the descendants once, starting from the element closest to the root that changes state. * dom/Document.cpp: (WebCore::Document::updateHoverActiveState): Compute the change root and pass the information to setActive/Hover. Reorganize the function a bit to allow this, and for general readability. * dom/Element.cpp: (WebCore::Element::setActive): (WebCore::Element::setHovered): * dom/Element.h: * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::setActive): * html/HTMLAnchorElement.h: * html/HTMLLabelElement.cpp: (WebCore::HTMLLabelElement::setActive): (WebCore::HTMLLabelElement::setHovered): * html/HTMLLabelElement.h: * html/shadow/SpinButtonElement.cpp: (WebCore::SpinButtonElement::setHovered): * html/shadow/SpinButtonElement.h: * style/PseudoClassChangeInvalidation.cpp: (WebCore::Style::PseudoClassChangeInvalidation::computeInvalidation): Only include descendant traversing rulesets for the change root. * style/PseudoClassChangeInvalidation.h: (WebCore::Style::PseudoClassChangeInvalidation::PseudoClassChangeInvalidation): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271584 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-18 Antti Koivisto <antti@apple.com> Optimize :hover/:active style invalidation for deep trees and descendant selectors https://bugs.webkit.org/show_bug.cgi?id=220711 Reviewed by Zalan Bujtas. Hover and active states are flipped for the entire ancestor chain. We compute invalidation for each flipped element separately. If the selectors are of form ':active .descendant' then each of these invalidations needs to traverse the whole subtree, leading to O(n^2) behavior. We really only need to traverse the descendants once, starting from the element closest to the root that changes state. * dom/Document.cpp: (WebCore::Document::updateHoverActiveState): Compute the change root and pass the information to setActive/Hover. Reorganize the function a bit to allow this, and for general readability. * dom/Element.cpp: (WebCore::Element::setActive): (WebCore::Element::setHovered): * dom/Element.h: * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::setActive): * html/HTMLAnchorElement.h: * html/HTMLLabelElement.cpp: (WebCore::HTMLLabelElement::setActive): (WebCore::HTMLLabelElement::setHovered): * html/HTMLLabelElement.h: * html/shadow/SpinButtonElement.cpp: (WebCore::SpinButtonElement::setHovered): * html/shadow/SpinButtonElement.h: * style/PseudoClassChangeInvalidation.cpp: (WebCore::Style::PseudoClassChangeInvalidation::computeInvalidation): Only include descendant traversing rulesets for the change root. * style/PseudoClassChangeInvalidation.h: (WebCore::Style::PseudoClassChangeInvalidation::PseudoClassChangeInvalidation): 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271542. rdar://problem/73477309 (REGRESSION) Playback pauses upon entering PiP via media controls on trailers.apple.com https://bugs.webkit.org/show_bug.cgi?id=220669 Reviewed by Jer Noble. Add a quirk to disable the "webkitendfullscreen" event when a video enters picture-in-picture from fullscreen for the sites which cannot handle the event properly. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::enterFullscreen): * page/Quirks.cpp: (WebCore::Quirks::shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk const): * page/Quirks.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271542 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-15 Peng Liu <peng.liu6@apple.com> (REGRESSION) Playback pauses upon entering PiP via media controls on trailers.apple.com https://bugs.webkit.org/show_bug.cgi?id=220669 Reviewed by Jer Noble. Add a quirk to disable the "webkitendfullscreen" event when a video enters picture-in-picture from fullscreen for the sites which cannot handle the event properly. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::enterFullscreen): * page/Quirks.cpp: (WebCore::Quirks::shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk const): * page/Quirks.h: 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271536. rdar://problem/73477501 AX: increment/decrement synthetic arrow events don't work in ARIA slider examples https://bugs.webkit.org/show_bug.cgi?id=220626 <rdar://problem/73228924> Reviewed by Zalan Bujtas. Source/WebCore: keyCode is still expected to be filled in with standard codes for arrow keys. Updated test: accessibility/keyevents-posted-for-increment-actions.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::postKeyboardKeysForValueChange): LayoutTests: * accessibility/keyevents-posted-for-increment-actions-expected.txt: * accessibility/keyevents-posted-for-increment-actions.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271536 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-15 Chris Fleizach <cfleizach@apple.com> AX: increment/decrement synthetic arrow events don't work in ARIA slider examples https://bugs.webkit.org/show_bug.cgi?id=220626 <rdar://problem/73228924> Reviewed by Zalan Bujtas. keyCode is still expected to be filled in with standard codes for arrow keys. Updated test: accessibility/keyevents-posted-for-increment-actions.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::postKeyboardKeysForValueChange): 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271530. rdar://problem/73478410 CRASH in MediaSourcePrivateAVFObjC::removeSourceBuffer() https://bugs.webkit.org/show_bug.cgi?id=220647 <rdar://73173684> Reviewed by Darin Adler. In exceptional circumstances, the MediaPlayerPrivateMediaSourceAVFObjC can be destroyed before MediaSourcePrivateAVFObjC, which leaves behind a null WeakPtr. Null check m_player before using everywhere in MediaSourcePrivateAVFObjC. Drive-by fix: it would be invalid to pass in a null player to MediaSourcePrivateAVFObjC::create(), so modify that method to take a reference rather than a pointer. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::create): (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer): (WebCore::MediaSourcePrivateAVFObjC::durationChanged): (WebCore::MediaSourcePrivateAVFObjC::markEndOfStream): (WebCore::MediaSourcePrivateAVFObjC::readyState const): (WebCore::MediaSourcePrivateAVFObjC::setReadyState): (WebCore::MediaSourcePrivateAVFObjC::waitForSeekCompleted): (WebCore::MediaSourcePrivateAVFObjC::seekCompleted): (WebCore::MediaSourcePrivateAVFObjC::currentMediaTime const): (WebCore::MediaSourcePrivateAVFObjC::sourceBufferPrivateDidChangeActiveState): (WebCore::MediaSourcePrivateAVFObjC::sourceBufferKeyNeeded): (WebCore::MediaSourcePrivateAVFObjC::setSourceBufferWithSelectedVideo): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271530 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-15 Jer Noble <jer.noble@apple.com> CRASH in MediaSourcePrivateAVFObjC::removeSourceBuffer() https://bugs.webkit.org/show_bug.cgi?id=220647 <rdar://73173684> Reviewed by Darin Adler. In exceptional circumstances, the MediaPlayerPrivateMediaSourceAVFObjC can be destroyed before MediaSourcePrivateAVFObjC, which leaves behind a null WeakPtr. Null check m_player before using everywhere in MediaSourcePrivateAVFObjC. Drive-by fix: it would be invalid to pass in a null player to MediaSourcePrivateAVFObjC::create(), so modify that method to take a reference rather than a pointer. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::create): (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer): (WebCore::MediaSourcePrivateAVFObjC::durationChanged): (WebCore::MediaSourcePrivateAVFObjC::markEndOfStream): (WebCore::MediaSourcePrivateAVFObjC::readyState const): (WebCore::MediaSourcePrivateAVFObjC::setReadyState): (WebCore::MediaSourcePrivateAVFObjC::waitForSeekCompleted): (WebCore::MediaSourcePrivateAVFObjC::seekCompleted): (WebCore::MediaSourcePrivateAVFObjC::currentMediaTime const): (WebCore::MediaSourcePrivateAVFObjC::sourceBufferPrivateDidChangeActiveState): (WebCore::MediaSourcePrivateAVFObjC::sourceBufferKeyNeeded): (WebCore::MediaSourcePrivateAVFObjC::setSourceBufferWithSelectedVideo): 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271516. rdar://problem/73477422 [LFC][Integration] REGRESSION (r270123) facebook.com birthday dropdown do not work when creating new account https://bugs.webkit.org/show_bug.cgi?id=220638 <rdar://problem/73175259> Reviewed by Simon Fraser. Source/WebCore: This patch fixes incorrect hittest results when the hittest target 1. participates in the modern line layout and 2. prior to the hittesting its style changes in a way that it does not trigger layout. e.g. <div><div id=inner style="display: inline-block; visibility: hidden"><div></div> <script>inner.style.visibility = "visible"</script> Any subsequent hittest will miss the inner <div> as the loop in LineLayout::hitTest() early returns due to stale style information. The reason why we end up with stale style is because we only update the layout box's style when the style diff >= StyleDifference::Layout () in RenderBox::styleDidChange. Test: fast/inline-block/hittest-fails-on-inline-block-with-visibility-change.html * rendering/RenderBox.cpp: (WebCore::RenderBox::styleDidChange): LayoutTests: * fast/inline-block/hittest-fails-on-inline-block-with-visibility-change-expected.txt: Added. * fast/inline-block/hittest-fails-on-inline-block-with-visibility-change.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271516 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-15 Zalan Bujtas <zalan@apple.com> [LFC][Integration] REGRESSION (r270123) facebook.com birthday dropdown do not work when creating new account https://bugs.webkit.org/show_bug.cgi?id=220638 <rdar://problem/73175259> Reviewed by Simon Fraser. This patch fixes incorrect hittest results when the hittest target 1. participates in the modern line layout and 2. prior to the hittesting its style changes in a way that it does not trigger layout. e.g. <div><div id=inner style="display: inline-block; visibility: hidden"><div></div> <script>inner.style.visibility = "visible"</script> Any subsequent hittest will miss the inner <div> as the loop in LineLayout::hitTest() early returns due to stale style information. The reason why we end up with stale style is because we only update the layout box's style when the style diff >= StyleDifference::Layout () in RenderBox::styleDidChange. Test: fast/inline-block/hittest-fails-on-inline-block-with-visibility-change.html * rendering/RenderBox.cpp: (WebCore::RenderBox::styleDidChange): 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271476. rdar://problem/73478439 Crash ASSERT in AccessibilityRenderObject::textUnderElement during AXIsolatedObject initialization. https://bugs.webkit.org/show_bug.cgi?id=220446 Reviewed by Chris Fleizach. AXIsolatedObject methods that need to forward the call to the associated AXObject on the main thread, should call the updateBackingStore method on the AXObject. This fixes the issue with AccessibilityRenderObject::textUnderElement shown in the stack trace. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::associatedAXObject const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271476 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-13 Andres Gonzalez <andresg_22@apple.com> Crash ASSERT in AccessibilityRenderObject::textUnderElement during AXIsolatedObject initialization. https://bugs.webkit.org/show_bug.cgi?id=220446 Reviewed by Chris Fleizach. AXIsolatedObject methods that need to forward the call to the associated AXObject on the main thread, should call the updateBackingStore method on the AXObject. This fixes the issue with AccessibilityRenderObject::textUnderElement shown in the stack trace. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::associatedAXObject const): 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271473. rdar://problem/73478401 PCM: Output logs by default, including to Web Inspector https://bugs.webkit.org/show_bug.cgi?id=220596 <rdar://problem/73159180> Reviewed by Brent Fulgham. This change turns on PCM output to Web Inspector and logs Source/WebCore: by default. In the case of WebCore::PrivateClickMeasurement, this means we no longer need the debugModeEnabled() convenience function. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::parseAttributionRequest): (WebCore::PrivateClickMeasurement::debugModeEnabled): Deleted. * loader/PrivateClickMeasurement.h: Source/WebKit: by default. In some of the cases, the syslog output was deleted since it doesn't make sense to log those messages now that we have output in Web Inspector. * NetworkProcess/PrivateClickMeasurementManager.cpp: (WebKit::PrivateClickMeasurementManager::storeUnattributed): (WebKit::PrivateClickMeasurementManager::handleAttribution): (WebKit::PrivateClickMeasurementManager::attribute): (WebKit::PrivateClickMeasurementManager::fireConversionRequest): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271473 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-13 John Wilander <wilander@apple.com> PCM: Output logs by default, including to Web Inspector https://bugs.webkit.org/show_bug.cgi?id=220596 <rdar://problem/73159180> Reviewed by Brent Fulgham. This change turns on PCM output to Web Inspector and logs by default. In the case of WebCore::PrivateClickMeasurement, this means we no longer need the debugModeEnabled() convenience function. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::parseAttributionRequest): (WebCore::PrivateClickMeasurement::debugModeEnabled): Deleted. * loader/PrivateClickMeasurement.h: 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271471. rdar://problem/73477068 Source/WebCore: [HANG] 496ms to 1360ms in WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices() https://bugs.webkit.org/show_bug.cgi?id=220471 Reviewed by Youenn Fablet. Refactor RealtimeMediaSourceCenter::getMediaStreamDevices() to take a completion handler, rather than synchronously return a Vector of CaptureDevices. This also requires all CaptureDeviceManager subclasses to support taking a completion handler themselves. By default, all CaptureDeviceManagers will support the CompletionHandler path by just synchronously calling the completion handler with the existing synchronous method. But for AVAudioSessionCaptureDeviceManager, override that default implementation by activating the AVAudioSession on a background thread, and querying that session's inputs on a background thread as well. * platform/mediastream/CaptureDeviceManager.h: * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices): * platform/mediastream/RealtimeMediaSourceCenter.h: * platform/mediastream/RealtimeMediaSourceFactory.h: (WebCore::AudioCaptureFactory::getSpeakerDevices const): * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h: * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: (WebCore::AVAudioSessionCaptureDeviceManager::audioSessionDeviceWithUID): (WebCore::AVAudioSessionCaptureDeviceManager::scheduleUpdateCaptureDevices): (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): (WebCore::AVAudioSessionCaptureDeviceManager::getCaptureDevices): (WebCore::AVAudioSessionCaptureDeviceManager::activateAudioSession): (WebCore::AVAudioSessionCaptureDeviceManager::retrieveAudioSessionCaptureDevices const): (WebCore::AVAudioSessionCaptureDeviceManager::setAudioCaptureDevices): (WebCore::AVAudioSessionCaptureDeviceManager::audioSessionCaptureDevices): Deleted. Source/WebKit: [HANG] 496ms to 1360ms in WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices() https://bugs.webkit.org/show_bug.cgi?id=220471 Reviewed by Youenn Fablet. Use the completion-handler version of RealtimeMediaSourceCenter::getMediaStreamDevices(). * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::updateCaptureDevices): (WebKit::UserMediaProcessManager::beginMonitoringCaptureDevices): * UIProcess/UserMediaProcessManager.h: LayoutTests: [Cocoa] Support key rotation with HLS-backed encrypted media streams https://bugs.webkit.org/show_bug.cgi?id=220493 <rdar://68227709> Reviewed by Youenn Fablet. Fix a broken layout test; the test enumerates devices, then uses the deviceIds returned to generate constraints for a call to getUserMedia(). However, it assumes all devices will either be of kind 'audioinput' or 'videoinput'. If an 'audiooutput' device is returned (as the MockRealtimeMediaSourceCenter does), then the test turns that into a video capture constraint, which fails. * fast/mediastream/get-user-media-device-id.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271471 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-13 Jer Noble <jer.noble@apple.com> [HANG] 496ms to 1360ms in WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices() https://bugs.webkit.org/show_bug.cgi?id=220471 Reviewed by Youenn Fablet. Refactor RealtimeMediaSourceCenter::getMediaStreamDevices() to take a completion handler, rather than synchronously return a Vector of CaptureDevices. This also requires all CaptureDeviceManager subclasses to support taking a completion handler themselves. By default, all CaptureDeviceManagers will support the CompletionHandler path by just synchronously calling the completion handler with the existing synchronous method. But for AVAudioSessionCaptureDeviceManager, override that default implementation by activating the AVAudioSession on a background thread, and querying that session's inputs on a background thread as well. * platform/mediastream/CaptureDeviceManager.h: * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices): * platform/mediastream/RealtimeMediaSourceCenter.h: * platform/mediastream/RealtimeMediaSourceFactory.h: (WebCore::AudioCaptureFactory::getSpeakerDevices const): * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h: * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: (WebCore::AVAudioSessionCaptureDeviceManager::audioSessionDeviceWithUID): (WebCore::AVAudioSessionCaptureDeviceManager::scheduleUpdateCaptureDevices): (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): (WebCore::AVAudioSessionCaptureDeviceManager::getCaptureDevices): (WebCore::AVAudioSessionCaptureDeviceManager::activateAudioSession): (WebCore::AVAudioSessionCaptureDeviceManager::retrieveAudioSessionCaptureDevices const): (WebCore::AVAudioSessionCaptureDeviceManager::setAudioCaptureDevices): (WebCore::AVAudioSessionCaptureDeviceManager::audioSessionCaptureDevices): Deleted. 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271436. rdar://problem/73477448 REGRESSION(r268666) Incorrect vertical position inside grid items with padding https://bugs.webkit.org/show_bug.cgi?id=220524 Reviewed by Manuel Rego Casasnovas. Source/WebCore: In r268666 we sanitized and renamed the old overrideLogicalXXX sizes so that they store what they say. There was a mistake in one of those renames, in availableLogicalHeightForPercentageComputation() we were returning the border box size for the case of grid items. That's clearly wrong as we should return the content box size. That's why adding a padding to a grid item was causing their children to wrongly evaluate the available logical height. This fixes a WPT that was marked as failure. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const): Return the overridingContentLogicalHeight instead of the overridingLogicalHeight. LayoutTests: * TestExpectations: remove web-platform-tests/css/css-grid/grid-items/percentage-size-subitems-001.html from the list of image failures. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271436 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-13 Sergio Villar Senin <svillar@igalia.com> REGRESSION(r268666) Incorrect vertical position inside grid items with padding https://bugs.webkit.org/show_bug.cgi?id=220524 Reviewed by Manuel Rego Casasnovas. In r268666 we sanitized and renamed the old overrideLogicalXXX sizes so that they store what they say. There was a mistake in one of those renames, in availableLogicalHeightForPercentageComputation() we were returning the border box size for the case of grid items. That's clearly wrong as we should return the content box size. That's why adding a padding to a grid item was causing their children to wrongly evaluate the available logical height. This fixes a WPT that was marked as failure. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const): Return the overridingContentLogicalHeight instead of the overridingLogicalHeight. 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271435. rdar://problem/73477090 REGRESSION (r267571): black line appears upon navigating back from apple.com shopping bag https://bugs.webkit.org/show_bug.cgi?id=220550 <rdar://problem/72459816> Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Mark two additional PASS results for ::marker tests. * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt: Source/WebCore: Test: webanimations/no-transition-on-after-pseudo-element-upon-creation.html In r267571, we refactored the code to use Styleable instead of Element in pseudo-element resolution code. While there should have been no behavior change, there was a change in Style::TreeResolver::createAnimatedElementUpdate() that mistakenly introduced one. In order to get the "before" style to be used to consider CSS Transitions, we used to simply call Element::renderOrDisplayContentsStyle() on the element provided to createAnimatedElementUpdate(), which would be either an Element or a PseudoElement in the case of ::before and ::after. When we switched to using Styleable, we made a change where we'd call renderOrDisplayContentsStyle() on the Styleable's element, if it didn't a pseudo-element, or try to get the matching PseudoElement in the case of ::before and ::after. However, if we got a nullptr RenderStyle in the PseudoElement case, we'd fall back to using the style from the host element. This yielded this regression on apple.com where a transition is started on an ::after pseudo-element which has an "opacity: 0" style and a "transition" style set for "opacity". The host element is created first, and later the ::after pseudo-element added. While it should not consider starting a transition in this case since upon creation there is no existing style to work with, it did start a transition since it would use the host element's style and see "opacity: 1" to start a transition. In this patch, we address the FIXME we'd left behind in TreeResolver::createAnimatedElementUpdate() and make Element::renderOrDisplayContentsStyle() take in a PseudoId, defaulting to PseudoId::None. In case we have a pseudo-element, we first try to call renderOrDisplayContentsStyle() on the matching PseudoElement if it exists, or we return the existing computed style for this pseudo-element. If there is no existing computed style, we return nullptr, which means that in the apple.com scenario, no transition is started because we correctly don't have a "before" style to work within upon creation of the ::after pseudo-element. * dom/Element.cpp: (WebCore::beforeOrAfterPseudoElement): (WebCore::Element::renderOrDisplayContentsStyle const): * dom/Element.h: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): LayoutTests: Add a test that checks that adding a pseudo-element for an existing host element does not use the host element's style to consider starting a transition. * webanimations/no-transition-on-after-pseudo-element-upon-creation-expected.html: Added. * webanimations/no-transition-on-after-pseudo-element-upon-creation.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271435 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-12 Antoine Quint <graouts@webkit.org> REGRESSION (r267571): black line appears upon navigating back from apple.com shopping bag https://bugs.webkit.org/show_bug.cgi?id=220550 <rdar://problem/72459816> Reviewed by Antti Koivisto. Test: webanimations/no-transition-on-after-pseudo-element-upon-creation.html In r267571, we refactored the code to use Styleable instead of Element in pseudo-element resolution code. While there should have been no behavior change, there was a change in Style::TreeResolver::createAnimatedElementUpdate() that mistakenly introduced one. In order to get the "before" style to be used to consider CSS Transitions, we used to simply call Element::renderOrDisplayContentsStyle() on the element provided to createAnimatedElementUpdate(), which would be either an Element or a PseudoElement in the case of ::before and ::after. When we switched to using Styleable, we made a change where we'd call renderOrDisplayContentsStyle() on the Styleable's element, if it didn't a pseudo-element, or try to get the matching PseudoElement in the case of ::before and ::after. However, if we got a nullptr RenderStyle in the PseudoElement case, we'd fall back to using the style from the host element. This yielded this regression on apple.com where a transition is started on an ::after pseudo-element which has an "opacity: 0" style and a "transition" style set for "opacity". The host element is created first, and later the ::after pseudo-element added. While it should not consider starting a transition in this case since upon creation there is no existing style to work with, it did start a transition since it would use the host element's style and see "opacity: 1" to start a transition. In this patch, we address the FIXME we'd left behind in TreeResolver::createAnimatedElementUpdate() and make Element::renderOrDisplayContentsStyle() take in a PseudoId, defaulting to PseudoId::None. In case we have a pseudo-element, we first try to call renderOrDisplayContentsStyle() on the matching PseudoElement if it exists, or we return the existing computed style for this pseudo-element. If there is no existing computed style, we return nullptr, which means that in the apple.com scenario, no transition is started because we correctly don't have a "before" style to work within upon creation of the ::after pseudo-element. * dom/Element.cpp: (WebCore::beforeOrAfterPseudoElement): (WebCore::Element::renderOrDisplayContentsStyle const): * dom/Element.h: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271416. rdar://problem/73478416 AX: Implement aria-braillelabel and aria-brailleroledescription https://bugs.webkit.org/show_bug.cgi?id=220516 <rdar://problem/73004715> Reviewed by Zalan Bujtas. Source/WebCore: Add support for new ARIA attributes. Test: accessibility/mac/braille-label-role.html * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityBrailleLabel]): (-[WebAccessibilityObjectWrapper accessibilityBrailleRoleDescription]): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): * html/HTMLAttributeNames.in: LayoutTests: * accessibility/braille-label-role-expected.txt: Added. * accessibility/braille-label-role.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271416 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-12 Chris Fleizach <cfleizach@apple.com> AX: Implement aria-braillelabel and aria-brailleroledescription https://bugs.webkit.org/show_bug.cgi?id=220516 <rdar://problem/73004715> Reviewed by Zalan Bujtas. Add support for new ARIA attributes. Test: accessibility/mac/braille-label-role.html * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityBrailleLabel]): (-[WebAccessibilityObjectWrapper accessibilityBrailleRoleDescription]): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): * html/HTMLAttributeNames.in: 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271524. rdar://problem/73473371 Reversed transform animation not applied alongside other transform animations https://bugs.webkit.org/show_bug.cgi?id=218655 <rdar://problem/71116284> Reviewed by Simon Fraser. Source/WebCore: Tests: webanimations/combining-transform-animations-with-different-acceleration-capabilities-2.html webanimations/combining-transform-animations-with-different-acceleration-capabilities-3.html webanimations/combining-transform-animations-with-different-acceleration-capabilities.html While, in theory, animations for a transform-related CSS property (translate, rotate, scale and transform) can be accelerated, there are various reasons why it might not, in fact, run accelerated. One example is that the timing function is not something we can translate in terms Core Animation can understand, such as the steps() timing function. In this case, the KeyframeEffect itself is aware of the limitation and the method KeyframeEffect::canBeAccelerated() returns false. Another example is that the playback rate of the animation is not 1, which we currently don't support for Core Animation animations (see bug 211839). In this case, GraphicsLayerCA is where the impossibility to run an animation accelerated is determined. While we support running transform-related animations with or without acceleration, one thing we cannot support is, for the same element, running some transform-related animations with acceleration, and some without. Thus, regardless of where we determine that a transform-related animation cannot be accelerated, we need to send this information up to the KeyframeEffectStack in which this animation's effect belongs to make sure that any other transform-related animation that may already be running accelerated no longer does and continues running without acceleration. There are two locations where we determine that a transform-related animation cannot be accelerated: 1. in DocumentTimeline::applyPendingAcceleratedAnimations() under which we start, update or stop accelerated animations that have been invalidated since the last page rendering, 2. in KeyframeEffect::updateAcceleratedActions() which is called for each page rendering, including animations that cannot be accelerated. In the first case, we catch situations where an animation that could have been accelerated but failed to be started due to the internal logic of GraphicsLayerCA. We use the new KeyframeEffect method applyPendingAcceleratedActions() return value to determine this, and for each effect where the result indicates that a transform-related animation could not be accelerated, we add the KeyframeEffectStack to which it belongs and, once we're done with updating all effects, call the new stopAcceleratingTransformRelatedProperties() method on the keyframe effect stack. In the second case, we catch situations where an animation is known to not be able to run accelerated even without involving GraphicsLayerCA. We check whether the animation targets a transform-related property and if it is active, and if so call stopAcceleratingTransformRelatedProperties() on the keyframe effect stack there as well. When KeyframeEffectStack::stopAcceleratingTransformRelatedProperties() is called, we go through all the registered effects and call stopAcceleratingTransformRelatedProperties(). This new KeyframeEffect method will either add a pending accelerated action to stop the accelerated animation, or if we're currently apply accelerated actions (ie. during DocumentTimeline::applyPendingAcceleratedAnimations()), we stop the accelerated animation right away. In both cases we know not to try running this animation again with acceleration by setting m_runningAccelerated to RunningAccelerated::No. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::isTargetingTransformRelatedProperty const): (WebCore::KeyframeEffect::isRunningAcceleratedTransformRelatedAnimation const): (WebCore::KeyframeEffect::updateAcceleratedActions): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): (WebCore::KeyframeEffect::stopAcceleratingTransformRelatedProperties): * animation/KeyframeEffect.h: * animation/KeyframeEffectStack.cpp: (WebCore::KeyframeEffectStack::stopAcceleratingTransformRelatedProperties): * animation/KeyframeEffectStack.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::applyPendingAcceleratedActions): Deleted. * animation/WebAnimation.h: * animation/WebAnimationTypes.h: LayoutTests: Add new tests that start a transform-related animation that runs accelerated, then add another transform-related animation that either initially or eventually is not accelerated. In all cases, we check that once the second animation is no longer accelerated that the first animation is also no longer accelerated. * platform/win/TestExpectations: * webanimations/combining-transform-animations-with-different-acceleration-capabilities-2-expected.txt: Added. * webanimations/combining-transform-animations-with-different-acceleration-capabilities-2.html: Added. * webanimations/combining-transform-animations-with-different-acceleration-capabilities-3-expected.txt: Added. * webanimations/combining-transform-animations-with-different-acceleration-capabilities-3.html: Added. * webanimations/combining-transform-animations-with-different-acceleration-capabilities-expected.txt: Added. * webanimations/combining-transform-animations-with-different-acceleration-capabilities.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271524 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-15 Antoine Quint <graouts@webkit.org> Reversed transform animation not applied alongside other transform animations https://bugs.webkit.org/show_bug.cgi?id=218655 <rdar://problem/71116284> Reviewed by Simon Fraser. Tests: webanimations/combining-transform-animations-with-different-acceleration-capabilities-2.html webanimations/combining-transform-animations-with-different-acceleration-capabilities-3.html webanimations/combining-transform-animations-with-different-acceleration-capabilities.html While, in theory, animations for a transform-related CSS property (translate, rotate, scale and transform) can be accelerated, there are various reasons why it might not, in fact, run accelerated. One example is that the timing function is not something we can translate in terms Core Animation can understand, such as the steps() timing function. In this case, the KeyframeEffect itself is aware of the limitation and the method KeyframeEffect::canBeAccelerated() returns false. Another example is that the playback rate of the animation is not 1, which we currently don't support for Core Animation animations (see bug 211839). In this case, GraphicsLayerCA is where the impossibility to run an animation accelerated is determined. While we support running transform-related animations with or without acceleration, one thing we cannot support is, for the same element, running some transform-related animations with acceleration, and some without. Thus, regardless of where we determine that a transform-related animation cannot be accelerated, we need to send this information up to the KeyframeEffectStack in which this animation's effect belongs to make sure that any other transform-related animation that may already be running accelerated no longer does and continues running without acceleration. There are two locations where we determine that a transform-related animation cannot be accelerated: 1. in DocumentTimeline::applyPendingAcceleratedAnimations() under which we start, update or stop accelerated animations that have been invalidated since the last page rendering, 2. in KeyframeEffect::updateAcceleratedActions() which is called for each page rendering, including animations that cannot be accelerated. In the first case, we catch situations where an animation that could have been accelerated but failed to be started due to the internal logic of GraphicsLayerCA. We use the new KeyframeEffect method applyPendingAcceleratedActions() return value to determine this, and for each effect where the result indicates that a transform-related animation could not be accelerated, we add the KeyframeEffectStack to which it belongs and, once we're done with updating all effects, call the new stopAcceleratingTransformRelatedProperties() method on the keyframe effect stack. In the second case, we catch situations where an animation is known to not be able to run accelerated even without involving GraphicsLayerCA. We check whether the animation targets a transform-related property and if it is active, and if so call stopAcceleratingTransformRelatedProperties() on the keyframe effect stack there as well. When KeyframeEffectStack::stopAcceleratingTransformRelatedProperties() is called, we go through all the registered effects and call stopAcceleratingTransformRelatedProperties(). This new KeyframeEffect method will either add a pending accelerated action to stop the accelerated animation, or if we're currently apply accelerated actions (ie. during DocumentTimeline::applyPendingAcceleratedAnimations()), we stop the accelerated animation right away. In both cases we know not to try running this animation again with acceleration by setting m_runningAccelerated to RunningAccelerated::No. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::isTargetingTransformRelatedProperty const): (WebCore::KeyframeEffect::isRunningAcceleratedTransformRelatedAnimation const): (WebCore::KeyframeEffect::updateAcceleratedActions): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): (WebCore::KeyframeEffect::stopAcceleratingTransformRelatedProperties): * animation/KeyframeEffect.h: * animation/KeyframeEffectStack.cpp: (WebCore::KeyframeEffectStack::stopAcceleratingTransformRelatedProperties): * animation/KeyframeEffectStack.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::applyPendingAcceleratedActions): Deleted. * animation/WebAnimation.h: * animation/WebAnimationTypes.h: 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271446. rdar://problem/73469344 REGRESSION (r257839): Broken focus when 'display' changes in an attribute selector https://bugs.webkit.org/show_bug.cgi?id=217240 <rdar://problem/69891684> Reviewed by Wenson Hsieh. Source/WebCore: Focus optimization that avoids full style resolution when setting focus in unrendered subtrees misbehaves when the style is invalidated via an attribute change. Test case by Ali Juma. Test: fast/dom/focus-style-resolution-attribute-change.html * dom/Element.cpp: (WebCore::Element::invalidateStyle): * dom/Node.cpp: (WebCore::Node::invalidateStyle): We need to set the computed style invalidity bit on all style invalidation code paths. * html/InputType.cpp: (WebCore::InputType::setValue): Don't invalidate style when nothing changes. LayoutTests: * fast/dom/focus-style-resolution-attribute-change-expected.html: Added. * fast/dom/focus-style-resolution-attribute-change.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271446 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-13 Antti Koivisto <antti@apple.com> REGRESSION (r257839): Broken focus when 'display' changes in an attribute selector https://bugs.webkit.org/show_bug.cgi?id=217240 <rdar://problem/69891684> Reviewed by Wenson Hsieh. Focus optimization that avoids full style resolution when setting focus in unrendered subtrees misbehaves when the style is invalidated via an attribute change. Test case by Ali Juma. Test: fast/dom/focus-style-resolution-attribute-change.html * dom/Element.cpp: (WebCore::Element::invalidateStyle): * dom/Node.cpp: (WebCore::Node::invalidateStyle): We need to set the computed style invalidity bit on all style invalidation code paths. * html/InputType.cpp: (WebCore::InputType::setValue): Don't invalidate style when nothing changes. 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271425. rdar://problem/73469655 Multi-codepoint CJK grapheme clusters are not oriented correctly in vertical writing mode https://bugs.webkit.org/show_bug.cgi?id=220536 <rdar://problem/70633887> Reviewed by Zalan Bujtas. Source/WebCore: We have two codeblocks in this section that are meant to be used for non-CJK text, but the compound "if" statement was causing us to hit one of them even for CJK text. Test: fast/text/cjk-multi-codepoint-cluster-vertical.html * platform/graphics/coretext/FontCascadeCoreText.cpp: (WebCore::FontCascade::fontForCombiningCharacterSequence const): LayoutTests: * fast/text/cjk-multi-codepoint-cluster-vertical-expected.html: Added. * fast/text/cjk-multi-codepoint-cluster-vertical.html: Added. * platform/win/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271425 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-12 Myles C. Maxfield <mmaxfield@apple.com> Multi-codepoint CJK grapheme clusters are not oriented correctly in vertical writing mode https://bugs.webkit.org/show_bug.cgi?id=220536 <rdar://problem/70633887> Reviewed by Zalan Bujtas. We have two codeblocks in this section that are meant to be used for non-CJK text, but the compound "if" statement was causing us to hit one of them even for CJK text. Test: fast/text/cjk-multi-codepoint-cluster-vertical.html * platform/graphics/coretext/FontCascadeCoreText.cpp: (WebCore::FontCascade::fontForCombiningCharacterSequence const): 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271405. rdar://problem/73466993 [Cocoa] Support key rotation with HLS-backed encrypted media streams https://bugs.webkit.org/show_bug.cgi?id=220493 <rdar://68227709> Reviewed by Eric Carlson. Source/WebCore: Support key rotation through AVContentKeySession by explicitly handling unexpected key requests submitted through the new -contentKeySession:didProvideContentKeyRequests:forInitializationData:. Rotation was previously handled in the delegate method -contentKeySession:didProvideContentKeyRequest, but that method is no longer called after the replacement delegate method was implemented, and that method never handled "skd://" style initialization data. Update the helper method, initTypeForRequest(), to detect "skd://" identifiers and correctly identify those sessions as "skd". Add a new helper method, initializationDataForRequest(), which will package the AVContentKeySession's identifier as initialization data. Drive-by Fix: Fixing this bug causes the default key group to update it's identifier, which causes an assert when the group in question isn't any of those associated with an existing MediaKeySession, so handle that case explicitly. Drive-by Fix 2: Sometimes, when GPUP is enabled for media, we will get spurious mediaPlayerEngineUpdated() calls which cause cdmInstanceAttached() to be called multiple times for the same player, triggering an ASSERT. If called twice with the same CDM, just return early rather than ASSERTing. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::initTypeForRequest): (WebCore::initializationDataForRequest): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::takeUnexpectedKeyRequestForInitializationData): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequests): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::handleUnexpectedRequests): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::groupSessionIdentifierChanged): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceAttached): Source/WebCore/PAL: * pal/spi/cocoa/AVFoundationSPI.h: Source/WebKit: Support handling the "unexpectedInitializationDataReceived()" client callback from within the GPUP. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/media/RemoteCDMInstanceProxy.cpp: (WebKit::RemoteCDMInstanceProxy::create): (WebKit::RemoteCDMInstanceProxy::RemoteCDMInstanceProxy): (WebKit::RemoteCDMInstanceProxy::~RemoteCDMInstanceProxy): (WebKit::RemoteCDMInstanceProxy::unrequestedInitializationDataReceived): * GPUProcess/media/RemoteCDMInstanceProxy.h: * GPUProcess/media/RemoteCDMProxy.cpp: (WebKit::RemoteCDMProxy::createInstance): * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/RemoteCDMInstance.cpp: (WebKit::RemoteCDMInstance::RemoteCDMInstance): (WebKit::RemoteCDMInstance::~RemoteCDMInstance): (WebKit::RemoteCDMInstance::unrequestedInitializationDataReceived): * WebProcess/GPU/media/RemoteCDMInstance.h: * WebProcess/GPU/media/RemoteCDMInstance.messages.in: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271405 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-12 Jer Noble <jer.noble@apple.com> [Cocoa] Support key rotation with HLS-backed encrypted media streams https://bugs.webkit.org/show_bug.cgi?id=220493 <rdar://68227709> Reviewed by Eric Carlson. Support key rotation through AVContentKeySession by explicitly handling unexpected key requests submitted through the new -contentKeySession:didProvideContentKeyRequests:forInitializationData:. Rotation was previously handled in the delegate method -contentKeySession:didProvideContentKeyRequest, but that method is no longer called after the replacement delegate method was implemented, and that method never handled "skd://" style initialization data. Update the helper method, initTypeForRequest(), to detect "skd://" identifiers and correctly identify those sessions as "skd". Add a new helper method, initializationDataForRequest(), which will package the AVContentKeySession's identifier as initialization data. Drive-by Fix: Fixing this bug causes the default key group to update it's identifier, which causes an assert when the group in question isn't any of those associated with an existing MediaKeySession, so handle that case explicitly. Drive-by Fix 2: Sometimes, when GPUP is enabled for media, we will get spurious mediaPlayerEngineUpdated() calls which cause cdmInstanceAttached() to be called multiple times for the same player, triggering an ASSERT. If called twice with the same CDM, just return early rather than ASSERTing. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::initTypeForRequest): (WebCore::initializationDataForRequest): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::takeUnexpectedKeyRequestForInitializationData): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequests): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::handleUnexpectedRequests): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::groupSessionIdentifierChanged): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceAttached): 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271394. rdar://problem/73425595 [Multicol] set the childrenInline flag on the RenderBlockFlow properly https://bugs.webkit.org/show_bug.cgi?id=218555 Reviewed by Zalan Bujtas. * rendering/updating/RenderTreeBuilderMultiColumn.cpp: (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271394 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-12 Zalan Bujtas <zalan@apple.com> [Multicol] set the childrenInline flag on the RenderBlockFlow properly https://bugs.webkit.org/show_bug.cgi?id=218555 Reviewed by Zalan Bujtas. * rendering/updating/RenderTreeBuilderMultiColumn.cpp: (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow): 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271387. rdar://problem/73469606 Receiving two enter/exit fullscreen delegate callbacks on iPad when presenting fullscreen elements https://bugs.webkit.org/show_bug.cgi?id=218688 Reviewed by Darin Adler. Source/WebCore: On iPads, when a video enters/exits fullscreen standby, we should not call the video fullscreen delegate callbacks. * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::setupFullscreen): (VideoFullscreenInterfaceAVKit::exitFullscreen): Source/WebKit: * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::didExitFullscreen): (WebKit::VideoFullscreenManagerProxy::didEnterFullscreen): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271387 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-11 Peng Liu <peng.liu6@apple.com> Receiving two enter/exit fullscreen delegate callbacks on iPad when presenting fullscreen elements https://bugs.webkit.org/show_bug.cgi?id=218688 Reviewed by Darin Adler. On iPads, when a video enters/exits fullscreen standby, we should not call the video fullscreen delegate callbacks. * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::setupFullscreen): (VideoFullscreenInterfaceAVKit::exitFullscreen): 2021-01-25 Alan Coon <alancoon@apple.com> Cherry-pick r271367. rdar://problem/73469641 REGRESSION (r258321): CSS rules using :first-of-type are applied to any/all siblings in a group under certain circumstances https://bugs.webkit.org/show_bug.cgi?id=218256 <rdar://problem/70749584> Reviewed by Simon Fraser. Source/WebCore: More accurate invalidation for :hover resulted in smaller style updates that revealed a bug in the way we mark style non-shareable. We reset style relation bits when resolving the parent but may fail to set them again if we don't re-resolve all children. Test case by Eben Packwood. Test: fast/css/positional-selector-style-sharing.html * style/StyleRelations.cpp: (WebCore::Style::commitRelationsToRenderStyle): Just mark all styles affected by relations non-shareable. This is achieved via various bit tests but there is no reason not to set the simplest no-sharing bit. Since this forces real style resolution the parent bits will also get properly reset. LayoutTests: * fast/css/positional-selector-style-sharing-expected.html: Added. * fast/css/positional-selector-style-sharing.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271367 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-11 Antti Koivisto <antti@apple.com> REGRESSION (r258321): CSS rules using :first-of-type are applied to any/all siblings in a group under certain circumstances https://bugs.webkit.org/show_bug.cgi?id=218256 <rdar://problem/70749584> Reviewed by Simon Fraser. More accurate invalidation for :hover resulted in smaller style updates that revealed a bug in the way we mark style non-shareable. We reset style relation bits when resolving the parent but may fail to set them again if we don't re-resolve all children. Test case by Eben Packwood. Test: fast/css/positional-selector-style-sharing.html * style/StyleRelations.cpp: (WebCore::Style::commitRelationsToRenderStyle): Just mark all styles affected by relations non-shareable. This is achieved via various bit tests but there is no reason not to set the simplest no-sharing bit. Since this forces real style resolution the parent bits will also get properly reset. 2021-01-11 Russell Epstein <repstein@apple.com> Cherry-pick r271364. rdar://problem/73001152 [LFC][Integration] Factor marked text style collection code out of InlineTextBox https://bugs.webkit.org/show_bug.cgi?id=220249 <rdar://problem/72976067> Unreviewed build fix after 271350. * rendering/MarkedTextStyle.cpp: (WebCore::resolveStyleForMarkedText): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271364 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2021-01-11 Antti Koivisto <antti@apple.com> [LFC][Integration] Factor marked text style collection code out of InlineTextBox https://bugs.webkit.org/show_bug.cgi?id=220249 <rdar://problem/72976067> Unreviewed build fix after 271350. * rendering/MarkedTextStyle.cpp: (WebCore::resolveStyleForMarkedText): 2021-01-11 Kimmo Kinnunen <kkinnunen@apple.com> WebKit::IPC::Encoder needs definitions of all custom enum values at the Encoder definition time https://bugs.webkit.org/show_bug.cgi?id=220410 Reviewed by Darin Adler. Change WTF::EnumTraits to have either EnumTraits::values or EnumTraits::isValidEnum(). Change here needed to conform to the new protocol. Fixes an issue with the template usage in WebKit::IPC::Encoder, see WebKit and WTF ChangeLogs for discussion. * platform/ContextMenuItem.h: (WTF::EnumTraits<WebCore::ContextMenuAction>::isValidEnum): 2021-01-07 Sergio Villar Senin <svillar@igalia.com> [css-multicol] Restore placeholders on multicolumn children position changes. https://bugs.webkit.org/show_bug.cgi?id=218501 Reviewed by Zalan Bujtas. Whenever there is a placeholder in a multicolumn flow ("column-span: all") it must be ensured that the spanner associated to that placeholder is properly restored as a child of the multicolumn flow when the element with "column-span:all" is moved out of the multicolumn flow (for example by removing it, by making it out-of-flow or because an ancestor becomes another multicolumn flow). This was smoothly handled by the current code for the in-flow -> out-of-flow transition but not the other way around, i.e in the case of making the placeholder (or an ancestor) an absolutely positioned element. * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::normalizeTreeAfterStyleChange): restore column spanners then the element becomes out-of-flow as it's removed from the multicolumn flow. * rendering/updating/RenderTreeBuilderMultiColumn.cpp: (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow): Call the newly created method restoreColumnSpannersForContainer(). (WebCore::RenderTreeBuilder::MultiColumn::restoreColumnSpannersForContainer): Refactored from createFragmentedFlow() as it's now used by normalizeTreeAfterStyleChange(). * rendering/updating/RenderTreeBuilderMultiColumn.h: 2020-12-04 Sergio Villar Senin <svillar@igalia.com> [css-multicol] Update fragment flow state on element insertion when element position changes https://bugs.webkit.org/show_bug.cgi?id=202805 Reviewed by Zalan Bujtas. Let's imagine the following scenario: <div1 style="columns: 2"> <div2 style="columns:2; position: absolute"> <div3 style="column-span:all"> The generated render tree is more or less the following: DIV |__RenderMultiColumnFlow |__DIV |__RenderMultiColumnFlow | |__RenderMultiColumnSpannerPlaceholder |__DIV |__RenderMultiColumnSet both <div1> and <div2> generate RenderMultiColumnFlows because they're multicolumn containers while the <div3> becomes a spanner and leaves a placeholder in the place where it's supposed to be as it's a "column-span:all". Note that <div2> is absolutely positioned so it isn't really part of the column flow of <div1> (there is no RenderMultiColumnSet for <div1>). Now if the <div2> becomes a statically positioned container (i.e. style="position:static") then it should be inserted (actually its whole subtree) in the <div1> multicolumn flow. That insertion implies doing 2 things, first notify the RenderMultiColumnFlow of <div1> that a new child was inserted and secondly update the flow state of the subtree which starts in <div2> so they acknowledge <div1> as their enclosing fragment flow. The former was properly done. However the latter was not done at all, meaning that they would be treated as not belonging to any multicolumn flow when they actually did. * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock): call initializeFragmentedFlowStateOnInsertion(). 2021-01-11 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer] Add support to build with native audio and video https://bugs.webkit.org/show_bug.cgi?id=220087 Reviewed by Philippe Normand. We enable native audio and video in the pipeline depending on the build flags. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::setPlaybackFlags): (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): 2021-01-11 Carlos Garcia Campos <cgarcia@igalia.com> and Philippe Normand <pnormand@igalia.com> [GStreamer] Do not use the registry scanner singleton from the UI process https://bugs.webkit.org/show_bug.cgi?id=220407 Reviewed by Xabier Rodriguez-Calvar. * platform/RuntimeApplicationChecks.h: (WebCore::isInNetworkProcess): Simplify ifdefs a bit and allow for glib implementation in a separate file. * platform/SourcesGLib.txt: * platform/glib/RuntimeApplicationChecksGLib.cpp: Added. (WebCore::isInWebProcess): Implementation based on program filename. (WebCore::isInNetworkProcess): Ditto. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::getSupportedDecodingTypes): Static function to get the supported MIME types for decoding. It uses the singleton if called from the web process or creates a new instance otherwise. (WebCore::GStreamerRegistryScanner::GStreamerRegistryScanner): Initialize gst when not in the web process. * platform/graphics/gstreamer/GStreamerRegistryScanner.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes): Use GStreamerRegistryScanner::getSupportedDecodingTypes(). * platform/graphics/gstreamer/mse/GStreamerRegistryScannerMSE.cpp: (WebCore::GStreamerRegistryScannerMSE::getSupportedDecodingTypes): Static function to get the supported MIME types for decoding. It uses the singleton if called from the web process or creates a new instance otherwise. * platform/graphics/gstreamer/mse/GStreamerRegistryScannerMSE.h: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::getSupportedTypes): Use GStreamerRegistryScannerMSE::getSupportedDecodingTypes(). 2021-01-10 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Make "inline level box affects line box geometry" logic more explicit https://bugs.webkit.org/show_bug.cgi?id=220232 Reviewed by Antti Koivisto. Since InlineLevelBox::isEmpty makes little sense in case of non-inline-boxes (e.g. <br>), let's make the following set of changes: 1. Introduce InlineLevelBox::setHasContent for inline boxes only (<span>has content</span>, <div>root inlinebox has content</div>) 2. Both atomic and line box logic is moved to InlineFormattingContext::Quirks::inlineLevelBoxAffectsLineBox This is also in preparation for getting rid of the is-considered-empty concept for line/line box. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): (WebCore::Layout::LineBoxBuilder::computeLineBoxHeightAndAlignInlineLevelBoxesVertically): * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::inlineLevelBoxAffectsLineBox const): (WebCore::Layout::InlineFormattingContext::Quirks::shouldInlineLevelBoxStretchLineBox const): Deleted. * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::InlineLevelBox::setHasContent): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineLevelBox::hasContent const): (WebCore::Layout::LineBox::InlineLevelBox::isEmpty const): Deleted. (WebCore::Layout::LineBox::InlineLevelBox::setIsNonEmpty): Deleted. 2021-01-10 Antti Koivisto <antti@apple.com> [LFC][Integration] Factor marked text style collection code out of InlineTextBox https://bugs.webkit.org/show_bug.cgi?id=220249 Reviewed by Zalan Bujtas. This makes it possible to use the code from LFC painting. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): (WebCore::InlineTextBox::MarkedTextStyle::areBackgroundMarkedTextStylesEqual): Deleted. (WebCore::InlineTextBox::MarkedTextStyle::areForegroundMarkedTextStylesEqual): Deleted. (WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual): Deleted. (WebCore::InlineTextBox::StyledMarkedText::StyledMarkedText): Deleted. (WebCore::InlineTextBox::computeStyleForUnmarkedMarkedText const): Deleted. (WebCore::InlineTextBox::resolveStyleForMarkedText): Deleted. (WebCore::InlineTextBox::subdivideAndResolveStyle): Deleted. (WebCore::InlineTextBox::coalesceAdjacentMarkedTexts): Deleted. * rendering/InlineTextBox.h: * rendering/MarkedTextStyle.cpp: Added. (WebCore::resolveStyleForMarkedText): (WebCore::computeStyleForUnmarkedMarkedText): (WebCore::subdivideAndResolveStyle): (WebCore::coalesceAdjacentMarkedTexts): * rendering/MarkedTextStyle.h: Added. (WebCore::MarkedTextStyle::areBackgroundMarkedTextStylesEqual): (WebCore::MarkedTextStyle::areForegroundMarkedTextStylesEqual): (WebCore::MarkedTextStyle::areDecorationMarkedTextStylesEqual): (WebCore::StyledMarkedText::StyledMarkedText): 2021-01-10 Antti Koivisto <antti@apple.com> Remove InlineBox::hasSelectedChildren bit https://bugs.webkit.org/show_bug.cgi?id=220240 Reviewed by Sam Weinig. It is only needed for selection gap painting and easily computed. * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::constructLine): * rendering/InlineBox.h: (WebCore::InlineBox::setCanHaveLeftExpansion): (WebCore::InlineBox::InlineBoxBitfields::InlineBoxBitfields): (WebCore::InlineBox::hasEllipsisBox const): (WebCore::InlineBox::canHaveLeftExpansion const): (WebCore::InlineBox::hasSelectedChildren const): Deleted. (WebCore::InlineBox::setHasSelectedChildren): Deleted. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::inlineSelectionGaps): * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::setSelectionState): Deleted. * rendering/RenderLineBreak.h: * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::setSelectionState): Deleted. * rendering/RenderListMarker.h: * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::setSelectionState): Deleted. * rendering/RenderReplaced.h: * rendering/RenderText.cpp: (WebCore::RenderText::setSelectionState): * rendering/RenderTextLineBoxes.cpp: (WebCore::RenderTextLineBoxes::setSelectionState): Deleted. * rendering/RenderTextLineBoxes.h: * rendering/RootInlineBox.h: 2021-01-09 Zalan Bujtas <zalan@apple.com> play.google.com: App preview images are clipped https://bugs.webkit.org/show_bug.cgi?id=220470 <rdar://problem/60258531> Reviewed by Simon Fraser. "The baseline of an 'inline-block' is the baseline of its last line box in the normal flow, unless it has either no in-flow line boxes or if its 'overflow' property has a computed value other than 'visible', in which case the baseline is the bottom margin edge." https://www.w3.org/TR/CSS22/visudet.html#leading Test: fast/inline/inline-block-baseline-with-overflow-not-visible.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::inlineBlockBaseline const): 2021-01-09 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Use the bottom margin edge as the baseline for inline-block when overflow is not visible https://bugs.webkit.org/show_bug.cgi?id=220481 Reviewed by Antti Koivisto. "The baseline of an 'inline-block' is the baseline of its last line box in the normal flow, unless it has either no in-flow line boxes or if its 'overflow' property has a computed value other than 'visible', in which case the baseline is the bottom margin edge." https://www.w3.org/TR/CSS22/visudet.html#leading * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): 2021-01-08 Peng Liu <peng.liu6@apple.com> A video element needs to ignore the request to enter/exit fullscreen before the current fullscreen mode change is completed https://bugs.webkit.org/show_bug.cgi?id=220466 Reviewed by Jer Noble. Fix a flaky layout test: media/media-fullscreen-inline.html * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitEnterFullscreen): (WebCore::HTMLVideoElement::webkitExitFullscreen): 2021-01-08 Brady Eidson <beidson@apple.com> BlobLoader lifetime cleanup. <rdar://problem/70498831> and https://bugs.webkit.org/show_bug.cgi?id=220486 Reviewed by Chris Dumez. Test: LayoutTests/http/tests/loading/blob-load-fail.html * fileapi/Blob.cpp: (WebCore::Blob::loadBlob): (WebCore::Blob::text): (WebCore::Blob::arrayBuffer): * fileapi/Blob.h: 2021-01-08 Peng Liu <peng.liu6@apple.com> REGRESSION (r271273): Crash in WebCore::HTMLMediaElement::setVideoFullscreenGravity https://bugs.webkit.org/show_bug.cgi?id=220467 Reviewed by Darin Adler. Add a null check in VideoFullscreenModelVideoElement::setVideoLayerGravity(). Fix layout test crashes: - media/controls/pip-placeholder-without-video-controls.html - media/element-containing-pip-video-going-into-fullscreen.html * platform/cocoa/VideoFullscreenModelVideoElement.mm: (WebCore::VideoFullscreenModelVideoElement::setVideoLayerGravity): 2021-01-08 Philippe Normand <pnormand@igalia.com> [GStreamer] Player audio sink needs to be initialized earlier https://bugs.webkit.org/show_bug.cgi?id=220462 Reviewed by Xabier Rodriguez-Calvar. Currently the player initializes the audio sink in the load method but that's not enough in situations where the player has an audiosourceprovider. So initialize it from the constructor early on, to ensure that the audio provider sink bin is valid. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 2021-01-08 Sihui Liu <sihui_liu@appe.com> [Mojave Debug] ASSERTION FAILED: !m_requests.contains(clientIdentifier) in WebKit::SpeechRecognitionServer::start() https://bugs.webkit.org/show_bug.cgi?id=220426 <rdar://problem/72897083> Reviewed by Youenn Fablet. We should send end event to mark the end of recognition. Otherwise, SpeechRecognitionServer does not know the request is finished and won't remove it from map. * Modules/speech/SpeechRecognizer.cpp: (WebCore::SpeechRecognizer::resetRecognition): 2021-01-08 Youenn Fablet <youenn@apple.com> PaintFrameForMedia has a null identifier when media player is a media stream track video player https://bugs.webkit.org/show_bug.cgi?id=220411 Reviewed by Wenson Hsieh. MediaStreamTrack video player is running in WebProcess as WebProcess gets each video sample. There is no corresponding remote media player. Disable the GPU code path for painting the video element and use the in-process one instead. Covered by test in GPU process mode. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::paintFrameForMedia): * platform/graphics/GraphicsContextImpl.h: * platform/graphics/cairo/GraphicsContextImplCairo.h: * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::canPaintFrameForMedia const): (WebCore::DisplayList::Recorder::paintFrameForMedia): * platform/graphics/displaylists/DisplayListRecorder.h: * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: * platform/graphics/win/GraphicsContextImplDirect2D.h: 2021-01-08 Rob Buis <rbuis@igalia.com> Take aspect-ratio into account for percentage resolution https://bugs.webkit.org/show_bug.cgi?id=220143 Reviewed by Darin Adler. Add aspect-ratio handling to containing block available height computations to fix percentage resolution on its children. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const): * rendering/RenderBox.cpp: (WebCore::RenderBox::availableLogicalHeightUsing const): (WebCore::blockSizeFromAspectRatio): Deleted. * rendering/RenderBox.h: (WebCore::RenderBox::blockSizeFromAspectRatio): 2021-01-08 Philippe Normand <pnormand@igalia.com> [GStreamer] WebAudio provider should clean-up its bin when the client disappears https://bugs.webkit.org/show_bug.cgi?id=219245 Reviewed by Xabier Rodriguez-Calvar. Clean-up elements downstream of the deinterleave element when the provider client changes or is removed. * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: (WebCore::copyGStreamerBuffersToAudioChannel): (WebCore::AudioSourceProviderGStreamer::provideInput): (WebCore::AudioSourceProviderGStreamer::handleSample): (WebCore::AudioSourceProviderGStreamer::setClient): (WebCore::AudioSourceProviderGStreamer::handleRemovedDeinterleavePad): (WebCore::AudioSourceProviderGStreamer::deinterleavePadsConfigured): * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::disconnectSimpleBusMessageCallback): Drive-by, remove bus signal handler. (WebCore::connectSimpleBusMessageCallback): * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Drive-by, define GST_CAT_DEFAULT earlier so that all GST_DEBUG call sites actually log something. 2021-01-08 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer][EME][Thunder] Accept no protection system specific caps for CENC https://bugs.webkit.org/show_bug.cgi?id=220088 Reviewed by Philippe Normand. For example in CMAF it could happen that you don't have protection events and hence no protection system in the caps. We need to allow those cases. * platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp: 2020-09-24 Sergio Villar Senin <svillar@igalia.com> [WebXR] Initial implemention of device initialization/shutdown with OpenXR https://bugs.webkit.org/show_bug.cgi?id=216925 Reviewed by Darin Adler. Added a very basic initialization and shutdown processes of XR devices using OpenXR. So far we're just creating and destroying the XR session. Follow up patches will add the required machinery to get frame data from OpenXR. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::WebXRSession): Call initializeTrackingAndRendering(). (WebCore::WebXRSession::~WebXRSession): Call shutdownTrackingAndRendering(). (WebCore::WebXRSession::shutdown): Ditto. * Modules/webxr/WebXRSystem.h: * platform/xr/PlatformXR.h: New virtual methods to initialize/shutdown devices. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::OpenXRDevice::OpenXRDevice): Initialize m_session. (PlatformXR::OpenXRDevice::~OpenXRDevice): Call shutdownTrackingAndRendering(). (PlatformXR::toXrViewConfigurationType): New method. Translates from SessionMode to XrViewConfigurationType. (PlatformXR::OpenXRDevice::initializeTrackingAndRendering): New method. Creates a session with a given mode. (PlatformXR::OpenXRDevice::resetSession): Destroys session. (PlatformXR::OpenXRDevice::shutdownTrackingAndRendering): * platform/xr/openxr/PlatformXROpenXR.h: * testing/WebFakeXRDevice.h: Added empty implementations for the new virtual methods. 2021-01-07 Zalan Bujtas <zalan@apple.com> paypal.com: text at the bottom of the page is not aligned properly https://bugs.webkit.org/show_bug.cgi?id=220444 <rdar://problem/60356338> Reviewed by Simon Fraser. This patch addresses the case when we try to align text content inside an inline level box with display type of inline-block. While ideally only the inline level boxes would participate in the vertical alignment process, in legacy line layout we align the text content as well. The verticalAlignApplies() function filters out the cases when the text content should default to baseline. It was checking against "inline" to ensure "<div style="vertical-align: top">foobar</div>" works and it missed the following case "<div style="display: inline-block; vertical-align:top">foobar</div>" <- inline level box but "foobar" should be baseline aligned. Tests: fast/inline/incorrect-vertical-alignment-inside-inline-block.html * rendering/InlineFlowBox.cpp: (WebCore::verticalAlignApplies): 2021-01-07 Eric Carlson <eric.carlson@apple.com> [Mac] Add runtime logging to format reader and WebM parser https://bugs.webkit.org/show_bug.cgi?id=220423 <rdar://problem/72896655> Reviewed by Andy Estes. Add a shared Logger to Document that can be used by singletons or objects that don't have access to a Document. To ensure that the shared logger doesn't log activity from a private session, it is disabled if *any* Document in the process doesn't allow logging. * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::sharedLoggerOwner): (WebCore::staticSharedLogger): (WebCore::Document::sharedLogger): (WebCore::Document::configureSharedLogger): (WebCore::Document::addToDocumentsMap): (WebCore::Document::removeFromDocumentsMap): (WebCore::m_selection): (WebCore::Document::~Document): * dom/Document.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WTF::LogArgument<webm::TrackType>::toString): (WebCore::logChannel): (WebCore::logClassName): (WebCore::SourceBufferParserWebM::appendData): (WebCore::SourceBufferParserWebM::setLogger): (WebCore::SourceBufferParserWebM::OnElementBegin): (WebCore::SourceBufferParserWebM::OnElementEnd): (WebCore::SourceBufferParserWebM::OnEbml): (WebCore::SourceBufferParserWebM::OnSegmentBegin): (WebCore::SourceBufferParserWebM::OnInfo): (WebCore::SourceBufferParserWebM::OnClusterBegin): (WebCore::SourceBufferParserWebM::OnTrackEntry): (WebCore::SourceBufferParserWebM::OnBlockBegin): (WebCore::SourceBufferParserWebM::OnBlockEnd): (WebCore::SourceBufferParserWebM::OnSimpleBlockBegin): (WebCore::SourceBufferParserWebM::OnSimpleBlockEnd): (WebCore::SourceBufferParserWebM::OnBlockGroupBegin): (WebCore::SourceBufferParserWebM::OnBlockGroupEnd): (WebCore::SourceBufferParserWebM::OnFrame): * platform/graphics/cocoa/SourceBufferParserWebM.h: 2021-01-07 Alexey Shvayka <shvaikalesh@gmail.com> [JSC] Simplify get*PropertyNames() methods and EnumerationMode https://bugs.webkit.org/show_bug.cgi?id=212954 Reviewed by Yusuke Suzuki. Adjust for changes in JSC's MethodTable, TypeInfo, and EnumerationMode. No new tests, no behavior change. * animation/KeyframeEffect.cpp: (WebCore::processKeyframeLikeObject): * bindings/js/JSDOMConvertRecord.h: * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertyNames): * bindings/js/JSLocationCustom.cpp: (WebCore::JSLocation::getOwnPropertyNames): * bindings/js/JSRemoteDOMWindowCustom.cpp: (WebCore::JSRemoteDOMWindow::getOwnPropertyNames): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): * bindings/scripts/CodeGeneratorJS.pm: (GenerateGetOwnPropertyNames): (GenerateHeader): * bindings/scripts/test/JS/*: Updated. * bridge/NP_jsobject.cpp: * bridge/runtime_array.cpp: (JSC::RuntimeArray::getOwnPropertyNames): * bridge/runtime_array.h: * bridge/runtime_object.cpp: (JSC::Bindings::RuntimeObject::getOwnPropertyNames): * bridge/runtime_object.h: 2021-01-07 Wenson Hsieh <wenson_hsieh@apple.com> Text fields should not be translated while typing https://bugs.webkit.org/show_bug.cgi?id=220431 <rdar://problem/71724918> Reviewed by Tim Horton. Don't vend text nodes or newly created elements inside input elements for translation (i.e. text manipulation) if the input element was modified by the user. Note that this check is right before the call to `observeParagraphs` as opposed to when we schedule the observation update, since edit commands may create renderers for text nodes and other elements before the `m_lastChangeWasUserEdit` flag has been set. Test: TextManipulation.StartTextManipulationDoesNotExtractUserModifiedText * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::scheduleObservationUpdate): 2021-01-07 Eric Carlson <eric.carlson@apple.com> [MSE] Fix potential crash in SourceBufferPrivateAVFObjC::destroyParser https://bugs.webkit.org/show_bug.cgi?id=220434 Reviewed by Jer Noble. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::destroyParser): NULL-check m_mediaSource->player() before using it. 2021-01-07 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] WebGL isn't shown in non-AC mode https://bugs.webkit.org/show_bug.cgi?id=220380 Reviewed by Kenneth Russell. If WinCairo disabled accelerated compositing, no WebGL were shown. GraphicsContextGLOpenGL::readCompositedResults wasn't implemented for !PLATFORM(COCOA). * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: (WebCore::GraphicsContextGLOpenGL::readCompositedResults): 2021-01-07 Andy Estes <aestes@apple.com> [Mac] Prepend "Media" to FormatReader, SampleCursor, and TrackReader class names https://bugs.webkit.org/show_bug.cgi?id=220424 Reviewed by Eric Carlson. * platform/graphics/cocoa/SourceBufferParserWebM.h: 2021-01-07 Chris Dumez <cdumez@apple.com> [GPUProcess] Implement GPUProcess crash recovery for MediaElementAudioSourceNode https://bugs.webkit.org/show_bug.cgi?id=220391 Reviewed by Geoffrey Garen. When audio is playing using WebAudio and a MediaElementAudioSourceNode, make sure that audio resumes playing seemlessly after a GPUProcess crash. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaEngineWasUpdated): (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): Reconstruct the audioSourceProvider (and add the audioSourceNode as its client) as soon as possible after the media engine was (re-)initialized in mediaPlayerEngineUpdated(), instead of doing it asynchronously in mediaEngineWasUpdated(). This does not run script so it is safe to call synchronously. If the GPUProcess crashes while a MediaElementAudioSourceNode is playing, MediaElementAudioSourceNode::process() needs the audioSourceProvider to get the input audio. If we don't eagerly construct the audioSourceProvider here, then it may happen on the audio rendering thread, when the MediaElementAudioSourceNode actually needs it, which would not be safe. (WebCore::HTMLMediaElement::mediaPlayerWillInitializeMediaEngine): (WebCore::HTMLMediaElement::mediaPlayerDidInitializeMediaEngine): As mentioned earlier, MediaElementAudioSourceNode::process() runs on the audio thread and accesses HTMLMediaElement::audioSourceProvider(), which calls MediaPlayer::audioSourceProvider(), which calls MediaPlayerPrivate::audioSourceProvider(). To be thread-safe, we need to make sure we hold the MediaElementAudioSourceNode's process lock while the MediaPlayerPrivate is being reconstructed in MediaPlayer (which happens when the GPUProcess crashes). * html/HTMLMediaElement.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::loadWithNextMediaEngine): * platform/graphics/MediaPlayer.h: (WebCore::MediaPlayerClient::mediaPlayerWillInitializeMediaEngine): (WebCore::MediaPlayerClient::mediaPlayerDidInitializeMediaEngine): Add new MediaPlayerClient interface functions that are called before and after the MediaPlayerPrivate gets (re-)constructed. This is needed by the HTMLMediaElement to hold a lock while this is happening. 2021-01-07 Alex Christensen <achristensen@webkit.org> Null check global object in Blob::stream https://bugs.webkit.org/show_bug.cgi?id=220393 <rdar://problem/71626701> Reviewed by Chris Dumez. Sometimes during a frame teardown we could dereference null. Attached a test that hit it about 10% of the time for me in WebKitTestRunner before this change. Test: fast/files/blob-stream-crash.html * fileapi/Blob.cpp: (WebCore::Blob::stream): 2021-01-07 Lauro Moura <lmoura@igalia.com> REGRESSION(r270425) [GTK] wheel scrolling stopped working https://bugs.webkit.org/show_bug.cgi?id=219547 Reviewed by Carlos Garcia Campos. Return early if the frame was already deleted. Needed for fast/events/wheel-event-destroys-frame.html * page/EventHandler.cpp: (WebCore::EventHandler::wheelEventWasProcessedByMainThread): 2021-01-07 Carlos Garcia Campos <cgarcia@igalia.com> Only update the resources when rendering SVG selected text https://bugs.webkit.org/show_bug.cgi?id=218486 Reviewed by Ryosuke Niwa. Instead of calling SVGResourcesCache::clientStyleChanged() that marks the renderer for layout and parent resource invalidation, add a helper class SVGResourcesCache::SetStyleForScope() that just updates the resources for the new style on construction and restores the previous one on destruction. * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::paintText): Use SVGResourcesCache::SetStyleForScope(). * rendering/svg/SVGResourcesCache.cpp: (WebCore::SVGResourcesCache::SetStyleForScope::SetStyleForScope): Call setStyle() with the new style. (WebCore::SVGResourcesCache::SetStyleForScope::~SetStyleForScope): Call setStyle() with the previous style. (WebCore::SVGResourcesCache::SetStyleForScope::setStyle): Set the given style if needed. * rendering/svg/SVGResourcesCache.h: 2021-01-07 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Build failures with GTK4 3.99.5.1 https://bugs.webkit.org/show_bug.cgi?id=219844 Reviewed by Philippe Normand. * platform/gtk/GtkVersioning.h: (gtk_window_resize): (gtk_window_get_size): 2021-01-06 Rob Buis <rbuis@igalia.com> Fix aspect ratio handling in RenderBox::computeLogicalWidthInFragment https://bugs.webkit.org/show_bug.cgi?id=220138 Reviewed by Simon Fraser. The existing code does not respect min/max-height in the logical height calculation, the computeLogicalWidthFromAspectRatio helper does, so use it. * rendering/RenderBox.cpp: (WebCore::RenderBox::computeLogicalWidthInFragment const): 2021-01-06 Fujii Hironori <Hironori.Fujii@sony.com> [GTK][CMake] Add a build switch USE_OPENGL_OR_ES to be able to disable OpenGL and ES https://bugs.webkit.org/show_bug.cgi?id=220183 Reviewed by Kenneth Russell. * platform/graphics/x11/PlatformDisplayX11.cpp: Include <X11/Xutil.h> for XGetVisualInfo. 2021-01-06 Jer Noble <jer.noble@apple.com> [Cocoa] Revert audioTimePitchAlgorithm to "TimeDomain" from "Spectral" https://bugs.webkit.org/show_bug.cgi?id=220341 Reviewed by Youenn Fablet. The "Spectral" pitch correction algorithm has notable deficiencies when applied to spoken content; notably, transient propagation is missing, and the resulting audio sounds "robotic". Revert to "TimeDomain", which is both more computationally inexpensive, and both propogates transients and is optimized for non-harmonic content like speech. Add a setting to allow clients to customize this behavior, e.g., if those clients would prefer optimizing for music over speech. Drive-by fix: re-apply the pitch algorithm after the AVPlayerItem reaches the "readyToPlay" status to work around an AVFoundation bug. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::loadResource): * page/Settings.yaml: * page/SettingsBase.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::setPitchCorrectionAlgorithm): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerEnums.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::setPitchCorrectionAlgorithm): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::audioTimePitchAlgorithmForMediaPlayerPitchCorrectionAlgorithm): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPreservesPitch): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPitchCorrectionAlgorithm): (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatusDidChange): 2021-01-06 Aditya Keerthi <akeerthi@apple.com> [macOS] Text inside form controls is off center on burton.com https://bugs.webkit.org/show_bug.cgi?id=220376 <rdar://problem/72833977> Reviewed by Devin Rousso. <select> elements on burton.com specify an empty size attribute. This results in the "select:matches([size], [multiple]), select[size][multiple]" ruleset being applied, which adds the rule "align-items: flex-start". That rules causes the text within the element to be aligned to the top. This rule is necessary for <select multiple> and <select> elements with a size attribute greater than or equal to 2, which both have a listbox appearance (a popup menu is not shown when clicking the element). However, <select> elements with a size attribute less than or equal to 1 have a menulist appearance and display a popup when clicked. <select size> also displays a popup when clicked, and like other browsers it should have vertically centered text. WebKit already has an additional ruleset for size="0" and size="1" to preserve the menulist appearance. Consequently, we can augment the ruleset to include size="", removing the "align-items: flex-start" rule for <select size> and ensuring the text is vertically centered. Test: fast/forms/select-empty-size.html * css/html.css: (select:is([size], [multiple]), select[size][multiple]): Update ruleset to use :is(), instead of the obsolete :matches(). (select:is([size=""], [size="0"], [size="1"])): Add [size=""] to the list of matching attributes, since <select size> should not have a listbox appearance. The new appearance matches Chrome and Firefox. 2021-01-06 Devin Rousso <drousso@apple.com> [iOS] REGRESSION(r265088): "pointerdown" doesn't fire using a trackpad after double-tapping https://bugs.webkit.org/show_bug.cgi?id=220072 Reviewed by Antoine Quint. r265088 made it such that pointer events are not created for mouse events if there is an existing entry for any touch event in `m_activePointerIdsToCapturingData`. Unfortunately, entries only appear to be removed from `m_activePointerIdsToCapturingData` from three places: - when the single tap gesture recognizer resets (`-[WKContentView _singleTapDidReset:]`) - if a potential tap cannot be committed (`-[WKContentView _commitPotentialTapFailed]`) - after a synthetic click (`-[WKContentView _didCompleteSyntheticClick]`) AFAICT (and seeing how there's a gesture recognizer for double-tap, long press, etc.), this does not include other situations like the second tap of a double-tap. In order to fix this: - eagerly `touchWithIdentifierWasRemoved` when dispatching `"pointerup"` for a touch event - (just in case) don't prevent the pointer event for mouse events if the existing touch event has been cancelled or is not currently pressed * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex): (WebCore::PointerCaptureController::pointerEventForMouseEvent): 2021-01-06 Andy Estes <aestes@apple.com> [Mac] Replace most uses of HAVE(MT_PLUGIN_FORMAT_READER) with ENABLE(WEBM_FORMAT_READER) https://bugs.webkit.org/show_bug.cgi?id=220374 <rdar://problem/72600426> Reviewed by Eric Carlson. * page/RuntimeEnabledFeatures.h: * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::webMFormatReaderEnabled): (WebCore::PlatformMediaSessionManager::setWebMFormatReaderEnabled): * platform/audio/PlatformMediaSessionManager.h: * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: (WebCore::AVAssetMIMETypeCache::canDecodeExtendedType): (WebCore::AVAssetMIMETypeCache::initializeCache): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::registerFormatReaderIfNecessary): (WebCore::willUseWebMFormatReaderForType): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::canLoadFormatReader): 2021-01-06 Zalan Bujtas <zalan@apple.com> [LFC][IFC] "display: -webkit-inline-box" generates an inline level box https://bugs.webkit.org/show_bug.cgi?id=220373. <rdar://problem/72138270> Reviewed by David Kilzer. * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::isInlineLevelBox const): 2021-01-06 Antoine Quint <graouts@webkit.org> Remove the unused RenderStyle::setHasPseudoStyle() https://bugs.webkit.org/show_bug.cgi?id=219893 Reviewed by Darin Adler. This function no longer has any call sites. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyle): Deleted. (WebCore::RenderStyle::setHasPseudoStyle): Deleted. 2021-01-06 Philippe Normand <pnormand@igalia.com> REGRESSION[r270947][GStreamer]: Deadlocks audio rendering https://bugs.webkit.org/show_bug.cgi?id=220112 Reviewed by Chris Dumez. This patch fixes the mentioned regression by making the webaudiosrc element wait on the dispatch condition only if it wasn't done synchronously. Additionally several race conditions are now fixed in the AudioDestination, by ensuring the start and stop completion handlers are invoked only after the corresponding pipeline state has been reached. Also the AudioDestination now correctly notifies its parent node of is-playing changes. * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer): (WebCore::AudioDestinationGStreamer::~AudioDestinationGStreamer): (WebCore::AudioDestinationGStreamer::handleMessage): (WebCore::AudioDestinationGStreamer::start): (WebCore::AudioDestinationGStreamer::startRendering): (WebCore::AudioDestinationGStreamer::stop): (WebCore::AudioDestinationGStreamer::stopRendering): (WebCore::AudioDestinationGStreamer::notifyStartupResult): (WebCore::AudioDestinationGStreamer::notifyStopResult): (WebCore::AudioDestinationGStreamer::notifyIsPlaying): * platform/audio/gstreamer/AudioDestinationGStreamer.h: * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webkit_web_audio_src_class_init): (webKitWebAudioSrcConstructed): (webKitWebAudioSrcSetProperty): (webKitWebAudioSrcGetProperty): (webKitWebAudioSrcAllocateBuffers): (webKitWebAudioSrcRenderAndPushFrames): (webKitWebAudioSrcRenderIteration): (webKitWebAudioSrcChangeState): (webkitWebAudioSourceSetDispatchToRenderThreadFunction): * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.h: * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::webkitGstSetElementStateSynchronously): * platform/graphics/gstreamer/GStreamerCommon.h: (WebCore::webkitGstSetElementStateSynchronously): 2021-01-05 Eric Carlson <eric.carlson@apple.com> [Cocoa] WebM format reader doesn't work with a url in a <source> element https://bugs.webkit.org/show_bug.cgi?id=219961 <rdar://problem/72399014> Reviewed by Andy Estes. Work around a CoreMedia bug that makes the format reader fail to load when the AVURLAssetOutOfBandMIMETypeKeyis included in the AVURLAsset options dictionary. Also include some cleanup: - Move the code to check for WebM MIME types from MediaPlayerPrivateAVFoundationObjC to AVAssetMIMETypeCache. - Don't use RuntimeEnabledFeatures in MediaPlayerPrivateAVFoundationObjC. - Register the WebM format reader when creating an AVURLAsset for a WebM url instead of when checking the MIME type. - Cleanup WebM "codecs" parameter parsing. - It is a layering violation to use RuntimeSettings from inside of /platform. * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::webMFormatReaderEnabled): (WebCore::PlatformMediaSessionManager::setWebMFormatReaderEnabled): (WebCore::PlatformMediaSessionManager::vorbisDecoderEnabled): (WebCore::PlatformMediaSessionManager::setVorbisDecoderEnabled): * platform/audio/PlatformMediaSessionManager.h: * platform/graphics/TrackPrivateBase.cpp: (WebCore::TrackPrivateBase::defaultEnabled const): * platform/graphics/TrackPrivateBase.h: * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: (WebCore::AVAssetMIMETypeCache::canDecodeExtendedType): (WebCore::AVAssetMIMETypeCache::initializeCache): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::registerFormatReaderIfNecessary): (WebCore::willUseWebMFormatReaderForType): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsTypeAndCodecs): (WebCore::ensureFormatReaderIsRegistered): Deleted. (WebCore::isFormatReaderAvailable): Deleted. * platform/graphics/cocoa/AudioTrackPrivateWebM.cpp: (WebCore::AudioTrackPrivateWebM::defaultEnabled const): * platform/graphics/cocoa/AudioTrackPrivateWebM.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::webmMIMETypes): (WebCore::canLoadFormatReader): (WebCore::SourceBufferParserWebM::isWebMFormatReaderAvailable): (WebCore::SourceBufferParserWebM::isContentTypeSupported): * platform/graphics/cocoa/SourceBufferParserWebM.h: * platform/graphics/cocoa/VideoTrackPrivateWebM.cpp: (WebCore::VideoTrackPrivateWebM::defaultEnabled const): * platform/graphics/cocoa/VideoTrackPrivateWebM.h: * platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm: (WebCore::isVorbisDecoderAvailable): 2021-01-05 Simon Fraser <simon.fraser@apple.com> REGRESSION: animated iframe painted blank https://bugs.webkit.org/show_bug.cgi?id=220231 <rdar://problem/72793724> Reviewed by Zalan Bujtas. When an <iframe> on a fractional pixel boundary, on a non-Retina display, with composited contents had its visibility toggled from 'hidden' to 'visible' we could fail to parent the iframe content compositing layers, resulting in missing iframe content. This happened when the iframe's GraphicsLayer had a m_contentsClippingLayer (which acts as the parent for the content layers) due to the fractional pixel offset. When GraphicsLayerCA::setContentsVisible(true) was called, it would fail to call noteSublayersChanged() because the iframe host layer has no m_contentsLayer, but we do need to rebuild sublayers in this case. Test: compositing/iframes/content-visibility-with-clipping.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setContentsVisible): 2021-01-05 Megan Gardner <megan_gardner@apple.com> Copy Localizable.strings file into the correct directory https://bugs.webkit.org/show_bug.cgi?id=220029 Reviewed by Tim Horton. After the changes in r269865, r269873, r269915, r269932, r269937 the localizable.strings was not showing up in the right place in the production build to allow it to be correctly localized. This skips the step of putting it in DerivedSources and just puts the concatenated file in the final correct directory so we do not have to relay on Xcode build doing the correct thing for us. * WebCore.xcodeproj/project.pbxproj: 2021-01-05 Peng Liu <peng.liu6@apple.com> [Media in GPU Process][MSE] SourceBuffer fires update and updateend events before the coded frames are removed https://bugs.webkit.org/show_bug.cgi?id=220334 Reviewed by Eric Carlson. Add a completion handler parameter to SourceBufferPrivate::removeCodedFrames(), and the caller (SourceBuffer) will fire `update` and `updateend` events when the completion handler is called. No new tests. Fix failures of the following tests: - imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-v-framesize.html - imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-av-audio-bitrate.html - imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-av-video-bitrate.html * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::removeTimerFired): * platform/graphics/SourceBufferPrivate.cpp: (WebCore::SourceBufferPrivate::removeCodedFrames): * platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::removeCodedFrames): 2021-01-05 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo][curl] Enable CURLSSLOPT_NATIVE_CA flag to use system's CA certs instead of cacert.pem https://bugs.webkit.org/show_bug.cgi?id=220258 Reviewed by Don Olmstead. * PlatformFTW.cmake: Removed the code copying pem file. * PlatformWin.cmake: Ditto. * platform/network/curl/CurlContext.cpp: (WebCore::CurlHandle::enableSSLForHost): (WebCore::CurlHandle::enableHttp): Set CURLOPT_SSL_OPTIONS with CURLSSLOPT_NATIVE_CA. * platform/network/win/CurlSSLHandleWin.cpp: (WebCore::CurlSSLHandle::platformInitialize): (WebCore::getCACertPathEnv): Deleted. 2021-01-05 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r271025. Breaks internal builds Reverted changeset: "Copy Localizable.strings file into the correct directory" https://bugs.webkit.org/show_bug.cgi?id=220029 https://trac.webkit.org/changeset/271025 2021-01-05 Chris Fleizach <cfleizach@apple.com> AX: aria-orientation is ignored on input[type="range"] https://bugs.webkit.org/show_bug.cgi?id=220222 <rdar://problem/72765547> Reviewed by Zalan Bujtas. Check aria-orientation on range sliders. Test: accessibility/mac/range-orientation.html * accessibility/AccessibilitySlider.cpp: (WebCore::AccessibilitySlider::orientation const): 2021-01-05 Alicia Boya García <aboya@igalia.com> [GStreamer] Use Ref<> in AudioTrackPrivateGStreamer::create() https://bugs.webkit.org/show_bug.cgi?id=220324 Reviewed by Philippe Normand. create() should return Ref<> when the return value can't be null. This is a cleanup with no functional changes. * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): 2021-01-05 Sihui Liu <sihui_liu@appe.com> Fail speech recognition when page is muted for audio capture https://bugs.webkit.org/show_bug.cgi?id=220133 <rdar://problem/72745232> Reviewed by Youenn Fablet. API test: WebKit2.SpeechRecognitionErrorWhenStartingAudioCaptureOnDifferentPage * Modules/speech/SpeechRecognitionCaptureSource.cpp: (WebCore::SpeechRecognitionCaptureSource::mute): * Modules/speech/SpeechRecognitionCaptureSource.h: * Modules/speech/SpeechRecognitionCaptureSourceImpl.cpp: (WebCore::SpeechRecognitionCaptureSourceImpl::mute): * Modules/speech/SpeechRecognitionCaptureSourceImpl.h: * Modules/speech/SpeechRecognizer.h: (WebCore::SpeechRecognizer::source): 2021-01-05 Alex Christensen <achristensen@webkit.org> Use WeakHashSet<Page> instead of HashSet<Page*> https://bugs.webkit.org/show_bug.cgi?id=220102 Reviewed by Darin Adler. The former is more resistent to using a raw pointer after the object has been freed. * inspector/PageDebugger.cpp: (WebCore::PageDebugger::setJavaScriptPaused): * page/CaptionUserPreferences.cpp: (WebCore::CaptionUserPreferences::currentPage const): (WebCore::CaptionUserPreferences::userPrefersCaptions const): (WebCore::CaptionUserPreferences::setUserPrefersCaptions): (WebCore::CaptionUserPreferences::userPrefersSubtitles const): (WebCore::CaptionUserPreferences::setUserPrefersSubtitles): (WebCore::CaptionUserPreferences::userPrefersTextDescriptions const): (WebCore::CaptionUserPreferences::setUserPrefersTextDescriptions): (WebCore::CaptionUserPreferences::updateCaptionStyleSheetOverride): * page/FrameTree.cpp: (WebCore::FrameTree::find const): * page/PageGroup.cpp: (WebCore::PageGroup::addPage): (WebCore::PageGroup::removePage): (WebCore::PageGroup::captionPreferencesChanged): * page/PageGroup.h: (WebCore::PageGroup::pages const): (WebCore::PageGroup:: const): Deleted. * page/PageGroupLoadDeferrer.cpp: (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer): * page/UserContentProvider.cpp: (WebCore::UserContentProvider::~UserContentProvider): (WebCore::UserContentProvider::addPage): (WebCore::UserContentProvider::removePage): (WebCore::UserContentProvider::registerForUserMessageHandlerInvalidation): (WebCore::UserContentProvider::unregisterForUserMessageHandlerInvalidation): (WebCore::UserContentProvider::invalidateAllRegisteredUserMessageHandlerInvalidationClients): (WebCore::UserContentProvider::invalidateInjectedStyleSheetCacheInAllFramesInAllPages): * page/UserContentProvider.h: * page/VisitedLinkStore.cpp: (WebCore::VisitedLinkStore::~VisitedLinkStore): (WebCore::VisitedLinkStore::addPage): (WebCore::VisitedLinkStore::removePage): (WebCore::VisitedLinkStore::invalidateStylesForAllLinks): (WebCore::VisitedLinkStore::invalidateStylesForLink): * page/VisitedLinkStore.h: * plugins/PluginInfoProvider.cpp: (WebCore::PluginInfoProvider::~PluginInfoProvider): (WebCore::PluginInfoProvider::clearPagesPluginData): (WebCore::PluginInfoProvider::refresh): (WebCore::PluginInfoProvider::addPage): (WebCore::PluginInfoProvider::removePage): * plugins/PluginInfoProvider.h: * storage/StorageEventDispatcher.cpp: (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents): (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): 2021-01-05 Andres Gonzalez <andresg_22@apple.com> AXIsolatedObject::doAXStringForRange must return an isolatedCopy. https://bugs.webkit.org/show_bug.cgi?id=220327 Reviewed by Chris Fleizach. Fix oversight in doAXStringForRange that needs to return an isolatedCopy from the main thread. Ssame fix for caching the documentURI and documentEncoding in the initialization of AXIsolatedObjects. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): (WebCore::AXIsolatedObject::doAXStringForRange const): 2021-01-05 Manuel Rego Casasnovas <rego@igalia.com> [selectors] :focus should match inside the focus event https://bugs.webkit.org/show_bug.cgi?id=220243 Reviewed by Frédéric Wang. Before this patch this was working different in WebKit than Chromium and Firefox. The specs are clear about the expected behavior for this: - From https://drafts.csswg.org/selectors-4/#the-focus-pseudo: "The :focus pseudo-class applies while an element has the focus" - From https://w3c.github.io/uievents/#event-type-focus: "The focus MUST be given to the element before the dispatch of this event type" A similar fix has been done on Blink in r201118 by <kochi@chromium.org> (https://chromium.googlesource.com/chromium/src/+/cc49a6966f5ae6d89e86fbd3f53e4deea4e066ca). Test: imported/w3c/web-platform-tests/css/selectors/focus-in-focus-event-001.html * dom/Document.cpp: (WebCore::Document::setFocusedElement): Just moved the call to m_focusedElement->setFocus(true) right before dispatching the events. 2021-01-04 Alexey Shvayka <shvaikalesh@gmail.com> [WebIDL] Remove [LegacyCaller] extended attribute https://bugs.webkit.org/show_bug.cgi?id=220246 Reviewed by Sam Weinig. Before this change, [LegacyCaller] implementation was very complex yet versatile, handling overloads and multiple callers via operation cloning. This patch removes [LegacyCaller], instead of simplifying it, and leverages [CustomGetCallData] to implement HTMLAllCollection's [[Call]] method for a few reasons: 1. Legacy callers were removed from the WebIDL spec [1], with `document.all` being the only use case; callable objects won't ever be introduced. 2. To closely match the HTML spec [2] by returning early rather than passing nullish AtomString. 3. To make getCallData() override more obvious to a reader unfamiliar with legacy callers. 4. To maximize the amount of code removed from the generator. No new tests, no behavior change. [1] https://github.com/heycam/webidl/pull/412 [2] https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#HTMLAllCollection-call * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSHTMLAllCollectionCustom.cpp: Added. (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::JSHTMLAllCollection::getCallData): * bindings/scripts/CodeGeneratorJS.pm: (GenerateInterface): (GenerateGetCallData): (InstanceOverridesGetCallData): (AddLegacyCallerOperationIfNeeded): Deleted. (GeneratePluginCall): Deleted. (GenerateLegacyCallerDefinitions): Deleted. (GenerateLegacyCallerDefinition): Deleted. * bindings/scripts/IDLAttributes.json: * bindings/scripts/IDLParser.pm: (cloneArgument): Deleted. (cloneOperation): Deleted. * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjDOMConstructor::construct): (WebCore::callJSTestObj1): Deleted. (WebCore::callJSTestObj2): Deleted. (WebCore::callJSTestObj3): Deleted. (WebCore::JSTestObj::getCallData): Deleted. (WebCore::jsTestObjPrototypeFunction_legacyCallerNamedBody): Deleted. * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/TestObj.idl: * html/HTMLAllCollection.idl: 2020-12-31 Simon Fraser <simon.fraser@apple.com> [LFC Display] Hook up very basic repaint in the display tree https://bugs.webkit.org/show_bug.cgi?id=220212 Reviewed by Zalan Bujtas. Plumb setNeedsDisplay() from a Display::Box via the Tree to the View, and from there just repaint the entire root layer. This is very preliminary. * display/DisplayTree.cpp: (WebCore::Display::Tree::setBoxNeedsDisplay const): * display/DisplayTree.h: * display/DisplayView.cpp: (WebCore::Display::View::prepareForDisplay): (WebCore::Display::View::setNeedsDisplay): * display/DisplayView.h: * display/compositing/DisplayLayerController.cpp: (WebCore::Display::LayerController::setNeedsDisplay): * display/compositing/DisplayLayerController.h: * display/css/DisplayBox.cpp: (WebCore::Display::Box::Box): (WebCore::Display::Box::setNeedsDisplay): * display/css/DisplayBox.h: 2020-12-31 Simon Fraser <simon.fraser@apple.com> [LFC Display] Give display boxes a parent pointer https://bugs.webkit.org/show_bug.cgi?id=220210 Reviewed by Zalan Bujtas. Future code will need to be able to do ancestor tree walks ("find enclosing"), so give Display::Box a pointer to its parent ContainerBox. * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::insert const): * display/css/DisplayBox.h: (WebCore::Display::Box::parent const): (WebCore::Display::Box::setParent): 2020-12-30 Simon Fraser <simon.fraser@apple.com> [LFC Display] Give display boxes a back reference to the tree https://bugs.webkit.org/show_bug.cgi?id=220205 Reviewed by Zalan Bujtas. Display box code will need a back pointer to the display tree for things like paint invalidation. Pass a Tree& to box constructors, which requires that the Tree has been constructed before we make any boxes. * display/DisplayTree.cpp: (WebCore::Display::Tree::setRootStackingItem): (WebCore::Display::Tree::Tree): Deleted. * display/DisplayTree.h: (WebCore::Display::Tree::view const): (WebCore::Display::Tree::setView): * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::TreeBuilder): (WebCore::Display::TreeBuilder::build): * display/DisplayTreeBuilder.h: (WebCore::Display::TreeBuilder::tree const): * display/css/DisplayBox.cpp: (WebCore::Display::Box::Box): * display/css/DisplayBox.h: (WebCore::Display::Box::Box): * display/css/DisplayBoxFactory.cpp: (WebCore::Display::BoxFactory::BoxFactory): (WebCore::Display::BoxFactory::displayBoxForRootBox const): (WebCore::Display::BoxFactory::displayBoxForLayoutBox const): (WebCore::Display::BoxFactory::displayBoxForTextRun const): * display/css/DisplayBoxFactory.h: * display/css/DisplayBoxModelBox.cpp: (WebCore::Display::BoxModelBox::BoxModelBox): * display/css/DisplayBoxModelBox.h: (WebCore::Display::BoxModelBox::BoxModelBox): * display/css/DisplayContainerBox.cpp: (WebCore::Display::ContainerBox::ContainerBox): * display/css/DisplayContainerBox.h: * display/css/DisplayImageBox.cpp: (WebCore::Display::ImageBox::ImageBox): * display/css/DisplayImageBox.h: * display/css/DisplayReplacedBox.cpp: (WebCore::Display::ReplacedBox::ReplacedBox): * display/css/DisplayReplacedBox.h: * display/css/DisplayTextBox.cpp: (WebCore::Display::TextBox::TextBox): * display/css/DisplayTextBox.h: 2021-01-04 Jeff Miller <jeffm@apple.com> Update user-visible copyright strings to include 2021 https://bugs.webkit.org/show_bug.cgi?id=219901 Reviewed by Anders Carlsson. * Info.plist: 2020-12-14 Sergio Villar Senin <svillar@igalia.com> [css-multicol] Do not attach <legend> to <fieldset> multicolumn containers https://bugs.webkit.org/show_bug.cgi?id=218500 Reviewed by Zalan Bujtas. Whenever a <fieldset> is a multicolumn container, any <legend> child must be directly attached to the <fieldset> renderer instead of the RenderMultiColumnFlow created by the latter. That was not happening when the renderer of the DOM node for the <legend> was deleted and then recreated. The problem was that in those situations the parent and beforeChild arguments for RenderTreeBuilder::Block::attachIgnoringContinuation() call were not properly selected. This lead to a scenario were that method was wrongly using the special code path for tables. * rendering/updating/RenderTreeBuilderBlockFlow.cpp: (WebCore::RenderTreeBuilder::BlockFlow::attach): Add a special case for attaching a <legend> to a <fieldset>. 2020-12-17 Sergio Villar Senin <svillar@igalia.com> Intrinsic size not correctly stored for SVG images https://bugs.webkit.org/show_bug.cgi?id=219981 Reviewed by Darin Adler. Intrinsic sizes were only stored in case the replaced element had an intrinsic size for both height and width. However it's pretty common for SVG images to only specify one of them and an aspect ratio. We should store it in those cases too as it'd be useful for some layout systems like flexbox. * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox const): Replace isEmpty() by isZero() calls to allow incomplete intrinsic sizes to be stored. 2021-01-04 Alicia Boya García <aboya@igalia.com> [GStreamer] More robust video size handling https://bugs.webkit.org/show_bug.cgi?id=220103 Reviewed by Philippe Normand. This patch improves the handling of how video size is detected and reported to WebKit, fixing several issues: a) The value returned by calling MediaPlayerPrivateGStreamer ::naturalSize() should not change during a given main thread tick, since this can potentially be read several times from the rendering code. This caused the elusive racy crash on `ASSERTION FAILED: !intrinsicSizeChanged || !view().frameView().layoutContext().isInRenderTreeLayout()` that has been appearing randomly in many layout tests for a very long time. b) Video rotation used to be handled via bus messages, but this is also racy, since the handling of bus messages in the main thread is run on a different priority than other callbacks. This caused a flaky failure on media/video-orientation.html. c) In MSE, appending a second initialization segment with a different video size triggered a video resize on append, before any frames with the new size has been played. This patch fixes these three issues: Only the first initialization segment will trigger a video resize (this is done so we have a video size on HAVE_METADATA, as the MSE spec expects), but otherwise video size is emitted on caps changes on the sink. In the case of regular playback this is delayed until the first frame arrives so that we have a guarantee that any rotation tag events have traversed the pipeline (the data flow through a GStreamer pipeline is done in this order: CAPS event, optional TAG events and then buffers). Video size changes are done by posting a task to the main thread, which ensures the value doesn't change during a main thread tick. The patch also relinquishes usage of MainThreadNotifier so that successions of quick video size changes (e.g. in a test case) still trigger the expected events instead of being potentially coalesced. Since this patch for the most part fixes race conditions that are not covered in TestExpectations, it doesn't introduce changes in TestExpectations. Note: This patch is not enough to fix imported/w3c/web-platform-tests/media-source/mediasource-config-change-*-framesize tests. That requires further non-trivial fixes regarding how MSE flushes are handled. Note: This patch does not fix framesize WebRTC tests. These seem to be a consequence of notifying the user too early of the frame size and/or ready state, before any frame is readable, which is a problem unrelated to these fixes. * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::getVideoSizeAndFormatFromCaps): * platform/graphics/gstreamer/GStreamerCommon.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChanged): (WebCore::MediaPlayerPrivateGStreamer::naturalSize const): (WebCore::MediaPlayerPrivateGStreamer::handleMessage): (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): (WebCore::getVideoOrientation): (WebCore::MediaPlayerPrivateGStreamer::updateVideoSizeAndOrientationFromCaps): (WebCore::MediaPlayerPrivateGStreamer::triggerRepaint): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected): 2021-01-03 Rob Buis <rbuis@igalia.com> Use UTF-8 encoding for empty main resource loads https://bugs.webkit.org/show_bug.cgi?id=220227 Reviewed by Sam Weinig. Unless specified otherwise, documents have UTF-8 encoding [1]. Since [2] does not mention encoding, use UTF-8 encoding explicitly for empty main loads. [1] https://dom.spec.whatwg.org/#concept-document-type [2] https://html.spec.whatwg.org/#initialise-the-document-object (Step 7) Tests: imported/w3c/web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/creating_browsing_context_test_01.html imported/w3c/web-platform-tests/html/browsers/windows/browsing-context.html http/wpt/html/browsers/windows/browsing-context.html Behavior matches Chrome and Firefox. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::maybeLoadEmpty): 2021-01-03 Rob Buis <rbuis@igalia.com> Share meta refresh logic https://bugs.webkit.org/show_bug.cgi?id=220179 Reviewed by Darin Adler. Share meta refresh logic between Document and FrameLoader. * dom/Document.cpp: (WebCore::Document::processHttpEquiv): * loader/FrameLoader.cpp: (WebCore::FrameLoader::receivedFirstData): (WebCore::FrameLoader::scheduleRefreshIfNeeded): * loader/FrameLoader.h: 2021-01-02 Rob Buis <rbuis@igalia.com> Remove some FrameLoader::changeLocation parameters https://bugs.webkit.org/show_bug.cgi?id=220186 Reviewed by Darin Adler. In all cases changeLocation is called with the default values for LockHistory and LockBackForwardList, so we do not need to have these parameters. * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::handleClick): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::handleClick): * loader/FrameLoader.cpp: (WebCore::FrameLoader::changeLocation): * loader/FrameLoader.h: * loader/NavigationScheduler.cpp: * mathml/MathMLElement.cpp: (WebCore::MathMLElement::defaultEventHandler): * svg/SVGAElement.cpp: (WebCore::SVGAElement::defaultEventHandler): 2021-01-02 Simon Fraser <simon.fraser@apple.com> [LFC Display] Rename Box::Flags to Box::TypeFlags https://bugs.webkit.org/show_bug.cgi?id=220223 Reviewed by Sam Weinig. I'll be adding a separate OptionSet<> of flags that can change dynamically on a Display::Box, so rename the existing flags to TypeFlags, and make the member const. They will never change after construction. * display/css/DisplayBox.cpp: (WebCore::Display::Box::Box): * display/css/DisplayBox.h: (WebCore::Display::Box::Box): (WebCore::Display::Box::isBoxModelBox const): (WebCore::Display::Box::isContainerBox const): (WebCore::Display::Box::isImageBox const): (WebCore::Display::Box::isReplacedBox const): (WebCore::Display::Box::isTextBox const): (WebCore::Display::Box::isLineBreakBox const): * display/css/DisplayBoxFactory.cpp: (WebCore::Display::BoxFactory::displayBoxForLayoutBox const): * display/css/DisplayBoxModelBox.cpp: (WebCore::Display::BoxModelBox::BoxModelBox): * display/css/DisplayBoxModelBox.h: (WebCore::Display::BoxModelBox::BoxModelBox): * display/css/DisplayContainerBox.cpp: (WebCore::Display::ContainerBox::ContainerBox): * display/css/DisplayImageBox.cpp: (WebCore::Display::ImageBox::ImageBox): * display/css/DisplayReplacedBox.cpp: (WebCore::Display::ReplacedBox::ReplacedBox): * display/css/DisplayReplacedBox.h: * display/css/DisplayTextBox.cpp: (WebCore::Display::TextBox::TextBox): 2020-12-31 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Horizontal padding/border makes the inline box non-empty https://bugs.webkit.org/show_bug.cgi?id=220208 Reviewed by Antti Koivisto. <span style="padding-left: 1px"></span> makes this inline box non-empty and it stretches the line box. (note that horizontal margin does not make the inline box non-empty) (fast/inline/inline-padding-disables-text-quirk.html) * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): 2020-12-30 Nikolas Zimmermann <nzimmermann@igalia.com> Introduce RenderLayerScrollableArea https://bugs.webkit.org/show_bug.cgi?id=219808 Reviewed by Simon Fraser. Overhaul RenderLayer: The goal is to move all overflow/scroll/... handling out of RenderLayer, to streamline its interface and make it re-usable for layer types that do not need nor support scrolling/overflow. This patch introduces RenderLayerScrollableArea inheriting from ScrollableArea, with a back-reference to RenderLayer -- that mimics the design of RenderLayerFilters. Follow-up patches will land the actual implementation, this only adds a stub and adds it to the build systems. No functional change - no new tests needed. * Headers.cmake: Add RenderLayerScrollableArea.* to build. * Sources.txt: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * rendering/RenderLayerScrollableArea.cpp: Added. (WebCore::RenderLayerScrollableArea::RenderLayerScrollableArea): (WebCore::RenderLayerScrollableArea::~RenderLayerScrollableArea): (WebCore::RenderLayerScrollableArea::shouldPlaceBlockDirectionScrollbarOnLeft const): * rendering/RenderLayerScrollableArea.h: Added. 2020-12-30 Zalan Bujtas <zalan@apple.com> [Legacy Line Layout] Remove unnecessary 'vertical-align: middle' integral rounding https://bugs.webkit.org/show_bug.cgi?id=220198 Reviewed by Antti Koivisto. Let's not do "random" rounding for 'vertical-align: middle'. Fix it for all the alignment types by adjusting the logical top position when the inline box stretches the line. * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::computeLogicalBoxHeights): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::verticalPositionForBox): 2020-12-30 Simon Fraser <simon.fraser@apple.com> [LFC Display] Stacking item bounds were wrong in some cases https://bugs.webkit.org/show_bug.cgi?id=220201 Reviewed by Zalan Bujtas. Display::StackingItem were computed incorrectly for some content configurations, such as: - inline non-container box - inline container box with no children - positioned inline non-container box - positioned inline container box with no children - positioned block non-container box Fix by ensuring that when we create a StackingItem for a box with no children to descend into, we run the same geometry logic that happens for pushStateForBoxDescendants()/popState(). Also ensure that we call accountForBoxPaintingExtent() for leaf boxes without a stacking item. Test: fast/layoutformattingcontext/display/stacking-item-bounds.html * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::popState): (WebCore::Display::TreeBuilder::didAppendNonContainerStackingItem): (WebCore::Display::TreeBuilder::insertIntoTree): (WebCore::Display::TreeBuilder::buildInlineDisplayTree): (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree): * display/DisplayTreeBuilder.h: 2020-12-29 Simon Fraser <simon.fraser@apple.com> [LFC Display] Clean up display tree dumping https://bugs.webkit.org/show_bug.cgi?id=220195 Reviewed by Daniel Bates. Reduce redundant code in debugDescription() functions by having boxes report their box type. Improve the formatting of the tree dump. * display/DisplayTreeBuilder.cpp: (WebCore::Display::outputStackingTree): (WebCore::Display::displayTreeAsText): * display/css/DisplayBox.cpp: (WebCore::Display::Box::boxName const): (WebCore::Display::Box::debugDescription const): * display/css/DisplayBox.h: * display/css/DisplayBoxModelBox.cpp: (WebCore::Display::BoxModelBox::boxName const): (WebCore::Display::BoxModelBox::debugDescription const): * display/css/DisplayBoxModelBox.h: * display/css/DisplayContainerBox.cpp: (WebCore::Display::ContainerBox::boxName const): (WebCore::Display::ContainerBox::debugDescription const): Deleted. * display/css/DisplayContainerBox.h: * display/css/DisplayImageBox.cpp: (WebCore::Display::ImageBox::boxName const): (WebCore::Display::ImageBox::debugDescription const): * display/css/DisplayImageBox.h: * display/css/DisplayReplacedBox.cpp: (WebCore::Display::ReplacedBox::boxName const): * display/css/DisplayReplacedBox.h: * display/css/DisplayTextBox.cpp: (WebCore::Display::TextBox::boxName const): (WebCore::Display::TextBox::debugDescription const): * display/css/DisplayTextBox.h: 2020-12-29 Yusuke Suzuki <ysuzuki@apple.com> Fix compile error in non libressl WinCairo https://bugs.webkit.org/show_bug.cgi?id=220191 Reviewed by Don Olmstead. * platform/network/curl/CurlSSLVerifier.cpp: (WebCore::CurlSSLVerifier::CurlSSLVerifier): 2020-12-29 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Incorrectly positioned content with vertical-align: length/percentage https://bugs.webkit.org/show_bug.cgi?id=220193 Reviewed by Antti Koivisto. vertical-align: length/percentage is a baseline shift. Let's use the inline level box's baseline and not its height when adjusting the vertical position (css1/text_properties/vertical_align.html). * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::computeLineBoxHeightAndAlignInlineLevelBoxesVertically): 2020-12-28 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Add support for non-baseline aligned text painting https://bugs.webkit.org/show_bug.cgi?id=220185 Reviewed by Antti Koivisto. Use the run's vertical position to set the text origin (instead of using the line's baseline position). This is in preparation for enabling inline box content. (e.g. <div><span style="vertical-align: text-top">non-baseline aligned text</span></div>) * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::paint): 2020-12-27 Simon Fraser <simon.fraser@apple.com> Add a ReadMe.md for Source/WebCore/display Reviewed by Zalan Bujtas. * display/ReadMe.md: Added. 2020-12-27 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Inline box should start with a strut in standards mode https://bugs.webkit.org/show_bug.cgi?id=220160 Reviewed by Antti Koivisto. If the inline box contains no glyphs at all, or if it contains only glyphs from fallback fonts, it is considered to contain a “strut” (an invisible glyph of zero width) with the metrics of the box’s first available font. https://www.w3.org/TR/css-inline-3/#inline-height (css2.1/20110323/empty-inline-003.htm) * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): 2020-12-27 Sam Weinig <weinig@apple.com> Fix incorrect return types of fallback color conversion functions https://bugs.webkit.org/show_bug.cgi?id=220159 Reviewed by Dean Jackson. * platform/graphics/ColorConversion.h: Fixup return types of fallback conversion functions to match signature. 2020-12-27 Sam Weinig <weinig@apple.com> Generalize callWithColorType to work with either float or uint8_t color types https://bugs.webkit.org/show_bug.cgi?id=220155 Reviewed by Dean Jackson. * platform/graphics/ColorTypes.h: (WebCore::callWithColorType): Templatize the component type. 2020-12-27 Sam Weinig <weinig@apple.com> Remove one more place needed when adding new color types https://bugs.webkit.org/show_bug.cgi?id=220156 Reviewed by Simon Fraser. * platform/graphics/Color.h: (WebCore::Color::Color): Missed this in the last pass. Replace specific overloads with a conditional template function contructor. * platform/graphics/ColorTypes.h: Adds a few traits to help identify color types. 2020-12-26 Alexey Shvayka <shvaikalesh@gmail.com> [WebIDL] Remove [CustomToStringName] and Location-specific extended attributes https://bugs.webkit.org/show_bug.cgi?id=219276 Reviewed by Sam Weinig. This patch: a) Removes [CustomToStringName] and 3 related overrides, whose purpose was to ensure that Object.prototype.toString() returns "[object Object]" for cross-realm Location / WindowProxy objects, which is already accomplished via own unforgeable @@toStringTag property [1], making this change unobservable. b) Inlines putCommon() to avoid weird true => false returns and save an extra identifier creation / check in putByIndex(). This is also unobservable. c) Removes "toString" and "valueOf" special-casing from JSLocation::defineOwnProperty(), which failed silently instead of throwing a TypeError. Since these are own unforgeable properties of Location [2], ordinary [[DefineOwnProperty]] prevents their redefinition. d) Removes [CustomDefineOwnPropertyOnPrototype], [CustomPutOnPrototype], and corresponding overrides, whose purpose was to prevent definition of "toString" and "valueOf" properties on Location.prototype. Since these are own unforgeable properties of Location instances [2], the limitation doesn't make sense. Location.prototype is an ordinary object per spec. Both c) and d) align WebKit with the spec, Blink, and Gecko. [1]: https://html.spec.whatwg.org/multipage/browsers.html#crossoriginpropertyfallback-(-p-) [2]: https://html.spec.whatwg.org/multipage/history.html#the-location-interface (step 3) Tests: imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-non-configurable-toString-valueOf.html imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prototype-no-toString-valueOf.html * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::toStringName): Deleted. * bindings/js/JSLocationCustom.cpp: (WebCore::JSLocation::put): (WebCore::JSLocation::putByIndex): (WebCore::JSLocation::defineOwnProperty): (WebCore::putCommon): Deleted. (WebCore::JSLocation::toStringName): Deleted. (WebCore::JSLocationPrototype::put): Deleted. (WebCore::JSLocationPrototype::defineOwnProperty): Deleted. * bindings/js/JSRemoteDOMWindowCustom.cpp: (WebCore::JSRemoteDOMWindow::toStringName): Deleted. * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): (HeaderNeedsPrototypeDeclaration): * bindings/scripts/IDLAttributes.json: * page/DOMWindow.idl: * page/Location.idl: * page/RemoteDOMWindow.idl: 2020-12-26 Zalan Bujtas <zalan@apple.com> [LFC] Rect::expandToContain should call LayoutRect::uniteEvenIfEmpty https://bugs.webkit.org/show_bug.cgi?id=220153 Reviewed by Antti Koivisto. Multiline inline boxes should expand even when they start at the end of the line and are empty. e.g. <pre>this is the first line<span> and this is the second</span></pre> The <span>'s height = first line height (even though the <span> is empty on this line) + second line height. * layout/layouttree/LayoutGeometryRect.h: (WebCore::Layout::Rect::expandToContain): * platform/graphics/LayoutRect.cpp: (WebCore::LayoutRect::unite): (WebCore::LayoutRect::uniteEvenIfEmpty): copy from FloatRect. * platform/graphics/LayoutRect.h: (WebCore::LayoutRect::setLocationAndSizeFromEdges): copy from FloatRect. 2020-12-26 Simon Fraser <simon.fraser@apple.com> Fix scrolling issues when scrolling on only one axis is enabled https://bugs.webkit.org/show_bug.cgi?id=220134 Reviewed by Sam Weinig. If an overflow:scroll has overflow on an axis, but overflow:hidden on that axis, then there are various issues with finding the correct scroller and latching. This affects nested scrollers where inner and outer and scrollable on different axes, and the inner scroller has overflow, but overflow:hidden on the cross axis. The fix involves adding checks for scrolling being allowed in code that fetches pinned state, and code that looks for scrollable areas for a given event delta. Tests: fast/scrolling/mac/overflow-hidden-on-one-axis-async-overflow.html fast/scrolling/mac/overflow-hidden-on-one-axis.html * page/mac/EventHandlerMac.mm: (WebCore::findEnclosingScrollableContainer): * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::edgePinnedState const): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::isPinnedForScrollDeltaOnAxis const): * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::isPinnedForScrollDeltaOnAxis const): (WebCore::ScrollableArea::isPinnedForScrollDelta const): Check for non-zero deltas. isPinnedForScrollDeltaOnAxis() returns false if a delta is zero, so we don't want to say we're not pinned if a delta is zero. The logic of this code really needs to be inverted to talk about scrollability, not pinning. (WebCore::ScrollableArea::edgePinnedState const): 2020-12-26 Sam Weinig <weinig@apple.com> Simplify adding new color spaces to WebCore https://bugs.webkit.org/show_bug.cgi?id=220146 Reviewed by Dean Jackson. Reduce the number of places one needs to touch when adding new color types to: - ColorTypes.h - ColorConversion.h/cpp - ColorSpace.h/cpp (only needed if support in Color is required). - ColorSerialization.h (only needed if support in Color is required). - ColorSpaceCG.h/cpp (only needed if support in Color is required). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add ColorSpace.cpp, ColorSpaceCG.h and ColorSpaceCG.cpp. * platform/graphics/Color.cpp: * platform/graphics/Color.h: (WebCore::Color::Color): (WebCore::Color::setColor): Replace specific overloads of the contructor and setColor with template functions that do the same things. These are safe to make as if a non-supported color type (one that doesn't have a colorSpace member) is passed it will fail to compile due to use beneath ExtendedColor::create(). Also moves WTF::TextStream operator<< overload for ColorSpace out and into ColorSpace.cpp where it makes more sense. * platform/graphics/ColorConversion.cpp: * platform/graphics/ColorConversion.h: Re-order and explicitly comment conversion functions to be more clear. As the comment indicates, all color types must implement at least the following conversions: XYZA<float> toXYZA(const ColorType<float>&); ColorType<float> toColorType(const XYZA<float>&); This allows generic fallback code, inline at the bottom of the header, to support conversion to and from any set of colors. Additional conversion functions are useful for the cases where the optimal or base conversion is not through XYZ such as from SRGBA to LinearSRGBA. To allow this to work a few additional conversion functions were added which just combine existing conversions together and one was added for SRGBA to CMYKA which was missing, though currently unused. * platform/graphics/ColorSpace.cpp: Added. (WebCore::operator<<): * platform/graphics/ColorSpace.h: Moved from Color.h * platform/graphics/ColorTypes.h: (WebCore::callWithColorType): This is a generalization of ExtendedColor::callOnUnderlyingType() that also has the benefit of now being in the same file as the color type definitions, reducing the number of files people need to touch. * platform/graphics/ColorUtilities.h: (WebCore::colorByModifingEachNonAlphaComponent): Update to not assume that colors use the names red/green/blue for non-alpha components. This makes it work generically for all four component color types. * platform/graphics/ExtendedColor.h: (WebCore::ExtendedColor::callOnUnderlyingType const): Use generalized form, callWithColorType to avoid requiring modiftying this when new color types are added. * platform/graphics/cg/ColorCG.cpp: (WebCore::leakCGColor): When going to generalize this (we could have simply called `return CGColorCreate(cachedCGColorSpace(colorSpace), cgFloatComponents))` I noticed this was not doing the right thing for CG ports that don't support all the color spaces WebCore requires (such as Windows). For instance, displayP3ColorSpaceRef() just returns sRGBColorSpaceRef() on windows, meaning we would be taking some DisplayP3 components and having CG interpret them as sRGB. To avoid this, we now check if the color space returned is the fallback color space, sRGB, and do our own conversion to sRGB using ColorConversion before creating the color. This also resolves a long standing bug / FIXME around LinearRGB where we were using sRGBColorSpaceRef() for them. In practice, we don't actually ever create LinearRGB CGColorRefs right now, but if we ever do in the future, makes sense to use the right color space. * platform/graphics/cg/ColorSpaceCG.cpp: Added. (WebCore::sRGBColorSpaceRef): (WebCore::linearRGBColorSpaceRef): (WebCore::displayP3ColorSpaceRef): (WebCore::extendedSRGBColorSpaceRef): * platform/graphics/cg/ColorSpaceCG.h: Added. (WebCore::cachedCGColorSpace): * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::sRGBColorSpaceRef): Deleted. (WebCore::linearRGBColorSpaceRef): Deleted. (WebCore::extendedSRGBColorSpaceRef): Deleted. (WebCore::displayP3ColorSpaceRef): Deleted. * platform/graphics/cg/GraphicsContextCG.h: (WebCore::cachedCGColorSpace): Deleted. Moved color space specific CG code to its own files to make it more clear where to find them. 2020-12-26 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Set pre-computed inline box geometries (margin, border and padding) https://bugs.webkit.org/show_bug.cgi?id=220149 Reviewed by Antti Koivisto. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::updateInlineBoxDimensions): * layout/integration/LayoutIntegrationLineLayout.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutModernLines): 2020-12-26 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Remove redundant LineBox::inlineLevelBoxList() https://bugs.webkit.org/show_bug.cgi?id=220147 Reviewed by Antti Koivisto. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::inlineLevelBoxList const): Deleted. * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::computeLineLevelVisualAdjustmentsForRuns const): 2020-12-25 Andy Estes <aestes@apple.com> REGRESSION (r270662): SourceBufferParserWebM leaks CMSampleBufferRefs https://bugs.webkit.org/show_bug.cgi?id=220144 Reviewed by Anders Carlsson. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::VideoTrackData::createSampleBuffer): (WebCore::SourceBufferParserWebM::AudioTrackData::createSampleBuffer): Move the RetainPtr holding an adopted CMSampleBufferRef rather than leaking it when calling provideMediaData. 2020-12-25 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Use the pre-computed geometries for the inline level boxes https://bugs.webkit.org/show_bug.cgi?id=220135 <rdar://problem/72642850> Reviewed by Antti Koivisto. Let's skip the tree traversal and recomputing the box geometries in InlineFormattingContext::layoutInFlowContent. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::inlineReplacedContentHeightAndMargin const): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedContentWidthAndMargin): * layout/inlineformatting/InlineFormattingContext.h: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions): (WebCore::LayoutIntegration::LineLayout::updateLineBreakBoxDimensions): (WebCore::LayoutIntegration::LineLayout::layout): * layout/integration/LayoutIntegrationLineLayout.h: * layout/layouttree/LayoutReplacedBox.h: (WebCore::Layout::ReplacedBox::contentSizeForIntegration const): Deleted. (WebCore::Layout::ReplacedBox::setContentSizeForIntegration): Deleted. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutModernLines): 2020-12-25 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Fast vertical alignment should work with line-height https://bugs.webkit.org/show_bug.cgi?id=220131 Reviewed by Antti Koivisto. Adjust the line box height and the root inline box's logical top position as the layout bounds of the inline-block content stretches the line. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::LineBoxBuilder): (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): 2020-12-23 Simon Fraser <simon.fraser@apple.com> Clean up some code related to scroll pinning https://bugs.webkit.org/show_bug.cgi?id=220128 Reviewed by Sam Weinig. ScrollAnimatorMac and ScrollingTreeScrollingNodeDelegateMac share a lot of similar code related to being "pinned" to an edge for scrolling (i.e. already scrolled to an edge). There are too many functions implementing similar functionality in slightly different ways. Reduce this count by one by rewriting isAlreadyPinnedInDirectionOfGesture() and calling it from isPinnedForScrollDelta(). Rename bool pinnedInDirection() to isPinnedForScrollDelta(). Make use of wheelEvent.isGestureStart(). * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::isPinnedForScrollDeltaOnAxis const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::isPinnedForScrollDelta const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture const): Deleted. (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection const): Deleted. * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::isPinnedForScrollDeltaOnAxis const): (WebCore::ScrollableArea::isPinnedForScrollDelta const): (WebCore::ScrollableArea::isPinnedInBothDirections const): Deleted. (WebCore::ScrollableArea::isPinnedHorizontallyInDirection const): Deleted. (WebCore::ScrollableArea::isPinnedVerticallyInDirection const): Deleted. * platform/ScrollableArea.h: (WebCore::ScrollableArea::isHorizontalScrollerPinnedToMinimumPosition const): Deleted. (WebCore::ScrollableArea::isHorizontalScrollerPinnedToMaximumPosition const): Deleted. (WebCore::ScrollableArea::isVerticalScrollerPinnedToMinimumPosition const): Deleted. (WebCore::ScrollableArea::isVerticalScrollerPinnedToMaximumPosition const): Deleted. * platform/cocoa/ScrollController.h: * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): * platform/ios/ScrollAnimatorIOS.mm: (WebCore::ScrollAnimatorIOS::determineScrollableAreaForTouchSequence): * platform/mac/ScrollAnimatorMac.h: * platform/mac/ScrollAnimatorMac.mm: (WebCore::ScrollAnimatorMac::isPinnedForScrollDelta const): (WebCore::ScrollAnimatorMac::allowsVerticalStretching const): (WebCore::ScrollAnimatorMac::allowsHorizontalStretching const): (WebCore::ScrollAnimatorMac::pinnedInDirection const): Deleted. (WebCore::newGestureIsStarting): Deleted. (WebCore::ScrollAnimatorMac::isAlreadyPinnedInDirectionOfGesture const): Deleted. * platform/mock/ScrollAnimatorMock.h: 2020-12-23 Said Abou-Hallawa <said@apple.com> [GPU Process]: Don't call flushDrawingContext() in the middle of recording drawing commands https://bugs.webkit.org/show_bug.cgi?id=220126 Reviewed by Simon Fraser. Avoid calling flushDrawingContext() except when the drawing is finished and the backend of the ImageBuffer is about to be used. Rename flushDrawingContextAndCommit() to flushDrawingContextAsync(). The difference between flushDrawingContext() and flushDrawingContextAsync() is the former waits for the flush reply message. * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::prepareForDisplay): * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::flushDrawingContextAsync): (WebCore::ImageBuffer::flushDrawingContextAndCommit): Deleted. * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::drawImageBuffer): (WebCore::DisplayList::Recorder::didAppendItemOfType): Deleted. * platform/graphics/displaylists/DisplayListRecorder.h: (WebCore::DisplayList::Recorder::Delegate::willAppendItemOfType): (WebCore::DisplayList::Recorder::append): (WebCore::DisplayList::Recorder::Delegate::didAppendItemOfType): Deleted. 2020-12-23 Peng Liu <peng.liu6@apple.com> [Media in GPU Process][MSE] Clean up SourceBufferPrivateRemote and implement functions with new IPC messages https://bugs.webkit.org/show_bug.cgi?id=220122 Reviewed by Eric Carlson. Currently, `SourceBuffer` needs to get the `highestPresentationTimestamp` from `SourceBufferPrivate`, which is hard to implement synchronously when `SourceBufferPrivate` runs in a different process (e.g., GPU process). This patch makes `SourceBufferPrivate` push `highestPresentationTimestamp` to `SourceBuffer` when its value is changed. This patch also changes some functions of `SourceBufferPrivate` to virtual so that we can override them in `SourceBufferPrivateRemote`. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::highestPresentationTimestamp const): (WebCore::SourceBuffer::sourceBufferPrivateHighestPresentationTimestampChanged): * Modules/mediasource/SourceBuffer.h: * platform/graphics/SourceBufferPrivate.cpp: (WebCore::SourceBufferPrivate::updateHighestPresentationTimestamp): (WebCore::SourceBufferPrivate::removeCodedFrames): (WebCore::SourceBufferPrivate::didReceiveSample): (WebCore::SourceBufferPrivate::highestPresentationTimestamp const): Deleted. * platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::setMode): (WebCore::SourceBufferPrivate::setGroupStartTimestamp): (WebCore::SourceBufferPrivate::setGroupStartTimestampToEndTimestamp): (WebCore::SourceBufferPrivate::setShouldGenerateTimestamps): (WebCore::SourceBufferPrivate::startChangingType): (WebCore::SourceBufferPrivate::bufferFull const): (WebCore::SourceBufferPrivate::hasVideo const): (WebCore::SourceBufferPrivate::timestampOffset const): * platform/graphics/SourceBufferPrivateClient.h: 2020-12-23 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] Enable WebGL 2 https://bugs.webkit.org/show_bug.cgi?id=192314 Reviewed by Kenneth Russell. * platform/graphics/texmap/ANGLEContext.cpp: (WebCore::ANGLEContext::createContext): Added context attributes for WebGL by copying the code of GraphicsContextGLOpenGLCocoa.mm. 2020-12-23 Kate Cheney <katherine_cheney@apple.com> Can't login to Skype from Microsoft Outlook account in Safari https://bugs.webkit.org/show_bug.cgi?id=220106 <rdar://problem/72453487> Reviewed by Alex Christensen. This is a temporary quirk to assist a high-traffic website while they complete the large task of migrating away from logins using third party cookies. This quirk will be removed when the site is updated. No new tests, site-specific quirk. Create a quirk that will call the Storage Access API on behalf of Microsoft for skype.com under live.com. This patch also refactors existing quirks to avoid lots of duplicate code. * dom/DocumentStorageAccess.cpp: (WebCore::DocumentStorageAccess::requestStorageAccessQuirk): * page/Quirks.cpp: Condense the code which calls the Storage Access API and handles the click into one function Quirks::requestStorageAccessAndHandleClick. Call this function if the domain/element pair matches the check in Quirks::isStorageAccessQuirkDomainElementPair. (WebCore::isStorageAccessQuirkDomainElementPair): (WebCore::Quirks::requestStorageAccessAndHandleClick const): (WebCore::Quirks::mapToTopDomain): Moved from NetworkStorageSession and adjusted to check the host to distinguish login.live.com from outlook.live.com which should be treated differently. (WebCore::Quirks::triggerOptionalStorageAccessQuirk const): The BBC case can't be included in the same check as other domains with quirks because we need to create a pop-up and inject JavaScript based on the user's response. So we still need to check for the BBC domain separately. (WebCore::isMicrosoftLoginElement): Deleted. (WebCore::isMicrosoftDomain): Deleted. (WebCore::isPlaystationLoginElement): Deleted. * page/Quirks.h: * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::storageAccessQuirks): (WebCore::NetworkStorageSession::mapToTopDomain): Moved. * platform/network/NetworkStorageSession.h: 2020-12-23 Simon Fraser <simon.fraser@apple.com> REGRESSION: Scroll snapping triggers body scroll https://bugs.webkit.org/show_bug.cgi?id=220056 <rdar://problem/72595482> Reviewed by Wenson Hsieh. ScrollController::handleWheelEvent() needs to return true to indicate that it handled the event when it has been processed for scroll snap. If we don't do this, the latching code thinks that no node handled the event so the latch times out. Test: fast/scrolling/latching/scroll-snap-latching.html * platform/cocoa/ScrollController.h: * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): 2020-12-23 Simon Fraser <simon.fraser@apple.com> Standardize on "allows scrolling" terminology instead of asking about scrollbars https://bugs.webkit.org/show_bug.cgi?id=220111 Reviewed by Wenson Hsieh. Code variously used "canScrollHorizontally" and "hasEnabledHorizontalScrollbar". Standardize on "allowsHorizontalScrolling". This returns true both when there is overflow to scroll, and when style allows it (i.e. not overflow-x: hidden). This changes the name and dumping for ScrollableAreaParams so lots of test results change. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry): * page/scrolling/ScrollingCoordinator.cpp: (WebCore::operator<<): * page/scrolling/ScrollingCoordinatorTypes.h: (WebCore::ScrollableAreaParameters::operator== const): * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::eventCanScrollContents const): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/ScrollingTreeScrollingNodeDelegate.h: (WebCore::ScrollingTreeScrollingNodeDelegate::allowsHorizontalScrolling const): (WebCore::ScrollingTreeScrollingNodeDelegate::allowsVerticalScrolling const): (WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledHorizontalScrollbar const): Deleted. (WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledVerticalScrollbar const): Deleted. * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalScrolling const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalScrolling const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally const): Deleted. (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically const): Deleted. * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::allowsHorizontalScrolling const): (WebCore::ScrollableArea::allowsVerticalScrolling const): * platform/ScrollableArea.h: * platform/cocoa/ScrollController.h: * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::snapRubberBandTimerFired): * platform/mac/ScrollAnimatorMac.h: * platform/mac/ScrollAnimatorMac.mm: (WebCore::ScrollAnimatorMac::allowsHorizontalScrolling const): (WebCore::ScrollAnimatorMac::allowsVerticalScrolling const): (WebCore::ScrollAnimatorMac::canScrollHorizontally const): Deleted. (WebCore::ScrollAnimatorMac::canScrollVertically const): Deleted. * platform/mock/ScrollAnimatorMock.h: 2020-12-22 Dean Jackson <dino@apple.com> Use an enum class to identify WebGL versions https://bugs.webkit.org/show_bug.cgi?id=220099 <rdar://problem/72596828> Reviewed by Ken Russell. Rather than doing string comparisons multiple times, against values that have been deprecated, use an enum class to identify the version of WebGL that we are creating. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::getContext): (WebCore::HTMLCanvasElement::toWebGLVersion): (WebCore::HTMLCanvasElement::createContextWebGL): (WebCore::HTMLCanvasElement::getContextWebGL): * html/HTMLCanvasElement.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/GraphicsContextGLAttributes.h: New enum class. * platform/graphics/RemoteGraphicsContextGLProxyBase.cpp: (WebCore::RemoteGraphicsContextGLProxyBase::isGLES2Compliant const): * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::InitializeEGLDisplay): Add a logging statement as a drive-by. (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): 2020-12-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Use reserveInitialCapacity when applicable https://bugs.webkit.org/show_bug.cgi?id=220100 <rdar://problem/72598083> Reviewed by Simon Fraser. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): inlineItems size is a better approximation. (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::m_isConsideredEmpty): * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const): 2020-12-22 Rob Buis <rbuis@igalia.com> Support aspect-ratio on positioned elements https://bugs.webkit.org/show_bug.cgi?id=219741 Reviewed by Simon Fraser. Support aspect-ratio on positioned elements taking into account insets in the case where no width/height is specified. * rendering/RenderBox.cpp: (WebCore::RenderBox::computePositionedLogicalWidthUsing const): (WebCore::RenderBox::computePositionedLogicalHeightUsing const): (WebCore::RenderBox::shouldComputeLogicalHeightFromAspectRatio const): We should not compute the logical height if there is an implied height due to top/bottom. (WebCore::RenderBox::shouldComputeLogicalWidthFromAspectRatio const): (WebCore::RenderBox::shouldComputeLogicalWidthFromAspectRatioAndInsets const): Helper method to determine whether logical width can be computed from inset information in the case where no width/height are specified. (WebCore::RenderBox::computeLogicalWidthFromAspectRatio const): compute logical width from the computed logical height constriaining it by min max. * rendering/RenderBox.h: 2020-12-22 Youenn Fablet <youenn@apple.com> MediaStreamTrack.muted value should not change before the corresponding event is fired https://bugs.webkit.org/show_bug.cgi?id=220084 Reviewed by Eric Carlson. Before the patch, the muted value was changed and a task was queued to dispatch the corresponding event. During a period of time, the muted value was changed while the event was not fired. To fix this, dispatch a task that will change the value and dispatch the event. MediaStreamTrack is now storing the muted value instead of relying on its m_private muted value. The muted value is only used for JS as the rest of the code base expects to get the actual muted value. Test: fast/mediastream/media-stream-track-muted-event.html * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::MediaStreamTrack): (WebCore::MediaStreamTrack::mutedForBindings const): (WebCore::MediaStreamTrack::trackMutedChanged): * Modules/mediastream/MediaStreamTrack.h: * Modules/mediastream/MediaStreamTrack.idl: 2020-12-22 Kate Cheney <katherine_cheney@apple.com> Cannot see 'Add to my stations' button in BBC World service Radio https://bugs.webkit.org/show_bug.cgi?id=219949 <rdar://problem/60319532> Reviewed by Alex Christensen. This is a temporary quirk to assist a high-traffic website while they complete the large task of migrating away from site compatibility using third party cookies. This quirk will be removed when the site is updated. No new tests, site-specific quirk. Create a quirk that will call the Storage Access API on behalf of BBC for radioplayer.co.uk under bbc.co.uk. When the user clicks to open the radio player pop-up, storage access is requested. If the user grants permission, then we open the pop-up to static.radioplayer.co.uk to get first party status, then immediately redirect to the radio player page. This changes the language of the site-specific quirk code in NetworkStorageSession now that we are creating quirks for instances other than login cases. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::responseReceived): * page/DOMWindow.cpp: (WebCore::DOMWindow::open): Even if WebKit cancels the pop-up click in Element::dispatchMouseEvent, the popup still appears. So we should check here if the pop-up is trying to load before storage access has been granted. If so, we should cancel it and wait for the quirk to re-open the pop-up after prompting the user. Also adds a null frame check. * page/Quirks.cpp: (WebCore::isBBCDomain): (WebCore::isBBCPopOutPlayerElement): (WebCore::Quirks::BBCRadioPlayerURLString): (WebCore::Quirks::staticRadioPlayerURLString): (WebCore::Quirks::triggerOptionalStorageAccessQuirk const): * page/Quirks.h: This is where we check if the pop-up button has been clicked and prompt for storage access if needed. If the user grants storage access, we should open a popup to static.radioplayer.co.uk so it gets marked as first party, then inject script to redirect to the correct BBC radio player page. * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::storageAccessQuirks): (WebCore::NetworkStorageSession::loginDomainMatchesRequestingDomain): (WebCore::NetworkStorageSession::canRequestStorageAccessForLoginOrCompatibilityPurposesWithoutPriorUserInteraction): (WebCore::NetworkStorageSession::subDomainInNeedOfStorageAccessForFirstParty): (WebCore::NetworkStorageSession::canRequestStorageAccessForLoginPurposesWithoutPriorUserInteraction): Deleted. (WebCore::NetworkStorageSession::loginDomainForFirstParty): Deleted. * platform/network/NetworkStorageSession.h: Change wording now that quirks are not only being used for login flows. 2020-12-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add fast path for the most common "inline level box is the child of the root inline box" case https://bugs.webkit.org/show_bug.cgi?id=220089 <rdar://problem/72590141> Reviewed by Simon Fraser. * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::addLineRun): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::logicalMarginRectForInlineLevelBox const): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::inlineLevelBoxList const): (WebCore::Layout::LineBox::containsInlineLevelBox const): Deleted. 2020-12-22 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, fix the build with recent SDKs. * platform/cocoa/DragImageCocoa.mm: (WebCore::createDragImageIconForCachedImageFilename): * platform/graphics/mac/IconMac.mm: (WebCore::Icon::createIconForFileExtension): (WebCore::Icon::createIconForUTI): * platform/mac/LocalDefaultSystemAppearance.mm: (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance): * platform/mac/ScrollAnimatorMac.mm: (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): (WebCore::ScrollAnimatorMac::contentAreaWillPaint const): * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::paintScrollCorner): * platform/mac/ThemeMac.mm: (WebCore::paintStepper): (WebCore::ThemeMac::ensuredView): (WebCore::ThemeMac::supportsLargeFormControls): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintProgressBar): (WebCore::createAttachmentPlaceholderImage): 2020-12-22 Philippe Normand <pnormand@igalia.com> REGRESSION(r270612) [GStreamer][MSE] Some play/seek related failures https://bugs.webkit.org/show_bug.cgi?id=219822 Reviewed by Xabier Rodriguez-Calvar. Call appendComplete which internally synchronizes the TrackBuffer buffered ranges and calls m_client->sourceBufferPrivateAppendComplete(). * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples): (WebCore::SourceBufferPrivateGStreamer::appendParsingFailed): 2020-12-22 Antti Koivisto <antti@apple.com> [LFC][Integration] Invalidate line layout path for children of inlines https://bugs.webkit.org/show_bug.cgi?id=219639 Reviewed by Zalan Bujtas. We currently assume you can just invalidate the direct parent. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::blockContainer): (WebCore::LayoutIntegration::LineLayout::containing): * layout/integration/LayoutIntegrationLineLayout.h: * rendering/RenderObject.cpp: (WebCore::RenderObject::insertedIntoTree): (WebCore::RenderObject::willBeRemovedFromTree): Invalidate here. * rendering/RenderText.cpp: (WebCore::RenderText::setText): * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::attachToRenderElementInternal): * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation): (WebCore::RenderTreeBuilder::Block::detach): 2020-12-22 Simon Fraser <simon.fraser@apple.com> Sibling element wheel event regions can be wrong https://bugs.webkit.org/show_bug.cgi?id=220071 <rdar://problem/72435466> Reviewed by Daniel Bates. RenderStyle contains eventListenerRegionTypes() data which derive from registered wheel event handlers, so style sharing needs to avoid sharing style between elements with different handlers. For now, just disable style sharing for any elements which event handlers. Test: fast/scrolling/mac/wheel-event-listener-region-siblings.html * style/StyleSharingResolver.cpp: (WebCore::Style::SharingResolver::canShareStyleWithElement const): 2020-12-22 Simon Fraser <simon.fraser@apple.com> Layout overflow is computed incorrectly inside flexbox (breaks sticky positioning) https://bugs.webkit.org/show_bug.cgi?id=220075 <rdar://problem/70956639> Reviewed by Zalan Bujtas. RenderBlock::endAndCommitUpdateScrollInfoAfterLayoutTransaction(), which is only called by grid and flexbox layout, would unconditionally clear layout overflow on boxes with overflow clipping, which resulted in incorrect sticky positioning because RenderBoxModelObject::computeStickyPositionConstraints() consults layout overflow. It was only through happenstance that overflow:scroll worked correctly, relying on the fact that updateScrollInfoAfterLayout() would trigger caching of scroll dimensions on RenderLayer. This clearing was added in r151360 but seems incorrect; layout overflow should be preserved after layout. Test: fast/flexbox/preserve-layout-overflow.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::endAndCommitUpdateScrollInfoAfterLayoutTransaction): 2020-12-22 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Compute enclosing top and bottom while constructing the inline runs https://bugs.webkit.org/show_bug.cgi?id=220064 <rdar://problem/72556810> Reviewed by Antti Koivisto. Let's pre-compute the enclosing top and bottom coordinates while constructing the line runs. (This saves a loop on the inline level boxes while constructing the lines at InlineContentBuilder::createDisplayLines) * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineLineGeometry.h: (WebCore::Layout::InlineLineGeometry::enclosingTopAndBottom const): (WebCore::Layout::InlineLineGeometry::InlineLineGeometry): * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const): * layout/integration/LayoutIntegrationLine.h: (WebCore::LayoutIntegration::Line::Line): (WebCore::LayoutIntegration::Line::enclosingContentTop const): (WebCore::LayoutIntegration::Line::enclosingContentBottom const): * layout/integration/LayoutIntegrationPagination.cpp: (WebCore::LayoutIntegration::makeAdjustedContent): 2020-12-22 Youenn Fablet <youenn@apple.com> [iOS] Do extensive search for microphone devices when trying to capture https://bugs.webkit.org/show_bug.cgi?id=220010 <rdar://problem/72036034> Reviewed by Eric Carlson. It is not possible to discover some audio input devices without an active audio session, so WebKit allocates an auxiliary audio session when it needs to build a list of audio capture devices. The full list of devices is only needed when evaluating getUserMedia audio constraints, or for enumerateDevices *after* capture is active (we return a truncated list before capture is active), so don't activate the session until we need to validate audio constraints or after the user gives permission to capture. Manually tested on device with built-in, BT, and USB audio inputs. * platform/mediastream/RealtimeMediaSourceFactory.h: (WebCore::AudioCaptureFactory::addExtensiveObserver): (WebCore::AudioCaptureFactory::removeExtensiveObserver): * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h: * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): (WebCore::AVAudioSessionCaptureDeviceManager::enableAllDevicesQuery): (WebCore::AVAudioSessionCaptureDeviceManager::disableAllDevicesQuery): * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h: * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: (WebCore::CoreAudioCaptureSourceFactoryIOS::addExtensiveObserver): (WebCore::CoreAudioCaptureSourceFactoryIOS::removeExtensiveObserver): (WebCore::CoreAudioCaptureSourceFactoryIOS::createAudioCaptureSource): In UIProcess, UserMediaPermissionRequestManagerProxy makes sure to enable the extensive audio device query. In WebProcess, we also need this when starting the audio capture. We enable it when there is no observer to handle the WebProcess side. * platform/mediastream/mac/CoreAudioCaptureSource.h: (WebCore::CoreAudioCaptureSourceFactory::createAudioCaptureSource): 2020-12-21 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Reserve both the line and the run vector sizes https://bugs.webkit.org/show_bug.cgi?id=220068 <rdar://problem/72560573> Reviewed by Simon Fraser. We actually know how many entries these vectors will have (in case of no-bidi content). * layout/integration/LayoutIntegrationInlineContent.h: * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const): 2020-12-21 Chris Dumez <cdumez@apple.com> Simplify CARingBuffer usage with SharedMemory storage https://bugs.webkit.org/show_bug.cgi?id=220047 Reviewed by Geoff Garen. Simplify CARingBuffer usage with SharedMemory storage: 1. There are now 2 storage types: - ReadOnlySharedRingBufferStorage: Used by the reader - SharedRingBufferStorage: Used by the writer One type inherits the other. This allows the API to be a bit clearer and we can drop the m_readyOnly flag. 2. Drop SharedRingBufferStorage::updateReadOnlyStorage() function. Instead, the reader can now construct a new ReadOnlySharedRingBufferStorage directly of the SharedMemory handle and pass it to the CARingBuffer constructor. * platform/audio/cocoa/CARingBuffer.cpp: (WebCore::CARingBuffer::CARingBuffer): * platform/audio/cocoa/CARingBuffer.h: 2020-12-21 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r270939 and r270952. Caused layout test timeouts on internal bots Reverted changesets: "[Cocoa] WebM format reader doesn't work with a url in a <source> element" https://bugs.webkit.org/show_bug.cgi?id=219961 https://trac.webkit.org/changeset/270939 "[Cocoa] WebM format reader doesn't work with a url in a <source> element" https://bugs.webkit.org/show_bug.cgi?id=219961 https://trac.webkit.org/changeset/270952 2020-12-21 Wenson Hsieh <wenson_hsieh@apple.com> Many websites crash under toDataURL() when enabling GPU process for DOM https://bugs.webkit.org/show_bug.cgi?id=220051 <rdar://problem/72412509> Reviewed by Simon Fraser. See WebKit ChangeLog for more details. * platform/graphics/ImageBufferBackend.h: Add traits for the PreserveResolution enum flag, so that it can be encoded over IPC. 2020-12-21 Megan Gardner <megan_gardner@apple.com> Copy Localizable.strings file into the correct directory https://bugs.webkit.org/show_bug.cgi?id=220029 rdar://72167601 Reviewed by Alex Christensen. After the changes in r269865, r269873, r269915, r269932, r269937 the localizable.strings was not showing up in the right place in the production build to allow it to be correctly localized. This skips the step of putting it in DerivedSources and just puts the concatenated file in the final correct directory so we do not have to relay on Xcode build doing the correct thing for us. * WebCore.xcodeproj/project.pbxproj: 2020-12-21 Alicia Boya García <aboya@igalia.com> [MSE] Fix allSamplesInTrackEnqueued() handling https://bugs.webkit.org/show_bug.cgi?id=220055 Reviewed by Philippe Normand. Within the changes introduced by r270612 a spurious call to allSamplesInTrackEnqueued() was added to provideMediaData(). provideMediaData() is called every time there may be new samples that need to be enqueued into the playback pipeline. allSamplesInTrackEnqueued() is supposed to be called when MediaSource.endOfStream() has been called and all pending samples have been enqueued, therefore signaling the playback pipeline that no more samples will be added. Some decoders need to be notified of this condition in order to move the last samples in their queue downstream. This is true at least of the avdec (ffmpeg) decoders that are commonly used in desktop versions of the GStreamer port. Calling allSamplesInTrackEnqueued() prematurely will mess with the playback as the code will not accept any more samples, a serious problem. This patch fixes it by removing the spurious call and restoring its original purpose when it was introduced in r230909. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::streamEndedWithError): (WebCore::MediaSource::openIfInEndedState): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::setMediaSourceEnded): (WebCore::SourceBuffer::trySignalAllSamplesEnqueued): Deleted. * Modules/mediasource/SourceBuffer.h: * platform/graphics/SourceBufferPrivate.cpp: (WebCore::SourceBufferPrivate::setMediaSourceEnded): (WebCore::SourceBufferPrivate::trySignalAllSamplesInTrackEnqueued): (WebCore::SourceBufferPrivate::provideMediaData): * platform/graphics/SourceBufferPrivate.h: 2020-12-21 Aditya Keerthi <akeerthi@apple.com> REGRESSION (r262729): Poor contrast for specific color/background combinations on disabled input fields https://bugs.webkit.org/show_bug.cgi?id=219991 <rdar://problem/70522921> Reviewed by Sam Weinig. The text color for disabled input fields is adjusted based on any specified color and background-color rules. r262729 modified the adjustment logic to use the contrastRatio utility function to determine illegibility issues due to contrast, rather than a differenceSquared computation. In both cases if the computed value is less than a minimum constrast value, the original text color is preserved. As a part of the change, the minimum contrast value was set to 1.1, a value chosen in order to maintain the appearance of fast/forms/input-disabled-color.html. However, the constrast value 1.1 results in combination of "color #acacac" and "background-color: #f2f2f2" producing white text on a light gray background, which is illegible. Previously, this color combination did not result in any change to the text color. In order to fix, increase the minimum color constrast to 1.195, which accounts for the failing combination. Note that this increase to the minimum value prevents some existing text color adjustments from being performed. This is evidenced by the need to rebaseline fast/forms/input-disabled-color.html after increasing the constrast. However, the new text colors are subjectively more legible, which is the reason why we have a minimum color constrast value. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::disabledTextColor const): 2020-12-20 Simon Fraser <simon.fraser@apple.com> Rename FrameView::sendResizeEventIfNeeded() to scheduleResizeEventIfNeeded() https://bugs.webkit.org/show_bug.cgi?id=220050 Reviewed by Ryosuke Niwa. FrameView::sendResizeEventIfNeeded() only schedules events, it does not send them, so rename accordingly. Also fix some logging. * dom/Document.cpp: (WebCore::Document::runResizeSteps): (WebCore::Document::runScrollSteps): * page/FrameView.cpp: (WebCore::FrameView::performPostLayoutTasks): (WebCore::FrameView::scheduleResizeEventIfNeeded): (WebCore::FrameView::setCustomSizeForResizeEvent): (WebCore::FrameView::sendResizeEventIfNeeded): Deleted. * page/FrameView.h: 2020-12-20 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] Unreviewed typo fix of r271015 https://bugs.webkit.org/show_bug.cgi?id=220000 <rdar://problem/72531245> Reviewed by Kenneth Russell. * platform/graphics/win/PlatformDisplayWin.cpp: (WebCore::PlatformDisplayWin::initializeEGLDisplay): Fixed a typo 'attributs'. 2020-12-20 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo][WebGL] webgl/1.0.3/conformance/misc/uninitialized-test.html is failing only for Debug builds https://bugs.webkit.org/show_bug.cgi?id=220000 Reviewed by Kenneth Russell. Some WebGL tests were failing only in debug builds. Those test cases expect black transparent for uninitialized buffers. ANGLE enables debug layers as default only for debug builds. And it fills uninitialized buffers with kDebugColorInitClearValue instead of black transparent. Create a PlatformDisplay with explicitly disabling debug layers by using EGL_PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED_ANGLE. * PlatformWinCairo.cmake: * platform/graphics/win/PlatformDisplayWin.cpp: Added. (WebCore::PlatformDisplayWin::initializeEGLDisplay): * platform/graphics/win/PlatformDisplayWin.h: 2020-12-20 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Let's create the run and update the box geometry in one go for atomic inline level boxes https://bugs.webkit.org/show_bug.cgi?id=220045 Reviewed by Antti Koivisto. Let's not run the "same" loop twice on atomic inline level boxes (first when we create the line run and the second time we we update the associated the box geometry). Unfortunately we still have to run a second pass on the inline boxes (e.g <span>) as they behave as containers (there's room for improvement here too). * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::addInlineLevelBox): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::hasInlineBox const): 2020-12-20 Rob Buis <rbuis@igalia.com> Convert remaining FrameLoaderType enums to enum classes https://bugs.webkit.org/show_bug.cgi?id=219898 Reviewed by Sam Weinig. Convert remaining FrameLoaderType enums to enum classes. Not converted is ShouldReplaceDocumentIfJavaScriptURL since it should be removed eventually. * dom/Document.cpp: (WebCore::Document::open): * history/BackForwardCache.cpp: (WebCore::canCacheFrame): (WebCore::firePageHideEventRecursively): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::stopLoading): (WebCore::DocumentLoader::isLoadingInAPISense const): * loader/FrameLoader.cpp: (WebCore::FrameLoader::FrameLoader): (WebCore::FrameLoader::initForSynthesizedDocument): (WebCore::FrameLoader::stopLoading): (WebCore::FrameLoader::closeURL): (WebCore::FrameLoader::setupForReplace): (WebCore::FrameLoader::stopAllLoaders): (WebCore::FrameLoader::activeDocumentLoader const): (WebCore::FrameLoader::setState): (WebCore::FrameLoader::clearProvisionalLoad): (WebCore::FrameLoader::transitionToCommitted): (WebCore::FrameLoader::checkLoadCompleteForThisFrame): (WebCore::FrameLoader::detachFromParent): (WebCore::FrameLoader::receivedMainResourceError): (WebCore::FrameLoader::dispatchUnloadEvents): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad): (WebCore::FrameLoader::shouldSuppressTextInputFromEditing const): * loader/FrameLoader.h: * loader/FrameLoaderTypes.h: * loader/NavigationScheduler.cpp: (WebCore::NavigationScheduler::schedule): * loader/SubframeLoader.cpp: (WebCore::FrameLoader::SubframeLoader::loadSubframe): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): * page/FrameView.cpp: (WebCore::FrameView::shouldSuspendScrollAnimations const): 2020-12-20 Zalan Bujtas <zalan@apple.com> [LFC] Move content height logic to the formatting contexts. https://bugs.webkit.org/show_bug.cgi?id=220040 Reviewed by Simon Fraser. Formatting contexts know about their content height. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::geometryForBox const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::usedContentHeight const): * layout/blockformatting/BlockFormattingContext.h: * layout/flexformatting/FlexFormattingContext.cpp: (WebCore::Layout::FlexFormattingContext::usedContentHeight const): * layout/flexformatting/FlexFormattingContext.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::usedContentHeight const): * layout/inlineformatting/InlineFormattingContext.h: * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::usedContentHeight const): * layout/tableformatting/TableFormattingContext.h: * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const): 2020-12-19 Rob Buis <rbuis@igalia.com> Move FrameLoader::arePluginsEnabled to Frame https://bugs.webkit.org/show_bug.cgi?id=220022 Reviewed by Sam Weinig. The arePluginsEnabled functionality is not tied to FrameLoader, so move it to Frame to save some indirections. * dom/DOMImplementation.cpp: (WebCore::DOMImplementation::createDocument): * html/HTMLElement.cpp: (WebCore::HTMLElement::rendererIsEverNeeded): * loader/FrameLoader.cpp: (WebCore::FrameLoader::arePluginsEnabled): Deleted. * loader/FrameLoader.h: * loader/SubframeLoader.cpp: (WebCore::FrameLoader::SubframeLoader::requestPlugin): * page/Frame.cpp: (WebCore::Frame::arePluginsEnabled): * page/Frame.h: 2020-12-19 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Remove redundant InlineContent::InlineBox https://bugs.webkit.org/show_bug.cgi?id=220042 <rdar://problem/72511784> Reviewed by Simon Fraser. This is not used anymore since we've decided to turn everything into a run for integration. * layout/integration/LayoutIntegrationInlineContent.h: (WebCore::LayoutIntegration::InlineContent::shrinkToFit): (WebCore::LayoutIntegration::InlineContent::InlineBox::InlineBox): Deleted. (WebCore::LayoutIntegration::InlineContent::InlineBox::layoutBox const): Deleted. (WebCore::LayoutIntegration::InlineContent::InlineBox::lineIndex const): Deleted. (WebCore::LayoutIntegration::InlineContent::InlineBox::rect const): Deleted. * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::build const): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayInlineBoxes const): Deleted. * layout/integration/LayoutIntegrationInlineContentBuilder.h: 2020-12-19 Zalan Bujtas <zalan@apple.com> width: max-content with box-sizing: border-box should leave space for padding (Twitter date hover overflow) https://bugs.webkit.org/show_bug.cgi?id=219687 <rdar://problem/72137685> Reviewed by Antti Koivisto. Non-quantitative values such as auto and min-content are not influenced by the box-sizing property. See http:://www.w3.org/TR/css-sizing-3/#box-sizing (adjustContentBoxLogicalWidthFor* now needs the property type too) * rendering/RenderBlock.cpp: (WebCore::RenderBlock::computePreferredLogicalWidths): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths const): * rendering/RenderBox.cpp: (WebCore::RenderBox::adjustContentBoxLogicalWidthForBoxSizing const): (WebCore::RenderBox::computeReplacedLogicalWidthUsing const): (WebCore::RenderBox::computePositionedLogicalWidthUsing const): * rendering/RenderBox.h: (WebCore::RenderBox::adjustContentBoxLogicalWidthForBoxSizing const): * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::computePreferredLogicalWidths): * rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::computePreferredLogicalWidths): * rendering/RenderFragmentContainer.cpp: (WebCore::RenderFragmentContainer::computePreferredLogicalWidths): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::computeAutoRepeatTracksCount const): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::computePreferredLogicalWidths): * rendering/RenderMenuList.cpp: (RenderMenuList::computePreferredLogicalWidths): * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::computePreferredLogicalWidths): * rendering/RenderSlider.cpp: (WebCore::RenderSlider::computePreferredLogicalWidths): * rendering/RenderTable.cpp: (WebCore::RenderTable::computePreferredLogicalWidths): * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::computePreferredLogicalWidths): 2020-12-19 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add fast path vertical alignment for non-stretchy, baseline aligned atomic inline level boxes https://bugs.webkit.org/show_bug.cgi?id=219962 Reviewed by Antti Koivisto. Let's estimate the logical top of simple atomic inline level boxes while they are being constructed. It helps to avoid the rather expensive three-pass vertical alignment code (see computeLineBoxHeightAndAlignInlineLevelBoxesVertically) when the line has nothing but such simple boxes. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::LineBoxBuilder): (WebCore::Layout::LineBoxBuilder::build): (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): (WebCore::Layout::LineBoxBuilder::computeLineBoxHeightAndAlignInlineLevelBoxesVertically): (WebCore::Layout::LineBoxBuilder::computeLineBoxHeightAndalignInlineLevelBoxesVertically): Deleted. 2020-12-18 Kate Cheney <katherine_cheney@apple.com> Login flows on sites with ITP quirks no longer work with ITP disabled https://bugs.webkit.org/show_bug.cgi?id=220019 <rdar://problem/72472858> Reviewed by Darin Adler. We should add a check for ITP enabled before attempting to apply quirks, otherwise the quirks will commandeer the login process, fail (because no ITP), and thus result in an inability to login when ITP is disabled. No new tests, this will fix login flows on sites with ITP quirks when ITP is turned off. I confirmed these cases manually. * page/Quirks.cpp: (WebCore::Quirks::triggerOptionalStorageAccessQuirk const): 2020-12-18 Zalan Bujtas <zalan@apple.com> Line snapping fails when the content is taller than the page. https://bugs.webkit.org/show_bug.cgi?id=220020 <rdar://problem/68761119> Reviewed by Antti Koivisto. When the snapped position of the current line falls off of the page, we call lineSnapAdjustment() recursively to figure out the snapped position on the next page. We usually find the final position on the next page mostly slightly below the logical top. However when the line is taller than the page itself, it does not fit the next page or any of the following pages (assuming uniform page height). Let the line overflow when the pages can't accommodate it. * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::lineSnapAdjustment const): 2020-12-18 Dean Jackson <dino@apple.com> Use EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE now it is in the build https://bugs.webkit.org/show_bug.cgi?id=219968 <rdar://problem/72405724> Reviewed by Darin Adler. * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::InitializeEGLDisplay): Use the named value. 2020-12-18 Peng Liu <peng.liu6@apple.com> [Media in GPU Process][MSE] SourceBufferPrivateRemote needs to override some track buffer related functions of SourceBufferPrivate https://bugs.webkit.org/show_bug.cgi?id=219998 Reviewed by Jer Noble. No new tests, fix layout test failures. * platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::setTimestampOffset): (WebCore::SourceBufferPrivate::setAppendWindowStart): (WebCore::SourceBufferPrivate::setAppendWindowEnd): (WebCore::SourceBufferPrivate::hasVideo const): (WebCore::SourceBufferPrivate::timestampOffset const): Change these functions to virtual because `SourceBufferPrivateRemote` needs to override them. 2020-12-18 Sihui Liu <sihui_liu@apple.com> SpeechRecognitionRemoteRealtimeMediaSourceManager should not issue sandbox extension for mocked devices https://bugs.webkit.org/show_bug.cgi?id=219972 Reviewed by Eric Carlson. * platform/mediastream/CaptureDevice.h: (WebCore::CaptureDevice::isMockDevice const): Add a member in CaptureDevice to indicate if it's mocked device. (WebCore::CaptureDevice::setIsMockDevice): (WebCore::CaptureDevice::encode const): (WebCore::CaptureDevice::decode): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::toCaptureDevice): 2020-12-18 Julian Gonzalez <julian_a_gonzalez@apple.com> Crash in DOMSelection::getRangeAt() https://bugs.webkit.org/show_bug.cgi?id=219804 Reviewed by Darin Adler. Add a check in HTMLTextFormControlElement::setSelectionRange() that ensures we do not try to move the frame's selection if the HTMLTextFormControlElement is no longer connected. * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setSelectionRange): 2020-12-18 Megan Gardner <megan_gardner@apple.com> Gate all of the code associated with app highlights https://bugs.webkit.org/show_bug.cgi?id=220003 <rdar://problem/72451893> Reviewed by Tim Horton. Only gating code, no new tests needed. * Modules/highlight/AppHighlightListData.cpp: * Modules/highlight/AppHighlightListData.h: * Modules/highlight/AppHighlightStorage.cpp: * Modules/highlight/AppHighlightStorage.h: * Modules/highlight/HighlightRegister.cpp: * Modules/highlight/HighlightRegister.h: * dom/Document.cpp: (WebCore::Document::commonTeardown): (WebCore::Document::updateHighlightPositions): * dom/Document.h: * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): (WebCore::ContextMenuController::populate): (WebCore::ContextMenuController::checkOrEnableIfNeeded const): * platform/ContextMenuItem.cpp: (WebCore::isValidContextMenuAction): * platform/ContextMenuItem.h: * platform/LocalizedStrings.h: * platform/cocoa/LocalizedStringsCocoa.mm: * rendering/RenderTheme.h: 2020-12-18 Lauro Moura <lmoura@igalia.com> [WPE] Unreviewed buildfix after r270964 * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp: 2020-12-18 Yusuke Suzuki <ysuzuki@apple.com> [CSSJIT] Do not use trampoline if JITCage is disabled https://bugs.webkit.org/show_bug.cgi?id=220004 Reviewed by Tadeu Zagallo. This trampoline is not necessary if JITCage is not enabled. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::compile): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateReturn): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker): * cssjit/SelectorCompiler.h: (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorChecker): (WebCore::SelectorCompiler::querySelectorSimpleSelectorChecker): (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerWithCheckingContext): (WebCore::SelectorCompiler::querySelectorSelectorCheckerWithCheckingContext): 2020-12-17 Kimmo Kinnunen <kkinnunen@apple.com> REGRESSION (r268386): Snapshots of WebGL content in the tab picker don't work (black map on Google Maps) https://bugs.webkit.org/show_bug.cgi?id=219946 <rdar://problem/72013784> Reviewed by Dean Jackson. Fix case where WebGL would first be displayed with hardware code path and then displayed with software code path (painting from the paint tree). Former happens when user looks at the page and latter happens when printing or when Safari takes a snapshot. This is not a real regression of r268386. Prior to that, the software display would have used uninitialized IOSurface contents or contents of 1-2 frames prior and would leave the hardware display buffer not updated. CanvasRenderingContext::paintRenderingResultsToCanvas() is used for two purposes: 1) Image extraction uses, such as toData() or constructing an Image out of the contents. 2) Painting the rendering to the document during software display. The 1) case uses always the drawing buffer. The 2) case presents the drawing buffer as the new display buffer if there are changes to the drawing buffer and uses the potentially new display buffer to display. For 2D canvas, these two cases are the same case. For WebGL they are different. The display is destructive for WebGL drawing buffer when preserveDrawingBuffer == false. This means that if hardware display has happened, we must read the display buffer during case 2. This code was missing, so the scenario could not have ever worked. The previous code tried to workaround this by the WebGLGraphicsContextBase to detect what the owner intended with the paintRenderingResultsToCanvas, then skip the potential drawing buffer clear, read the drawing buffer and put that data to the "presentation copy" of the HTMLElement. This is not ok, as the uncleared drawing buffer has non-deterministic contents in case the context has displayed and the client has not drawn new content to the drawing buffer. Fix by removing the "presentation copy" of the HTMLCanvas. The presentation image can always be drawn to the CanvasBase::buffer(): - The current contents of the buffer is the presentation image if the context has not changed since updating the buffer with either drawing buffer or previous display buffer. - If the context has changed, we must present and put the new display buffer to the CanvasBase::buffer() - This is also correct contents for the potential next image extraction uses, up to a point when context changes. - If the context changes before an image extraction use, CanvasBase::buffer() is updated with the normal logic, the same as what happens when CanvasBase::buffer() is updated between two image extraction uses. Prior to this, there was an unneeded and incorrectly implemented GPUCanvasContext::markLayerComposited(). The sequence would be: HTMLCanvasElement::paint(): canvasContext().paintRenderingResultsToCanvas(buffer()); context().drawImageBuffer(buffer()); canvasContext().markLayerComposited(); The markLayerComposited() would incorrectly mark the WebGL context compositing being done, but there was no compositing actually happening. The GPU-side display buffer would be incorrect. Also, there is nothing to be done at this stage, as the compositing of WebGL context itself is already finished at WebGL context paintRenderingResultsToCanvas() return. Instead, add CanvasRenderingContext::prepareForDisplayWithPaint() which signals that next paintRenderingResultsToCanvas() is a display operation. This can be used to to detect the paintRenderingResultsToCanvas() in which we must present the drawing buffer as display buffer. Implement the display buffer read with OpenGL. Refactor the drawing buffer read code to be able to reuse the read code for the display buffer read. The refactored code reduces redundant the allocations of full-screen malloc buffers and ensures allocation results are checked instead of crashing with nullptr derefs when OOM happens. Fixes errors such as rdar://67553531 (CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::GraphicsContextGLOpenGL::paintRenderingResultsToCanvas). Removes RGBA->BGRA->RGBA conversions from GraphicsContextGLOpenGL::paintRenderingResultsToImageData(). Removes manual alpha premultiplication and makes CG draw with unpremultiplied alpha. Changes Cairo variant of GraphicsContextGLOpenGL to convert manually RGBA->BGRA instead of (big) OpenGL driver doing it in case of non-NVIDIA platforms. No new tests, the snapshot / sw+hw drawing is not testable at the moment. * Modules/webgpu/GPUCanvasContext.cpp: (WebCore::GPUCanvasContext::configureSwapChain): (WebCore::GPUCanvasContext::prepareForDisplayWithPaint): (WebCore::GPUCanvasContext::paintRenderingResultsToCanvas): * Modules/webgpu/GPUCanvasContext.h: * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::paint): * html/HTMLCanvasElement.h: * html/canvas/CanvasRenderingContext.h: (WebCore::CanvasRenderingContext::prepareForDisplayWithPaint): * html/canvas/GPUBasedCanvasRenderingContext.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::initializeNewContext): (WebCore::WebGLRenderingContextBase::prepareForDisplayWithPaint): (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas): (WebCore::WebGLRenderingContextBase::validateElementArraySize): (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise): (WebCore::WebGLRenderingContextBase::validateDrawElements): (WebCore::WebGLRenderingContextBase::vertexAttribfvImpl): (WebCore::WebGLRenderingContextBase::initVertexAttrib0): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/GraphicsContextGL.h: * platform/graphics/RemoteGraphicsContextGLProxyBase.cpp: * platform/graphics/RemoteGraphicsContextGLProxyBase.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::readPixelsForPaintResults): (WebCore::GraphicsContextGLOpenGL::readRenderingResults): (WebCore::GraphicsContextGLOpenGL::reshape): (WebCore::GraphicsContextGLOpenGL::getProgramInfoLog): (WebCore::GraphicsContextGLOpenGL::getShaderInfoLog): * platform/graphics/angle/GraphicsContextGLANGLEUtilities.h: (WebCore::ScopedRestoreTextureBinding::ScopedRestoreTextureBinding): (WebCore::ScopedBufferBinding::ScopedBufferBinding): (WebCore::ScopedBufferBinding::~ScopedBufferBinding): (WebCore::ScopedBufferBinding::query): (WebCore::ScopedRestoreReadFramebufferBinding::ScopedRestoreReadFramebufferBinding): (WebCore::ScopedRestoreReadFramebufferBinding::markBindingChanged): (WebCore::ScopedRestoreReadFramebufferBinding::bindFramebuffer): (WebCore::ScopedRestoreReadFramebufferBinding::~ScopedRestoreReadFramebufferBinding): (WebCore::ScopedPixelStorageMode::ScopedPixelStorageMode): (WebCore::ScopedPixelStorageMode::~ScopedPixelStorageMode): (WebCore::ScopedPixelStorageMode::pixelStore): (WebCore::ScopedPixelStorageMode::operator GLint const): (WebCore::ScopedTexture::ScopedTexture): (WebCore::ScopedTexture::~ScopedTexture): (WebCore::ScopedTexture::operator GLuint const): (WebCore::ScopedFramebuffer::ScopedFramebuffer): (WebCore::ScopedFramebuffer::~ScopedFramebuffer): (WebCore::ScopedFramebuffer::operator GLuint const): * platform/graphics/cairo/GraphicsContextGLCairo.cpp: (WebCore::GraphicsContextGLOpenGL::paintToCanvas): * platform/graphics/cg/GraphicsContextGLCG.cpp: (WebCore::releaseImageData): (WebCore::GraphicsContextGLOpenGL::paintToCanvas): * platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.h: * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::allowOfflineRenderers const): (WebCore::GraphicsContextGLOpenGL::readCompositedResults): * platform/graphics/cocoa/WebGLLayer.mm: * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: (WebCore::GraphicsContextGLOpenGL::paintRenderingResultsToCanvas): (WebCore::GraphicsContextGLOpenGL::paintCompositedResultsToCanvas): (WebCore::GraphicsContextGLOpenGL::paintRenderingResultsToImageData): (WebCore::GraphicsContextGLOpenGL::readCompositedResults): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp: (WebCore::GraphicsContextGLOpenGL::readPixelsForPaintResults): * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::readRenderingResults): (WebCore::GraphicsContextGLOpenGL::reshape): (WebCore::GraphicsContextGLOpenGL::blendFunc): (WebCore::GraphicsContextGLOpenGL::compileShader): (WebCore::GraphicsContextGLOpenGL::getActiveAttribImpl): (WebCore::GraphicsContextGLOpenGL::getActiveAttrib): (WebCore::GraphicsContextGLOpenGL::getActiveUniformImpl): (WebCore::GraphicsContextGLOpenGL::getActiveUniform): (WebCore::GraphicsContextGLOpenGL::originalSymbolName): (WebCore::GraphicsContextGLOpenGL::mappedSymbolName): (WebCore::GraphicsContextGLOpenGL::deleteVertexArray): (WebCore::GraphicsContextGLOpenGL::isVertexArray): (WebCore::GraphicsContextGLOpenGL::getNonBuiltInActiveSymbolCount): (WebCore::GraphicsContextGLOpenGL::getUnmangledInfoLog): (WebCore::GraphicsContextGLOpenGL::getShaderi): (WebCore::GraphicsContextGLOpenGL::getShaderInfoLog): (WebCore::GraphicsContextGLOpenGL::getShaderSource): * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp: (WebCore::GraphicsContextGLOpenGL::readPixelsForPaintResults): 2020-12-17 Chris Dumez <cdumez@apple.com> [GPUProcess] https://www.waveplayer.info/createmediaelementsource-test/ demo is flaky https://bugs.webkit.org/show_bug.cgi?id=219951 Reviewed by Geoff Garen. The issue was with the following line in AudioSourceProviderAVFObjC::prepare: `m_ringBuffer = m_ringBufferCallback(description, capacity).moveToUniquePtr();` In the case where m_ringBuffer was non-null before the assignment, we would have 2 RingBuffers that would coexist for a very small period of time. When the new one was created, we would send an IPC to the remote process with the shared memory handle of the new RingBuffer. However, very shortly after, the old ring buffer would get destroyed, causing us to send another IPC to the remote process with a null handle (since the shared memory associated with the old ring buffer is getting destroyed). As a result, of this ordering issue, the remote process would end up with a RingBuffer with a null shared memory handle and no audio would be rendered. We could have addressed the issue like so: ``` m_ringBuffer = nullptr; m_ringBuffer = m_ringBufferCallback(description, capacity).moveToUniquePtr(); ``` However, this would be super fragile. Instead, I have made the following changes: 1. If there is already a ringBuffer, reuse it instead of reconstructing it. Calling allocate() with the new parameters on the existing ring buffer is sufficient in this case. 2. Because of 1, the ring buffer creation callback no longer needs to call CARingBuffer::allocate(). I also made the following changes to make the code simpler and to reduce code duplication: - The storage change handler passed to SharedRingBufferStorage is now given as parameter the CAAudioStreamDescription & frameCount. What the handler always does is send an IPC to the remote process to tell it that the storage changed and in all cases, it needs to provide these 2 parameters as well. This is because the remote process will need to call CARingBuffer::allocate(), which requires those 2 parameters. This simplifies our code in some cases since we no longer need a mechanism to retrieve those 2 parameters from inside the storage change handler. - The logic of the StorageChange IPC recipient to update its ringbuffer with the new shared memory handle is complicated and was duplicated in a LOT of places. To address this, I introduced a new SharedRingBufferStorage::updateReadOnlyStorage() function which does exactly what we need. * platform/audio/cocoa/CARingBuffer.cpp: (WebCore::CARingBuffer::allocate): * platform/audio/cocoa/CARingBuffer.h: * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h: * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: (WebCore::AudioSourceProviderAVFObjC::AudioSourceProviderAVFObjC): (WebCore::AudioSourceProviderAVFObjC::prepare): (WebCore::AudioSourceProviderAVFObjC::setRingBufferCreationCallback): 2020-12-17 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Reserve vector capacity for inline runs and line boxes https://bugs.webkit.org/show_bug.cgi?id=219985 Reviewed by Simon Fraser. ...and some of the predefined vector capacities got lost at r267325. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::build): * layout/inlineformatting/InlineFormattingState.h: * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::InlineLevelBox::InlineLevelBox): (WebCore::Layout::LineBox::LineBox): (WebCore::Layout::m_isConsideredEmpty): * layout/inlineformatting/InlineLineBox.h: 2020-12-17 Manuel Rego Casasnovas <rego@igalia.com> [selectors] Default namespace gets ignored inside non-type selectors for :is() and :not() https://bugs.webkit.org/show_bug.cgi?id=219950 Reviewed by Antti Koivisto. Based on Blink r820500 and r820557 by <andruud@chromium.org>. Default namespace declarations do not affect the compound selector representing the subject of any selector within a :is() or :not() pseudo-class, unless that compound selector contains an explicit universal selector or type selector. Spec: https://drafts.csswg.org/selectors-4/#matches This patch aligns WebKit implementation with Chromium and Firefox, so two WPT tests pass now. * css/parser/CSSSelectorParser.cpp: (WebCore::atEndIgnoringWhitespace): (WebCore::CSSSelectorParser::consumeCompoundSelector): (WebCore::CSSSelectorParser::consumePseudo): (WebCore::CSSSelectorParser::defaultNamespace const): * css/parser/CSSSelectorParser.h: 2020-12-17 Eric Carlson <eric.carlson@apple.com> [Cocoa] WebM format reader doesn't work with a url in a <source> element https://bugs.webkit.org/show_bug.cgi?id=219961 <rdar://problem/72399014> Unreviewed, address post-review comments after r270939. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::canLoadFormatReader): Use an #elif so we don’t compile multiple return statements. 2020-12-17 Chris Dumez <cdumez@apple.com> [WebAudio] Simplify code related to dispatchToRenderThread https://bugs.webkit.org/show_bug.cgi?id=219990 Reviewed by Geoffrey Garen. Simplify code related to dispatchToRenderThread in WebAudio: 1. AudioDestination::start() now always gets called with a non-null dispatchToRenderThread lambda. In the case where there is no AudioWorkletThread to dispatch to, the lambda simply calls its task synchronously. 2. For Cocoa ports, make it so that only AudioDestinationCocoa needs to worry about the dispatchToRenderThread lambda. The dispatchToRenderThread lambda is no longer exposed to subclasses such as MockAudioDestinationCocoa & RemoteAudioDestinationProxy. * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::Function<void): * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestinationCocoa::start): (WebCore::AudioDestinationCocoa::startRendering): (WebCore::AudioDestinationCocoa::stop): (WebCore::AudioDestinationCocoa::stopRendering): (WebCore::AudioDestinationCocoa::render): * platform/audio/cocoa/AudioDestinationCocoa.h: * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::AudioDestinationGStreamer::start): * platform/mock/MockAudioDestinationCocoa.cpp: (WebCore::MockAudioDestinationCocoa::startRendering): (WebCore::MockAudioDestinationCocoa::stopRendering): (WebCore::MockAudioDestinationCocoa::tick): * platform/mock/MockAudioDestinationCocoa.h: 2020-12-17 Jer Noble <jer.noble@apple.com> [macOS] Use low-power audio buffer sizes for more output devices https://bugs.webkit.org/show_bug.cgi?id=219975 <rdar://problem/72391280> Reviewed by Eric Carlson. In r171069, we limited setting the preferred buffer duration to a "low power", high-duration value to built-in hardware, as some external audio devices would report supporting those high-duration values only to have audible glitches when that value was set. Since then, external, wireless audio devices have become vastly more prevalent. To enable "low power" buffer durations on those devices, allow these larger durations to be set on external devices so long as they claim to support that larger duration. * platform/audio/AudioHardwareListener.cpp: (WebCore::AudioHardwareListener::AudioHardwareListener): * platform/audio/AudioHardwareListener.h: (WebCore::AudioHardwareListener::BufferSizeRange::operator bool const): (WebCore::AudioHardwareListener::BufferSizeRange::nearest const): (WebCore::AudioHardwareListener::supportedBufferSizes const): (WebCore::AudioHardwareListener::setSupportedBufferSizes): (WebCore::AudioHardwareListener::outputDeviceSupportsLowPowerMode const): Deleted. (WebCore::AudioHardwareListener::setOutputDeviceSupportsLowPowerMode): Deleted. * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::updateSessionState): * platform/audio/mac/AudioHardwareListenerMac.cpp: (WebCore::currentDeviceSupportedBufferSizes): (WebCore::AudioHardwareListenerMac::AudioHardwareListenerMac): (WebCore::AudioHardwareListenerMac::outputDeviceChanged): (WebCore::currentDeviceSupportsLowPowerBufferSize): Deleted. 2020-12-17 Kate Cheney <katherine_cheney@apple.com> Followup patch: Still can't login to my.playstation.com https://bugs.webkit.org/show_bug.cgi?id=219900 <rdar://problem/72062985> Reviewed by Darin Adler. * en.lproj/Localizable.strings: 2020-12-17 Fujii Hironori <Hironori.Fujii@sony.com> [CMake] Unify WebGL source files into the common WebCore/CMakeLists.txt https://bugs.webkit.org/show_bug.cgi?id=219970 Reviewed by Don Olmstead. CMake build scripts should have a single place to list WebGL source files to ease WebGL devs. After all ports will switch to use GraphicsContextGLANGLE.cpp, those files can be added to the common Sources.txt. GraphicsContextGLOpenGLPrivate is used only by AppleWin port. Enclosed by #if PLATFORM(WIN) && USE(CA). * CMakeLists.txt: * PlatformFTW.cmake: * PlatformGTK.cmake: * PlatformPlayStation.cmake: * PlatformWin.cmake: * SourcesGTK.txt: * SourcesWPE.txt: * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLPrivate.cpp: * platform/graphics/opengl/GraphicsContextGLOpenGLPrivate.h: * platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp: 2020-12-17 Eric Carlson <eric.carlson@apple.com> [Cocoa] WebM format reader doesn't work with a url in a <source> element https://bugs.webkit.org/show_bug.cgi?id=219961 <rdar://problem/72399014> Reviewed by Andy Estes. Work around a bug that makes the format reader fail to load when the AVURLAssetOutOfBandMIMETypeKey is included in the AVURLAsset options dictionary. Also include some cleanup: - Move the code to check for WebM MIME types from MediaPlayerPrivateAVFoundationObjC to AVAssetMIMETypeCache. - Don't use RuntimeEnabledFeatures in MediaPlayerPrivateAVFoundationObjC. - Register the WebM format reader when creating an AVURLAsset for a WebM url instead of when checking the MIME type. - Cleanup WebM "codecs" parameter parsing. * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h: * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: (WebCore::AVAssetMIMETypeCache::canDecodeExtendedType): (WebCore::AVAssetMIMETypeCache::staticContainerTypeList): (WebCore::AVAssetMIMETypeCache::setWebMFormatReaderEnabled): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::registerFormatReaderIfNecessary): (WebCore::shouldAdvertiseOutOfBandMIMEType): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsTypeAndCodecs): (WebCore::ensureFormatReaderIsRegistered): Deleted. (WebCore::isFormatReaderAvailable): Deleted. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::setWebMFormatReaderEnabled): (WebCore::SourceBufferParserWebM::webmMIMETypes): (WebCore::SourceBufferParserWebM::isWebMFormatReaderAvailable): (WebCore::SourceBufferParserWebM::isContentTypeSupported): * platform/graphics/cocoa/SourceBufferParserWebM.h: 2020-12-17 Chris Dumez <cdumez@apple.com> [GPUProcess] Replace WebAudio rendering timer with a cross-process semaphore https://bugs.webkit.org/show_bug.cgi?id=219964 Reviewed by Geoff Garen. Revert changes to CARingBuffer from r270907. These are no longer needed with this new approach so we might as well remove the complexity from our ring buffer implementation. * platform/audio/cocoa/CARingBuffer.cpp: (WebCore::CARingBufferStorageVector::flush): (WebCore::CARingBuffer::fetchIfHasEnoughData): (WebCore::CARingBuffer::fetch): * platform/audio/cocoa/CARingBuffer.h: 2020-12-17 Patrick Angle <pangle@apple.com> Web Inspector: REGRESSION(r266467): viewing a WebSocket created before Web Inspector was opened doesn't show any message frames https://bugs.webkit.org/show_bug.cgi?id=219510 Reviewed by Youenn Fablet. Updated test: http/tests/websocket/tests/hybi/inspector/before-load.html Restored functionality prior to r266467 so that the `progressIdentifier` (previously `channelIdentifier`) is available from `WebSocketChannel`. * Modules/websockets/ThreadableWebSocketChannel.h: * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::WebSocketChannel): (WebCore::WebSocketChannel::connect): (WebCore::WebSocketChannel::fail): (WebCore::WebSocketChannel::disconnect): (WebCore::WebSocketChannel::didOpenSocketStream): (WebCore::WebSocketChannel::didCloseSocketStream): (WebCore::WebSocketChannel::didFailSocketStream): (WebCore::WebSocketChannel::processBuffer): (WebCore::WebSocketChannel::processFrame): (WebCore::WebSocketChannel::sendFrame): * Modules/websockets/WebSocketChannel.h: - Reinstate a separate progress identifier for inspection * Modules/websockets/WebSocketChannelInspector.cpp: (WebCore::progressIdentifier const): * Modules/websockets/WebSocketChannelInspector.h: - Support getting the progress identifier. * Modules/websockets/WorkerThreadableWebSocketChannel.h: * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::enable): (WebCore::InspectorNetworkAgent::webSocketForRequestId): 2020-12-17 Rob Buis <rbuis@igalia.com> Make FontCascade::CodePath an enum class https://bugs.webkit.org/show_bug.cgi?id=219947 Reviewed by Alex Christensen. Make FontCascade::CodePath an enum class. Besides the usual enum class benefits, one additional nice thing is that it removed the need for the "Complex" ifdef. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForFontAndText): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::canUseSimplifiedTextMeasuring): * platform/graphics/ComplexTextController.cpp: (WebCore::TextLayout::isNeeded): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::layoutText const): (WebCore::FontCascade::displayListForTextRun const): (WebCore::FontCascade::widthOfTextRange const): (WebCore::FontCascade::width const): (WebCore::FontCascade::widthForSimpleText const): (WebCore::FontCascade::adjustSelectionRectForText const): (WebCore::FontCascade::offsetForPosition const): (WebCore::FontCascade::codePath const): (WebCore::FontCascade::characterRangeCodePath): * platform/graphics/FontCascade.h: (WebCore::FontCascade::characterRangeCodePath): * platform/win/WebCoreTextRenderer.cpp: (WebCore::WebCoreSetAlwaysUsesComplexTextCodePath): (WebCore::WebCoreAlwaysUsesComplexTextCodePath): * rendering/RenderText.cpp: (WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const): (WebCore::RenderText::computeCanUseSimpleFontCodePath const): * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer): 2020-12-17 Rob Buis <rbuis@igalia.com> Make MixedContentChecker stateless https://bugs.webkit.org/show_bug.cgi?id=219771 Reviewed by Alex Christensen. Make MixedContentChecker stateless, it only needs the frame in a few cased which we can just pass as a parameter. Making MixedContentChecker stateless means that FrameLoader does not have to know it. * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::connect): * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect): * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::parseAttribute): * html/parser/XSSAuditor.cpp: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::willSendRequest): * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): * loader/FrameLoader.cpp: (WebCore::FrameLoader::FrameLoader): * loader/FrameLoader.h: * loader/MixedContentChecker.cpp: (WebCore::logWarning): (WebCore::MixedContentChecker::canDisplayInsecureContent): (WebCore::MixedContentChecker::canRunInsecureContent): (WebCore::MixedContentChecker::checkFormForMixedContent): (WebCore::MixedContentChecker::checkForMixedContentInFrameTree): (WebCore::MixedContentChecker::MixedContentChecker): Deleted. (WebCore::MixedContentChecker::client const): Deleted. (WebCore::MixedContentChecker::canDisplayInsecureContent const): Deleted. (WebCore::MixedContentChecker::canRunInsecureContent const): Deleted. (WebCore::MixedContentChecker::checkFormForMixedContent const): Deleted. (WebCore::MixedContentChecker::logWarning const): Deleted. * loader/MixedContentChecker.h: * loader/SubframeLoader.cpp: (WebCore::FrameLoader::SubframeLoader::pluginIsLoadable): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::checkInsecureContent const): 2020-12-16 Chris Dumez <cdumez@apple.com> Flaky crash under AudioBuffer::channelData() when running layout tests https://bugs.webkit.org/show_bug.cgi?id=219914 Reviewed by Geoffrey Garen. The issue was that AudioBuffer::channelData() returns a RefPtr<Float32Array>, Float32Array not being ThreadSafeRefCounted. The AudioBuffers in ScriptProcessorNode are constructed on the main thread but ScriptProcessorNode::process() was calling AudioBuffer::channelData() on the audio rendering thread. This would do some non-thread-safe refcounting churn which would cause the crashes. To address the issue, I introduced AudioBuffer::rawChannelData() which returns the data as a float*, without any refcounting. I ported ScriptProcessorNode::process() to use AudioBuffer::rawChannelData() instead of AudioBuffer::channelData(). No new tests, covered by existing layout tests that are flakily crashing. * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::rawChannelData): * Modules/webaudio/AudioBuffer.h: * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::process): 2020-12-15 Yusuke Suzuki <ysuzuki@apple.com> [JSC] Accept arbitrary module namespace identifier names https://bugs.webkit.org/show_bug.cgi?id=217576 Reviewed by Darin Adler. * bindings/js/JSDOMConvertStrings.cpp: (WebCore::hasUnpairedSurrogate): Deleted. 2020-12-16 Peng Liu <peng.liu6@apple.com> [Media in GPU Process][MSE] Add an IPC message BufferedSamplesForTrackId for testing purposes https://bugs.webkit.org/show_bug.cgi?id=219956 Reviewed by Eric Carlson. No new tests, fix a layout test failure. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::bufferedSamplesForTrackId): (WebCore::SourceBuffer::bufferedSamplesForTrackID): Deleted. * Modules/mediasource/SourceBuffer.h: * platform/graphics/SourceBufferPrivate.cpp: (WebCore::SourceBufferPrivate::bufferedSamplesForTrackId): (WebCore::SourceBufferPrivate::bufferedSamplesForTrackID): Deleted. * platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::enqueuedSamplesForTrackID): * testing/Internals.cpp: (WebCore::Internals::bufferedSamplesForTrackId): (WebCore::Internals::bufferedSamplesForTrackID): Deleted. * testing/Internals.h: * testing/Internals.idl: 2020-12-16 Kate Cheney <katherine_cheney@apple.com> Still can't login to my.playstation.com https://bugs.webkit.org/show_bug.cgi?id=219900 <rdar://problem/72062985> Reviewed by John Wilander. Adapted from an original patch by John Wilander. This is a temporary quirk to assist a high-traffic website while they complete the large task of migrating away from login flows that require third party cookies. This quirk will be removed when the site is updated. Create a quirk to call the Storage Access API on behalf of Sony. This case is unique because playstation.com requires storage access for 2 login domains: sony.com and sonyentertainmentnetwork.com. This patch handles this by requesting storage access for both domains if either domain is requested to avoid massive changes to the Storage Access code to handle multiple domains at once. This patch adjusts the quirk code in NetworkStorageSession to handle multiple login domains for a single first party domain. No new tests, site specific quirk. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::responseReceived): * page/Quirks.cpp: (WebCore::isPlaystationLoginElement): (WebCore::Quirks::hasStorageAccessForAllLoginDomains): (WebCore::Quirks::triggerOptionalStorageAccessQuirk const): Adjust the existing quirks to handle the new format of a HashSet of login domains, and add the new playstation.com case. * page/Quirks.h: * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::grantCrossPageStorageAccess): (WebCore::NetworkStorageSession::hasStorageAccess const): (WebCore::NetworkStorageSession::storageAccessQuirks): (WebCore::NetworkStorageSession::loginDomainMatchesRequestingDomain): (WebCore::NetworkStorageSession::loginDomainsForFirstParty): (WebCore::NetworkStorageSession::findAdditionalLoginDomain): Function to match up Sony login domains with one another at storage endpoints and for prompting so we don't need to thread them through all of the existing storage access code. (WebCore::NetworkStorageSession::loginDomainForFirstParty): Renamed to be plural. * platform/network/NetworkStorageSession.h: Adjusted existing quirk code to handle a HashSet of login domains instead of a single domain. 2020-12-16 Chris Dumez <cdumez@apple.com> [GPUProcess] Avoid doing an IPC per rendering quantum when using WebAudio https://bugs.webkit.org/show_bug.cgi?id=219818 Reviewed by Geoff Garen. * platform/audio/AudioDestination.h: Make sure AudioDestination always gets destroyed on the main thread. * platform/audio/cocoa/CARingBuffer.cpp: (WebCore::CARingBuffer::lastReadFrame const): (WebCore::CARingBufferStorageVector::setLastReadFrame): (WebCore::CARingBufferStorageVector::lastReadFrame const): (WebCore::CARingBuffer::fetchIfHasEnoughData): (WebCore::CARingBuffer::fetch): * platform/audio/cocoa/CARingBuffer.h: Add API to CARingBuffer to query the last frame that the reader attempted to read. This is helpful to make sure the writer keeps up with the reader and does not stray too far ahead. 2020-12-16 Víctor Manuel Jáquez Leal <vjaquez@igalia.com> [Debug][GStreamer] Crash in fast/mediastream/change-tracks-media-stream-being-played.html https://bugs.webkit.org/show_bug.cgi?id=219437 Reviewed by Philippe Normand. The crash was a product of a race condition where a new sample, either video or audio, appeared after the track was already removed from the stream and the GStreamer's source was already removed. The result was a segmentation fault when the sample observer is called, since the observer is coupled with the GStreamer's source. This fix consists of removing the observers as soon as the track is removed from the stream. No new tests needed since it fix one. * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (webkitMediaStreamSrcRemoveTrackObserver): New function. (stopObservingTracks): Use new function. (webkitMediaStreamSrcSetupSrc): Use track's type method rather than source's. 2020-12-16 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] Enable USE_ANGLE https://bugs.webkit.org/show_bug.cgi?id=219421 Reviewed by Don Olmstead. Switch GraphicsContextGLOpenGL implementation from old one (GraphicsContextGLOpenGLES.cpp) to new one (GraphicsContextGLANGLE.cpp), which is using ANGLE's internal API and verification code, for WinCairo port. I will enable WebGL2 for WinCairo in a follow-up patch. GL_TEXTURE_RECTANGLE_ANGLE is not available for ANGLE D3D backend. Use GL_TEXTURE_2D instead. Add a new class WebCore::ANGLEContext by copying Nicosia::GCGLANGLELayer::ANGLEContext. It'd be better to merge them after GTK and WPE will also switch. * PlatformWin.cmake: * platform/TextureMapper.cmake: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): (WebCore::GraphicsContextGLOpenGL::compileShader): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/texmap/ANGLEContext.cpp: Added. (WebCore::ANGLEContext::errorString): (WebCore::ANGLEContext::lastErrorString): (WebCore::ANGLEContext::createContext): (WebCore::ANGLEContext::ANGLEContext): (WebCore::ANGLEContext::~ANGLEContext): (WebCore::ANGLEContext::makeContextCurrent): (WebCore::ANGLEContext::platformContext const): * platform/graphics/texmap/ANGLEContext.h: Added. * platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::isGLES2Compliant const): (WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTarget): * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp: (WebCore::TextureMapperGCGLPlatformLayer::TextureMapperGCGLPlatformLayer): (WebCore::TextureMapperGCGLPlatformLayer::paintToTextureMapper): * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.h: 2020-12-16 Chris Fleizach <cfleizach@apple.com> AX: Update list heuristics to include linked lists inside navigation containers https://bugs.webkit.org/show_bug.cgi?id=193382 <rdar://problem/47233475> Reviewed by Zalan Bujtas. If an unstyled list is inside a <nav> or a role=navigation, it should be marked as an accessibility list. Updated test: accessibility/list-detection2.html * accessibility/AccessibilityList.cpp: (WebCore::AccessibilityList::determineAccessibilityRole): 2020-12-16 Simon Fraser <simon.fraser@apple.com> Make FrameView::m_customSizeForResizeEvent an Optional<IntSize> https://bugs.webkit.org/show_bug.cgi?id=219931 Reviewed by Zalan Bujtas. Replace bool + IntSize with an Optional<IntSize>. * page/FrameView.cpp: (WebCore::FrameView::sizeForResizeEvent const): (WebCore::FrameView::setCustomSizeForResizeEvent): * page/FrameView.h: 2020-12-16 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Non-quantitative values such as auto and min-content are not influenced by the box-sizing property https://bugs.webkit.org/show_bug.cgi?id=219944 Reviewed by Antti Koivisto. See https://www.w3.org/TR/css-sizing-3/#box-sizing Test: fast/layoutformattingcontext/max-content-and-box-sizing-simple.html * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedWidth): 2020-12-16 Andy Estes <aestes@apple.com> [Mac] Disable the WebM format reader in configurations where the plug-in will fail to load https://bugs.webkit.org/show_bug.cgi?id=219938 Reviewed by Eric Carlson. The user default for loading an ad-hoc code-signed WebM format reader plug-in is not respected in customer installs of macOS, leaving no known way to load the plug-in in an engineering build running on a customer OS variant. Fixing this is tracked by rdar://72320419, but for now we must disable the plug-in for this configuration. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::isFormatReaderAvailable): (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsTypeAndCodecs): 2020-12-16 Antti Koivisto <antti@apple.com> Remove simpleUserAgentStyleSheet (to fix flaky fast/lists/001.html and fast/lists/001-vertical.html) https://bugs.webkit.org/show_bug.cgi?id=218995 <rdar://problem/71452387> Reviewed by Antoine Quint. The simpleUserAgentStyleSheet optimization allows WebKit to load a very simple version of the user agent stylesheet as long as the document is very simple too (mostly just <div>/<span>). It was implemented to support certain non-web use cases a long time ago when the cost of simply parsing the main stylesheet was significant. It can cause problems like seen here when it is not fully in-sync with the real stylesheet. The ways it may be out of sync can be pretty obscure. The optimization hasn't been useful for a while now. Let's just remove it instead of continuing fix problems caused by it. * page/ProcessWarming.cpp: (WebCore::ProcessWarming::prewarmGlobally): * style/ElementRuleCollector.cpp: (WebCore::Style::ElementRuleCollector::matchUARules): * style/InspectorCSSOMWrappers.cpp: (WebCore::Style::InspectorCSSOMWrappers::collectDocumentWrappers): * style/StyleResolver.cpp: (WebCore::Style::Resolver::Resolver): * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::initDefaultStyleSheet): (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement): (WebCore::Style::elementCanUseSimpleDefaultStyle): Deleted. (WebCore::Style::UserAgentStyle::initDefaultStyle): Deleted. (WebCore::Style::UserAgentStyle::loadFullDefaultStyle): Deleted. (WebCore::Style::UserAgentStyle::loadSimpleDefaultStyle): Deleted. * style/UserAgentStyle.h: 2020-12-16 Youenn Fablet <youenn@apple.com> Expose SFrameTransform to DedicatedWorker https://bugs.webkit.org/show_bug.cgi?id=219890 Reviewed by Eric Carlson. Test: http/wpt/webrtc/sframe-transform-in-worker.html * Modules/mediastream/RTCRtpSFrameTransform.idl: 2020-12-16 Youenn Fablet <youenn@apple.com> Make sure WebKit WebSocketChannel handle suspend/resume correctly https://bugs.webkit.org/show_bug.cgi?id=219910 Reviewed by Alex Christensen. Covered by http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html and http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html with NSURLSession WebSocket code path enabled. * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::resume): In case resume is called and there are some events to dispatch, start the timer even if the channel is not null. 2020-12-15 Rob Buis <rbuis@igalia.com> Remove FrameLoader::cancelAndClear https://bugs.webkit.org/show_bug.cgi?id=219853 Reviewed by Alex Christensen. Since this functionality is only called at Frame destructor time, we can move the code to that destructor. * loader/FrameLoader.cpp: (WebCore::FrameLoader::cancelAndClear): Deleted. * loader/FrameLoader.h: * page/Frame.cpp: (WebCore::Frame::~Frame): 2020-12-15 Zalan Bujtas <zalan@apple.com> REGRESSION (r270839): ASSERT NOT REACHED in WebCore::Layout::InlineContentBreaker::processOverflowingContent https://bugs.webkit.org/show_bug.cgi?id=219904 <rdar://problem/72350087> Reviewed by Simon Fraser. "Typo" in r270839. * layout/inlineformatting/InlineContentBreaker.cpp: (WebCore::Layout::InlineContentBreaker::processOverflowingContent const): 2020-12-15 Aditya Keerthi <akeerthi@apple.com> [macOS] Adjust date input placeholder color based on specified text color https://bugs.webkit.org/show_bug.cgi?id=219875 <rdar://problem/72314705> Reviewed by Darin Adler. Empty date inputs currently show the current date in dark gray text as a placeholder. The existing behavior results in an issue on Nike's membership registration page, where their custom placeholder and the placeholder date are visible at the same time. Nike uses "color: transparent" to hide the contents of the date input and display their own placeholder. However, since the placeholder date is always displayed in dark gray text, both placeholders are visible. To fix, the color of the placeholder should be adjusted based on the text color specified by the site author. This will ensure that "color: transparent" will hide the placeholder, and also ensures the placeholder better matches the style of the rest of the input. Test: fast/forms/date/date-editable-components/date-editable-components-placeholder-color.html * html/shadow/DateTimeFieldElement.cpp: (WebCore::DateTimeFieldElement::resolveCustomStyle): Moved custom style resolution out of the derived classes and into the base class to reduce code duplication. The min-width adjustment is preserved by calling the pure virtual method adjustMinWidth. The new color resolution for placeholder dates is performed by obtaining the text and background colors through the shadow host (the HTMLInputElement) and calling into RenderTheme for the adjustment algorithm. * html/shadow/DateTimeFieldElement.h: Made setEmptyValue and setValueAsInteger pure virtual methods since the base implementation is now empty. Introduced adjustMinWidth as a pure virtual method to allow numeric and symbolic field elements to set their minimum width. This replaces the need to have the derived classes implement resolveCustomStyle. * html/shadow/DateTimeNumericFieldElement.cpp: (WebCore::DateTimeNumericFieldElement::adjustMinWidth const): (WebCore::DateTimeNumericFieldElement::setEmptyValue): (WebCore::DateTimeNumericFieldElement::setValueAsInteger): * html/shadow/DateTimeNumericFieldElement.h: * html/shadow/DateTimeSymbolicFieldElement.cpp: (WebCore::DateTimeSymbolicFieldElement::adjustMinWidth const): (WebCore::DateTimeSymbolicFieldElement::setEmptyValue): (WebCore::DateTimeSymbolicFieldElement::setValueAsInteger): * html/shadow/DateTimeSymbolicFieldElement.h: * rendering/RenderTheme.cpp: (WebCore::RenderTheme::datePlaceholderTextColor const): Adjust the placeholder text color based on the text and background color specified. The adjustment is performed by changing the lightness of the specified text color. The lightness is increased for dark text on a light background, and is decreased for light text on a dark background. The chosen adjustment factor ensures that a dark gray color is obtained for both white on black, and black on white. * rendering/RenderTheme.h: 2020-12-15 Alexey Shvayka <shvaikalesh@gmail.com> Non-enumerable property fails to shadow inherited enumerable property from for-in https://bugs.webkit.org/show_bug.cgi?id=38970 Reviewed by Keith Miller. Report RuntimeArray indices as [[Enumerable]]. Test: platform/mac/fast/dom/wrapper-classes-objc.html * bridge/runtime_array.cpp: (JSC::RuntimeArray::getOwnPropertySlot): (JSC::RuntimeArray::getOwnPropertySlotByIndex): 2020-12-15 Jer Noble <jer.noble@apple.com> [Cocoa] Adopt -externalContentProtectionStatus https://bugs.webkit.org/show_bug.cgi?id=219911 Reviewed by Eric Carlson. Adopt a new AVContentKeyRequest API which provides a "pending" status (in addition to usable/unusable). * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::protectionStatusForDisplayID const): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyRequestHasInsufficientProtectionForDisplayID const): Deleted. 2020-12-15 Sihui Liu <sihui_liu@apple.com> Add webkit- prefix to SpeechRecognition https://bugs.webkit.org/show_bug.cgi?id=219869 Reviewed by Geoffrey Garen. * Modules/speech/SpeechRecognition.idl: * bindings/js/WebCoreBuiltinNames.h: 2020-12-15 Simon Fraser <simon.fraser@apple.com> REGRESSION (r259137): Clip-path rendering regression when element contains transformed child https://bugs.webkit.org/show_bug.cgi?id=219829 <rdar://problem/66308088> Reviewed by Said Abou-Hallawa. When computing the geometry for clip-path when applied to a CSS box, we should take overflow:hidden on the box into account. It's not entirely clear what the correct geometry is (https://github.com/w3c/csswg-drafts/issues/5786) but this avoids stretched masks. Test: css3/masking/clip-path-overflow-hidden-bounds.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::setupClipPath): 2020-12-15 Devin Rousso <drousso@apple.com> Toggling pointer-events on body does not re-enable scrolling on child https://bugs.webkit.org/show_bug.cgi?id=218533 <rdar://problem/71009746> Reviewed by Simon Fraser. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresRecompositeLayer const): Changes to the CSS `pointer-events` property should also also indicate that a recomposite is required (`StyleDifference::RecompositeLayer`), resulting in `RenderElement::styleWillChange` being called, which invalidates the event region since the value of the CSS `pointer-events` property has changed. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerStyleChanged): Don't limit `StyleDifference::RecompositeLayer` changes to only affect `RenderWidget`. 2020-12-15 Zalan Bujtas <zalan@apple.com> [LFC][Integration] REGRESSION: Event handler region is wrong https://bugs.webkit.org/show_bug.cgi?id=219515 <rdar://problem/71955706> Reviewed by Antti Koivisto. Event regions need to include the paint offset the same way painting does. Test: fast/scrolling/mac/event-region-is-leaking-out.html * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::paint): 2020-12-15 Sihui Liu <sihui_liu@apple.com> resultIndex of SpeechRecognitionEvent should be the first index that has change https://bugs.webkit.org/show_bug.cgi?id=219876 Reviewed by Youenn Fablet. Our current resultIndex is first index of non-final result, but it should be first index of changed result (https://wicg.github.io/speech-api/#dom-speechrecognitionevent-resultindex), which includes result with state change (non-final to final) but no content change. Modified existing test: fast/speechrecognition/ios/start-recognition-then-stop.html * Modules/speech/SpeechRecognition.cpp: (WebCore::SpeechRecognition::didReceiveResult): 2020-12-15 Noam Rosenthal <noam@webkit.org> REGRESSION(r268886): Page load time performance regression https://bugs.webkit.org/show_bug.cgi?id=219677 <rdar://problem/71543823> Reviewed by Darin Adler. Optimize metadata fetching from images in ImageDecoderCG. Instead of reading metadata separately for orientation and resolution, use the partial metadata retrieved for orientation to figure out whether we need extended metadata at all. This will limit the expensive reading of extended metadata to images which might have density size correction. No new tests, this is an optimization covered by existing tests. * platform/graphics/ImageDecoder.h: (WebCore::ImageDecoder::frameDensityCorrectedSizeAtIndex const): Deleted. * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::cacheMetadataAtIndex): * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h: * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::ImageDecoderAVFObjC::frameMetadataAtIndex const): (WebCore::ImageDecoderAVFObjC::frameOrientationAtIndex const): Deleted. * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::frameMetadataAtIndex const): (WebCore::ImageDecoderGStreamer::frameOrientationAtIndex const): Deleted. * platform/graphics/gstreamer/ImageDecoderGStreamer.h: * platform/graphics/win/ImageDecoderDirect2D.cpp: (WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const): Deleted. * platform/graphics/win/ImageDecoderDirect2D.h: * platform/image-decoders/ScalableImageDecoder.h: Changed the signature to retrive metadata in one call * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::mayHaveDensityCorrectedSize): (WebCore::densityCorrectedSizeFromProperties): (WebCore::ImageDecoderCG::frameMetadataAtIndex const): (WebCore::ImageDecoderCG::frameOrientationAtIndex const): Deleted. (WebCore::ImageDecoderCG::frameDensityCorrectedSizeAtIndex const): Deleted. * platform/graphics/cg/ImageDecoderCG.h: Figure out whether we need to read density based on partial metadata. 2020-12-15 Youenn Fablet <youenn@apple.com> Make worker RTC insertable streams constructs controlled by webrtc insertable streams feature setting https://bugs.webkit.org/show_bug.cgi?id=219252 <rdar://problem/71798249> Reviewed by Eric Carlson. Update binding generator to use the new ScriptExecutionContext::settingsValues getter. Enable use of EnabledBySettings outside window context. Make use of it in RTCRtpScriptTransformer. Covered by existing tests and rebased binding tests. * Modules/mediastream/RTCRtpScriptTransformer.idl: * bindings/js/WebCoreBuiltinNames.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateRuntimeEnableConditionalString): * bindings/scripts/test/JS/JSTestConditionalIncludes.cpp: (WebCore::JSTestConditionalIncludesDOMConstructor::initializeProperties): (WebCore::JSTestConditionalIncludesPrototype::finishCreation): * bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp: (WebCore::JSTestConditionallyReadWritePrototype::finishCreation): * bindings/scripts/test/JS/JSTestDefaultToJSON.cpp: (WebCore::JSTestDefaultToJSONPrototype::finishCreation): (WebCore::jsTestDefaultToJSONPrototypeFunction_toJSONBody): * bindings/scripts/test/JS/JSTestDefaultToJSONInherit.cpp: (WebCore::jsTestDefaultToJSONInheritPrototypeFunction_toJSONBody): * bindings/scripts/test/JS/JSTestDefaultToJSONInheritFinal.cpp: (WebCore::jsTestDefaultToJSONInheritFinalPrototypeFunction_toJSONBody): * bindings/scripts/test/JS/JSTestDerivedDictionary.cpp: (WebCore::convertDictionaryToJS): * bindings/scripts/test/JS/JSTestDerivedDictionary2.cpp: (WebCore::convertDictionaryToJS): * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::JSTestEnabledBySettingDOMConstructor::initializeProperties): (WebCore::JSTestEnabledBySettingPrototype::finishCreation): (WebCore::JSTestEnabledBySetting::finishCreation): * bindings/scripts/test/JS/JSTestEnabledForContext.cpp: (WebCore::JSTestEnabledForContext::finishCreation): * bindings/scripts/test/JS/JSTestInheritedDictionary.cpp: (WebCore::convertDictionaryToJS): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfacePrototype::finishCreation): * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: (WebCore::convertDictionaryToJS): 2020-12-15 Andy Estes <aestes@apple.com> [Mac] Numerous webgl tests time out with WebM format reader enabled https://bugs.webkit.org/show_bug.cgi?id=219887 Reviewed by Eric Carlson. Covered by existing tests. * platform/graphics/TrackPrivateBase.cpp: (WebCore::TrackPrivateBase::trackUID const): * platform/graphics/TrackPrivateBase.h: * platform/graphics/cocoa/AudioTrackPrivateWebM.cpp: (WebCore::AudioTrackPrivateWebM::id const): (WebCore::AudioTrackPrivateWebM::trackUID const): * platform/graphics/cocoa/AudioTrackPrivateWebM.h: * platform/graphics/cocoa/VideoTrackPrivateWebM.cpp: (WebCore::VideoTrackPrivateWebM::id const): (WebCore::VideoTrackPrivateWebM::trackUID const): * platform/graphics/cocoa/VideoTrackPrivateWebM.h: Added a way to get the track ID as an optional uint64_t. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::callOnMainThreadCallback): (WebCore::SourceBufferParserWebM::SourceBufferParserWebM): (WebCore::SourceBufferParserWebM::appendData): (WebCore::SourceBufferParserWebM::OnClusterBegin): (WebCore::SourceBufferParserWebM::provideMediaData): (WebCore::SourceBufferParserWebM::setCallOnClientThreadCallback): * platform/graphics/cocoa/SourceBufferParserWebM.h: Added a way for SourceBufferParserWebM clients to customize the thread on which callbacks are invoked. 2020-12-15 Chris Dumez <cdumez@apple.com> [GPUProcess] Crash under AudioDestinationCocoa::setIsPlaying(bool) https://bugs.webkit.org/show_bug.cgi?id=219809 <rdar://problem/72298420> Reviewed by Youenn Fablet. The issue is that when using the GPU process, AudioDestination::stop() & start() are asynchronous due to IPC. Those functions take completion handlers and the AudioDestination object makes sure to ref itself to keep itself alive during async operations. However, AudioDestination::m_callback is a raw pointer to the AudioDestinationNode, which may itself become dead if AudioDestination extends its lifetime by ref'ing itself. To address the issue, AudioDestinationNode now clears AudioDestination's node to itself before nulling out its destination. Before AudioDestination::m_callback is used from several threads, we need to add a lock too. No new tests, already covered by layout tests currently crashing on bots with GPU process enabled. * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::uninitialize): (WebCore::DefaultAudioDestinationNode::clearDestination): (WebCore::DefaultAudioDestinationNode::createDestination): (WebCore::DefaultAudioDestinationNode::recreateDestination): (WebCore::DefaultAudioDestinationNode::enableInput): (WebCore::DefaultAudioDestinationNode::setChannelCount): * Modules/webaudio/DefaultAudioDestinationNode.h: * platform/audio/AudioDestination.h: (WebCore::AudioDestination::clearCallback): (WebCore::AudioDestination::AudioDestination): (WebCore::AudioDestination::callRenderCallback): * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestinationCocoa::AudioDestinationCocoa): (WebCore::AudioDestinationCocoa::setIsPlaying): (WebCore::AudioDestinationCocoa::renderOnRenderingThead): * platform/audio/cocoa/AudioDestinationCocoa.h: * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer): * platform/audio/gstreamer/AudioDestinationGStreamer.h: 2020-12-15 Zalan Bujtas <zalan@apple.com> REGRESSION: apple.com sign-in page footer does not wrap, "Site Map" option renders offscreen. https://bugs.webkit.org/show_bug.cgi?id=219880 <rdar://problem/72128221> Reviewed by Antti Koivisto. Do not check the inline-block's style for wrapping. It's the parent's style that drives the content wrapping. E.g. <div style="white-space: nowrap">some text<div style="display: inline-block; white-space: pre-wrap"></div></div>. While the inline-block has pre-wrap which allows wrapping, the content lives in a nowrap context. Test: fast/inline/inline-block-no-wrap.html * layout/inlineformatting/InlineContentBreaker.cpp: (WebCore::Layout::InlineContentBreaker::processOverflowingContent const): (WebCore::Layout::lastContentRunIndex): Deleted. (WebCore::Layout::InlineContentBreaker::isContentWrappingAllowed const): Deleted. * layout/inlineformatting/InlineContentBreaker.h: 2020-12-15 Martin Robinson <mrobinson@webkit.org> CSS Scroll Snap is not in effect when the user scrolls via the keyboard https://bugs.webkit.org/show_bug.cgi?id=198566 <rdar://problem/51488088> Reviewed by Simon Fraser. Add support for scroll snap for keyboard scrolling This change adds support for the concept of directional scroll snapping, which will never snap to a snap point that is away from the original scroll offset in the opposite direction of the scroll direction. This allows escaping snap points. Tests: tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-horizontal-with-keyboard-scaled.html tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-horizontal-with-keyboard.html tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical-with-keyboard-scaled.html tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical-with-keyboard.html tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-mainframe-horizontal-with-keyboard.html tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-mainframe-vertical-with-keyboard.html tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-overflow-rtl-with-keyboard.html * page/FrameView.cpp: (WebCore::FrameView::pageScaleFactor const): Added. * page/FrameView.h: Added scale factor getter. * page/scrolling/ScrollSnapOffsetsInfo.cpp: (WebCore::closestSnapOffset): Added a new optional argument that signals directional snapping. This changes the behavior when choosing a snap offset that is in the opposite direction as the scroll direction. * page/scrolling/ScrollSnapOffsetsInfo.h: * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::scroll): * page/scrolling/ScrollSnapOffsetsInfo.h: (WebCore::ScrollAnimator::scroll): No longer use the granularity argument. (WebCore::ScrollAnimator::scrollWithoutAnimation): Remove the unused ScrollGranularity argument and use the new positionFromStep helper. (WebCore::ScrollAnimator::scrollWithDirectionalSnapping): Added. (WebCore::ScrollAnimator::positionFromStep): Added this helper. (WebCore::ScrollAnimator::handleWheelEvent): Remove the granularity argument. (WebCore::ScrollAnimator::pageScaleFactor const): Added this implementation of a ScrollControllerClient method. * platform/ScrollAnimator.h: Update method declarations. * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::scroll): Use the new argument to the scroll method. * platform/cocoa/ScrollController.h: Added new method. (WebCore::ScrollableArea::pageScaleFactor const): * platform/cocoa/ScrollController.h: * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::adjustScrollDestinationForDirectionalSnapping): Added. * platform/mac/ScrollAnimatorMac.h: * platform/mac/ScrollAnimatorMac.mm: (WebCore::ScrollAnimatorMac::scroll): Use new positionFromStep helper. 2020-12-15 Antoine Quint <graouts@webkit.org> [Web Animations] Implied keyframes should not account for animations on siblings https://bugs.webkit.org/show_bug.cgi?id=188050 <rdar://problem/71330806> Reviewed by Antti Koivisto. Sibling nodes can share styles, but we need to opt out of this behavior for elements targeted by keyframe effects that rely on implied keyframes as, otherwise, we end up using another element's style to resolve animations with implied keyframes. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::hasImplicitKeyframes const): * animation/KeyframeEffect.h: * animation/KeyframeEffectStack.cpp: (WebCore::KeyframeEffectStack::hasEffectWithImplicitKeyframes const): * animation/KeyframeEffectStack.h: * style/StyleSharingResolver.cpp: (WebCore::Style::SharingResolver::resolve): * style/StyleSharingResolver.h: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::styleForStyleable): (WebCore::Style::TreeResolver::resolveElement): (WebCore::Style::TreeResolver::styleForElement): Deleted. * style/StyleTreeResolver.h: 2020-12-15 Andres Gonzalez <andresg_22@apple.com> Add logging for Accessibility::findMatchingObjects. https://bugs.webkit.org/show_bug.cgi?id=219883 Reviewed by Chris Fleizach. No change in functionality, logging code. - Overloaded << operator for AccessibilitySearchDirection, SearchKey and SearchCriteria. - Provided corresponding AXLogger::log overloads. * accessibility/AXLogger.cpp: (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AccessibilityObject.cpp: (WebCore::Accessibility::appendChildrenToArray): Moved to the Accessibility namespace. (WebCore::Accessibility::findMatchingObjects): Added logging. * accessibility/AccessibilityObjectInterface.h: 2020-12-15 Philippe Normand <pnormand@igalia.com> [CMake][WPE] Remove unconditional WebCore dependency to WPEBackend-FDO https://bugs.webkit.org/show_bug.cgi?id=219835 Reviewed by Yusuke Suzuki. * PlatformWPE.cmake: The WPEBackend-FDO dependency should be enabled only when client-side video or audio rendering is enabled. 2020-12-14 Chris Fleizach <cfleizach@apple.com> AX: implement prefers-contrast: more https://bugs.webkit.org/show_bug.cgi?id=215507 <rdar://problem/67077492> Reviewed by Dean Jackson. Implement prefers-contrast as defined in https://drafts.csswg.org/mediaqueries-5/#prefers-contrast Tests: fast/media/mq-prefers-contrast-forced-value.html fast/media/mq-prefers-contrast-live-update-for-listener.html fast/media/mq-prefers-contrast-live-update.html fast/media/mq-prefers-contrast-matchMedia.html fast/media/mq-prefers-contrast.html * css/CSSValueKeywords.in: * css/MediaFeatureNames.h: * css/MediaQueryEvaluator.cpp: (WebCore::isAccessibilitySettingsDependent): (WebCore::prefersContrastEvaluate): * css/MediaQueryExpression.cpp: (WebCore::featureWithValidIdent): (WebCore::isFeatureValidWithoutValue): * page/Settings.yaml: * platform/Theme.cpp: (WebCore::Theme::userPrefersContrast const): * platform/Theme.h: * platform/ios/ThemeIOS.h: * platform/ios/ThemeIOS.mm: (WebCore::ThemeIOS::userPrefersContrast const): * platform/mac/ThemeMac.h: * platform/mac/ThemeMac.mm: (WebCore::ThemeMac::userPrefersContrast const): * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::forcedPrefersContrastAccessibilityValue const): (WebCore::InternalSettings::setForcedPrefersContrastAccessibilityValue): * testing/InternalSettings.h: * testing/InternalSettings.idl: * testing/Internals.cpp: (WebCore::Internals::userPrefersContrast const): * testing/Internals.h: * testing/Internals.idl: * testing/Internals.mm: (WebCore::Internals::userPrefersContrast const): 2020-12-14 Peng Liu <peng.liu6@apple.com> [Media in GPU Process][MSE] VP9 stream playback is not smooth https://bugs.webkit.org/show_bug.cgi?id=219861 Reviewed by Eric Carlson. Change two methods of `MediaSourcePrivate` to virtual so that we can implement them in `MediaSourcePrivateRemote` with IPC messages. * platform/graphics/MediaSourcePrivate.h: (WebCore::MediaSourcePrivate::setIsSeeking): (WebCore::MediaSourcePrivate::setTimeFudgeFactor): (WebCore::MediaSourcePrivate::timeFudgeFactor const): 2020-12-14 Simon Fraser <simon.fraser@apple.com> REGRESSION (r268604): fast/layoutformattingcontext/table-basic-row-vertical-align-baseline.html is a flaky crash https://bugs.webkit.org/show_bug.cgi?id=219369 <rdar://problem/69985187> Reviewed by Zalan Bujtas. During TestController::resetStateToConsistentValues() there are lots of calls to WebPage::preferencesDidChange() via the async IPC, and for some of those calls both layoutFormattingContextIntegrationEnabled and layoutFormattingContextEnabled are true. If Display::view() does a paint at that time, then we hit assertions because these two settings are incompatible with eachother. Fix by bailing from display if layoutFormattingContextIntegrationEnabled() is set. * display/DisplayView.cpp: (WebCore::Display::View::prepareForDisplay): 2020-12-14 Chris Dumez <cdumez@apple.com> Unreviewed, reverting r270768. Still crashes in debug in a different location Reverted changeset: "[GPUProcess] Crash under AudioDestinationCocoa::setIsPlaying(bool)" https://bugs.webkit.org/show_bug.cgi?id=219809 https://trac.webkit.org/changeset/270768 2020-12-14 Peng Liu <peng.liu6@apple.com> [Media in GPU Process][MSE] Fix crashes in a debug build https://bugs.webkit.org/show_bug.cgi?id=219874 Reviewed by Eric Carlson. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::readyStateChanged): (WebCore::SourceBuffer::audioTracks): (WebCore::SourceBuffer::textTracks): (WebCore::SourceBuffer::appendError): (WebCore::SourceBuffer::trySignalAllSamplesEnqueued): (WebCore::SourceBuffer::sourceBufferPrivateDurationChanged): (WebCore::SourceBuffer::sourceBufferPrivateStreamEndedWithDecodeError): Only use m_source when the pointer is valid. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::abort): SourceBufferParser::invalidate() may crash if the parser is parsing data. 2020-12-14 Chris Dumez <cdumez@apple.com> [GPUProcess] Bump QoS to UserInteractive for real-time audio rendering thread https://bugs.webkit.org/show_bug.cgi?id=219873 Reviewed by Eric Carlson. Use Default QoS for offline audio rendering and UserInteractive for real-time audio rendering. Previously, we were using always UserInitiated QoS for all audio threads, which is lower than UserInteractive [1]. [1] https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/PrioritizeWorkAtTheTaskLevel.html#//apple_ref/doc/uid/TP40013929-CH35-SW1 * Modules/webaudio/AudioWorkletMessagingProxy.cpp: (WebCore::generateWorkletParameters): * Modules/webaudio/AudioWorkletThread.cpp: (WebCore::AudioWorkletThread::createThread): * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::startRendering): * worklets/WorkletParameters.h: (WebCore::WorkletParameters::isolatedCopy const): 2020-12-14 Peng Liu <peng.liu6@apple.com> [Media in GPU Process][MSE] WebM source buffer parser is not enabled https://bugs.webkit.org/show_bug.cgi?id=219857 Reviewed by Eric Carlson. Function `isWebmParserAvailable()` always return false when `SourceBufferParserWebM` runs in the GPU process because `RuntimeEnabledFeatures::sharedFeatures().webMParserEnabled()` always returns false in the GPU process. Therefore, `MediaSourcePrivateAVFObjC` will not enable the VP9 support when media in GPU process is enabled. This patch moves the call of `RuntimeEnabledFeatures::sharedFeatures().webMParserEnabled()` to `MediaSource`, which always runs in the web process and will get the correct value. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::createSourceBufferPrivate): * platform/graphics/MediaSourcePrivate.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): * platform/graphics/cocoa/SourceBufferParser.cpp: (WebCore::SourceBufferParser::create): * platform/graphics/cocoa/SourceBufferParser.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::isWebmParserAvailable): (WebCore::SourceBufferParserWebM::create): Delete this function because it is not used. * platform/graphics/cocoa/SourceBufferParserWebM.h: * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp: (WebCore::MediaSourcePrivateGStreamer::addSourceBuffer): * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h: * platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::addSourceBuffer): * platform/mock/mediasource/MockMediaSourcePrivate.h: 2020-12-14 Rob Buis <rbuis@igalia.com> Make CachePolicy an enum class https://bugs.webkit.org/show_bug.cgi?id=219856 Reviewed by Alex Christensen. Make CachePolicy an enum class. * loader/FrameLoader.cpp: (WebCore::FrameLoader::subresourceCachePolicy const): * loader/FrameLoader.h: * loader/cache/CachePolicy.h: (): Deleted. * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): (WebCore::CachedResource::makeRevalidationDecision const): * loader/cache/CachedResource.h: * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::determineRevalidationPolicy const): (WebCore::CachedResourceLoader::cachePolicy const): * loader/cache/CachedResourceLoader.h: 2020-12-14 Antoine Quint <graouts@webkit.org> Simplify transform blending for simple cases https://bugs.webkit.org/show_bug.cgi?id=219863 Reviewed by Simon Fraser. Optimize two simple cases for transform blending. First, use matrices as-is for the cases when we blend with progress equal to 0 or 1. Then, when rotating around an angle that's an increment of 360º, simply return the existing matrix. * platform/graphics/transforms/TransformationMatrix.cpp: (WebCore::TransformationMatrix::rotate): (WebCore::TransformationMatrix::blend): 2020-12-14 Wenson Hsieh <wenson_hsieh@apple.com> GPU process sometimes hangs during MotionMark Focus when enabling GPU Process for DOM https://bugs.webkit.org/show_bug.cgi?id=219839 <rdar://problem/71562635> Reviewed by Tim Horton. See Source/WebKit/ChangeLog for more details. * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::prepareToAppendDisplayListItems): (WebCore::ImageBuffer::clearDisplayList): Deleted. Replace this method with `prepareToAppendDisplayListItems`. * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::prepareToAppend): * platform/graphics/displaylists/DisplayList.h: * platform/graphics/displaylists/DisplayListItemBuffer.cpp: (WebCore::DisplayList::ItemBuffer::prepareToAppend): Plumb `prepareToAppendDisplayListItems` through `DisplayList` and into the `DisplayList::ItemBuffer`, as `prepareToAppend`. This method swaps the current writable buffer out for the new `ItemBufferHandle` provided by the caller, and resets the written bytes counter. * platform/graphics/displaylists/DisplayListItemBuffer.h: 2020-12-14 Simon Fraser <simon.fraser@apple.com> Fix rare crashes in Page::lockAllOverlayScrollbarsToHidden() https://bugs.webkit.org/show_bug.cgi?id=219862 <rdar://problem/28205511> Reviewed by Wenson Hsieh. Crash data suggest that lockAllOverlayScrollbarsToHidden() can be called on a null Page*, so check it. * dom/Document.cpp: (WebCore::Document::suspend): (WebCore::Document::resume): 2020-12-14 Andres Gonzalez <andresg_22@apple.com> Fix for accessibility layout tests related to VisiblePositions in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=219807 Reviewed by Chris Fleizach. Tests: accessibility/mac/line-range-for-text-marker.html accessibility/mac/visible-position-crash-for-text-node.html - Moved remaining unimplemented AXIsolatedObject methods from the header to the cpp file and added ASSERT_NOT_REACHED where pertinent. This will allow to identify any method that needs implementation. - Implemented the necessary VisiblePosition methods. - Cleaned up and simplified platform code by calling directly into AXCoreObject methods instead of unnecessary wrappers. * accessibility/AccessibilityObjectInterface.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityLabel]): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::init): (WebCore::AXIsolatedObject::updateChildrenIfNecessary): (WebCore::AXIsolatedObject::accessibilityHitTest): (WebCore::AXIsolatedObject::boundsForVisiblePositionRange const): (WebCore::AXIsolatedObject::lengthForVisiblePositionRange const): (WebCore::AXIsolatedObject::visiblePositionForBounds const): (WebCore::AXIsolatedObject::visiblePositionForPoint const): (WebCore::AXIsolatedObject::nextVisiblePosition const): (WebCore::AXIsolatedObject::previousVisiblePosition const): (WebCore::AXIsolatedObject::nextWordEnd const): (WebCore::AXIsolatedObject::previousWordStart const): (WebCore::AXIsolatedObject::nextLineEndPosition const): (WebCore::AXIsolatedObject::previousLineStartPosition const): (WebCore::AXIsolatedObject::nextSentenceEndPosition const): (WebCore::AXIsolatedObject::previousSentenceStartPosition const): (WebCore::AXIsolatedObject::nextParagraphEndPosition const): (WebCore::AXIsolatedObject::previousParagraphStartPosition const): (WebCore::AXIsolatedObject::visiblePositionForIndex const): (WebCore::AXIsolatedObject::indexForVisiblePosition const): (WebCore::AXIsolatedObject::accessibilityObjectForPosition const): (WebCore::AXIsolatedObject::plainTextRangeForVisiblePositionRange const): (WebCore::AXIsolatedObject::index const): (WebCore::AXIsolatedObject::lineBreaks const): (WebCore::AXIsolatedObject::textUnderElement const): (WebCore::AXIsolatedObject::accessibilityHitTest const): Deleted. * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/AccessibilityObjectBase.mm: (WebCore::AccessibilityObject::titleAttributeValue const): * accessibility/mac/WebAccessibilityObjectWrapperBase.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]): Deleted. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): (-[WebAccessibilityObjectWrapper accessibilityHitTest:]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): 2020-12-14 Emilio Cobos Álvarez <emilio@crisal.io> Implement ::file-selector-button pseudo-element. https://bugs.webkit.org/show_bug.cgi?id=219836 Reviewed by Simon Fraser. Treat it like ::placeholder. Tests: fast/css/css-selector-text.html (plus see the comment in changelog). * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): * css/SelectorPseudoElementTypeMap.in: * css/formControlsIOS.css: (input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::file-selector-button, button): (input:matches([type="button"], [type="reset"]), input[type="file"]::file-selector-button, button): * css/html.css: (input[type="file"]::file-selector-button): (input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::file-selector-button, button): (input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]::file-selector-button:active, button:active): (input:matches([type="button"], [type="submit"], [type="reset"]):active:disabled,): * css/parser/CSSParserSelector.cpp: (WebCore::CSSParserSelector::parsePseudoElementSelector): * css/themeWin.css: (input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::file-selector-button, button): * html/FileInputType.cpp: (WebCore::UploadButtonElement::createInternal): 2020-12-14 Sihui Liu <sihui_liu@apple.com> Implement recognizer for SpeechRecognition https://bugs.webkit.org/show_bug.cgi?id=219459 <rdar://problem/71914465> Reviewed by Youenn Fablet. Add WebSpeechRecognizerTask, which connects to speech recognition service using Speech framework APIs. Tests: fast/speechrecognition/ios/restart-recognition-after-stop.html fast/speechrecognition/ios/start-recognition-then-stop.html * Modules/speech/SpeechRecognizer.cpp: (WebCore::SpeechRecognizer::reset): (WebCore::SpeechRecognizer::abort): (WebCore::SpeechRecognizer::stop): (WebCore::SpeechRecognizer::start): (WebCore::SpeechRecognizer::startCapture): (WebCore::SpeechRecognizer::stopCapture): (WebCore::SpeechRecognizer::dataCaptured): (WebCore::SpeechRecognizer::startRecognition): (WebCore::SpeechRecognizer::abortRecognition): (WebCore::SpeechRecognizer::stopRecognition): (WebCore::SpeechRecognizer::resetRecognition): (WebCore::SpeechRecognizer::setSource): Deleted. (WebCore::SpeechRecognizer::stopInternal): Deleted. * Modules/speech/SpeechRecognizer.h: * Modules/speech/cocoa/SpeechRecognizerCocoa.mm: Added. (WebCore::SpeechRecognizer::dataCaptured): (WebCore::SpeechRecognizer::startRecognition): (WebCore::SpeechRecognizer::stopRecognition): (WebCore::SpeechRecognizer::abortRecognition): (WebCore::SpeechRecognizer::resetRecognition): * Modules/speech/cocoa/WebSpeechRecognizerTask.h: Added. * Modules/speech/cocoa/WebSpeechRecognizerTask.mm: Added. (-[WebSpeechRecognizerTaskImpl initWithIdentifier:locale:doMultipleRecognitions:reportInterimResults:maxAlternatives:delegateCallback:]): (-[WebSpeechRecognizerTaskImpl callbackWithResult:isFinal:]): (-[WebSpeechRecognizerTaskImpl audioSamplesAvailable:]): (-[WebSpeechRecognizerTaskImpl abort]): (-[WebSpeechRecognizerTaskImpl stop]): (-[WebSpeechRecognizerTaskImpl sendSpeechStartIfNeeded]): (-[WebSpeechRecognizerTaskImpl sendSpeechEndIfNeeded]): (-[WebSpeechRecognizerTaskImpl sendEndIfNeeded]): (-[WebSpeechRecognizerTaskImpl speechRecognizer:availabilityDidChange:]): (-[WebSpeechRecognizerTaskImpl speechRecognitionTask:didHypothesizeTranscription:]): (-[WebSpeechRecognizerTaskImpl speechRecognitionTask:didFinishRecognition:]): (-[WebSpeechRecognizerTaskImpl speechRecognitionTaskWasCancelled:]): (-[WebSpeechRecognizerTaskImpl speechRecognitionTask:didFinishSuccessfully:]): (-[WebSpeechRecognizerTask initWithIdentifier:locale:doMultipleRecognitions:reportInterimResults:maxAlternatives:delegateCallback:]): (-[WebSpeechRecognizerTask audioSamplesAvailable:]): (-[WebSpeechRecognizerTask abort]): (-[WebSpeechRecognizerTask stop]): * Modules/speech/cocoa/WebSpeechRecognizerTaskMock.h: Added. * Modules/speech/cocoa/WebSpeechRecognizerTaskMock.mm: Added. (-[WebSpeechRecognizerTaskMock initWithIdentifier:locale:doMultipleRecognitions:reportInterimResults:maxAlternatives:delegateCallback:]): (-[WebSpeechRecognizerTaskMock audioSamplesAvailable:]): (-[WebSpeechRecognizerTaskMock abort]): (-[WebSpeechRecognizerTaskMock stop]): * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: 2020-12-14 Chris Dumez <cdumez@apple.com> [GPUProcess] Crash under AudioDestinationCocoa::setIsPlaying(bool) https://bugs.webkit.org/show_bug.cgi?id=219809 Reviewed by Eric Carlson. The issue is that when using the GPU process, AudioDestination::stop() & start() are asynchronous due to IPC. Those functions take completion handlers and the AudioDestination object makes sure to ref itself to keep itself alive during async operations. However, AudioDestination::m_callback is a raw pointer to the AudioDestinationNode, which may itself become dead if AudioDestination extends its lifetime by ref'ing itself. To address the issue, AudioDestination is not fully owned by AudioDestinationNode. If the AudioDestination needs to keep itself alive, it now ref's its owner (AudioDestinationNode). This ensure that AudioDestination::m_callback never goes stale, even if AudioDestination extends its lifetime by ref'ing itself during async operations. No new tests, covered by existing WebAudio tests currently crashing on the GPU bots. * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::~AudioDestinationNode): * Modules/webaudio/AudioDestinationNode.h: (WebCore::AudioDestinationNode::isPlaying): * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::deref): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::clear): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::~DefaultAudioDestinationNode): (WebCore::DefaultAudioDestinationNode::uninitialize): (WebCore::DefaultAudioDestinationNode::createDestination): * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::~OfflineAudioDestinationNode): * platform/MediaStrategy.h: * platform/audio/AudioDestination.h: (WebCore::AudioDestination::ref): (WebCore::AudioDestination::deref): (WebCore::AudioDestination::AudioDestination): * platform/audio/AudioIOCallback.h: * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestination::create): (WebCore::AudioDestinationCocoa::AudioDestinationCocoa): * platform/audio/cocoa/AudioDestinationCocoa.h: * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::AudioDestination::create): (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer): * platform/mock/MockAudioDestinationCocoa.h: 2020-12-14 Lauro Moura <lmoura@igalia.com> REGRESSSION(270435) [GStreamer] Many media source tests failing and timing out https://bugs.webkit.org/show_bug.cgi?id=219565 Reviewed by Philippe Normand. Fix the recursing calls due to the refactoring of `SourceBufferPrivate`. (As Philippe Normand pointed out and Peng Liu added in the first version of the patch). Also fix the didReceiveInitializationSegment signature after r270612. Covered by existing tests. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::didReceiveInitializationSegment): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment): (WebCore::SourceBufferPrivateGStreamer::didReceiveSample): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: 2020-12-13 Yusuke Suzuki <ysuzuki@apple.com> [JSC] Introduce vmEntryCustomAccessor and vmEntryHostFunction for JITCage https://bugs.webkit.org/show_bug.cgi?id=219847 Reviewed by Mark Lam. * bindings/js/WebCoreJITOperations.cpp: (WebCore::populateJITOperations): * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::populateJITOperations): 2020-12-14 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer][EME][Thunder] Opus should be supported by the decryptor https://bugs.webkit.org/show_bug.cgi?id=219742 Reviewed by Philippe Normand. * platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp: Added Opus to the sink and src caps. 2020-12-14 Youenn Fablet <youenn@apple.com> Pass an isolated copy of Settings to workers and worklets. https://bugs.webkit.org/show_bug.cgi?id=219688 Reviewed by Sam Weinig. Generate a Settings::Values struct containing all setting values. Workers and worklets get that structure from their document and do a thread safe copy to use it in the background thread. Covered by existing tests in workers. * Modules/webaudio/AudioWorkletMessagingProxy.cpp: (WebCore::generateWorkletParameters): * Scripts/SettingsTemplates/Settings.cpp.erb: * Scripts/SettingsTemplates/Settings.h.erb: * dom/Document.h: * dom/EmptyScriptExecutionContext.h: * dom/ScriptExecutionContext.h: * page/Settings.yaml: * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): * workers/WorkerGlobalScope.h: (WebCore::WorkerGlobalScope::requestAnimationFrameEnabled const): (WebCore::WorkerGlobalScope::acceleratedCompositingEnabled const): (WebCore::WorkerGlobalScope::webGLEnabled const): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): * workers/WorkerThread.cpp: (WebCore::WorkerParameters::isolatedCopy const): * workers/WorkerThread.h: * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::ServiceWorkerThread): * workers/service/context/ServiceWorkerThread.h: * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy): * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): * worklets/WorkletGlobalScope.h: * worklets/WorkletParameters.h: (WebCore::WorkletParameters::isolatedCopy const): 2020-12-13 Andy Estes <aestes@apple.com> [Mac] Create a MediaToolbox format reader plug-in for WebM https://bugs.webkit.org/show_bug.cgi?id=218908 <rdar://problem/71373264> Reviewed by Eric Carlson. Updated expected results for existing tests. For contiguous samples, teach MediaSample to remember their position and size in the underlying byte stream. Added a runtime feature flag. Registered the format reader plug-in at runtime. * page/RuntimeEnabledFeatures.h: * platform/MediaSample.h: * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: * platform/graphics/cocoa/SourceBufferParser.cpp: * platform/graphics/cocoa/SourceBufferParser.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: * platform/graphics/cocoa/SourceBufferParserWebM.h: * platform/graphics/gstreamer/MediaSampleGStreamer.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: * platform/network/mac/WebCoreURLResponse.mm: 2020-12-13 Simon Fraser <simon.fraser@apple.com> [LFC Display] The display tree should be owned by the display view https://bugs.webkit.org/show_bug.cgi?id=219840 Reviewed by Sam Weinig. Move ownership of the Display::Tree from Display::LayerController to Display::View, because this ownership model makes more sense. * display/DisplayView.cpp: (WebCore::Display::View::prepareForDisplay): * display/DisplayView.h: (WebCore::Display::View::tree const): * display/compositing/DisplayLayerController.cpp: (WebCore::Display::LayerController::RootLayerClient::paintContents): (WebCore::Display::LayerController::prepareForDisplay): * display/compositing/DisplayLayerController.h: 2020-12-13 Don Olmstead <don.olmstead@sony.com> Move createAppHighlightRangeData into AppHighlightStorage source file https://bugs.webkit.org/show_bug.cgi?id=219834 Reviewed by Devin Rousso. The createAppHighlightRangeData function was defined statically in AppHighlightListData.cpp but was only used in AppHighlightStorage.cpp. Moved the static functions from the former into the later. Additionally added forward declarations in the AppHighlightStorage header. This allows the highlight module to compile with non-unified sources. * Modules/highlight/AppHighlightListData.cpp: (WebCore::computePathIndex): Deleted. (WebCore::createNodePathComponent): Deleted. (WebCore::makeNodePath): Deleted. (WebCore::createAppHiglightRangeData): Deleted. * Modules/highlight/AppHighlightStorage.cpp: (WebCore::computePathIndex): (WebCore::createNodePathComponent): (WebCore::makeNodePath): (WebCore::createAppHighlightRangeData): (WebCore::AppHighlightStorage::createAppHighlightListData): * Modules/highlight/AppHighlightStorage.h: 2020-12-13 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Offset the content logical left by the word-spacing value https://bugs.webkit.org/show_bug.cgi?id=219706 Reviewed by Antti Koivisto. Let's decouple the whitespace width and the word-spacing value. Instead of constructing a 9px long run for whitespace "width: 4px", "word-spacing: 5px", we create a 4px long run at 5px. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::appendTextContent): * layout/inlineformatting/text/TextUtil.cpp: (WebCore::Layout::TextUtil::width): 2020-12-13 Simon Fraser <simon.fraser@apple.com> Add some missing Grid files to the project https://bugs.webkit.org/show_bug.cgi?id=219831 Reviewed by Anders Carlsson. A few Grid files were compiled, but had not been added to the project file. * WebCore.xcodeproj/project.pbxproj: 2020-12-12 Zalan Bujtas <zalan@apple.com> [LFC][IFC] tabCharacter and newlineCharacter are also word separators when not preserved https://bugs.webkit.org/show_bug.cgi?id=219784 Reviewed by Antti Koivisto. * layout/inlineformatting/InlineTextItem.cpp: (WebCore::Layout::isWhitespaceCharacter): (WebCore::Layout::shouldPreserveSpacesAndTabs): (WebCore::Layout::InlineTextItem::createAndAppendTextItems): (WebCore::Layout::InlineTextItem::shouldPreserveSpacesAndTabs): 2020-12-12 Frank Olivier <frankolivier@apple.com> Implement WebVTT VTTCue region attribute https://bugs.webkit.org/show_bug.cgi?id=168716 Reviewed by Eric Carlson. Updated existing region tests. * WebCore.xcodeproj/project.pbxproj: * html/shadow/MediaControlTextTrackContainerElement.cpp: (WebCore::MediaControlTextTrackContainerElement::processActiveVTTCue): * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): (WebCore::TextTrackCueGeneric::setLine): * html/track/TextTrackCueGeneric.h: * html/track/VTTCue.cpp: (WebCore::horizontalKeyword): (WebCore::lineLeftKeyword): (WebCore::lineRightKeyword): (WebCore::autoKeyword): (WebCore::VTTCueBox::applyCSSProperties): (WebCore::VTTCue::setVertical): (WebCore::VTTCue::line const): (WebCore::VTTCue::setLine): (WebCore::VTTCue::lineAlign const): (WebCore::VTTCue::setLineAlign): (WebCore::VTTCue::positionAlign const): (WebCore::VTTCue::setPositionAlign): (WebCore::VTTCue::setAlign): (WebCore::VTTCue::setTrack): (WebCore::VTTCue::setRegion): (WebCore::VTTCue::region): (WebCore::VTTCue::regionId): (WebCore::VTTCue::calculateComputedLinePosition): (WebCore::VTTCue::getDisplayTree): (WebCore::VTTCue::removeDisplayTree): (WebCore::VTTCue::settingName): (WebCore::VTTCue::setCueSettings): (WebCore::VTTCue::toJSON const): (WebCore::VTTCue::setRegionId): Deleted. * html/track/VTTCue.h: (WebCore::VTTCue::line const): Deleted. (WebCore::VTTCue::regionId const): Deleted. * html/track/VTTCue.idl: * rendering/RenderVTTCue.cpp: (WebCore::RenderVTTCue::layout): 2020-12-12 Simon Fraser <simon.fraser@apple.com> Scroll performance logging: rubberbanding should not trigger "Exposed tileless area" logging https://bugs.webkit.org/show_bug.cgi?id=219827 <rdar://problem/72209189> Reviewed by Zalan Bujtas. Clamp the scroll position before computing exposed tile-less area so that rubberbanding doesn't trigger logging that we revealed areas not covered by tiles. * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const): 2020-12-12 Zalan Bujtas <zalan@apple.com> REGRESSION(r270715) [LFC][IFC] Whitespace as expansion opportunity should not change as we expand the runs https://bugs.webkit.org/show_bug.cgi?id=219826 Reviewed by Antti Koivisto. This is the property of the entire run and should be set based on the box and whether the initial part of the run is whitespace or not. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::Run::Run): (WebCore::Layout::Line::Run::expand): (WebCore::Layout::Line::Run::visuallyCollapseTrailingWhitespace): * layout/inlineformatting/InlineLine.h: * layout/inlineformatting/InlineTextItem.cpp: (WebCore::Layout::InlineTextItem::shouldPreserveSpacesAndTabs): * layout/inlineformatting/text/TextUtil.cpp: (WebCore::Layout::TextUtil::shouldPreserveSpacesAndTabs): * layout/inlineformatting/text/TextUtil.h: 2020-12-11 Peng Liu <peng.liu6@apple.com> [Media in GPU Process][MSE] Implement SourceBuffer::reportExtraMemoryAllocated() https://bugs.webkit.org/show_bug.cgi?id=219812 Reviewed by Eric Carlson. Refactor the implementation of `SourceBuffer::reportExtraMemoryAllocated()` to let `SourceBufferPrivate` calculate the extra memory cost and report the value to `SourceBuffer` when necessary. This approach is better than the current one when `SourceBufferPrivate` runs in the GPU process because track buffer management has been moved to `SourceBufferPrivate` in r270435. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::appendBufferInternal): (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): (WebCore::SourceBuffer::sourceBufferPrivateReportExtraMemoryCost): (WebCore::SourceBuffer::reportExtraMemoryAllocated): (WebCore::SourceBuffer::extraMemoryCost const): Deleted. * Modules/mediasource/SourceBuffer.h: * platform/graphics/SourceBufferPrivate.cpp: (WebCore::SourceBufferPrivate::appendCompleted): (WebCore::SourceBufferPrivate::evictCodedFrames): * platform/graphics/SourceBufferPrivateClient.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::append): 2020-12-11 Jiewen Tan <jiewen_tan@apple.com> [WebAuthn] Adopt new UI for the Platform Authenticator getAssertion flow https://bugs.webkit.org/show_bug.cgi?id=219710 <rdar://problem/72154800> Reviewed by Brent Fulgham. Covered by manual tests. * Modules/webauthn/AuthenticatorAssertionResponse.h: (WebCore::AuthenticatorAssertionResponse::laContext const): (WebCore::AuthenticatorAssertionResponse::setLAContext): 2020-12-11 Megan Gardner <megan_gardner@apple.com> Infrastructure to store and restore AppHighlights https://bugs.webkit.org/show_bug.cgi?id=219769 <rdar://problem/70297699> Reviewed by Tim Horton. AppHighlights can be pulled out of their HighlightRegister and encoded for storage by the app. Also, an encoded buffer can be unpacked in ranges added back into the HighlightRegister. Fallbacks for ranges that are not found are not designed yet, so currently they will just be stored with the intention to communicate back to the app that they were not found in the current version of the document. The API to interact with the client is not designed yet, so currently this encoded data does not get shuttle anywhere but that plumbing will be added in a later patch. * Modules/highlight/AppHighlightListData.cpp: Added. (WebCore::computePathIndex): (WebCore::createNodePathComponent): (WebCore::makeNodePath): (WebCore::createAppHiglightRangeData): (WebCore::AppHighlightListData::create): (WebCore::AppHighlightListData::toData const): * Modules/highlight/AppHighlightListData.h: Added. (WebCore::AppHighlightRangeData::NodePathComponent::NodePathComponent): (WebCore::AppHighlightRangeData::NodePathComponent::operator== const): (WebCore::AppHighlightRangeData::NodePathComponent::operator!= const): (WebCore::AppHighlightRangeData::AppHighlightRangeData): (WebCore::AppHighlightRangeData::text const): (WebCore::AppHighlightRangeData::startContainer const): (WebCore::AppHighlightRangeData::startOffset const): (WebCore::AppHighlightRangeData::endContainer const): (WebCore::AppHighlightRangeData::endOffset const): (WebCore::AppHighlightListData::AppHighlightListData): (WebCore::AppHighlightListData::ranges const): (WebCore::AppHighlightListData::setRanges): (WebCore::AppHighlightListData::addRanges): (WebCore::AppHighlightListData::size const): (WebCore::AppHighlightListData::isEmpty const): (WebCore::AppHighlightRangeData::NodePathComponent::encode const): (WebCore::AppHighlightRangeData::NodePathComponent::decode): (WebCore::AppHighlightRangeData::encode const): (WebCore::AppHighlightRangeData::decode): (WebCore::AppHighlightListData::encode const): (WebCore::AppHighlightListData::decode): * Modules/highlight/AppHighlightStorageController.cpp: Added. (WebCore::findNodeByPathIndex): (WebCore::findNodeStartingAtPathComponentIndex): (WebCore::findNode): (WebCore::findRangeByIdentifyingStartAndEndPositions): (WebCore::findRangeBySearchingText): (WebCore::findRange): (WebCore::AppHighlightStorageController::AppHighlightStorageController): (WebCore::AppHighlightStorageController::createAppHighlightListData): (WebCore::AppHighlightStorageController::restoreAppHighlights): * Modules/highlight/AppHighlightStorageController.h: Added. * Modules/mediastream/RTCRtpScriptTransform.cpp: * Modules/mediastream/RTCRtpScriptTransform.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::appHighlightStorageController): (WebCore::Document::updateHighlightPositions): * dom/Document.h: (WebCore::Document::appHighlightStorageControllerIfExists const): 2020-12-11 Jer Noble <jer.noble@apple.com> [WebM] Mark Opus and Vorbis as supported track types. https://bugs.webkit.org/show_bug.cgi?id=219819 Rubber-stamped by Eric Carlson. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::supportedAudioCodecs): 2020-12-11 Jer Noble <jer.noble@apple.com> [Cocoa] Add Experimental VP8 support https://bugs.webkit.org/show_bug.cgi?id=219732 <rdar://problem/72171055> Reviewed by Eric Carlson. Merge error after r270720; Use the local value isKey, rather than querying the VP9 header parser to tell whether the incoming frame is a keyframe. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::VideoTrackData::createSampleBuffer): 2020-12-11 Ryosuke Niwa <rniwa@webkit.org> [GPU Process] Cache Font objects https://bugs.webkit.org/show_bug.cgi?id=219672 Reviewed by Wenson Hsieh. Partially based on the patch made by Said Abou-Hallawa. This patch introduces a mechanism to cache Font objects in the GPU process much the same way NativeImage objects are cached in the GPU process. * platform/graphics/Font.cpp: (WebCore::Font::Font): Restore the same rendering resource identifier when Font object is decoded in the GPU process. (WebCore::Font::renderingResourceIdentifier const): Added. Lazily creates an identifier. This never happens in the GPU process as we set it in the constructor above. * platform/graphics/Font.h: (WebCore::Font::create): Ditto as Font::Font. * platform/graphics/displaylists/DisplayList.h: (WebCore::DisplayList::DisplayList::fonts const): Added. (WebCore::DisplayList::DisplayList::cacheFont): Added. * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp: (WebCore::DisplayList::DrawGlyphsRecorder::recordDrawGlyphs): Call the newly introduced appendDrawGraphsItemWithCachedFont instead of appending DrawGlyphs directly. (WebCore::DisplayList::DrawGlyphsRecorder::drawGlyphs): * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderHarfBuzz.cpp: Ditto. (WebCore::DisplayList::DrawGlyphsRecorder::drawGlyphs): * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderWin.cpp: Ditto. (WebCore::DisplayList::DrawGlyphsRecorder::drawGlyphs): * platform/graphics/displaylists/DisplayListItemBuffer.cpp: (WebCore::DisplayList::ItemHandle::apply): Replaced call to DrawGlyphs::apply with ASSERT_NOT_REACHED since Replayer::applyItem should handle it now. * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawGlyphs::DrawGlyphs): The one used in decode function in GPU process now takes RenderingResourceIdentifier instead of Font and the glyph bounds instead of computing it again here. The one used in WebContent will continue to take Font to copmute the bounds but encodes RenderingResourceIdentifier instead. (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const): Takes Font. (WebCore::DisplayList::DrawGlyphs::apply const): Takes Font. (WebCore::DisplayList::DrawGlyphs::computeBounds): Takes Font. * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::DrawGlyphs::fontIdentifier): Added. (WebCore::DisplayList::DrawGlyphs): No longer retains Font object. (WebCore::DisplayList::DrawGlyphs::encode const): Encodes the bounding rect. (WebCore::DisplayList::DrawGlyphs::decode): Ditto for decoding. * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::appendDrawGraphsItemWithCachedFont): Added. * platform/graphics/displaylists/DisplayListRecorder.h: (WebCore::DisplayList::Recorder::Delegate::cacheFont): Added. * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::Replayer::Replayer): Now takes FontRenderingResourceMap. (WebCore::DisplayList::applyFontItem): Added. (WebCore::DisplayList::Replayer::applyItem): Applies DrawGlyphs with Font in m_fonts. * platform/graphics/displaylists/DisplayListReplayer.h: 2020-12-11 Eric Carlson <eric.carlson@apple.com> [Cocoa] Add Experimental Vorbis support https://bugs.webkit.org/show_bug.cgi?id=219810 <rdar://problem/72242614> Reviewed by Jer Noble. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setVorbisDecoderEnabled): (WebCore::RuntimeEnabledFeatures::vorbisDecoderEnabled const): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::AudioTrackData::consumeFrameData): Support being called with more than one sample. * platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm: (WebCore::isVorbisDecoderAvailable): Check the runtime settings. 2020-12-11 Jer Noble <jer.noble@apple.com> [Cocoa] Add Experimental VP8 support https://bugs.webkit.org/show_bug.cgi?id=219732 Reviewed by Eric Carlson. Newly passing tests: imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer.html imported/w3c/web-platform-tests/media-source/mediasource-seek-during-pending-seek.html imported/w3c/web-platform-tests/media-source/mediasource-seekable.html imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-v-bitrate.html imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-v-framerate.html imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-v-framesize.html imported/w3c/web-platform-tests/media-source/mediasource-invalid-codec.html Parse VP8 video tracks out of WebM files. Add a simple VP8 frame header parser to extract width height and color information out of keyframe headers, and create a CMFormatDescription from that header. Throw an error during parsing if an Audio or Video track is encountered with an unsupported codec. * platform/graphics/VP9Utilities.cpp: (WebCore::parseVPCodecParameters): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::isContentTypeSupported): (WebCore::createFormatDescriptionFromVPCodecConfigurationRecord): (WebCore::createFormatDescriptionFromVP9HeaderParser): (WebCore::parseVP8FrameHeader): (WebCore::createFormatDescriptionFromVP8Header): (WebCore::SourceBufferParserWebM::OnFrame): * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::registerWebKitVP8Decoder): (WebCore::isVP8DecoderAvailable): (WebCore::isVP9CodecConfigurationRecordSupported): (WebCore::isVP8CodecConfigurationRecordSupported): (WebCore::isVPCodecConfigurationRecordSupported): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProvider::registerWebKitVP8Decoder): 2020-12-11 Chris Dumez <cdumez@apple.com> Potential null dereference of m_frame under DocumentLoader::stopLoading() https://bugs.webkit.org/show_bug.cgi?id=219786 <rdar://71945402> Reviewed by Geoffrey Garen. The crash indicates that FrameLoader::stopAllLoaders() is calling m_documentLoader->stopLoading() and that DocumentLoader::m_frame is null, causing DocumentLoader::stopLoading() to do a null dereference of m_frame. I believe 3 things could have happened: 1. DocumentLoader::detachFromFrame() was called on a DocumentLoader but that DocumentLoader somehow stayed attached to the FrameLoader. DocumentLoader::detachFromFrame() is what clears DocumentLoader::m_frame. 2. FrameLoader::setDocumentLoader() was called with a DocumentLoader which already did not have a frame. 3. The Frame was destroyed. DocumentLoader is a FrameDestructionObserver so m_frame would actually get nulled out in case of Frame destruction. Now, I do not believe that 3 is actually possible. We know the FrameLoader is alive here since FrameLoader::stopAllLoaders() is what's calling DocumentLoader::stopLoading(). The Frame owns the FrameLoader so the Frame is alive. Also note that FrameLoader::stopAllLoaders() protects the frame AND dereferences m_frame without crashing *BEFORE* calling DocumentLoader::stopLoading(). Looking at case 1, I believe this is actually possible currently because FrameLoader::setProvisionalDocumentLoader() does not early return when the new DocumentLoader being set is the same one as m_provisionalDocumentLoader. This means that FrameLoader::setProvisionalDocumentLoader() would in such case call DocumentLoader::detachFromFrame() on the DocumentLoader even though it will remain attached to this FrameLoader. Note that FrameLoader::setPolicyDocumentLoader() & FrameLoader::setDocumentLoader() already return early properly in such cases. This patch fixes FrameLoader::setProvisionalDocumentLoader() to early return, thus making issue 1 impossible I believe. Case 2 is a bit harder to fix. We had this debug assertion in FrameLoader::setDocumentLoader(): `ASSERT(!loader || loader->frameLoader() == this);` So in debug builds at least, we are protected against issue 2 because loader->frameLoader() would return null when the loader's frame is null. I turned this debug assertion into a release assertion to help us figure out if this is what's causing this crash. I also made the following changes: - Added release logging to the related code to help debug this in the future if the issue remains. - Do an early return in DocumentLoader::stopLoading() if m_frame is already null to avoid the crash. I added a debug assertion to ensure that m_frame is not null though to see if this is still happening. No new tests, we do not know how this happens at this time. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::stopLoading): (WebCore::DocumentLoader::attachToFrame): (WebCore::DocumentLoader::detachFromFrame): * loader/FrameLoader.cpp: (WebCore::FrameLoader::stopAllLoaders): (WebCore::FrameLoader::setDocumentLoader): (WebCore::FrameLoader::setPolicyDocumentLoader): (WebCore::FrameLoader::setProvisionalDocumentLoader): Return early when the new loader is identical to the existing one, to avoid incorrectly calling detachFromFrame() on it. 2020-12-11 Andy Estes <aestes@apple.com> [Mac] Abstract SourceBufferParser segments https://bugs.webkit.org/show_bug.cgi?id=218908 <rdar://problem/71373264> Reviewed by Eric Carlson. Rather than directly using a Vector, teach SourceBufferParser to use a Segment class. This will allow the underlying segment representation to vary in a follow-on patch. * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm: (WebCore::SourceBufferParserAVFObjC::appendData): * platform/graphics/cocoa/SourceBufferParser.cpp: (WebCore::SourceBufferParser::Segment::Segment): (WebCore::SourceBufferParser::Segment::size const): (WebCore::SourceBufferParser::Segment::read const): (WebCore::SourceBufferParser::Segment::takeVector): * platform/graphics/cocoa/SourceBufferParser.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::appendData): * platform/graphics/cocoa/SourceBufferParserWebM.h: 2020-12-11 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Use InlineTextItem::shouldPreserveSpacesAndTabs throughout the inline line layout code https://bugs.webkit.org/show_bug.cgi?id=219799 Reviewed by Antti Koivisto. Remove redundant local functions. * layout/inlineformatting/InlineContentBreaker.cpp: (WebCore::Layout::InlineContentBreaker::processInlineContent): (WebCore::Layout::shouldKeepBeginningOfLineWhitespace): Deleted. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::appendTextContent): (WebCore::Layout::Line::Run::Run): (WebCore::Layout::Line::Run::expand): (WebCore::Layout::Line::Run::visuallyCollapseTrailingWhitespace): (WebCore::Layout::isWhitespacePreserved): Deleted. * layout/inlineformatting/InlineLine.h: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineCandidate::InlineContent::appendInlineItem): * layout/inlineformatting/text/TextUtil.h: (WebCore::Layout::TextUtil::shouldPreserveTrailingWhitespace): Deleted. 2020-12-11 Aditya Keerthi <akeerthi@apple.com> [iOS][FCR] Add new look for select elements https://bugs.webkit.org/show_bug.cgi?id=219507 <rdar://problem/71951874> Reviewed by Wenson Hsieh. Implement the new in-page appearance for <select> and <select multiple>. The new appearance/behavior of the select popup will be added separately. Tests: fast/forms/ios/form-control-refresh/select/background-color.html fast/forms/ios/form-control-refresh/select/border-radius.html fast/forms/ios/form-control-refresh/select/border.html fast/forms/ios/form-control-refresh/select/multiple-appearance.html fast/forms/ios/form-control-refresh/select/rtl-appearance.html fast/forms/ios/form-control-refresh/select/text-color.html fast/forms/ios/form-control-refresh/select/width-height.html * css/formControlsIOS.css: (select): * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::adjustInnerStyle): (RenderMenuList::layout): Override the layout method so that the border radius can be adjusted to enforce the pill-shaped appearance. Ideally, we should not be adjusting styles during layout. However, for a pill-shaped appearance, the horizontal border radius is dependent on the computed height of the box. This means that the border radius cannot be declared prior to layout, since CSS only allows the horizontal border radius to be dependent on the computed width of the box. Ignoring the style's border radius and forcing a pill-shaped appearance at paint time is not an option, since focus rings and tap highlights will not use the correct border radius. Consequently, we need to adjust the border radius after layout. Note that similar adjustments to style after layout are made in RenderSliderThumb, RenderButton, and RenderTextControlSingleLine. * rendering/RenderMenuList.h: * rendering/RenderTheme.h: (WebCore::RenderTheme::popupInternalPaddingBox const): Added a new parameter, so that the padding can be controlled at runtime. * rendering/RenderThemeAdwaita.cpp: (WebCore::RenderThemeAdwaita::popupInternalPaddingBox const): * rendering/RenderThemeAdwaita.h: * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::popupInternalPaddingBox const): Use a 1em padding, so that the button scales with the font size. (WebCore::canAdjustBorderRadiusForAppearance): Enforce a pill-like shape, only if the author has not specified a custom border radius. (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): (WebCore::RenderThemeIOS::paintMenuListButtonDecorationsWithFormControlRefresh): Paint the appropriate glyph for <select> (a two-headed arrow) and <select multiple> (ellipses). Both glyphs were obtained from SF Symbols. The glyph is painted on the right by default, and on the left if the element's direction is RTL. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::popupInternalPaddingBox const): 2020-12-11 Tim Horton <timothy_horton@apple.com> Trackpad and Mouse scroll events on iPad only fire "pointermove" -- not "wheel" https://bugs.webkit.org/show_bug.cgi?id=210071 <rdar://problem/54616853> Reviewed by Simon Fraser. * page/EventHandler.cpp: (WebCore::EventHandler::handleWheelEventInternal): Fix a minor logic error when WHEEL_EVENT_LATCHING is off; allowScrolling would always be true, even if the set of processing steps does not include any scrolling steps. * rendering/EventRegion.h: (WebCore::EventRegion::encode const): (WebCore::EventRegion::decode): Encode/decode the wheel and passive wheel event regions. 2020-12-11 Peng Liu <peng.liu6@apple.com> [Media in GPU Process][MSE] Implement some required functions with new IPC messages and remove some unneeded functions https://bugs.webkit.org/show_bug.cgi?id=219788 Reviewed by Eric Carlson. Change the argument type of sourceBufferPrivateDidReceiveRenderingError() from int to int64_t so that we can pass it in an IPC message. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): * Modules/mediasource/SourceBuffer.h: * platform/graphics/SourceBufferPrivateClient.h: 2020-12-11 Zalan Bujtas <zalan@apple.com> [LFC][IFC] InlineTextItem::isCollapsible might be misleading https://bugs.webkit.org/show_bug.cgi?id=219796 Reviewed by Antti Koivisto. This change makes the code more aligned with the spec language. ::isCollapsed (which maps to RenderStyle::collapseWhiteSpace) is not always about collapsing subsequent whitespace content but also about preserving tab stops. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::appendTextContent): * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::Run::trailingWhitespaceType const): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::inlineItemWidth const): * layout/inlineformatting/InlineTextItem.cpp: (WebCore::Layout::InlineTextItem::shouldPreserveSpacesAndTabs): * layout/inlineformatting/InlineTextItem.h: (WebCore::Layout::InlineTextItem::isWhitespace const): (WebCore::Layout::InlineTextItem::InlineTextItem): (WebCore::Layout::InlineTextItem::isCollapsible const): Deleted. * layout/inlineformatting/text/TextUtil.cpp: (WebCore::Layout::TextUtil::width): 2020-12-11 Aditya Keerthi <akeerthi@apple.com> Unreviewed. Address post-review comments after r270678. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintColorWellDecorations): Use std::size to determine the size of the color stops array. 2020-12-11 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Line should report the correct value for "content logical right" https://bugs.webkit.org/show_bug.cgi?id=219779 Reviewed by Antti Koivisto. Adjust the run's horizontal geometry when negative margin-start is present. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::appendNonReplacedInlineBox): (WebCore::Layout::Line::appendReplacedInlineBox): * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::contentLogicalRight const): 2020-12-11 Alexey Shvayka <shvaikalesh@gmail.com> Reflect.preventExtensions should not throw if called on WindowProxy or Location https://bugs.webkit.org/show_bug.cgi?id=219270 Reviewed by Darin Adler. Since r254626 fixed Object.preventExtensions to throw a TypeError on `false` result, this patch makes [[PreventExtensions]] overrides pure, aligning Reflect.preventExtensions behavior with the spec [1], Gecko, and (only for WindowProxy [2]) Blink. [1]: https://html.spec.whatwg.org/multipage/history.html#location-preventextensions [2]: https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-preventextensions Tests: imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-prevent-extensions.html imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html imported/w3c/web-platform-tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prevent-extensions.html * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::preventExtensions): * bindings/js/JSLocationCustom.cpp: (WebCore::JSLocation::preventExtensions): * bindings/js/JSRemoteDOMWindowCustom.cpp: (WebCore::JSRemoteDOMWindow::preventExtensions): 2020-12-11 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] Enable accelerated WebGL canvas https://bugs.webkit.org/show_bug.cgi?id=219768 Reviewed by Don Olmstead. TextureMapper has TextureMapperGCGLPlatformLayer that is a PlatformLayer for WebGL. * html/canvas/GPUBasedCanvasRenderingContext.h (isAccelerated): Return true for WinCairo port. 2020-12-11 Fujii Hironori <Hironori.Fujii@sony.com> [TextureMapper] REGRESION(r269570): mask layer doesn't clip descendent layers https://bugs.webkit.org/show_bug.cgi?id=219136 <rdar://problem/71742605> Reviewed by Carlos Garcia Campos. computeOverlapRegions shouldn't include the descendent layer region for layers with a mask layer. Add a new mode Mask to ComputeOverlapRegionMode which is like Union mode but doesn't include descendent layers. Test: compositing/masks/clip-path-composited-descendent-2.html * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeOverlapRegions): Skip children for the Mask mode. (WebCore::TextureMapperLayer::paintUsingOverlapRegions): Use ComputeOverlapRegionMode::Mask for a layer with mask layer. * platform/graphics/texmap/TextureMapperLayer.h (ComputeOverlapRegionMode): Added Mask. 2020-12-11 Don Olmstead <don.olmstead@sony.com> [CMake] Determine correct visibility for linked frameworks https://bugs.webkit.org/show_bug.cgi?id=210366 Reviewed by Michael Catanzaro. Set WebCore_FRAMEWORKS and WebCoreTestSupport_FRAMEWORKS to determine correct linkage for the libraries. Remove explicit setting of STATICALLY_LINKED_WITH_PAL. For the GTK port JavaScriptCore is compiled as a SHARED library with WTF and bmalloc compiled into it. WEBKIT_FRAMEWORK now correctly prevents WTF and bmalloc being linked into targets that also link JavaScriptCore. However GTK port can't be compiled with hidden visibility turned on currently to properly export symbols so the libraries are added back to the list for WebCore to keep the old, albiet wrong, behavior. * CMakeLists.txt: * PlatformGTK.cmake: 2020-12-11 Chris Lord <clord@igalia.com> [GTK][WPE] Async overflow scrolling is disabled by default due to brokenness https://bugs.webkit.org/show_bug.cgi?id=219776 Reviewed by Žan Doberšek. Make sure to respect GraphicsLayer::boundsOrigin when calculating transforms, coverage and clipping in CoordinatedGraphicsLayer. Also, when scrolling overflow areas, change the boundsOrigin on the container layer and not the contents area, to match behaviour on Mac. * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::repositionScrollingLayers): * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintSelfAndChildren): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect): 2020-12-11 Jer Noble <jer.noble@apple.com> [iOS] Adopt AVSystemController_SubscribeToNotificationsAttribute https://bugs.webkit.org/show_bug.cgi?id=219754 <rdar://problem/71352731> Reviewed by Eric Carlson. Ask AVSystemController to send us the notifications we are interested in, making sure to ask again if the server dies. * platform/audio/ios/MediaSessionHelperIOS.mm: (MediaSessionHelperiOS::mediaServerConnectionDied): (-[WebMediaSessionHelper initWithCallback:]): 2020-12-11 Youenn Fablet <youenn@apple.com> Introduce a way to update additional settings than the one handled by policies https://bugs.webkit.org/show_bug.cgi?id=219681 Reviewed by Eric Carlson. Add a way for WebKit additions to update page settings at the time settings are changed by policies. Manually tested. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::applyPoliciesToSettings): * loader/DocumentLoader.h: 2020-12-11 Aditya Keerthi <akeerthi@apple.com> [iOS][FCR] Add new look for color inputs https://bugs.webkit.org/show_bug.cgi?id=219654 <rdar://problem/72107493> Reviewed by Wenson Hsieh. The new appearance matches the appearance of UIKit's UIColorWell. Tests: fast/forms/ios/form-control-refresh/color/background-color.html fast/forms/ios/form-control-refresh/color/border-radius.html fast/forms/ios/form-control-refresh/color/border.html fast/forms/ios/form-control-refresh/color/width-height.html * css/formControlsIOS.css: (input[type="color"]::-webkit-color-swatch-wrapper, input[type="color"]::-webkit-color-swatch): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::adjustStyle): (WebCore::RenderTheme::paint): (WebCore::RenderTheme::paintDecorations): (WebCore::RenderTheme::adjustColorWellStyle const): Call adjustButtonStyle to preserve existing behavior in cases where the form control refresh does not apply (setting disabled, non-iOS ports). (WebCore::RenderTheme::paintColorWell): Call paintButton to preserve existing behavior in cases where the form control refresh does not apply (setting disabled, non-iOS ports). (WebCore::RenderTheme::paintColorWellDecorations): Call paintButtonDecorations to preserve existing behavior in cases where the form control refresh does not apply (setting disabled, non-iOS ports). (WebCore::RenderTheme::colorInputStyleSheet const): * rendering/RenderTheme.h: Previously, color inputs always had the same appearance as buttons. However, with the new appearance on iOS this is no longer always the case. Consequently, it is necessary to introduce adjustColorWellStyle, paintColorWell and paintColorWellDecorations. Updated colorInputStyleSheet to take an additional parameter, so that the style can change depending on whether or not the form control refresh setting is enabled. It is not possible to simply add the new style to formControlsiOS.css, since <input type=color> is another runtime enabled feature. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::colorInputStyleSheet const): (WebCore::RenderThemeIOS::adjustColorWellStyle const): (WebCore::RenderThemeIOS::paintColorWell): (WebCore::RenderThemeIOS::paintColorWellDecorations): Use a conic gradient to achieve the new appearance. * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement): 2020-12-10 Wenson Hsieh <wenson_hsieh@apple.com> REGRESSION (r270458): Canvas painting is broken when enabling GPU process for DOM https://bugs.webkit.org/show_bug.cgi?id=219760 Reviewed by Tim Horton. Use `ImageBuffer::logicalSize` instead of `ImageBuffer::backendSize` when overriding the CanvasBase's size, upon changing image buffers. When enabling GPU process for DOM, `ImageBufferShareableIOSurfaceBackend::backendSize` is empty because the actual IOSurface backend exists in the GPU process; using the backendSize instead of the logical size here would otherwise cause us to always set CanvasBase's size to `(0, 0)`. * html/CanvasBase.cpp: (WebCore::CanvasBase::setImageBuffer const): 2020-12-11 Miguel Gomez <magomez@igalia.com> REGRESSION(r268923): [WPE] Nothing renders on the rpi3 using the proprietary video driver https://bugs.webkit.org/show_bug.cgi?id=219739 Reviewed by Carlos Garcia Campos. Rewrite the GLSL code to perform rounded rectangle clipping so it works with the limitations of the raspberrypi3 proprietary video driver. * platform/graphics/texmap/TextureMapperShaderProgram.cpp: 2020-12-11 Carlos Garcia Campos <cgarcia@igalia.com> Unreviewed. Remove temporary workaround added to fix the build with GCC 10 Revert r269948. The bug has already been fixed in GCC. * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting): 2020-12-10 Alex Christensen <achristensen@webkit.org> Accept click measurement data from hosting application https://bugs.webkit.org/show_bug.cgi?id=219763 <rdar://problem/72121094> Reviewed by John Wilander. Covered by an API test. * loader/PrivateClickMeasurement.h: (WebCore::PrivateClickMeasurement::PrivateClickMeasurement): (WebCore::PrivateClickMeasurement::sourceID const): (WebCore::PrivateClickMeasurement::sourceDescription const): (WebCore::PrivateClickMeasurement::purchaser const): (WebCore::PrivateClickMeasurement::encode const): (WebCore::PrivateClickMeasurement::decode): (WebCore::PrivateClickMeasurement::sourceID): Deleted. 2020-12-10 Peng Liu <peng.liu6@apple.com> [Media in GPU Process][MSE] Implement several methods in SourceBufferPrivateRemote to make seeking more reliable https://bugs.webkit.org/show_bug.cgi?id=219757 Reviewed by Eric Carlson. Clean up the code regarding flush audio and video. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::flush): 2020-12-10 Chris Dumez <cdumez@apple.com> [GPUProcess] Cut in half amount of IPC needed to do WebAudio https://bugs.webkit.org/show_bug.cgi?id=219715 Reviewed by Geoff Garen. Cut in half amount of IPC needed to do WebAudio. Previously, we would send 2 IPCs per rendering quantum: 1. RemoteAudioDestinationProxy::RequestBuffer from GPUProcess to WebProcess 2. The response to RemoteAudioDestinationProxy::RequestBuffer which contained the frame bounds for the RingBuffer. This patch gets rid of IPC 2 by having the CARingBuffer class store its bounds in its memory backing. As a result, when the CARingBuffer is using a shared memory backing, the bounds get shared between processes, without any need for IPC to sync them. This is still too much IPC but this is a step in the right direction. We can hopefully get rid of (or greatly reduce) IPC 1 in a follow-up patch. * platform/audio/cocoa/AudioSampleBufferList.cpp: (WebCore::AudioSampleBufferList::copyFrom): * platform/audio/cocoa/AudioSampleDataSource.mm: (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks): * platform/audio/cocoa/CARingBuffer.cpp: (WebCore::CARingBufferStorageVector::CARingBufferStorageVector): (WebCore::CARingBuffer::CARingBuffer): (WebCore::CARingBuffer::flush): (WebCore::CARingBufferStorageVector::flush): (WebCore::CARingBuffer::setCurrentFrameBounds): (WebCore::CARingBufferStorageVector::setCurrentFrameBounds): (WebCore::CARingBuffer::getCurrentFrameBounds): (WebCore::CARingBuffer::getCurrentFrameBoundsWithoutUpdate): (WebCore::CARingBufferStorageVector::getCurrentFrameBounds): (WebCore::CARingBuffer::clipTimeBounds): (WebCore::CARingBuffer::currentStartFrame const): (WebCore::CARingBufferStorageVector::currentStartFrame const): (WebCore::CARingBuffer::currentEndFrame const): (WebCore::CARingBufferStorageVector::currentEndFrame const): (WebCore::CARingBuffer::updateFrameBounds): (WebCore::CARingBuffer::fetchIfHasEnoughData): (WebCore::CARingBuffer::fetch): (WebCore::CARingBuffer::fetchInternal): * platform/audio/cocoa/CARingBuffer.h: (WebCore::CARingBufferStorage::updateFrameBounds): 2020-12-10 Eric Carlson <eric.carlson@apple.com> [MSE] Refactor SourceBufferParserWebM in preparation for supporting audio https://bugs.webkit.org/show_bug.cgi?id=219755 <rdar://problem/72192625> Reviewed by Jer Noble. Refactor the WebM parser in preparation for supporting audio: move VP9-specific code into VP9UtilitiesCocoa, convert TrackData from a struct to a class and made derived classes for audio and video, add stub function to create format descriptions for Vorbis and Opus audio. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/MediaUtilities.cpp: (WebCore::createAudioFormatDescription): Add optional parameters for magic cookie. * platform/cocoa/MediaUtilities.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::isContentTypeSupported): (WebCore::SourceBufferParserWebM::create): (WebCore::SourceBufferParserWebM::resetParserState): (WebCore::SourceBufferParserWebM::trackDataForTrackNumber): (WebCore::SourceBufferParserWebM::OnTrackEntry): (WebCore::SourceBufferParserWebM::OnFrame): (WebCore::SourceBufferParserWebM::provideMediaData): (WebCore::SourceBufferParserWebM::VideoTrackData::consumeFrameData): (WebCore::SourceBufferParserWebM::VideoTrackData::createSampleBuffer): (WebCore::SourceBufferParserWebM::AudioTrackData::consumeFrameData): (WebCore::SourceBufferParserWebM::AudioTrackData::createSampleBuffer): (WebCore::SourceBufferParserWebM::flushPendingAudioBuffers): (WebCore::SourceBufferParserWebM::setMinimumAudioSampleDuration): (WebCore::convertToColorPrimaries): Deleted. (WebCore::convertToCMColorPrimaries): Deleted. (WebCore::convertToTransferCharacteristics): Deleted. (WebCore::convertToCMTransferFunction): Deleted. (WebCore::convertToMatrixCoefficients): Deleted. (WebCore::convertToCMYCbCRMatrix): Deleted. (WebCore::convertSubsamplingXYToChromaSubsampling): Deleted. (WebCore::createFormatDescriptionFromVP9HeaderParser): Deleted. * platform/graphics/cocoa/SourceBufferParserWebM.h: (isType): * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::convertToColorPrimaries): (WebCore::convertToCMColorPrimaries): (WebCore::convertToTransferCharacteristics): (WebCore::convertToCMTransferFunction): (WebCore::convertToMatrixCoefficients): (WebCore::convertToCMYCbCRMatrix): (WebCore::convertSubsamplingXYToChromaSubsampling): (WebCore::createFormatDescriptionFromVP9HeaderParser): * platform/graphics/cocoa/WebMAudioUtilitiesCocoa.h: Added. * platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm: Added. (WebCore::registerDecoderFactory): (WebCore::createAudioFormatDescriptionForFormat): (WebCore::cookieFromOpusCodecPrivate): (WebCore::isOpusDecoderAvailable): (WebCore::createOpusAudioFormatDescription): (WebCore::cookieFromVorbisCodecPrivate): (WebCore::isVorbisDecoderAvailable): (WebCore::createVorbisAudioFormatDescription): 2020-12-10 Wenson Hsieh <wenson_hsieh@apple.com> [GPU Process] Crash when loading drinktrade.com https://bugs.webkit.org/show_bug.cgi?id=219752 Reviewed by Tim Horton. Fix an overrelease when rendering color emoji fonts by removing an extraneous `adoptCF` around a `CGImageRef`. This `CGImageRef` is not a retained (+1) object, so we need to make sure that it is retained when tracking it in the display list's native image cache. Layout test: fast/text/emoji.html * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp: (WebCore::DisplayList::DrawGlyphsRecorder::recordDrawImage): 2020-12-10 Andres Gonzalez <andresg_22@apple.com> Rework of AXObjectCache::isIsolatedTreeEnabled. https://bugs.webkit.org/show_bug.cgi?id=219722 Reviewed by Chris Fleizach. Covered by existing tests. - AXObjectCache::isIsolatedTreeEnabled now returns true if it is called off the main thread, no matter the rest of the conditions. This is necessary since any call off of the main thread must be handled by the isolated tree. - It caches a true value to optimize the case where a client that supports isolated tree mode makes a request. All subsequent request by any client will be served by the isolated tree. - Moved the check for the WebKit test client to clientSupportsIsolatedTree where it belongs. - Renamed canUseSecondaryAXThread to UsedOnAXThread, which is a more accurate name. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::clientSupportsIsolatedTree): (WebCore::AXObjectCache::isIsolatedTreeEnabled): (WebCore::AXObjectCache::isolatedTreeRootObject): (WebCore::AXObjectCache::usedOnAXThread): (WebCore::AXObjectCache::canUseSecondaryAXThread): Renamed usedOnAXThread. * accessibility/AXObjectCache.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::AXIsolatedTree): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]): 2020-12-10 Wenson Hsieh <wenson_hsieh@apple.com> DisplayList::Recorder::drawImageBuffer should flush the given image buffer before recording https://bugs.webkit.org/show_bug.cgi?id=219748 Reviewed by Darin Adler. Make sure that the source image buffer has been flushed, so that the platform context in the GPU process is flushed along with any outstanding display list items. This codepath is exercised when painting GPU-process- backed canvases into other GPU-process-backed canvases. * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::drawImageBuffer): 2020-12-10 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Cleanup TextUtil::width/split functions https://bugs.webkit.org/show_bug.cgi?id=219697 Reviewed by Antti Koivisto. General cleanup and tightening. * layout/inlineformatting/InlineContentBreaker.cpp: (WebCore::Layout::InlineContentBreaker::processOverflowingContent const): (WebCore::Layout::InlineContentBreaker::tryBreakingTextRun const): * layout/inlineformatting/InlineTextItem.cpp: (WebCore::Layout::InlineTextItem::createAndAppendTextItems): * layout/inlineformatting/InlineTextItem.h: (WebCore::Layout::InlineTextItem::createEmptyItem): * layout/inlineformatting/text/TextUtil.cpp: (WebCore::Layout::TextUtil::width): (WebCore::Layout::TextUtil::split): * layout/inlineformatting/text/TextUtil.h: 2020-12-10 Youenn Fablet <youenn@apple.com> Add a SFrame VP8 experimental compatibility mode https://bugs.webkit.org/show_bug.cgi?id=219674 Reviewed by Eric Carlson. Similarly to H264, prefix the SFrame content with some data to ensure key frames or resolution can be detected without revealing the actual content. Covered by updated test. * Modules/mediastream/RTCRtpSFrameTransform.idl: * Modules/mediastream/RTCRtpSFrameTransformer.cpp: (WebCore::RTCRtpSFrameTransformer::decryptFrame): (WebCore::RTCRtpSFrameTransformer::encryptFrame): * Modules/mediastream/RTCRtpSFrameTransformer.h: * Modules/mediastream/SFrameUtils.cpp: Renamed from Source/WebCore/Modules/mediastream/H264Utils.cpp. (WebCore::computeH264PrefixOffset): (WebCore::computeH264PrefixBuffer): (WebCore::isVP8KeyFrame): (WebCore::computeVP8PrefixOffset): (WebCore::computeVP8PrefixBuffer): * Modules/mediastream/SFrameUtils.h: Renamed from Source/WebCore/Modules/mediastream/H264Utils.h. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-12-10 Don Olmstead <don.olmstead@sony.com> [GTK] Add even more exports to support hidden visibility https://bugs.webkit.org/show_bug.cgi?id=219747 Reviewed by Michael Catanzaro. Add WEBCORE_EXPORT to additional declarations. * platform/graphics/SourceBufferPrivate.h: * platform/graphics/gstreamer/GRefPtrGStreamer.h: 2020-12-10 Peng Liu <peng.liu6@apple.com> [Media in GPU Process][MSE] Implement seeking support https://bugs.webkit.org/show_bug.cgi?id=219658 Reviewed by Jer Noble. Covered by existing tests. * platform/graphics/SourceBufferPrivate.h: Change function `seekToTime()` to virtual because `SourceBufferPrivateRemote` needs to override it. 2020-12-10 Patrick Angle <pangle@apple.com> Web Inspector: Show current properties for font in new Elements sidebar Font panel https://bugs.webkit.org/show_bug.cgi?id=218964 Reviewed by Devin Rousso. Test: inspector/css/getComputedPrimaryFontForNode.html Adds support for retrieving the primary font computed for a node including the available variation axes of the underlying Font. * inspector/agents/InspectorCSSAgent.cpp: (WebCore::buildObjectForFont): (WebCore::InspectorCSSAgent::getFontDataForNode): (WebCore::InspectorCSSAgent::nodeForId): * inspector/agents/InspectorCSSAgent.h: - Added method for retrieving font data for a node. * platform/graphics/FontPlatformData.cpp: (WebCore::FontPlatformData::variationAxes const): - Empty implementation for non-Cocoa platforms. * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::FontVariationAxis::FontVariationAxis): (WebCore::FontPlatformData::FontVariationAxis::name const): (WebCore::FontPlatformData::FontVariationAxis::tag const): (WebCore::FontPlatformData::FontVariationAxis::defaultValue const): (WebCore::FontPlatformData::FontVariationAxis::minimumValue const): (WebCore::FontPlatformData::FontVariationAxis::maximumValue const): - Added struct type for font variation axis information. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::defaultVariationValues): * platform/graphics/cocoa/FontCacheCoreText.h: - Support getting the name of variation axes. * platform/graphics/cocoa/FontPlatformDataCocoa.mm: (WebCore::FontPlatformData::variationAxes const): - Retrieve font variation axes from the underlying font. 2020-12-10 Dean Jackson <dino@apple.com> Add runtime flag for ANGLE on Metal https://bugs.webkit.org/show_bug.cgi?id=219661 <rdar://problem/69061894> Reviewed by Sam Weinig. Add a new RuntimeEnabledFeature for "WebGL on Metal". Check that value when creating the GraphicsContextGL inside WebGL and then pass a new attribute into EGL_GetPlatformDisplay. The value used isn't yet in the tree, but this allows for local testing. No change of behaviour at the moment. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebGLUsingMetal): (WebCore::RuntimeEnabledFeatures::webGLUsingMetal const): * platform/graphics/GraphicsContextGLAttributes.h: New useMetal attribute. * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::InitializeEGLDisplay): (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): 2020-12-10 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Introduce InlineTextItem::isWordSeparator https://bugs.webkit.org/show_bug.cgi?id=219695 Reviewed by Antti Koivisto. This is in preparation for using it to make space for word-spacing. * layout/inlineformatting/InlineItem.cpp: * layout/inlineformatting/InlineItem.h: * layout/inlineformatting/InlineTextItem.cpp: (WebCore::Layout::InlineTextItem::createAndAppendTextItems): * layout/inlineformatting/InlineTextItem.h: (WebCore::Layout::InlineTextItem::isWordSeparator const): (WebCore::Layout::InlineTextItem::createWhitespaceItem): (WebCore::Layout::InlineTextItem::createNonWhitespaceItem): (WebCore::Layout::InlineTextItem::InlineTextItem): (WebCore::Layout::InlineTextItem::left const): (WebCore::Layout::InlineTextItem::right const): 2020-12-10 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Line available width computation should be based on the content logical right. https://bugs.webkit.org/show_bug.cgi?id=219693 Reviewed by Antti Koivisto. This is in preparation for adding proper support for negative word spacing values where the negative value pulls the content on the line to the logical left direction making more space for subsequent content. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::appendInlineBoxStart): (WebCore::Layout::Line::appendTextContent): (WebCore::Layout::Line::appendNonReplacedInlineBox): (WebCore::Layout::Line::appendLineBreak): (WebCore::Layout::Line::appendWordBreakOpportunity): * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::contentLogicalRight const): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::placeInlineContent): (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::handleInlineContent): (WebCore::Layout::LineBuilder::rebuildLine): (WebCore::Layout::LineBuilder::rebuildLineForTrailingSoftHyphen): 2020-12-10 Youenn Fablet <youenn@apple.com> Gate VP9 exposure in MediaCapabilities on VP9DecoderEnabled preference https://bugs.webkit.org/show_bug.cgi?id=219640 Reviewed by Eric Carlson. Add a boolean to enable/disable VP9 exposure. Set it according to page settings. Update scripts to correctly generate setVPXX setters. Expose VP9DecoderEnabled value through internals API. Test: media/mediacapabilities/vp9.html * Modules/mediacapabilities/MediaCapabilities.cpp: (WebCore::MediaCapabilities::decodingInfo): * Scripts/GenerateSettings.rb: * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: (WebCore::createMediaPlayerDecodingConfigurationCocoa): * platform/mediacapabilities/MediaDecodingConfiguration.h: (WebCore::MediaDecodingConfiguration::encode const): (WebCore::MediaDecodingConfiguration::decode): * testing/InternalSettings.cpp: (WebCore::InternalSettings::vp9DecoderEnabled const): * testing/InternalSettings.h: * testing/InternalSettings.idl: 2020-12-10 Youenn Fablet <youenn@apple.com> ICE does not resolve for `turns` relay candidates rooted in LetsEncrypt CA https://bugs.webkit.org/show_bug.cgi?id=219274 Reviewed by Eric Carlson. Introduce a new runtime flag that is used to control whether using the new webrtc socket code path or not. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCPlatformSocketsEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCPlatformSocketsEnabled): 2020-12-10 Aditya Keerthi <akeerthi@apple.com> [iOS][FCR] Add new look for input type=range https://bugs.webkit.org/show_bug.cgi?id=219698 <rdar://problem/72144727> Reviewed by Wenson Hsieh. The new appearance matches the appearance of UIKit's UISlider. Tests: fast/forms/ios/form-control-refresh/range/background-color.html fast/forms/ios/form-control-refresh/range/border.html fast/forms/ios/form-control-refresh/range/datalist.html fast/forms/ios/form-control-refresh/range/style-height.html fast/forms/ios/form-control-refresh/range/style-width.html fast/forms/ios/form-control-refresh/range/value.html * css/formControlsIOS.css: (input[type="range"]::-webkit-slider-thumb, input[type="range"]::-webkit-slider-thumb:active): The pressed appearance of slider thumbs on iOS is the same as the unpressed appearance. * rendering/RenderSlider.cpp: (WebCore::RenderSlider::valueRatio const): * rendering/RenderSlider.h: Added the valueRatio() method so that the appropriate portion of the slider can be filled when the value is non-zero. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::adjustStyle): Consult supportsBoxShadow() rather than unconditionally dropping the box shadow for native controls. * rendering/RenderTheme.h: (WebCore::RenderTheme::supportsBoxShadow const): Preserve the default behavior of dropping box shadows for native controls. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintSliderTrack): (WebCore::RenderThemeIOS::paintSliderThumbDecorations): (WebCore::RenderThemeIOS::paintProgressBar): (WebCore::RenderThemeIOS::supportsBoxShadow const): Slider thumbs rely on box shadows for their appearance. Other controls may also be able to support box shadows; more investigation is needed, which is outside the scope of this patch. (WebCore::RenderThemeIOS::paintProgressBarWithFormControlRefresh): Removed acronym to follow style guidelines. (WebCore::RenderThemeIOS::paintSliderTrackWithFormControlRefresh): 2020-12-10 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Remove redundant Line::lineLogicalLeft https://bugs.webkit.org/show_bug.cgi?id=219704 Reviewed by Antti Koivisto. Now that the line builder tracks the left offset, the line does not need to have this bit anymore. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::appendInlineBoxEnd): (WebCore::Layout::Line::moveLogicalLeft): Deleted. * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::contentLogicalRight const): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::handleFloatContent): 2020-12-10 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Remove old SLL logic of not letting the measured width to be < 0 https://bugs.webkit.org/show_bug.cgi?id=219724 Reviewed by Antti Koivisto. This is in preparation for adding proper negative letter spacing support (similar to negative word spacing). While negative widths seem a bit odd, the line builder will use this information to position the runs properly (offset the run using the negative value and size it to 0.) * layout/inlineformatting/text/TextUtil.cpp: (WebCore::Layout::TextUtil::width): (WebCore::Layout::TextUtil::fixedPitchWidth): 2020-12-10 Youenn Fablet <youenn@apple.com> Expose RTCRtpSFrameTransform as SFrameTransform https://bugs.webkit.org/show_bug.cgi?id=219675 Reviewed by Eric Carlson. Covered by updated tests. * Modules/mediastream/RTCRtpSFrameTransform.idl: * bindings/js/WebCoreBuiltinNames.h: 2020-12-10 Rob Buis <rbuis@igalia.com> Support aspect-ratio on replaced elements https://bugs.webkit.org/show_bug.cgi?id=219200 Reviewed by Darin Adler. Take CSS aspect-ratio into account when calculating replaced element dimensions. * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox const): override the context renderer aspect ratio with the replaced element aspect ratio. (WebCore::RenderReplaced::computeIntrinsicRatioInformation const): compute intrinsicRatio using CSS aspect-ratio information if it is provided. * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::computeIntrinsicRatioInformation const): compute intrinsicRatio using CSS aspect-ratio for SVG root elements. 2020-12-09 Sergio Villar Senin <svillar@igalia.com> [css-flex] RenderFlexibleBox::computeMainSizeFromAspectRatioUsing() must obbey box-sizing https://bugs.webkit.org/show_bug.cgi?id=219690 Reviewed by Darin Adler. The method was not handling the cases in which box-sizing was border-box and thus it was incorrectly using border and padding to compute sizes based on aspect ratios (the aspect ratio must be applied to content box). This fixes 3 subtests from the WPT test suite. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing const): Use a lambda to substract border and padding extent when box-sizing is border-box. (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild): Do not substract border and padding because computeMainSizeFromAspectRatioUsing now always returns the content box size. 2020-12-09 Cathie Chen <cathiechen@igalia.com> Support overscroll-behavior parsing https://bugs.webkit.org/show_bug.cgi?id=219305 Reviewed by Simon Fraser. Based on Frédéric Wang's patch. Support parsing CSS properties: overscroll-behavior, overscroll-behavior-x and overscroll-behavior-y. Tests: fast/css/overscroll-behavior-invalidate-if-disabled.html fast/css/overscroll-behavior-validate-if-enable.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::settings const): (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSComputedStyleDeclaration.h: * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator OverscrollBehavior const): * css/CSSProperties.json: * css/CSSStyleDeclaration.cpp: (WebCore::CSSStyleDeclaration::settings const): (WebCore::CSSStyleDeclaration::namedItem): (WebCore::CSSStyleDeclaration::setNamedItem): (WebCore::CSSStyleDeclaration::supportedPropertyNames const): * css/CSSStyleDeclaration.h: * css/CSSValueKeywords.in: * css/StyleProperties.cpp: (WebCore::StyleProperties::getPropertyValue const): (WebCore::StyleProperties::asText const): * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): (WebCore::operator==): * css/parser/CSSParserContext.h: (WebCore::CSSParserContextHash::hash): * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): (WebCore::CSSParserFastPaths::isKeywordPropertyID): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeOverscrollBehavior): (WebCore::CSSPropertyParser::parseSingleValue): (WebCore::CSSPropertyParser::consumeOverscrollBehaviorShorthand): (WebCore::CSSPropertyParser::parseShorthand): * css/parser/CSSPropertyParser.h: * platform/ScrollTypes.h: * rendering/style/RenderStyle.h: (WebCore::RenderStyle::overscrollBehaviorX const): (WebCore::RenderStyle::overscrollBehaviorY const): (WebCore::RenderStyle::setOverscrollBehaviorX): (WebCore::RenderStyle::setOverscrollBehaviorY): (WebCore::RenderStyle::initialOverscrollBehaviorX): (WebCore::RenderStyle::initialOverscrollBehaviorY): * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: 2020-12-09 Peng Liu <peng.liu6@apple.com> [Media in GPU Process][MSE] Implement basic video playback https://bugs.webkit.org/show_bug.cgi?id=219402 Reviewed by Jer Noble. Implement the video playback support when the MSE media player runs in the GPU process. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::setPrivateAndOpen): Propagate the time fudge factor to `MediaSourcePrivate` so that `SourceBufferPrivate` can use it. (WebCore::MediaSource::setDurationInternal): Propagate the duration information to `MediaSourcePrivate` so that `SourceBufferPrivate` can use it. (WebCore::MediaSource::streamEndedWithError): Mark the stream is end in `MediaSourcePrivate`. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::SourceBuffer): (WebCore::SourceBuffer::~SourceBuffer): (WebCore::SourceBuffer::buffered const): (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): Move the code to update `buffered` to `SourceBufferPrivate` to make sure the `buffered` attribute is updated timely. (WebCore::SourceBuffer::maximumBufferSize const): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): Add a completionHandler parameter to notify the caller (`SourceBufferParser`) that the track buffer manager (`SourceBufferPrivate`) has handled the initialization segment and is ready to receive media samples. (WebCore::SourceBuffer::extraMemoryCost const): (WebCore::SourceBuffer::reportExtraMemoryAllocated): (WebCore::SourceBuffer::setMaximumQueueDepthForTrackID): (WebCore::SourceBuffer::sourceBufferPrivateBufferedDirtyChanged): (WebCore::SourceBuffer::sourceBufferPrivateBufferedRangesChanged): (WebCore::SourceBuffer::isBufferedDirty const): (WebCore::SourceBuffer::setBufferedDirty): (WebCore::SourceBuffer::sourceBufferPrivateHasAudio const): Deleted. (WebCore::SourceBuffer::sourceBufferPrivateHasVideo const): Deleted. * Modules/mediasource/SourceBuffer.h: Some parameters and return values are changed from `size_t` to `uint64_t` because they need to pass with IPC messages when we run the MSE media player in the GPU process. * platform/graphics/MediaSourcePrivate.h: (WebCore::MediaSourcePrivate::setTimeFudgeFactor): (WebCore::MediaSourcePrivate::timeFudgeFactor const): * platform/graphics/SourceBufferPrivate.cpp: (WebCore::SourceBufferPrivate::setBufferedDirty): (WebCore::SourceBufferPrivate::setBufferedRanges): (WebCore::SourceBufferPrivate::updateBufferedFromTrackBuffers): (WebCore::SourceBufferPrivate::appendCompleted): (WebCore::SourceBufferPrivate::bufferedSamplesForTrackID): (WebCore::SourceBufferPrivate::provideMediaData): (WebCore::SourceBufferPrivate::reenqueueMediaForTime): (WebCore::SourceBufferPrivate::reenqueueMediaIfNeeded): (WebCore::removeSamplesFromTrackBuffer): (WebCore::SourceBufferPrivate::evictCodedFrames): (WebCore::SourceBufferPrivate::totalTrackBufferSizeInBytes const): (WebCore::SourceBufferPrivate::addTrackBuffer): (WebCore::SourceBufferPrivate::didReceiveInitializationSegment): (WebCore::SourceBufferPrivate::didReceiveSample): * platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::hasAudio const): (WebCore::SourceBufferPrivate::hasVideo const): (WebCore::SourceBufferPrivate::startChangingType): (WebCore::SourceBufferPrivate::setMaximumQueueDepthForTrackID): (WebCore::SourceBufferPrivate::timeFudgeFactor const): (WebCore::SourceBufferPrivate::setActive): Deleted. (WebCore::SourceBufferPrivate::setCurrentTimeFudgeFactor): Deleted. (WebCore::SourceBufferPrivate::buffered const): Deleted. (WebCore::SourceBufferPrivate::isBufferedDirty const): Deleted. (WebCore::SourceBufferPrivate::setBufferedDirty): Deleted. * platform/graphics/SourceBufferPrivateClient.h: `SourceBufferPrivate` can figure out the values of `hasAudio` and `hasVideo` because it manages the track buffers, so the functions `sourceBufferPrivateHasAudio()` and `sourceBufferPrivateHasVideo()` can be removed. * platform/graphics/VideoTrackPrivate.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC): (WebCore::MediaSourcePrivateAVFObjC::durationChanged): * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm: (WebCore::SourceBufferParserAVFObjC::didParseStreamDataAsAsset): Use a semaphore to hold the parser thread until the track buffer manager has handled the initialization segment. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData): (WebCore::SourceBufferPrivateAVFObjC::appendCompleted): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::timeFudgeFactor const): (WebCore::SourceBufferPrivateAVFObjC::hasVideo const): Deleted. (WebCore::SourceBufferPrivateAVFObjC::hasAudio const): Deleted. * platform/graphics/cocoa/SourceBufferParser.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::OnClusterBegin): * platform/graphics/cocoa/SourceBufferParserWebM.h: The same as `SourceBufferPrivateAVFObjC`. * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp: (WebCore::MediaSourcePrivateGStreamer::durationChanged): (WebCore::MediaSourcePrivateGStreamer::markEndOfStream): (WebCore::MediaSourcePrivateGStreamer::unmarkEndOfStream): * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h: * platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::durationChanged): * platform/mock/mediasource/MockMediaSourcePrivate.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockSourceBufferPrivate::append): (WebCore::MockSourceBufferPrivate::didReceiveInitializationSegment): (WebCore::MockSourceBufferPrivate::setMaximumQueueDepthForTrackID): (WebCore::MockSourceBufferPrivate::hasVideo const): Deleted. (WebCore::MockSourceBufferPrivate::hasAudio const): Deleted. * platform/mock/mediasource/MockSourceBufferPrivate.h: 2020-12-09 Wenson Hsieh <wenson_hsieh@apple.com> [GPU Process] Allow form controls to be painted when iOS form control refresh is enabled https://bugs.webkit.org/show_bug.cgi?id=219718 Reviewed by Tim Horton. Ensures that form controls show up when using the GPU process, when the iOS form control refresh setting is enabled. All form controls post-refresh are implemented in such a way that they're compatible with graphics contexts in the web process that are not backed by platform graphics context objects. See below for more details. This was added as a temporary workaround to avoid crashing when enabling GPU process in r199037. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::paint): * rendering/RenderTheme.h: Makes `RenderTheme::canPaint` true by default on the base `RenderTheme` class, so that all platforms don't need to individually override it and return true. Additionally plumbs a `WebCore::Settings` object through this method, so that we can consult it on iOS. (WebCore::RenderTheme::canPaint const): * rendering/RenderThemeAdwaita.h: * rendering/RenderThemeCocoa.h: * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::canPaint const): Deleted. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::canPaint const): When iOS form control refresh is enabled, return true; otherwise, return true only if there is a platform `CGContextRef`. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::canPaint const): Preserve existing behavior by returning true here if (and only if) there is a platform `CGContextRef`. * rendering/RenderThemePlayStation.h: * rendering/RenderThemeWin.h: 2020-12-09 Andres Gonzalez <andresg_22@apple.com> Fix for focus tracking in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=219662 Reviewed by Chris Fleizach. Covered by existing tests. - AXIsolatedTree::setFocusedNodeID and applyPendingChanges now properly handle the focused node ID update when the focused object changes. - AccessibilityObject::setFocused sets focus and activates the corresponding view. This was done in the wrapper baseAccessibilitySetFocus method, but this is a more appropriate place for this core functionality. - Some code cleanup, ASSERT checks of appropriate thread, and additional logging. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::setFocused): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::setFocused): * accessibility/AccessibilityScrollView.cpp: (WebCore::AccessibilityScrollView::setFocused): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilitySetFocus:]): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::page const): (WebCore::AXIsolatedObject::document const): (WebCore::AXIsolatedObject::documentFrameView const): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::applyPendingChanges): * accessibility/mac/WebAccessibilityObjectWrapperBase.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase baseAccessibilitySetFocus:]): Deleted, not needed since core functionality is now in AccessibilityObject::setFocused. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]): 2020-12-09 Said Abou-Hallawa <said@apple.com> [GPU Process]: Recording an in-process ImageBuffer drawing has to convert it to a NativeImage first https://bugs.webkit.org/show_bug.cgi?id=219705 Reviewed by Wenson Hsieh. We will allow GraphicsContext::drawImageBuffer() to proceed with the painting code path if the ImageBuffer is not a RemoteImageBuffer. In this case ImageBuffer::draw() extracts a NativeImage from the ImageBuffer and calls GraphicsContext::drawNativeImage() which will send the NativeImage to GPUP. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawImageBuffer): * platform/graphics/GraphicsContextImpl.h: (WebCore::GraphicsContextImpl::canDrawImageBuffer const): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::canDrawImageBuffer const): * platform/graphics/displaylists/DisplayListRecorder.h: (WebCore::DisplayList::Recorder::Delegate::isCachedImageBuffer const): 2020-12-09 John Wilander <wilander@apple.com> PCM: Make JSON key names use underscores according to the W3C conversation https://bugs.webkit.org/show_bug.cgi?id=219696 <rdar://problem/72143642> Reviewed by Brent Fulgham. Further discussion in https://github.com/privacycg/private-click-measurement/issues/30 concluded that the JSON report should use underscores in its keys instead of dashes. This patch makes that change and shortens the "report_version" key to just "version". Existing tests updated. * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::json const): 2020-12-09 Antoine Quint <graouts@webkit.org> text-decoration-color animation should not be discrete https://bugs.webkit.org/show_bug.cgi?id=219691 <rdar://problem/72138361> Reviewed by Simon Fraser. We mistakenly added animation support for text-decoration-color in r269812 as a discrete property. We now correctly make it a property that supports interpolation of the color type. * animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): 2020-12-09 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r270544 and r270569. Caused two editing tests to consistently crash on iOS Reverted changesets: "[LFC][Integration] Invalidate line layout path for children of inlines" https://bugs.webkit.org/show_bug.cgi?id=219639 https://trac.webkit.org/changeset/270544 "Unreviewed. Add missing LFC guards around LineLayout usage from r270544" https://trac.webkit.org/changeset/270569 2020-12-09 Antti Koivisto <antti@apple.com> Font loads are triggered too late https://bugs.webkit.org/show_bug.cgi?id=219678 Reviewed by Geoffrey Garen. CSSFontSelector triggers font loads on zero duration timer after style resolution. This can get delayed substantially and all sorts of less important loads (for example CSS images triggered during render tree building) may go out first. * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::beginLoadingFontSoon): (WebCore::CSSFontSelector::loadPendingFonts): Factor the actual load triggering into a function. (WebCore::CSSFontSelector::fontLoadingTimerFired): Timer still takes care of the checkLoadComplete. (WebCore::CSSFontSelector::suspend): (WebCore::CSSFontSelector::resume): * css/CSSFontSelector.h: * dom/Document.cpp: (WebCore::Document::resolveStyle): Trigger font loads right after style resolution, before render tree building. 2020-12-09 Antoine Quint <graouts@webkit.org> REGRESSION (r269812): Amazon Prime: thumbnail fails to expand properly https://bugs.webkit.org/show_bug.cgi?id=219692 <rdar://problem/71878636> Reviewed by Simon Fraser. We regressed hovering over titles on the main page of Amazon Prime Video since those hover effects change "position" from "static" to "absolute" and have "transition-property" set to "all". The CSS Transitions specification defines the following in its "Starting of transitions" section (https://drafts.csswg.org/css-transitions/#starting): "When comparing the before-change style and after-change style for a given property, the property values are transitionable if they have an animation type that is neither not animatable nor discrete." AnimationTimeline::updateCSSTransitionsForStyleableAndProperty(), which implements the specification text of the "Starting of transitions" section, relies on CSSPropertyAnimation::canPropertyBeInterpolated() to determine whether a property can be interpolated. This function, in turn, uses the AnimationPropertyWrapperBase method canInterpolate() to determine support for interpolation. When adding support for discrete properties, we neglected to make DiscretePropertyWrapper implement this method and return false, which we correct in this patch. Fixing this uncovered two issues. First, the WPT test css/css-transitions/properties-value-003.html incorrectly thinks that the "position" property can be interpolated and start transitions. The WPT issue #26822 deals with this issue. Second, text-decoration-color is mistakenly marked as discrete in our implementation. This will be dealt with in bug 219691. * animation/CSSPropertyAnimation.cpp: 2020-12-09 Kimmo Kinnunen <kkinnunen@apple.com> Implement RemoteGraphicsContextGL https://bugs.webkit.org/show_bug.cgi?id=217216 <rdar://problem/69876258> Reviewed by Simon Fraser. Implements a beginning of a remote version of GraphicsContextGL for GPU process. Current implementation is using WebKit IPC. Implemented with a generator script implementing the IPC to pass the GraphicsContextGL member function calls from web process to the GPU process. The script is run during development time and the results are committed to the repo for ease of review. Extracts an interface GraphicsContextGLIOSurfaceSwapChain which is used to submit IOSurfaces from GraphicsContextGLOpenGL. For web process WebGL, these go to WebGLLayer. For GPU process WebGL, the IOSurfaces go to the prepareForDisplay caller, e.g. the RemoteGraphicsContextGL, which then return the IOSurfaces back to Web process side. RemoteGraphicsContextGLProxy will send them to WebGLLayer. No new tests, tested by existing webgl tests once the implementation works. * PlatformMac.cmake: * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getBufferSubData): (WebCore::WebGL2RenderingContext::vertexAttribI4uiv): (WebCore::WebGL2RenderingContext::getQueryParameter): (WebCore::WebGL2RenderingContext::bindSampler): (WebCore::WebGL2RenderingContext::getSamplerParameter): (WebCore::WebGL2RenderingContext::clientWaitSync): (WebCore::WebGL2RenderingContext::deleteTransformFeedback): (WebCore::WebGL2RenderingContext::beginTransformFeedback): (WebCore::WebGL2RenderingContext::endTransformFeedback): (WebCore::WebGL2RenderingContext::transformFeedbackVaryings): (WebCore::WebGL2RenderingContext::getActiveUniforms): (WebCore::WebGL2RenderingContext::readPixels): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): (WebCore::WebGLRenderingContextBase::readPixels): * html/canvas/WebGLSync.cpp: (WebCore::WebGLSync::updateCache): * page/Chrome.cpp: (WebCore::Chrome::createGraphicsContextGL const): (WebCore::Chrome::windowScreenDidChange): * page/Chrome.h: * page/ChromeClient.h: (WebCore::ChromeClient::createGraphicsContextGL const): * platform/HostWindow.h: * platform/RuntimeApplicationChecks.h: (WebCore::isInGPUProcess): * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::isInGPUProcess): * platform/graphics/ExtensionsGL.h: * platform/graphics/GraphicsContextGL.cpp: (WebCore::GraphicsContextGL::create): * platform/graphics/GraphicsContextGL.h: * platform/graphics/GraphicsTypesGL.h: (GCGLSpan::GCGLSpan): (GCGLSpan<GCGLvoid>::GCGLSpan): * platform/graphics/RemoteGraphicsContextGLProxyBase.cpp: Added. (WebCore::RemoteGraphicsContextGLProxyBase::RemoteGraphicsContextGLProxyBase): (WebCore::RemoteGraphicsContextGLProxyBase::platformGraphicsContextGL const): (WebCore::RemoteGraphicsContextGLProxyBase::platformTexture const): (WebCore::RemoteGraphicsContextGLProxyBase::getExtensions): (WebCore::RemoteGraphicsContextGLProxyBase::setContextVisibility): (WebCore::RemoteGraphicsContextGLProxyBase::powerPreferenceUsedForCreation const): (WebCore::RemoteGraphicsContextGLProxyBase::isGLES2Compliant const): (WebCore::RemoteGraphicsContextGLProxyBase::markContextChanged): (WebCore::RemoteGraphicsContextGLProxyBase::markLayerComposited): (WebCore::RemoteGraphicsContextGLProxyBase::layerComposited const): (WebCore::RemoteGraphicsContextGLProxyBase::setBuffersToAutoClear): (WebCore::RemoteGraphicsContextGLProxyBase::getBuffersToAutoClear const): (WebCore::RemoteGraphicsContextGLProxyBase::paintCompositedResultsToCanvas): (WebCore::RemoteGraphicsContextGLProxyBase::enablePreserveDrawingBuffer): (WebCore::RemoteGraphicsContextGLProxyBase::supports): (WebCore::RemoteGraphicsContextGLProxyBase::ensureEnabled): (WebCore::RemoteGraphicsContextGLProxyBase::isEnabled): (WebCore::RemoteGraphicsContextGLProxyBase::initialize): (WebCore::RemoteGraphicsContextGLProxyBase::platformInitialize): (WebCore::RemoteGraphicsContextGLProxyBase::platformLayer const): * platform/graphics/RemoteGraphicsContextGLProxyBase.h: Added. * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::ExtensionsGLANGLE): (WebCore::ExtensionsGLANGLE::getGraphicsResetStatusARB): (WebCore::ExtensionsGLANGLE::getTranslatedShaderSourceANGLE): (WebCore::ExtensionsGLANGLE::blitFramebufferANGLE): (WebCore::ExtensionsGLANGLE::renderbufferStorageMultisampleANGLE): (WebCore::ExtensionsGLANGLE::drawArraysInstancedANGLE): (WebCore::ExtensionsGLANGLE::drawElementsInstancedANGLE): (WebCore::ExtensionsGLANGLE::vertexAttribDivisorANGLE): (WebCore::ExtensionsGLANGLE::getUniformuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformivRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformuivRobustANGLE): * platform/graphics/angle/ExtensionsGLANGLE.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::readnPixels): (WebCore::GraphicsContextGLOpenGL::readnPixelsImpl): (WebCore::GraphicsContextGLOpenGL::getBufferSubData): (WebCore::GraphicsContextGLOpenGL::getActiveUniforms): (WebCore::GraphicsContextGLOpenGL::getQueryObjectui): (WebCore::GraphicsContextGLOpenGL::getSamplerParameterf): (WebCore::GraphicsContextGLOpenGL::getSamplerParameteri): (WebCore::GraphicsContextGLOpenGL::getSynci): * platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.cpp: Added. * platform/graphics/cocoa/GraphicsContextGLIOSurfaceSwapChain.h: Copied from Source/WebCore/platform/graphics/cocoa/WebGLLayer.h. * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::InitializeEGLDisplay): (WebCore::GraphicsContextGLOpenGL::create): (WebCore::GraphicsContextGLOpenGL::createShared): (WebCore::GraphicsContextGLOpenGL::createForGPUProcess): (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::reshapeDisplayBufferBacking): (WebCore::GraphicsContextGLOpenGL::allocateAndBindDisplayBufferBacking): (WebCore::GraphicsContextGLOpenGL::allowOfflineRenderers const): (WebCore::GraphicsContextGLOpenGL::prepareForDisplay): * platform/graphics/cocoa/RemoteGraphicsContextGLProxyBaseCocoa.mm: Added. (WebCore::RemoteGraphicsContextGLProxyBase::platformInitialize): (WebCore::RemoteGraphicsContextGLProxyBase::platformLayer const): (WebCore::RemoteGraphicsContextGLProxyBase::asCV): (WebCore::RemoteGraphicsContextGLProxyBase::platformSwapChain): * platform/graphics/cocoa/WebGLLayer.h: * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer initWithDevicePixelRatio:contentsOpaque:]): (-[WebGLLayer swapChain]): (-[WebGLLayer prepareForDisplay]): (-[WebGLLayer display]): (WebGLLayerSwapChain::present): * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm: * platform/graphics/opengl/ExtensionsGLOpenGL.cpp: (WebCore::ExtensionsGLOpenGL::blitFramebufferANGLE): (WebCore::ExtensionsGLOpenGL::renderbufferStorageMultisampleANGLE): (WebCore::ExtensionsGLOpenGL::drawArraysInstancedANGLE): (WebCore::ExtensionsGLOpenGL::drawElementsInstancedANGLE): (WebCore::ExtensionsGLOpenGL::vertexAttribDivisorANGLE): * platform/graphics/opengl/ExtensionsGLOpenGL.h: * platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp: (WebCore::ExtensionsGLOpenGLCommon::readnPixelsRobustANGLE): * platform/graphics/opengl/ExtensionsGLOpenGLCommon.h: * platform/graphics/opengl/ExtensionsGLOpenGLES.cpp: (WebCore::ExtensionsGLOpenGLES::blitFramebufferANGLE): (WebCore::ExtensionsGLOpenGLES::renderbufferStorageMultisampleANGLE): (WebCore::ExtensionsGLOpenGLES::drawArraysInstancedANGLE): (WebCore::ExtensionsGLOpenGLES::drawElementsInstancedANGLE): (WebCore::ExtensionsGLOpenGLES::vertexAttribDivisorANGLE): * platform/graphics/opengl/ExtensionsGLOpenGLES.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::drawArraysInstanced): (WebCore::GraphicsContextGLOpenGL::drawElementsInstanced): (WebCore::GraphicsContextGLOpenGL::vertexAttribDivisor): (WebCore::GraphicsContextGLOpenGL::getBufferSubData): (WebCore::GraphicsContextGLOpenGL::getQueryObjectui): (WebCore::GraphicsContextGLOpenGL::getSamplerParameterf): (WebCore::GraphicsContextGLOpenGL::getSamplerParameteri): (WebCore::GraphicsContextGLOpenGL::getSynci): (WebCore::GraphicsContextGLOpenGL::getActiveUniforms): * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp: (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): 2020-12-09 Chris Dumez <cdumez@apple.com> [GPUProcess] Video does not resume if the GPU Process crashes while in fullscreen https://bugs.webkit.org/show_bug.cgi?id=219660 Reviewed by Darin Adler. When the GPU process was crashing while a video was playing in full screen (very common on iOS), we would attempt to resume playback but video rendering was broken. It looks like this should be recoverable in some way since changing the orientation of the device makes the video render again. However, the full screen logic lives in the UIProcess and I could not figure out how to recover nicely. As a result, this patch simply exits fullscreen when the GPU process crashes. I have verified that the video renders properly if the user re-enter full screen after a crash. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::reloadAndResumePlaybackIfNeeded): 2020-12-08 Megan Gardner <megan_gardner@apple.com> Allow App Highlight without turning on Experimental Feature Flag https://bugs.webkit.org/show_bug.cgi?id=219668 Reviewed by Wenson Hsieh. The same painting infrastructure is used to paint app highlights as well as JavaScript highlights, but the both were gated on the experimental feature flag for the JavaScript highlights when painting text. The app highlights should not have such a barrier. Conversely, painting the JavaScript highlights was not gated when painting images. That should be behind the feature flag check. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::collectMarkedTextsForHighlights const): * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::calculateHighlightColor const): 2020-12-09 Carlos Garcia Campos <cgarcia@igalia.com> WebDriver: add support for pen pointer events https://bugs.webkit.org/show_bug.cgi?id=219024 Reviewed by Brian Burg. * Headers.cmake: * dom/Element.cpp: (WebCore::dispatchPointerEventIfNeeded): Pass pointer ID and pointer type to pointerEventForMouseEvent(). * dom/PointerEvent.cpp: (WebCore::PointerEvent::create): Add pointer ID and pointer type parameters. (WebCore::PointerEvent::PointerEvent): Ditto. * dom/PointerEvent.h: * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::pointerEventForMouseEvent): Do not assume the pointer type is always mouse. We might not have a capturing data yet for other pointer types. (WebCore::PointerCaptureController::pointerEventWillBeDispatched): Explicilty check it's not touch pointer event. * page/PointerCaptureController.h: * platform/PlatformMouseEvent.h: (WebCore::PlatformMouseEvent::pointerType const): 2020-12-09 Chris Dumez <cdumez@apple.com> Build error after r270457 https://bugs.webkit.org/show_bug.cgi?id=219676 Unreviewed, fix ARM NEON build after r270457. * platform/audio/SincResampler.cpp: (WebCore::SincResampler::convolve): 2020-12-02 Sergio Villar Senin <svillar@igalia.com> Multicolumn children becoming in-flow elements should be inserted into the multicolumn flow https://bugs.webkit.org/show_bug.cgi?id=218503 Reviewed by Zalan Bujtas. Out of flow children of a multicolumn container are not really part of the multicolumn flow. Making them in-flow (i.e. setting "position: static;") should trigger the code that inserts them into the MultiColumnFlowThread object of the multicolumn container. RenderTreeBuilder was handling this in-flow <-> out-of-flow changes just for the cases in which the inline status of an element was affecting the parent. * rendering/RenderMultiColumnFlow.cpp: (WebCore::RenderMultiColumnFlow::normalizeTreeAfterStyleChange): Insert renderer in the multicolumn flow thread whenever it becames in flow. 2020-12-04 Sergio Villar Senin <svillar@igalia.com> [css-flex] Implement 9.8.1 Definite and Indefinite Sizes https://bugs.webkit.org/show_bug.cgi?id=219538 Reviewed by Manuel Rego Casasnovas. If a single-line flex container has a definite cross size, the automatic preferred outer cross size of any stretched flex items is the flex container's inner cross size (clamped to the flex item's min and max cross size) and is considered definite. Before that we were considering all automatic sizes as indefinite. This patch does not consider all the cases where the container cross size is definite but just when that size is fixed. Support for additional cases should be added in followup patches. This fixes 3 full tests plus 24 subtests in some other flexbox aspect ratio tests from the WPT suite. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing const): Use the container's cross size as the item's cross size. (WebCore::RenderFlexibleBox::childCrossSizeIsDefinite const): Consider automatic cross size inside a single line container with definite cross size as definite. 2020-12-09 Per Arne Vollan <pvollan@apple.com> [macOS] Change Universal Access zoom in the UI process https://bugs.webkit.org/show_bug.cgi?id=219635 Reviewed by Darin Adler. Currently, the API UAZoomChangeFocus is called in the WebContent process when Universal Access zoom is enabled. To enable us to block the HI service com.apple.hiservices-xpcservice in the WebContent process, this call should be performed in the UI process. This patch implements this by having the page chrome client send a message to the UI process, which will change the zoom. No new tests, since enabling Universal Access zoom is required to test this. * WebCore.xcodeproj/project.pbxproj: * editing/mac/FrameSelectionMac.mm: (WebCore::FrameSelection::notifyAccessibilityForSelectionChange): * editing/mac/UniversalAccessZoom.h: Added. * editing/mac/UniversalAccessZoom.mm: Added. (WebCore::changeUniversalAccessZoomFocus): * page/ChromeClient.h: (WebCore::ChromeClient::changeUniversalAccessZoomFocus): * platform/PlatformScreen.h: 2020-12-09 Sihui Liu <sihui_liu@apple.com> Implement audio capture for SpeechRecognition on iOS https://bugs.webkit.org/show_bug.cgi?id=219371 <rdar://problem/71824049> Reviewed by Youenn Fablet. Add a way to set RealtimeMediaSource member of SpeechRecognitionCaptureSourceImpl. Test: fast/speechrecognition/ios/audio-capture.html * Headers.cmake: * Modules/speech/SpeechRecognitionCaptureSource.cpp: (WebCore::SpeechRecognitionCaptureSource::findCaptureDevice): (WebCore::SpeechRecognitionCaptureSource::createRealtimeMediaSource): (WebCore::SpeechRecognitionCaptureSource::SpeechRecognitionCaptureSource): * Modules/speech/SpeechRecognitionCaptureSource.h: * Modules/speech/SpeechRecognizer.cpp: (WebCore::SpeechRecognizer::reset): (WebCore::SpeechRecognizer::start): (WebCore::SpeechRecognizer::setSource): (WebCore::SpeechRecognizer::startInternal): Deleted. * Modules/speech/SpeechRecognizer.h: * WebCore.xcodeproj/project.pbxproj: 2020-12-08 Rob Buis <rbuis@igalia.com> Dirty line boxes when RenderMenuList text changes https://bugs.webkit.org/show_bug.cgi?id=218488 Reviewed by Darin Adler. Dirty line boxes when RenderMenuList selection text changes and we have an existing m_buttonText, in order to ensure its content gets laid out properly. * rendering/RenderMenuList.cpp: (RenderMenuList::setText): 2020-12-08 Diego Pino Garcia <dpino@igalia.com> [GLIB] REGRESSION(r270526): Several URL related tests are failing https://bugs.webkit.org/show_bug.cgi?id=219664 Reviewed by Alex Christensen. r270526 changed the behaviour of shouldRemoveFragmentIdentifier for non-Apple ports. It should return true. * platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::shouldRemoveFragmentIdentifier): 2020-12-08 Lauro Moura <lmoura@igalia.com> Unreviewed. Add missing LFC guards around LineLayout usage from r270544 Fix build when LFC is disabled, like in Ubuntu LTS/Debian Stable bots. * rendering/RenderObject.cpp: (WebCore::RenderObject::insertedIntoTree): (WebCore::RenderObject::willBeRemovedFromTree): * rendering/RenderText.cpp: (WebCore::RenderText::setText): 2020-12-08 Alex Christensen <achristensen@webkit.org> Increase maximum size of WKContentRuleList https://bugs.webkit.org/show_bug.cgi?id=219626 <rdar://problem/69175732> Reviewed by Geoffrey Garen. The process that compiles WKContentRuleLists has a soft memory limit of 150MB. We can go over it slightly, but doing so dramatically increases our chance of being jetsammed and never succeeding, which we want to avoid. When originally developing WKContentRuleLists, we had to tune 2 limiting factors to prevent memory use from exponential growth: maxNFASize and maxRuleCount. We have received the most complaints about maxRuleCount being only 50000, so I decided to see if we could increase it. In r270414 I did a technical improvement that could allow us to increase maxRuleCount. I just completed some iOS device measurements to determine what the new limit will be. They were done by taking some popular content blockers from the app store that separate their rules into several rule lists and combining them into one list to see what will happen in practice when we increase the limits. Then, I measured the peak memory use spike. Here is my data: Revision, Rule list length, Max Memory Use r270413 64779 134MB r270413 122475 361MB r270414 64779 119MB r270414 122475 146MB Given this data and the fact that it is a soft memory limit, I am changing maxRuleCount to 150000. It is also comforting to see the measurement of r270414 actually decreasing maximum memory use, especially with the longest rule lists. I also measured the effect of changing maxNFASize after r270414: Rule list length, maxNFASize, Max Memory Use, NFA count in compileToBytecode 64779 75000 119MB 1105 64779 250000 318MB 1102 64779 1000000 405MB 1101 122475 75000 146MB 1129 122475 250000 335MB 1127 122475 1000000 340MB 1127 Lower NFA counts means fewer passes on each URL loaded, which increases performance of WebKit with content blockers. Given that increasing maxNFASize greatly increases the max memory use without significantly decreasing the NFA count, I decided to leave that parameter tuned to where it was already, 75000 nodes. The number of NFAs is still uncomfortably high, but the cause is not maxNFASize. We should investigate the splitting of the NFAs in the compiler and consider ways to split into fewer NFAs if we can, but that should be done at another time. * contentextensions/ContentExtensionParser.cpp: (WebCore::ContentExtensions::loadEncodedRules): 2020-12-08 Fujii Hironori <Hironori.Fujii@sony.com> Add ANGLEHeaders.h to include all ANGLE headers for WebGL https://bugs.webkit.org/show_bug.cgi?id=219629 Reviewed by Kenneth Russell. There were the similar #include and #define code in some files. Add a new header to include all ANGLE headers required for USE_ANGLE build configuration. * WebCore.xcodeproj/project.pbxproj: * platform/graphics/ANGLEWebKitBridge.h: * platform/graphics/angle/ANGLEHeaders.h: Added. * platform/graphics/angle/ExtensionsGLANGLE.cpp: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: * platform/graphics/angle/GraphicsContextGLANGLEUtilities.h: * platform/graphics/angle/TemporaryANGLESetting.cpp: * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp: * platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp: * platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp: 2020-12-08 Said Abou-Hallawa <said@apple.com> REGRESSION(r254841): Possible null pointer reference in BitmapImage::preTransformedNativeImageForCurrentFrame() https://bugs.webkit.org/show_bug.cgi?id=219651 Reviewed by Tim Horton. preTransformedNativeImageForCurrentFrame() was added in r254841 under the name nativeImageForCurrentFrameRespectingOrientation() without checking whether the resulted image of nativeImageForCurrentFrame() is null or not. If the ImageSource is corrupted, the decoder might return a null PlatformImagePtr for the current frame. And if this happens most likely ImageSource::densityCorrectedSize() will return WTF::nullopt also. In this case, we end up calling GraphicsContext::drawPlatformImage() with a null PlatformImagePtr. * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::preTransformedNativeImageForCurrentFrame): 2020-12-08 Geoffrey Garen <ggaren@apple.com> TextManipulationController sometimes fails to notify its delegate of new text (if an element has been removed) https://bugs.webkit.org/show_bug.cgi?id=219656 Reviewed by Wenson Hsieh. Sihui Liu <sihui_liu@apple.com> diagnosed this; I typed the fix. * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::scheduleObservationUpdate): Ignore disconnected nodes. They are irrelevent to text manipulation in the document (since they are not in the document); and including them causes the common acenstor algorithm to fail. Use an explicit boolean instead of a series of set checks to track whether an update has already been scheduled. The set checks confused me while debugging; also, checking a weak hash set for empty is needlessly costly at O(n). (WebCore::TextManipulationController::flushPendingItemsForCallback): Ignore flushes when the list of pending items is empty. Otherwise, our delegate will get a confusing 0-item callback. * editing/TextManipulationController.h: 2020-12-08 Chris Dumez <cdumez@apple.com> Unreviewed, reverting r269983. Seems to have regressed PLT5 Reverted changeset: "[iOS] beforeunload event does not fire in MobileSafari" https://bugs.webkit.org/show_bug.cgi?id=219102 https://trac.webkit.org/changeset/269983 2020-12-08 Simon Fraser <simon.fraser@apple.com> Make ScrollingPerformanceLoggingEnabled an internal debug preference https://bugs.webkit.org/show_bug.cgi?id=219647 Reviewed by Sam Weinig. ScrollingPerformanceLoggingEnabled is used by a Safari performance test, so it needs to be easily toggleable from a script. That's easier if it's an Internal Debug preference. Testing also sets ForceUpdateScrollbarsOnMainThreadForPerformanceTesting but we can just use the ScrollingPerformanceLoggingEnabled flag, but it makes more sense to rename ScrollingPerformanceLoggingEnabled to ScrollingPerformanceTestingEnabled when we do that. Also fix how we propagate ScrollingPerformanceTestingEnabled to the scrolling tree; do so via ScrollingStateFrameScrollingNode as we do for the other tree-wide settings, removing code in TiledCoreAnimationDrawingArea::updatePreferences() that did this. * page/FrameView.cpp: (WebCore::FrameView::forceUpdateScrollbarsOnMainThreadForPerformanceTesting const): (WebCore::FrameView::setScrollingPerformanceTestingEnabled): (WebCore::FrameView::setScrollingPerformanceLoggingEnabled): Deleted. * page/FrameView.h: * page/SettingsBase.cpp: (WebCore::SettingsBase::scrollingPerformanceTestingEnabledChanged): (WebCore::SettingsBase::scrollingPerformanceLoggingEnabledChanged): Deleted. * page/SettingsBase.h: * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState): (WebCore::AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled const): Deleted. (WebCore::AsyncScrollingCoordinator::wheelEventGesturesBecomeNonBlocking const): Deleted. * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingStateFrameScrollingNode.cpp: (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode): (WebCore::ScrollingStateFrameScrollingNode::applicableProperties const): (WebCore::ScrollingStateFrameScrollingNode::setScrollingPerformanceTestingEnabled): * page/scrolling/ScrollingStateFrameScrollingNode.h: * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::commitTreeState): (WebCore::ScrollingTree::setScrollingPerformanceLoggingEnabled): Deleted. (WebCore::ScrollingTree::scrollingPerformanceLoggingEnabled): Deleted. * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::scrollingPerformanceTestingEnabled const): (WebCore::ScrollingTree::setScrollingPerformanceTestingEnabled): * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren): (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged): * platform/graphics/TiledBacking.h: * platform/graphics/ca/TileController.h: * platform/graphics/ca/TileGrid.cpp: (WebCore::TileGrid::platformCALayerPaintContents): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::forceUpdateScrollbarsOnMainThreadForPerformanceTesting const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::RenderLayerBacking): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::forceUpdateScrollbarsOnMainThreadForPerformanceTesting const): 2020-12-08 Wenson Hsieh <wenson_hsieh@apple.com> [Concurrent Display Lists] Add a way for display list clients to get missing cached resource identifiers https://bugs.webkit.org/show_bug.cgi?id=219652 Reviewed by Tim Horton. Refactor some code so that we plumb the `RenderingResourceIdentifier` of the missing cached resource from `applyImageBufferItem` and `applyNativeImageItem` to the `ReplayResult`. Test: DisplayListTests.ReplayWithMissingResource * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::applyImageBufferItem): (WebCore::DisplayList::applyNativeImageItem): (WebCore::DisplayList::Replayer::applyItem): (WebCore::DisplayList::Replayer::replay): * platform/graphics/displaylists/DisplayListReplayer.h: 2020-12-08 Rob Buis <rbuis@igalia.com> Support aspect-ratio on non-replaced elements https://bugs.webkit.org/show_bug.cgi?id=218794 Reviewed by Simon Fraser. Compute logical width/height for non-replaced elements taking aspect ratio into account. This is very basic support and does not consider things like transferred min/max block size. * rendering/RenderBox.cpp: (WebCore::inlineSizeFromAspectRatio): Helper to compute inline size given box-sizing mode, margins/borders, block size and logical aspect ratio. (WebCore::RenderBox::computeLogicalWidthInFragment const): (WebCore::blockSizeFromAspectRatio): Helper to compute block size given box-sizing mode, margins/borders, inline size and logical aspect ratio. (WebCore::RenderBox::computeLogicalHeight const): (WebCore::RenderBox::shouldComputeLogicalHeightFromAspectRatio const): * rendering/RenderBox.h: * rendering/style/RenderStyle.h: (WebCore::RenderStyle::logicalAspectRatio const): Return aspect ratio taking direction into account. (WebCore::RenderStyle::hasAspectRatio const): Return true if aspect-ratio property has <ratio> set. 2020-12-08 Antti Koivisto <antti@apple.com> [LFC][Integration] Invalidate line layout path for children of inlines https://bugs.webkit.org/show_bug.cgi?id=219639 Reviewed by Zalan Bujtas. We currently assume you can just invalidate the direct parent. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::blockContainer): (WebCore::LayoutIntegration::LineLayout::containing): * layout/integration/LayoutIntegrationLineLayout.h: * rendering/RenderObject.cpp: (WebCore::RenderObject::insertedIntoTree): (WebCore::RenderObject::willBeRemovedFromTree): Invalidate here. * rendering/RenderText.cpp: (WebCore::RenderText::setText): * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::attachToRenderElementInternal): * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation): (WebCore::RenderTreeBuilder::Block::detach): 2020-12-08 Rob Buis <rbuis@igalia.com> Make TextRun::subRun stricter https://bugs.webkit.org/show_bug.cgi?id=219615 Reviewed by Darin Adler. Make TextRun::subRun stricter, besides the start offset being less than the run length, the sub run start offset plus sub run length should not exceed the overall run length. * platform/graphics/TextRun.h: (WebCore::TextRun::subRun const): 2020-12-08 Antti Koivisto <antti@apple.com> [LFC][Integration] Don't assume ensureLineBoxes can be called on direct parent https://bugs.webkit.org/show_bug.cgi?id=219633 Reviewed by Zalan Bujtas. This is no longer true with inlines. * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::addMarker): * layout/integration/LayoutIntegrationLineLayout.h: (WebCore::LayoutIntegration::LineLayout::flow): * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::setSelectionState): (WebCore::RenderLineBreak::ensureLineBoxes): Deleted. * rendering/RenderLineBreak.h: * rendering/RenderObject.cpp: (WebCore::RenderObject::setSelectionState): Move to the base class and use LineLayout::containing. * rendering/RenderObject.h: (WebCore::RenderObject::setSelectionState): Deleted. * rendering/RenderText.cpp: (WebCore::RenderText::setSelectionState): (WebCore::RenderText::ensureLineBoxes): Deleted. * rendering/RenderText.h: 2020-12-08 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Trimmable content can include <wbr> https://bugs.webkit.org/show_bug.cgi?id=219613 Reviewed by Antti Koivisto. Trailing <wbr> can be part of the trimmable trailing content. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::TrimmableTrailingContent::remove): 2020-12-08 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Do not keep the inline box "start" inline item on the current line when its content does not fit anymore https://bugs.webkit.org/show_bug.cgi?id=219627 Reviewed by Antti Koivisto. This is a simple case when the <span>'s content does not fit the line anymore and we end up wrapping the content right after the <span> (e.g <span>this_does_not_fit</span>. Let's move the <span> over to the next line as well. This fixes imported/w3c/web-platform-tests/css/css-text/white-space/white-space-pre-wrap-trailing-spaces-011.html * layout/inlineformatting/InlineContentBreaker.cpp: (WebCore::Layout::InlineContentBreaker::processOverflowingTextContent const): 2020-12-08 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Set hyphen on the last text run https://bugs.webkit.org/show_bug.cgi?id=219619 Reviewed by Antti Koivisto. Line::addTrailingHyphen should set the hyphen flag on the last _text_ run. (e.g. <span>last run is not always a text run</span> <- inline box end is the last run here) * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::addTrailingHyphen): 2020-12-08 Youenn Fablet <youenn@apple.com> Allow RTCRtpSFrameTransform to handle multiple keys https://bugs.webkit.org/show_bug.cgi?id=219598 Reviewed by Eric Carlson. Keep a map of ID to Key material when setEncryptionKey is called. Use that map on decryption side to get key material from key ID. Add internals API to validate key retrieval is done correctly. If setEncryptionKey key ID is not set, we use the map size which allows to use 0, 1, 2 and so on... Test: webrtc/sframe-keys.html * Modules/mediastream/RTCRtpSFrameTransform.cpp: (WebCore::RTCRtpSFrameTransform::keyIdForTesting const): * Modules/mediastream/RTCRtpSFrameTransform.h: * Modules/mediastream/RTCRtpSFrameTransformer.cpp: (WebCore::RTCRtpSFrameTransformer::setEncryptionKey): (WebCore::RTCRtpSFrameTransformer::updateEncryptionKey): (WebCore::RTCRtpSFrameTransformer::decryptFrame): * Modules/mediastream/RTCRtpSFrameTransformer.h: (WebCore::RTCRtpSFrameTransformer::keyId const): * testing/Internals.cpp: (WebCore::Internals::sframeKeyId): * testing/Internals.h: * testing/Internals.idl: 2020-12-08 Joonghun Park <jh718.park@samsung.com> Unreviewed. Remove the build warning below since r270526. warning: unused parameter ‘mediaType’ [-Wunused-parameter] No new tests, no new behaviors. * platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::shouldRemoveFragmentIdentifier): 2020-12-07 Fujii Hironori <Hironori.Fujii@sony.com> Unreviewed sort-Xcode-project-file * WebCore.xcodeproj/project.pbxproj: 2020-12-07 Said Abou-Hallawa <said@apple.com> [GPU Process] Ensure the backend of ImageBuffer is created before getting its handle https://bugs.webkit.org/show_bug.cgi?id=219623 Reviewed by Tim Horton. Remove the ImageBuffer::backend() method and move ensureBackendCreated() from ConcreteImageBuffer to ImageBuffer. Clients should ensure the backend is created before accessing its method. ensureBackendCreated() is only overridden by RemoteImageBufferProxy. * platform/graphics/ConcreteImageBuffer.h: (WebCore::ConcreteImageBuffer::ensureBackendCreated const): Deleted. * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::backend const): Deleted. 2020-12-07 Alex Christensen <achristensen@webkit.org> Parse content after # in data URLs with HLS mime types https://bugs.webkit.org/show_bug.cgi?id=219612 <rdar://problem/71039282> Reviewed by Darin Adler. r267995 made us conform to the behavior of Chrome and Firefox by removing fragments from data URLs before parsing. While this is desirable, there is content in Safari-specific HLS data URLs that needs the content including and after #. So, to fix this, wait until after we know the mime type and remove the fragment if it's not HLS. Test: fast/url/data-url-mediatype.html * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::loadDataURL): (WebCore::shouldStripFragmentIdentifier): Deleted. * platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::shouldRemoveFragmentIdentifier): (WebCore::DataURLDecoder::DecodeTask::DecodeTask): (WebCore::DataURLDecoder::DecodeTask::process): (WebCore::DataURLDecoder::createDecodeTask): 2020-12-07 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Check if RenderInline style is supported https://bugs.webkit.org/show_bug.cgi?id=219611 Reviewed by Antti Koivisto. At this point it's insufficient to check for block style only. Inline boxes may have unsupported styles as well. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForChild): 2020-12-07 Andres Gonzalez <andresg_22@apple.com> Add check to ensure that the size of the result of AXTextMarkerGetBytePtr is equal to the size of TextMarkerData. https://bugs.webkit.org/show_bug.cgi?id=219601 Reviewed by Simon Fraser. Covered by existing tests. This is a follow up change to the patch for https://bugs.webkit.org/show_bug.cgi?id=219491 per Simon Fraser's comment. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::getBytesFromAXTextMarker): Added a check to ensure that the memory block returned by AXTextMarkerGetBytePtr is the same size as TextMarkerData. This doesn't guaranty that the underlying binary structures are the same, but it is a sanity check that may catch flagrant discrepancies. 2020-12-07 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes, early December 2020 edition (bis) https://bugs.webkit.org/show_bug.cgi?id=219607 Unreviewed non-unified build fixes. * contentextensions/ImmutableNFA.h: * contentextensions/SerializedNFA.cpp: * contentextensions/SerializedNFA.h: * loader/DocumentLoader.cpp: * platform/audio/MultiChannelResampler.h: * platform/audio/SincResampler.h: 2020-12-07 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r270507. Caused some WebRTC tests to assert Reverted changeset: "Allow RTCRtpSFrameTransform to handle multiple keys" https://bugs.webkit.org/show_bug.cgi?id=219598 https://trac.webkit.org/changeset/270507 2020-12-07 Don Olmstead <don.olmstead@sony.com> [CMake] Remove WEBKIT_WRAP_SOURCELIST https://bugs.webkit.org/show_bug.cgi?id=196916 Reviewed by Michael Catanzaro. * CMakeLists.txt: 2020-12-07 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Overflowing text content should not break at inline box boundary https://bugs.webkit.org/show_bug.cgi?id=219605 Reviewed by Antti Koivisto. Wrap the overflowing content on the inline box boundary when possible. <span>fits</span><span>overflows</span> When the text "overflows" completely overflows, let's wrap the content after '</span>'. Test: fast/layoutformattingcontext/overflow-at-inline-box-boundary-simple.html * layout/inlineformatting/InlineContentBreaker.cpp: (WebCore::Layout::InlineContentBreaker::processOverflowingTextContent const): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::commitPartialContent): 2020-12-07 Don Olmstead <don.olmstead@sony.com> Non-unified build fixes, early December 2020 edition https://bugs.webkit.org/show_bug.cgi?id=219552 Unreviewed non-unified build fixes. * display/css/DisplayBoxModelBox.cpp: * display/css/DisplayStackingItem.cpp: * display/css/DisplayStackingItem.h: * html/HTMLIFrameElement.cpp: * layout/inlineformatting/InlineLineBox.cpp: * loader/DocumentLoader.cpp: * platform/mediacapabilities/ColorGamut.h: * platform/mediacapabilities/HdrMetadataType.h: 2020-12-07 Youenn Fablet <youenn@apple.com> Allow RTCRtpSFrameTransform to handle multiple keys https://bugs.webkit.org/show_bug.cgi?id=219598 Reviewed by Eric Carlson. Keep a map of ID to Key material when setEncryptionKey is called. Use that map on decryption side to get key material from key ID. Add internals API to validate key retrieval is done correctly. If setEncryptionKey key ID is not set, we use the map size which allows to use 0, 1, 2 and so on... Test: webrtc/sframe-keys.html * Modules/mediastream/RTCRtpSFrameTransform.cpp: (WebCore::RTCRtpSFrameTransform::keyIdForTesting const): * Modules/mediastream/RTCRtpSFrameTransform.h: * Modules/mediastream/RTCRtpSFrameTransformer.cpp: (WebCore::RTCRtpSFrameTransformer::setEncryptionKey): (WebCore::RTCRtpSFrameTransformer::updateEncryptionKey): (WebCore::RTCRtpSFrameTransformer::decryptFrame): * Modules/mediastream/RTCRtpSFrameTransformer.h: (WebCore::RTCRtpSFrameTransformer::keyId const): * testing/Internals.cpp: (WebCore::Internals::sframeKeyId): * testing/Internals.h: * testing/Internals.idl: 2020-12-07 Youenn Fablet <youenn@apple.com> Add a SFrame H264 experimental compatibility mode https://bugs.webkit.org/show_bug.cgi?id=219532 Reviewed by Eric Carlson. Add an SFrame compatibility mode for H.264. To do so, the encryptor generates an SFrame and prefixes it with either a delta frame prefix or a key frame prefix. The SFrame content is escaped so that it is considered as one big IDR or Slice nalu. The decoder on the other hand, unescapes the content, removes the prefix and decrypts the SFrame content. Test: webrtc/video-sframe.html * Modules/mediastream/H264Utils.cpp: Added. (WebCore::isSliceNALU): (WebCore::isSPSNALU): (WebCore::isPPSNALU): (WebCore::isIDRNALU): (WebCore::findNalus): (WebCore::computePrefixOffset): (WebCore::needsRbspUnescaping): (WebCore::fromRbsp): (WebCore::computePrefixBuffer): (WebCore::findEscapeRbspPatterns): (WebCore::toRbsp): * Modules/mediastream/H264Utils.h: Added. * Modules/mediastream/MediaStreamTrack.cpp: * Modules/mediastream/RTCRtpSFrameTransform.cpp: (WebCore::RTCRtpSFrameTransform::RTCRtpSFrameTransform): * Modules/mediastream/RTCRtpSFrameTransform.h: * Modules/mediastream/RTCRtpSFrameTransform.idl: * Modules/mediastream/RTCRtpSFrameTransformer.cpp: (WebCore::RTCRtpSFrameTransformer::create): (WebCore::RTCRtpSFrameTransformer::RTCRtpSFrameTransformer): (WebCore::RTCRtpSFrameTransformer::decryptFrame): (WebCore::RTCRtpSFrameTransformer::encryptFrame): * Modules/mediastream/RTCRtpSFrameTransformer.h: * Modules/mediastream/RTCRtpScriptTransformer.cpp: * Modules/mediastream/RTCRtpScriptTransformer.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-12-07 Chris Dumez <cdumez@apple.com> Reduce memory copying in MultiChannelResampler::provideInputForChannel() https://bugs.webkit.org/show_bug.cgi?id=219561 Reviewed by Eric Carlson. Reduce memory copying in MultiChannelResampler::provideInputForChannel() by using the passed-in buffer as memory for the first channel in the AudioBus. This way we avoid having to memcpy() the data for the first channel. Chromium's MultiChannelResampler has the same optimization. * platform/audio/MultiChannelResampler.cpp: (WebCore::MultiChannelResampler::MultiChannelResampler): (WebCore::MultiChannelResampler::provideInputForChannel): * platform/audio/MultiChannelResampler.h: 2020-12-07 Simon Fraser <simon.fraser@apple.com> [LFC Display] Keep track of the painted bounds of StackingItems https://bugs.webkit.org/show_bug.cgi?id=219583 Reviewed by Zalan Bujtas. Display::StackingItems will need to know their painted bounds for various reasons like transparency layer extent, composited layer bounds, repaint etc. We can compute this cheaply at tree building time. In fact, two bounds are useful: first, the bounds of the in-flow content of that stacking item, and second the bounds of that stacking item and all its stacking descendants. We don't have a good way to know the painted extent of a Display::Box yet, so just use its bounds as a proxy. BoxModelBox extends this by looking at box-shadow style. While building the display tree, keep track of two extents rectangles: - currentStackingItemPaintedContentExtent starts with the bounds of the stack item's box, and is unioned with the bounds of all the in-flow content for that stacking item as we build the tree downwards. - currentStackingItemPaintingExtent starts empty, and accumulates the union of all the descendant stacking items' painting extent in post-order traversal as we pop stacking items off the currentState stack. * display/DisplayTreeBuilder.cpp: (WebCore::Display::BuildingState::inFlowContainingBlockBox const): (WebCore::Display::TreeBuilder::build): (WebCore::Display::TreeBuilder::pushStateForBoxDescendants): (WebCore::Display::TreeBuilder::popState): (WebCore::Display::TreeBuilder::accountForBoxPaintingExtent): (WebCore::Display::TreeBuilder::currentState): (WebCore::Display::TreeBuilder::positioningContext): (WebCore::Display::TreeBuilder::insertIntoTree): (WebCore::Display::TreeBuilder::buildInlineDisplayTree): (WebCore::Display::outputStackingTree): (WebCore::Display::TreeBuilder::currentState const): Deleted. (WebCore::Display::TreeBuilder::positioningContext const): Deleted. * display/DisplayTreeBuilder.h: * display/css/DisplayBox.h: (WebCore::Display::Box::absolutePaintingExtent const): * display/css/DisplayBoxModelBox.cpp: (WebCore::Display::BoxModelBox::absolutePaintingExtent const): * display/css/DisplayBoxModelBox.h: * display/css/DisplayCSSPainter.cpp: (WebCore::Display::applyEffects): (WebCore::Display::CSSPainter::paintAtomicallyPaintedBox): * display/css/DisplayStackingItem.h: (WebCore::Display::StackingItem::paintedContentBounds const): (WebCore::Display::StackingItem::paintedBoundsIncludingDescendantItems const): (WebCore::Display::StackingItem::setPaintedContentBounds): (WebCore::Display::StackingItem::setPaintedBoundsIncludingDescendantItems): 2020-12-07 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Check if RenderInline's text children are supported https://bugs.webkit.org/show_bug.cgi?id=219585 Reviewed by Antti Koivisto. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForFontAndText): (WebCore::LayoutIntegration::canUseForChild): 2020-12-07 Chris Lord <clord@igalia.com> [GTK][WPE] Overflow/iframe scrolling with async scrolling enabled sometimes doesn't work https://bugs.webkit.org/show_bug.cgi?id=219594 Reviewed by Žan Doberšek. Scrollable layers can occur outside of the bounds of ancestor layers, so remove bounds checking early-exit in nicosia collectDescendantLayersAtPoint(). * page/scrolling/nicosia/ScrollingTreeNicosia.cpp: (WebCore::collectDescendantLayersAtPoint): 2020-12-06 Joonghun Park <jh718.park@samsung.com> Unreviewed. Remove the build warning below since r270414. warning: redundant move in return statement [-Wredundant-move] No new tests, no new behaviors. * contentextensions/NFAToDFA.cpp: (WebCore::ContentExtensions::NFAToDFA::convert): 2020-12-06 Joonghun Park <jh718.park@samsung.com> Unreviewed. Remove the build warnings below since r270400. warning: unused parameter ‘foo’ [-Wunused-parameter] No new tests, no new behaviors. * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::getActiveUniforms): 2020-12-06 Simon Fraser <simon.fraser@apple.com> Use WTF_MAKE_FAST_ALLOCATED for some scrolling-related objects https://bugs.webkit.org/show_bug.cgi?id=219567 Reviewed by Tim Horton. Make ScrollingCoordinator, ScrollingTree and ScrollingTreeNode be fast-allocated. * page/scrolling/ScrollingCoordinator.h: * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeNode.h: 2020-12-06 Simon Fraser <simon.fraser@apple.com> [LFC Display] Move DisplayLayerController to display/compositing https://bugs.webkit.org/show_bug.cgi?id=219584 Reviewed by Anders Carlsson. Make a display/compositing directory and move DisplayLayerController.* into it. * CMakeLists.txt: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * display/compositing/DisplayLayerController.cpp: Renamed from Source/WebCore/display/DisplayLayerController.cpp. * display/compositing/DisplayLayerController.h: Renamed from Source/WebCore/display/DisplayLayerController.h. 2020-12-06 Youenn Fablet <youenn@apple.com> Add support for RTCRtpSender::setStreams https://bugs.webkit.org/show_bug.cgi?id=219542 Reviewed by Eric Carlson. Pipe stream IDs from WebCore sender to libqebrtc backend sender. A follow-up patch should handle creation of remote streams in case of renegotiation. Covered by updated and rebased tests. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::create): (WebCore::RTCRtpSender::RTCRtpSender): (WebCore::RTCRtpSender::setStreams): (WebCore::RTCRtpSender::setMediaStreamIds): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpSenderBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::addTrack): (WebCore::LibWebRTCPeerConnectionBackend::addTransceiverFromTrackOrKind): (WebCore::LibWebRTCPeerConnectionBackend::newRemoteTransceiver): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: (WebCore::LibWebRTCRtpSenderBackend::setMediaStreamIds): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: 2020-12-06 Zalan Bujtas <zalan@apple.com> [LFC][IFC] BoxGeometry should provide an enclosing rect for multiline inline boxes https://bugs.webkit.org/show_bug.cgi?id=219574 Reviewed by Antti Koivisto. This patch add support for multiline inline box geometry (e.g. <span>first<br>second</span>) In such cases we turn the content box into the enclosing rect (border and padding do not make too much sense in multiline case) This is not to be confused with Element.getClientRects() which returns a list of rects where border and padding start making sense. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): set the box geometry depending on whether this is the first line where the inline box shows or we are processing an in-between or end line. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::enclosingBorderBoxRectFor const): * layout/layouttree/LayoutGeometryRect.h: (WebCore::Layout::Rect::moveBy): (WebCore::Layout::Rect::expandToContain): 2020-12-06 Simon Fraser <simon.fraser@apple.com> [LFC Display] Move border radii to BoxRareGeometry https://bugs.webkit.org/show_bug.cgi?id=219581 Reviewed by Zalan Bujtas. Border radius is not a box decoration, since it affects rendering (e.g. clipping) when there are no decorations, so move it to BoxRareGeometry. * display/css/DisplayBoxDecorationData.cpp: (WebCore::Display::roundedRectWithIncludedRadii): Deleted. (WebCore::Display::roundedInsetBorderForRect): Deleted. (WebCore::Display::BoxDecorationData::hasBorderRadius const): Deleted. * display/css/DisplayBoxDecorationData.h: (WebCore::Display::BoxDecorationData::borderRadii const): Deleted. (WebCore::Display::BoxDecorationData::setBorderRadii): Deleted. * display/css/DisplayBoxDecorationPainter.cpp: (WebCore::Display::BoxDecorationPainter::BoxDecorationPainter): (WebCore::Display::BoxDecorationPainter::paintBoxShadow const): (WebCore::Display::BoxDecorationPainter::paintBackground const): (WebCore::Display::BoxDecorationPainter::determineBackgroundBleedAvoidance): (WebCore::Display::BoxDecorationPainter::computeBorderRect): Deleted. * display/css/DisplayBoxDecorationPainter.h: * display/css/DisplayBoxFactory.cpp: (WebCore::Display::BoxFactory::constructBoxDecorationData const): (WebCore::Display::BoxFactory::constructBoxRareGeometry const): * display/css/DisplayBoxModelBox.cpp: (WebCore::Display::BoxModelBox::hasBorderRadius const): (WebCore::Display::BoxModelBox::borderRoundedRect const): (WebCore::Display::BoxModelBox::innerBorderRoundedRect const): (WebCore::Display::BoxModelBox::clipForDescendants const): * display/css/DisplayBoxModelBox.h: * display/css/DisplayBoxRareGeometry.cpp: (WebCore::Display::BoxRareGeometry::hasBorderRadius const): (WebCore::Display::roundedRectWithIncludedRadii): (WebCore::Display::roundedInsetBorderForRect): * display/css/DisplayBoxRareGeometry.h: (WebCore::Display::BoxRareGeometry::borderRadii const): (WebCore::Display::BoxRareGeometry::setBorderRadii): 2020-12-06 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Disable RenderCounter content https://bugs.webkit.org/show_bug.cgi?id=219573 Reviewed by Antti Koivisto. RenderCounters are not supported yet. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForChild): 2020-12-05 Simon Fraser <simon.fraser@apple.com> REGRESSION (r268075): Animations at the top of https://browserbench.org/JetStream/ are very slow https://bugs.webkit.org/show_bug.cgi?id=219447 <rdar://problem/71905123> Reviewed by Sam Weinig. SVG images have their own Page, and when they request rendering updates, they have to go through ChromeClient, but that was missing for the Page::renderingUpdateCompleted() code path. Make scheduleRenderingUpdateInternal() and call it from the two relevant places. I tried making both a ref test and a test using internals.renderingUpdateCount(), but neither were reliable. There's no way to get a signal out from the <img src="*.svg"> to say that the animation has started, requiring tests to have flakey setTimeouts. * page/Page.cpp: (WebCore::Page::scheduleRenderingUpdate): (WebCore::Page::scheduleRenderingUpdateInternal): (WebCore::Page::renderingUpdateCompleted): * page/Page.h: 2020-12-05 Said Abou-Hallawa <said@apple.com> REGRESSION(r270458): Crash loading https://browserbench.org/JetStream/ https://bugs.webkit.org/show_bug.cgi?id=219568 Reviewed by Tim Horton. Get the backendSize before sinking it into a NativeImage. * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: (WebCore::ImageBufferIOSurfaceBackend::drawConsuming): 2020-12-04 Wenson Hsieh <wenson_hsieh@apple.com> [Concurrent display lists] Synchronize display list rendering across remote image buffers https://bugs.webkit.org/show_bug.cgi?id=219091 <rdar://problem/71747695> Reviewed by Geoff Garen. See Source/WebKit/ChangeLog for more details. * platform/graphics/ImageBuffer.h: * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::append): * platform/graphics/displaylists/DisplayListItemBuffer.cpp: (WebCore::DisplayList::ItemHandle::apply): (WebCore::DisplayList::ItemHandle::destroy): (WebCore::DisplayList::ItemHandle::copyTo const): (WebCore::DisplayList::ItemBuffer::swapWritableBufferIfNeeded): Add plumbing so that `didAppendData` can inform the client whether the data was appended after switching to a new buffer. In WebKit2's remote image buffer, we use this information to determine whether or not we need to send a wakeup message to the GPU process. Namely, in the case of `DidChangeItemBuffer::Yes`, we don't need to wake up the GPU process even though the unread bytes count was 0 before we advanced, since the GPU process will automatically progress to this item buffer when it's done processing items in the previous item buffer. See WebKit changes (in `RemoteImageBufferProxy`) for more details. (WebCore::DisplayList::ItemBuffer::append): (WebCore::DisplayList::ItemBuffer::didAppendData): (WebCore::DisplayList::ItemBuffer::appendEncodedData): Deleted. * platform/graphics/displaylists/DisplayListItemBuffer.h: Add a new `ItemBufferWritingClient` method to inform clients when new bytes are appended to an item buffer, given the additional number of bytes added and the item buffer handle. (WebCore::DisplayList::ItemBuffer::append): (WebCore::DisplayList::ItemBuffer::uncheckedAppend): * platform/graphics/displaylists/DisplayListItemType.cpp: (WebCore::DisplayList::sizeOfItemInBytes): (WebCore::DisplayList::isDrawingItem): (WebCore::DisplayList::isInlineItem): Remove MetaCommandEnd. I introduced this item type because I was going to make the GPU process always sleep for more display list item data, but I've since changed the approach so that the GPU process goes to sleep naturally when it's done processing all unread bytes. * platform/graphics/displaylists/DisplayListItemType.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: * platform/graphics/displaylists/DisplayListRecorder.h: (WebCore::DisplayList::Recorder::flushContext): Add a new helper method to append a `FlushContext` item via the display list recorder, to ensure that the appropriate recorder delegate methods are invoked when appending a "flush context" item. * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::Replayer::replay): * platform/graphics/displaylists/DisplayListReplayer.h: 2020-12-05 Fujii Hironori <Hironori.Fujii@sony.com> Remove ENABLE_GRAPHICS_CONTEXT_GL by replacing it with ENABLE(WEBGL) https://bugs.webkit.org/show_bug.cgi?id=219551 Reviewed by Kenneth Russell. GraphicsContextGL is a module only for WebGL. ENABLE_WEBGL should be removed if all ports enable it. * CMakeLists.txt: * page/Chrome.cpp: (WebCore::Chrome::windowScreenDidChange): * platform/graphics/ANGLEWebKitBridge.cpp: * platform/graphics/ANGLEWebKitBridge.h: * platform/graphics/FormatConverter.cpp: * platform/graphics/FormatConverter.h: * platform/graphics/GLContext.cpp: * platform/graphics/GLContext.h: * platform/graphics/GraphicsContextGL.cpp: * platform/graphics/GraphicsContextGL.h: * platform/graphics/GraphicsContextGLAttributes.h: * platform/graphics/GraphicsContextGLImageExtractor.cpp: * platform/graphics/GraphicsContextGLImageExtractor.h: * platform/graphics/OpenGLShims.cpp: * platform/graphics/angle/ExtensionsGLANGLE.cpp: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: * platform/graphics/angle/GraphicsContextGLANGLEUtilities.h: * platform/graphics/angle/TemporaryANGLESetting.cpp: * platform/graphics/cairo/GraphicsContextGLCairo.cpp: * platform/graphics/cg/GraphicsContextGLCG.cpp: * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: * platform/graphics/cv/GraphicsContextGLCV.h: * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp: * platform/graphics/cv/GraphicsContextGLCVANGLE.h: * platform/graphics/egl/GLContextEGL.cpp: * platform/graphics/egl/GLContextEGL.h: * platform/graphics/glx/GLContextGLX.cpp: * platform/graphics/glx/GLContextGLX.h: * platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.h: * platform/graphics/opengl/ExtensionsGLOpenGL.cpp: * platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp: * platform/graphics/opengl/ExtensionsGLOpenGLES.cpp: * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp: * platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp: * platform/graphics/opengl/GraphicsContextGLOpenGLPrivate.cpp: * platform/graphics/opengl/TemporaryOpenGLSetting.cpp: * platform/graphics/opengl/TemporaryOpenGLSetting.h: * platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp: * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp: * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.h: * platform/graphics/win/GraphicsContextGLDirect2D.cpp: 2020-12-05 Andres Gonzalez <andresg_22@apple.com> Prelininary refactoring of TextMarker and TextMarkerRange. https://bugs.webkit.org/show_bug.cgi?id=219491 Reviewed by Chris Fleizach. Covered by existing tests. TextMarker and TextMarkerRange should become classes on their own right. As a first step in that direction, this patch moves all the static functions in WebAccessibilityObjectWrapperMac.mm to make conversions between TextMarkers and TextMarkerRanges to and from other types to AXObjectCacheMac.mm. In addition, removed all ObjectiveC wrappers to these functions and instead call the functions directly where needed. This is relevant now with the arrival of isolated tree mode because it saves a non-trivial call to the wrapper's axBackingObject getter. Furthermore, all the conversion functions are doing now the appropriate thread check, since they all need to run on the main thread. Fixed the handling of the NSAccessibilityMisspellingTextMarkerRangeParameterizedAttribute request that was calling accessibilityMisspellingSearchCriteriaForParameterizedAttribute off of the main thread. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postTextStateChangePlatformNotification): (WebCore::AXTextMarkerRange): (WebCore::textMarkerRangeFromMarkers): (WebCore::AXTextMarkerRangeStart): (WebCore::AXTextMarkerRangeEnd): (WebCore::getBytesFromAXTextMarker): (WebCore::accessibilityObjectForTextMarker): (WebCore::textMarkerForVisiblePosition): (WebCore::visiblePositionForTextMarker): (WebCore::textMarkerRangeFromVisiblePositions): (WebCore::visiblePositionRangeForTextMarkerRange): (WebCore::textMarkerForCharacterOffset): (WebCore::characterOffsetForTextMarker): (WebCore::startOrEndTextMarkerForRange): (WebCore::textMarkerRangeFromRange): (WebCore::rangeForTextMarkerRange): * accessibility/mac/WebAccessibilityObjectWrapperMac.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (accessibilityTextOperationForParameterizedAttribute): (accessibilityMisspellingSearchCriteriaForParameterizedAttribute): (-[WebAccessibilityObjectWrapper textMarkerForVisiblePosition:]): (-[WebAccessibilityObjectWrapper textMarkerForFirstPositionInTextControl:]): (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]): (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]): (-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]): (-[WebAccessibilityObjectWrapper _indexForTextMarker:]): (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]): (-[WebAccessibilityObjectWrapper debugDescriptionForTextMarker:]): (-[WebAccessibilityObjectWrapper debugDescriptionForTextMarkerRange:]): (-[WebAccessibilityObjectWrapper showNodeForTextMarker:]): (-[WebAccessibilityObjectWrapper showNodeTreeForTextMarker:]): (-[WebAccessibilityObjectWrapper textMarkerRangeAtTextMarker:forUnit:]): (-[WebAccessibilityObjectWrapper lineTextMarkerRangeForTextMarker:forUnit:]): (-[WebAccessibilityObjectWrapper textMarkerForTextMarker:atUnit:]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): (AXTextMarkerRangeStart): MOved to AXObjectCacheMac.mm. (AXTextMarkerRangeEnd): MOved to AXObjectCacheMac.mm. (getBytesFromAXTextMarker): MOved to AXObjectCacheMac.mm. (isTextMarkerIgnored): Deleted. (-[WebAccessibilityObjectWrapper accessibilityObjectForTextMarker:]): Deleted. (accessibilityObjectForTextMarker): MOved to AXObjectCacheMac.mm. (-[WebAccessibilityObjectWrapper textMarkerForCharacterOffset:]): Deleted. (textMarkerForCharacterOffset): MOved to AXObjectCacheMac.mm. (-[WebAccessibilityObjectWrapper rangeForTextMarkerRange:]): Deleted. (characterOffsetForTextMarker): MOved to AXObjectCacheMac.mm. (-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]): Deleted. (visiblePositionForTextMarker): MOved to AXObjectCacheMac.mm. (visiblePositionRangeForTextMarkerRange): MOved to AXObjectCacheMac.mm. (-[WebAccessibilityObjectWrapper visiblePositionForTextMarker:]): Deleted. (-[WebAccessibilityObjectWrapper visiblePositionRangeForTextMarkerRange:]): Deleted. 2020-12-05 Simon Fraser <simon.fraser@apple.com> Add ScrollAnimation files to the Xcode project https://bugs.webkit.org/show_bug.cgi?id=219566 Reviewed by Yusuke Suzuki. ScrollAnimation* files were added to Sources.txt but not the Xcode project. * WebCore.xcodeproj/project.pbxproj: 2020-12-05 Simon Fraser <simon.fraser@apple.com> [LFC Display] Store the display tree as a tree of stacking items https://bugs.webkit.org/show_bug.cgi?id=219315 Reviewed by Zalan Bujtas. Currently the display tree is a full tree, crossing stacking context boundaries, and the z-order lists are built at paint time. Change to a tree of StackingItems, where a StackingItem exists for each box that participates in the z-order sorting algorithm (i.e. boxes that are positioned, or have styles that create stacking context). Each StackingItem owns the subtree of Display::Boxes that it paints, and those subtrees are not otherwise connected. The Display::Tree owns the root StackingItem, and each StackingItem owns its child StackingItems. The StackingItem tree is built at display tree building time by storing state in the BuildingState stack. StackingItems are added to the z-order lists of their parent item at creation time; when done processing boxes for a StackingItem, we then sort its z-order lists. Add Box::participatesInZOrderSorting() and a LineBreakBox flag, and call that function instead of the version on Display::Style to work around webkit.org/b/219335 for now. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * display/DisplayLayerController.cpp: * display/DisplayTree.cpp: (WebCore::Display::Tree::Tree): (WebCore::Display::Tree::rootBox const): * display/DisplayTree.h: (WebCore::Display::Tree::rootStackingItem const): (WebCore::Display::Tree::rootBox const): Deleted. * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::build): (WebCore::Display::TreeBuilder::pushStateForBoxDescendants): (WebCore::Display::TreeBuilder::popState): (WebCore::Display::TreeBuilder::insertIntoTree): (WebCore::Display::TreeBuilder::buildInlineDisplayTree): (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree): (WebCore::Display::outputDisplayBox): (WebCore::Display::outputDisplayTree): (WebCore::Display::displayTreeAsText): (WebCore::Display::outputStackingTree): (WebCore::Display::showDisplayTree): * display/DisplayTreeBuilder.h: * display/css/DisplayBox.cpp: (WebCore::Display::Box::participatesInZOrderSorting const): * display/css/DisplayBox.h: (WebCore::Display::Box::isLineBreakBox const): * display/css/DisplayBoxFactory.cpp: (WebCore::Display::BoxFactory::displayBoxForRootBox const): (WebCore::Display::BoxFactory::displayBoxForLayoutBox const): (WebCore::Display::BoxFactory::setupBoxModelBox const): * display/css/DisplayBoxFactory.h: * display/css/DisplayCSSPainter.cpp: (WebCore::Display::CSSPainter::recursivePaintDescendantsForPhase): (WebCore::Display::CSSPainter::paintAtomicallyPaintedBox): (WebCore::Display::CSSPainter::paintStackingContext): (WebCore::Display::CSSPainter::paintTree): (WebCore::Display::CSSPainter::isStackingContextPaintingBoundary): Deleted. (WebCore::Display::CSSPainter::participatesInZOrderSorting): Deleted. (WebCore::Display::CSSPainter::collectStackingContextDescendants): Deleted. (WebCore::Display::CSSPainter::recursiveCollectLayers): Deleted. * display/css/DisplayCSSPainter.h: 2020-12-05 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Create an inline box for </span> when it's the first box on the line https://bugs.webkit.org/show_bug.cgi?id=219556 Reviewed by Antti Koivisto. When the line starts with inline-box-end (</span>), we need to create an inline box for that box itself and for its ancestors as well. This fixes css1/units/rounding.html with ALLOW_INLINES enabled. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): 2020-12-05 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Do not construct a new layout box for every inline box end (InlineWalker) https://bugs.webkit.org/show_bug.cgi?id=219557 Reviewed by Antti Koivisto. We use the InlineWalker to walk the inline part of the render tree to build the corresponding layout (sub)tree. With content e.g <span>text</span>, InlineWalker visits 1. <span> (RenderInline) 2. text (RenderText) 3. </span> (RenderInline) This patch ensures that we don't create yet another layout box for step #3. * layout/integration/LayoutIntegrationBoxTree.cpp: (WebCore::LayoutIntegration::BoxTree::buildTree): 2020-12-04 Chris Dumez <cdumez@apple.com> Simplify audio resampling code https://bugs.webkit.org/show_bug.cgi?id=219560 Reviewed by Darin Adler. Made the following changes to simplify / improve the resampling code: - MultiChannelResampler & SincResampler now take a lambda upon construction to fetch input data, instead of taking a AudioSourceProvider pointer whenever process() is called. - We can now get rid of the whole MultiChannelResampler::ChannelProvider class and have the lambda call MultiChannelResampler::provideInputForChannel() instead. Similarly, we can also get rid of SincResampler's BufferSourceProvider. - As an optimization, MultiChannelResampler::process() now has a fast path when the AudioBus only has a single channel, to avoid the processing-in-chunks logic. The chunking logic is only needed when there are multiple channels, to make sure that provideInputForChannel() only gets called once per channel, to avoid confusing its logic. This is similar to what Chromium does. * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::setFormat): (WebCore::MediaElementAudioSourceNode::provideInput): (WebCore::MediaElementAudioSourceNode::process): * Modules/webaudio/MediaElementAudioSourceNode.h: * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::setFormat): (WebCore::MediaStreamAudioSourceNode::provideInput): (WebCore::MediaStreamAudioSourceNode::process): * Modules/webaudio/MediaStreamAudioSourceNode.h: * platform/audio/AudioBus.cpp: (WebCore::AudioBus::createBySampleRateConverting): * platform/audio/MultiChannelResampler.cpp: (WebCore::MultiChannelResampler::MultiChannelResampler): (WebCore::MultiChannelResampler::process): (WebCore::MultiChannelResampler::provideInputForChannel): * platform/audio/MultiChannelResampler.h: * platform/audio/SincResampler.cpp: (WebCore::SincResampler::SincResampler): (WebCore::SincResampler::processBuffer): (WebCore::SincResampler::process): * platform/audio/SincResampler.h: * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestinationCocoa::AudioDestinationCocoa): (WebCore::AudioDestinationCocoa::renderOnRenderingThead): * platform/audio/cocoa/AudioDestinationCocoa.h: 2020-12-04 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for intrusive floats when line gets stretched vertically https://bugs.webkit.org/show_bug.cgi?id=219528 Reviewed by Antti Koivisto. This patch adds supports for cases when the the candidate content stretches the line vertically and we need to check if additional floats are getting in the way and adjust the available horizontal width accordingly. Test: fast/layoutformattingcontext/intrusive-floats-and-stretchy-lines-simple.html * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineCandidate::InlineContent::hasInlineLevelBox const): (WebCore::Layout::LineCandidate::InlineContent::appendInlineItem): (WebCore::Layout::LineCandidate::InlineContent::reset): (WebCore::Layout::LineBuilder::handleInlineContent): 2020-12-04 Jer Noble <jer.noble@apple.com> [Cocoa] Adopt AVOutputDevice.allowsHeadTrackedSpatialAudio https://bugs.webkit.org/show_bug.cgi?id=219503 Reviewed by Eric Carlson. AudioConfiguration.spatialRendering is an Optional<bool>, so it both needs to be null-checked and also value checked. Additionally, WTF::allOf() will return true if the passed in container is empty, so empty-check that container in addition to checking its contents. * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: (WebCore::createMediaPlayerDecodingConfigurationCocoa): 2020-12-04 Jer Noble <jer.noble@apple.com> [GPUP] Move MediaCapabilities into the GPU process https://bugs.webkit.org/show_bug.cgi?id=219521 Reviewed by Eric Carlson. Add encode() and decode() operations to all structs used inside MediaEngineConfigurationFactory. Add the ability for clients to provide their own factories for use in MediaEngineConfigurationFactory. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/MediaCapabilitiesDecodingInfo.h: (WebCore::MediaCapabilitiesDecodingInfo::encode const): (WebCore::MediaCapabilitiesDecodingInfo::decode): * platform/MediaCapabilitiesEncodingInfo.h: (WebCore::MediaCapabilitiesEncodingInfo::encode const): (WebCore::MediaCapabilitiesEncodingInfo::decode): * platform/MediaCapabilitiesInfo.h: (WebCore::MediaCapabilitiesInfo::encode const): (WebCore::MediaCapabilitiesInfo::decode): * platform/mediacapabilities/AudioConfiguration.h: (WebCore::AudioConfiguration::encode const): (WebCore::AudioConfiguration::decode): * platform/mediacapabilities/ColorGamut.h: * platform/mediacapabilities/HdrMetadataType.h: * platform/mediacapabilities/MediaCapabilitiesLogging.h: * platform/mediacapabilities/MediaConfiguration.h: (WebCore::MediaConfiguration::encode const): (WebCore::MediaConfiguration::decode): * platform/mediacapabilities/MediaDecodingConfiguration.h: (WebCore::MediaDecodingConfiguration::encode const): (WebCore::MediaDecodingConfiguration::decode): * platform/mediacapabilities/MediaDecodingType.h: * platform/mediacapabilities/MediaEncodingConfiguration.h: (WebCore::MediaEncodingConfiguration::encode const): (WebCore::MediaEncodingConfiguration::decode): * platform/mediacapabilities/MediaEncodingType.h: * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp: (WebCore::defaultFactories): (WebCore::factories): (WebCore::MediaEngineConfigurationFactory::clearFactories): (WebCore::MediaEngineConfigurationFactory::resetFactories): (WebCore::MediaEngineConfigurationFactory::installFactory): (WebCore::MediaEngineConfigurationFactory::hasDecodingConfigurationFactory): (WebCore::MediaEngineConfigurationFactory::hasEncodingConfigurationFactory): * platform/mediacapabilities/MediaEngineConfigurationFactory.h: * platform/mediacapabilities/TransferFunction.h: * platform/mediacapabilities/VideoConfiguration.h: (WebCore::VideoConfiguration::encode const): (WebCore::VideoConfiguration::decode): 2020-12-04 Chris Dumez <cdumez@apple.com> Stop constructing unnecessary AudioBus in SincResampler https://bugs.webkit.org/show_bug.cgi?id=219553 Reviewed by Darin Adler. Stop constructing unnecessary AudioBus in SincResampler. Instead, pass the float* buffer to the lambda directly. * platform/audio/MultiChannelResampler.cpp: (WebCore::MultiChannelResampler::ChannelProvider::provideInputForChannel): (WebCore::MultiChannelResampler::process): * platform/audio/SincResampler.cpp: (WebCore::SincResampler::consumeSource): (WebCore::SincResampler::process): * platform/audio/SincResampler.h: 2020-12-04 Said Abou-Hallawa <said@apple.com> [GPU Process] Clean up recreating the ImageBufferBackend because of GPU crashing https://bugs.webkit.org/show_bug.cgi?id=219007 Reviewed by Simon Fraser. To allow answering questions about the backend creation parameters without having the backend created, the new structure ImageBufferBackend::Parameters is introduced. This structure contains the parameters which were passed by the caller in the WebProcess and which are sufficient to recreate RemoteImageBuffer if the GPU Process crashes even before the backend of RemoteImageBufferProxy is created. ConcreteImageBuffer and ImageBufferBackend will hold an instance of the new structure ImageBufferBackend::Parameters. Also replace all the instances of 'isAccelerated' by 'renderingMode'. So no need to convert one type to the other. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/ConcreteImageBuffer.h: (WebCore::ConcreteImageBuffer::create): (WebCore::ConcreteImageBuffer::ConcreteImageBuffer): -- Make ConcreteImageBuffer own an instance of ImageBufferBackend::Parameters. -- Add methods to set and clear the backend of an ImageBuffer. * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::backend const): (WebCore::ImageBuffer::submitDisplayList): (WebCore::ImageBuffer::didFlush): -- Expose the ImageBufferBackend creation parameters through methods. -- Expose submitDisplayList() and didFlush() so no casting is needed when calling these functions through RemoteImageBuferProxy. * platform/graphics/ImageBufferBackend.cpp: (WebCore::ImageBufferBackend::ImageBufferBackend): (WebCore::ImageBufferBackend::toBGRAData const): * platform/graphics/ImageBufferBackend.h: (WebCore::ImageBufferBackend::backendSize const): (WebCore::ImageBufferBackend::memoryCost const): (WebCore::ImageBufferBackend::bytesPerRow const): (WebCore::ImageBufferBackend::toBackendCoordinates const): (WebCore::ImageBufferBackend::logicalSize const): (WebCore::ImageBufferBackend::resolutionScale const): (WebCore::ImageBufferBackend::colorSpace const): (WebCore::ImageBufferBackend::pixelFormat const): (WebCore::ImageBufferBackend::logicalRect const): (WebCore::ImageBufferBackend::backendRect const): (WebCore::ImageBufferBackend::baseTransform const): Deleted. -- Add the structure ImageBufferBackend::Parameters. -- Make ImageBufferBackend own an instance of this structure. -- Make backendSize() a pure virtual method. -- Delete baseTransform() since it is implemented in ConcreteImageBuffer. * platform/graphics/PlatformImageBuffer.h: (isType): * platform/graphics/cairo/ImageBufferCairoBackend.cpp: (WebCore::ImageBufferCairoBackend::drawPattern): * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp: (WebCore::ImageBufferCairoImageSurfaceBackend::create): (WebCore::ImageBufferCairoImageSurfaceBackend::ImageBufferCairoImageSurfaceBackend): (WebCore::ImageBufferCairoImageSurfaceBackend::platformTransformColorSpace): * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.h: * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.cpp: (WebCore::ImageBufferCairoSurfaceBackend::ImageBufferCairoSurfaceBackend): (WebCore::ImageBufferCairoSurfaceBackend::backendSize const): * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.h: * platform/graphics/cg/ImageBufferCGBackend.cpp: (WebCore::ImageBufferCGBackend::setupContext const): (WebCore::ImageBufferCGBackend::copyImage const): (WebCore::ImageBufferCGBackend::sinkIntoImage): (WebCore::ImageBufferCGBackend::draw): (WebCore::ImageBufferCGBackend::drawPattern): (WebCore::ImageBufferCGBackend::toCFData const): (WebCore::ImageBufferCGBackend::baseTransform const): Deleted. * platform/graphics/cg/ImageBufferCGBackend.h: * platform/graphics/cg/ImageBufferCGBitmapBackend.cpp: (WebCore::ImageBufferCGBitmapBackend::create): (WebCore::ImageBufferCGBitmapBackend::ImageBufferCGBitmapBackend): (WebCore::ImageBufferCGBitmapBackend::backendSize const): (WebCore::ImageBufferCGBitmapBackend::copyNativeImage const): * platform/graphics/cg/ImageBufferCGBitmapBackend.h: * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: (WebCore::ImageBufferIOSurfaceBackend::create): (WebCore::ImageBufferIOSurfaceBackend::ImageBufferIOSurfaceBackend): (WebCore::ImageBufferIOSurfaceBackend::backendSize const): (WebCore::ImageBufferIOSurfaceBackend::drawConsuming): * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: -- Change the create() methods to take a "Parameters" argument. -- Use the backend method to access the "Parameters" structure. * platform/graphics/displaylists/DisplayList.h: * platform/graphics/displaylists/DisplayListFlushIdentifier.h: Added. Move DisplayListFlushIdentifier to a separate file so it can be included in ImageBuffer.h without having to include DisplayList.h. * platform/graphics/displaylists/DisplayListImageBuffer.h: (WebCore::DisplayList::ImageBuffer::create): (WebCore::DisplayList::ImageBuffer::ImageBuffer): (WebCore::DisplayList::ImageBuffer::initialDrawingContextCTM): Deleted. -- No need to pass the 'size' argument twice in the 'create' methods. The structure Parameters has to be passed to the constructor anyway. -- No need for initialDrawingContextCTM() since it is equivalent to baseTransform(). * platform/graphics/win/ImageBufferDirect2DBackend.cpp: (WebCore::ImageBufferDirect2DBackend::copyImage const): (WebCore::ImageBufferDirect2DBackend::draw): (WebCore::ImageBufferDirect2DBackend::drawPattern): -- Use the backend method to access the "Parameters" structure. 2020-12-04 Chris Dumez <cdumez@apple.com> Improve vectorization in SincResampler https://bugs.webkit.org/show_bug.cgi?id=219546 Reviewed by Darin Adler. Add USE(ACCELERATE) vectorization logic to SincResampler for Cocoa ports. Also import HAVE(ARM_NEON_INTRINSICS) vectorization from Blink: - https://github.com/chromium/chromium/blob/master/media/base/sinc_resampler.cc Move convolution implements from process() to a separate convolve() function for clarity. * platform/audio/SincResampler.cpp: (WebCore::SincResampler::SincResampler): (WebCore::SincResampler::process): (WebCore::SincResampler::convolve): * platform/audio/SincResampler.h: 2020-12-04 John Wilander <wilander@apple.com> PCM: Switch to 8+4 bits for source IDs and trigger values respectively https://bugs.webkit.org/show_bug.cgi?id=219519 <rdar://problem/70470036> Reviewed by Brent Fulgham. We've received a lot of feedback saying increased entropy on the click side is more important than the current 6 bits on the conversion side. Some of that conversation is captured in https://github.com/privacycg/private-click-measurement/issues/28. This patch switches from 6+6 bits to 8+4 bits. It also fixes some minor logging issues. Existing layout tests and API tests were updated. * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parsePrivateClickMeasurement const): * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::parseAttributionRequest): Removed the check that would log "Conversion was not accepted because the URL path did not start with ..." on every redirect in PCM Debug Mode. It was wrong and annoying. (WebCore::PrivateClickMeasurement::json const): Added a call to isValid(). Other checks made sure this wasn't an issue but I'd rather have it in this public function too. * loader/PrivateClickMeasurement.h: (WebCore::PrivateClickMeasurement::AttributionTriggerData::isValid const): 2020-12-04 Chris Dumez <cdumez@apple.com> Drop unused data members from SincResampler https://bugs.webkit.org/show_bug.cgi?id=219548 Reviewed by Darin Adler. * platform/audio/SincResampler.h: 2020-12-04 Brian Burg <bburg@apple.com> Web Inspector: InspectorFrontendAPIDispatcher should not ignore all exceptions https://bugs.webkit.org/show_bug.cgi?id=219378 Reviewed by Devin Rousso. Covered by existing Web Inspector layout tests. * bindings/js/ScriptController.h: Make evaluateInWorld public and exported. * inspector/InspectorFrontendAPIDispatcher.h: * inspector/InspectorFrontendAPIDispatcher.cpp: (WebCore::InspectorFrontendAPIDispatcher::evaluateOrQueueExpression): (WebCore::InspectorFrontendAPIDispatcher::evaluateExpression): Evaluate and pass along the result whether it's a value or exception. * inspector/InspectorFrontendClientLocal.h: * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::evaluationResultToBoolean): (WebCore::InspectorFrontendClientLocal::isDebuggingEnabled): (WebCore::InspectorFrontendClientLocal::isTimelineProfilingEnabled): (WebCore::InspectorFrontendClientLocal::isProfilingJavaScript): Refactor the common code to take an EvaluationResult and figure out if the value is true or falsy. * platform/Logging.h: Add an Inspector logging channel, for logging errors. 2020-12-04 Zalan Bujtas <zalan@apple.com> [LFC][Floats] FloatAvoider does not need to keep a pointer to Layout::Box around. https://bugs.webkit.org/show_bug.cgi?id=219529 Reviewed by Antti Koivisto. * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::FloatAvoider): * layout/floats/FloatAvoider.h: (WebCore::Layout::FloatAvoider::isLeftAligned const): (WebCore::Layout::FloatAvoider::isFloatingBox const): (WebCore::Layout::FloatAvoider::layoutBox const): Deleted. * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): 2020-12-04 Fujii Hironori <Hironori.Fujii@sony.com> GraphicsContextGLOpenGL: m_depthBuffer and m_stencilBuffer are used only if USE(OPENGL_ES) https://bugs.webkit.org/show_bug.cgi?id=219422 Reviewed by Don Olmstead. * platform/graphics/opengl/GraphicsContextGLOpenGL.h: Conditioned out m_depthBuffer and m_stencilBuffer with #if !USE(ANGLE) && USE(OPENGL_ES). * platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): Removed code to generate m_depthBuffer and m_stencilBuffer because this code is only for USE(ANGLE). (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): 2020-12-04 David Kilzer <ddkilzer@apple.com> Add safety checks to xsltParamArrayFromParameterMap() <https://webkit.org/b/219407> <rdar://problem/71853069> Reviewed by Darin Adler. * xml/XSLTProcessorLibxslt.cpp: (WebCore::xsltParamArrayFromParameterMap): 2020-12-04 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Move float constraint logic from initialConstraintsForLine to a dedicated function https://bugs.webkit.org/show_bug.cgi?id=219526 Reviewed by Antti Koivisto. We are going to call this new function whenever the line stretches vertically and not just once at the very beginning. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::floatConstraints const): (WebCore::Layout::LineBuilder::initialConstraintsForLine const): (WebCore::Layout::LineBuilder::initialConstraintsForLine): Deleted. * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::floatingState const): 2020-12-04 Kate Cheney <katherine_cheney@apple.com> Create API to enable/disable text interaction gestures in WKWebView https://bugs.webkit.org/show_bug.cgi?id=217784 <rdar://problem/63406241> Reviewed by Wenson Hsieh. Add API to disable text selection for macOS. * page/EventHandler.cpp: (WebCore::EventHandler::selectClosestWordFromMouseEvent): (WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent): (WebCore::EventHandler::handleMousePressEventDoubleClick): (WebCore::EventHandler::handleMousePressEventTripleClick): (WebCore::EventHandler::handleMousePressEventSingleClick): (WebCore::EventHandler::mouseDownMayStartSelect): Create a new function to return whether a click results in a selection. It will always return false if text interaction is disabled. (WebCore::EventHandler::handleMousePressEvent): (WebCore::EventHandler::handleMouseDraggedEvent): (WebCore::EventHandler::updateSelectionForMouseDrag): (WebCore::EventHandler::selectCursor): * page/EventHandler.h: * page/Page.cpp: (WebCore::m_textInteractionEnabled): (WebCore::m_shouldRelaxThirdPartyCookieBlocking): Deleted. * page/Page.h: Store the textInteractionEnabled value in the Page so it is accessible from the EventHandler. (WebCore::Page::textInteractionEnabled): (WebCore::Page::setTextInteractionEnabled): * page/PageConfiguration.h: 2020-12-04 Adam Roben <aroben@apple.com> More FALLBACK_PLATFORM adoption https://bugs.webkit.org/show_bug.cgi?id=219545 Reviewed by Tim Horton. * Configurations/SDKVariant.xcconfig: WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to NO. 2020-12-04 Said Abou-Hallawa <said@apple.com> [GPU Process] Share the NativeImage with GPU Process through a ShareableBitmap https://bugs.webkit.org/show_bug.cgi?id=218934 Reviewed by Tim Horton. Delete a NativeImage constructor and a create method which were used by the deleted IPC coders of the NativeImage. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/NativeImage.cpp: (WebCore::NativeImage::create): (WebCore::NativeImage::NativeImage): * platform/graphics/NativeImage.h: * platform/graphics/NativeImageReference.h: Removed. 2020-12-04 Peng Liu <peng.liu6@apple.com> [MSE] Move track buffer management from SourceBuffer to SourceBufferPrivate https://bugs.webkit.org/show_bug.cgi?id=219332 Reviewed by Daniel Bates. Currently, the `SourceBuffer` class deals with both the DOM related tasks (providing Javascript interfaces, firing events, handling object properties, etc.) and track buffer management. This patch moves the track buffer management from `SourceBuffer` to `SourceBufferPrivate`. The purpose of this change is to support running the track buffer management in the GPU process so that the callbacks from a media parser regarding a new sample is parsed does not need to cross the process boundary (`SourceBufferPrivate` will run in the GPU process). We have to update the interface `SourceBufferPrivateClient` accordingly. When running the track buffer management in the `SourceBuffer` class, we can get some information related to `MediaSource` directly, such as `isSeeking`, `duration`, and `currentMediaTime`. However, after moving it to `SourceBufferPrivate`, we have to get the information from the corresponding `MediaSourcePrivate`. This patch includes some changes for that. No new tests because this patch does not want to introduce any behavior change. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::seekToTime): (WebCore::MediaSource::completeSeek): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::SourceBuffer): (WebCore::SourceBuffer::~SourceBuffer): (WebCore::SourceBuffer::buffered const): (WebCore::SourceBuffer::timestampOffset const): (WebCore::SourceBuffer::setTimestampOffset): (WebCore::SourceBuffer::setAppendWindowStart): (WebCore::SourceBuffer::setAppendWindowEnd): (WebCore::SourceBuffer::resetParserState): (WebCore::SourceBuffer::abort): (WebCore::SourceBuffer::changeType): (WebCore::SourceBuffer::highestPresentationTimestamp const): (WebCore::SourceBuffer::readyStateChanged): (WebCore::SourceBuffer::removedFromMediaSource): (WebCore::SourceBuffer::seekToTime): (WebCore::SourceBuffer::appendBufferInternal): (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): (WebCore::SourceBuffer::removeTimerFired): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): (WebCore::SourceBuffer::validateInitializationSegment): (WebCore::SourceBuffer::sourceBufferPrivateAppendError): (WebCore::SourceBuffer::appendError): (WebCore::SourceBuffer::trySignalAllSamplesEnqueued): (WebCore::SourceBuffer::sourceBufferPrivateDidParseSample): (WebCore::SourceBuffer::sourceBufferPrivateDurationChanged): (WebCore::SourceBuffer::sourceBufferPrivateDidDropSample): (WebCore::SourceBuffer::sourceBufferPrivateStreamEndedWithDecodeError): (WebCore::SourceBuffer::extraMemoryCost const): (WebCore::SourceBuffer::bufferedSamplesForTrackID): (WebCore::SourceBuffer::setMode): (WebCore::SourceBuffer::setShouldGenerateTimestamps): (WebCore::SourceBuffer::isBufferedDirty const): (WebCore::SourceBuffer::setBufferedDirty): (): Deleted. (WebCore::SourceBuffer::TrackBuffer::TrackBuffer): Deleted. (WebCore::SourceBuffer::TrackBuffer::enqueueDiscontinuityBoundary): Deleted. (WebCore::SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted. (WebCore::decodeTimeComparator): Deleted. (WebCore::removeSamplesFromTrackBuffer): Deleted. (WebCore::SourceBuffer::removeCodedFrames): Deleted. (WebCore::SourceBuffer::evictCodedFrames): Deleted. (WebCore::SampleLessThanComparator::operator()): Deleted. (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Deleted. (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples): Deleted. (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples): Deleted. (WebCore::SourceBuffer::provideMediaData): Deleted. (WebCore::SourceBuffer::updateMinimumUpcomingPresentationTime): Deleted. (WebCore::SourceBuffer::resetMinimumUpcomingPresentationTime): Deleted. (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued): Deleted. (WebCore::SourceBuffer::reenqueueMediaForTime): Deleted. (WebCore::SourceBuffer::didDropSample): Deleted. (WebCore::SourceBuffer::updateBufferedFromTrackBuffers): Deleted. * Modules/mediasource/SourceBuffer.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/MediaSourcePrivate.h: (WebCore::MediaSourcePrivate::setIsSeeking): (WebCore::MediaSourcePrivate::isSeeking const): * platform/graphics/SourceBufferPrivate.cpp: Added. (WebCore::SourceBufferPrivate::TrackBuffer::TrackBuffer): (WebCore::enqueueDiscontinuityBoundary): (WebCore::SourceBufferPrivate::SourceBufferPrivate): (WebCore::SourceBufferPrivate::resetTimestampOffsetInTrackBuffers): (WebCore::SourceBufferPrivate::resetTrackBuffers): (WebCore::SourceBufferPrivate::highestPresentationTimestamp const): (WebCore::SourceBufferPrivate::updateBufferedFromTrackBuffers): (WebCore::SourceBufferPrivate::reenqueSamples): (WebCore::SourceBufferPrivate::seekToTime): (WebCore::SourceBufferPrivate::clearTrackBuffers): (WebCore::SourceBufferPrivate::bufferedSamplesForTrackID): (WebCore::SourceBufferPrivate::fastSeekTimeForMediaTime): (WebCore::SourceBufferPrivate::updateMinimumUpcomingPresentationTime): (WebCore::SourceBufferPrivate::trySignalAllSamplesInTrackEnqueued): (WebCore::SourceBufferPrivate::provideMediaData): (WebCore::SourceBufferPrivate::reenqueueMediaForTime): (WebCore::SourceBufferPrivate::reenqueueMediaIfNeeded): (WebCore::decodeTimeComparator): (WebCore::removeSamplesFromTrackBuffer): (WebCore::SourceBufferPrivate::removeCodedFrames): (WebCore::SourceBufferPrivate::evictCodedFrames): (WebCore::SourceBufferPrivate::totalTrackBufferSizeInBytes const): (WebCore::SourceBufferPrivate::addTrackBuffer): (WebCore::SourceBufferPrivate::updateTrackIds): (WebCore::SourceBufferPrivate::setAllTrackBuffersNeedRandomAccess): (WebCore::SourceBufferPrivate::didReceiveInitializationSegment): (WebCore::SourceBufferPrivate::validateInitializationSegment): (WebCore::SourceBufferPrivate::didReceiveSample): * platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::setActive): (WebCore::SourceBufferPrivate::setClient): (WebCore::SourceBufferPrivate::setIsAttached): (WebCore::SourceBufferPrivate::setCurrentTimeFudgeFactor): (WebCore::SourceBufferPrivate::setAppendWindowStart): (WebCore::SourceBufferPrivate::setAppendWindowEnd): (WebCore::SourceBufferPrivate::bufferFull const): (WebCore::SourceBufferPrivate::buffered const): (WebCore::SourceBufferPrivate::isBufferedDirty const): (WebCore::SourceBufferPrivate::setBufferedDirty): (WebCore::SourceBufferPrivate::timestampOffset const): (WebCore::SourceBufferPrivate::setTimestampOffset): (WebCore::SourceBufferPrivate::startChangingType): (WebCore::SourceBufferPrivate::setShouldGenerateTimestamps): (WebCore::SourceBufferPrivate::setMode): (WebCore::SourceBufferPrivate::setGroupStartTimestamp): (WebCore::SourceBufferPrivate::setGroupStartTimestampToEndTimestamp): (WebCore::SourceBufferPrivate::isActive const): (WebCore::SourceBufferPrivate::isSeeking const): (WebCore::SourceBufferPrivate::currentMediaTime const): (WebCore::SourceBufferPrivate::duration const): (WebCore::SourceBufferPrivate::flush): (WebCore::SourceBufferPrivate::enqueueSample): (WebCore::SourceBufferPrivate::allSamplesInTrackEnqueued): (WebCore::SourceBufferPrivate::isReadyForMoreSamples): (WebCore::SourceBufferPrivate::notifyClientWhenReadyForMoreSamples): (WebCore::SourceBufferPrivate::canSetMinimumUpcomingPresentationTime const): (WebCore::SourceBufferPrivate::setMinimumUpcomingPresentationTime): (WebCore::SourceBufferPrivate::clearMinimumUpcomingPresentationTime): * platform/graphics/SourceBufferPrivateClient.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::duration const): (WebCore::MediaSourcePrivateAVFObjC::currentMediaTime const): (WebCore::MediaSourcePrivateAVFObjC::duration): Deleted. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData): (WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource): (WebCore::SourceBufferPrivateAVFObjC::setActive): (WebCore::SourceBufferPrivateAVFObjC::isActive const): (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::isSeeking const): (WebCore::SourceBufferPrivateAVFObjC::currentMediaTime const): (WebCore::SourceBufferPrivateAVFObjC::duration const): (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer): (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): (WebCore::SourceBufferPrivateAVFObjC::setClient): Deleted. (WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime): Deleted. * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp: (WebCore::MediaSourcePrivateGStreamer::duration const): (WebCore::MediaSourcePrivateGStreamer::currentMediaTime const): * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h: * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::append): (WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource): (WebCore::SourceBufferPrivateGStreamer::notifyReadyForMoreSamples): (WebCore::SourceBufferPrivateGStreamer::setActive): (WebCore::SourceBufferPrivateGStreamer::isActive const): (WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment): (WebCore::SourceBufferPrivateGStreamer::didReceiveSample): (WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples): (WebCore::SourceBufferPrivateGStreamer::appendParsingFailed): (WebCore::SourceBufferPrivateGStreamer::isSeeking const): (WebCore::SourceBufferPrivateGStreamer::currentMediaTime const): (WebCore::SourceBufferPrivateGStreamer::duration const): (WebCore::SourceBufferPrivateGStreamer::setClient): Deleted. * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: * platform/mock/mediasource/MockMediaPlayerMediaSource.h: * platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): (WebCore::MockMediaSourcePrivate::currentMediaTime const): (WebCore::MockMediaSourcePrivate::logChannel const): (WebCore::MockMediaSourcePrivate::mediaSourceLogger const): Deleted. (WebCore::MockMediaSourcePrivate::mediaSourceLogIdentifier): Deleted. * platform/mock/mediasource/MockMediaSourcePrivate.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockSourceBufferPrivate::MockSourceBufferPrivate): (WebCore::MockSourceBufferPrivate::didReceiveInitializationSegment): (WebCore::MockSourceBufferPrivate::didReceiveSample): (WebCore::MockSourceBufferPrivate::setActive): (WebCore::MockSourceBufferPrivate::isActive const): (WebCore::MockSourceBufferPrivate::isSeeking const): (WebCore::MockSourceBufferPrivate::currentMediaTime const): (WebCore::MockSourceBufferPrivate::duration const): (WebCore::MockSourceBufferPrivate::logChannel const): (WebCore::MockSourceBufferPrivate::setClient): Deleted. (WebCore::MockSourceBufferPrivate::fastSeekTimeForMediaTime): Deleted. (WebCore::MockSourceBufferPrivate::sourceBufferLogger const): Deleted. (WebCore::MockSourceBufferPrivate::sourceBufferLogIdentifier): Deleted. * platform/mock/mediasource/MockSourceBufferPrivate.h: 2020-12-04 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Only shrink the line with the float when it is intrusive https://bugs.webkit.org/show_bug.cgi?id=219525 Reviewed by Antti Koivisto. In this patch we check if the positioned float box actually intersects the line and shrink the available width accordingly. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::layoutInlineContent): (WebCore::Layout::LineBuilder::computedIntrinsicWidth): (WebCore::Layout::LineBuilder::initialize): (WebCore::Layout::LineBuilder::placeInlineContent): (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::initialConstraintsForLine): (WebCore::Layout::LineBuilder::handleFloatContent): (WebCore::Layout::LineBuilder::handleInlineContent): (WebCore::Layout::LineBuilder::rebuildLineForTrailingSoftHyphen): (WebCore::Layout::LineBuilder::constraintsForLine): Deleted. * layout/inlineformatting/InlineLineBuilder.h: 2020-12-04 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Float positioning needs to happen while building the line https://bugs.webkit.org/show_bug.cgi?id=219523 Reviewed by Antti Koivisto. This patch is in preparation for cases when the float may fit the line and we assume it's intrusive but due to e.g. "clear" it is not intersecting the line at all. In order to figure out whether the float boxes intersect the current line, we need to compute their position as we find them. In this patch the float positioning logic is moved over to LineBuilder (from the line post-processing) and floats are added to the FloatingState as we encounter them while building the line. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const): (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::LineBuilder): (WebCore::Layout::LineBuilder::layoutInlineContent): (WebCore::Layout::LineBuilder::computedIntrinsicWidth): (WebCore::Layout::LineBuilder::initialize): (WebCore::Layout::LineBuilder::constraintsForLine): (WebCore::Layout::LineBuilder::handleFloatContent): * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::formattingState): (WebCore::Layout::LineBuilder::floatingState): 2020-12-04 Zalan Bujtas <zalan@apple.com> Web process assert when loading slack https://bugs.webkit.org/show_bug.cgi?id=219079 <rdar://problem/71814675> Reviewed by Antti Koivisto. While some display types do not make too much sense on replaced elements, Box::isInlineLevelBox should return true for all of them. Test: fast/inline/inline-flex-on-replaced-crash.html * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::isInlineLevelBox const): 2020-12-04 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Decouple inline content and float handling in LineBuilder https://bugs.webkit.org/show_bug.cgi?id=219522 Reviewed by Antti Koivisto. The line candidate content is either a list of inline runs or an individual float box. Let's process them separately. This is in preparation for adding support for "vertically stretchy" lines vs. intrusive floats where the line height may change as we add new inline level boxes and we need to probe against existing floats. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineCandidate::InlineContent::continuousContent const): (WebCore::Layout::LineCandidate::InlineContent::isEmpty const): (WebCore::Layout::LineBuilder::placeInlineContent): (WebCore::Layout::LineBuilder::handleFloatContent): (WebCore::Layout::LineBuilder::handleInlineContent): (WebCore::Layout::LineCandidate::InlineContent::operator() const): Deleted. (WebCore::Layout::LineBuilder::handleFloatOrInlineContent): Deleted. * layout/inlineformatting/InlineLineBuilder.h: 2020-12-03 Simon Fraser <simon.fraser@apple.com> Only the first wheel event in a gesture should be cancelable https://bugs.webkit.org/show_bug.cgi?id=218764 <rdar://problem/71248946> Reviewed by Tim Horton. Implement the WebKit2 version of r270312, where only the first wheel event in a gesture is cancelable. When scrolling over an element with handlers, we do event handling on the main thread, so we can take the compute value of EventHandler's Optional<WheelScrollGestureState> from the first event and send it back to the scrolling thread. However, the scrolling thread needs to block until this first event comes back from the main thread. To achieve this, EventDispatcher::wheelEvent() now dispaches main thread scrolls from the scrolling thread (not the dispatcher thread), and waits on m_waitingForBeganEventCondition with a 50ms timeout for that first event to come back. In the normal case, main thread handling dispatches the event back to the scrolling thread for scrolling via handleWheelEventAfterMainThread(), and then calls wheelEventWasProcessedByMainThread() to signal the condition. If for some reason handleWheelEventAfterMainThread() doesn't get called (e.g. nothing was scrollable), then wheelEventWasProcessedByMainThread() still gets called to signal. If m_waitingForBeganEventCondition times out, then the scrolling thread falls back to non-blocking behaviour (as if the first event was not canceled). Finally, when we know the gesture will become non-blocking, we transition to running the scroll from the scrolling thread, which requires that we set up latching, hence the changes in ScrollingTreeLatchingController. Tested by existing tests in fast/events/wheel. * page/EventHandler.cpp: (WebCore::EventHandler::wheelEventWasProcessedByMainThread): (WebCore::EventHandler::handleWheelEventInScrollableArea): * page/WheelEventTestMonitor.cpp: (WebCore::operator<<): * page/WheelEventTestMonitor.h: * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::processWheelEventForScrolling): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::determineWheelEventProcessing): (WebCore::ScrollingTree::setGestureState): (WebCore::ScrollingTree::gestureState): * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::willSendEventToMainThread): (WebCore::ScrollingTree::waitForEventToBeProcessedByMainThread): * page/scrolling/ScrollingTreeLatchingController.cpp: (WebCore::ScrollingTreeLatchingController::receivedWheelEvent): (WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent): * page/scrolling/ScrollingTreeLatchingController.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread): (WebCore::ThreadedScrollingTree::wheelEventWasProcessedByMainThread): (WebCore::ThreadedScrollingTree::willSendEventToMainThread): (WebCore::ThreadedScrollingTree::waitForEventToBeProcessedByMainThread): * page/scrolling/ThreadedScrollingTree.h: * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::handleWheelEventForScrolling): Need to track deferral for WheelEventTestMonitor. (WebCore::ScrollingCoordinatorMac::wheelEventWasProcessedByMainThread): This is now synchronous to the scrolling thread so no need for the deferrer. (WebCore::nextDeferIdentifier): Deleted. * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: (WebCore::ScrollingCoordinatorNicosia::wheelEventWasProcessedByMainThread): * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): 2020-12-03 Kate Cheney <katherine_cheney@apple.com> Issue logging in to Microsoft Teams if logged into other Microsoft accounts and navigating directly to teams.microsoft.com https://bugs.webkit.org/show_bug.cgi?id=219505 <rdar://problem/71391657> Reviewed by Alex Christensen. This is a temporary quirk to assist a high-traffic website while they complete the large task of migrating away from login flows that require third party cookies. This quirk will be removed when the site is updated. No new tests, site specific quirk. In https://bugs.webkit.org/show_bug.cgi?id=218778 we added a quirk to call the Storage Access API on behalf of microsoft.com when logging into Microsoft Teams. This patch covers a final edge case where a user was logged into other Microsoft accounts prior to the fix. In this case, if the user tries to go straight to teams.microsoft.com, an endless redirect loop will occur because the site has login credentials from a previous Microsoft login but does not have 3rd party cookie access to authenticate the login on teams.microsoft.com. The solution is to redirect the user to the login page for Teams on microsoft.com where the previous fix added a Storage Access prompt. * loader/DocumentLoader.cpp: (WebCore::microsoftTeamsRedirectURL): (WebCore::DocumentLoader::responseReceived): * page/Quirks.cpp: (WebCore::Quirks::isMicrosoftTeamsRedirectURL): * page/Quirks.h: 2020-12-03 Adam Roben <aroben@apple.com> Adopt FALLBACK_PLATFORM https://bugs.webkit.org/show_bug.cgi?id=219504 Reviewed by Tim Horton. * Configurations/SDKVariant.xcconfig: * Scripts/check-xcfilelists.sh: Use FALLBACK_PLATFORM it if it's defined, otherwise use PLATFORM_NAME as before. 2020-12-03 Said Abou-Hallawa <said@apple.com> [GPU Process] Disconnect NativeImages from RemoteResourceCacheProxy when RemoteRenderingBackendProxy is destroyed https://bugs.webkit.org/show_bug.cgi?id=219417 Reviewed by Tim Horton. Allow multiple observers for a single NativeImage. The NativeImage is usually a frame of a CachedImage. The CachedImage can be referenced by multiple pages and every page has its RemoteRenderingBackendProxy which is a superclass of NativeImage::Observer.s * platform/graphics/NativeImage.cpp: (WebCore::NativeImage::~NativeImage): * platform/graphics/NativeImage.h: (WebCore::NativeImage::addObserver): (WebCore::NativeImage::removeObserver): (WebCore::NativeImage::setObserver): Deleted. (): Deleted. 2020-12-03 Simon Fraser <simon.fraser@apple.com> Use red color for sync wheel event handler debug overlay text https://bugs.webkit.org/show_bug.cgi?id=219514 Reviewed by Tim Horton. Use red for the "sync" wheel event handler debug overlay text. * rendering/RenderLayerBacking.cpp: (WebCore::patternForEventListenerRegionType): 2020-12-03 Alex Christensen <achristensen@webkit.org> Serialize NFA to disk before converting it to a DFA when compiling a WKContentRuleList https://bugs.webkit.org/show_bug.cgi?id=219452 Reviewed by Geoffrey Garen. This decreases maximum memory use by about 50% because the NFA and DFA never need to be in memory at the same time. I'll have to do some tuning and on-device measurement, but this may allow us to increase maxRuleCount. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * contentextensions/CombinedURLFilters.cpp: (WebCore::ContentExtensions::CombinedURLFilters::processNFAs): * contentextensions/CombinedURLFilters.h: * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileToBytecode): (WebCore::ContentExtensions::compileRuleList): * contentextensions/ContentExtensionError.cpp: (WebCore::ContentExtensions::contentExtensionErrorCategory): * contentextensions/ContentExtensionError.h: * contentextensions/ContentExtensionsDebugging.h: * contentextensions/DFA.cpp: (WebCore::ContentExtensions::DFA::shrinkToFit): Deleted. * contentextensions/DFA.h: * contentextensions/ImmutableNFA.h: (WebCore::ContentExtensions::ImmutableNFA::clear): (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator* const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator-> const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator== const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator!= const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator++): Deleted. (WebCore::ContentExtensions::ImmutableNFA::IterableConstTargets::begin const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::IterableConstTargets::end const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator== const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator!= const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator++): Deleted. (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::first const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::last const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::data const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::range const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::begin const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::end const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::debugPrint const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::transitionsForNode const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::root const): Deleted. (WebCore::ContentExtensions::ImmutableNFA::finalize): Deleted. * contentextensions/ImmutableNFANodeBuilder.h: * contentextensions/NFAToDFA.cpp: (WebCore::ContentExtensions::epsilonClosureExcludingSelf): (WebCore::ContentExtensions::resolveEpsilonClosures): (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource): (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate): (WebCore::ContentExtensions::createCombinedTransition): (WebCore::ContentExtensions::getOrCreateDFANode): (WebCore::ContentExtensions::NFAToDFA::convert): * contentextensions/NFAToDFA.h: * contentextensions/SerializedNFA.cpp: Added. (WebCore::ContentExtensions::writeAllToFile): (WebCore::ContentExtensions::SerializedNFA::serialize): (WebCore::ContentExtensions::SerializedNFA::SerializedNFA): (WebCore::ContentExtensions::SerializedNFA::pointerAtOffsetInFile const): (WebCore::ContentExtensions::SerializedNFA::nodes const const): (WebCore::ContentExtensions::SerializedNFA::transitions const const): (WebCore::ContentExtensions::SerializedNFA::targets const const): (WebCore::ContentExtensions::SerializedNFA::epsilonTransitionsTargets const const): (WebCore::ContentExtensions::SerializedNFA::actions const const): * contentextensions/SerializedNFA.h: Copied from Source/WebCore/contentextensions/ImmutableNFA.h. (WebCore::ContentExtensions::SerializedNFA::Range::Range): (WebCore::ContentExtensions::SerializedNFA::Range::begin const): (WebCore::ContentExtensions::SerializedNFA::Range::end const): (WebCore::ContentExtensions::SerializedNFA::Range::size const): (WebCore::ContentExtensions::SerializedNFA::Range::operator[] const): (WebCore::ContentExtensions::SerializedNFA::root const): (WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator* const): (WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator-> const): (WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator== const): (WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator!= const): (WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator++): (WebCore::ContentExtensions::SerializedNFA::IterableConstTargets::begin const): (WebCore::ContentExtensions::SerializedNFA::IterableConstTargets::end const): (WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::operator== const): (WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::operator!= const): (WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::operator++): (WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::first const): (WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::last const): (WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::data const): (WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::range const): (WebCore::ContentExtensions::SerializedNFA::IterableConstRange::begin const): (WebCore::ContentExtensions::SerializedNFA::IterableConstRange::end const): (WebCore::ContentExtensions::SerializedNFA::IterableConstRange::debugPrint const): (WebCore::ContentExtensions::SerializedNFA::transitionsForNode const): 2020-12-03 Tim Horton <timothy_horton@apple.com> ASSERTION FAILED: isMainThread() in WTF::Optional<IntSize> &WebCore::surfaceMaximumSize() https://bugs.webkit.org/show_bug.cgi?id=219492 Reviewed by Ryosuke Niwa. No new tests; fixes a failing test. * platform/graphics/cocoa/IOSurface.mm: (WebCore::surfaceMaximumSize): (WebCore::IOSurface::setMaximumSize): (WebCore::IOSurface::maximumSize): maximumSize() is used off the main thread, so wrap it in a WTF::Atomic. 2020-12-03 Chris Dumez <cdumez@apple.com> Crash when trying to suspend an OfflineAudioContext with a bad buffer https://bugs.webkit.org/show_bug.cgi?id=219496 Reviewed by Geoffrey Garen. Test: webaudio/OfflineAudioContext-bad-buffer-suspend-crash.html * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::startOfflineRendering): Throw a NotSupportedError for consistency with Blink. (WebCore::OfflineAudioContext::suspendOfflineRendering): Use length() instead of dereferencing the potentially null renderTarget to get the length. 2020-12-03 Chris Dumez <cdumez@apple.com> Refactor macros for low power mode code https://bugs.webkit.org/show_bug.cgi?id=219497 Reviewed by Geoffrey Garen. Use HAVE(APPLE_LOW_POWER_MODE_SUPPORT) instead of PLATFORM(IOS_FAMILY), which is equivalent. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/LowPowerModeNotifier.h: * platform/cocoa/LowPowerModeNotifier.mm: Renamed from Source/WebCore/platform/ios/LowPowerModeNotifierIOS.mm. (-[WebLowPowerModeObserver initWithNotifier:]): (-[WebLowPowerModeObserver dealloc]): (-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]): (WebCore::LowPowerModeNotifier::LowPowerModeNotifier): (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier): (WebCore::LowPowerModeNotifier::isLowPowerModeEnabled const): (WebCore::LowPowerModeNotifier::notifyLowPowerModeChanged): (WebCore::notifyLowPowerModeChanged): 2020-12-03 Alicia Boya García <aboya@igalia.com> [GStreamer] Fix video losing size at the end of the stream https://bugs.webkit.org/show_bug.cgi?id=219493 Reviewed by Xabier Rodriguez-Calvar. Our port for long had an issue where at the end of the video the tracks would be erased, causing the video to lose its size and by extension its aspect ratio. In absence of a size, WebKit uses the default video size defined by the spec of 300x150 (2:1 aspect ratio). This causes a video element that doesn't have a size set through CSS to shrink to that size at the end of playback, and also for black bars to appear on wider content (e.g. 16:9 video) when watched in full screen mode. This patch fixes the problem by not removing the tracks after an end of stream, and instead reusing them with different pads the next time the video is played. Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended.html * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: (WebCore::TrackPrivateBaseGStreamer::setPad): * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: 2020-12-03 Aditya Keerthi <akeerthi@apple.com> [iOS][FCR] Add new look for buttons in their default state https://bugs.webkit.org/show_bug.cgi?id=219446 <rdar://problem/71904353> Reviewed by Wenson Hsieh. Controls with a button-like appearance include <button> and <input> elements with the following type attributes: “button”, “submit”, “reset”, and “file”. All of these have the same default appearance, with the exception of "submit", which has a darker background and lighter text color than the others. Note that styles for additional states (pressed, disabled) will be added once final specifications are obtained. * css/formControlsIOS.css: (input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::-webkit-file-upload-button, button): (input:matches([type="button"], [type="reset"]), input[type="file"]::-webkit-file-upload-button, button): (input[type="submit"]): * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintPushButtonDecorations): The old button appearance painted a gradient over the button background. This gradient is no longer necessary under the new design. 2020-12-03 Fujii Hironori <Hironori.Fujii@sony.com> GraphicsContextGLOpenGL: Rename IOSurfaceTextureTarget to drawingBufferTextureTarget https://bugs.webkit.org/show_bug.cgi?id=219475 Reviewed by Don Olmstead. Cocoa port has IOSurfaceTextureTarget method to switch a buffer target type. Non-Cocoa ports also need a similar method. Rename IOSurfaceTextureTarget, IOSurfaceTextureTargetQuery and EGLIOSurfaceTextureTarget to drawingBufferTextureTarget, drawingBufferTextureTargetQuery and EGLDrawingBufferTextureTarget. * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTarget): (WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTargetQuery): (WebCore::GraphicsContextGLOpenGL::EGLDrawingBufferTextureTarget): (WebCore::GraphicsContextGLOpenGL::reshapeDisplayBufferBacking): (WebCore::GraphicsContextGLOpenGL::bindDisplayBufferBacking): (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget): Deleted. (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery): Deleted. (WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget): Deleted. * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp: (WebCore::GraphicsContextGLCVANGLE::initializeUVContextObjects): (WebCore::GraphicsContextGLCVANGLE::attachIOSurfaceToTexture): (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: 2020-12-03 Kimmo Kinnunen <kkinnunen@apple.com> GraphicsContextGL has a couple non-robust getters and other small API problems preventing GPU process implementation https://bugs.webkit.org/show_bug.cgi?id=219486 Reviewed by Dean Jackson. Changes GraphicsContextGL and ExtensionsGL to not have duplicate names and have the correct function signatures. Changes few remaining GraphicsContextGL getters to use robust GCGLSpan form. Changes few robust getters to GCGLSpan form and moves them from ExtensionsGL to GraphicsContextGL. Changes GraphicsContextGLOpenGL::getActiveUniforms to return the result vector instead of taking it as non-const reference. This way the out vector does not need to be transferred to the GPU process, when the code is implemented. The call site is also more natural. Requests GL_EXT_occlusion_query_boolean so that WebGL 2.0 occlusion queries work when called with gl::GetQueryObjectuivRobustANGLE. Removes use of mapBufferRange and related functions, changes them to a single getBufferSubData. If the mapping ever is useful, the more complex form of API can be added back. Changes the getInternalformativ call site to check erros similar to other generic error checking: first clear the errors and then after the call check if there are new errors. This is slightly less efficient than using the domain knowledge that the function never returns -1 in the slot. Current single-value-as-return-value pattern cannot express this. In the future, GPU process context cannot / will not support passing non-default in-arrays. In the future, the generic error checking pattern will possibly be improved, circumventing the need for the -1 domain knowledge case. Removes getVertexAttrib*v, they are not used. Removes getAttachedShaders, it is not used. Removes the vendor-based workarounds from ANGLE ExtensionsGL, it was not used. No new tests, a refactor. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getBufferSubData): (WebCore::WebGL2RenderingContext::getInternalformatParameter): (WebCore::WebGL2RenderingContext::vertexAttribI4uiv): (WebCore::WebGL2RenderingContext::getQueryParameter): (WebCore::WebGL2RenderingContext::bindSampler): (WebCore::WebGL2RenderingContext::getSamplerParameter): (WebCore::WebGL2RenderingContext::clientWaitSync): (WebCore::WebGL2RenderingContext::deleteTransformFeedback): (WebCore::WebGL2RenderingContext::beginTransformFeedback): (WebCore::WebGL2RenderingContext::endTransformFeedback): (WebCore::WebGL2RenderingContext::transformFeedbackVaryings): (WebCore::WebGL2RenderingContext::getActiveUniforms): (WebCore::WebGL2RenderingContext::readPixels): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::readPixels): * html/canvas/WebGLSync.cpp: (WebCore::WebGLSync::updateCache): * platform/graphics/ExtensionsGL.h: * platform/graphics/GraphicsContextGL.h: (WebCore::GraphicsContextGL::getInternalformati): * platform/graphics/GraphicsTypesGL.h: * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::ExtensionsGLANGLE): (WebCore::ExtensionsGLANGLE::getGraphicsResetStatusARB): (WebCore::ExtensionsGLANGLE::getTranslatedShaderSourceANGLE): (WebCore::ExtensionsGLANGLE::blitFramebufferANGLE): (WebCore::ExtensionsGLANGLE::renderbufferStorageMultisampleANGLE): (WebCore::ExtensionsGLANGLE::drawArraysInstancedANGLE): (WebCore::ExtensionsGLANGLE::drawElementsInstancedANGLE): (WebCore::ExtensionsGLANGLE::vertexAttribDivisorANGLE): (WebCore::ExtensionsGLANGLE::getUniformuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformivRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformuivRobustANGLE): * platform/graphics/angle/ExtensionsGLANGLE.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::readnPixels): (WebCore::GraphicsContextGLOpenGL::readnPixelsImpl): (WebCore::GraphicsContextGLOpenGL::getBufferSubData): (WebCore::GraphicsContextGLOpenGL::getInternalformativ): (WebCore::GraphicsContextGLOpenGL::getActiveUniforms): (WebCore::GraphicsContextGLOpenGL::getQueryObjectui): (WebCore::GraphicsContextGLOpenGL::getSamplerParameterf): (WebCore::GraphicsContextGLOpenGL::getSamplerParameteri): (WebCore::GraphicsContextGLOpenGL::getSynci): * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): * platform/graphics/opengl/ExtensionsGLOpenGL.cpp: (WebCore::ExtensionsGLOpenGL::blitFramebufferANGLE): (WebCore::ExtensionsGLOpenGL::renderbufferStorageMultisampleANGLE): (WebCore::ExtensionsGLOpenGL::drawArraysInstancedANGLE): (WebCore::ExtensionsGLOpenGL::drawElementsInstancedANGLE): (WebCore::ExtensionsGLOpenGL::vertexAttribDivisorANGLE): * platform/graphics/opengl/ExtensionsGLOpenGL.h: * platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp: * platform/graphics/opengl/ExtensionsGLOpenGLCommon.h: * platform/graphics/opengl/ExtensionsGLOpenGLES.cpp: (WebCore::ExtensionsGLOpenGLES::blitFramebufferANGLE): (WebCore::ExtensionsGLOpenGLES::renderbufferStorageMultisampleANGLE): (WebCore::ExtensionsGLOpenGLES::drawArraysInstancedANGLE): (WebCore::ExtensionsGLOpenGLES::drawElementsInstancedANGLE): (WebCore::ExtensionsGLOpenGLES::vertexAttribDivisorANGLE): * platform/graphics/opengl/ExtensionsGLOpenGLES.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp: (WebCore::GraphicsContextGLOpenGL::readnPixels): * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::reshape): (WebCore::GraphicsContextGLOpenGL::blendFunc): (WebCore::GraphicsContextGLOpenGL::compileShader): (WebCore::GraphicsContextGLOpenGL::getActiveAttribImpl): (WebCore::GraphicsContextGLOpenGL::getActiveAttrib): (WebCore::GraphicsContextGLOpenGL::getActiveUniformImpl): (WebCore::GraphicsContextGLOpenGL::getActiveUniform): (WebCore::GraphicsContextGLOpenGL::originalSymbolName): (WebCore::GraphicsContextGLOpenGL::mappedSymbolName): (WebCore::GraphicsContextGLOpenGL::deleteVertexArray): (WebCore::GraphicsContextGLOpenGL::isVertexArray): (WebCore::GraphicsContextGLOpenGL::getNonBuiltInActiveSymbolCount): (WebCore::GraphicsContextGLOpenGL::getUnmangledInfoLog): (WebCore::GraphicsContextGLOpenGL::getProgramInfoLog): (WebCore::GraphicsContextGLOpenGL::getShaderi): (WebCore::GraphicsContextGLOpenGL::getShaderInfoLog): (WebCore::GraphicsContextGLOpenGL::getShaderSource): (WebCore::GraphicsContextGLOpenGL::drawArraysInstanced): (WebCore::GraphicsContextGLOpenGL::drawElementsInstanced): (WebCore::GraphicsContextGLOpenGL::vertexAttribDivisor): (WebCore::GraphicsContextGLOpenGL::getBufferSubData): (WebCore::GraphicsContextGLOpenGL::getInternalformativ): (WebCore::GraphicsContextGLOpenGL::getQueryObjectui): (WebCore::GraphicsContextGLOpenGL::getSamplerParameterf): (WebCore::GraphicsContextGLOpenGL::getSamplerParameteri): (WebCore::GraphicsContextGLOpenGL::getSynci): (WebCore::GraphicsContextGLOpenGL::getActiveUniforms): (WebCore::GraphicsContextGLOpenGL::getUniformBlockIndex): (WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockName): (WebCore::GraphicsContextGLOpenGL::uniformBlockBinding): (WebCore::GraphicsContextGLOpenGL::readnPixels): * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp: (WebCore::GraphicsContextGLOpenGL::readnPixels): (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): 2020-12-03 Aditya Keerthi <akeerthi@apple.com> [iOS][FCR] Add new look for search fields https://bugs.webkit.org/show_bug.cgi?id=219443 <rdar://problem/71902666> Reviewed by Wenson Hsieh. Tests: fast/forms/ios/form-control-refresh/search/background-color.html fast/forms/ios/form-control-refresh/search/border.html fast/forms/ios/form-control-refresh/search/font-size.html fast/forms/ios/form-control-refresh/search/results-attribute.html fast/forms/ios/form-control-refresh/search/width-height.html * css/formControlsIOS.css: (input[type="search"]): Unlike traditional text fields, the new appearance has no border and a filled background. (input[type="search"]::-webkit-search-decoration,): The new appearance has a magnifying glass glyph in the search field. On macOS, the glyph changes depending on the value of the "results" attribute. However, on iOS, the glyph should always be shown. Consequently, "-webkit-search-decoration", "-webkit-search-results-decoration", and "-webkit-search-results-button" all specify the same glyph. * rendering/RenderThemeIOS.mm: (WebCore::canAdjustBorderRadiusForAppearance): The old search field forced a pill-like appearance. This is no longer required under the new appearance. (WebCore::RenderThemeIOS::adjustRoundBorderRadius): 2020-12-03 Aditya Keerthi <akeerthi@apple.com> [iOS][FCR] Add new look for controls with text entry https://bugs.webkit.org/show_bug.cgi?id=219362 rdar://problem/71813850 Reviewed by Wenson Hsieh. Controls with text entry include <textarea> and the following <input> types: "email", "password", "search", "tel", "text", and "url". Additionally, <input> without a specified type is also a control with text entry, since the default behavior matches <input type="text">. * css/formControlsIOS.css: (textarea, input): Updated border and font to match new look. * css/html.css: Removed input[type="range"] and input:matches([type="password"], [type="search"]) from the rule-set containing the selector "input", since "input" encompasses "range", "password", and "search". This change aligns with the user-agent stylesheets in Chrome and Firefox. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintTextFieldDecorations): The previous appearance painted a gradient inside the control. However, the new appearance does not have any decorations. 2020-12-03 Fujii Hironori <Hironori.Fujii@sony.com> Remove GraphicsContextGLOpenGL::setRenderbufferStorageFromDrawable declaration https://bugs.webkit.org/show_bug.cgi?id=219463 Reviewed by Alex Christensen. r268198 removed the definition. * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp: (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): Removed a dead code of USE(OPENGL_ES) in PLATFORM(COCOA). 2020-12-03 Jer Noble <jer.noble@apple.com> MediaSessionHelper::setSharedHelper() hangs when "media in the GPU process" is enabled https://bugs.webkit.org/show_bug.cgi?id=219466 <rdar://problem/71566601> Reviewed by Chris Dumez. The WebProcess will attempt to set a RemoteMediaSessionHelper as the sharedHelper, but calling MediaSessionHelper::setSharedHelper() will cause a MediaSessionHelperIOS to be created, which in turn tries to talk to AVSystemController.sharedAVSystemController, which fails due to sandbox restrictions. Refactor sharedHelperInstance() to not create a MediaSessionHelperIOS by default, which allows setSharedHelper to assign a new helper without creating one by default. * platform/audio/ios/MediaSessionHelperIOS.mm: (sharedHelperInstance): (MediaSessionHelper::sharedHelper): (MediaSessionHelper::resetSharedHelper): (MediaSessionHelper::setSharedHelper): 2020-12-03 Andres Gonzalez <andresg_22@apple.com> Fix for crash handling NSAccessibilityInsertionPointLineNumberAttribute for text fields in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=219477 Reviewed by Chris Fleizach. Tests: accessibility/content-editable-as-textarea.html accessibility/mac/content-editable-range-properties.html - Implemented AXIsolatedObject::selectionStart/End, selectedText, visiblePositionForIndex. - Handler of the NSAccessibilityInsertionPointLineNumberAttribute request now dispatches to the main thread the calls that involve VisiblePositions. - This change fixes the above mentioned layout tests in isolated tree mode. * accessibility/AccessibilityObjectInterface.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::selectionStart const): (WebCore::AXIsolatedObject::selectionEnd const): (WebCore::AXIsolatedObject::selectedText const): (WebCore::AXIsolatedObject::visiblePositionForIndex const): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 2020-12-03 Tim Horton <timothy_horton@apple.com> GPU Process: Sandbox violations under IOSurface::maximumSize in the Web Content process https://bugs.webkit.org/show_bug.cgi?id=219484 <rdar://problem/71603808> Reviewed by Ryosuke Niwa. * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: (WebCore::computeMaximumSurfaceSize): (WebCore::surfaceMaximumSize): (WebCore::IOSurface::setMaximumSize): (WebCore::IOSurface::maximumSize): Make it possible to externally override IOSurface::maximumSize. 2020-12-03 Lauro Moura <lmoura@igalia.com> [WTF] Avoid JSONValue::create with raw string falling to bool overload https://bugs.webkit.org/show_bug.cgi?id=219483 Reviewed by Adrian Perez de Castro. Covered by existing tests. * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Convert to WTF::String when creating the value. 2020-12-03 Martin Robinson <mrobinson@igalia.com> Move code from AxisScrollSnapOffsets to ScrollSnapOffsetsInfo https://bugs.webkit.org/show_bug.cgi?id=219345 Reviewed by Daniel Bates. No new tests. This should not modify behavior. * Headers.cmake: Remove AxisScrollSnapOffsets.h from header list. * Sources.txt: Update source list. * WebCore.xcodeproj/project.pbxproj: Ditto. * page/FrameView.cpp: Update includes. * page/scrolling/AxisScrollSnapOffsets.h: Removed. * page/scrolling/ScrollSnapOffsetsInfo.cpp: Renamed from Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp. (WebCore::indicesOfNearestSnapOffsetRanges): Added from AxisScrollSnapOffsets. (WebCore::indicesOfNearestSnapOffsets): Ditto. (WebCore::closestSnapOffset): Ditto. (WebCore::computeScrollSnapPortOrAreaRect): Ditto. (WebCore::computeScrollSnapAlignOffset): Ditto. (WebCore::operator<<): Ditto. (WebCore::computeAxisProximitySnapOffsetRanges): Ditto. (WebCore::updateSnapOffsetsForScrollableArea): Ditto. * page/scrolling/ScrollSnapOffsetsInfo.h: Added functions from AxisScrollSnapOffsets.h and surrounded this header in conditional compilation so it can be included unconditionally. * page/scrolling/ScrollingCoordinator.h: Updated includes. * page/scrolling/ScrollingMomentumCalculator.h: Ditto. * platform/cocoa/ScrollSnapAnimatorState.h: Ditto. * rendering/RenderLayer.cpp: Ditto. 2020-12-02 Simon Fraser <simon.fraser@apple.com> Determine the WheelScrollGestureState on the main thread before passing it to ScrollingCoordinator https://bugs.webkit.org/show_bug.cgi?id=219481 Reviewed by Tim Horton. Fixing webkit.org/b/218764 requires that we store state for a given series of wheel events related to whether the "begin" event had preventDefault() called on it (i.e. was canceled). Previously code was designed to propagate OptionSet<EventHandling> around, and use it to compute WheelScrollGestureState in both EventHandler and ScrollingTree code. However, we can compute WheelScrollGestureState just once in EventHandler, and pass it to ScrollingCoordinator. To achieve this, add a bottleneck in the form of EventHandler::handleWheelEventInScrollableArea() and before calling the ScrollableArea function (implementation of which can call ScrollingCoordinator), compute WheelScrollGestureState from OptionSet<EventHandling>. This required making handleWheelEventInAppropriateEnclosingBox() a member function. * page/EventHandler.cpp: (WebCore::EventHandler::processWheelEventForScrolling): (WebCore::EventHandler::handleWheelEvent): (WebCore::handleWheelEventPhaseInScrollableArea): (WebCore::didScrollInScrollableArea): (WebCore::EventHandler::handleWheelEventInAppropriateEnclosingBox): (WebCore::EventHandler::handleWheelEventInScrollableArea): (WebCore::EventHandler::updateWheelGestureState): (WebCore::EventHandler::defaultWheelEventHandler): (WebCore::handleWheelEventInAppropriateEnclosingBox): Deleted. * page/EventHandler.h: * page/FrameView.cpp: (WebCore::FrameView::handleWheelEventForScrolling): * page/FrameView.h: * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::wheelEvent): (WebCore::EventHandler::processWheelEventForScrolling): (WebCore::EventHandler::wheelEventWasProcessedByMainThread): * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::handleWheelEventForScrolling): (WebCore::ScrollingCoordinator::wheelEventWasProcessedByMainThread): * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread): (WebCore::ThreadedScrollingTree::wheelEventWasProcessedByMainThread): * page/scrolling/ThreadedScrollingTree.h: * page/scrolling/mac/ScrollingCoordinatorMac.h: * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::handleWheelEventForScrolling): (WebCore::ScrollingCoordinatorMac::wheelEventWasProcessedByMainThread): * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: (WebCore::ScrollingCoordinatorNicosia::handleWheelEventForScrolling): (WebCore::ScrollingCoordinatorNicosia::wheelEventWasProcessedByMainThread): * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h: * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::handleWheelEventForScrolling): * platform/ScrollableArea.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::handleWheelEventForScrolling): * rendering/RenderLayer.h: 2020-12-02 Rob Buis <rbuis@igalia.com> Remove m_reversedOrderIteratorForHitTesting https://bugs.webkit.org/show_bug.cgi?id=218554 Reviewed by Zalan Bujtas. Remove m_reversedOrderIteratorForHitTesting as determining it at hit test time should not be very expensive. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::hitTestChildren): (WebCore::RenderFlexibleBox::layoutFlexItems): * rendering/RenderFlexibleBox.h: 2020-12-02 Fujii Hironori <Hironori.Fujii@sony.com> GraphicsContextGL: Remove unused platformTexture and platformGraphicsContextGL interface https://bugs.webkit.org/show_bug.cgi?id=219461 Reviewed by Daniel Bates. * platform/graphics/GraphicsContextGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp: (WebCore::GraphicsContextGLOpenGL::platformGraphicsContextGL): Deleted. (WebCore::GraphicsContextGLOpenGL::platformTexture const): Deleted. * platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp: (WebCore::GraphicsContextGLOpenGL::platformGraphicsContextGL const): Deleted. (WebCore::GraphicsContextGLOpenGL::platformTexture const): Deleted. 2020-12-02 Chris Dumez <cdumez@apple.com> iframe with `sandbox=allow-top-navigation-by-user-activation` can navigate top frame when the user interacts with an iframe from another origin https://bugs.webkit.org/show_bug.cgi?id=219413 <rdar://problem/64887657> Reviewed by Geoffrey Garen. An iframe with `sandbox=allow-top-navigation-by-user-activation` can navigate the top frame when the user interacts with an frame from another origin. This is not strict enough and does not match the behavior of Chrome. In Chrome, the user activation is only valid for the purpose of navigation if the user interacted with either: - The iframe triggering the navigation - A descendant iframe of the iframe triggering the navigation - A frame from the same origin as the iframe triggering the navigation This patch aligns our behavior with Chrome's. Test: http/tests/security/block-top-level-navigations-by-sandboxed-iframe-with-propagated-user-gesture.html * dom/Document.cpp: (WebCore::Document::canNavigateInternal): * dom/UserGestureIndicator.cpp: (WebCore::UserGestureToken::UserGestureToken): (WebCore::UserGestureToken::isValidForDocument const): (WebCore::UserGestureIndicator::processingUserGesture): * dom/UserGestureIndicator.h: (WebCore::UserGestureToken::create): 2020-12-02 Chris Dumez <cdumez@apple.com> Block suspicious top level navigations by iframes even if sandbox=allow-top-navigation is specified https://bugs.webkit.org/show_bug.cgi?id=219408 <rdar://problem/71049726> Reviewed by Geoffrey Garen. Block suspicious top level navigations by iframes even if sandbox=allow-top-navigation is specified, when the parent of the sandboxed iframe is not first-party. Test: http/tests/security/block-top-level-navigations-by-third-party-sandboxed-iframe.html * dom/Document.cpp: (WebCore::Document::isNavigationBlockedByThirdPartyIFrameRedirectBlocking): 2020-12-02 Truitt Savell <tsavell@apple.com> Unreviewed, reverting r270339. introduced a constantly failing test. Reverted changeset: "Toggling pointer-events on body does not re-enable scrolling on child" https://bugs.webkit.org/show_bug.cgi?id=218533 https://trac.webkit.org/changeset/270339 2020-12-02 Megan Gardner <megan_gardner@apple.com> Create and draw app highlights https://bugs.webkit.org/show_bug.cgi?id=219365 Reviewed by Wenson Hsieh. Create a separate highlight register for app highlights so that there is a clear separation with no risk of web content accessing the wrong highlights. Extend rendering to include the app highlights with the current default settings. * Modules/highlight/Highlight.h: * Modules/highlight/HighlightRegister.cpp: (WebCore::HighlightRegister::appHighlightKey): (WebCore::HighlightRegister::addAppHighlight): * Modules/highlight/HighlightRegister.h: * WebCore.xcodeproj/project.pbxproj: * css/CSSValueKeywords.in: * dom/Document.cpp: (WebCore::Document::appHighlightRegister): (WebCore::Document::collectRageDataFromRegister): (WebCore::Document::updateHighlightPositions): * dom/Document.h: * dom/StaticRange.h: * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * rendering/HighlightData.cpp: (WebCore::rendererAfterOffset): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::resolveStyleForMarkedText): (WebCore::InlineTextBox::collectMarkedTextsForHighlights const): * rendering/MarkedText.h: * rendering/RenderTheme.cpp: (WebCore::RenderTheme::platformAppHighlightColor const): * rendering/RenderTheme.h: * rendering/RenderThemeIOS.mm: (WebCore::cssValueIDSelectorList): * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::platformAppHighlightColor const): (WebCore::RenderThemeMac::systemColor const): 2020-12-02 Julian Gonzalez <julian_a_gonzalez@apple.com> Fix crash with performance.measure() with negative duration https://bugs.webkit.org/show_bug.cgi?id=219418 Reviewed by Alex Christensen. In PerformanceUserTiming::measure(), the wrong variable is used to look up the exception to return if an invalid duration value is provided. Updated user-timing-apis test to catch this crash. * page/PerformanceUserTiming.cpp: (WebCore::PerformanceUserTiming::measure): 2020-12-02 Andres Gonzalez <andresg_22@apple.com> Fix for accessibility layout tests involving ranges in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=219436 Reviewed by Chris Fleizach. Tests: accessibility/mac/bounds-for-range.html accessibility/misspelling-range.html - Implementation of AXIsolatedObject::boundsForRange and misspellingRange. - Fix for bug in stringForRange that wasn't isolatedCopying the returned string. Also this method should not dispatch the call to the main thread since the caller needs to do so because it is passing a SimpleRange as a parameter. - Implementation of AXIsolatedObject::lineForPosition. Other methods that take or return VisiblePositions and VisiblePositionRanges need also to be implemented. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::stringForRange const): (WebCore::AXIsolatedObject::boundsForRange const): (WebCore::AXIsolatedObject::misspellingRange const): (WebCore::AXIsolatedObject::lineForPosition const): * accessibility/isolatedtree/AXIsolatedObject.h: 2020-12-02 Simon Fraser <simon.fraser@apple.com> Optimize padding in EventHandler and platform event classes https://bugs.webkit.org/show_bug.cgi?id=219420 Reviewed by Ryosuke Niwa. Organize the member variables in EventHandler a bit better, to minimize padding and avoid redundant #ifdefs. This shrinks it from 632 bytes to 576 bytes. Minimize padding in the Platform*Event classes. * page/EventHandler.h: * platform/PlatformEvent.h: (WebCore::PlatformEvent::PlatformEvent): * platform/PlatformKeyboardEvent.h: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): * platform/PlatformMouseEvent.h: (WebCore::PlatformMouseEvent::PlatformMouseEvent): * platform/PlatformWheelEvent.h: (WebCore::PlatformWheelEvent::m_wheelTicksY): (WebCore::PlatformWheelEvent::m_granularity): Deleted. 2020-12-02 Aditya Keerthi <akeerthi@apple.com> REGRESSION: [iOS] imported/w3c/web-platform-tests/css/css-ui/appearance-revert-001.tentative.html is a flaky image failure https://bugs.webkit.org/show_bug.cgi?id=219410 <rdar://problem/71868276> Reviewed by Wenson Hsieh. The flaky failure started appearing after r270065, which introduced a new look for progress bars when the iOSFormControlRefresh setting is enabled. Animated indeterminate progress bars were added as part of the new appearance. However, since the setting is disabled by default, there should have been no effect on existing tests. r270065 omitted an early return in RenderThemeIOS::animationRepeatIntervalForProgressBar, which would lead to the existing progress bar being repainted 30 times per second. This repainting is the likely cause of the flaky image failure. Furthermore, this test uses a determinate progress bar, so repainting due to animation should never occur, regardless of whether or not the iOSFormControlRefresh setting is enabled. To fix the incorrect behavior, a change was made to RenderProgress::updateAnimationState. * rendering/RenderProgress.cpp: (WebCore::RenderProgress::updateAnimationState): Only indeterminate progress bars have an animation. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::animationRepeatIntervalForProgressBar const): Use the original value if the iOSFormControlRefresh setting is disabled. 2020-12-01 Tim Horton <timothy_horton@apple.com> GPU Process: IOSurfaces should not be mapped into the Web Content Process https://bugs.webkit.org/show_bug.cgi?id=219368 Reviewed by Said Abou-Hallawa. * platform/graphics/ConcreteImageBuffer.h: * platform/graphics/ImageBuffer.h: * platform/graphics/ImageBufferBackend.h: * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: Make it possible to determine if an image buffer's backend is capable of mapping the backing store in-process or not. 2020-12-01 Andres Gonzalez <andresg_22@apple.com> Fix for accessibility attributed string tests in isolated mode. https://bugs.webkit.org/show_bug.cgi?id=219419 Reviewed by Chris Fleizach. Tests: accessibility/mac/attributed-string-includes-misspelled-with-selection.html accessibility/mac/attributed-string/attributed-string-does-not-includes-misspelled-for-non-editable.html accessibility/mac/misspelled-attributed-string.html Implemented AXIsolatedObject::rangeForPlainTextRange which is needed to build the attributed string for a given range. Also Implemented AXIsolatedObject::doAXBoundsForRangeUsingCharacterOffset and makeRangeVisible as a follow up to the previous patch to support PlaintTextRanges in isolated tree mode. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::rangeForPlainTextRange const): (WebCore::AXIsolatedObject::makeRangeVisible): (WebCore::AXIsolatedObject::doAXBoundsForRangeUsingCharacterOffset const): * accessibility/isolatedtree/AXIsolatedObject.h: 2020-12-01 Devin Rousso <drousso@apple.com> Toggling pointer-events on body does not re-enable scrolling on child https://bugs.webkit.org/show_bug.cgi?id=218533 <rdar://problem/71009746> Reviewed by Simon Fraser. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresRecompositeLayer const): Changes to the CSS `pointer-events` property should also also indicate that a recomposite is required (`StyleDifference::RecompositeLayer`), resulting in `RenderElement::styleWillChange` being called, which invalidates the event region since the value of the CSS `pointer-events` property has changed. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerStyleChanged): Don't limit `StyleDifference::RecompositeLayer` changes to only affect `RenderWidget`. 2020-12-01 Simon Fraser <simon.fraser@apple.com> Simplify some callsites of WheelEventTestMonitor https://bugs.webkit.org/show_bug.cgi?id=219416 Reviewed by Daniel Bates. Migrate towards more usage of WheelEventTestMonitorCompletionDeferrer, using a pattern where we WTFMove() one into a completion handler to pair the defer/undefer pairs, rather than having manual deferral/undeferral. To make this work, WheelEventTestMonitorCompletionDeferrer gains a move constructor, that nullifies the m_monitor in the source to prevent double firing. Remove the WheelEventTestMonitor::RequestedScrollPosition deferral, since that code path is now synchronous. * page/EventHandler.cpp: (WebCore::EventHandler::handleWheelEventInternal): * page/FrameView.cpp: (WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl): * page/WheelEventTestMonitor.cpp: (WebCore::WheelEventTestMonitor::removeDeferralForReason): * page/WheelEventTestMonitor.h: (WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer): * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate): (WebCore::AsyncScrollingCoordinator::synchronizeStateFromScrollingTree): (WebCore::AsyncScrollingCoordinator::applyPendingScrollUpdates): (WebCore::AsyncScrollingCoordinator::applyScrollUpdate): (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): (WebCore::AsyncScrollingCoordinator::noteScrollingThreadSyncCompleteForNode): Deleted. * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::wheelEventTestMonitor): * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll): (WebCore::ThreadedScrollingTree::setActiveScrollSnapIndices): (WebCore::ThreadedScrollingTree::scrollingTreeNodeRequestsScroll): Deleted. * page/scrolling/ThreadedScrollingTree.h: * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::wheelEventWasProcessedByMainThread): * page/scrolling/mac/ScrollingTreeMac.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent): 2020-12-01 Peng Liu <peng.liu6@apple.com> [Media In GPU Process][MSE] Add the support to forward initialization segment from the GPU Process to Web processes https://bugs.webkit.org/show_bug.cgi?id=219227 Reviewed by Eric Carlson. * Headers.cmake: 2020-12-01 Chris Fleizach <cfleizach@apple.com> AX: VoiceOver does not announce the aria-checked state for ARIA treeitem https://bugs.webkit.org/show_bug.cgi?id=218316 <rdar://problem/70787809> Reviewed by Zalan Bujtas. Tree items need to be able to support their aria-checked status according to WAI-ARIA. In addition, when the value changes they need to be able to post an appropriate notification. While working on this, I realized that if an attribute changes, the notification is not fired until the next layout change which is problematic. Those need to fire immediately. Test: accessibility/mac/checked-status-tree-items.html accessibility/ios-simulator/checked-status-tree-items.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::deferAttributeChangeIfNeeded): * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::isChecked const): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::supportsCheckedState const): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/AccessibilityTreeItem.cpp: (WebCore::AccessibilityTreeItem::supportsCheckedState const): * accessibility/AccessibilityTreeItem.h: * accessibility/ios/AXObjectCacheIOS.mm: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityTraits]): (-[WebAccessibilityObjectWrapper accessibilityValue]): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (AXAttributedStringAppendText): (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 2020-12-01 Andres Gonzalez <andresg_22@apple.com> Fix for multiple LayoutTests/accessibility tests in isolated tree mode that rely on PlainTextRange. https://bugs.webkit.org/show_bug.cgi?id=219411 Reviewed by Chris Fleizach. Tests: accessibility/insert-newline.html accessibility/mac/input-string-for-range-crash.html accessibility/mac/range-for-contenteditable-newline.html accessibility/mac/range-for-line-textarea.html accessibility/set-selected-text-range-after-newline.html accessibility/textarea-line-for-index.html accessibility/mac/select-element-selection-with-optgroups.html Implementation of AXIsolatedObject methods that take or return PlainTextRanges. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::selectedTextRange const): (WebCore::AXIsolatedObject::doAXRangeForLine const): (WebCore::AXIsolatedObject::doAXStringForRange const): (WebCore::AXIsolatedObject::doAXRangeForPosition const): (WebCore::AXIsolatedObject::doAXRangeForIndex const): (WebCore::AXIsolatedObject::doAXStyleRangeForIndex const): (WebCore::AXIsolatedObject::doAXBoundsForRange const): (WebCore::AXIsolatedObject::doAXLineForIndex): * accessibility/isolatedtree/AXIsolatedObject.h: 2020-12-01 Aditya Keerthi <akeerthi@apple.com> [iOS] <button> with multi-line content does not render properly https://bugs.webkit.org/show_bug.cgi?id=219372 <rdar://problem/6061602> Reviewed by Darin Adler. Currently, on iOS, a <button> that has multiple lines of content clips the content to a single line. This behavior is incorrect, since <button> can contain arbitrary HTML and should resize based on its content. The incorrect behavior occurs due to the forcing of a single line height for the button in RenderThemeIOS::adjustButtonStyle. To fix, replace setHeight with setMinHeight when styling the button. This ensures the button retains its appearance for single-line content, but does not clip multi-line content. Test: fast/forms/button-multiline-height.html * rendering/RenderTheme.cpp: (WebCore::RenderTheme::adjustButtonStyle const): * rendering/RenderTheme.h: (WebCore::RenderTheme::setButtonSize): Removed. This virtual method is unnecessary, as it is only used by a single derived class, RenderThemeIOS. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::adjustButtonStyle const): No longer round down the height calculation, to ensure the min height better matches the font size. 2020-12-01 Youenn Fablet <youenn@apple.com> Update SFrame transformation implementation according post-commit review https://bugs.webkit.org/show_bug.cgi?id=218981 Reviewed by Geoffrey Garen. Add an ASSERT that salt key size is 16 or above so that IV computation is safe. Move HMAC SHA 256 Cocoa implementation to CryptoUtilitiesCocoa.cpp. A follow-up patch should move CryptoUtilitiesCocoa.cpp to platform or PAL. No change of behavior. * Modules/mediastream/RTCRtpSFrameTransformer.cpp: (WebCore::RTCRtpSFrameTransformer::setEncryptionKey): * Modules/mediastream/RTCRtpSFrameTransformerCocoa.cpp: (WebCore::RTCRtpSFrameTransformer::computeEncryptedDataSignature): * crypto/mac/CryptoAlgorithmHMACMac.cpp: (WebCore::CryptoAlgorithmHMAC::platformSign): (WebCore::CryptoAlgorithmHMAC::platformVerify): (WebCore::calculateSignature): Deleted. * crypto/mac/CryptoUtilitiesCocoa.cpp: (WebCore::calculateHMACSignature): (WebCore::calculateSHA256Signature): * crypto/mac/CryptoUtilitiesCocoa.h: 2020-12-01 Lauro Moura <lmoura@igalia.com> Unreviewed. Fix the reaches end of non-void function warning since r270294. No new tests. No new behaviors. * Modules/mediastream/RTCRtpScriptTransformerContext.h: (WebCore::RTCRtpScriptTransformerContext::requestKeyFrame): Add default clause returning void. 2020-11-30 Simon Fraser <simon.fraser@apple.com> [WK1] Only the first wheel event in a gesture should be cancelable https://bugs.webkit.org/show_bug.cgi?id=219384 Reviewed by Chris Dumez. Implement the logic described at <https://w3c.github.io/uievents/#cancelability-of-wheel-events>, where only the first wheel event in a sequence is cancelable, and, if not canceled, then the rest of the events in the sequence become non-cancelable. This is done for the non-async scrolling code path (i.e. WebKitLegacy) by storing a Optional<WheelScrollGestureState> on EventHandler, which is cleared when we receive the "begin" event, set when we finish processing that event, then consulted for subsequent move events. Tests: fast/events/wheel/first-wheel-event-cancelable.html fast/events/wheel/wheel-events-become-non-cancelable.html * page/EventHandler.h: * page/ios/EventHandlerIOS.mm: (WebCore::EventHandler::wheelEvent): * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::wheelEvent): (WebCore::EventHandler::wheelEventWasProcessedByMainThread): * platform/PlatformWheelEvent.cpp: (WebCore::operator<<): * platform/PlatformWheelEvent.h: 2020-12-01 Youenn Fablet <youenn@apple.com> REGRESSION(STP116): wpt.live/webrtc/RTCRtpTransceiver.https.html crashes on load https://bugs.webkit.org/show_bug.cgi?id=219259 Reviewed by Eric Carlson. Make use of StopStandard instead of the old StopInternal method. Covered by rebased tests. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::addInternalTransceiver): * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCRtpTransceiver.cpp: (WebCore::RTCRtpTransceiver::setConnection): (WebCore::RTCRtpTransceiver::stop): * Modules/mediastream/RTCRtpTransceiver.h: * Modules/mediastream/RTCRtpTransceiver.idl: * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp: (WebCore::LibWebRTCRtpTransceiverBackend::stop): 2020-12-01 Youenn Fablet <youenn@apple.com> DedicatedWorkerGlobalScope should clear m_rtcRtpTransformerConstructorMap before destructor https://bugs.webkit.org/show_bug.cgi?id=219389 Reviewed by Eric Carlson. Clear the constructor map before the destructor in prepareForDestruction like done for audio worklet. Covered by http/wpt/webrtc/webrtc-transform.html no longer crashing with guard malloc. * workers/DedicatedWorkerGlobalScope.cpp: (WebCore::DedicatedWorkerGlobalScope::prepareForDestruction): * workers/DedicatedWorkerGlobalScope.h: * workers/WorkerGlobalScope.h: 2020-12-01 Philippe Normand <pnormand@igalia.com> [GStreamer] Common module should use a dedicated logging category https://bugs.webkit.org/show_bug.cgi?id=219348 Reviewed by Xabier Rodriguez-Calvar. Because this module can be used outside of the MediaPlayer scope, we cannot assume the MediaPlayer debug category will be initialized in time when GST_DEBUG logs need to be emitted from GStreamerCommon. So it is safer to introduce a new, standalone, logging category for this module. * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::initializeGStreamer): 2020-12-01 Rob Buis <rbuis@igalia.com> Lazy loaded iframe should not lazy load when scripting is disabled https://bugs.webkit.org/show_bug.cgi?id=217315 Reviewed by Darin Adler. Lazy loaded iframe should not lazy load when scripting is disabled [1]. Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-script-disabled-iframe.html [1] https://html.spec.whatwg.org/#will-lazy-load-element-steps This matches Chrome and Firefox. * html/HTMLIFrameElement.cpp: (WebCore::isFrameLazyLoadable): (WebCore::HTMLIFrameElement::shouldLoadFrameLazily): * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::isLazyLoadable const): 2020-12-01 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> [WebIDL] Move ShadowRootInit to dedicated idl file from Element.idl https://bugs.webkit.org/show_bug.cgi?id=219261 Reviewed by Don Olmstead. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Element.cpp: * dom/Element.h: * dom/Element.idl: * dom/ShadowRootInit.h: Added. * dom/ShadowRootInit.idl: Added. This patch use the same license header used in bug 216336 because this patch does not change the code essentially at here. 2020-12-01 Youenn Fablet <youenn@apple.com> CSSStyleSheet.cssRules and rules should throw in case of opaque stylesheets https://bugs.webkit.org/show_bug.cgi?id=219203 Reviewed by Alex Christensen. In case of opaque stylesheet, throw a SecurityError as done by Chrome and Firefox. Covered by updated and rebased tests. * css/CSSStyleSheet.cpp: (WebCore::CSSStyleSheet::cssRulesFromJS): (WebCore::CSSStyleSheet::rulesFromJS): * css/CSSStyleSheet.idl: 2020-12-01 Youenn Fablet <youenn@apple.com> Allow RTCRtpScriptTransformer to request key frames https://bugs.webkit.org/show_bug.cgi?id=219199 <rdar://problem/71763010> Reviewed by Eric Carlson. Expose RTCRtpScriptTransformerContext to RTCRtpScriptTransformer as part of third parameter of the 'start' callback. This context exposes some states (sender or receiver transform, audio or video transform). It also exposes the ability to request key frames for video transforms. Make RTCRtpTransformableFrame ref counted so that we can keep it even though the frame was piped to the writable stream. Make LibWebRTCRtpTransformableFrame able to cope with a nullptr internal rtc frame. Add support for RTCEncodedVideoFrame.type. Tests: http/wpt/webrtc/audio-script-transform.html http/wpt/webrtc/video-script-transform.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/mediastream/RTCEncodedVideoFrame.cpp: (WebCore::RTCEncodedVideoFrame::RTCEncodedVideoFrame): * Modules/mediastream/RTCEncodedVideoFrame.h: (WebCore::RTCEncodedVideoFrame::type const): * Modules/mediastream/RTCEncodedVideoFrame.idl: * Modules/mediastream/RTCRtpScriptTransformerContext.h: Added. (WebCore::RTCRtpScriptTransformerContext::side const): (WebCore::RTCRtpScriptTransformerContext::mediaType const): (WebCore::RTCRtpScriptTransformerContext::create): (WebCore::RTCRtpScriptTransformerContext::RTCRtpScriptTransformerContext): (WebCore::RTCRtpScriptTransformerContext::requestKeyFrame): * Modules/mediastream/RTCRtpScriptTransformerContext.idl: Added. * Modules/mediastream/RTCRtpTransformBackend.h: * Modules/mediastream/RTCRtpTransformableFrame.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.cpp: (WebCore::LibWebRTCRtpReceiverTransformBackend::requestKeyFrame): * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.cpp: (WebCore::LibWebRTCRtpSenderTransformBackend::requestKeyFrame): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.cpp: (WebCore::LibWebRTCRtpTransformableFrame::isKeyFrame const): * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-12-01 Rob Buis <rbuis@igalia.com> Remove m_gridItemsIndexesMap https://bugs.webkit.org/show_bug.cgi?id=219392 Reviewed by Manuel Rego Casasnovas. Remove m_gridItemsIndexesMap since it is not used. * rendering/Grid.h: 2020-12-01 Alejandro G. Castro <alex@igalia.com> [GTK][WPE] Async scrolling udpates are blocked in the main thread https://bugs.webkit.org/show_bug.cgi?id=219308 Reviewed by Simon Fraser. We need to avoid this performance improvement of avoiding the refresh for the scrolling thread when no wheel events were recently sent because GTK and WPE kinetic scrolling does not use wheel events to control the animation. We are discussing to change this for the future and make the code more similar for every port. No new tests, not sure if we can add tests for this situation. We detected it manually. * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::displayDidRefresh): This function is also called by the threaded compositor thread in case of GTK and WPE. We can not use that condition for GTK and WPE, kinetic animation does not use the wheel events. 2020-12-01 Youenn Fablet <youenn@apple.com> Add support for readable/writable to RTCRtpSFrameTransform https://bugs.webkit.org/show_bug.cgi?id=219298 Reviewed by Eric Carlson. Add support for locking WritableStream and checking locked state. Add readable/writable getters so that RTCRtpSFrameTransform can be used as a TransformStream. Make a refactoring to allow reuse of SimpleReadableStreamSource and SimpleWritableStreamSink. In case of encryption/decryption error, we do not error the transform as this is final. Instead, we output empty buffers. In case of trying to encrypt unexpected objects, we error the transform. Move RTCRtpTransformableFrame to be ref counted. This allows to keep a RTCRtpTransformableFrame for each RTCEncodedFrame even though the underlying webrtc frame (which is a unique ptr) is given back to the webrtc backend after processing. Covered by updated test. * Modules/mediastream/RTCEncodedAudioFrame.cpp: (WebCore::RTCEncodedAudioFrame::RTCEncodedAudioFrame): * Modules/mediastream/RTCEncodedAudioFrame.h: (WebCore::RTCEncodedAudioFrame::create): * Modules/mediastream/RTCEncodedFrame.cpp: (WebCore::RTCEncodedFrame::RTCEncodedFrame): * Modules/mediastream/RTCEncodedFrame.h: (WebCore::RTCEncodedFrame::rtcFrame): * Modules/mediastream/RTCEncodedVideoFrame.cpp: (WebCore::RTCEncodedVideoFrame::RTCEncodedVideoFrame): * Modules/mediastream/RTCEncodedVideoFrame.h: (WebCore::RTCEncodedVideoFrame::create): * Modules/mediastream/RTCRtpSFrameTransform.cpp: (WebCore::RTCRtpSFrameTransform::RTCRtpSFrameTransform): (WebCore::RTCRtpSFrameTransform::isAttached const): (WebCore::RTCRtpSFrameTransform::initializeTransformer): (WebCore::RTCRtpSFrameTransform::willClearBackend): (WebCore::transformFrame): (WebCore::RTCRtpSFrameTransform::createStreams): (WebCore::RTCRtpSFrameTransform::readable): (WebCore::RTCRtpSFrameTransform::writable): * Modules/mediastream/RTCRtpSFrameTransform.h: (WebCore::RTCRtpSFrameTransform::create): * Modules/mediastream/RTCRtpSFrameTransform.idl: * Modules/mediastream/RTCRtpSFrameTransformer.cpp: (WebCore::RTCRtpSFrameTransformer::setEncryptionKey): (WebCore::RTCRtpSFrameTransformer::decryptFrame): (WebCore::RTCRtpSFrameTransformer::encryptFrame): (WebCore::RTCRtpSFrameTransformer::transform): (WebCore::RTCRtpSFrameTransformer::updateAuthenticationSize): * Modules/mediastream/RTCRtpSFrameTransformer.h: (WebCore::RTCRtpSFrameTransformer::setIsEncrypting): (WebCore::RTCRtpSFrameTransformer::setAuthenticationSize): * Modules/mediastream/RTCRtpSFrameTransformerCocoa.cpp: (WebCore::RTCRtpSFrameTransformer::updateAuthenticationSize): * Modules/mediastream/RTCRtpScriptTransformer.cpp: (WebCore::RTCRtpScriptTransformer::startStreams): * Modules/mediastream/RTCRtpScriptTransformer.h: * Modules/mediastream/RTCRtpTransformBackend.h: * Modules/mediastream/RTCRtpTransformableFrame.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.cpp: * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformBackend.cpp: (WebCore::LibWebRTCRtpTransformBackend::processTransformedFrame): (WebCore::LibWebRTCRtpTransformBackend::Transform): * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.cpp: Added. * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.h: * Modules/streams/ReadableStreamSource.h: (WebCore::SimpleReadableStreamSource::create): (WebCore::SimpleReadableStreamSource::close): (WebCore::SimpleReadableStreamSource::enqueue): * Modules/streams/WritableStreamSink.h: (WebCore::SimpleWritableStreamSink::create): (WebCore::SimpleWritableStreamSink::SimpleWritableStreamSink): (WebCore::SimpleWritableStreamSink::write): * bindings/js/WritableStream.cpp: (WebCore::WritableStreamInternal::callFunction): (WebCore::checkWritableStream): (WebCore::WritableStream::lock): (WebCore::WritableStream::isLocked const): * bindings/js/WritableStream.h: * bindings/scripts/CodeGeneratorJS.pm: (AddToIncludesForIDLType): 2020-12-01 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] WebKit doesn't preserve aspect ratio when computing cross size of flexed images in auto-height flex container https://bugs.webkit.org/show_bug.cgi?id=209983 <rdar://problem/61288094> Reviewed by Darin Adler. Aspect ratio was not preserved in the cross axis because WebKit was stretching the items (as they're auto sized) without considering the aspect ratio. Instead of letting flexbox code deal with that we basically don't stretch them and let RenderReplaced compute the cross size based on the aspect ratio as it does with other elements that are not flex items. This allows us to pass 3 tests from the WPT test suite. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::needToStretchChildLogicalHeight const): Return false for replaced elements with aspect ratio. 2020-11-30 Andres Gonzalez <andresg_22@apple.com> [WebAccessibilityObjectWrapper doAXAttributedStringForRange] needs to run on the main thread. https://bugs.webkit.org/show_bug.cgi?id=219360 Reviewed by Chris Fleizach. Dispatch this call to the main thread in isolated tree mode. In addition, moved several TextMarker static functions and ObjectiveC wrappers out of the WebAccessibilityObjectWrapper implementation in an ongoing effort to move core code out of the accessibility platform wrapper. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::textMarkerRangeFromMarkers): (WebCore::startOrEndTextMarkerForRange): (WebCore::textMarkerRangeFromRange): * accessibility/mac/WebAccessibilityObjectWrapperMac.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): (-[WebAccessibilityObjectWrapper textMarkerRangeFromRange:]): Deleted, not needed, instead call the C function directly. (textMarkerRangeFromRange): Deleted, moved to AXObjectCacheMac.mm. (-[WebAccessibilityObjectWrapper startOrEndTextMarkerForRange:isStart:]): Deleted, not needed, instead call the C function directly. (startOrEndTextmarkerForRange): Deleted, Moved to AXObjectCacheMac.mm. 2020-11-30 Simon Fraser <simon.fraser@apple.com> Pass OptionSet<EventHandling> to various wheel event handler functions https://bugs.webkit.org/show_bug.cgi?id=219373 Reviewed by Tim Horton. Fixing webkit.org/b/218764 will require that code that dispatches wheel events can tell later whether script called preventDefault() on the event, since this will affect whether the rest of the wheel events in a gesture are cancelable. To prepare for this, pass OptionSet<EventHandling> around in event handling code. No behavior change. * dom/Element.cpp: (WebCore::Element::dispatchWheelEvent): * page/EventHandler.cpp: (WebCore::handleWheelEventInAppropriateEnclosingBox): (WebCore::EventHandler::processWheelEventForScrolling): (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::handleWheelEventInternal): (WebCore::EventHandler::defaultWheelEventHandler): * page/EventHandler.h: * page/FrameView.cpp: (WebCore::FrameView::handleWheelEventForScrolling): * page/FrameView.h: * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::wheelEvent): (WebCore::EventHandler::processWheelEventForScrolling): * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::handleWheelEventForScrolling): * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread): * page/scrolling/ThreadedScrollingTree.h: * page/scrolling/mac/ScrollingCoordinatorMac.h: * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::handleWheelEventForScrolling): * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: (WebCore::ScrollingCoordinatorNicosia::handleWheelEventForScrolling): (WebCore::ScrollingCoordinatorNicosia::wheelEventWasProcessedByMainThread): * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h: * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::handleWheelEventForScrolling): * platform/ScrollableArea.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::handleWheelEventForScrolling): * rendering/RenderLayer.h: 2020-11-30 Chris Dumez <cdumez@apple.com> sessionStorage should not be cloned when a window is opened with rel=noopener https://bugs.webkit.org/show_bug.cgi?id=218804 <rdar://problem/71286606> Reviewed by Alex Christensen. sessionStorage should not be cloned when a window is opened with rel=noopener, as per: - https://html.spec.whatwg.org/multipage/browsers.html#copy-session-storage Both Firefox and Chrome have already implemented this behavior. * loader/EmptyFrameLoaderClient.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): * loader/FrameLoaderClient.h: * page/Chrome.cpp: (WebCore::Chrome::createWindow const): 2020-11-30 Alex Christensen <achristensen@webkit.org> Allow blob URLs with fragments https://bugs.webkit.org/show_bug.cgi?id=219361 Reviewed by Darin Adler. When fetching blob content, we use the whole blob URL. In order to match Chrome and Firefox, we need to remove the fragment if there is one. * platform/network/BlobRegistryImpl.cpp: (WebCore::BlobRegistryImpl::getBlobDataFromURL const): 2020-11-30 James Darpinian <jdarpinian@chromium.org> Support KHR_parallel_shader_compile https://bugs.webkit.org/show_bug.cgi?id=219266 Reviewed by Kenneth Russell. Tested by webgl/conformance/extensions/khr-parallel-shader-compile.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMConvertWebGL.cpp: (WebCore::convertToJSValue): * html/canvas/KHRParallelShaderCompile.cpp: Added. (WebCore::KHRParallelShaderCompile::KHRParallelShaderCompile): (WebCore::KHRParallelShaderCompile::getName const): (WebCore::KHRParallelShaderCompile::supported): * html/canvas/KHRParallelShaderCompile.h: Added. * html/canvas/KHRParallelShaderCompile.idl: Added. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getExtension): (WebCore::WebGL2RenderingContext::getSupportedExtensions): * html/canvas/WebGLExtension.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::getExtension): (WebCore::WebGLRenderingContext::getSupportedExtensions): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::getProgramParameter): (WebCore::WebGLRenderingContextBase::getShaderParameter): (WebCore::WebGLRenderingContextBase::extensionIsEnabled): (WebCore::WebGLRenderingContextBase::loseExtensions): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/ExtensionsGL.h: 2020-11-30 Youenn Fablet <youenn@apple.com> Introduce an experimental flag specific to VP9 profile 2 https://bugs.webkit.org/show_bug.cgi?id=219350 Reviewed by Eric Carlson. Introduce an experimental flag for VP9 profile 2. Pass it to libwebrtc backend when creating codec factories. Profile 2 support is only enabled if profile 0 support is also enabled. Covered by updated test. * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile0CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile0CodecEnabled): (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile2CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile2CodecEnabled): (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): Deleted. * platform/mediastream/libwebrtc/LibWebRTCProvider.h: (WebCore::LibWebRTCProvider::setVP9Support): * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: 2020-11-30 Youenn Fablet <youenn@apple.com> Missing WebRTC Metrics in iOS 14 Beta 5 https://bugs.webkit.org/show_bug.cgi?id=215678 <rdar://problem/67625414> Reviewed by Eric Carlson. Expose more stats and fix a bug in stat exposure code for kind. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::fillInboundRtpStreamStats): (WebCore::fillRemoteInboundRtpStreamStats): (WebCore::fillOutboundRtpStreamStats): 2020-11-30 Kenneth Russell <kbr@chromium.org> [WebGL2] Rasterizer discard interferes with implicit clears https://bugs.webkit.org/show_bug.cgi?id=219061 Reviewed by Dean Jackson. When rasterizer discard is enabled, user-level draw calls and clears skip the implicit clear since they have no effect. Readbacks and copies still perform the implicit clear. A new WebGL conformance test has been added for this in https://github.com/KhronosGroup/WebGL/pull/3183 which passes with this fix. WebKit's TestRunner doesn't run the composite phase as the browser or MiniBrowser do, so wouldn't pass this test as integrated as a layout test. Per discussion with dino and kkinnunen on Slack, will address this in follow-on work. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::copyTexSubImage3D): (WebCore::WebGL2RenderingContext::readPixels): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::ScopedDisableRasterizerDiscard::ScopedDisableRasterizerDiscard): (WebCore::ScopedDisableRasterizerDiscard::~ScopedDisableRasterizerDiscard): (WebCore::WebGLRenderingContextBase::initializeNewContext): (WebCore::WebGLRenderingContextBase::clearIfComposited): (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas): (WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData): (WebCore::WebGLRenderingContextBase::clear): (WebCore::WebGLRenderingContextBase::copyTexSubImage2D): (WebCore::WebGLRenderingContextBase::disable): (WebCore::WebGLRenderingContextBase::drawArrays): (WebCore::WebGLRenderingContextBase::drawElements): (WebCore::WebGLRenderingContextBase::enable): (WebCore::WebGLRenderingContextBase::readPixels): (WebCore::WebGLRenderingContextBase::copyTexImage2D): (WebCore::WebGLRenderingContextBase::drawArraysInstanced): (WebCore::WebGLRenderingContextBase::drawElementsInstanced): * html/canvas/WebGLRenderingContextBase.h: 2020-11-30 Simon Fraser <simon.fraser@apple.com> Unreviewed build fix. Fix non-unified builds after r270224. * display/DisplayTreeBuilder.cpp: * display/DisplayTreeBuilder.h: 2020-11-30 Aditya Keerthi <akeerthi@apple.com> RenderTheme::paintDecorations should return void https://bugs.webkit.org/show_bug.cgi?id=219357 Reviewed by Simon Fraser. RenderTheme::paintDecorations currently returns a boolean value. However, the returned value is unused. For clarity, the method is updated to return void. The various "paint*Decorations" methods called in RenderTheme:paintDecorations are also updated to return void. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::paintDecorations): * rendering/RenderTheme.h: (WebCore::RenderTheme::paintFileUploadIconDecorations): (WebCore::RenderTheme::paintCheckboxDecorations): (WebCore::RenderTheme::paintRadioDecorations): (WebCore::RenderTheme::paintButtonDecorations): (WebCore::RenderTheme::paintTextFieldDecorations): (WebCore::RenderTheme::paintTextAreaDecorations): (WebCore::RenderTheme::paintMenuListDecorations): (WebCore::RenderTheme::paintMenuListButtonDecorations): (WebCore::RenderTheme::paintPushButtonDecorations): (WebCore::RenderTheme::paintSquareButtonDecorations): (WebCore::RenderTheme::paintSliderThumbDecorations): (WebCore::RenderTheme::paintSearchFieldDecorations): * rendering/RenderThemeAdwaita.cpp: (WebCore::RenderThemeAdwaita::paintMenuListButtonDecorations): * rendering/RenderThemeAdwaita.h: * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintCheckboxDecorations): (WebCore::RenderThemeIOS::paintRadioDecorations): (WebCore::RenderThemeIOS::paintTextFieldDecorations): (WebCore::RenderThemeIOS::paintTextAreaDecorations): (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): (WebCore::RenderThemeIOS::paintSliderThumbDecorations): (WebCore::RenderThemeIOS::paintSearchFieldDecorations): (WebCore::RenderThemeIOS::paintButtonDecorations): (WebCore::RenderThemeIOS::paintPushButtonDecorations): (WebCore::RenderThemeIOS::paintFileUploadIconDecorations): * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintMenuListButtonDecorations): * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::paintMenuList): (WebCore::RenderThemeWin::paintMenuListButtonDecorations): * rendering/RenderThemeWin.h: 2020-11-30 Tyler Wilcock <twilco.o@protonmail.com> getComputedStyle rounds lineHeight to nearest pixel https://bugs.webkit.org/show_bug.cgi?id=216601 Reviewed by Simon Fraser. When serializing `line-height` for `getComputedStyle`, ensure the value can be represented fractionally (when appropriate). Prior to this patch, `line-height` serialization was always an integer value. Per spec, the used value of `line-height` can be a `<number>` value, which is fractional. Gecko and Chromium allow fractional `line-height`s to be returned from `getComputedStyle`, further confirming this. https://drafts.csswg.org/css2/#propdef-line-height Test: fast/css/line-height-get-computed-style.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::lineHeightFromStyle): Cast result to `double` instead of `int` since `line-height` can be represented fractionally. 2020-11-30 Aditya Keerthi <akeerthi@apple.com> Use real dates and times as placeholders for date/time inputs with editable components https://bugs.webkit.org/show_bug.cgi?id=219216 <rdar://problem/71636615> Reviewed by Devin Rousso. Currently, date/time inputs with editable components have "--" as a placeholder when the input is empty. This is undesirable for two reasons: 1. "--" does not fill the width of the component, leading to an unpleasant appearance. 2. The order of the date/time components is unclear. To resolve these issues, this patch introduces real dates and times as placeholders. For dates, the current date is used as a placeholder. For times, a fixed time (such as "12:30 PM") is used, to avoid being overly specific. Note that the second and millisecond fields for times will always have "00" and "000" as a placeholder respectively. When the placeholder is visible, the text color is changed to dark gray, matching the placeholder in regular text inputs. Note that date/time placeholders are not customizable in any way, as it is an unspecified aspect of the element. Separators are left in the existing text color, to avoid making the input look disabled. * html/shadow/DateTimeEditElement.cpp: (WebCore::DateTimeEditElement::DateTimeEditElement): (WebCore::DateTimeEditElement::placeholderDate const): * html/shadow/DateTimeEditElement.h: Introduced m_placeholderDate, which is set to the current date. * html/shadow/DateTimeFieldElement.cpp: (WebCore::DateTimeFieldElement::setEmptyValue): (WebCore::DateTimeFieldElement::setValueAsInteger): (WebCore::DateTimeFieldElement::visibleValue const): (WebCore::DateTimeFieldElement::updateVisibleValue): Removed early return when the previous visible value is equal to the updated visible value. This can occur when the placeholder value is equal to the value entered by the user. In these instances, we should still dispatch input and change events. * html/shadow/DateTimeFieldElement.h: Added base class implementations of setEmptyValue and setValueAsInteger so that the logic to change the text color when a placeholder is visible can be shared. Changed visibleValue to no longer be a pure virtual method, as the implementations in derived classes were very similar, and can be abstracted. For this reason, the new placeholderValue pure virtual method was added. * html/shadow/DateTimeFieldElements.cpp: (WebCore::DateTimeDayFieldElement::DateTimeDayFieldElement): (WebCore::DateTimeHourFieldElement::DateTimeHourFieldElement): (WebCore::DateTimeMeridiemFieldElement::DateTimeMeridiemFieldElement): (WebCore::DateTimeMillisecondFieldElement::DateTimeMillisecondFieldElement): (WebCore::DateTimeMinuteFieldElement::DateTimeMinuteFieldElement): (WebCore::DateTimeMonthFieldElement::DateTimeMonthFieldElement): Months are 0-indexed, so we add 1 to the value returned by month(). (WebCore::DateTimeSecondFieldElement::DateTimeSecondFieldElement): (WebCore::DateTimeSymbolicMonthFieldElement::DateTimeSymbolicMonthFieldElement): (WebCore::DateTimeYearFieldElement::DateTimeYearFieldElement): * html/shadow/DateTimeNumericFieldElement.cpp: (WebCore::DateTimeNumericFieldElement::DateTimeNumericFieldElement): (WebCore::DateTimeNumericFieldElement::setEmptyValue): (WebCore::DateTimeNumericFieldElement::setValueAsInteger): (WebCore::DateTimeNumericFieldElement::placeholderValue const): (WebCore::DateTimeNumericFieldElement::valueAsInteger const): * html/shadow/DateTimeNumericFieldElement.h: * html/shadow/DateTimeSymbolicFieldElement.cpp: (WebCore::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement): (WebCore::DateTimeSymbolicFieldElement::setEmptyValue): (WebCore::DateTimeSymbolicFieldElement::setValueAsInteger): (WebCore::DateTimeSymbolicFieldElement::placeholderValue const): (WebCore::DateTimeSymbolicFieldElement::valueAsInteger const): * html/shadow/DateTimeSymbolicFieldElement.h: 2020-11-30 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Remove redundant const ContainerBox& formattingContextRoot from LineBuilder c'tor https://bugs.webkit.org/show_bug.cgi?id=219339 Reviewed by Antti Koivisto. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::LineBuilder): (WebCore::Layout::LineBuilder::root const): * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::root const): Deleted. 2020-11-30 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Preferred width computation is not constrained by existing floats https://bugs.webkit.org/show_bug.cgi?id=219338 Reviewed by Antti Koivisto. Let's create a fake(empty) floating state/context for the line as existing floats should not constrain the min/max content widths. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const): 2020-11-30 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add missing TableGrid::Row::m_baseline initialization https://bugs.webkit.org/show_bug.cgi?id=219336 Reviewed by Antti Koivisto. * layout/tableformatting/TableGrid.h: 2020-11-30 Andres Gonzalez <andresg_22@apple.com> AXIsolatedTree::m_axObjectCache should not be accessed on the secondary AX thread. https://bugs.webkit.org/show_bug.cgi?id=219223 Reviewed by Chris Fleizach. AXIsolatedTree::m_axObjectCache was being set on the main thread and also accessed on the AX thread in the nodeForID and applyPendingChanges methods. This problem is fixed with this change by adding the member variable m_usedOnAXThread that is initialized on the main thread and only used on the AX thread. This means also a performance optimization since nodeForID and applyPendingChanges are called very frequently. In addition, the change to AXIsolatedTree::create fixes a possible race condition between the time the newly created tree was added to the map of trees on the main thread, and the time that the tree is ready to be used on the AX thread. Now the newly created tree is not added to the trees map until it is fully functional. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::getOrCreateIsolatedTree const): (WebCore::AXObjectCache::generateIsolatedTree): Deleted, the creation and initialization of the isolated tree is now done in AXIsolatedTree::create. * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::pageID const): Getter for the m_pageID member variable. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::AXIsolatedObject): Now takes a pointer t the tree instead of a tree ID. (WebCore::AXIsolatedObject::create): Same as above. (WebCore::AXIsolatedObject::associatedAXObject const): (WebCore::AXIsolatedObject::setSelectedChildren): Check for nullity of the AXObjectCache. * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::AXIsolatedTree): Takes an AXObjectCache. (WebCore::AXIsolatedTree::clear): (WebCore::AXIsolatedTree::create): Takes an AXObjectCache. (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::applyPendingChanges): (WebCore::AXIsolatedTree::createTreeForPageID): Deleted, became AXIsolatedTree::create. * accessibility/isolatedtree/AXIsolatedTree.h: (WebCore::AXIsolatedTree::axObjectCache const): (WebCore::AXIsolatedTree::setAXObjectCache): Deleted, can be set only at construction time. 2020-11-30 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer] Media player does not properly inhibit, uninhibit sleep https://bugs.webkit.org/show_bug.cgi?id=186971 Reviewed by Philippe Normand. * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::updateStates): Call the player to update the playback state as it is done in the regular player. 2020-11-29 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Do not assume float avoiders have pre-computed vertical positions https://bugs.webkit.org/show_bug.cgi?id=219326 Reviewed by Antti Koivisto. Move the final vertical position computation from computeHeightAndMargin() (it does not really belong in there) to layoutInFlowContent(). This patch also ensures that we only adjust the vertical position when needed. Test: fast/layoutformattingcontext/block-only/child-containing-block-margin-collapse-when-float-avoiders.html * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): 2020-11-29 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Create runs for inline boxes https://bugs.webkit.org/show_bug.cgi?id=219329 Reviewed by Antti Koivisto. With this patch we start constructing runs for inline boxes (these are spec "inline boxes" and not legacy line layout "inline boxes"). * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::logicalMarginRectForInlineLevelBox const): * layout/inlineformatting/InlineLineBox.h: * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayInlineBoxes const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::showInlineTreeAndRuns): 2020-11-29 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Remove LineBuilder::availableWidth https://bugs.webkit.org/show_bug.cgi?id=219330 Reviewed by Antti Koivisto. There is no "global" available width while building the line. It may very well change as inline level boxes stretch the line and additional floats turn to intrusive. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::handleFloatOrInlineContent): (WebCore::Layout::LineBuilder::rebuildLineForTrailingSoftHyphen): * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::availableWidth const): Deleted. 2020-11-29 Zalan Bujtas <zalan@apple.com> [LFC][IFC] FloatingContext should take const FloatingState& https://bugs.webkit.org/show_bug.cgi?id=219331 Reviewed by Antti Koivisto. Let's not use FloatContext as a proxy for adding float items to the FloatingState. It enables us to use FloatingContext when we don't have mutable FloatingState e.g. while computing preferred width. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutInFlowContent): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::FloatingContext): (WebCore::Layout::FloatingContext::toFloatItem const): (WebCore::Layout::FloatingContext::append): Deleted. * layout/floats/FloatingContext.h: (WebCore::Layout::FloatingContext::floatingState const): (WebCore::Layout::FloatingContext::layoutState const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): 2020-11-28 Don Olmstead <don.olmstead@sony.com> Non-unified build fixes, late November 2020 edition, take three https://bugs.webkit.org/show_bug.cgi?id=219333 Unreviewed non-unified build fixes. * display/css/DisplayBoxFactory.cpp: * display/css/DisplayCSSPainter.cpp: * display/css/DisplayContainerBox.cpp: 2020-11-28 Simon Fraser <simon.fraser@apple.com> [LFC Display] Use a vector to maintain state during display tree building https://bugs.webkit.org/show_bug.cgi?id=219314 Reviewed by Zalan Bujtas. Over time more state will be required during tree building. Rather than using the stack and passing lots of arguments to tree building functions, use a Vector<> to push state when processing a ContainerBox's children, and pop afterwards. The vector is declared as a std::unique_ptr<> to hide the state types from the header. * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::TreeBuilder): (WebCore::Display::TreeBuilder::build): (WebCore::Display::TreeBuilder::pushStateForBoxDescendants): (WebCore::Display::TreeBuilder::popState): (WebCore::Display::TreeBuilder::currentState const): (WebCore::Display::TreeBuilder::positioningContext const): (WebCore::Display::TreeBuilder::buildInlineDisplayTree): (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree): (WebCore::Display::TreeBuilder::buildInlineDisplayTree const): Deleted. (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const): Deleted. * display/DisplayTreeBuilder.h: 2020-11-28 Simon Fraser <simon.fraser@apple.com> [LFC Display] Add basic transforms support. https://bugs.webkit.org/show_bug.cgi?id=219313 Reviewed by Zalan Bujtas. Add Display::BoxRareGeometry which will hold uncommon per-box geometry like border-radius and transformation matrix. At tree building time, compute a TransformationMatrix for the transforms on a box, using a pixel-snapped transform origin. Also store a bit on Display::Style to indicate that a transform applies (when set, we assume that BoxRareGeometry is non-null). At paint time, use the computed matrix to adjust the CTM when painting a stacking context, post-clipping and pre-effects. We adjust the box's matrix to move the applied origin to the origin of the border box, and to account for the fact that descendants will continue to paint in absolute coordinates. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * display/css/DisplayBoxFactory.cpp: (WebCore::Display::BoxFactory::computeTransformOrigin const): (WebCore::Display::BoxFactory::computeTransformationMatrix const): (WebCore::Display::BoxFactory::constructBoxRareGeometry const): (WebCore::Display::BoxFactory::setupBoxModelBox const): * display/css/DisplayBoxFactory.h: * display/css/DisplayBoxModelBox.cpp: (WebCore::Display::BoxModelBox::setBoxRareGeometry): (WebCore::Display::BoxModelBox::hasAncestorClip const): * display/css/DisplayBoxModelBox.h: (WebCore::Display::BoxModelBox::rareGeometry const): * display/css/DisplayBoxRareGeometry.cpp: Added. * display/css/DisplayBoxRareGeometry.h: Copied from Source/WebCore/display/css/DisplayBoxModelBox.h. (WebCore::Display::BoxRareGeometry::transform const): (WebCore::Display::BoxRareGeometry::setTransform): * display/css/DisplayCSSPainter.cpp: (WebCore::Display::applyAncestorClip): (WebCore::Display::applyEffects): (WebCore::Display::CSSPainter::paintAtomicallyPaintedBox): * display/css/DisplayStyle.cpp: (WebCore::Display::Style::Style): * display/css/DisplayStyle.h: (WebCore::Display::Style::hasTransform const): (WebCore::Display::Style::setHasTransform): 2020-11-28 Simon Fraser <simon.fraser@apple.com> [LFC Display] Add basic opacity support. https://bugs.webkit.org/show_bug.cgi?id=219312 Reviewed by Zalan Bujtas. Add a TransparencyLayerScope helper that can lazily begin, and end a transparency layer. Add display tree support for opacity via applyEffects(), which begins a transparency layer at the start of stacking context painting when alpha is < 1. * display/css/DisplayBoxDecorationPainter.cpp: (WebCore::Display::BorderPainter::paintTranslucentBorderSides const): * display/css/DisplayCSSPainter.cpp: (WebCore::Display::applyEffects): (WebCore::Display::CSSPainter::paintAtomicallyPaintedBox): * display/css/DisplayStyle.cpp: (WebCore::Display::Style::Style): * display/css/DisplayStyle.h: (WebCore::Display::Style::opacity const): * platform/graphics/GraphicsContext.h: (WebCore::TransparencyLayerScope::TransparencyLayerScope): (WebCore::TransparencyLayerScope::beginLayer): (WebCore::TransparencyLayerScope::~TransparencyLayerScope): 2020-11-28 Antti Koivisto <antti@apple.com> Move caret rect computation out of render tree https://bugs.webkit.org/show_bug.cgi?id=219304 Reviewed by Zalan Bujtas. Reduce code randomly sprinkled on renderers by moving it into standalone functions. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::localCaretRectForCharacterOffset): * editing/RenderedPosition.cpp: (WebCore::RenderedPosition::absoluteRect const): * editing/RenderedPosition.h: * editing/VisiblePosition.cpp: (WebCore::VisiblePosition::localCaretRect const): * rendering/CaretRectComputation.cpp: Added. (WebCore::computeCaretRectForEmptyElement): (WebCore::computeCaretRectForLinePosition): (WebCore::computeCaretRectForText): (WebCore::computeCaretRectForLineBreak): (WebCore::computeCaretRectForSVGInlineText): (WebCore::computeCaretRectForBox): (WebCore::computeCaretRectForBlock): (WebCore::computeCaretRectForInline): (WebCore::computeLocalCaretRect): * rendering/CaretRectComputation.h: Added. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::localCaretRect const): Deleted. * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::computeCaretRect const): Deleted. * rendering/RenderBlockFlow.h: * rendering/RenderBox.cpp: (WebCore::RenderBox::localCaretRect const): Deleted. * rendering/RenderBox.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::localCaretRectForEmptyElement const): Deleted. * rendering/RenderBoxModelObject.h: * rendering/RenderInline.cpp: (WebCore::RenderInline::localCaretRect const): Deleted. * rendering/RenderInline.h: * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::localCaretRect const): Deleted. * rendering/RenderLineBreak.h: * rendering/RenderObject.cpp: (WebCore::RenderObject::localCaretRect const): Deleted. * rendering/RenderObject.h: * rendering/RenderObjectEnums.h: * rendering/RenderText.cpp: (WebCore::RenderText::localCaretRect const): Deleted. * rendering/RenderText.h: * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::localCaretRect const): Deleted. * rendering/svg/RenderSVGInlineText.h: 2020-11-28 Don Olmstead <don.olmstead@sony.com> Remove enums for GCGLenum constants in GraphicsContextGL and ExtensionsGL https://bugs.webkit.org/show_bug.cgi?id=219319 Reviewed by Darin Adler. Both GraphicsContextGL and ExtensionsGL were using C style enums to scope GCGLenum values. Rather than using the enum static constexpr values of GCGLenum are used instead. This removes the need in WebGLDrawBuffers to static_cast the enums to GCGLenum which works around a narrowing error. No new tests. No change in behavior. * html/canvas/WebGLDrawBuffers.cpp: (WebCore::WebGLDrawBuffers::drawBuffersWEBGL): * platform/graphics/ExtensionsGL.h: * platform/graphics/GraphicsContextGL.h: 2020-11-28 Philippe Normand <pnormand@igalia.com> Unreviewed, GTK LTS build fix after r270195 * rendering/RenderInline.cpp: (WebCore::RenderInline::linesBoundingBox const): 2020-11-27 Simon Fraser <simon.fraser@apple.com> [LFC Display] Implement basic overflow:hidden clipping https://bugs.webkit.org/show_bug.cgi?id=219311 Reviewed by Zalan Bujtas. Add BoxClip which represents the clip generated by walking the containing block ancestor chain of a box. Display::BoxModelBox optionally has a BoxClip if it's a box that paints out of order (i.e. participates in z-order sorting, so positioned or stacking context). That BoxClip represents the clip contributed by ancestors, and it's applied before painting this box. If a Box has overflow clip, then that is also additionally applied before painting the in-flow descendants of the box. To compute BoxClip, ask the display box for the relevant containing block for its clip, which takes the clip from ancestors and appends the clip for that box (if any). Also move accessors for borderRoundedRect() and innerBorderRoundedRect() onto Display::BoxModelBox since they are needed for clipping as well as painting. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * display/css/DisplayBoxClip.cpp: Copied from Source/WebCore/display/css/DisplayBoxModelBox.cpp. (WebCore::Display::BoxClip::BoxClip): (WebCore::Display::BoxClip::copy const): (WebCore::Display::BoxClip::pushClip): (WebCore::Display::BoxClip::pushRoundedClip): * display/css/DisplayBoxClip.h: Copied from Source/WebCore/display/css/DisplayBoxModelBox.cpp. (WebCore::Display::BoxClip::create): (WebCore::Display::BoxClip::clipRect const): (WebCore::Display::BoxClip::affectedByBorderRadius const): (WebCore::Display::BoxClip::clipStack const): * display/css/DisplayBoxDecorationData.cpp: (WebCore::Display::roundedRectWithIncludedRadii): (WebCore::Display::roundedInsetBorderForRect): * display/css/DisplayBoxDecorationData.h: * display/css/DisplayBoxDecorationPainter.cpp: (WebCore::Display::BoxDecorationPainter::innerBorderRoundedRect const): (WebCore::Display::roundedRectWithIncludedRadii): Deleted. (WebCore::Display::roundedInsetBorderForRect): Deleted. * display/css/DisplayBoxFactory.cpp: (WebCore::Display::BoxFactory::setupBoxModelBox const): * display/css/DisplayBoxModelBox.cpp: (WebCore::Display::BoxModelBox::borderRoundedRect const): (WebCore::Display::BoxModelBox::innerBorderRoundedRect const): (WebCore::Display::BoxModelBox::setAncestorClip): (WebCore::Display::BoxModelBox::clipForDescendants const): (WebCore::Display::BoxModelBox::debugDescription const): * display/css/DisplayBoxModelBox.h: (WebCore::Display::BoxModelBox::ancestorClip const): * display/css/DisplayCSSPainter.cpp: (WebCore::Display::applyClipIfNecessary): (WebCore::Display::applyAncestorClip): (WebCore::Display::CSSPainter::recursivePaintDescendantsForPhase): (WebCore::Display::CSSPainter::paintAtomicallyPaintedBox): * display/css/DisplayContainerBox.cpp: (WebCore::Display::ContainerBox::debugDescription const): * display/css/DisplayStyle.cpp: (WebCore::Display::Style::Style): * display/css/DisplayStyle.h: (WebCore::Display::Style::hasClippedOverflow const): 2020-11-27 Simon Fraser <simon.fraser@apple.com> [LFC Display] Fix box locations for positioned elements https://bugs.webkit.org/show_bug.cgi?id=219310 Reviewed by Zalan Bujtas. The code assumed that layout boxes were always positioned relative to their parents, but border box geometry is actually relative to containing block. To keep track of this when building the display tree, add PositioningContext which tracks containing blocks for three types of positioning (fixed, absolute and in-flow), and root-relative offsets for each. The code then passes the appropriate containing block box + offset into the Display::BoxFactory code, which uses the offset to compute absolute box rects. * display/DisplayTreeBuilder.cpp: (WebCore::Display::PositioningContext::PositioningContext): (WebCore::Display::PositioningContext::m_absolutePositionContainer): (WebCore::Display::PositioningContext::m_inFlowContainer): (WebCore::Display::PositioningContext::contextForDescendants const): (WebCore::Display::PositioningContext::containingBlockContextForLayoutBox const): (WebCore::Display::PositioningContext::inFlowContainingBlockContext const): (WebCore::Display::TreeBuilder::build): (WebCore::Display::TreeBuilder::buildInlineDisplayTree const): (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const): * display/DisplayTreeBuilder.h: * display/css/DisplayBoxFactory.cpp: (WebCore::Display::BoxFactory::displayBoxForRootBox const): (WebCore::Display::BoxFactory::displayBoxForBodyBox const): (WebCore::Display::BoxFactory::displayBoxForLayoutBox const): (WebCore::Display::BoxFactory::displayBoxForTextRun const): (WebCore::Display::BoxFactory::setupBoxGeometry const): (WebCore::Display::BoxFactory::constructBoxDecorationData const): (WebCore::Display::BoxFactory::setupBoxModelBox const): * display/css/DisplayBoxFactory.h: * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::containingBlock const): * layout/layouttree/LayoutBox.h: (WebCore::Layout::Box::isContainingBlockForInFlow const): (WebCore::Layout::Box::isContainingBlockForFixedPosition const): (WebCore::Layout::Box::isContainingBlockForOutOfFlowPosition const): 2020-11-27 Aditya Keerthi <akeerthi@apple.com> [iOS][FCR] Add new look for meter element https://bugs.webkit.org/show_bug.cgi?id=219103 <rdar://problem/71549155> Reviewed by Wenson Hsieh. Tests: fast/forms/ios/form-control-refresh/meter/border.html fast/forms/ios/form-control-refresh/meter/even-less-good-appearance.html fast/forms/ios/form-control-refresh/meter/optimal-appearance.html fast/forms/ios/form-control-refresh/meter/suboptimal-appearance.html fast/forms/ios/form-control-refresh/meter/width-height.html * html/HTMLMeterElement.cpp: (WebCore::HTMLMeterElement::createElementRenderer): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::supportsMeter const): * rendering/RenderTheme.h: Added additional parameter to supportsMeter to control support at runtime. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::supportsMeter const): Implement this method so that a native meter is painted on iOS. Note that a native appearance for meter is currently supported on macOS, but is unsupported on iOS. (WebCore::RenderThemeIOS::paintMeter): Paint a meter element using the new appearance. The color of the filled portion matches the element's gauge region, and can be one of three colors. If the style has an RTL direction, flip the filled portion to start from the right side of the element. This matches the RTL behavior for progress bars. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::supportsMeter const): * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::supportsMeter const): * rendering/RenderThemeWin.h: 2020-11-27 Don Olmstead <don.olmstead@sony.com> Non-unified build fixes, late November 2020 edition, take two https://bugs.webkit.org/show_bug.cgi?id=219317 Unreviewed non-unified build fixes. * display/css/DisplayBox.cpp: * layout/integration/LayoutIntegrationLineLayout.cpp: * rendering/RenderBlockFlow.cpp: 2020-11-27 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo][Clang] html/canvas/WebGLDrawBuffers.cpp(77,29): error: non-constant-expression cannot be narrowed from type 'WebCore::GraphicsContextGL::(anonymous enum at GraphicsContextGL.h:64:5)' to 'GCGLenum' (aka 'unsigned int') in initializer list https://bugs.webkit.org/show_bug.cgi?id=219320 Unreviewed build fix for WinCairo clang-cl build. * html/canvas/WebGLDrawBuffers.cpp: (WebCore::WebGLDrawBuffers::drawBuffersWEBGL): Added static_cast<GCGLenum> for the initializer list. 2020-11-27 Wenson Hsieh <wenson_hsieh@apple.com> Introduce new display list meta commands in preparation for webkit.org/b/219091 https://bugs.webkit.org/show_bug.cgi?id=219262 Reviewed by Ryosuke Niwa. Introduces two new display list items: `MetaCommandChangeDestinationImageBuffer` and `MetaCommandEnd`. These meta commands will be used in a future patch to synchronize display list drawing commands between multiple destination image buffers when using the GPU process by allowing `RemoteRenderingBackend` to process display data that contains commands targeting more than one destination image buffer. `MetaCommandChangeDestinationImageBuffer` is used to inform the replayer that the destination image buffer (in which commands are replayed) should be changed to the new image buffer indicated by the rendering resource identifier in the item. When replaying, we'll bail with `StopReplayReason::ChangeDestinationImageBuffer` and set `nextDestinationImageBuffer` to the identifier of this next buffer. `MetaCommandEnd` is used to inform the replayer that it should expect no more display list items; in a future patch, `RemoteRenderingBackend` will take this as a cue to immediately stop waiting for more display list data and go to sleep. A stream of display list data will eventually consist of data targeting one or more destination image buffers, separated by `MetaCommandChangeDestinationImageBuffer` items, and may span one or more item buffers, separated by `MetaCommandChangeItemBuffer` items; finally, it will conclude with a `MetaCommandEnd` item. The below diagram depicts one such stream of display list data, where we have two destination image buffers (denoted by A and B), and display list item data spanning two item buffers (denoted by 1 and 2). Wakeup message initiates display list processing with Image Buffer A and Item Buffer 1 | | MetaCommandChangeItemBuffer(2) | | | MetaCommandChangeDestinationImageBuffer(B) | | | | | | | v v v +-----------------------+--------------------------------++ | +--------------------+ +------------------------------+ | | | Destination | | Destination | | Item Buffer 1 | | Image Buffer A | | Image Buffer B | | | +--------------------+ +------------------------------+ | +---------------------------------------------------------+ +---------------------------------------------------------+ | +--------------+ +-----------------------+ | | | Dst. Image | | Destination Image | Unused | Item Buffer 2 | | Buffer B | | Buffer A | Capacity | | +--------------+ +-----------------------+ | +-----------------+-------------------------+-------------+ ^ ^ | | | | | MetaCommandEnd | MetaCommandChangeDestinationImageBuffer(A) Additionally, rename `MetaCommandSwitchToItemBuffer` to `MetaCommandChangeItemBuffer`, such that it is consistent with the new `MetaCommandChangeDestinationImageBuffer` item. * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::append): * platform/graphics/displaylists/DisplayListItemBuffer.cpp: (WebCore::DisplayList::ItemHandle::apply): (WebCore::DisplayList::ItemHandle::destroy): (WebCore::DisplayList::ItemHandle::copyTo const): (WebCore::DisplayList::ItemBuffer::swapWritableBufferIfNeeded): * platform/graphics/displaylists/DisplayListItemType.cpp: (WebCore::DisplayList::sizeOfItemInBytes): (WebCore::DisplayList::isDrawingItem): (WebCore::DisplayList::isInlineItem): * platform/graphics/displaylists/DisplayListItemType.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::MetaCommandChangeItemBuffer::MetaCommandChangeItemBuffer): (WebCore::DisplayList::MetaCommandChangeDestinationImageBuffer::MetaCommandChangeDestinationImageBuffer): (WebCore::DisplayList::MetaCommandChangeDestinationImageBuffer::identifier const): (WebCore::DisplayList::MetaCommandSwitchToItemBuffer::MetaCommandSwitchToItemBuffer): Deleted. (WebCore::DisplayList::MetaCommandSwitchToItemBuffer::identifier const): Deleted. * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::Replayer::replay): * platform/graphics/displaylists/DisplayListReplayer.h: 2020-11-27 Simon Fraser <simon.fraser@apple.com> [LFC Display] Clean up CSS stacking context painting code https://bugs.webkit.org/show_bug.cgi?id=219307 Reviewed by Antti Koivisto. Clarify the code in Display::CSSPainter that paints stacking contexts and positioned elements. Non-stacking positioned elements paint atomically, but don't paint descendant stacking contexts (sometimes these are called "pseudo-stacking contexts" but that term is avoided here to reduce confusion). Share code between painting these and stacking contexts via paintAtomicallyPaintedBox(). Also make sure we paint the contents of non-container child boxes, so that things like positioned images paint. Remove some incorrect image painting code in BoxPainter::paintBox(). * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const): * display/css/DisplayBoxPainter.cpp: (WebCore::Display::BoxPainter::paintBox): * display/css/DisplayCSSPainter.cpp: (WebCore::Display::CSSPainter::recursivePaintDescendantsForPhase): (WebCore::Display::CSSPainter::recursivePaintDescendants): (WebCore::Display::CSSPainter::paintAtomicallyPaintedBox): (WebCore::Display::CSSPainter::paintStackingContext): (WebCore::Display::CSSPainter::participatesInZOrderSorting): (WebCore::Display::CSSPainter::collectStackingContextDescendants): (WebCore::Display::CSSPainter::recursiveCollectLayers): * display/css/DisplayCSSPainter.h: 2020-11-27 Simon Fraser <simon.fraser@apple.com> [LFC Display] A ContainerBox can establish an inline formatting context and have box children https://bugs.webkit.org/show_bug.cgi?id=218736 Reviewed by Zalan Bujtas. If a layout box establishes an inline formatting context, then the only descendant container boxes that we should make display boxes for while traversing non-inline descendants are those which are out of flow. * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const): 2020-11-27 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes, late November 2020 edition https://bugs.webkit.org/show_bug.cgi?id=219306 Unreviewed non-unified build fixes. * dom/SimpleRange.cpp: Add missing Frame.h header. * html/canvas/CanvasRenderingContext2D.cpp: Removed fontStyleIsWithinRange() from here, as it is not used in this source file. * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::isSpaceThatNeedsReplacing): Moved here from CanvasRenderingContext2D.cpp * inspector/InspectorNodeFinder.cpp: Add missing Frame.h header. * page/FrameTree.h: Added missing wtf/Forward.h header * style/StyleResolveForFontRaw.cpp: Add missing CSSToLengthConversionData.h, FontCascade.h, and Settings.h headers. * style/StyleResolveForFontRaw.h: Add forward declaration for FontCascadeDescription. 2020-11-27 Simon Fraser <simon.fraser@apple.com> [LFC Display] Add support for painting box shadows https://bugs.webkit.org/show_bug.cgi?id=219265 Reviewed by Zalan Bujtas. Clone the ShadowData linked list into Display::Style, fixing up the color, and add code to BoxDecorationPainter to paint outset and inset shadows. The pixel snapping isn't quite right yet; we really need to pixel-snap the rect that results from the border/padding box with shadow offset and spread applied, but that would require storing more shadow-related data at tree building time. The boxShadowShouldBeAppliedToBackground() code path isn't supported yet. * display/css/DisplayBoxDecorationPainter.cpp: (WebCore::Display::BoxDecorationPainter::BoxDecorationPainter): (WebCore::Display::BoxDecorationPainter::paintBoxShadow const): (WebCore::Display::BoxDecorationPainter::innerBorderRoundedRect const): (WebCore::Display::BoxDecorationPainter::backgroundRoundedRectAdjustedForBleedAvoidance const): (WebCore::Display::BoxDecorationPainter::paintBackgroundAndBorders const): * display/css/DisplayBoxDecorationPainter.h: * display/css/DisplayStyle.cpp: (WebCore::Display::deepCopy): (WebCore::Display::Style::Style): * display/css/DisplayStyle.h: (WebCore::Display::Style::boxShadow const): * platform/graphics/LayoutSize.h: (WebCore::roundSizeToDevicePixels): * rendering/style/ShadowData.h: (WebCore::ShadowData::setColor): (WebCore::ShadowData::setNext): 2020-11-27 Antti Koivisto <antti@apple.com> [LFC][Integration] Initial display:inline support https://bugs.webkit.org/show_bug.cgi?id=219301 Reviewed by Zalan Bujtas. <span> etc. Not enabled yet. * layout/integration/LayoutIntegrationBoxTree.cpp: (WebCore::LayoutIntegration::BoxTree::buildTree): (WebCore::LayoutIntegration::BoxTree::updateStyle): (WebCore::LayoutIntegration::BoxTree::layoutBoxForRenderer): (WebCore::LayoutIntegration::BoxTree::rendererForLayoutBox): * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForChild): (WebCore::LayoutIntegration::canUseForLineLayoutWithReason): * layout/integration/LayoutIntegrationInlineContent.h: (WebCore::LayoutIntegration::InlineContent::InlineBox::InlineBox): (WebCore::LayoutIntegration::InlineContent::InlineBox::layoutBox const): (WebCore::LayoutIntegration::InlineContent::InlineBox::lineIndex const): (WebCore::LayoutIntegration::InlineContent::InlineBox::rect const): (WebCore::LayoutIntegration::InlineContent::shrinkToFit): * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::build const): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayInlineBoxes const): * layout/integration/LayoutIntegrationInlineContentBuilder.h: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::containing): (WebCore::LayoutIntegration::LineLayout::enclosingBorderBoxRectFor const): (WebCore::LayoutIntegration::LineLayout::paint): * layout/integration/LayoutIntegrationLineLayout.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutModernLines): * rendering/RenderInline.cpp: (WebCore::RenderInline::styleDidChange): (WebCore::RenderInline::linesBoundingBox const): 2020-11-27 Víctor Manuel Jáquez Leal <vjaquez@igalia.com> REGRESSION(r269642) [GStreamer][WebRTC] Unexpected results after update to M87 https://bugs.webkit.org/show_bug.cgi?id=218787 Reviewed by Philippe Normand. Describe more specifically the H264 SDP. It uses a hardcoded list with the minimun requirement: ConstrainedBaseline and Baseline profiles which are supported by the video decoders used in GStreamer. No new tests required. * platform/GStreamer.cmake: * platform/mediastream/libwebrtc/GStreamerVideoCommon.cpp: Added. (WebCore::createH264Format): (WebCore::gstreamerSupportedH264Codecs): * platform/mediastream/libwebrtc/GStreamerVideoCommon.h: Added. * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: Removed unused headers. (WebCore::GStreamerVideoDecoder::AddDecoderIfSupported): Pass argument by reference. (WebCore::GStreamerVideoDecoder::ConfigureSupportedDecoder): Instead of a single SDP returns a vector of them. * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Removed unused headers. (WebCore::GStreamerVideoEncoder::AddCodecIfSupported): Pass argument by reference. (WebCore::GStreamerVideoEncoder::ConfigureSupportedCodec): Instead of a single SDP returns a vector of them and remove the unused argument. (WebCore::GStreamerVideoEncoderFactory::GetSupportedFormats const): * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: Fixed a typo. 2020-11-27 Philippe Normand <pnormand@igalia.com> Unreviewed, clang build fix after r270185 * platform/graphics/GraphicsTypesGL.h: Fixup nullptr_t namespace. (GCGLSpan::GCGLSpan): (std::numeric_limits<size_t>::max): 2020-11-27 Víctor Manuel Jáquez Leal <vjaquez@igalia.com> [GStreamer] refactor video encoder with WebKit style https://bugs.webkit.org/show_bug.cgi?id=218748 Reviewed by Philippe Normand. Apply WebKit code style to GStreamerVideoEncoder No new tests required since it's a refactor. * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp: (Encoders::singleton): Instead of an array with the available encoders, a singleton map is used, with better memory handling. (Encoders::registerEncoder): static method to register a possible encoder to handle (Encoders::definition): getter (webrtcVideoEncoderGetProperty): renamed (webrtcVideoEncoderSetBitrate): renamed (webrtcVideoEncoderSetFormat): Use getter for static pads; GRefPtr for memory handling; don't call gst_ghost_pad_set_target() inside a g_assert since it can be disabled. (webrtcVideoEncoderSetProperty): renamed (setupX264enc): renamed (setupOpenh264enc): renamed (setupOmxh264enc): renamed (setBitrateKbitPerSec): renamed (setBitrateBitPerSec): renamed (webrtc_video_encoder_class_init): renamed (webrtc_video_encoder_init): renamed * platform/mediastream/libwebrtc/GStreamerVideoEncoder.h: use G_DECLARE_FINAL_TYPE macro and change the name of the glib type to WEBRTC_TYPE_VIDEO_ENCODER * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: remove unused macro (WebCore::GStreamerVideoEncoderFactory::GStreamerVideoEncoderFactory): Don't register the element as primary, but none. 2020-11-27 Kimmo Kinnunen <kkinnunen@apple.com> GraphicsContextGL should have robust multivalue setters https://bugs.webkit.org/show_bug.cgi?id=219256 Reviewed by Dean Jackson. Replace bufSize, pointer pairs and plain pointers in GraphicsContextGL with GCGLSpan. This makes it easier to understand how many values there are pointed by the pointer. This is needed for simpler implementation of GPU process IPC, where the IPC layer does not need to interpret the OpenGL properties. In WebGL implementation, changes the validation functions to return the memory reference that will be touched by the valid function call. On validation failure, nullopt will be returned. Makes the existing GraphicsContextGL texture image manipulation functions to support robust invocation. Removes the robust APIs from ExtensionsGL. Adds the missing texture image manipulation functions from ExtensionGL to GraphicsContextGL. Implementations for the moved methods exist only for ANGLE implementation of GraphicsContextGLOpenGL. Changes the ANGLE variant of GraphicsContextGL::texImage2D to be implemented as ExtensionsGLANGLE::texImage2DRobustANGLE. Before, for ANGLE the GraphicsContextGL::texImage2D was unused. No new tests, a refactor. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::invalidateFramebuffer): (WebCore::WebGL2RenderingContext::invalidateSubFramebuffer): (WebCore::WebGL2RenderingContext::uniform1uiv): (WebCore::WebGL2RenderingContext::uniform2uiv): (WebCore::WebGL2RenderingContext::uniform3uiv): (WebCore::WebGL2RenderingContext::uniform4uiv): (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv): (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv): (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv): (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv): (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv): (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv): (WebCore::WebGL2RenderingContext::vertexAttribI4iv): (WebCore::WebGL2RenderingContext::vertexAttribI4uiv): (WebCore::WebGL2RenderingContext::drawBuffers): (WebCore::WebGL2RenderingContext::clearBufferiv): (WebCore::WebGL2RenderingContext::clearBufferuiv): (WebCore::WebGL2RenderingContext::clearBufferfv): (WebCore::WebGL2RenderingContext::validateClearBuffer): (WebCore::WebGL2RenderingContext::uniform1fv): (WebCore::WebGL2RenderingContext::uniform2fv): (WebCore::WebGL2RenderingContext::uniform3fv): (WebCore::WebGL2RenderingContext::uniform4fv): (WebCore::WebGL2RenderingContext::uniform1iv): (WebCore::WebGL2RenderingContext::uniform2iv): (WebCore::WebGL2RenderingContext::uniform3iv): (WebCore::WebGL2RenderingContext::uniform4iv): (WebCore::WebGL2RenderingContext::uniformMatrix2fv): (WebCore::WebGL2RenderingContext::uniformMatrix3fv): (WebCore::WebGL2RenderingContext::uniformMatrix4fv): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLDrawBuffers.cpp: (WebCore::WebGLDrawBuffers::drawBuffersWEBGL): * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::drawBuffersIfNecessary): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::bufferData): (WebCore::WebGLRenderingContextBase::bufferSubData): (WebCore::WebGLRenderingContextBase::uniform1fv): (WebCore::WebGLRenderingContextBase::uniform2fv): (WebCore::WebGLRenderingContextBase::uniform3fv): (WebCore::WebGLRenderingContextBase::uniform4fv): (WebCore::WebGLRenderingContextBase::uniform1iv): (WebCore::WebGLRenderingContextBase::uniform2iv): (WebCore::WebGLRenderingContextBase::uniform3iv): (WebCore::WebGLRenderingContextBase::uniform4iv): (WebCore::WebGLRenderingContextBase::uniformMatrix2fv): (WebCore::WebGLRenderingContextBase::uniformMatrix3fv): (WebCore::WebGLRenderingContextBase::uniformMatrix4fv): (WebCore::WebGLRenderingContextBase::validateUniformMatrixParameters): (WebCore::WebGLRenderingContextBase::vertexAttribfvImpl): * html/canvas/WebGLRenderingContextBase.h: (WebCore::WebGLRenderingContextBase::validateUniformParameters): * platform/graphics/ExtensionsGL.h: * platform/graphics/GraphicsContextGL.h: * platform/graphics/GraphicsTypesGL.h: (GCGLSpan::GCGLSpan): (std::numeric_limits<size_t>::max): (makeGCGLSpan): * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::drawBuffersEXT): * platform/graphics/angle/ExtensionsGLANGLE.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::bufferData): (WebCore::GraphicsContextGLOpenGL::bufferSubData): (WebCore::GraphicsContextGLOpenGL::uniform1fv): (WebCore::GraphicsContextGLOpenGL::uniform2fv): (WebCore::GraphicsContextGLOpenGL::uniform3fv): (WebCore::GraphicsContextGLOpenGL::uniform4fv): (WebCore::GraphicsContextGLOpenGL::uniform1iv): (WebCore::GraphicsContextGLOpenGL::uniform2iv): (WebCore::GraphicsContextGLOpenGL::uniform3iv): (WebCore::GraphicsContextGLOpenGL::uniform4iv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib1fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib2fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib3fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib4fv): (WebCore::GraphicsContextGLOpenGL::invalidateFramebuffer): (WebCore::GraphicsContextGLOpenGL::invalidateSubFramebuffer): (WebCore::GraphicsContextGLOpenGL::uniform1uiv): (WebCore::GraphicsContextGLOpenGL::uniform2uiv): (WebCore::GraphicsContextGLOpenGL::uniform3uiv): (WebCore::GraphicsContextGLOpenGL::uniform4uiv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2x3fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3x2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2x4fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4x2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3x4fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4x3fv): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4iv): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4uiv): (WebCore::GraphicsContextGLOpenGL::drawBuffers): (WebCore::GraphicsContextGLOpenGL::clearBufferiv): (WebCore::GraphicsContextGLOpenGL::clearBufferuiv): (WebCore::GraphicsContextGLOpenGL::clearBufferfv): * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp: (WebCore::GraphicsContextGLCVANGLE::initializeUVContextObjects): (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: 2020-11-27 Philippe Normand <pnormand@igalia.com> [GStreamer] AudioSourceProvider can potentially invoke an already-freed client https://bugs.webkit.org/show_bug.cgi?id=217952 Reviewed by Xabier Rodriguez-Calvar. * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: (WebCore::AudioSourceProviderGStreamer::deinterleavePadsConfigured): Check the provider has a client before setting up the audio format. 2020-11-26 Lauro Moura <lmoura@igalia.com> [GTK4] Build fix. Add cast when taking const data ownership https://bugs.webkit.org/show_bug.cgi?id=219267 Reviewed by Carlos Garcia Campos. r269614 introduced the NativeImage class, which returns a const platform image and uses an Observer scheme to release the data. * platform/graphics/gtk/ImageGtk.cpp: (WebCore::BitmapImage::gdkTexture): Keep using the direct approach and use a const_cast to release the data. 2020-11-26 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] Enable GPU process https://bugs.webkit.org/show_bug.cgi?id=219294 Reviewed by Don Olmstead. * platform/graphics/FontPlatformData.cpp: * platform/graphics/win/FontPlatformDataCairoWin.cpp: (WebCore::FontPlatformData::familyName const): Added. 2020-11-26 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com> AXObjectCache::focusedObjectForPage() is not defined when ENABLE(ACCESSIBILITY) is off https://bugs.webkit.org/show_bug.cgi?id=219290 Reviewed by Chris Fleizach. Define AXObjectCache::focusedObjectForPage() as a function which returns a nullptr. * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::focusedObjectForPage): Defined. 2020-11-26 Youenn Fablet <youenn@apple.com> https://collab-project.github.io/videojs-record/demo/video-only.html is not working https://bugs.webkit.org/show_bug.cgi?id=219258 <rdar://problem/69759808> Reviewed by Eric Carlson. Make 'HTMLMediaElement.srcObject = blob' functional by making sure to register a blob URL before trying to load. Clean-up internal slots when srcObject is set to make sure we do not load a MediaStream even if the current MediaProvider is a Blob. Fix a Use-After-Move bug that can be triggered in case of synchronous media loading failure. Test: http/wpt/mediarecorder/set-srcObject-MediaStream-Blob.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::~HTMLMediaElement): (WebCore::HTMLMediaElement::setSrcObject): (WebCore::HTMLMediaElement::loadResource): * html/HTMLMediaElement.h: * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: (WebCore::WebCoreAVFResourceLoader::startLoading): 2020-11-26 Michael Catanzaro <mcatanzaro@gnome.org> [WPE][GTK] Use Internet Explorer quirk for Google Docs https://bugs.webkit.org/show_bug.cgi?id=219278 Reviewed by Carlos Garcia Campos. Since r266584, we've suffered from an annoying unsupported browser warning when using Google Docs. We don't have many options to avoid it. I'm afraid that Firefox or Chrome quirks are too risky, since these seem to tempt Google into using web platform features that WebKit does not support. The safest quirk is the macOS platform quirk, but that doesn't work well here because it breaks various keyboard shortcuts like Ctrl+A and Ctrl+Z. So an Internet Explorer quirk is really the last card we have left. I think this is the safest Google quirk we've ever had, in that it's pretty unlikely that Google will try to send Internet Explorer anything that doesn't work in WebKit. However, it will break eventually, whenever Google decides that Internet Explorer is no longer supported. I guess that date is probably at least five years away, so we can only hope that Google drops this anticompetitive nonsense before then. P.S. Let's also switch Google Drive to this new quirk. The unsupported browser warning on Google Drive seems to be completely independent, but the IE quirk seems safer that the existing Firefox quirk, so why not? * platform/UserAgentQuirks.cpp: (WebCore::isGoogle): (WebCore::urlRequiresInternetExplorerBrowser): (WebCore::urlRequiresWindowsPlatform): (WebCore::urlRequiresLinuxDesktopPlatform): (WebCore::UserAgentQuirks::quirksForURL): (WebCore::UserAgentQuirks::stringForQuirk): * platform/UserAgentQuirks.h: * platform/glib/UserAgentGLib.cpp: (WebCore::buildUserAgentString): 2020-11-26 Darin Adler <darin@apple.com> Fix non-unified build problem in CSSPropertyParserHelpers.cpp along with a little refactoring https://bugs.webkit.org/show_bug.cgi?id=219222 Reviewed by Sam Weinig. * css/parser/CSSPropertyParser.cpp: (WebCore::fontStyleIsWithinRange): Deleted. (WebCore::consumeFontStyleRange): Updated for name change to isFontStyleAngleInRange, don't force angles to float since the values are stored as double. Use local variables to avoid multiple calls to doubleValue. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::isCSSWideKeyword): Moved inline function here from the header since it's only used inside this file. (WebCore::CSSPropertyParserHelpers::consumeFontStyleRaw): Updated for the name change of isFontStyleAngleInRange, and also eliminated local since it's clear without it. * css/parser/CSSPropertyParserHelpers.h: (WebCore::CSSPropertyParserHelpers::isCSSWideKeyword): Deleted. This had "static" on it in a header, which is not good style, but also didn't need to be in a header. (WebCore::CSSPropertyParserHelpers::isFontStyleAngleInRange): Moved this here so we can use it in two different .cpp files. Also renamed it for improved clarity, and used an inline function because this is super simple. 2020-11-22 Antti Koivisto <antti@apple.com> [LFC][Integration] Convert some remaining InlineBox access to use inline iterator https://bugs.webkit.org/show_bug.cgi?id=219244 Reviewed by Zalan Bujtas. * dom/Position.cpp: (WebCore::hasInlineRun): (WebCore::nextRenderedEditable): (WebCore::previousRenderedEditable): (WebCore::hasInlineBoxWrapper): Deleted. * rendering/RenderElement.cpp: (WebCore::RenderElement::getLeadingCorner const): * rendering/RenderText.cpp: (WebCore::RenderText::topOfFirstText const): Deleted. * rendering/RenderText.h: 2020-11-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Only process floats that fit the current line. https://bugs.webkit.org/show_bug.cgi?id=219239 Reviewed by Antti Koivisto. Now that we process floats as soft wrap opportunities, all the intrusive logic can be removed. Any float that we put on the line is considered intrusive and shrinks the available space. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineCandidate::InlineContent::operator() const): (WebCore::Layout::LineCandidate::reset): (WebCore::Layout::LineBuilder::placeInlineContent): (WebCore::Layout::LineBuilder::constraintsForLine): (WebCore::Layout::LineBuilder::candidateContentForLine): (WebCore::Layout::LineBuilder::handleFloatOrInlineContent): (WebCore::Layout::LineBuilder::rebuildLine): (WebCore::Layout::LineCandidate::InlineContent::continuousContent const): Deleted. (WebCore::Layout::LineCandidate::FloatContent::list const): Deleted. (WebCore::Layout::LineCandidate::FloatContent::intrusiveWidth const): Deleted. (WebCore::Layout::LineCandidate::FloatContent::append): Deleted. (WebCore::Layout::LineCandidate::FloatContent::reset): Deleted. (WebCore::Layout::LineBuilder::nextContentForLine): Deleted. (WebCore::Layout::LineBuilder::commitFloats): Deleted. (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): Deleted. * layout/inlineformatting/InlineLineBuilder.h: 2020-11-22 Rob Buis <rbuis@igalia.com> Fix getIndexedParameter indexing crash https://bugs.webkit.org/show_bug.cgi?id=218601 Reviewed by Ryosuke Niwa. Like in setBoundIndexedTransformFeedbackBuffer ASSERT, the index should always be smaller than size for indexing to be safe, so bail if the index is greater than or equal to size. * html/canvas/WebGLTransformFeedback.cpp: (WebCore::WebGLTransformFeedback::getBoundIndexedTransformFeedbackBuffer): 2020-11-21 Ada Chan <adachan@apple.com> Convert PlatformXRCocoa.cpp to Objective C++ https://bugs.webkit.org/show_bug.cgi?id=219242 Reviewed by Tim Horton. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/xr/cocoa/PlatformXRCocoa.mm: Renamed from Source/WebCore/platform/xr/cocoa/PlatformXRCocoa.cpp. 2020-11-21 Sihui Liu <sihui_liu@apple.com> Implement audio capture for SpeechRecognition on macOS https://bugs.webkit.org/show_bug.cgi?id=218855 <rdar://problem/71331001> Reviewed by Youenn Fablet. Introduce SpeechRecognizer, which performs audio capture and speech recogntion operations. On start, SpeechRecognizer creates a SpeechRecognitionCaptureSource and starts audio capturing. On stop, SpeechRecognizer clears the source and stops recognizing. SpeechRecognizer can only handle one request at a time, so calling start on already started SpeechRecognizer would cause ongoing request to be aborted. Tests: fast/speechrecognition/start-recognition-then-stop.html fast/speechrecognition/start-second-recognition.html * Headers.cmake: * Modules/speech/SpeechRecognitionCaptureSource.cpp: Added. (WebCore::SpeechRecognitionCaptureSource::SpeechRecognitionCaptureSource): * Modules/speech/SpeechRecognitionCaptureSource.h: Added. * Modules/speech/SpeechRecognitionCaptureSourceImpl.cpp: Added. SpeechRecognitionCaptureSourceImpl provides implementation of SpeechRecognitionCaptureSource on when ENABLE(MEDIA_STREAM) is true. (WebCore::nextLogIdentifier): (WebCore::nullLogger): (WebCore::SpeechRecognitionCaptureSourceImpl::SpeechRecognitionCaptureSourceImpl): (WebCore::SpeechRecognitionCaptureSourceImpl::~SpeechRecognitionCaptureSourceImpl): (WebCore::SpeechRecognitionCaptureSourceImpl::audioSamplesAvailable): Push data to buffer, signal main thread to pull from buffer and invoke data callback. (WebCore::SpeechRecognitionCaptureSourceImpl::sourceStarted): (WebCore::SpeechRecognitionCaptureSourceImpl::sourceStopped): (WebCore::SpeechRecognitionCaptureSourceImpl::sourceMutedChanged): * Modules/speech/SpeechRecognitionCaptureSourceImpl.h: Added. * Modules/speech/SpeechRecognizer.cpp: Added. (WebCore::SpeechRecognizer::SpeechRecognizer): (WebCore::SpeechRecognizer::reset): (WebCore::SpeechRecognizer::start): (WebCore::SpeechRecognizer::startInternal): (WebCore::SpeechRecognizer::stop): (WebCore::SpeechRecognizer::stopInternal): * Modules/speech/SpeechRecognizer.h: Added. (WebCore::SpeechRecognizer::currentClientIdentifier const): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/MediaUtilities.cpp: Added. (WebCore::createAudioFormatDescription): (WebCore::createAudioSampleBuffer): * platform/cocoa/MediaUtilities.h: Added. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Move code for creating CMSampleBufferRef to MediaUtilities.h/cpp so it can shared between SpeechRecognition and UserMedia, as Speech recognition backend will take CMSampleBufferRef as input. (WebCore::createAudioFormatDescription): Deleted. (WebCore::createAudioSampleBuffer): Deleted. 2020-11-21 Chris Dumez <cdumez@apple.com> Poor resampling quality when using AudioContext sampleRate parameter https://bugs.webkit.org/show_bug.cgi?id=219201 Reviewed by Geoff Garen. MultiChannelResampler uses a SincResampler per audio channel. In MultiChannelResampler::process(), it was calling SincResampler::process() for each channel, which would potentially end up calling MultiChannelResampler::ChannelProvider::provideInput() to provide channel data used for resampling. The issue was that MultiChannelResampler::ChannelProvider::provideInput() is implemented in such a way that things will break if provideInput() gets called more than once per channel. When using an AudioContext's sample rate larger than the hardware sample rate, provideInput() was getting called more than once per channel and this resulted in very poor resampling quality. To address the issue, MultiChannelResampler::process() now processes the data in chunks that are small enough to guarantee that MultiChannelResampler::ChannelProvider::provideInput() will never get called more than once per audio channel. The fix is based on the corresponding MultiChannelResampler / SincResampler implementation in Chrome: - https://github.com/chromium/chromium/blob/master/media/base/multi_channel_resampler.cc - https://github.com/chromium/chromium/blob/master/media/base/sinc_resampler.cc Tests: webaudio/audiocontext-large-samplerate.html webaudio/audiocontext-low-samplerate.html * platform/audio/MultiChannelResampler.cpp: (WebCore::MultiChannelResampler::ChannelProvider::setProvider): (WebCore::MultiChannelResampler::ChannelProvider::setCurrentChannel): (WebCore::MultiChannelResampler::process): * platform/audio/MultiChannelResampler.h: * platform/audio/SincResampler.cpp: (WebCore::calculateChunkSize): (WebCore::SincResampler::updateRegions): * platform/audio/SincResampler.h: 2020-11-21 Simon Fraser <simon.fraser@apple.com> Propagate the 'wheelEventGesturesBecomeNonBlocking' setting to the ScrollingTree https://bugs.webkit.org/show_bug.cgi?id=219241 Reviewed by Tim Horton. Propagate the 'wheelEventGesturesBecomeNonBlocking' setting to the ScrollingTree via the ScrollingStateFrameScrollingNode, as we do for other settings. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState): (WebCore::AsyncScrollingCoordinator::wheelEventGesturesBecomeNonBlocking const): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingStateFrameScrollingNode.cpp: (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode): (WebCore::ScrollingStateFrameScrollingNode::applicableProperties const): (WebCore::ScrollingStateFrameScrollingNode::setWheelEventGesturesBecomeNonBlocking): * page/scrolling/ScrollingStateFrameScrollingNode.h: * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::commitTreeState): (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled): Deleted. * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled): (WebCore::ScrollingTree::wheelEventGesturesBecomeNonBlocking const): (WebCore::ScrollingTree::setWheelEventGesturesBecomeNonBlocking): 2020-11-21 Chris Dumez <cdumez@apple.com> Unreviewed, reverting r270141. Caused assertions on bots Reverted changeset: "Poor resampling quality when using AudioContext sampleRate parameter" https://bugs.webkit.org/show_bug.cgi?id=219201 https://trac.webkit.org/changeset/270141 2020-11-21 Andres Gonzalez <andresg_22@apple.com> AccessibilityObject::FocusedUIElement should not call AXObjectCache::focusedUIElementForPage that can return an isolated object. https://bugs.webkit.org/show_bug.cgi?id=219238 Reviewed by Chris Fleizach. Since AXObjectCache::focusedUIElementForPage can return an isolated object, AccessibilityObject::focusedUIElement should not use it to determine the focused object. This causes that isolated objects may be accessed on the main thread when they shouldn't, and even infinite recursion if this happens when the isolated tree is being built. This patch changes AccessibilityObject::focusedUIElement to call AXObjectCache::focusedObjectForPage that always returns another AccessibilityObject. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::focusedObjectForPage): (WebCore::AXObjectCache::focusedUIElementForPage): (WebCore::AXObjectCache::generateIsolatedTree): (WebCore::AXObjectCache::focusedObject): Deleted. * accessibility/AXObjectCache.h: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::focusedUIElement const): 2020-11-21 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Move current logicalLeft from ContinuousContent to LineStatus https://bugs.webkit.org/show_bug.cgi?id=219237 Reviewed by Antti Koivisto. Retain the content logical right in the LineStatus instead (this is used to measure text properly (see xPos) while finding hyphen position). * layout/inlineformatting/InlineContentBreaker.cpp: (WebCore::Layout::InlineContentBreaker::processOverflowingTextContent const): (WebCore::Layout::InlineContentBreaker::ContinuousContent::reset): * layout/inlineformatting/InlineContentBreaker.h: (WebCore::Layout::InlineContentBreaker::ContinuousContent::logicalWidth const): (WebCore::Layout::InlineContentBreaker::ContinuousContent::logicalLeft const): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineCandidate::InlineContent::reset): (WebCore::Layout::LineCandidate::reset): (WebCore::Layout::LineBuilder::nextContentForLine): (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): 2020-11-21 Simon Fraser <simon.fraser@apple.com> Add an Experimental Features for wheel event gestures becoming non-blocking https://bugs.webkit.org/show_bug.cgi?id=219236 Reviewed by Sam Weinig. Add a feature flag for the behavior that is being added via webkit.org/b/218764, which is that only the first wheel event in a gesture is cancelable. * platform/cocoa/VersionChecks.h: 2020-11-21 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Treat floats as soft wrap opportunities https://bugs.webkit.org/show_bug.cgi?id=219235 Reviewed by Antti Koivisto. While floats are not part of the inline content and they are not supposed to introduce soft wrap opportunities, e.g. [text][float box][float box][text][float box][text] is essentially just [text][text][text] figuring out whether a float (or set of floats) should stay on the line or not (and handle potentially out of order inline items) brings in unnecessary complexity (and apparently Blink works like this too). * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::isAtSoftWrapOpportunity): (WebCore::Layout::LineBuilder::nextWrapOpportunity const): 2020-11-21 Antti Koivisto <antti@apple.com> [LFC][Integration] Remove ensureLineBoxes call from RenderedPosition constructor https://bugs.webkit.org/show_bug.cgi?id=219164 Reviewed by Zalan Bujtas. It is not needed anymore. We can use LFC line layout through the editing code. * dom/Position.cpp: (WebCore::Position::ensureLineBoxes const): Deleted. * dom/Position.h: * editing/RenderedPosition.cpp: (WebCore::RenderedPosition::RenderedPosition): * editing/RenderedPosition.h: (WebCore::RenderedPosition::rootBox): Deleted. 2020-11-21 Aditya Keerthi <akeerthi@apple.com> Space between minute and meridiem fields in time inputs is too large https://bugs.webkit.org/show_bug.cgi?id=219217 <rdar://problem/71637133> Reviewed by Devin Rousso. The space between minute and meridiem fields in time inputs appears two CSS pixels larger than a space character. This appearance is due to the presence of a 1px padding on field elements, which exists to prevent selected fields from appearing squished. To fix, apply a negative margin on each side of the element that has a space character. This pulls fields closer together and negates the effect of the field padding on the appearance of the space. * html/shadow/DateTimeEditElement.cpp: (WebCore::DateTimeEditBuilder::visitLiteral): 2020-11-21 Antti Koivisto <antti@apple.com> [LFC][Integration] Use inline iterator in collectSelectionRects https://bugs.webkit.org/show_bug.cgi?id=219233 Reviewed by Zalan Bujtas. Convert these iOS only functions. * layout/integration/LayoutIntegrationLineIterator.h: (WebCore::LayoutIntegration::PathLine::selectionHeight const): * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::PathRun::logicalTop const): (WebCore::LayoutIntegration::PathRun::logicalBottom const): * rendering/RenderImage.cpp: (WebCore::RenderImage::collectSelectionRects): * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::collectSelectionRects): * rendering/RenderText.cpp: (WebCore::RenderText::collectSelectionRects): 2020-11-21 Zalan Bujtas <zalan@apple.com> [LFC][Integration] LayoutIntegration::Line::rect is way too ambiguous https://bugs.webkit.org/show_bug.cgi?id=219230 Reviewed by Antti Koivisto. Line::rect() is actually the line box (see https://www.w3.org/TR/css-inline-3/#line-box). * layout/integration/LayoutIntegrationLine.h: (WebCore::LayoutIntegration::Line::lineBoxTop const): (WebCore::LayoutIntegration::Line::lineBoxBottom const): (WebCore::LayoutIntegration::Line::lineBoxLeft const): (WebCore::LayoutIntegration::Line::lineBoxRight const): (WebCore::LayoutIntegration::Line::rect const): Deleted. * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::LineIteratorModernPath::lineBoxTop const): (WebCore::LayoutIntegration::LineIteratorModernPath::lineBoxBottom const): (WebCore::LayoutIntegration::LineIteratorModernPath::contentLogicalLeft const): (WebCore::LayoutIntegration::LineIteratorModernPath::logicalHeight const): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::contentLogicalHeight const): (WebCore::LayoutIntegration::LineLayout::firstLineBaseline const): (WebCore::LayoutIntegration::LineLayout::lastLineBaseline const): (WebCore::LayoutIntegration::LineLayout::adjustForPagination): (WebCore::LayoutIntegration::LineLayout::paint): * layout/integration/LayoutIntegrationPagination.cpp: (WebCore::LayoutIntegration::updateMinimumPageHeight): (WebCore::LayoutIntegration::makeAdjustedContent): * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::createTextRun const): 2020-11-21 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Remove redundant lineBoxWidth from Line https://bugs.webkit.org/show_bug.cgi?id=219208 Reviewed by Antti Koivisto. Line::lineBoxWidth() is incorrectly returning the content logical width. By definition it is the available horizontal space for the content and therefore it equals to Line::rect().width(). 1. Replace lineLogicalRect with lineBoxLogicalRect. 2. Remove redundant lineBoxWidth() from Line. * display/css/DisplayBoxFactory.cpp: (WebCore::Display::BoxFactory::displayBoxForTextRun const): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedContentHeightAndMargin): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): (WebCore::Layout::InlineFormattingContext::Geometry::computedLineLogicalRect const): Deleted. * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::logicalRect const): (WebCore::Layout::LineBox::logicalTopLeft const): (WebCore::Layout::LineBox::logicalSize const): * layout/inlineformatting/InlineLineGeometry.h: (WebCore::Layout::InlineLineGeometry::lineBoxLogicalRect const): (WebCore::Layout::InlineLineGeometry::moveVertically): (WebCore::Layout::InlineLineGeometry::InlineLineGeometry): (WebCore::Layout::InlineLineGeometry::logicalRect const): Deleted. (WebCore::Layout::InlineLineGeometry::lineBoxLogicalSize const): Deleted. * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::lineOverflowWidth): (WebCore::LayoutIntegration::InlineContentBuilder::computeLineLevelVisualAdjustmentsForRuns const): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const): * layout/integration/LayoutIntegrationLine.h: (WebCore::LayoutIntegration::Line::Line): (WebCore::LayoutIntegration::Line::rect const): (WebCore::LayoutIntegration::Line::lineBoxWidth const): Deleted. * layout/integration/LayoutIntegrationPagination.cpp: (WebCore::LayoutIntegration::makeAdjustedContent): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::showInlineTreeAndRuns): 2020-11-21 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Remove InlineLineGeometry::logicalLeft/top/bottom/right/width/height helper functions https://bugs.webkit.org/show_bug.cgi?id=219226 Reviewed by Antti Koivisto. This is in preparation for having lineBoxLogicalRect() on InlineLineGeometry. It makes it absolutely clear of what type of logical rect we have here. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedContentHeightAndMargin): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): * layout/inlineformatting/InlineLineGeometry.h: (WebCore::Layout::InlineLineGeometry::logicalLeft const): Deleted. (WebCore::Layout::InlineLineGeometry::logicalRight const): Deleted. (WebCore::Layout::InlineLineGeometry::logicalTop const): Deleted. (WebCore::Layout::InlineLineGeometry::logicalBottom const): Deleted. (WebCore::Layout::InlineLineGeometry::logicalWidth const): Deleted. (WebCore::Layout::InlineLineGeometry::logicalHeight const): Deleted. * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::computeLineLevelVisualAdjustmentsForRuns const): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::showInlineTreeAndRuns): 2020-11-21 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Add contentLogicalOffset and contentLogicalWidth to InlineLineGeometry(Line) https://bugs.webkit.org/show_bug.cgi?id=219220 Reviewed by Antti Koivisto. This helps to match the legacy root inline box's geometry where line left + content offset == root inline box left edge line left + content offset + content width = root inline box right edge * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineLineGeometry.h: (WebCore::Layout::InlineLineGeometry::contentOffset const): (WebCore::Layout::InlineLineGeometry::contentWidth const): (WebCore::Layout::InlineLineGeometry::InlineLineGeometry): (WebCore::Layout::InlineLineGeometry::horizontalAlignmentOffset const): Deleted. * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const): * layout/integration/LayoutIntegrationLine.h: (WebCore::LayoutIntegration::Line::Line): (WebCore::LayoutIntegration::Line::contentOffset const): (WebCore::LayoutIntegration::Line::contentWidth const): (WebCore::LayoutIntegration::Line::horizontalAlignmentOffset const): Deleted. * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::LineIteratorModernPath::contentLogicalLeft const): (WebCore::LayoutIntegration::LineIteratorModernPath::contentLogicalRight const): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::paint): * layout/integration/LayoutIntegrationPagination.cpp: (WebCore::LayoutIntegration::makeAdjustedContent): * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::createTextRun const): 2020-11-21 Jiewen Tan <jiewen_tan@apple.com> [WebAuthn] Implement SPI for AuthenticationServices.Framework https://bugs.webkit.org/show_bug.cgi?id=218893 <rdar://problem/71364731> Reviewed by Alex Christensen. Covered by API tests. * Modules/webauthn/PublicKeyCredentialCreationOptions.h: * Modules/webauthn/PublicKeyCredentialRequestOptions.h: Tweaks some macros to expose an empty struct for ports that have WebAuthn disabled. 2020-11-20 Chris Dumez <cdumez@apple.com> Poor resampling quality when using AudioContext sampleRate parameter https://bugs.webkit.org/show_bug.cgi?id=219201 Reviewed by Geoff Garen. MultiChannelResampler uses a SincResampler per audio channel. In MultiChannelResampler::process(), it was calling SincResampler::process() for each channel, which would potentially end up calling MultiChannelResampler::ChannelProvider::provideInput() to provide channel data used for resampling. The issue was that MultiChannelResampler::ChannelProvider::provideInput() is implemented in such a way that things will break if provideInput() gets called more than once per channel. When using an AudioContext's sample rate larger than the hardware sample rate, provideInput() was getting called more than once per channel and this resulted in very poor resampling quality. To address the issue, MultiChannelResampler::process() now processes the data in chunks that are small enough to guarantee that MultiChannelResampler::ChannelProvider::provideInput() will never get called more than once per audio channel. The fix is based on the corresponding MultiChannelResampler / SincResampler implementation in Chrome: - https://github.com/chromium/chromium/blob/master/media/base/multi_channel_resampler.cc - https://github.com/chromium/chromium/blob/master/media/base/sinc_resampler.cc Tests: webaudio/audiocontext-large-samplerate.html webaudio/audiocontext-low-samplerate.html * platform/audio/MultiChannelResampler.cpp: (WebCore::MultiChannelResampler::ChannelProvider::setProvider): (WebCore::MultiChannelResampler::ChannelProvider::setCurrentChannel): (WebCore::MultiChannelResampler::process): * platform/audio/MultiChannelResampler.h: * platform/audio/SincResampler.cpp: (WebCore::calculateChunkSize): (WebCore::SincResampler::updateRegions): * platform/audio/SincResampler.h: 2020-11-20 Kate Cheney <katherine_cheney@apple.com> PCM: Persist pending ad clicks and attributions so they can survive browser restart https://bugs.webkit.org/show_bug.cgi?id=219134 <rdar://problem/70470129> Reviewed by John Wilander. This patch migrates PCM data to be stored on disk and updates naming of various PCM data to match naming agreed upon in standards bodies: - source -> sourceSite - campaign/campaignID -> sourceID - destination -> attributeOnSite - conversion/conversionValue -> attributionTriggerData - unconverted -> unattributed - convert(ed) -> attribute(d) Tests: http/tests/privateClickMeasurement/expired-ad-click-gets-removed-on-session-start.html http/tests/privateClickMeasurement/expired-attribution-report-gets-sent-on-session-start.html * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parsePrivateClickMeasurement const): * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::maxAge): (WebCore::PrivateClickMeasurement::isValid const): (WebCore::PrivateClickMeasurement::parseAttributionRequest): (WebCore::PrivateClickMeasurement::attributeAndGetEarliestTimeToSend): (WebCore::PrivateClickMeasurement::hasHigherPriorityThan const): (WebCore::PrivateClickMeasurement::reportURL const): (WebCore::PrivateClickMeasurement::json const): (WebCore::PrivateClickMeasurement::parseConversionRequest): Deleted. (WebCore::PrivateClickMeasurement::convertAndGetEarliestTimeToSend): Deleted. Renaming. (WebCore::PrivateClickMeasurement::markAsExpired): Deleted. (WebCore::PrivateClickMeasurement::hasExpired const): Deleted. (WebCore::PrivateClickMeasurement::markConversionAsSent): Deleted. (WebCore::PrivateClickMeasurement::wasConversionSent const): Deleted. We can remove the *Expired() functions as they were only indicators for the HashMap storage to know what attributions to delete. This is now handled by SQLite. Similarly, we can remove the markConversionAsSent and wasConversionSent functions because a sent attribution will not be stored in the database, so this value will always be false. (WebCore::PrivateClickMeasurement::toString const): Deleted. * loader/PrivateClickMeasurement.h: (WebCore::PrivateClickMeasurement::SourceID::SourceID): (WebCore::PrivateClickMeasurement::SourceSite::SourceSite): (WebCore::PrivateClickMeasurement::SourceSite::operator== const): (WebCore::PrivateClickMeasurement::SourceSite::deletedValue): (WebCore::PrivateClickMeasurement::SourceSite::constructDeletedValue): (WebCore::PrivateClickMeasurement::SourceSiteHash::hash): (WebCore::PrivateClickMeasurement::SourceSiteHash::equal): (WebCore::PrivateClickMeasurement::AttributeOnSite::AttributeOnSite): (WebCore::PrivateClickMeasurement::AttributeOnSite::operator== const): (WebCore::PrivateClickMeasurement::AttributeOnSite::deletedValue): (WebCore::PrivateClickMeasurement::AttributeOnSite::constructDeletedValue): (WebCore::PrivateClickMeasurement::AttributeOnSiteHash::hash): (WebCore::PrivateClickMeasurement::AttributeOnSiteHash::equal): (WebCore::PrivateClickMeasurement::AttributionTriggerData::AttributionTriggerData): Renaming. (WebCore::PrivateClickMeasurement::PrivateClickMeasurement): (WebCore::PrivateClickMeasurement::sourceSite const): (WebCore::PrivateClickMeasurement::attributeOnSite const): (WebCore::PrivateClickMeasurement::timeOfAdClick const): (WebCore::PrivateClickMeasurement::setEarliestTimeToSend): (WebCore::PrivateClickMeasurement::sourceID): (WebCore::PrivateClickMeasurement::attributionTriggerData): (WebCore::PrivateClickMeasurement::setAttribution): Now that we store data on disk, we need a more flexible constructor and more functions to rebuild PCM objects from the database. (WebCore::PrivateClickMeasurement::encode const): (WebCore::PrivateClickMeasurement::decode): (WebCore::PrivateClickMeasurement::AttributionTriggerData::encode const): (WebCore::PrivateClickMeasurement::AttributionTriggerData::decode): (WTF::HashTraits<WebCore::PrivateClickMeasurement::SourceSite>::emptyValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::SourceSite>::constructDeletedValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::SourceSite>::isDeletedValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::AttributeOnSite>::emptyValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::AttributeOnSite>::constructDeletedValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::AttributeOnSite>::isDeletedValue): (WebCore::PrivateClickMeasurement::Campaign::Campaign): Deleted. (WebCore::PrivateClickMeasurement::Campaign::isValid const): Deleted. (WebCore::PrivateClickMeasurement::Source::Source): Deleted. (WebCore::PrivateClickMeasurement::Source::operator== const): Deleted. (WebCore::PrivateClickMeasurement::Source::matches const): Deleted. (WebCore::PrivateClickMeasurement::Source::isHashTableDeletedValue const): Deleted. (WebCore::PrivateClickMeasurement::Source::deletedValue): Deleted. (WebCore::PrivateClickMeasurement::Source::constructDeletedValue): Deleted. (WebCore::PrivateClickMeasurement::Source::deleteValue): Deleted. (WebCore::PrivateClickMeasurement::Source::isDeletedValue const): Deleted. (WebCore::PrivateClickMeasurement::SourceHash::hash): Deleted. (WebCore::PrivateClickMeasurement::SourceHash::equal): Deleted. (WebCore::PrivateClickMeasurement::Destination::Destination): Deleted. (WebCore::PrivateClickMeasurement::Destination::operator== const): Deleted. (WebCore::PrivateClickMeasurement::Destination::matches const): Deleted. (WebCore::PrivateClickMeasurement::Destination::isHashTableDeletedValue const): Deleted. (WebCore::PrivateClickMeasurement::Destination::deletedValue): Deleted. (WebCore::PrivateClickMeasurement::Destination::constructDeletedValue): Deleted. (WebCore::PrivateClickMeasurement::Destination::deleteValue): Deleted. (WebCore::PrivateClickMeasurement::Destination::isDeletedValue const): Deleted. (WebCore::PrivateClickMeasurement::DestinationHash::hash): Deleted. (WebCore::PrivateClickMeasurement::DestinationHash::equal): Deleted. (WebCore::PrivateClickMeasurement::Conversion::Conversion): Deleted. (WebCore::PrivateClickMeasurement::Conversion::isValid const): Deleted. (WebCore::PrivateClickMeasurement::source const): Deleted. (WebCore::PrivateClickMeasurement::destination const): Deleted. Renaming. (WebCore::PrivateClickMeasurement::isEmpty const): Deleted. Not needed anymore, the database uses Optionals to indicate an empty result. (WebCore::PrivateClickMeasurement::Conversion::encode const): Deleted. (WebCore::PrivateClickMeasurement::Conversion::decode): Deleted. (WTF::HashTraits<WebCore::PrivateClickMeasurement::Source>::emptyValue): Deleted. (WTF::HashTraits<WebCore::PrivateClickMeasurement::Source>::constructDeletedValue): Deleted. (WTF::HashTraits<WebCore::PrivateClickMeasurement::Source>::isDeletedValue): Deleted. (WTF::HashTraits<WebCore::PrivateClickMeasurement::Destination>::emptyValue): Deleted. (WTF::HashTraits<WebCore::PrivateClickMeasurement::Destination>::constructDeletedValue): Deleted. (WTF::HashTraits<WebCore::PrivateClickMeasurement::Destination>::isDeletedValue): Deleted. Renaming. 2020-11-20 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Assign top/left to LineBox https://bugs.webkit.org/show_bug.cgi?id=219218 Reviewed by Antti Koivisto. It makes the LineBox class more aligned with the spec (https://www.w3.org/TR/css-inline-3/#line-box). * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::build): (WebCore::Layout::InlineFormattingContext::Geometry::computedLineLogicalRect const): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::LineBox): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::logicalWidth const): (WebCore::Layout::LineBox::logicalHeight const): (WebCore::Layout::LineBox::logicalTopLeft const): (WebCore::Layout::LineBox::logicalSize const): (WebCore::Layout::LineBox::setLogicalHeight): 2020-11-20 Simon Fraser <simon.fraser@apple.com> Dispatch main-thread overflow scrolls to the scrolling thread as we do for page scrolls https://bugs.webkit.org/show_bug.cgi?id=219213 Reviewed by Tim Horton. Unify the behavior of overflow scrolling and page scrolling for synchronous scrolls. Somewhat surprisingly, synchronous page scrolls move layers via a dispatch to the scrolling thread in FrameView::handleWheelEventForScrolling(), but overflow scrolls just did main thread compositing updates to set the new layer positions. A future patch will require that the "began" event for a synchronous scroll gets back to the scrolling thread, so unify these code paths to have overflow scrolls also leverage handleWheelEventAfterMainThread(), via RenderLayer::handleWheelEventForScrolling(). There's some fallout from this. ThreadedScrollingTree::handleWheelEventAfterMainThread() calls into handleWheelEventWithNode(), but in this special case that codepath needs to know that we're in a special "post main thread" mode that should 1. Behave as if the node is latched, i.e. don't propagate to parent nodes, and target the node if if it's scrolled to a the min or max to allow rubberbanding 2. Scroll even if the node has synchronous scrolling reasons This mode is represented by the EventTargeting value. Finally, EventHandler::handleWheelEventInternal() should only clear latching state if the content has called preventDefault() on the event. * page/EventHandler.cpp: (WebCore::EventHandler::handleWheelEventInternal): * page/scrolling/ScrollLatchingController.cpp: (WebCore::ScrollLatchingController::updateAndFetchLatchingStateForFrame): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::handleWheelEventWithNode): * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::canHandleWheelEvent const): (WebCore::ScrollingTreeScrollingNode::handleWheelEvent): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread): * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent): * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::handleWheelEventForScrolling): * rendering/RenderLayer.h: 2020-11-20 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Rename LineIteratorLegacy::logicalLeft/right to contentLeft/right https://bugs.webkit.org/show_bug.cgi?id=219215 Reviewed by Antti Koivisto. These functions are supposed to return the position where the content starts/ends inside the line box (see text-alignment as an example where the line's logical left edge is not where content starts). (WebCore::VisiblePosition::absoluteSelectionBoundsForLine const): * layout/integration/LayoutIntegrationLineIterator.h: (WebCore::LayoutIntegration::PathLine::selectionRect const): (WebCore::LayoutIntegration::PathLine::contentLogicalLeft const): (WebCore::LayoutIntegration::PathLine::contentLogicalRight const): (WebCore::LayoutIntegration::PathLine::logicalLeft const): Deleted. (WebCore::LayoutIntegration::PathLine::logicalRight const): Deleted. * layout/integration/LayoutIntegrationLineIteratorLegacyPath.h: (WebCore::LayoutIntegration::LineIteratorLegacyPath::contentLogicalLeft const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::contentLogicalRight const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalLeft const): Deleted. (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalRight const): Deleted. * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::LineIteratorModernPath::contentLogicalLeft const): (WebCore::LayoutIntegration::LineIteratorModernPath::contentLogicalRight const): (WebCore::LayoutIntegration::LineIteratorModernPath::logicalLeft const): Deleted. (WebCore::LayoutIntegration::LineIteratorModernPath::logicalRight const): Deleted. * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::localCaretRect const): (WebCore::RenderLineBreak::collectSelectionRects): 2020-11-20 Chris Dumez <cdumez@apple.com> AudioWorkletProcessor::process() may get called on non-audio worklet thread and crash https://bugs.webkit.org/show_bug.cgi?id=219209 Reviewed by Geoffrey Garen. If the AudioContext is already running when the AudioWorklet becomes ready, then the AudioWorkletNode::process() was getting called on the CoreAudio rendering thread instead of the AudioWorklet thread. This was causing us to run the AudioWorkletProcessor's JS on the wrong thread, which would cause flaky crashes in release and assertion hits in debug. To address the issue, I updated AudioWorkletNode::process() to output silence when it is called on another thread than the AudioWorklet thread. Also, if the AudioContext is already running when the AudioWorklet becomes ready, we need to restart the AudioDestination so that we switch the audio rendering from the CoreAudio rendering thread to the AudioWorklet thread. Test: http/wpt/webaudio/the-audio-api/the-audioworklet-interface/context-already-rendering.html * Modules/webaudio/AudioDestinationNode.h: (WebCore::AudioDestinationNode::restartRendering): * Modules/webaudio/AudioWorkletNode.cpp: (WebCore::AudioWorkletNode::isWorkletThread): (WebCore::AudioWorkletNode::process): * Modules/webaudio/AudioWorkletNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::addAudioParamDescriptors): (WebCore::BaseAudioContext::workletIsReady): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::uninitialize): (WebCore::DefaultAudioDestinationNode::startRendering): (WebCore::DefaultAudioDestinationNode::resume): (WebCore::DefaultAudioDestinationNode::suspend): (WebCore::DefaultAudioDestinationNode::restartRendering): (WebCore::DefaultAudioDestinationNode::setChannelCount): * Modules/webaudio/DefaultAudioDestinationNode.h: 2020-11-20 Lauro Moura <lmoura@igalia.com> canvas: drawImage should not raise IndexSizeError on empty sources https://bugs.webkit.org/show_bug.cgi?id=219068 Reviewed by Noam Rosenthal. Per 4.12.5.1.14 Drawing images[1] point 5, if the src rect has one of the dimensions zero, return silently. [1] https://html.spec.whatwg.org/multipage/canvas.html#drawing-images Covered by existing tests and fixes WPT offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource flakiness * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::drawImage): Return early instead of raising an exception if the rect is empty. 2020-11-20 Simon Fraser <simon.fraser@apple.com> Rename some wheel-event handling functions for clarity https://bugs.webkit.org/show_bug.cgi?id=219211 Reviewed by Tim Horton. There are too many functions called wheelEvent() or handleWheelEvent(), making it hard to know which phase of handling they apply to. So rename some to handleWheelEventForScrolling(), which applies to the "default handling" phase after DOM event dispatch. In addition, make ScrollableArea's handleWheelEventForScrolling() virtual and have FrameView override it (a future patch will also add an override in RenderLayer). Rename ScrollingCoordinator::performDefaultWheelEventHandling() to use handleWheelEventForScrolling() for clarity. * page/EventHandler.cpp: (WebCore::handleWheelEventInAppropriateEnclosingBox): (WebCore::EventHandler::processWheelEventForScrolling): (WebCore::EventHandler::defaultWheelEventHandler): * page/FrameView.cpp: (WebCore::FrameView::handleWheelEventForScrolling): (WebCore::FrameView::wheelEvent): Deleted. * page/FrameView.h: * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::determineWheelEventTarget): (WebCore::EventHandler::processWheelEventForScrolling): * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::handleWheelEventForScrolling): (WebCore::ScrollingCoordinator::performDefaultWheelEventHandling): Deleted. * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::scrollTo): * page/scrolling/mac/ScrollingCoordinatorMac.h: * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::handleWheelEventForScrolling): (WebCore::ScrollingCoordinatorMac::performDefaultWheelEventHandling): Deleted. * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: (WebCore::ScrollingCoordinatorNicosia::handleWheelEventForScrolling): (WebCore::ScrollingCoordinatorNicosia::performDefaultWheelEventHandling): Deleted. * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h: * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::handleWheelEventForScrolling): (WebCore::ScrollableArea::handleWheelEvent): Deleted. * platform/ScrollableArea.h: 2020-11-20 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Enable inline-block https://bugs.webkit.org/show_bug.cgi?id=218889 Reviewed by Antti Koivisto. * layout/integration/LayoutIntegrationCoverage.cpp: 2020-11-20 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r270064. Broke the macCatayst build Reverted changeset: "Link against the ANGLE Shared Library" https://bugs.webkit.org/show_bug.cgi?id=218539 https://trac.webkit.org/changeset/270064 2020-11-20 Don Olmstead <don.olmstead@sony.com> Remove quota module https://bugs.webkit.org/show_bug.cgi?id=219206 Reviewed by Anders Carlsson. Remove the files and any reference to the quota module. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/quota/DOMWindow+Quota.idl: Removed. * Modules/quota/DOMWindowQuota.cpp: Removed. * Modules/quota/DOMWindowQuota.h: Removed. * Modules/quota/Navigator+StorageQuota.idl: Removed. * Modules/quota/NavigatorStorageQuota.cpp: Removed. * Modules/quota/NavigatorStorageQuota.h: Removed. * Modules/quota/StorageErrorCallback.cpp: Removed. * Modules/quota/StorageErrorCallback.h: Removed. * Modules/quota/StorageErrorCallback.idl: Removed. * Modules/quota/StorageInfo.cpp: Removed. * Modules/quota/StorageInfo.h: Removed. * Modules/quota/StorageInfo.idl: Removed. * Modules/quota/StorageQuota.cpp: Removed. * Modules/quota/StorageQuota.h: Removed. * Modules/quota/StorageQuota.idl: Removed. * Modules/quota/StorageQuotaCallback.h: Removed. * Modules/quota/StorageQuotaCallback.idl: Removed. * Modules/quota/StorageUsageCallback.h: Removed. * Modules/quota/StorageUsageCallback.idl: Removed. * Modules/quota/WorkerNavigator+StorageQuota.idl: Removed. * Modules/quota/WorkerNavigatorStorageQuota.cpp: Removed. * Modules/quota/WorkerNavigatorStorageQuota.h: Removed. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-11-20 Antti Koivisto <antti@apple.com> [LFC][Integration] Hit test runs in reverse order https://bugs.webkit.org/show_bug.cgi?id=219205 Reviewed by Zalan Bujtas. In overlap case the latter boxes should be hit first. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::hitTest): 2020-11-20 Youenn Fablet <youenn@apple.com> Make webrtc/captureCanvas-webrtc-software-h264-*.html tests use codecs in WebProcess https://bugs.webkit.org/show_bug.cgi?id=219147 Reviewed by Eric Carlson. Expose internals setting to disable WebRTC codecs in GPU process. Covered by existing tests. * testing/InternalSettings.cpp: (WebCore::InternalSettings::setWebRTCPlatformCodecsInGPUProcessEnabled): * testing/InternalSettings.h: * testing/InternalSettings.idl: 2020-11-20 Sergio Villar Senin <svillar@igalia.com> [css-flex] Images as flex items should use the overridingLogicalWidth when defined to compute the logical height https://bugs.webkit.org/show_bug.cgi?id=219195 Reviewed by Manuel Rego Casasnovas. This is the same fix than the one we did in r270073 but for the other axis. RenderReplaced should use the overridingLogicalWidth whenever defined instead of the specified logical width to compute the logical height using an intrinsic aspect ratio. The overriding width is set by flex containers that need to stretch/shrink their items. The current code was not considering this case and thus, the intrinsic (non-stretched) logical height was used to compute the logical width, meaning that the stretching set by the flexbox container was ignored. This patch allows WebKit to pass 15 subtests in already existing aspect ratio flexbox tests from WPT. * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::computeReplacedLogicalHeight const): Use the overriding logical width if defined in presence of a valid aspect ratio. 2020-11-20 Don Olmstead <don.olmstead@sony.com> Use final in generated callback code https://bugs.webkit.org/show_bug.cgi?id=219169 Reviewed by Darin Adler. Generated callbacks descend from ContextDestructionObserver and are final. The scriptExecutionContext method is not virtual so adding override errors. Remove the virtual for that case and mark the destructor as final. Regenerated bindings through run-bindings-tests. * bindings/scripts/CodeGeneratorJS.pm: * bindings/scripts/test/JS/JSTestCallbackFunction.h: * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h: * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h: * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h: * bindings/scripts/test/JS/JSTestCallbackInterface.h: * bindings/scripts/test/JS/JSTestVoidCallbackFunction.h: 2020-11-20 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Move horizontal space tracking from Line to LineBuilder https://bugs.webkit.org/show_bug.cgi?id=219185 Reviewed by Antti Koivisto. Let's move the available horizontal space tracking from Line to LineBuilder. Since the LineBuilder decides what to put on the line the Line object does not need to know how much available space there is. This is also in preparation for adding float support on (vertically) stretchy lines where the horizontal available space may vary depending on how much the inline level boxes stretch the line vertically. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::initialize): (WebCore::Layout::Line::removeCollapsibleContent): (WebCore::Layout::Line::applyRunExpansion): (WebCore::Layout::Line::removeTrailingTrimmableContent): (WebCore::Layout::Line::visuallyCollapsePreWrapOverflowContent): (WebCore::Layout::Line::moveLogicalLeft): (WebCore::Layout::Line::moveLogicalRight): Deleted. * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::contentLogicalWidth const): (WebCore::Layout::Line::horizontalConstraint const): Deleted. (WebCore::Layout::Line::availableWidth const): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::layoutInlineContent): (WebCore::Layout::LineBuilder::initialize): (WebCore::Layout::LineBuilder::placeInlineContent): (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::commitFloats): (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): (WebCore::Layout::LineBuilder::rebuildLine): (WebCore::Layout::LineBuilder::rebuildLineForTrailingSoftHyphen): * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::availableWidth const): 2020-11-20 Antti Koivisto <antti@apple.com> [LFC][Integration] Take alignment offset into account when computing line iterator logicalLeft https://bugs.webkit.org/show_bug.cgi?id=219197 Reviewed by Zalan Bujtas. This fixes editing/style/text-indent.html with LFC editing enabled. * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::LineIteratorModernPath::logicalLeft const): 2020-11-20 Zalan Bujtas <zalan@apple.com> [LFC] BoxGeometry only tracks the reserved horizontal/vertical space for the scrollbars https://bugs.webkit.org/show_bug.cgi?id=219178 Reviewed by Antti Koivisto. BoxGeometry does not care whether it's a horizontal or vertical scrollbar. It only cares about the space we need to reserve for them. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions): * layout/layouttree/LayoutBoxGeometry.cpp: (WebCore::Layout::BoxGeometry::BoxGeometry): (WebCore::Layout::BoxGeometry::paddingBox const): * layout/layouttree/LayoutBoxGeometry.h: (WebCore::Layout::BoxGeometry::borderBoxHeight const): (WebCore::Layout::BoxGeometry::borderBoxWidth const): (WebCore::Layout::BoxGeometry::verticalSpaceForScrollbar const): (WebCore::Layout::BoxGeometry::horizontalSpaceForScrollbar const): (WebCore::Layout::BoxGeometry::setVerticalSpaceForScrollbar): (WebCore::Layout::BoxGeometry::setHorizontalSpaceForScrollbar): (WebCore::Layout::BoxGeometry::verticalScrollbarWidth const): Deleted. (WebCore::Layout::BoxGeometry::horizontalScrollbarHeight const): Deleted. (WebCore::Layout::BoxGeometry::setVerticalScrollbarWidth): Deleted. (WebCore::Layout::BoxGeometry::setHorizontalScrollbarHeight): Deleted. 2020-11-20 Alan Bujtas <zalan@apple.com> Unreviewed, reverting r270070. broke an API test Reverted changeset: "[LFC][Integration] Enable inline-block" https://bugs.webkit.org/show_bug.cgi?id=218889 https://trac.webkit.org/changeset/270070 2020-11-20 Youenn Fablet <youenn@apple.com> Add support for RTCRtpScriptTransform https://bugs.webkit.org/show_bug.cgi?id=219148 Reviewed by Eric Carlson. We introduce RTCRtpScriptTransform which processes encoded frames in a worker for either RTCRtpSender or RTCRtpReceiver. The model follows AudioWorkletNode in the sense that we create a RTCRtpScriptTransform object in main thread that is used with RTCRtp objects. The RTCRtpScriptTransform takes a name and a worker as parameters to create a RTCRtpScriptTransformer counter part in a worker. Before that, RTCRtpScriptTransformer constructors are registered in the worker with a specific name. A message port is shared between RTCRtpScriptTransform and RTCRtpScriptTransformer. RTCRtpScriptTransform keeps a weak pointer to RTCRtpScriptTransformer so that we keep all ref counting of RTCRtpScriptTransformer in the worker thread. To make sure RTCRtpScriptTransformer stays alive for long enough, we set a pending activity when RTCRtpScriptTransform is linked to its RTCRtpScriptTransformer. The pending activity is then removed either at worker closure or RTCRtpScriptTransform being no longer doing processing. We expose individual compressed frames as RTCEncodedAudioFrame and RTCEncodedVideoFrame. Accessor is limited to the raw data but additional getters should be added later on. To implement RTCRtpScriptTransformer, we have to be able to create WritableStream with native sinks. This is why we introduce WritableStreamSink and WritableStream C++ classes. Binding between native frames and streams is done through RTCRtpReadableStreamSource and RTCRtpWritableStreamSink. Test: http/wpt/webrtc/webrtc-transform.html and http/wpt/webrtc/sframe-transform.html. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/mediastream/RTCEncodedAudioFrame.cpp: Added. (WebCore::RTCEncodedAudioFrame::RTCEncodedAudioFrame): * Modules/mediastream/RTCEncodedAudioFrame.h: Added. (WebCore::RTCEncodedAudioFrame::create): * Modules/mediastream/RTCEncodedAudioFrame.idl: Added. * Modules/mediastream/RTCEncodedFrame.h: Added. * Modules/mediastream/RTCEncodedFrame.cpp: Added. * Modules/mediastream/RTCEncodedVideoFrame.cpp: Added. (WebCore::RTCEncodedVideoFrame::RTCEncodedVideoFrame): * Modules/mediastream/RTCEncodedVideoFrame.h: Added. (WebCore::RTCEncodedVideoFrame::create): * Modules/mediastream/RTCEncodedVideoFrame.idl: Added. * Modules/mediastream/RTCRtpReceiver+Transform.idl: * Modules/mediastream/RTCRtpReceiver.cpp: (WebCore::RTCRtpReceiver::setTransform): (WebCore::RTCRtpReceiver::transform): * Modules/mediastream/RTCRtpReceiver.h: * Modules/mediastream/RTCRtpReceiverWithTransform.h: (WebCore::RTCRtpReceiverWithTransform::transform): (WebCore::RTCRtpReceiverWithTransform::setTransform): * Modules/mediastream/RTCRtpSFrameTransform.cpp: (WebCore::RTCRtpSFrameTransform::initializeTransformer): * Modules/mediastream/RTCRtpSFrameTransform.h: (WebCore::RTCRtpSFrameTransform::isAttached const): * Modules/mediastream/RTCRtpSFrameTransform.idl: * Modules/mediastream/RTCRtpScriptTransform.cpp: Added. (WebCore::RTCRtpScriptTransform::create): (WebCore::RTCRtpScriptTransform::RTCRtpScriptTransform): (WebCore::RTCRtpScriptTransform::~RTCRtpScriptTransform): (WebCore::RTCRtpScriptTransform::setTransformer): (WebCore::RTCRtpScriptTransform::initializeBackendForReceiver): (WebCore::RTCRtpScriptTransform::initializeBackendForSender): (WebCore::RTCRtpScriptTransform::willClearBackend): (WebCore::RTCRtpScriptTransform::initializeTransformer): * Modules/mediastream/RTCRtpScriptTransform.h: Added. * Modules/mediastream/RTCRtpScriptTransform.idl: Added. * Modules/mediastream/RTCRtpScriptTransformProvider.idl: Added. * Modules/mediastream/RTCRtpScriptTransformer.cpp: Added. (WebCore::RTCRtpReadableStreamSource::create): (WebCore::RTCRtpReadableStreamSource::close): (WebCore::RTCRtpReadableStreamSource::enqueue): (WebCore::RTCRtpWritableStreamSink::create): (WebCore::RTCRtpWritableStreamSink::RTCRtpWritableStreamSink): (WebCore::RTCRtpWritableStreamSink::write): (WebCore::RTCRtpScriptTransformer::create): (WebCore::RTCRtpScriptTransformer::RTCRtpScriptTransformer): (WebCore::RTCRtpScriptTransformer::~RTCRtpScriptTransformer): (WebCore::RTCRtpScriptTransformer::start): (WebCore::RTCRtpScriptTransformer::clear): * Modules/mediastream/RTCRtpScriptTransformer.h: Added. (WebCore::RTCRtpScriptTransformer::setCallback): (WebCore::RTCRtpScriptTransformer::port): (WebCore::RTCRtpScriptTransformer::startPendingActivity): (WebCore::RTCRtpScriptTransformer::activeDOMObjectName const): (WebCore::RTCRtpScriptTransformer::stopPendingActivity): * Modules/mediastream/RTCRtpScriptTransformer.idl: Added. * Modules/mediastream/RTCRtpScriptTransformerConstructor.h: Added. * Modules/mediastream/RTCRtpScriptTransformerConstructor.idl: Added. * Modules/mediastream/RTCRtpSender+Transform.idl: * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::setTransform): (WebCore::RTCRtpSender::transform): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSenderWithTransform.h: (WebCore::RTCRtpSenderWithTransform::transform): (WebCore::RTCRtpSenderWithTransform::setTransform): * Modules/mediastream/RTCRtpTransform.cpp: (WebCore::RTCRtpTransform::from): (WebCore::RTCRtpTransform::RTCRtpTransform): (WebCore::RTCRtpTransform::~RTCRtpTransform): (WebCore::RTCRtpTransform::isAttached const): (WebCore::RTCRtpTransform::attachToReceiver): (WebCore::RTCRtpTransform::attachToSender): (WebCore::RTCRtpTransform::clearBackend): (WebCore::RTCRtpTransform::detachFromReceiver): (WebCore::RTCRtpTransform::detachFromSender): * Modules/mediastream/RTCRtpTransform.h: (WebCore::RTCRtpTransform::internalTransform): * Modules/mediastream/RTCRtpTransformBackend.h: * Modules/mediastream/RTCRtpTransformableFrame.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformBackend.cpp: (WebCore::LibWebRTCRtpTransformBackend::setInputCallback): (WebCore::LibWebRTCRtpTransformBackend::Transform): * Modules/streams/WritableStreamSink.h: Added. * Modules/streams/WritableStreamSink.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/ReadableStreamDefaultController.cpp: (WebCore::ReadableStreamDefaultController::enqueue): * bindings/js/ReadableStreamDefaultController.h: * bindings/js/WebCoreBuiltinNames.h: * bindings/js/WritableStream.cpp: Added. (WebCore::WritableStream::create): * bindings/js/WritableStream.h: Added. (WebCore::JSWritableStreamWrapperConverter::toWrapped): (WebCore::WritableStream::WritableStream): (WebCore::toJS): (WebCore::toJSNewlyCreated): * dom/EventTargetFactory.in: * testing/Internals.cpp: * testing/Internals.h: * testing/Internals.idl: * testing/MockRTCRtpTransform.cpp: (WebCore::MockRTCRtpTransformer::transform): * workers/DedicatedWorkerGlobalScope.cpp: (WebCore::DedicatedWorkerGlobalScope::registerRTCRtpScriptTransformer): (WebCore::DedicatedWorkerGlobalScope::createRTCRtpScriptTransformer): * workers/DedicatedWorkerGlobalScope.h: * workers/DedicatedWorkerGlobalScope.idl: * workers/Worker.cpp: (WebCore::Worker::addRTCRtpScriptTransformer): (WebCore::Worker::createRTCRtpScriptTransformer): (WebCore::Worker::postTaskToWorkerGlobalScope): * workers/Worker.h: * workers/WorkerGlobalScopeProxy.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::postTaskToWorkerObject): (WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope): (WebCore::WorkerMessagingProxy::postTaskToWorkerGlobalScope): * workers/WorkerMessagingProxy.h: * workers/WorkerObjectProxy.h: (WebCore::WorkerObjectProxy::postTaskToWorkerObject): 2020-11-20 Philippe Normand <pnormand@igalia.com> [MSE] Infinite loop in sample eviction when duration is NaN https://bugs.webkit.org/show_bug.cgi?id=218228 Reviewed by Darin Adler. Avoid infinite loop in evictCodedFrames for live streams When playing live streams the MediaSource DOM duration attribute has no meaning and would thus be set as +inf. When seeks are triggered to positions prior to the current playback position the SourceBuffer might attempt to free some space in order to keep the amount of memory used under control. It proceeds in 2 steps: 1. Attempt to free space represented by buffered range from media start up until current playback position - 30 seconds. 2. If step 1 didn't free enough memory, attempt to release memory represented by buffered ranges starting from current playback position + 30 seconds until media duration. Step 2 here wasn't taking into account the case where MediaSource.duration is actually invalid, and thus was entering an infinite loop. Test: media/media-source/live-rewind-seek-and-evict.html * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::evictCodedFrames): 2020-11-20 Fujii Hironori <Hironori.Fujii@sony.com> [TextureMapper] Hidden surface removal issue for nested transform-style:perserve-3d in Snow Stack demo https://bugs.webkit.org/show_bug.cgi?id=218969 Reviewed by Carlos Garcia Campos. r267711 enabled a depth buffer for a perserve-3d layer, but it didn't work nicely for nested perserve-3d, for example Snow Stack demo. It needs a intermediate surface to properly render interchangeably nested perserve-3d and non perserve-3d layers, for example transforms/3d/point-mapping/3d-point-mapping-deep.html. This change supports only simply nested perserve-3d layers such like Snow Stack demo. * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintSelfAndChildren): Added Preserves3DScope to call beginPreserves3D and endPreserves3D. 2020-11-20 Chris Lord <clord@igalia.com> Enable font functions on OffscreenCanvas for main-thread https://bugs.webkit.org/show_bug.cgi?id=219088 Reviewed by Simon Fraser. Move some font-related code from CanvasRenderingContext2D to CanvasRenderingContext2DBase so it can be shared by OffscreenCanvas and enable font functions on the OffscreenCanvas rendering context. Font setting only works when a Document is available, so this only enables drawing/measuring of text on the main thread. No new tests. Rebaselined existing tests. * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::measureText): (WebCore::CanvasRenderingContext2D::fontProxy const): (WebCore::CanvasRenderingContext2D::drawTextInternal): * html/canvas/CanvasRenderingContext2D.h: * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::font const): (WebCore::toCanvasTextAlign): (WebCore::fromCanvasTextAlign): (WebCore::CanvasRenderingContext2DBase::textAlign const): (WebCore::CanvasRenderingContext2DBase::setTextAlign): (WebCore::toCanvasTextBaseline): (WebCore::fromCanvasTextBaseline): (WebCore::CanvasRenderingContext2DBase::textBaseline const): (WebCore::CanvasRenderingContext2DBase::setTextBaseline): (WebCore::CanvasRenderingContext2DBase::setDirection): (WebCore::CanvasRenderingContext2DBase::canDrawTextWithParams): (WebCore::CanvasRenderingContext2DBase::normalizeSpaces): (WebCore::CanvasRenderingContext2DBase::drawText): (WebCore::CanvasRenderingContext2DBase::drawTextUnchecked): (WebCore::CanvasRenderingContext2DBase::measureTextInternal): (WebCore::CanvasRenderingContext2DBase::textOffset): * html/canvas/CanvasRenderingContext2DBase.h: (WebCore::CanvasRenderingContext2DBase::fontProxy): * html/canvas/OffscreenCanvasRenderingContext2D.cpp: (WebCore::OffscreenCanvasRenderingContext2D::setFont): (WebCore::OffscreenCanvasRenderingContext2D::direction const): (WebCore::OffscreenCanvasRenderingContext2D::fontProxy const): (WebCore::OffscreenCanvasRenderingContext2D::fillText): (WebCore::OffscreenCanvasRenderingContext2D::strokeText): (WebCore::OffscreenCanvasRenderingContext2D::measureText): * html/canvas/OffscreenCanvasRenderingContext2D.h: * html/canvas/OffscreenCanvasRenderingContext2D.idl: 2020-11-20 Youenn Fablet <youenn@apple.com> Add support for RTCPeerConnection.onicecandidateerror event https://bugs.webkit.org/show_bug.cgi?id=169644 Reviewed by Alex Christensen. Expose RTCPeerConnection.onicecandidateerror and use it for wrong STUN/TURN server URLs. For that matter, add RTCPeerConnectionIceErrorEvent as per spec with a slight change to the init directory to keep the same terminology between event and init dictionary. Covered by updated webrtc/stun-server-filtering.html test. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::iceServersFromConfiguration): (WebCore::iceServersFromConfiguration): Deleted. * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCPeerConnectionIceErrorEvent.cpp: Added. (WebCore::RTCPeerConnectionIceErrorEvent::create): (WebCore::RTCPeerConnectionIceErrorEvent::RTCPeerConnectionIceErrorEvent): (WebCore::RTCPeerConnectionIceErrorEvent::eventInterface const): * Modules/mediastream/RTCPeerConnectionIceErrorEvent.h: Added. * Modules/mediastream/RTCPeerConnectionIceErrorEvent.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/EventNames.h: * dom/EventNames.in: 2020-11-16 Sergio Villar Senin <svillar@igalia.com> [css-flex] Images as flex items should use the overridingLogicalHeight when defined to compute the logical width https://bugs.webkit.org/show_bug.cgi?id=218975 Reviewed by Manuel Rego Casasnovas. RenderReplaced should use the overridingLogicalHeight whenever defined instead of the specified logical height to compute the logical width using an intrinsic aspect ratio. The overriding height is set by flex containers that need to stretch/shrink their items. The current code was not considering this case and thus, the intrinsic (non-stretched) logical height was used to compute the logical width, meaning that the stretching set by the flexbox container was ignored. Note that it isn't enough to check that there is an overriding height, we must also check that the replaced element has an intrinsic size. Replaced elements with intrinsic ratios but without intrinsic sizes are handled in a separate code path (it's actually undefined behaviour). That's why it isn't enough to verify that the element has an aspect ratio, because most SVG graphics actually have defined intrinsic ratios but not intrinsic sizes. This allows us to pass an additional 19 subtests in 5 flexbox WPT tests. * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::computeReplacedLogicalWidth const): Use the overriding logical height if defined in presence of a valid aspect ratio. 2020-11-19 Fujii Hironori <Hironori.Fujii@sony.com> [TextureMapper] Remove m_textureMapper from TextureMapperLayer https://bugs.webkit.org/show_bug.cgi?id=219191 Reviewed by Carlos Garcia Campos. TextureMapperLayer had m_textureMapper to get the TextureMapper pointer. However, it was used only by the root layer. The child layers needed to traverse up to the root layer to get the TextureMapper pointer. It's more efficient to pass TextureMapper reference as an argument. No behavior changes. * platform/graphics/texmap/BitmapTexture.cpp: (WebCore::BitmapTexture::updateContents): * platform/graphics/texmap/BitmapTexture.h: * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayerTextureMapper::flushCompositingState): (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers): (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded): * platform/graphics/texmap/GraphicsLayerTextureMapper.h: * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paint): * platform/graphics/texmap/TextureMapperLayer.h: * platform/graphics/texmap/TextureMapperTile.cpp: (WebCore::TextureMapperTile::updateContents): 2020-11-19 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Enable inline-block https://bugs.webkit.org/show_bug.cgi?id=218889 Reviewed by Antti Koivisto. * layout/integration/LayoutIntegrationCoverage.cpp: 2020-11-19 Hoa Dinh <dvh@apple.com> Code formatting: change instances of "@synthesize a=b" to "@synthesize a = b". https://bugs.webkit.org/show_bug.cgi?id=219094 Reviewed by Wenson Hsieh. There was a mix of "@synthesize a=b" and "@synthesize a = b" in the codebase. Most of the instances are "@synthesize a = b", with spaces around the equal sign. With https://bugs.webkit.org/show_bug.cgi?id=219092, we're changing the behavior of the code style checker to require spaces around the equal sign. The change replace all the instances of "@synthesize a=b" with "@synthesize a = b". * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm: * platform/graphics/cocoa/WebGPULayer.mm: * platform/mac/VideoFullscreenInterfaceMac.mm: * platform/mac/WebPlaybackControlsManager.mm: * platform/network/cocoa/WebCoreNSURLSession.mm: 2020-11-19 Ada Chan <adachan@apple.com> Turn on ENABLE_WEBXR for Cocoa https://bugs.webkit.org/show_bug.cgi?id=219171 Reviewed by Tim Horton. * Modules/webxr/WebXRRigidTransform.h: * Modules/webxr/WebXRSystem.h: * Modules/webxr/WebXRView.h: * Modules/webxr/XREye.idl: * Modules/webxr/XRHandedness.idl: * Modules/webxr/XRReferenceSpaceType.idl: * Modules/webxr/XRSessionMode.idl: * Modules/webxr/XRTargetRayMode.idl: * Modules/webxr/XRVisibilityState.idl: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCallbackData.h: * dom/ActiveDOMCallback.h: * platform/xr/cocoa/PlatformXRCocoa.cpp: Copied from Source/WebCore/Modules/webxr/XRTargetRayMode.idl. * platform/xr/cocoa/PlatformXRCocoa.h: Copied from Source/WebCore/Modules/webxr/XREye.idl. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::Instance::Impl::queue const): (PlatformXR::Instance::Impl::checkInstanceExtensionProperties const): (PlatformXR::Instance::Impl::Impl): (PlatformXR::Instance::Impl::~Impl): (PlatformXR::Instance::enumerateImmersiveXRDevices): * platform/xr/openxr/PlatformXROpenXR.h: 2020-11-19 Aditya Keerthi <akeerthi@apple.com> [iOS][FCR] Add new look for progress bars https://bugs.webkit.org/show_bug.cgi?id=218864 <rdar://problem/71334958> Reviewed by Darin Adler and Wenson Hsieh. Tests: fast/forms/ios/form-control-refresh/progress/filled-appearance.html fast/forms/ios/form-control-refresh/progress/indeterminate-appearance.html fast/forms/ios/form-control-refresh/progress/rtl-appearance.html fast/forms/ios/form-control-refresh/progress/style-height.html fast/forms/ios/form-control-refresh/progress/style-width.html * platform/graphics/FloatRoundedRect.h: (WebCore::FloatRoundedRect::Radii::Radii): Added a new initializer to be used when all radii have the same value but the horizontal and vertical components of an individual radius are not equal. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::animationRepeatIntervalForProgressBar const): (WebCore::RenderTheme::animationDurationForProgressBar const): * rendering/RenderTheme.h: Updated methods to take const parameter. * rendering/RenderThemeAdwaita.cpp: (WebCore::RenderThemeAdwaita::animationRepeatIntervalForProgressBar const): (WebCore::RenderThemeAdwaita::animationDurationForProgressBar const): * rendering/RenderThemeAdwaita.h: * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintProgressBar): (WebCore::RenderThemeIOS::animationRepeatIntervalForProgressBar const): (WebCore::RenderThemeIOS::paintProgressBarFCR): Updated appearance of determinate progress bars to match UIKit. Added an animated indeterminate progress bar, by implementing the animationRepeatIntervalForProgressBar method in RenderThemeIOS. This matches RenderThemeMac. On macOS, the animation start time and the current time are forwarded to CoreUI for drawing. However, on iOS, we use this information to paint the animated progress bar ourselves. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: Renamed constant for accuracy. (WebCore::RenderThemeMac::animationRepeatIntervalForProgressBar const): 2020-11-19 Dean Jackson <dino@apple.com> Link against the ANGLE Shared Library https://bugs.webkit.org/show_bug.cgi?id=218539 <rdar://problem/69062211> Reviewed by Tim Horton. Weak link against libANGLE-shared.dylib. * Configurations/WebCore.xcconfig: * Configurations/WebCoreTestSupport.xcconfig: * Sources.txt: Stop compiling ANGLEWebKitBridge. * SourcesGTK.txt: * SourcesWPE.txt: * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::isANGLEAvailable): Add a helper to check if ANGLE loaded properly. (WebCore::GraphicsContextGLOpenGL::create): 2020-11-19 Geoffrey Garen <ggaren@apple.com> [Mac] LayoutTest fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events.html is a flaky timeout https://bugs.webkit.org/show_bug.cgi?id=175592 Reviewed by Eric Carlson. * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): * Modules/mediastream/CanvasCaptureMediaStreamTrack.h: Renamed m_canvasChangedTimer to m_captureCanvasTimer because the timer invokes captureCanvas() when it fires. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Removed m_pendingSelectedTrackCheck because track update is sync now. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): Invoke checkSelectedVideoTrack() and updateTracks() synchronously. Otherwise, we can miss the first frame rendered to our track. (Technically, there was no upper bound on the number of frames we might miss; but in practice, we tended to miss just the first one.) 2020-11-19 Chris Dumez <cdumez@apple.com> Crash under JSC::Heap::acquireAccessSlow() / JSC::Heap::releaseAccess() when starting an AudioWorklet https://bugs.webkit.org/show_bug.cgi?id=219183 <rdar://problem/71188544> Reviewed by Mark Lam. When audio rendering has already started when the AudioWorklet is constructed, it is possible for AudioWorkletGlobalScope::handlePreRenderTasks() to get called initially on the initial audio rendering thread instead of the audio worklet thread. Once the AudioWorklet is ready, the next rendering quantums will actually get processed on the audio worklet thread. However, there is a race when audio rendering has already started when the AudioWorklet gets created. This is not normally an issue. However, AudioWorkletGlobalScope::handlePreRenderTasks() grabs a JavaScript Lock and it is only safe to do so on the thread where we constructed the VM (i.e. the Audio Worklet thread). To address the issue, we now only grab the lock if we are on the audio worklet thread. Note that this lock is only used to delay the draining of the microtask queue until the end of the rendering quantum. Test: webaudio/worklet-crash.html * Modules/webaudio/AudioWorkletGlobalScope.cpp: (WebCore::AudioWorkletGlobalScope::handlePreRenderTasks): 2020-11-19 Wenson Hsieh <wenson_hsieh@apple.com> ASSERT NOT REACHED in WebCore::DisplayList::DrawImageBuffer::apply seen with TestWebKitAPI.DisplayListTests.ReplayWithMissingResource https://bugs.webkit.org/show_bug.cgi?id=219175 Reviewed by Tim Horton. We're currently hitting debug assertions when applying native image and image buffer display list items after r270002, due to the fact that `applyImageBufferItem` and `applyNativeImageItem` return `WTF::nullopt` in the case where the image resources are present, so we proceed by attempting to apply the item with only the graphics context. Fix this by checking the item type and always return early after calling either `applyImageBufferItem` or `applyNativeImageItem`. * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::applyImageBufferItem): (WebCore::DisplayList::applyNativeImageItem): (WebCore::DisplayList::Replayer::applyItem): 2020-11-19 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Do not stretch the border box with the scrollbars https://bugs.webkit.org/show_bug.cgi?id=219174 Reviewed by Antti Koivisto. Scrollbars are placed "between" the border and the padding box and they never stretch the border box. They may shrink the padding box though. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions): 2020-11-19 Chris Dumez <cdumez@apple.com> Regression(r267865) Geolocation API's error callback should be nullable https://bugs.webkit.org/show_bug.cgi?id=219165 Reviewed by Geoffrey Garen. Geolocation API's error callback should be nullable. The callback is nullable in both Firefox and Chrome and there is at least one WPT test that fails unless the error callback is nullable. The specification does not have this parameter as nullable. However, it is particularly risky to be the only engine matching the specification here, especially considering that we used to match other browser engines. No new tests, updated / rebaselined existing tests. * Modules/geolocation/Geolocation.idl: 2020-11-19 Chris Dumez <cdumez@apple.com> Unable to fetch an audio worklet module using a data URL https://bugs.webkit.org/show_bug.cgi?id=219166 Reviewed by Youenn Fablet. Allow fetching an audio worklet module using a data URL. No new tests, rebaselined existing test. * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::loadAsynchronously): 2020-11-19 Zalan Bujtas <zalan@apple.com> [Legacy Line Layout] Inline box's subpixel vertical top position should be enclosed https://bugs.webkit.org/show_bug.cgi?id=219142 Reviewed by Antti Koivisto. While the "logical top" here has floating point resolution, the "ascent" is integer type. The implicit integral flooring may produce a short line box and it makes the inline box "sticks out" of the containing block. * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::computeLogicalBoxHeights): 2020-11-19 Don Olmstead <don.olmstead@sony.com> Use final in generated wrapper owner code https://bugs.webkit.org/show_bug.cgi?id=219098 Reviewed by Yusuke Suzuki. Generated wrapper owner code descends from JSC::WeakHandleOwner which declares two virtual methods, isReachableFromOpaqueRoots and finalize. The generated code can descend from JSC::WeakHandleOwner directly or through JSNode. JSNode is generated by the script so those methods are marked with override. For all other cases a final class can be used and then those methods are maked accordingly. Regenerated bindings through run-bindings-tests. * bindings/scripts/CodeGeneratorJS.pm: * bindings/scripts/test/JS/JSExposedToWorkerAndWindow.h: * bindings/scripts/test/JS/JSTestCEReactions.h: * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h: * bindings/scripts/test/JS/JSTestCallTracer.h: * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h: * bindings/scripts/test/JS/JSTestConditionalIncludes.h: * bindings/scripts/test/JS/JSTestConditionallyReadWrite.h: * bindings/scripts/test/JS/JSTestDefaultToJSON.h: * bindings/scripts/test/JS/JSTestDefaultToJSONFilteredByExposed.h: * bindings/scripts/test/JS/JSTestDomainSecurity.h: * bindings/scripts/test/JS/JSTestEnabledBySetting.h: * bindings/scripts/test/JS/JSTestEnabledForContext.h: * bindings/scripts/test/JS/JSTestException.h: * bindings/scripts/test/JS/JSTestGenerateIsReachable.h: * bindings/scripts/test/JS/JSTestGlobalObject.h: * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestInterface.h: * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h: * bindings/scripts/test/JS/JSTestIterable.h: * bindings/scripts/test/JS/JSTestLegacyFactoryFunction.h: * bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.h: * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.h: * bindings/scripts/test/JS/JSTestMapLike.h: * bindings/scripts/test/JS/JSTestMapLikeWithOverriddenOperations.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h: * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyOverrideBuiltIns.h: * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.h: * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.h: * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestOperationConditional.h: * bindings/scripts/test/JS/JSTestOverloadedConstructors.h: * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h: * bindings/scripts/test/JS/JSTestPluginInterface.h: * bindings/scripts/test/JS/JSTestReadOnlyMapLike.h: * bindings/scripts/test/JS/JSTestReadOnlySetLike.h: * bindings/scripts/test/JS/JSTestReportExtraMemoryCost.h: * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: * bindings/scripts/test/JS/JSTestSetLike.h: * bindings/scripts/test/JS/JSTestSetLikeWithOverriddenOperations.h: * bindings/scripts/test/JS/JSTestStringifier.h: * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h: * bindings/scripts/test/JS/JSTestStringifierNamedOperation.h: * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h: * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h: * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h: * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h: * bindings/scripts/test/JS/JSTestTypedefs.h: 2020-11-19 Andres Gonzalez <andresg_22@apple.com> Fix for crash in Accessibility::performFunctionOnMainThread. https://bugs.webkit.org/show_bug.cgi?id=219168 Reviewed by Chris Fleizach. AXIsolatedObject::performFunctionOnMainThread captures the this pointer to be accessed on the main thread. But since the same object can be accessed concurrently on the AX thread, Accessibility::performFunctionOnMainThread must be blocking even though the caller doesn't expect a return value. * accessibility/AccessibilityObjectInterface.h: (WebCore::Accessibility::performFunctionOnMainThread): 2020-11-19 Fujii Hironori <Hironori.Fujii@sony.com> [TextureMapperGL] The invert filter wrongly inverts pre-multiplied alpha color https://bugs.webkit.org/show_bug.cgi?id=219144 Reviewed by Carlos Garcia Campos. Test: compositing/filters/invert-transparent.html * platform/graphics/texmap/TextureMapperShaderProgram.cpp: Take alpha value as an argument. 2020-11-19 Lauro Moura <lmoura@igalia.com> [GStreamer] Fix OptionSet initialization after r270019 Unreviewed. The OptionSet constructor was asserting when used directly with ElementFactories::Type::All. Based on original patch by Philippe Normand. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::GStreamerRegistryScanner): 2020-11-19 Chris Dumez <cdumez@apple.com> Worklet.addModule() should reject promise with an AbortError when the network load fails https://bugs.webkit.org/show_bug.cgi?id=219135 Reviewed by Geoffrey Garen. Worklet.addModule() should reject promise with an AbortError when the network load fails: - https://html.spec.whatwg.org/multipage/worklets.html#dom-worklet-addmodule This also aligns our behavior with Blink. No new tests, rebaselined existing tests. * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::notifyFinished): 2020-11-19 Antti Koivisto <antti@apple.com> [LFC][Integration] Use inline iterator in CompositeEditCommand::deleteInsignificantText https://bugs.webkit.org/show_bug.cgi?id=219155 Reviewed by Zalan Bujtas. Reduce direct InlineBox access. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::deleteInsignificantText): 2020-11-19 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Disable non-text content with floats https://bugs.webkit.org/show_bug.cgi?id=219122 Reviewed by Antti Koivisto. Non-text content may stretch the line and we don't yet have support for dynamic float avoiding (as the line grows). * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForLineLayoutWithReason): 2020-11-19 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Allow subpixel difference in the computed containing block height when switching between line layout systems https://bugs.webkit.org/show_bug.cgi?id=219143 Reviewed by Antti Koivisto. With all the seemingly random flooring, ceiling and rounding in the legacy line layout codebase, it's really difficult to subpixel match the end result in a sane way in IFC as we start supporting more complex content. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::ensureLineBoxes): 2020-11-19 Antti Koivisto <antti@apple.com> [LFC][Integration] nextLinePosition should use iterator https://bugs.webkit.org/show_bug.cgi?id=219152 Reviewed by Zalan Bujtas. The last major piece of direct InlineBox access in editing code. * dom/Position.cpp: (WebCore::InlineBoxAndOffset::InlineBoxAndOffset): Deleted. (WebCore::Position::inlineBoxAndOffset const): Deleted. No longer needed. * dom/Position.h: * editing/VisibleUnits.cpp: (WebCore::previousLineCandidatePosition): (WebCore::nextLineCandidatePosition): (WebCore::isTextOrLineBreakRun): (WebCore::previousTextOrLineBreakRun): (WebCore::nextTextOrLineBreakRun): (WebCore::startTextOrLineBreakRun): (WebCore::endTextOrLineBreakRun): (WebCore::logicallyPreviousRun): (WebCore::logicallyNextRun): (WebCore::wordBreakIteratorForMinOffsetBoundary): (WebCore::wordBreakIteratorForMaxOffsetBoundary): (WebCore::visualWordPosition): (WebCore::previousLinePosition): (WebCore::nextLinePosition): (WebCore::previousRootInlineBoxCandidatePosition): Deleted. (WebCore::nextRootInlineBoxCandidatePosition): Deleted. (WebCore::CachedLogicallyOrderedLeafBoxes::size const): Deleted. (WebCore::CachedLogicallyOrderedLeafBoxes::firstBox const): Deleted. (WebCore::CachedLogicallyOrderedLeafBoxes::CachedLogicallyOrderedLeafBoxes): Deleted. (WebCore::CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox): Deleted. (WebCore::CachedLogicallyOrderedLeafBoxes::nextTextOrLineBreakBox): Deleted. (WebCore::CachedLogicallyOrderedLeafBoxes::boxIndexInLeaves const): Deleted. The iterarator handles logical order caching for InlineBoxes, no need for a separate cache. (WebCore::logicallyPreviousBox): Deleted. (WebCore::logicallyNextBox): Deleted. 2020-11-19 Carlos Garcia Campos <cgarcia@igalia.com> REGRESSION(r267995): [GTK][WPE] media controls and form fields icons are no longer rendered https://bugs.webkit.org/show_bug.cgi?id=219156 Reviewed by Adrian Perez de Castro. Since r267995 we are now handling fragments in data URLs, which means we can't use '#' in the svg contents, we need to use %23 instead. * Modules/mediacontrols/mediaControlsAdwaita.css: (audio::-webkit-media-controls-mute-button,): (audio::-webkit-media-controls-mute-button.muted,): (audio::-webkit-media-controls-play-button,): (audio::-webkit-media-controls-play-button.paused,): (audio::-webkit-media-controls-toggle-closed-captions-button,): (video::-webkit-media-controls-fullscreen-button): (video::-webkit-media-controls-fullscreen-button.exit): * css/themeAdwaita.css: (input[type="search"]::-webkit-search-results-button,): (input[type="search"]::-webkit-search-cancel-button): (body[dir="rtl"] input[type="search"]::-webkit-search-cancel-button): 2020-11-19 Martin Robinson <mrobinson@webkit.org> Make scroll-padding independent of scroll-snap and have it affect scrollIntoView https://bugs.webkit.org/show_bug.cgi?id=219073 Reviewed by Simon Fraser. The scroll-padding CSS property is now available even when scroll-snap is not enabled at compile-time. Also make scroll-snap affect positioning during scrollIntoView operations. * Sources.txt: Remove ScrollSnapPoints.cpp, because it is no longer necessary. * WebCore.xcodeproj/project.pbxproj: Ditto. * css/CSSComputedStyleDeclaration.cpp: Enable scroll-padding and scroll-padding-* unconditionally. (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): Ditto. * css/CSSProperties.json: Ditto. * css/StyleProperties.cpp: Ditto. (WebCore::StyleProperties::getPropertyValue const): Ditto. (WebCore::StyleProperties::asText const): Ditto. * css/parser/CSSPropertyParser.cpp: Ditto. (WebCore::CSSPropertyParser::parseSingleValue): Ditto. (WebCore::CSSPropertyParser::parseShorthand): Ditto. * rendering/RenderLayer.cpp: Ditto. (WebCore::expandScrollRectToVisibleTargetRectToIncludeScrollPadding): Added this helper function which expands the target rectangle to include scroll padding from the container. This creates the affect that the container has a padding rectangle. (WebCore::RenderLayer::scrollRectToVisible): Now expand target rectangle to include scroll container padding. Also put some code into a lambda to simplify things. * rendering/RenderLayerModelObject.cpp: Ditto. (WebCore::scrollSnapContainerRequiresUpdateForStyleUpdate): Ditto. * rendering/style/RenderStyle.cpp: Ditto. (WebCore::RenderStyle::scrollPadding const): Ditto. (WebCore::RenderStyle::setScrollPaddingTop): Ditto. (WebCore::RenderStyle::setScrollPaddingBottom): Ditto. (WebCore::RenderStyle::setScrollPaddingLeft): Ditto. (WebCore::RenderStyle::setScrollPaddingRight): Ditto. (WebCore::RenderStyle::initialScrollSnapType): Ditto. (WebCore::RenderStyle::initialScrollSnapAlign): Ditto. (WebCore::RenderStyle::scrollSnapType const): Ditto. (WebCore::RenderStyle::scrollSnapAlign const): Ditto. (WebCore::RenderStyle::setScrollSnapType): Ditto. * rendering/style/RenderStyle.h: Ditto. (WebCore::RenderStyle::initialScrollPadding): Ditto. * rendering/style/StyleRareNonInheritedData.cpp: Have scroll-padding related properties be stored directly on StyleRareNonInheritedData. (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: Ditto. * rendering/style/StyleScrollSnapPoints.cpp: Removed. * rendering/style/StyleScrollSnapPoints.h: 2020-11-19 Carlos Garcia Campos <cgarcia@igalia.com> [GStreamer] GStreamerRegistryScanner cleanups and improvements https://bugs.webkit.org/show_bug.cgi?id=219078 Reviewed by Philippe Normand. We are creating the factories and keeping them alive forever, because GStreamerRegistryScanner is singleton. We can just delete them after the initialization and then create the factories we need on demand when checking AV1 codecs. This patch includes some other minor fixes and cleanups (missing const, avoid using blackList, etc.) * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::ElementFactories::ElementFactories): Create the factories for the given types. (WebCore::GStreamerRegistryScanner::ElementFactories::~ElementFactories): Destroy the factories. (WebCore::GStreamerRegistryScanner::ElementFactories::elementFactoryTypeToString): Return a string for the given factory type, used for logging. (WebCore::GStreamerRegistryScanner::ElementFactories::factory const): Return the factory for the given type. (WebCore::GStreamerRegistryScanner::ElementFactories::hasElementForMediaType const): Moved here now receiving a factory type instead of the factory itself. (WebCore::GStreamerRegistryScanner::GStreamerRegistryScanner): Create a ElementFactories for all the types and pass it to the initializers. (WebCore::GStreamerRegistryScanner::mimeTypeSet const): Use release assert and remove the return. (WebCore::GStreamerRegistryScanner::isContainerTypeSupported const): Ditto. (WebCore::GStreamerRegistryScanner::fillMimeTypeSetFromCapsMapping): It receives a ElementFactories now. (WebCore::GStreamerRegistryScanner::initializeDecoders): Ditto. (WebCore::GStreamerRegistryScanner::initializeEncoders): Ditto. (WebCore::GStreamerRegistryScanner::isCodecSupported const): Make the received code name const. (WebCore::GStreamerRegistryScanner::areAllCodecsSupported const): Use const references to iterate the codecs. (WebCore::GStreamerRegistryScanner::isAVC1CodecSupported const): Create a ElementFactories for the appropriate type and use to check if the given codec is supported. (WebCore::GStreamerRegistryScanner::isConfigurationSupported const): Make mediaConfiguration parameter const. (WebCore::GStreamerRegistryScanner::~GStreamerRegistryScanner): Deleted. (WebCore::GStreamerRegistryScanner::mimeTypeSet): Deleted. (WebCore::GStreamerRegistryScanner::hasElementForMediaType const): Deleted. * platform/graphics/gstreamer/GStreamerRegistryScanner.h: 2020-11-17 Sergio Villar Senin <svillar@igalia.com> Nullptr crash in RenderObject::parent https://bugs.webkit.org/show_bug.cgi?id=218484 <rdar://problem/70985057> Reviewed by Ryosuke Niwa. Let's imagine the following scenario: BODY LI contenteditable=true DIV If the current visible selection is on DIV and we try to execute document.execCommand("InsertOrderedList") then the current code will first try to fix the orphaned LI before inserting a new list. Fixing the orphaned LI means that a new list tag must be created between BODY and LI. There is one caveat though, and is that the InsertNodeBeforeCommand requires that the parent of the new node (in this case the BODY) must be richly editable (something that is not happening in the example above). That's why we need to ensure that this precondition is met before trying to fix the orphaned list item. Test: fast/editing/insert-list-in-orphaned-list-item-crash.html * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::fixOrphanedListChild): Early return if the parent is not richly editable. (WebCore::InsertListCommand::doApplyForSingleParagraph): Fixed a typo. 2020-11-18 Wenson Hsieh <wenson_hsieh@apple.com> Rename MetaCommandSwitchTo to MetaCommandSwitchToItemBuffer https://bugs.webkit.org/show_bug.cgi?id=219130 Reviewed by Tim Horton. Rename MetaCommandSwitchTo to MetaCommandSwitchToItemBuffer. The new name helps to clarify that this item is about changing or swapping between display list item buffers, rather than image buffers. * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::append): * platform/graphics/displaylists/DisplayListItemBuffer.cpp: (WebCore::DisplayList::ItemHandle::apply): (WebCore::DisplayList::ItemHandle::destroy): (WebCore::DisplayList::ItemHandle::copyTo const): (WebCore::DisplayList::ItemBuffer::swapWritableBufferIfNeeded): * platform/graphics/displaylists/DisplayListItemType.cpp: (WebCore::DisplayList::sizeOfItemInBytes): (WebCore::DisplayList::isDrawingItem): (WebCore::DisplayList::isInlineItem): * platform/graphics/displaylists/DisplayListItemType.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::MetaCommandSwitchToItemBuffer::MetaCommandSwitchToItemBuffer): (WebCore::DisplayList::MetaCommandSwitchTo::MetaCommandSwitchTo): Deleted. (WebCore::DisplayList::MetaCommandSwitchTo::identifier const): Deleted. 2020-11-18 Wenson Hsieh <wenson_hsieh@apple.com> [Concurrent display lists] Add a way for display lists to partially replay https://bugs.webkit.org/show_bug.cgi?id=219067 Reviewed by Simon Fraser. Make it possble for a display list replayer to stop early in the middle of processing a display list. This capability is a prerequisite to three items: - Allow display list processing in the GPU process to pause when encountering missing cached resources. - Allow the GPU process to replay display list item buffers that contain display list data targeting different destination image buffers. - Allow the GPU process to prematurely halt display list processing and perform a MESSAGE_CHECK to terminate the web content process, in the case of an invalid display list item (e.g. decoding failure). See below for more details. Test: DisplayListTests.ReplayWithMissingResource * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::flushDrawingContextAndCommit): (WebCore::ImageBuffer::submitDisplayList): Deleted. Remove the generic `submitDisplayList` method on `ImageBuffer`; instead, call directly into `RemoteImageBuffer::submitDisplayList` to replay display lists. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::platformCALayerPaintContents): Adjust several call sites of `replay()` to grab the tracked display list from the `ReplayResult`. * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::asText const): (WebCore::DisplayList::DisplayList::dump const): * platform/graphics/displaylists/DisplayList.h: (WebCore::DisplayList::DisplayList::iterator::operator* const): Pull the iterator value out into a separate `Value` struct, and include the size of the current display list item in the item buffer. * platform/graphics/displaylists/DisplayListDrawingContext.cpp: (WebCore::DisplayList::DrawingContext::replayDisplayList): * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::applyImageBufferItem): (WebCore::DisplayList::applyNativeImageItem): (WebCore::DisplayList::Replayer::applyItem): Make this private helper method return an optional flag indicating whether display list replay should stop. (WebCore::DisplayList::Replayer::replay): Make replay() return a `ReplayResult`, which contains the tracked display list (if tracking is enabled), as well as the number of bytes of display list item data that were consumed, and the reason why display list replay stopped (the default reason being `ReplayedAllItems`). * platform/graphics/displaylists/DisplayListReplayer.h: (WebCore::DisplayList::Replayer::replay): 2020-11-18 Tim Horton <timothy_horton@apple.com> REGRESSION (r269895): Google Maps expanded route options are missing background color https://bugs.webkit.org/show_bug.cgi?id=219119 <rdar://problem/71510412> Reviewed by Said Abou-Hallawa. No new tests, yet. Test is pending. * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::drawPlatformImage): r199071 removed the state save/restore around the CG implementation of drawNativeImage, explicitly saving and restoring the few things it knew that the implementation would change. However, it failed to save/restore the composite operator. This was mostly not a problem, because e.g. canvas always hands down the global op. However, in r269895, I added code that passes in a /different/ compositing operator, and it gets stuck on the context. Save and restore the composite operator and blend mode like we do for other properties. 2020-11-18 Aditya Keerthi <akeerthi@apple.com> [iOS][FCR] Rename UA style sheet to follow naming convention https://bugs.webkit.org/show_bug.cgi?id=219108 Reviewed by Tim Horton. * DerivedSources-input.xcfilelist: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * css/formControlsIOS.css: Renamed from Source/WebCore/css/iOSFormControlRefresh.css. * style/InspectorCSSOMWrappers.cpp: (WebCore::Style::InspectorCSSOMWrappers::collectDocumentWrappers): * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement): * style/UserAgentStyle.h: 2020-11-18 Chris Dumez <cdumez@apple.com> REGRESSION (r269227?): Flaky crash in WebCore::DOMPromiseProxy seen with imported/w3c/web-platform-tests/service-workers/service-worker/referrer-toplevel-script-fetch.https.html https://bugs.webkit.org/show_bug.cgi?id=219009 <rdar://problem/71464073> Reviewed by Geoffrey Garen. The lambda in ServiceWorkerContainer::ready() was dereferencing m_readyPromise unconditionally. This is not correct and we need a null-check since ServiceWorkerContainer::stop() nulls out m_readyPromise. No new tests, already covered by existing test that is flakily crashing. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::ready): 2020-11-18 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Line::enclosingRect should only include the border box (exclude vertical margins) https://bugs.webkit.org/show_bug.cgi?id=219106 Reviewed by Antti Koivisto. LineIteratorPath::top/bottom expects border box enclosing values (and not margin box values). (and while we are here, let's just compute the vertical enclosing values and ignore the horizontal aspect of it as the line box always encloses all the inline level boxes on the line anyway) * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::logicalMarginRectForInlineLevelBox const): (WebCore::Layout::LineBox::logicalRectForInlineLevelBox const): Deleted. * layout/inlineformatting/InlineLineBox.h: * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const): * layout/integration/LayoutIntegrationLine.h: (WebCore::LayoutIntegration::Line::Line): (WebCore::LayoutIntegration::Line::enclosingContentTop const): (WebCore::LayoutIntegration::Line::enclosingContentBottom const): (WebCore::LayoutIntegration::Line::enclosingContentRect const): Deleted. * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::LineIteratorModernPath::top const): (WebCore::LayoutIntegration::LineIteratorModernPath::bottom const): * layout/integration/LayoutIntegrationPagination.cpp: (WebCore::LayoutIntegration::makeAdjustedContent): * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::selectionRect const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::showInlineTreeAndRuns): 2020-11-18 Antoine Quint <graouts@webkit.org> Move <model> code under Modules/model-element https://bugs.webkit.org/show_bug.cgi?id=219104 Reviewed by Dean Jackson. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources.make: * Headers.cmake: * Modules/model-element/HTMLModelElement.cpp: Renamed from Source/WebCore/html/HTMLModelElement.cpp. * Modules/model-element/HTMLModelElement.h: Renamed from Source/WebCore/html/HTMLModelElement.h. * Modules/model-element/HTMLModelElement.idl: Renamed from Source/WebCore/html/HTMLModelElement.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-11-18 Chris Dumez <cdumez@apple.com> [iOS] beforeunload event does not fire in MobileSafari https://bugs.webkit.org/show_bug.cgi?id=219102 <rdar://problem/70550655> Reviewed by Geoff Garen. MobileSafari on iOS does not implement WKUIDelegate's runJavaScriptAlertPanelWithMessage because it never shows any before unload prompt. When the client does not implement this delegate, Chrome::canRunBeforeUnloadConfirmPanel() returns false and this was causing FrameLoader::shouldClose() to return early, before even firing the beforeunload event in each frame. I updated our logic so that we now fire the beforeunload events no matter what and we merely do not attempt to show the beforeunload prompt when Chrome::canRunBeforeUnloadConfirmPanel() return false, similarly to what we do when the document does not have a user gesture. Note that we already fire the pagehide and unload events on iOS so this is not a significant change in policy. * loader/FrameLoader.cpp: (WebCore::FrameLoader::shouldClose): (WebCore::FrameLoader::dispatchBeforeUnloadEvent): 2020-11-18 Aditya Keerthi <akeerthi@apple.com> [iOS][FCR] Use new glyph for -webkit-list-button https://bugs.webkit.org/show_bug.cgi?id=219040 <rdar://problem/71493560> Reviewed by Wenson Hsieh. This updates the appearance of the disclosure button used to view datalist options for text inputs. * css/iOSFormControlRefresh.css: (input::-webkit-list-button): The glyph is taken from SF Symbols. 2020-11-18 Aditya Keerthi <akeerthi@apple.com> [iOS][FCR] Add new look for radio buttons https://bugs.webkit.org/show_bug.cgi?id=219046 <rdar://problem/71498263> Reviewed by Wenson Hsieh. Tests: fast/forms/ios/form-control-refresh/radio/border.html fast/forms/ios/form-control-refresh/radio/checked-appearance.html fast/forms/ios/form-control-refresh/radio/disabled-appearance.html fast/forms/ios/form-control-refresh/radio/ignored-properties.html fast/forms/ios/form-control-refresh/radio/width-height.html * css/iOSFormControlRefresh.css: (input:matches([type="checkbox"], [type="radio"])): Use "border: initial" and "box-sizing: border-box" to match macOS, now that the native radio button styles on macOS and iOS are similar. This also aligns with the new iOS checkbox style. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintRadioDecorations): Move away from using paintRadioDecorations to paintRadio for the new design. This is necessary to avoid painting custom borders and backgrounds for native checkboxes, matching macOS. Painting both a CSS background as well as the native checkbox can lead to background bleeding. Customizations can still be made using "-webkit-appearance: none". (WebCore::RenderThemeIOS::paintRadio): A new implementation for painting radio buttons to match the updated design. If the button is unchecked, a single circle is painted. Otherwise, an inner and outer circle are painted. 2020-11-18 Yusuke Suzuki <ysuzuki@apple.com> Unreviewed, relanding r269940 https://bugs.webkit.org/show_bug.cgi?id=219076 Tests: js/dom/webassembly-memory-normal-fail.html js/dom/webassembly-memory-shared-basic.html js/dom/webassembly-memory-shared-fail.html storage/indexeddb/shared-memory-structured-clone.html * Headers.cmake: * Modules/indexeddb/server/IDBSerializationContext.cpp: (WebCore::IDBServer::IDBSerializationContext::initializeVM): * WebCore.xcodeproj/project.pbxproj: * bindings/IDLTypes.h: * bindings/js/CommonVM.cpp: (WebCore::commonVMSlow): * bindings/js/JSDOMConvertBufferSource.h: (WebCore::Detail::BufferSourceConverter::convert): (WebCore::Converter<IDLArrayBuffer>::convert): (WebCore::Converter<IDLDataView>::convert): (WebCore::Converter<IDLInt8Array>::convert): (WebCore::Converter<IDLInt16Array>::convert): (WebCore::Converter<IDLInt32Array>::convert): (WebCore::Converter<IDLUint8Array>::convert): (WebCore::Converter<IDLUint16Array>::convert): (WebCore::Converter<IDLUint32Array>::convert): (WebCore::Converter<IDLUint8ClampedArray>::convert): (WebCore::Converter<IDLFloat32Array>::convert): (WebCore::Converter<IDLFloat64Array>::convert): (WebCore::Converter<IDLArrayBufferView>::convert): (WebCore::Converter<IDLAllowSharedAdaptor<T>>::convert): * bindings/js/JSDOMConvertUnion.h: * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): (WebCore::CloneSerializer::CloneSerializer): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneDeserializer::deserialize): (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::CloneDeserializer::readTerminal): (WebCore::SerializedScriptValue::SerializedScriptValue): (WebCore::SerializedScriptValue::computeMemoryCost const): (WebCore::SerializedScriptValue::create): (WebCore::SerializedScriptValue::deserialize): * bindings/js/SerializedScriptValue.h: * bindings/js/WebCoreJSClientData.cpp: (WebCore::JSVMClientData::initNormalWorld): * bindings/js/WebCoreJSClientData.h: * bindings/js/WebCoreTypedArrayController.cpp: (WebCore::WebCoreTypedArrayController::WebCoreTypedArrayController): (WebCore::WebCoreTypedArrayController::isAtomicsWaitAllowedOnCurrentThread): * bindings/js/WebCoreTypedArrayController.h: * bindings/scripts/CodeGeneratorJS.pm: (IsAnnotatedType): (GetAnnotatedIDLType): * bindings/scripts/IDLAttributes.json: * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjDOMConstructor::construct): (WebCore::jsTestObjPrototypeFunction_encodeIntoBody): (WebCore::JSC_DEFINE_HOST_FUNCTION): * bindings/scripts/test/TestObj.idl: * dom/TextDecoder.idl: * dom/TextDecoderStreamDecoder.idl: * dom/TextEncoder.idl: * workers/DedicatedWorkerGlobalScope.cpp: (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): * workers/WorkerGlobalScope.h: * workers/WorkerOrWorkletGlobalScope.cpp: (WebCore::WorkerOrWorkletGlobalScope::WorkerOrWorkletGlobalScope): * workers/WorkerOrWorkletGlobalScope.h: * workers/WorkerOrWorkletScriptController.cpp: (WebCore::WorkerOrWorkletScriptController::WorkerOrWorkletScriptController): * workers/WorkerOrWorkletScriptController.h: * workers/WorkerThreadType.h: Added. * workers/service/ServiceWorkerGlobalScope.cpp: (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope): * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): 2020-11-18 Simon Fraser <simon.fraser@apple.com> Propagate wheel event handling back to the scrolling thread https://bugs.webkit.org/show_bug.cgi?id=219050 Reviewed by Chris Dumez. Prepare to fix webkit.org/b/218764 by adding a way for the main thread to communicate back to the scrolling thread information about whether the wheel event was dispatched to JS, and whether preventDefault() was called on it. The EventHandling enum has bits that are set when the event is dispatched to JS, when it's canceled, and if default handling happened. These values are filled in Element::dispatchWheelEvent(). They propagate back to the scrolling thread via EventHandler::wheelEventWasProcessedByMainThread(), whose macOS implementation calls into the ScrollingCoordinator, which will set state on the ScrollingTree in a future patch. WheelEventTestMonitor gains a "reason" flag to track the async propagation of wheelEventWasProcessedByMainThread() back to the scrolling thread. This patch also adds infrastructure for the scrolling thread to specify that wheel events sent to the main thread will be uncancelable; WheelEventProcessingSteps gains MainThreadForNonBlockingDOMEventDispatch and MainThreadForBlockingDOMEventDispatch, and if MainThreadForNonBlockingDOMEventDispatch is set, then we create WheelEvents with IsCancelable::No. This will be the case for wheel events in the passive event region. Rename ScrollingCoordinator::handleWheelEvent() to performDefaultWheelEventHandling() for clarity, and stop passing the FrameView* which was unused. Add a missing lock in ThreadedScrollingTree::handleWheelEventAfterMainThread(). * dom/Element.cpp: (WebCore::Element::dispatchWheelEvent): * dom/Element.h: * dom/WheelEvent.cpp: (WebCore::WheelEvent::WheelEvent): (WebCore::WheelEvent::create): * dom/WheelEvent.h: * page/EventHandler.cpp: (WebCore::EventHandler::wheelEventWasProcessedByMainThread): (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::handleWheelEventInternal): * page/EventHandler.h: * page/FrameView.cpp: (WebCore::FrameView::wheelEvent): * page/PointerLockController.cpp: (WebCore::PointerLockController::dispatchLockedWheelEvent): * page/WheelEventTestMonitor.cpp: (WebCore::operator<<): * page/WheelEventTestMonitor.h: * page/ios/EventHandlerIOS.mm: (WebCore::EventHandler::wheelEvent): * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::wheelEvent): (WebCore::EventHandler::wheelEventWasProcessedByMainThread): * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::performDefaultWheelEventHandling): (WebCore::ScrollingCoordinator::wheelEventWasProcessedByMainThread): (WebCore::ScrollingCoordinator::handleWheelEvent): Deleted. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::determineWheelEventProcessing): (WebCore::ScrollingTree::handleWheelEvent): * page/scrolling/ScrollingTree.h: (WebCore::WheelEventHandlingResult::needsMainThreadProcessing const): * page/scrolling/ScrollingTreeLatchingController.cpp: (WebCore::ScrollingTreeLatchingController::receivedWheelEvent): Send in WheelEventProcessingSteps which a future patch will use. * page/scrolling/ScrollingTreeLatchingController.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread): There was a missing lock here. (WebCore::ThreadedScrollingTree::wheelEventWasProcessedByMainThread): * page/scrolling/ThreadedScrollingTree.h: * page/scrolling/mac/ScrollingCoordinatorMac.h: * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::performDefaultWheelEventHandling): (WebCore::nextDeferIdentifier): (WebCore::ScrollingCoordinatorMac::wheelEventWasProcessedByMainThread): (WebCore::ScrollingCoordinatorMac::handleWheelEvent): Deleted. * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent): * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: (WebCore::ScrollingCoordinatorNicosia::performDefaultWheelEventHandling): (WebCore::ScrollingCoordinatorNicosia::wheelEventWasProcessedByMainThread): (WebCore::ScrollingCoordinatorNicosia::handleWheelEvent): Deleted. * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h: * platform/PlatformEvent.h: * platform/PlatformWheelEvent.cpp: (WebCore::operator<<): Add dumping of EventHandling. * platform/PlatformWheelEvent.h: 2020-11-18 Antoine Quint <graouts@webkit.org> [Web Animations] Ensure we don't schedule animation udpates when there are no styles to update https://bugs.webkit.org/show_bug.cgi?id=219071 Reviewed by Simon Fraser. Test: webanimations/scheduling-of-animation-without-keyframes.html For keyframe effects that don't interpolate any CSS property, run the same logic that we already run to determine when to schedule the next animation update in the case where we are running accelerated animations. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::timeToNextTick const): 2020-11-18 Antoine Quint <graouts@webkit.org> Support <source> as a child of <model> to specify the current source https://bugs.webkit.org/show_bug.cgi?id=219080 Reviewed by Dean Jackson. Test: system-preview/model/model-element-source.html * html/HTMLModelElement.cpp: (WebCore::HTMLModelElement::sourcesChanged): (WebCore::HTMLModelElement::setSourceURL): (WebCore::HTMLModelElement::didMoveToNewDocument): * html/HTMLModelElement.h: * html/HTMLModelElement.idl: * html/HTMLSourceElement.cpp: (WebCore::HTMLSourceElement::insertedIntoAncestor): (WebCore::HTMLSourceElement::removedFromAncestor): (WebCore::HTMLSourceElement::parseAttribute): 2020-11-18 Chris Dumez <cdumez@apple.com> navigator.clipboard is not exposed on *.localhost pages https://bugs.webkit.org/show_bug.cgi?id=219020 Reviewed by Wenson Hsieh. Make sure that if the host falls within ".localhost", the security origin is treated as potentially trustworthy, as per: - https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy (Step 5). This makes sure that API that are exposed only to secure context (such as navigator.clipboad) are exposed on subdomains of localhost. * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress): 2020-11-18 Chris Lord <clord@igalia.com> Make CSS font shorthands parsable within a worker (i.e. without CSSValuePool) https://bugs.webkit.org/show_bug.cgi?id=202794 Reviewed by Darin Adler. Add functions to make it possible to parse CSS font shorthand properties without using CSS values, so it can be done safely off of the main thread. To support and test this, also add functions to make it possible to resolve those properties into a style without StyleBuilder and use that within CanvasRenderingContext2D. No new tests, covered by existing tests. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseFontWorkerSafe): * css/parser/CSSParser.h: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeFontWeight): (WebCore::consumeFontStretchKeywordValue): (WebCore::consumeFontStyle): (WebCore::consumeFamilyName): * css/parser/CSSPropertyParser.h: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::CalcParser::consumePercentRaw): (WebCore::CSSPropertyParserHelpers::CalcParser::consumeAngleRaw): (WebCore::CSSPropertyParserHelpers::CalcParser::consumeLengthRaw): (WebCore::CSSPropertyParserHelpers::CalcParser::consumeLengthOrPercentRaw): (WebCore::CSSPropertyParserHelpers::consumeNumberRaw): (WebCore::CSSPropertyParserHelpers::consumeNumber): (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumberRaw): (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber): (WebCore::CSSPropertyParserHelpers::consumeLengthRaw): (WebCore::CSSPropertyParserHelpers::consumeLength): (WebCore::CSSPropertyParserHelpers::consumePercent): (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercentRaw): (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent): (WebCore::CSSPropertyParserHelpers::consumeAngleRaw): (WebCore::CSSPropertyParserHelpers::consumeIdentRaw): (WebCore::CSSPropertyParserHelpers::consumeIdent): (WebCore::CSSPropertyParserHelpers::consumeIdentRangeRaw): (WebCore::CSSPropertyParserHelpers::consumeFontVariantCSS21Raw): (WebCore::CSSPropertyParserHelpers::consumeFontWeightKeywordValueRaw): (WebCore::CSSPropertyParserHelpers::consumeFontWeightRaw): (WebCore::CSSPropertyParserHelpers::consumeFontStretchKeywordValueRaw): (WebCore::CSSPropertyParserHelpers::consumeFontStyleKeywordValueRaw): (WebCore::CSSPropertyParserHelpers::consumeFontStyleRaw): (WebCore::CSSPropertyParserHelpers::concatenateFamilyName): (WebCore::CSSPropertyParserHelpers::consumeFamilyNameRaw): (WebCore::CSSPropertyParserHelpers::consumeGenericFamilyRaw): (WebCore::CSSPropertyParserHelpers::consumeFontFamilyRaw): (WebCore::CSSPropertyParserHelpers::consumeFontSizeRaw): (WebCore::CSSPropertyParserHelpers::consumeLineHeightRaw): (WebCore::CSSPropertyParserHelpers::consumeFontWorkerSafe): (WebCore::CSSPropertyParserHelpers::genericFontFamilyFromValueID): * css/parser/CSSPropertyParserHelpers.h: (WebCore::CSSPropertyParserHelpers::consumeIdentRaw): * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::setFont): * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueFontFamily): * style/StyleResolveForFontRaw.cpp: Added. (WebCore::Style::resolveForFontRaw): * style/StyleResolveForFontRaw.h: Added. 2020-11-18 Michael Catanzaro <mcatanzaro@gnome.org> [WPE][GTK] Update Outlook user agent quirk https://bugs.webkit.org/show_bug.cgi?id=219049 Reviewed by Carlos Garcia Campos. Users report that our user agent quirk for Outlook no longer works. Problem is outlook.live.com has moved to outlook.office.com. Thanks to Adrian Vovk for rebuilding WebKit to confirm that this patch fixes the issue. * platform/UserAgentQuirks.cpp: (WebCore::urlRequiresMacintoshPlatform): 2020-11-17 Sergio Villar Senin <svillar@igalia.com> RenderTreeBuilderBlock using an incorrect anonymous parent to attach a new renderer https://bugs.webkit.org/show_bug.cgi?id=218505 Reviewed by Antti Koivisto. Let's consider the following simplified render tree: PARENT |___beforeChildAnonymousContainer |___hierarchy of anonymous blocks |___beforeChild When RenderTreeBuilderBlock is attaching a new renderer given PARENT and beforeChild, it first tries to attach it to the PARENT if beforeChild is a direct child of PARENT. Otherwise it assumes that beforeChild is the direct child of an anonymous block which is in between PARENT and beforeChild. However in some cases, as the one presented above, beforeChild might have a whole hierarchy of anonymous blocks in between. That's why we cannot assume that beforeChild->parent() is a direct child of PARENT. Instead we should use beforeChildAnonymousContainer as the parent of the new renderer. * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation): Use beforeChildAnonymousContainer instead of beforeChild->parent(). 2020-11-18 Sam Weinig <weinig@apple.com> Address additional feedback from https://bugs.webkit.org/show_bug.cgi?id=218960 https://bugs.webkit.org/show_bug.cgi?id=219044 Reviewed by Alex Christensen. Address post-review feedback from Darin. * WebCore.xcodeproj/project.pbxproj: * editing/cocoa/DataDetectorType.h: Added. * editing/cocoa/DataDetectorTypes.h: Removed. * editing/cocoa/DataDetection.h: * editing/cocoa/DataDetection.mm: * loader/FrameLoader.cpp: * page/SettingsBase.h: * page/Settings.yaml: Rename DataDetectorTypes to DataDetectorType. * accessibility/ForcedAccessibilityValue.h: Put the definition all on one line for easier reading. * bindings/scripts/CodeGenerator.pm: (WK_ucfirst): * editing/EditingBehaviorType.h: Special case "ios" so that it doesn't become "Ios" but rather "iOS". * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::setActive): Fixup comment adding period and making it all one line. * page/FrameView.cpp: * page/FrameView.h: Use forward declaration for FrameFlattening enum. * page/PDFImageCachingPolicy.h: * platform/graphics/cg/PDFDocumentImage.h: Remove default value enumeration value and replace it with a standalone constexpr. 2020-11-18 Kimmo Kinnunen <kkinnunen@apple.com> GraphicsContextGL should have robust multivalue getters https://bugs.webkit.org/show_bug.cgi?id=218976 Reviewed by Simon Fraser. Change getter calls that are used to obtain single values so that the value is a normal function return value. This reduces the risk of having uninitialized out parameter receive location. Change the getters that are only used to obtain single values so that the getter itself has the return value. Add a single-value getter for getters that are used to obtain also multiple values. Add GCGLSpan type that is used to communicate pair: ptr, number of elements. This is similar type to std::span in C++20. The type will be used to receive the multi-value getter results. Use of WTF::Vector as the return value would be problematic because the call semantics need the length. Thus the length would be needed to be specified by either passing in the resized vector or passing in the length. Both of the options contain redunancy and resizable vector type would still open interpretation to how the result value would behave. Using std::array would be problematic because it cannot have dynamic length. GCGLSpan is not a return value since it does not carry its data. A span is only a view to existing data store. The type GCGLSpan will be used to simplify the GPU process implementation, since the bufSize will be explicitly associated in the passed data value type, inside the GCGLSpan type. In subsequent patches GCGLSpan will be used also for multivalue setters, i.e. arbitrary buffer stores, i.e. const GLtype ptrs. Use the RobustANGLE variants of the GL API implementation to obtain the values. Remove the corresponding RobustANGLE variants from ExtensionsGL, they are dead code and unused. Removes requiresRestrictedMaximumTextureSize workaround from ANGLE GraphicsContextGLOpenGL code, it was dead code (i.e flag always false). This should be done in ANGLE level. Fixes cosmetic bugs where uninitialized value was used to store the location of the gotten property. This value would be unwritten in edge-cases like GL errors, and thus the read would touch unuinitialized value. Fixes a cosmetic bug where uniform block variables code would pass in too large buffer size to the RobustANGLE call. The bufSize refers to the number of elements, but the code passed in the size of the buffer (i.e. number of elements * size of element). No new tests, a refactor. * html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::transferToImageBitmap): * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::initializeNewContext): (WebCore::WebGL2RenderingContext::getInt64Parameter): (WebCore::WebGL2RenderingContext::getTexParameter): (WebCore::WebGL2RenderingContext::getIndexedParameter): (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter): (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter): (WebCore::WebGL2RenderingContext::getMaxDrawBuffers): (WebCore::WebGL2RenderingContext::getMaxColorAttachments): * html/canvas/WebGLDrawBuffers.cpp: (WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements): * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::initializeAttachments): * html/canvas/WebGLProgram.cpp: (WebCore::WebGLProgram::cacheActiveAttribLocations): (WebCore::WebGLProgram::cacheInfoIfNeeded): * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter): (WebCore::WebGLRenderingContext::getMaxDrawBuffers): (WebCore::WebGLRenderingContext::getMaxColorAttachments): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::initializeNewContext): (WebCore::WebGLRenderingContextBase::compileShader): (WebCore::WebGLRenderingContextBase::getBufferParameter): (WebCore::WebGLRenderingContextBase::getProgramParameter): (WebCore::WebGLRenderingContextBase::getRenderbufferParameter): (WebCore::WebGLRenderingContextBase::getShaderParameter): (WebCore::WebGLRenderingContextBase::getTexParameter): (WebCore::WebGLRenderingContextBase::getUniformLocation): (WebCore::WebGLRenderingContextBase::getBooleanParameter): (WebCore::WebGLRenderingContextBase::getFloatParameter): (WebCore::WebGLRenderingContextBase::getIntParameter): (WebCore::WebGLRenderingContextBase::getUnsignedIntParameter): (WebCore::WebGLRenderingContextBase::getMaxDrawBuffers): (WebCore::WebGLRenderingContextBase::getMaxColorAttachments): * platform/graphics/ExtensionsGL.h: * platform/graphics/GraphicsContextGL.h: (WebCore::GraphicsContextGL::getFloat): (WebCore::GraphicsContextGL::getBoolean): (WebCore::GraphicsContextGL::getInteger): (WebCore::GraphicsContextGL::getActiveUniformBlocki): * platform/graphics/GraphicsTypesGL.h: (GCGLSpan::GCGLSpan): (GCGLSpan::operator[]): (GCGLSpan::operator*): (std::numeric_limits<size_t>::max): (makeGCGLSpan): * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::getTranslatedShaderSourceANGLE): (WebCore::ExtensionsGLANGLE::getBooleanvRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getBufferParameterivRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getFloatvRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getFramebufferAttachmentParameterivRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getIntegervRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getProgramivRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getRenderbufferParameterivRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getShaderivRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getTexParameterfvRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getTexParameterivRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getUniformfvRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getUniformivRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getVertexAttribfvRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getVertexAttribivRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getVertexAttribPointervRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getIntegeri_vRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getActiveUniformBlockivRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getInteger64vRobustANGLE): Deleted. (WebCore::ExtensionsGLANGLE::getInteger64i_vRobustANGLE): Deleted. * platform/graphics/angle/ExtensionsGLANGLE.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::getIntegerv): (WebCore::GraphicsContextGLOpenGL::getActiveUniformImpl): (WebCore::GraphicsContextGLOpenGL::getBooleanv): (WebCore::GraphicsContextGLOpenGL::getBufferParameteri): (WebCore::GraphicsContextGLOpenGL::getFloatv): (WebCore::GraphicsContextGLOpenGL::getInteger64): (WebCore::GraphicsContextGLOpenGL::getInteger64i): (WebCore::GraphicsContextGLOpenGL::getFramebufferAttachmentParameteri): (WebCore::GraphicsContextGLOpenGL::getProgrami): (WebCore::GraphicsContextGLOpenGL::getRenderbufferParameteri): (WebCore::GraphicsContextGLOpenGL::getShaderi): (WebCore::GraphicsContextGLOpenGL::getTexParameterf): (WebCore::GraphicsContextGLOpenGL::getTexParameteri): (WebCore::GraphicsContextGLOpenGL::getUniformfv): (WebCore::GraphicsContextGLOpenGL::getUniformiv): (WebCore::GraphicsContextGLOpenGL::getUniformuiv): (WebCore::GraphicsContextGLOpenGL::getVertexAttribfv): (WebCore::GraphicsContextGLOpenGL::getVertexAttribiv): (WebCore::GraphicsContextGLOpenGL::getVertexAttribOffset): (WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockiv): (WebCore::GraphicsContextGLOpenGL::getIntegeri_v): Deleted. (WebCore::GraphicsContextGLOpenGL::getBufferParameteriv): Deleted. (WebCore::GraphicsContextGLOpenGL::getInteger64v): Deleted. (WebCore::GraphicsContextGLOpenGL::getInteger64i_v): Deleted. (WebCore::GraphicsContextGLOpenGL::getFramebufferAttachmentParameteriv): Deleted. (WebCore::GraphicsContextGLOpenGL::getProgramiv): Deleted. (WebCore::GraphicsContextGLOpenGL::getRenderbufferParameteriv): Deleted. (WebCore::GraphicsContextGLOpenGL::getShaderiv): Deleted. (WebCore::GraphicsContextGLOpenGL::getTexParameterfv): Deleted. (WebCore::GraphicsContextGLOpenGL::getTexParameteriv): Deleted. * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp: (WebCore::GraphicsContextGLCVANGLE::initializeUVContextObjects): * platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp: (WebCore::ExtensionsGLOpenGLCommon::ensureEnabled): (WebCore::ExtensionsGLOpenGLCommon::getTranslatedShaderSourceANGLE): (WebCore::ExtensionsGLOpenGLCommon::getBooleanvRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getBufferParameterivRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getFloatvRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getFramebufferAttachmentParameterivRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getIntegervRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getProgramivRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getRenderbufferParameterivRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getShaderivRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getTexParameterfvRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getTexParameterivRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getUniformfvRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getUniformivRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getVertexAttribfvRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getVertexAttribivRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getVertexAttribPointervRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getIntegeri_vRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getInteger64vRobustANGLE): Deleted. (WebCore::ExtensionsGLOpenGLCommon::getInteger64i_vRobustANGLE): Deleted. * platform/graphics/opengl/ExtensionsGLOpenGLCommon.h: * platform/graphics/opengl/ExtensionsGLOpenGLES.cpp: (WebCore::ExtensionsGLOpenGLES::isEnabled): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp: (WebCore::GraphicsContextGLOpenGL::getIntegerv): * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::getBooleanv): (WebCore::GraphicsContextGLOpenGL::getFloatv): (WebCore::GraphicsContextGLOpenGL::getInteger64): (WebCore::GraphicsContextGLOpenGL::getInteger64i): (WebCore::GraphicsContextGLOpenGL::getFramebufferAttachmentParameteri): (WebCore::GraphicsContextGLOpenGL::getProgrami): (WebCore::GraphicsContextGLOpenGL::getRenderbufferParameteri): (WebCore::GraphicsContextGLOpenGL::getShaderi): (WebCore::GraphicsContextGLOpenGL::getTexParameterf): (WebCore::GraphicsContextGLOpenGL::getTexParameteri): (WebCore::GraphicsContextGLOpenGL::getUniformfv): (WebCore::GraphicsContextGLOpenGL::getUniformiv): (WebCore::GraphicsContextGLOpenGL::getUniformuiv): (WebCore::GraphicsContextGLOpenGL::getVertexAttribf): (WebCore::GraphicsContextGLOpenGL::getVertexAttribiv): (WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockiv): (WebCore::GraphicsContextGLOpenGL::getIntegeri_v): Deleted. (WebCore::GraphicsContextGLOpenGL::getInteger64v): Deleted. (WebCore::GraphicsContextGLOpenGL::getInteger64i_v): Deleted. (WebCore::GraphicsContextGLOpenGL::getFramebufferAttachmentParameteriv): Deleted. (WebCore::GraphicsContextGLOpenGL::getProgramiv): Deleted. (WebCore::GraphicsContextGLOpenGL::getRenderbufferParameteriv): Deleted. (WebCore::GraphicsContextGLOpenGL::getShaderiv): Deleted. (WebCore::GraphicsContextGLOpenGL::getTexParameterfv): Deleted. (WebCore::GraphicsContextGLOpenGL::getTexParameteriv): Deleted. (WebCore::GraphicsContextGLOpenGL::getVertexAttribfv): Deleted. * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp: (WebCore::GraphicsContextGLOpenGL::getIntegerv): (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): 2020-11-18 Philippe Normand <pnormand@igalia.com> REGRESSION(r269435): [Debug][GStreamer] Several tests are crashing https://bugs.webkit.org/show_bug.cgi?id=218735 <rdar://problem/71469947> Reviewed by Carlos Garcia Campos. Cache the referrer value from the main thread before using it in the GStreamer secondary thread. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): (WebCore::MediaPlayerPrivateGStreamer::sourceSetup): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcMakeRequest): (webKitWebSrcSetMediaPlayer): * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: 2020-11-18 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r269940. https://bugs.webkit.org/show_bug.cgi?id=219076 caused seemingly-infinite build time regression Reverted changeset: "[JSC] Implement WebAssembly.Memory with shared" https://bugs.webkit.org/show_bug.cgi?id=218693 https://trac.webkit.org/changeset/269940 2020-11-18 Carlos Garcia Campos <cgarcia@igalia.com> Unreviewed. Fix the build with GCC 10 Add a temporary workaround for a GCC 10 bug. * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting): 2020-11-18 Michael Catanzaro <mcatanzaro@gnome.org> [WPE][GTK] Update Safari version in user agent header for Safari 14 https://bugs.webkit.org/show_bug.cgi?id=219048 Reviewed by Carlos Garcia Campos. See: https://webkit.org/blog/11340/new-webkit-features-in-safari-14/ * platform/glib/UserAgentGLib.cpp: (WebCore::buildUserAgentString): 2020-11-18 Carlos Garcia Campos <cgarcia@igalia.com> Release assertion failure in Optional<WebCore::SimpleRange>::operator* via CompositeEditCommand::moveParagraphs https://bugs.webkit.org/show_bug.cgi?id=218494 Reviewed by Ryosuke Niwa. This is happening when insert list command is called for a list item containing a body element as a child. When the tree is iterated looking for the end position, the body element selected as candidate, but a null position is returned because it's considered to be in a different editing element. This happens because Node::rootEditableElement() always returns the node itseld for body elements, but it should actually check that the node is the document body. Test: editing/inserting/insert-list-with-body-child-crash.html * dom/Node.cpp: (WebCore::Node::isRootEditableElement const): Check node is the document body, not just a body element. (WebCore::Node::rootEditableElement const): Ditto. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): Add an assert to ensure it's not called with a null endOfParagraphToMove. 2020-11-17 Said Abou-Hallawa <said@apple.com> REGRESSION(r269614): [iOS] WebContent crashes when entering Full Screen video with text captions https://bugs.webkit.org/show_bug.cgi?id=219065 Reviewed by Tim Horton. Pass a CGImageRef of the video caption to CALayer instead of passing a NativeImage which is now a WebCore class. * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm: (WebCore::TextTrackRepresentationCocoa::update): 2020-11-16 Yusuke Suzuki <ysuzuki@apple.com> [JSC] Implement WebAssembly.Memory with shared https://bugs.webkit.org/show_bug.cgi?id=218693 Reviewed by Saam Barati. In WebCore, we need three things. 1. Shared WebAssembly.Memory serialization/deserialization This patch adds structure-cloning for WebAssembly.Memory to pass it to the other workers. Cloning is available only when the WebAssembly.Memory is shared mode. And it is only available when we are using it in postMessage. So we cannot store WebAssembly.Memory in IndexedDB. 2. WebCoreTypedArrayController::isAtomicsWaitAllowedOnCurrentThread Atomics.wait is usable only in Workers, and *not* usable in Service Workers. When creating VM, we pass WorkerThreadType and make WebCoreTypedArrayController::isAtomicsWaitAllowedOnCurrentThread return appropriate value. 3. [AllowShared] support for WPT WPT tests for this are broken, and tests are saying "PASS" while the feature is not implemented at all. Now, the feature is actually implemented, and WPT tests start showing that [AllowShared] annotation in IDL is not implemented. [AllowShared] is that, usually, DOM does not accept TypedArray originated from SharedArrayBuffer. e.g. encodeInto(..., Uint8Array) DOM IDL throws an error if Uint8Array is backed by SharedArrayBuffer. But in the limited places, we are explicitly allowing this. This is [AllowShared] annotation. This patch implements that so that we keep passing TextEncoder / TextDecoder tests. * Headers.cmake: * Modules/indexeddb/server/IDBSerializationContext.cpp: (WebCore::IDBServer::IDBSerializationContext::initializeVM): * WebCore.xcodeproj/project.pbxproj: * bindings/IDLTypes.h: * bindings/js/CommonVM.cpp: (WebCore::commonVMSlow): * bindings/js/JSDOMConvertBufferSource.h: (WebCore::Detail::BufferSourceConverter::convert): (WebCore::Converter<IDLArrayBuffer>::convert): (WebCore::Converter<IDLDataView>::convert): (WebCore::Converter<IDLInt8Array>::convert): (WebCore::Converter<IDLInt16Array>::convert): (WebCore::Converter<IDLInt32Array>::convert): (WebCore::Converter<IDLUint8Array>::convert): (WebCore::Converter<IDLUint16Array>::convert): (WebCore::Converter<IDLUint32Array>::convert): (WebCore::Converter<IDLUint8ClampedArray>::convert): (WebCore::Converter<IDLFloat32Array>::convert): (WebCore::Converter<IDLFloat64Array>::convert): (WebCore::Converter<IDLArrayBufferView>::convert): (WebCore::Converter<IDLAllowSharedAdaptor<T>>::convert): * bindings/js/JSDOMConvertUnion.h: * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): (WebCore::CloneSerializer::CloneSerializer): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneDeserializer::deserialize): (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::CloneDeserializer::readTerminal): (WebCore::SerializedScriptValue::SerializedScriptValue): (WebCore::SerializedScriptValue::computeMemoryCost const): (WebCore::SerializedScriptValue::create): (WebCore::SerializedScriptValue::deserialize): * bindings/js/SerializedScriptValue.h: * bindings/js/WebCoreJSClientData.cpp: (WebCore::JSVMClientData::initNormalWorld): * bindings/js/WebCoreJSClientData.h: * bindings/js/WebCoreTypedArrayController.cpp: (WebCore::WebCoreTypedArrayController::WebCoreTypedArrayController): (WebCore::WebCoreTypedArrayController::isAtomicsWaitAllowedOnCurrentThread): * bindings/js/WebCoreTypedArrayController.h: * bindings/scripts/CodeGeneratorJS.pm: (IsAnnotatedType): (GetAnnotatedIDLType): * bindings/scripts/IDLAttributes.json: * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjDOMConstructor::construct): (WebCore::jsTestObjPrototypeFunction_encodeIntoBody): (WebCore::JSC_DEFINE_HOST_FUNCTION): * bindings/scripts/test/TestObj.idl: * dom/TextDecoder.idl: * dom/TextDecoderStreamDecoder.idl: * dom/TextEncoder.idl: * workers/DedicatedWorkerGlobalScope.cpp: (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): * workers/WorkerGlobalScope.h: * workers/WorkerOrWorkletGlobalScope.cpp: (WebCore::WorkerOrWorkletGlobalScope::WorkerOrWorkletGlobalScope): * workers/WorkerOrWorkletGlobalScope.h: * workers/WorkerOrWorkletScriptController.cpp: (WebCore::WorkerOrWorkletScriptController::WorkerOrWorkletScriptController): * workers/WorkerOrWorkletScriptController.h: * workers/WorkerThreadType.h: Added. * workers/service/ServiceWorkerGlobalScope.cpp: (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope): * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): 2020-11-17 Zalan Bujtas <zalan@apple.com> REGRESSION (r269744): ASSERTION FAILED: m_hasValidContentHeight in WebCore::Layout::BoxGeometry::contentBoxHeight() https://bugs.webkit.org/show_bug.cgi?id=219004 <rdar://problem/71459284> Reviewed by Antti Koivisto. Unfortunately we have to disable all percentage height/width content until after the integration codepath is fixed. (in this case, the layout code assumes that percentage height values can always be resolved by climbing up on the ancestor chain -worst case scenario we find the ICB which always has fixed height value. However the integration codepath does not set the height on the fake ICB (RenderBlockFlow) even when the flow's height is fixed and the IFC code can't climb farther up on the tree) * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForChild): 2020-11-17 Megan Gardner <megan_gardner@apple.com> Fix for localizableStrings.string in WebCore https://bugs.webkit.org/show_bug.cgi?id=219060 Unreviewed build fix. * WebCore.xcodeproj/project.pbxproj: 2020-11-17 Fujii Hironori <Hironori.Fujii@sony.com> Use SetForScope to temporarily change members of TextureMapperPaintOptions instead of copying all members https://bugs.webkit.org/show_bug.cgi?id=219022 Reviewed by Carlos Garcia Campos. All members of TextureMapperPaintOptions don't need to be copied just to change some members. Use WTF::SetForScope to temporarily change members of TextureMapperPaintOptions. No behavior changes. * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintSelf): (WebCore::TextureMapperLayer::paintSelfAndChildren): (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica): (WebCore::TextureMapperLayer::paintUsingOverlapRegions): (WebCore::TextureMapperLayer::applyMask): (WebCore::TextureMapperLayer::paintIntoSurface): (WebCore::commitSurface): (WebCore::TextureMapperLayer::paintWithIntermediateSurface): (WebCore::TextureMapperLayer::paintRecursive): * platform/graphics/texmap/TextureMapperLayer.h: 2020-11-17 Megan Gardner <megan_gardner@apple.com> Fix for localizableStrings.string in WebCore https://bugs.webkit.org/show_bug.cgi?id=219056 Unreviewed build fix. * WebCore.xcodeproj/project.pbxproj: 2020-11-17 Adrian Perez de Castro <aperez@igalia.com> Unreviewed build fix for non-unified builds. * rendering/RenderBox.cpp: Add missing LayoutIntegrationLineIterator.h header. 2020-11-17 Andres Gonzalez <andresg_22@apple.com> Implementation of AXCoreObject::innerHTML and outerHTML. https://bugs.webkit.org/show_bug.cgi?id=219037 Reviewed by Chris Fleizach. No change in functionality, debugging code. - Added innerHTML and outerHTmL methods to AXCoreObject for debugging purposes. - The AXIsolatedObject implementation of these methods forwards the call to the associated AXObject and does a lazy caching of the Inner/OuterHTML properties. - The AXLogger class is now declared and defined only #if !LOG_DISABLED. * accessibility/AXLogger.cpp: (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::innerHTML const): (WebCore::AccessibilityObject::outerHTML const): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::innerHTML const): (WebCore::AXIsolatedObject::outerHTML const): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase innerHTML]): (-[WebAccessibilityObjectWrapperBase outerHTML]): 2020-11-17 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Disable percentage type min/max-width/height https://bugs.webkit.org/show_bug.cgi?id=219045 Reviewed by Antti Koivisto. The integration layer code does not support them yet. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForChild): 2020-11-17 Sihui Liu <sihui_liu@apple.com> Add a default action for SpeechRecognition permission request https://bugs.webkit.org/show_bug.cgi?id=219021 Reviewed by Youenn Fablet. Manually tested in Minibrowser. * en.lproj/Localizable.strings: 2020-11-17 Antti Koivisto <antti@apple.com> [LFC][Integration] Cache inline boxes in logical order to run iterator https://bugs.webkit.org/show_bug.cgi?id=219031 Reviewed by Zalan Bujtas. Expand use of the existing cache to cover line traversal. This will make porting code in VisibleUnit.cpp to iterator easier. Also a bunch of related cleanups. * layout/integration/LayoutIntegrationLineIterator.cpp: (WebCore::LayoutIntegration::LineIterator::logicalStartRun const): (WebCore::LayoutIntegration::LineIterator::logicalEndRun const): (WebCore::LayoutIntegration::LineIterator::logicalStartRunWithNode const): (WebCore::LayoutIntegration::LineIterator::logicalEndRunWithNode const): * layout/integration/LayoutIntegrationLineIterator.h: * layout/integration/LayoutIntegrationLineIteratorLegacyPath.h: (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalStartRun const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalEndRun const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalStartRunWithNode const): Deleted. (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalEndRunWithNode const): Deleted. * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::LineIteratorModernPath::logicalStartRun const): (WebCore::LayoutIntegration::LineIteratorModernPath::logicalEndRun const): (WebCore::LayoutIntegration::LineIteratorModernPath::logicalStartRunWithNode const): Deleted. (WebCore::LayoutIntegration::LineIteratorModernPath::logicalEndRunWithNode const): Deleted. * layout/integration/LayoutIntegrationRunIterator.cpp: (WebCore::LayoutIntegration::RunIterator::traverseNextOnLineInLogicalOrder): (WebCore::LayoutIntegration::RunIterator::traversePreviousOnLineInLogicalOrder): (WebCore::LayoutIntegration::firstTextRunInTextOrderFor): * layout/integration/LayoutIntegrationRunIterator.h: * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: (WebCore::LayoutIntegration::RunIteratorLegacyPath::RunIteratorLegacyPath): (WebCore::LayoutIntegration::RunIteratorLegacyPath::traverseNextTextRunInTextOrder): (WebCore::LayoutIntegration::RunIteratorLegacyPath::traverseNextOnLineInLogicalOrder): (WebCore::LayoutIntegration::RunIteratorLegacyPath::traversePreviousOnLineInLogicalOrder): (WebCore::LayoutIntegration::RunIteratorLegacyPath::inlineTextBox const): (WebCore::LayoutIntegration::RunIteratorLegacyPath::initializeLogicalOrderCacheForLine): (WebCore::LayoutIntegration::RunIteratorLegacyPath::traverseNextInlineBoxInCacheOrder): (WebCore::LayoutIntegration::RunIteratorLegacyPath::traversePreviousInlineBoxInCacheOrder): (WebCore::LayoutIntegration::RunIteratorLegacyPath::nextInlineTextBoxInTextOrder const): Deleted. * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::traverseNextOnLineInLogicalOrder): (WebCore::LayoutIntegration::RunIteratorModernPath::traversePreviousOnLineInLogicalOrder): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::getLogicalStartBoxWithNode const): Deleted. (WebCore::RootInlineBox::getLogicalEndBoxWithNode const): Deleted. * rendering/RootInlineBox.h: 2020-11-17 Megan Gardner <megan_gardner@apple.com> Speculative fix for localizableStrings.string in WebCore https://bugs.webkit.org/show_bug.cgi?id=219042 Unreviewed build fix. * WebCore.xcodeproj/project.pbxproj: 2020-11-17 Antoine Quint <graouts@webkit.org> [Web Animations] Move all effect-specific parts of WebAnimation::timeToNextTick() to effect classes https://bugs.webkit.org/show_bug.cgi?id=219028 Reviewed by Antti Koivisto. Most of WebAnimation::timeToNextTick() is code that is specific to effects. We move this code out to KeyframeEffect and a virtual method with a default implementation on AnimationEffect. This is the first step towards adding more smarts to this method such as avoiding style recalcs if there are no keyframes set up on a KeyframeEffect or running fewer style recalcs when animating a discrete property. No new tests since this we are just moving code around. * animation/AnimationEffect.h: (WebCore::AnimationEffect::timeToNextTick const): * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::timeToNextTick const): * animation/KeyframeEffect.h: (WebCore::KeyframeEffect::isCompletelyAccelerated const): Make this method private since it is now only called by KeyframeEffect. * animation/WebAnimation.cpp: (WebCore::WebAnimation::timeToNextTick const): (WebCore::WebAnimation::isCompletelyAccelerated const): Deleted. This method no longer has any call sites. * animation/WebAnimation.h: 2020-11-17 Aditya Keerthi <akeerthi@apple.com> [iOS][FCR] Add new look for checkboxes https://bugs.webkit.org/show_bug.cgi?id=218808 <rdar://problem/71286037> Reviewed by Wenson Hsieh. Tests: fast/forms/ios/form-control-refresh/checkbox/border.html fast/forms/ios/form-control-refresh/checkbox/checked-appearance.html fast/forms/ios/form-control-refresh/checkbox/ignored-properties.html fast/forms/ios/form-control-refresh/checkbox/indeterminate-appearance.html fast/forms/ios/form-control-refresh/checkbox/width-height.html * css/iOSFormControlRefresh.css: (input[type="checkbox"]): Use "border: initial" and "box-sizing: border-box" to match macOS, now that the native checkbox styles on macOS and iOS are similar. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintCheckboxDecorations): Move away from using paintCheckboxDecorations to paintCheckbox for the new design. This is necessary to avoid painting custom borders and backgrounds for native checkboxes, matching macOS. Painting both a CSS background as well as the native checkbox can lead to background bleeding. Customizations can still be made using "-webkit-appearance: none". (WebCore::RenderThemeIOS::paintCheckbox): A new implementation for painting checkboxes to match the updated design. The checkmark drawing was generated using SF Symbols. 2020-11-17 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Add even more integral snapping to inline level boxes https://bugs.webkit.org/show_bug.cgi?id=219011 Reviewed by Antti Koivisto. It is required to match current legacy inline geometries. * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::InlineLevelBox::setLogicalTop): (WebCore::Layout::LineBox::InlineLevelBox::setLogicalHeight): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineLevelBox::setLogicalTop): Deleted. (WebCore::Layout::LineBox::InlineLevelBox::setLogicalHeight): Deleted. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions): 2020-11-17 Chris Lord <clord@igalia.com> REGRESSION(r269579) [WPE] Many tests with scrolling flaky after this revision https://bugs.webkit.org/show_bug.cgi?id=218859 Reviewed by Simon Fraser. Set scrolling node ID correctly on CoordinatedGraphicsLayer. * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren): * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::setScrollingNodeID): (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: 2020-11-17 Peng Liu <peng.liu6@apple.com> [Media In GPU Process][MSE] Add infrastructure needed to run MediaPlayerPrivateMediaSourceAVFObjC in the GPU process https://bugs.webkit.org/show_bug.cgi?id=218912 Reviewed by Eric Carlson. This patch makes the MSE version of MediaPlayer::load() the same as the one in MediaPlayerPrivate to support running MSE MediaPlayerPrivate(s) in the GPU process. No new tests, no functional change yet. * Headers.cmake: * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::createSourceBufferPrivate): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::appendBufferTimerFired): (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): * WebCore.xcodeproj/project.pbxproj: * platform/ContentType.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::load): (WebCore::MediaPlayer::loadWithNextMediaEngine): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: * platform/graphics/MediaSourcePrivate.h: * platform/graphics/SourceBufferPrivateClient.h: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::load): * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::appendCompleted): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::load): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::load): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: (WebCore::PlaybackPipeline::addSourceBuffer): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples): (WebCore::SourceBufferPrivateGStreamer::appendParsingFailed): * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: (WebCore::MockMediaPlayerMediaSource::load): * platform/mock/mediasource/MockMediaPlayerMediaSource.h: * platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::addSourceBuffer): * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockSourceBufferPrivate::append): 2020-11-17 Rob Buis <rbuis@igalia.com> Null check anchorNode of endingSelection start https://bugs.webkit.org/show_bug.cgi?id=218492 Reviewed by Alex Christensen. Null check anchorNode of endingSelection start. Test: editing/deleting/delete-contenteditable-crash.html * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::mergeParagraphs): 2020-11-17 Kimmo Kinnunen <kkinnunen@apple.com> Build fails on internal simulator builds due to missing enum kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange https://bugs.webkit.org/show_bug.cgi?id=219030 Reviewed by Antti Koivisto. Fix compile for simulator builds. Rename HAVE_CV_AGX_420_PIXEL_FORMAT_TYPES to HAVE_COREVIDEO_COMPRESSED_PIXEL_FORMAT_TYPES to better reflect what the ifdef does. * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp: (WebCore::pixelRangeFromPixelFormat): (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture): 2020-11-17 Claudio Saavedra <csaavedra@igalia.com> More non-unified build fixes https://bugs.webkit.org/show_bug.cgi?id=219029 Unreviewed. * rendering/RenderLayerBacking.cpp: 2020-11-17 Rob Buis <rbuis@igalia.com> Check whether destination still can be selected https://bugs.webkit.org/show_bug.cgi?id=218491 Reviewed by Ryosuke Niwa. Check whether destination still can be selected after deletion. Test: editing/deleting/delete-selection-crash.html * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): 2020-11-16 Kimmo Kinnunen <kkinnunen@apple.com> Textures Fail to Render in WebGL from HLS Stream on iPhone 12 [iOS 14.2] https://bugs.webkit.org/show_bug.cgi?id=218637 <rdar://problem/71102126> Reviewed by Eric Carlson. Patch by Jer Noble. Treat internal compressed YUV pixel formats kCVPixelFormatType_AGX_420YpCbCr8BiPlanarVideoRange and kCVPixelFormatType_AGX_420YpCbCr8BiPlanarFullRange as kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange and kCVPixelFormatType_420YpCbCr8BiPlanarFullRange when using the OpenGL shader to convert video IOSurface to a WebGL texture. Fixes cases where the decoder outputs the compressed formats. No new tests, adding more comprehensive test content suite is tracked in another bug. * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp: (WebCore::pixelRangeFromPixelFormat): (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture): 2020-11-16 Sam Weinig <weinig@apple.com> Standardize enums that are used by Settings in preperation for autogeneration https://bugs.webkit.org/show_bug.cgi?id=218960 Reviewed by Tim Horton. Move each enum type used by Settings to its own header and make them all scoped enums in preparation for using them in the generated settings code. Also converted enums used in Settings that are used as flags to use OptionSet, adding the necessary EnumTraits to make it to work. In the change, Settings still generates with getters/setters that work on the raw enum, but in subsequent changes the generation will work directly with OptionSets. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: Add new headers, adjust for renames. * Scripts/GenerateSettings.rb: Add special case for HTML prefix to keep renamed HTMLParserScriptingFlagPolicy setting using WebCore consistent capitalization. * accessibility/ForcedAccessibilityValue.h: Added. * css/FontLoadTimingOverride.h: Added. * editing/EditableLinkBehavior.h: Added. * editing/cocoa/DataDetectorTypes.h: Added. * html/parser/HTMLParserScriptingFlagPolicy.h: Added. * page/FrameFlattening.h: Added. * page/PDFImageCachingPolicy.h: Added. * page/DebugOverlayRegions.h: Added. * page/StorageBlockingPolicy.h: Added. * page/TextDirectionSubmenuInclusionBehavior.h: Added. * page/UserInterfaceDirectionPolicy.h: Added. * platform/text/FontRenderingMode.h: Added. * platform/text/TextDirection.h: Added. Add new headers. * editing/EditingBehaviorType.h: Added. * editing/EditingBehaviorTypes.h: Removed. Renamed header to match enum name. * css/CSSFontFace.cpp: (WebCore::fontLoadTimingOverride): (WebCore::CSSFontFace::fontLoadTiming const): Update uses of FontLoadTimingOverride to remove Settings scoping. * css/MediaQueryEvaluator.cpp: (WebCore::monochromeEvaluate): (WebCore::invertedColorsEvaluate): (WebCore::dynamicRangeEvaluate): (WebCore::prefersReducedMotionEvaluate): Update uses of ForcedAccessibilityValue to remove Settings scoping. * dom/Document.cpp: (WebCore::Document::applyQuickLookSandbox): Update uses of StorageBlockingPolicy to remove SecurityOrigin scoping. * editing/EditingBehavior.h: Update use of EditingBehaviorType to use scoped syntax. * editing/Editor.cpp: (WebCore::Editor::behavior const): Remove unnecessary duplication of EditingBehavior construction. * editing/cocoa/DataDetection.h: * editing/cocoa/DataDetection.mm: Switch to using OptionSet<DataDetectorTypes> rather than raw DataDetectorTypes. * editing/markup.cpp: (WebCore::createPageForSanitizingWebContent): Update for renamed setter now called setHTMLParserScriptingFlagPolicy to make it clear it is about the HTML parser. * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::setActive): (WebCore::HTMLAnchorElement::treatLinkAsLiveForEventType const): Update use of EditableLinkBehavior to use scoped syntax. * html/parser/HTMLParserOptions.cpp: (WebCore::HTMLParserOptions::HTMLParserOptions): Update for renamed setting now called HTMLParserScriptingFlagPolicy to make it clear it is about the HTML parser and no longer scoped to Settings. * loader/FrameLoader.cpp: (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Switch to using OptionSet<DataDetectorTypes> rather than raw DataDetectorTypes. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::populate): Update use of TextDirectionSubmenuInclusionBehavior to use scoped syntax. * page/DebugPageOverlays.cpp: (WebCore::DebugPageOverlays::updateOverlayRegionVisibility): (WebCore::DebugPageOverlays::settingsChanged): * page/DebugPageOverlays.h: Switch to using OptionSet<DebugOverlayRegions> rather than raw DebugOverlayRegions. * page/EventHandler.cpp: (WebCore::EventHandler::useHandCursor): Update use of EditableLinkBehavior to use scoped syntax. * page/FrameView.h: Switch to #including FrameFlattening.h since it is such a trivial include now. * page/Page.cpp: (WebCore::Page::shouldBuildEditableRegion const): Switch to using OptionSet<DebugOverlayRegions> rather than raw DebugOverlayRegions. * page/SecurityOrigin.cpp: * page/SecurityOrigin.h: Update to now include StorageBlockingPolicy.h and switch to use scoped syntax. * page/Settings.yaml: Update setting defaults to use new scoped names where appropriate and rename ParserScriptingFlagPolicy to HTMLParserScriptingFlagPolicy to make it clear which parser it is for. * page/SettingsBase.h: Replace enum definitions with #includes for the new headers. In future changes, these will be automatically included in the generated code and this won't be necessary anymore. * platform/DragImage.h: * platform/graphics/FontDescription.h: Update #includes to keep things building. * platform/graphics/cg/PDFDocumentImage.cpp: (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): * platform/graphics/cg/PDFDocumentImage.h: Update use of PDFImageCachingPolicy to use scoped syntax. * platform/text/TextFlags.h: Extract FontRenderingMode into its own header. * platform/text/WritingMode.h: Extract TextDirection into its own header. Also replace some macros with constexprs while I was here. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintDebugOverlays): (WebCore::RenderLayerBacking::paintContents): Switch to using OptionSet<DebugOverlayRegions> rather than raw DebugOverlayRegions. * testing/InternalSettings.cpp: * testing/InternalSettings.h: * testing/InternalSettings.idl: Use new enums rather than redeclaring them. Updates EditingBehaviorType to use the value "windows" rather than "win" which requires test changes as does changes to capitalization of PDFImageCachingPolicy enum values. * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::createPageForServiceWorker): (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy): * workers/service/context/ServiceWorkerThreadProxy.h: Update for extracted StorageBlockingPolicy enum. 2020-11-16 John Wilander <wilander@apple.com> PCM: Change attribute and JSON key names according to the W3C conversation https://bugs.webkit.org/show_bug.cgi?id=218967 Reviewed by Brent Fulgham. We've discussed extensively with Google and others on naming for the link attributes and JSON key names in these issues: https://github.com/privacycg/private-click-measurement/issues/30 https://github.com/privacycg/private-click-measurement/issues/56 This patch changes PCM accordingly. No new tests. Exiting tests updated. * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parsePrivateClickMeasurement const): * html/HTMLAnchorElement.idl: * html/HTMLAttributeNames.in: * loader/PrivateClickMeasurement.cpp: (WebCore::PrivateClickMeasurement::json const): 2020-11-16 Antoine Quint <graouts@webkit.org> Add an experimental <model> element https://bugs.webkit.org/show_bug.cgi?id=218991 Reviewed by Dean Jackson. Test: system-preview/model/model-element.html Add the basis for a new <model> element. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * html/HTMLModelElement.cpp: Added. (WebCore::HTMLModelElement::HTMLModelElement): (WebCore::HTMLModelElement::~HTMLModelElement): (WebCore::HTMLModelElement::create): * html/HTMLModelElement.h: Added. * html/HTMLModelElement.idl: Added. * html/HTMLTagNames.in: 2020-11-16 Alex Christensen <achristensen@webkit.org> FileReaderLoader::convertToDataURL should use application/octet-stream if MIME type is empty https://bugs.webkit.org/show_bug.cgi?id=218993 Reviewed by Geoffrey Garen. This matches Chrome and Firefox, and is covered by a web platform test. * fileapi/FileReaderLoader.cpp: (WebCore::FileReaderLoader::convertToDataURL): 2020-11-16 Megan Gardner <megan_gardner@apple.com> Speculative fix for localizableStrings.string in WebCore https://bugs.webkit.org/show_bug.cgi?id=219003 Unreviewed build fix. * WebCore.xcodeproj/project.pbxproj: 2020-11-16 Devin Rousso <drousso@apple.com> Ignore deprecation warnings for the uniform types C API https://bugs.webkit.org/show_bug.cgi?id=218989 Reviewed by Tim Horton. These should eventually be replaced with the ObjC API `UniformTypeIdentifiers.framework`. See <https://developer.apple.com/documentation/uniformtypeidentifiers>. * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::mimeTypeFromContentType): (WebCore::attachmentForFilePath): * editing/mac/EditorMac.mm: (WebCore::Editor::dataSelectionForPasteboard): * fileapi/FileCocoa.mm: (WebCore::File::shouldReplaceFile): * page/mac/DragControllerMac.mm: (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod const): * platform/cocoa/DragDataCocoa.mm: (WebCore::rtfPasteboardType): (WebCore::rtfdPasteboardType): (WebCore::stringPasteboardType): (WebCore::urlPasteboardType): (WebCore::htmlPasteboardType): (WebCore::pdfPasteboardType): (WebCore::tiffPasteboardType): (WebCore::DragData::containsCompatibleContent const): * platform/cocoa/MIMETypeRegistryCocoa.mm: (WebCore::extensionsForMIMETypeMap): * platform/cocoa/PasteboardCocoa.mm: (WebCore::cocoaTypeToImageType): (WebCore::Pasteboard::fileContentState): * platform/cocoa/PlatformPasteboardCocoa.mm: (WebCore::PlatformPasteboard::urlStringSuitableForLoading): * platform/graphics/cg/ImageBufferUtilitiesCG.cpp: (WebCore::jpegUTI): (WebCore::utiFromImageBufferMIMEType): * platform/graphics/cg/ImageSourceCGMac.mm: (WebCore::preferredExtensionForImageType): * platform/graphics/mac/ImageMac.mm: (WebCore::BitmapImage::tiffRepresentation): * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::writePlainText): (WebCore::Pasteboard::read): (WebCore::supportedImageTypes): (WebCore::isTypeAllowedByReadingPolicy): (WebCore::Pasteboard::readPasteboardWebContentDataForType): (WebCore::readURLAlongsideAttachmentIfNecessary): (WebCore::prefersAttachmentRepresentation): (WebCore::Pasteboard::supportedWebContentPasteboardTypes): (WebCore::Pasteboard::supportedFileUploadPasteboardTypes): (WebCore::utiTypeFromCocoaType): (WebCore::Pasteboard::readPlatformValuesAsStrings): (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): (WebCore::webSafeTypes): (WebCore::PlatformPasteboard::informationForItemAtIndex): (WebCore::PlatformPasteboard::stringForType const): (WebCore::PlatformPasteboard::platformPasteboardTypeForSafeTypeForDOMToReadAndWrite): (WebCore::addRepresentationsForPlainText): (WebCore::PlatformPasteboard::allowReadingURLAtIndex const): (WebCore::PlatformPasteboard::write): (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): (WebCore::createItemProviderRegistrationList): (WebCore::PlatformPasteboard::readString const): (WebCore::PlatformPasteboard::readURL const): (WebCore::PlatformPasteboard::containsURLStringSuitableForLoading): * platform/ios/WebItemProviderPasteboard.mm: (typeConformsToTypes): (-[NSItemProvider web_containsFileURLAndFileUploadContent]): (-[NSItemProvider web_fileUploadContentTypes]): (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]): (classForTypeIdentifier): (linkTemporaryItemProviderFilesToDropStagingDirectory): (-[WebItemProviderPasteboard typeIdentifiersToLoad:]): * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::write): (WebCore::Pasteboard::read): (WebCore::cocoaTypeFromHTMLClipboardType): (WebCore::utiTypeFromCocoaType): (WebCore::Pasteboard::writeString): * platform/mac/PasteboardWriter.mm: (WebCore::toUTI): (WebCore::toUTIUnlessAlreadyUTI): (WebCore::createPasteboardWriter): * platform/mac/PlatformPasteboardMac.mm: (WebCore::canWritePasteboardType): (WebCore::urlStringsFromPasteboard): (WebCore::typeIdentifierForPasteboardType): (WebCore::PlatformPasteboard::allStringsForType const): (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): (WebCore::PlatformPasteboard::setStringForType): * platform/network/ios/WebCoreURLResponseIOS.mm: (WebCore::adjustMIMETypeIfNecessary): * platform/network/mac/UTIUtilities.mm: (WebCore::MIMETypeFromUTI): (WebCore::MIMETypeFromUTITree): (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey): (WebCore::isDeclaredUTI): (WebCore::UTIFromTag): * platform/network/mac/WebCoreURLResponse.mm: (WebCore::adjustMIMETypeIfNecessary): * rendering/RenderThemeMac.mm: (WebCore::iconForAttachment): 2020-11-16 Don Olmstead <don.olmstead@sony.com> Non-unified build fixes, mid November 2020 edition https://bugs.webkit.org/show_bug.cgi?id=218911 Unreviewed build fix. * display/css/DisplayBoxFactory.h: * page/Quirks.cpp: * rendering/style/GridPosition.cpp: 2020-11-16 Megan Gardner <megan_gardner@apple.com> Add menu support for app highlights for books https://bugs.webkit.org/show_bug.cgi?id=218879 <rdar://problem/71352113> Reviewed by Alex Christensen. Add menu items and associated plubling for support for books highlights in modern webkit. * WebCore.xcodeproj/project.pbxproj: * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): (WebCore::ContextMenuController::populate): (WebCore::ContextMenuController::checkOrEnableIfNeeded const): * platform/ContextMenuItem.cpp: (WebCore::isValidContextMenuAction): * platform/ContextMenuItem.h: * platform/LocalizedStrings.h: * platform/cocoa/LocalizedStringsCocoa.mm: (WebCore::contextMenuItemTagAddHighlightToCurrentGroup): (WebCore::contextMenuItemTagAddHighlightToNewGroup): 2020-11-16 Rob Buis <rbuis@igalia.com> Add CSS aspect ratio to feature status page https://bugs.webkit.org/show_bug.cgi?id=218979 Reviewed by Simon Fraser. Add status entry for CSS aspect ratio as well as a css-sizing category for CSS properties. * css/CSSProperties.json: * features.json: 2020-11-16 Andres Gonzalez <andresg_22@apple.com> Add logging of AXCoreObject outerHTML to AXLogger. https://bugs.webkit.org/show_bug.cgi?id=218958 Reviewed by Chris Fleizach. No change in functionality, debugging code. * accessibility/AXLogger.cpp: (WebCore::operator<<): - Added logging of the outerHTML of the corresponding Element for AXCoreObjects. - Added logging of the platform wrapper address for AXCoreObjects. 2020-11-16 Antti Koivisto <antti@apple.com> [LFC][Integration] Remove isLastTextRunOnLine/isLastTextRun from run iterator https://bugs.webkit.org/show_bug.cgi?id=218978 Reviewed by Zalan Bujtas. Use the line interface instead. This both more readable and more generic. * dom/Position.cpp: (WebCore::Position::upstream const): (WebCore::Position::downstream const): * layout/integration/LayoutIntegrationLineIterator.cpp: (WebCore::LayoutIntegration::LineIterator::operator== const): Also use Variant default operator==. * layout/integration/LayoutIntegrationRunIterator.cpp: (WebCore::LayoutIntegration::RunIterator::operator== const): * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::PathTextRun::isLastTextRunOnLine const): Deleted. (WebCore::LayoutIntegration::PathTextRun::isLastTextRun const): Deleted. * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: Also use RefCountedArray instead of Vector to avoid unnecessary copies of the order cache. (WebCore::LayoutIntegration::RunIteratorLegacyPath::isLastTextRunOnLine const): Deleted. (WebCore::LayoutIntegration::RunIteratorLegacyPath::isLastTextRun const): Deleted. * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::isLastTextRunOnLine const): Deleted. (WebCore::LayoutIntegration::RunIteratorModernPath::isLastTextRun const): Deleted. 2020-11-16 Kimmo Kinnunen <kkinnunen@apple.com> Final refactor for WebGL implementation to use only GraphicsContextGL https://bugs.webkit.org/show_bug.cgi?id=218333 Reviewed by Simon Fraser. Change WebGL implementation to use GraphicsContextGL abstract class instead of GraphicsContextGLOpenGL concrete class. This allows implementation of WebGL in GpuProcess, where the remote implementation is one GraphicsContextGL subclass and the actual drawing is done, either in GPUP and non-GPUP cases by the old GraphicsContextGLOpenGL. The GPUP supports only ANGLE flavor of the WebGL implementation. This is because ANGLE contains the functions that are designed to be more secure for the cross-process environment. This is why GraphicsContextGL interface is modified to contain only functions that make sense for ANGLE. Functions unimplemeted by ANGLE are removed from the interface. Calling WebGL code inside #ifdef !USE(ANGLE) will downcast the interface to GraphicsContextGLOpenGL to call the functions that do not make sense to exist in the ANGLE version. Small amount of functions in GraphicsContextGL interface are re-ordered to enable later IPC auto-generation from the interface. ExtensionsGL.h is reformatted according to WebKit style to enable later IPC auto-generation from the interface. No new tests, a refactor. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::rendererIsNeeded): (WebCore::HTMLVideoElement::parseAttribute): (WebCore::HTMLVideoElement::supportsFullscreen const): (WebCore::HTMLVideoElement::paintCurrentFrameInContext): (WebCore::HTMLVideoElement::copyVideoTextureToPlatformTexture): (WebCore::HTMLVideoElement::hasAvailableVideoFrame const): (WebCore::HTMLVideoElement::webkitEnterFullscreen): * html/HTMLVideoElement.h: * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::create): (WebCore::WebGL2RenderingContext::WebGL2RenderingContext): (WebCore::WebGL2RenderingContext::getBufferSubData): (WebCore::WebGL2RenderingContext::vertexAttribI4uiv): (WebCore::WebGL2RenderingContext::bindSampler): (WebCore::WebGL2RenderingContext::clientWaitSync): (WebCore::WebGL2RenderingContext::deleteTransformFeedback): (WebCore::WebGL2RenderingContext::beginTransformFeedback): (WebCore::WebGL2RenderingContext::endTransformFeedback): (WebCore::WebGL2RenderingContext::transformFeedbackVaryings): (WebCore::WebGL2RenderingContext::getActiveUniforms): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLActiveInfo.h: * html/canvas/WebGLBuffer.cpp: (WebCore::WebGLBuffer::deleteObjectImpl): * html/canvas/WebGLBuffer.h: * html/canvas/WebGLContextGroup.cpp: (WebCore::WebGLContextGroup::getAGraphicsContextGL): * html/canvas/WebGLContextGroup.h: * html/canvas/WebGLContextObject.cpp: (WebCore::WebGLContextObject::getAGraphicsContextGL const): * html/canvas/WebGLContextObject.h: * html/canvas/WebGLDepthTexture.cpp: (WebCore::WebGLDepthTexture::supported): * html/canvas/WebGLDepthTexture.h: * html/canvas/WebGLDrawBuffers.cpp: (WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements): * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::onAccess): (WebCore::WebGLFramebuffer::deleteObjectImpl): (WebCore::WebGLFramebuffer::initializeAttachments): * html/canvas/WebGLFramebuffer.h: * html/canvas/WebGLObject.cpp: (WebCore::WebGLObject::deleteObject): * html/canvas/WebGLObject.h: * html/canvas/WebGLProgram.cpp: (WebCore::WebGLProgram::deleteObjectImpl): (WebCore::WebGLProgram::cacheActiveAttribLocations): (WebCore::WebGLProgram::cacheInfoIfNeeded): * html/canvas/WebGLProgram.h: * html/canvas/WebGLQuery.cpp: (WebCore::WebGLQuery::deleteObjectImpl): * html/canvas/WebGLQuery.h: * html/canvas/WebGLRenderbuffer.cpp: (WebCore::WebGLRenderbuffer::deleteObjectImpl): * html/canvas/WebGLRenderbuffer.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::create): (WebCore::WebGLRenderingContext::WebGLRenderingContext): * html/canvas/WebGLRenderingContext.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::isHighPerformanceContext): (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): (WebCore::WebGLRenderingContextBase::initializeNewContext): (WebCore::WebGLRenderingContextBase::compressedTexImage2D): (WebCore::WebGLRenderingContextBase::validateElementArraySize): (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise): (WebCore::WebGLRenderingContextBase::validateDrawElements): (WebCore::WebGLRenderingContextBase::readPixels): (WebCore::WebGLRenderingContextBase::texImageSourceHelper): (WebCore::WebGLRenderingContextBase::texImage2DBase): (WebCore::WebGLRenderingContextBase::validateTexFuncFormatAndType): (WebCore::WebGLRenderingContextBase::copyTexImage2D): (WebCore::WebGLRenderingContextBase::isTexInternalFormatColorBufferCombinationValid): (WebCore::WebGLRenderingContextBase::vertexAttribfvImpl): (WebCore::WebGLRenderingContextBase::initVertexAttrib0): (WebCore::WebGLRenderingContextBase::maybeRestoreContext): (WebCore::WebGLRenderingContextBase::drawElementsInstanced): * html/canvas/WebGLRenderingContextBase.h: (WebCore::WebGLRenderingContextBase::graphicsContextGL const): * html/canvas/WebGLSampler.cpp: (WebCore::WebGLSampler::deleteObjectImpl): * html/canvas/WebGLSampler.h: * html/canvas/WebGLShader.cpp: (WebCore::WebGLShader::deleteObjectImpl): * html/canvas/WebGLShader.h: * html/canvas/WebGLShaderPrecisionFormat.h: * html/canvas/WebGLSharedObject.cpp: (WebCore::WebGLSharedObject::getAGraphicsContextGL const): * html/canvas/WebGLSharedObject.h: * html/canvas/WebGLSync.cpp: (WebCore::WebGLSync::deleteObjectImpl): * html/canvas/WebGLSync.h: * html/canvas/WebGLTexture.cpp: (WebCore::WebGLTexture::deleteObjectImpl): * html/canvas/WebGLTexture.h: * html/canvas/WebGLTransformFeedback.cpp: (WebCore::WebGLTransformFeedback::deleteObjectImpl): * html/canvas/WebGLTransformFeedback.h: * html/canvas/WebGLVertexArrayObject.cpp: (WebCore::WebGLVertexArrayObject::deleteObjectImpl): * html/canvas/WebGLVertexArrayObject.h: * html/canvas/WebGLVertexArrayObjectBase.h: * html/canvas/WebGLVertexArrayObjectOES.cpp: (WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl): * html/canvas/WebGLVertexArrayObjectOES.h: * inspector/InspectorShaderProgram.cpp: * platform/graphics/ConcreteImageBuffer.h: * platform/graphics/ExtensionsGL.h: * platform/graphics/FormatConverter.cpp: (WebCore::FormatConverter::convert): * platform/graphics/FormatConverter.h: * platform/graphics/GraphicsContext.h: * platform/graphics/GraphicsContextGL.cpp: * platform/graphics/GraphicsContextGL.h: (WebCore::GraphicsContextGL::contextAttributes const): (WebCore::GraphicsContextGL::setContextAttributes): * platform/graphics/GraphicsTypesGL.h: * platform/graphics/ImageBuffer.h: * platform/graphics/ImageBufferBackend.h: (WebCore::ImageBufferBackend::copyToPlatformTexture const): * platform/graphics/MediaPlayer.cpp: (WebCore::bestMediaEngineForSupportParameters): (WebCore::MediaPlayer::nextMediaEngine): (WebCore::MediaPlayer::loadWithNextMediaEngine): (WebCore::MediaPlayer::cancelLoad): (WebCore::MediaPlayer::setSize): (WebCore::MediaPlayer::copyVideoTextureToPlatformTexture): (WebCore::MediaPlayer::supportsType): (WebCore::MediaPlayer::getSupportedTypes): (WebCore::MediaPlayer::languageOfPrimaryAudioTrack const): (WebCore::MediaPlayer::fileSize const): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::hasClosedCaptions const): (WebCore::MediaPlayerPrivateInterface::copyVideoTextureToPlatformTexture): * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::compressedTexImage2DRobustANGLE): (WebCore::ExtensionsGLANGLE::compressedTexSubImage2DRobustANGLE): * platform/graphics/angle/ExtensionsGLANGLE.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache): (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity): (WebCore::MediaPlayerPrivateAVFoundationObjC::accessLog const): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformSetVisible): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration const): (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable const): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded const): (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus const): (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity): (WebCore::determineChangedTracksFromNewTracksAndOldItems): (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions): (WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues): (WebCore::MediaPlayerPrivateAVFoundationObjC::setBufferingPolicy): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): * platform/graphics/cocoa/IOSurface.mm: (WebCore::optionsForBiplanarSurface): (WebCore::IOSurface::ensurePlatformContext): (WebCore::IOSurface::convertToFormat): * platform/graphics/egl/GLContextEGL.cpp: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::copyVideoTextureToPlatformTexture): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: (WebCore::GraphicsContextGLOpenGL::possibleFormatAndTypeForInternalFormat): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::reshape): (WebCore::GraphicsContextGLOpenGL::blendFunc): (WebCore::GraphicsContextGLOpenGL::compileShader): (WebCore::GraphicsContextGLOpenGL::getActiveAttribImpl): (WebCore::GraphicsContextGLOpenGL::getActiveAttrib): (WebCore::GraphicsContextGLOpenGL::getActiveUniformImpl): (WebCore::GraphicsContextGLOpenGL::getActiveUniform): (WebCore::GraphicsContextGLOpenGL::originalSymbolName): (WebCore::GraphicsContextGLOpenGL::mappedSymbolName): (WebCore::GraphicsContextGLOpenGL::deleteVertexArray): (WebCore::GraphicsContextGLOpenGL::isVertexArray): (WebCore::GraphicsContextGLOpenGL::getNonBuiltInActiveSymbolCount): (WebCore::GraphicsContextGLOpenGL::getUnmangledInfoLog): (WebCore::GraphicsContextGLOpenGL::getProgramInfoLog): (WebCore::GraphicsContextGLOpenGL::getShaderiv): (WebCore::GraphicsContextGLOpenGL::getShaderInfoLog): (WebCore::GraphicsContextGLOpenGL::getShaderSource): 2020-11-16 Philippe Normand <pnormand@igalia.com> [GStreamer] Clean-up Audio{Data,StreamDescription} implementations https://bugs.webkit.org/show_bug.cgi?id=218957 Reviewed by Xabier Rodriguez-Calvar. Refactor the GStreamerAudioData and GStreamerStreamDescription implementations in order to avoid un-necessary copies. The call-sites were adapted accordingly. Some usage of the latter class was removed because it was simpler to use the GstAudioInfo API directly. * Modules/webaudio/MediaStreamAudioSourceGStreamer.cpp: (WebCore::MediaStreamAudioSource::consumeAudio): * platform/audio/gstreamer/GStreamerAudioData.h: * platform/audio/gstreamer/GStreamerAudioStreamDescription.h: * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp: (WebCore::GStreamerAudioCaptureSource::newSampleCallback): * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (webkitMediaStreamSrcPushAudioSample): * platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp: (WebCore::MockRealtimeAudioSourceGStreamer::render): * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeIncomingAudioSourceLibWebRTC::OnData): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::libwebrtcAudioFormat): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: 2020-11-16 Andres Gonzalez <andresg_22@apple.com> Optimization for AccessibilityNodeObject::accessibilityDescription. https://bugs.webkit.org/show_bug.cgi?id=218959 Reviewed by Darin Adler. No change in functionality, optimization. AccessibilityObject::title() can be an expensive operations because it can invoke textUnderElement which causes text extraction for all descendants of the object. Thus, rewrote this snippet in a more efficient way. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::accessibilityDescription const): 2020-11-16 Youenn Fablet <youenn@apple.com> TextEncoderStreamEncoder should not be exposed https://bugs.webkit.org/show_bug.cgi?id=218956 Reviewed by Yusuke Suzuki. Binding generator correctly handles private identifiers and runtime settings, but not when combined for interfaces. Test: fast/encoding/stream-visibility.html * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::JSTestEnabledBySettingDOMConstructor::prototypeForStructure): (WebCore::JSTestEnabledBySetting::finishCreation): (WebCore::jsTestEnabledBySetting_TestSubObjEnabledBySettingPrivateConstructorGetter): (WebCore::JSC_DEFINE_CUSTOM_GETTER): (WebCore::setJSTestEnabledBySetting_TestSubObjEnabledBySettingPrivateConstructorSetter): (WebCore::JSC_DEFINE_CUSTOM_SETTER): (WebCore::jsTestEnabledBySetting_TestSubObjEnabledBySettingPrivatePublicConstructorGetter): (WebCore::setJSTestEnabledBySetting_TestSubObjEnabledBySettingPrivatePublicConstructorSetter): * bindings/scripts/test/TestEnabledBySetting.idl: 2020-11-16 Devin Rousso <drousso@apple.com> [iPad] nhl.com cannot select new video to play while video is playing with desktop UA https://bugs.webkit.org/show_bug.cgi?id=218868 <rdar://problem/67823088> Reviewed by Antoine Quint. The desktop "version" of this site uses custom media controls that don't work well on iOS because they rely on mouse events (which is why it was quirked in r255592). The mobile "version" uses the default/native media controls, so there is no issue. Currently, when tapping on another video with a desktop UA, the site uses its touch event handlers for mouse events. These handlers call `Event.prototype.preventDefault` if the event is not a touch event, meaning that `"click"` is not fired. This prevents new videos from being played. Rather than limit the quirk based on some DOM state (which is fragile if the site changes), just have the entire site default to a mobile UA. * page/Quirks.cpp: (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const): 2020-11-16 Zan Dobersek <zdobersek@igalia.com> PlatformDisplayLibWPE: use eglGetPlatformDisplay when possible https://bugs.webkit.org/show_bug.cgi?id=218941 Reviewed by Carlos Garcia Campos. Use the existing wpe_renderer_backend_egl API to detect any desired EGL platform that should be used to retrieve the global EGLDisplay object. If such a platform is specified, the eglGetPlatformDisplay entrypoing from the EGL_EXT_platform_base extension should be used to retrieve the corresponding EGLDisplay. If the API or the extension is not available, or if the EGLDisplay is not retrieved this way, we fall back to eglGetDisplay. * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp: (WebCore::PlatformDisplayLibWPE::initialize): 2020-11-10 Sergio Villar Senin <svillar@igalia.com> [css-flex] Better naming from some methods https://bugs.webkit.org/show_bug.cgi?id=218745 Reviewed by Javier Fernandez. This patch improves the naming of several confusing methods. * hasOrthogonalFlow(): was too generic. It was basically checking that the flexbox container main size was not the child's inline size. So we renamed it to mainAxisIsChildInlineAxis() reverting the output. For most of the cases it was enough to negate the output of the method to have the same check, but in other cases we decided to swap the if-else blocks as it was more convenient. * {main|cross}AxisLengthIsDefinite(): the name was misleading because you don't know whether the method is evaluating the child's length or the container's (the flexbox). Replaced by child{Main|Cross}SizeIsDefinite(). * setOverrideMainAxisContentSizeForChild(): this had 2 problems. First it should use overriding instead of override. Second the size which is overriden is not the content size, it used to be but not anymore. No new tests as there is no change in functionality. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::firstLineBaseline const): (WebCore::RenderFlexibleBox::mainAxisIsChildInlineAxis const): Renamed from hasOrthogonalFlow(). Also the behaviour is now reversed from the original function. (WebCore::RenderFlexibleBox::childIntrinsicLogicalHeight const): (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth const): (WebCore::RenderFlexibleBox::crossAxisIntrinsicExtentForChild const): (WebCore::RenderFlexibleBox::mainAxisContentExtent): Early return instead of if-else block. (WebCore::RenderFlexibleBox::useChildAspectRatio const): (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing const): Use a single line for division operators. (WebCore::RenderFlexibleBox::childMainSizeIsDefinite const): Renamed from mainAxisLengthIsDefinite. (WebCore::RenderFlexibleBox::childCrossSizeIsDefinite const): Renamed from crossAxisLengthIsDefinite. (WebCore::RenderFlexibleBox::cacheChildMainSize): (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild): (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax): (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution): (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): (WebCore::RenderFlexibleBox::childLogicalHeightForPercentageResolution): (WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax): (WebCore::RenderFlexibleBox::setOverridingMainSizeForChild): Renamed from setOverrideMainAxisContentSizeForChild. (WebCore::RenderFlexibleBox::alignmentForChild const): (WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize const): (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): (WebCore::RenderFlexibleBox::hasOrthogonalFlow const): Deleted. (WebCore::RenderFlexibleBox::mainAxisLengthIsDefinite const): Deleted. (WebCore::RenderFlexibleBox::crossAxisLengthIsDefinite const): Deleted. (WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild): Deleted. * rendering/RenderFlexibleBox.h: 2020-11-16 Philippe Normand <pnormand@igalia.com> [GStreamer] Switch the ImageDecoder to decodebin3 https://bugs.webkit.org/show_bug.cgi?id=218246 Reviewed by Xabier Rodriguez-Calvar. Rely on the decodebin3 select-stream to ensure that at most one video stream is selected for decoding. Thus we don't need to plug a fakesink to streams we don't need anymore. * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::InnerDecoder::decodebinSelectStreamCallback): (WebCore::ImageDecoderGStreamer::InnerDecoder::selectStream): (WebCore::ImageDecoderGStreamer::InnerDecoder::connectDecoderPad): (WebCore::ImageDecoderGStreamer::InnerDecoder::preparePipeline): * platform/graphics/gstreamer/ImageDecoderGStreamer.h: 2020-11-16 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo][GraphicsLayerTextureMapper] Support rounded rect clipping for backdrop-filter https://bugs.webkit.org/show_bug.cgi?id=218962 Reviewed by Carlos Garcia Campos. r269772 (Bug 215445) added rounded rect clipping support for backdrop-filter for TextureMapper and CoordinatedGraphics. Add the feature to GraphicsLayerTextureMapper. Existing tests cover this change: css3/filters/backdrop/backdrop-filter-uneven-corner-radii.html css3/filters/backdrop/backdrop-filter-with-border-radius-value-change.html css3/filters/backdrop/backdrop-filter-with-border-radius * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayerTextureMapper::commitLayerChanges): Call setBackdropFiltersRect. 2020-11-16 Fujii Hironori <Hironori.Fujii@sony.com> [TextureMapper] The edges of blur backdrop-filter look gradient tranparent https://bugs.webkit.org/show_bug.cgi?id=218645 <rdar://problem/71356999> Reviewed by Carlos Garcia Campos. The blur backdrop-filter needs a larger input image than an output image. However, it's not easy to get a larger input image in the edges of the windows. Cocoa port is doing extrapolation by duplicating edges pixels of the input image which has the same size with the output image (Bug 146215). Take the same approach. * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeOverlapRegions): Don't inflate the local bounding rect by the outsets for backdrop layers. * platform/graphics/texmap/TextureMapperShaderProgram.cpp: (sampleColorAtRadius): Don't clamp 'coord'. 2020-11-15 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Disable modern line layout for fieldset children. https://bugs.webkit.org/show_bug.cgi?id=218963 Reviewed by Sam Weinig. Fieldsets don't follow the standard CSS box model. They require special handling. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForChild): 2020-11-15 Simon Fraser <simon.fraser@apple.com> Minor RenderStyle boxShadow cleanup https://bugs.webkit.org/show_bug.cgi?id=218952 Reviewed by Sam Weinig. Rename getBoxShadowExtent() to boxShadowExtent() and have it return a LayoutBoxExtent. Make shadow-related functions static that can be, and private that can be. * rendering/RenderBox.cpp: (WebCore::RenderBox::applyVisualEffectOverflow const): * rendering/RenderElement.cpp: (WebCore::RenderElement::repaintAfterLayoutIfNeeded): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::shadowExtent): (WebCore::RenderStyle::shadowInsetExtent): (WebCore::RenderStyle::getShadowHorizontalExtent): (WebCore::RenderStyle::getShadowVerticalExtent): (WebCore::RenderStyle::getShadowExtent const): Deleted. (WebCore::RenderStyle::getShadowInsetExtent const): Deleted. (WebCore::RenderStyle::getShadowHorizontalExtent const): Deleted. (WebCore::RenderStyle::getShadowVerticalExtent const): Deleted. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::boxShadowExtent const): (WebCore::RenderStyle::boxShadowInsetExtent const): (WebCore::RenderStyle::getBoxShadowExtent const): Deleted. (WebCore::RenderStyle::getBoxShadowInsetExtent const): Deleted. 2020-11-15 Andres Gonzalez <andresg_22@apple.com> Fix for infinite recursion crash in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=218961 Reviewed by Chris Fleizach. Covered by existing tests. [WebAccessibilityObjectWrapper attachmentView] can cause the initialization of a new AXIsolatedObject which in turn can invoke indirectly AccessibilityObject::accessibilityIgnoreAttachment, thus creating an infinite recursion. This change avoids this problem and makes this method more efficient even in those cases where there was no infinite recursion. * accessibility/mac/AccessibilityObjectMac.mm: (WebCore::AccessibilityObject::accessibilityIgnoreAttachment const): 2020-11-15 Youenn Fablet <youenn@apple.com> Add a WebRTC SFrame transform https://bugs.webkit.org/show_bug.cgi?id=218752 Reviewed by Eric Carlson. Introduce a RTCRtpSFrameTransform that implements the SFrame format. RTCRtpSFrameTransform is a RTCRtpTransform that can be set to RTCRtp sender and receiver objects. API supports setting encryption key. Minor refactoring to reuse WebCrypto routines for encryption/decryption. Test: webrtc/audio-sframe.html * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/mediastream/RTCRtpSFrameTransform.cpp: Added. (WebCore::RTCRtpSFrameTransform::RTCRtpSFrameTransform): (WebCore::RTCRtpSFrameTransform::~RTCRtpSFrameTransform): (WebCore::RTCRtpSFrameTransform::setEncryptionKey): (WebCore::RTCRtpSFrameTransform::initializeTransformer): (WebCore::RTCRtpSFrameTransform::initializeBackendForReceiver): (WebCore::RTCRtpSFrameTransform::initializeBackendForSender): (WebCore::RTCRtpSFrameTransform::willClearBackend): * Modules/mediastream/RTCRtpSFrameTransform.h: Added. * Modules/mediastream/RTCRtpSFrameTransform.idl: Added. * Modules/mediastream/RTCRtpSFrameTransformer.cpp: Added. (WebCore::writeUInt64): (WebCore::lengthOfUInt64): (WebCore::computeFirstHeaderByte): (WebCore::computeIV): (WebCore::parseSFrameHeader): (WebCore::RTCRtpSFrameTransformer::create): (WebCore::RTCRtpSFrameTransformer::RTCRtpSFrameTransformer): (WebCore::RTCRtpSFrameTransformer::~RTCRtpSFrameTransformer): (WebCore::RTCRtpSFrameTransformer::setEncryptionKey): (WebCore::RTCRtpSFrameTransformer::decryptFrame): (WebCore::RTCRtpSFrameTransformer::encryptFrame): (WebCore::RTCRtpSFrameTransformer::transform): (WebCore::RTCRtpSFrameTransformer::computeSaltKey): (WebCore::RTCRtpSFrameTransformer::computeAuthenticationKey): (WebCore::RTCRtpSFrameTransformer::computeEncryptionKey): (WebCore::RTCRtpSFrameTransformer::decryptData): (WebCore::RTCRtpSFrameTransformer::encryptData): (WebCore::RTCRtpSFrameTransformer::computeEncryptedDataSignature): * Modules/mediastream/RTCRtpSFrameTransformer.h: Added. (WebCore::RTCRtpSFrameTransformer::setIsSending): (WebCore::RTCRtpSFrameTransformer::setIsProcessingAudio): * Modules/mediastream/RTCRtpSFrameTransformerCocoa.cpp: Added. (WebCore::deriveHDKFSHA256Bits): (WebCore::transformAES_CTR): (WebCore::RTCRtpSFrameTransformer::computeSaltKey): (WebCore::RTCRtpSFrameTransformer::computeAuthenticationKey): (WebCore::RTCRtpSFrameTransformer::computeEncryptionKey): (WebCore::RTCRtpSFrameTransformer::decryptData): (WebCore::RTCRtpSFrameTransformer::encryptData): (WebCore::RTCRtpSFrameTransformer::computeEncryptedDataSignature): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * WebCore.xcodeproj/project.pbxproj: * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp: (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt): (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt): (WebCore::transformAES_CTR): Deleted. * crypto/mac/CryptoAlgorithmHKDFMac.cpp: (WebCore::CryptoAlgorithmHKDF::platformDeriveBits): * crypto/mac/CryptoUtilitiesCocoa.cpp: Added. (WebCore::transformAES_CTR): (WebCore::deriveHDKFSHA256Bits): * crypto/mac/CryptoUtilitiesCocoa.h: Added. * bindings/js/WebCoreBuiltinNames.h: 2020-11-15 Youenn Fablet <youenn@apple.com> AudioSampleDataSource::pullSamplesInternal does not need to pass its sampleCount parameter as in/out https://bugs.webkit.org/show_bug.cgi?id=218899 Reviewed by Eric Carlson. pullSamplesInternal sets sampleCount to zero in some cases where pullSamplesInternal returns false. pullSamplesInternal callers do not use the sampleCount parameter if pullSamplesInternal returns false. Pass sampleCount by value to clarify the behavior and remove setting sampleCount to zero in pullSamplesInternal return false case. No change of behavior. * platform/audio/cocoa/AudioSampleDataSource.h: * platform/audio/cocoa/AudioSampleDataSource.mm: (WebCore::AudioSampleDataSource::pullSamplesInternal): 2020-11-15 Zalan Bujtas <zalan@apple.com> "Typo" in r269821 (by std::numeric_limits<>::min I really meant std::numeric_limits<>::lowest (got tricked by the floating-point type behavior)) Unreviewed. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::computeLineBoxHeightAndalignInlineLevelBoxesVertically): 2020-11-15 Philippe Normand <pnormand@igalia.com> [GStreamer] WebAudio to MediaStream support https://bugs.webkit.org/show_bug.cgi?id=218335 Reviewed by Xabier Rodriguez-Calvar. Provide audio samples coming from the WebAudio bus to the MediaStreamAudioSource node, using GStreamer. This patch also moves a couple files from platform/mediastream to platform/audio, because this is where the virtual parent classes are defined. * Modules/webaudio/MediaStreamAudioSource.cpp: * Modules/webaudio/MediaStreamAudioSource.h: * Modules/webaudio/MediaStreamAudioSourceGStreamer.cpp: Added. (WebCore::copyBusData): (WebCore::MediaStreamAudioSource::consumeAudio): * platform/GStreamer.cmake: * platform/audio/gstreamer/GStreamerAudioData.h: Renamed from Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioData.h. (isType): * platform/audio/gstreamer/GStreamerAudioStreamDescription.h: Renamed from Source/WebCore/platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h. * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): 2020-11-15 Zalan Bujtas <zalan@apple.com> [LFC] Do not use RenderStyle's logical margin API https://bugs.webkit.org/show_bug.cgi?id=218948 Reviewed by Antti Koivisto. https://www.w3.org/TR/css-writing-modes-4/#logical-direction-layout "Flow-relative directions are calculated with respect to the writing mode of the containing block of the box and used to abstract layout rules related to the box properties (margins, borders, padding) and any properties related to positioning the box within its containing block (float, clear, top, bottom, left, right, caption-side). For inline-level boxes, the writing mode of the parent box is used instead." RenderStyle::marginStart/End/Before/After flips these values based on the box's own writing mode. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::usedWritingMode): (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin const): (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin const): 2020-11-15 Zalan Bujtas <zalan@apple.com> [LFC][Geometry] Add support for horizontal/vertical scrollbar spacing https://bugs.webkit.org/show_bug.cgi?id=218950 Reviewed by Antti Koivisto. Let's make room for visible scrollbars between the border and the padding box. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions): * layout/layouttree/LayoutBoxGeometry.cpp: (WebCore::Layout::BoxGeometry::BoxGeometry): (WebCore::Layout::BoxGeometry::paddingBox const): * layout/layouttree/LayoutBoxGeometry.h: (WebCore::Layout::BoxGeometry::borderBoxHeight const): (WebCore::Layout::BoxGeometry::borderBoxWidth const): (WebCore::Layout::BoxGeometry::verticalScrollbarWidth const): (WebCore::Layout::BoxGeometry::horizontalScrollbarHeight const): (WebCore::Layout::BoxGeometry::setVerticalScrollbarWidth): (WebCore::Layout::BoxGeometry::setHorizontalScrollbarHeight): 2020-11-15 Tim Horton <timothy_horton@apple.com> Initial implementation of DOM rendering via the GPU process https://bugs.webkit.org/show_bug.cgi?id=218928 Reviewed by Simon Fraser. No new tests; will be covered by all existing DOM rendering tests in GPU process mode. * WebCore.xcodeproj/project.pbxproj: * platform/graphics/ConcreteImageBuffer.h: * platform/graphics/ImageBuffer.h: * platform/graphics/ImageBufferBackend.h: (WebCore::ImageBufferBackend::isInUse const): (WebCore::ImageBufferBackend::releaseGraphicsContext): (WebCore::ImageBufferBackend::setVolatile): (WebCore::ImageBufferBackend::releaseBufferToPool): (WebCore::ImageBufferBackend::createFlusher): * platform/graphics/cg/IOSurfacePool.cpp: (WebCore::IOSurfacePool::takeSurface): (WebCore::IOSurfacePool::markOlderSurfacesPurgeable): * platform/graphics/cg/ImageBufferCGBackend.cpp: (WebCore::ThreadSafeImageBufferFlusherCG::ThreadSafeImageBufferFlusherCG): (WebCore::ImageBufferCGBackend::contextColorSpace): (WebCore::ImageBufferCGBackend::setupContext const): (WebCore::ImageBufferCGBackend::createFlusher): (WebCore::ImageBufferCGBackend::setupContext): Deleted. * platform/graphics/cg/ImageBufferCGBackend.h: * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: (WebCore::ImageBufferIOSurfaceBackend::context const): (WebCore::ImageBufferIOSurfaceBackend::isInUse const): (WebCore::ImageBufferIOSurfaceBackend::releaseGraphicsContext): (WebCore::ImageBufferIOSurfaceBackend::setVolatile): (WebCore::ImageBufferIOSurfaceBackend::releaseBufferToPool): * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: Add isInUse, setVolatile, and releaseGraphicsContext to ImageBuffer, to manage volatile surfaces; they're only implemented for in-process IOSurface right now, in order to keep RemoteLayerBackingStore working after transitioning it to ImageBuffer. A future patch will determine how to implement this mechanism for remote IOSurfaces. Add createFlusher to ImageBuffer, which returns an object that can be tossed to a background queue, and has one method: flush(), which blocks until the ImageBuffer's oustanding painting is flushed. This is currently implemented for CG just by calling CGContextFlush. This is used to abstract out RemoteLayerBackingStore's background-thread flush of all surfaces. * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: (WebCore::IOSurface::state const): (WebCore::IOSurface::setVolatile): (WebCore::operator<<): (WebCore::IOSurface::setIsVolatile): Deleted. Make use of VolatilityState instead of SurfaceState. 2020-11-15 Julian Gonzalez <julian_a_gonzalez@apple.com> Font::platformBoundsForGlyph() should provide a boundingRect pointer to CTFontGetBoundingRectsForGlyphs() https://bugs.webkit.org/show_bug.cgi?id=218812 Reviewed by Ryosuke Niwa. Provide a zero CGRect boundingRect pointer in two places where the count argument to CTFontGetBoundingRectsForGlyphs() is already 1. No new tests, no behavior changes. * platform/graphics/coretext/FontCoreText.cpp: (WebCore::Font::platformBoundsForGlyph const): (WebCore::Font::isProbablyOnlyUsedToRenderIcons const): 2020-11-14 Simon Fraser <simon.fraser@apple.com> [LFC Display] Implement propagation background style from body to root https://bugs.webkit.org/show_bug.cgi?id=218947 Reviewed by Zalan Bujtas. The root display box needs to get its background style from the document element box, if it has one, otherwise the body box. If the body background style is propagated to the root, then the body box needs to not paint its background. Implement by adding BoxFactory::determineRootBackgroundPropagation(), and consulting the result when creating the display boxes for the root and body. This is complicated slightly by the need to pass the correct style to constructBoxDecorationData(), which deals with both backgrounds and other (non-propagating) properties. * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::build): (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const): (WebCore::Display::TreeBuilder::build const): Deleted. * display/DisplayTreeBuilder.h: * display/css/DisplayBoxFactory.cpp: (WebCore::Display::BoxFactory::determineRootBackgroundPropagation): (WebCore::Display::BoxFactory::displayBoxForRootBox const): (WebCore::Display::BoxFactory::displayBoxForBodyBox const): (WebCore::Display::BoxFactory::displayBoxForLayoutBox const): (WebCore::Display::BoxFactory::constructBoxDecorationData const): (WebCore::Display::BoxFactory::setupBoxModelBox const): (WebCore::Display::BoxFactory::documentElementBoxFromRootBox): (WebCore::Display::BoxFactory::bodyBoxFromRootBox): * display/css/DisplayBoxFactory.h: * display/css/DisplayFillLayerImageGeometry.cpp: (WebCore::Display::calculateFillLayerImageGeometry): * display/css/DisplayFillLayerImageGeometry.h: * display/css/DisplayStyle.cpp: (WebCore::Display::Style::Style): (WebCore::Display::Style::setupBackground): * display/css/DisplayStyle.h: 2020-11-14 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Negative margin before (>border box height value) completely pulls the inline level box out of the line box https://bugs.webkit.org/show_bug.cgi?id=218945 Reviewed by Antti Koivisto. maximumTopOffsetFromRootInlineBoxBaseline could very well be negative e.g <div><div style="display: inline-block; height: 10px; margin-top: -20px"></div></div>. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::computeLineBoxHeightAndalignInlineLevelBoxesVertically): 2020-11-14 Rob Buis <rbuis@igalia.com> Remove -webkit-aspect-ratio support https://bugs.webkit.org/show_bug.cgi?id=218384 Reviewed by Simon Fraser. Remove -webkit-aspect-ratio support since it is superseded by aspect-ratio (https://www.w3.org/TR/css-sizing-4/). * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/StyleProperties.cpp: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): (WebCore::consumeWebkitAspectRatio): Deleted. * layout/layouttree/LayoutReplacedBox.cpp: (WebCore::Layout::ReplacedBox::hasAspectRatio const): * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::layout): (WebCore::RenderReplaced::setNeedsLayoutIfNeededAfterIntrinsicSizeChange): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::aspectRatioType const): (WebCore::RenderStyle::setAspectRatioType): (WebCore::RenderStyle::initialAspectRatioType): (WebCore::RenderStyle::aspectRatioDenominator const): Deleted. (WebCore::RenderStyle::aspectRatioNumerator const): Deleted. (WebCore::RenderStyle::setAspectRatioDenominator): Deleted. (WebCore::RenderStyle::setAspectRatioNumerator): Deleted. (WebCore::RenderStyle::initialAspectRatioDenominator): Deleted. (WebCore::RenderStyle::initialAspectRatioNumerator): Deleted. * rendering/style/RenderStyleConstants.cpp: (WebCore::operator<<): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyInitialWebkitAspectRatio): Deleted. (WebCore::Style::BuilderCustom::applyInheritWebkitAspectRatio): Deleted. (WebCore::Style::BuilderCustom::applyValueWebkitAspectRatio): Deleted. 2020-11-14 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Use the physical size when setting the pre-computed width/height on ReplacedBox https://bugs.webkit.org/show_bug.cgi?id=218915 Reviewed by Antti Koivisto. This is where the logical vs. physical coordinate flip happens on the integration level. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::updateReplacedDimensions): (WebCore::LayoutIntegration::LineLayout::updateInlineBlockDimensions): * layout/integration/LayoutIntegrationLineLayout.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutModernLines): 2020-11-14 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Display runs generated by boxes should have border box geometries https://bugs.webkit.org/show_bug.cgi?id=218932 Reviewed by Antti Koivisto. Layout::Runs/InlineBoxes have margin box geometries, but the Display::Runs should preserve border box instead. This is mostly interesting in the context of negative vertical margins where such margin values could make the run "empty". * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): 2020-11-14 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Inline level box with negative vertical margin should not be considered empty https://bugs.webkit.org/show_bug.cgi?id=218933 Reviewed by Antti Koivisto. While in practice when the negative vertical margin makes the layout bounds empty (e.g: height: 100px; margin-top: -100px;), and the inline level box contributes 0px to the line box height, it should not be considered empty. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): 2020-11-13 Antoine Quint <graouts@webkit.org> Support animations on more pseudo-elements https://bugs.webkit.org/show_bug.cgi?id=218792 <rdar://problem/71274485> Reviewed by Antti Koivisto. We used to only support animations for pseudo-elements that were represented by PseudoElement (::before and ::after). With this patch, we can now animate any public pseudo-element, such as ::marker. * animation/KeyframeEffect.cpp: (WebCore::elementOrPseudoElementForStyleable): For pseudo-elements other than ::before or ::after, return the Styleable's element since a PseudoElement is only accessible for the aforementioned pseudo-elements. (WebCore::KeyframeEffect::targetElementOrPseudoElement const): For pseudo-elements other than ::before or ::after, return the animation target as the target element. * dom/PseudoElement.cpp: (WebCore::PseudoElement::rendererIsNeeded): Refactor what was originally isTargetedByKeyframeEffectRequiringPseudoElement() into this method since isTargetedByKeyframeEffectRequiringPseudoElement() was removed. (WebCore::PseudoElement::isTargetedByKeyframeEffectRequiringPseudoElement): Remove this method from PseudoElement since pseudo-elements that are not represented by a PseudoElement need similar logic, which is now available through the static function elementIsTargetedByKeyframeEffectRequiringPseudoElement() in RenderTreeUpdaterGeneratedContent.cpp. * dom/PseudoElement.h: * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::updateRenderTree): Pass the entire set of ElementUpdates instead of just the ElementUpdate to updateElementRenderer() such that it may process the new pseudoElementUpdates member. (WebCore::RenderTreeUpdater::updateBeforeDescendants): Pass the entire set of ElementUpdates and a PseudoId to updatePseudoElement() such that it may use the new pseudoElementUpdates member in combination with the PseudoId to determine what ElementUpdate to use. (WebCore::RenderTreeUpdater::updateAfterDescendants): Pass the entire set of ElementUpdates and a PseudoId to updatePseudoElement() such that it may use the new pseudoElementUpdates member in combination with the PseudoId to determine what ElementUpdate to use. (WebCore::RenderTreeUpdater::updateElementRenderer): Use the new pseudoElementUpdates member in ElementUpdates to set the pseudo-element styles. * rendering/updating/RenderTreeUpdater.h: * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp: (WebCore::elementIsTargetedByKeyframeEffectRequiringPseudoElement): New static method meant to replace the removed PseudoElement::isTargetedByKeyframeEffectRequiringPseudoElement() such that we may use this method regardless of whether the pseudo-element is represented by PseudoElement. (WebCore::createContentRenderers): Use elementIsTargetedByKeyframeEffectRequiringPseudoElement() instead of the removed PseudoElement::isTargetedByKeyframeEffectRequiringPseudoElement(). (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement): Look up all ElementUpdate for the provided PseudoId in the new pseudoElementUpdates member in ElementUpdates in order to determine what ElementUpdate to process. Also, use elementIsTargetedByKeyframeEffectRequiringPseudoElement() instead of the removed PseudoElement::isTargetedByKeyframeEffectRequiringPseudoElement(). (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement): * rendering/updating/RenderTreeUpdaterGeneratedContent.h: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveElement): Resolve any public pseudo-element instead of just ::before and ::after and save those in the new ElementUpdates pseudoElementUpdates member. (WebCore::Style::TreeResolver::resolvePseudoStyle): Resolve any pseudo-element set on an element that either has animations set on it, either set by Web Animations, as seen on the KeyframeEffectStack, or yet to be applied through a CSS Animation or CSS Transition, as seen on the RenderStyle. * style/StyleTreeResolver.h: * style/StyleUpdate.h: Add a new pseudoElementUpdates member on ElementUpdates. 2020-11-13 Antoine Quint <graouts@webkit.org> Add support for discrete animations of many CSS properties https://bugs.webkit.org/show_bug.cgi?id=218902 Reviewed by Antti Koivisto. Add support for discrete animation of the following properties: -webkit-backface-visibility, -webkit-box-decoration-break, -webkit-hyphens, -webkit-initial-letter, -webkit-print-color-adjust, -webkit-ruby-position, -webkit-text-emphasis-color, -webkit-text-emphasis-position, border-bottom-style, border-collapse, border-left-style, border-right-style, border-top-style, box-sizing, caption-side, clear, column-fill, column-rule-style, column-rule-style, cursor, empty-cells, flex-direction, flex-wrap, float, grid-auto-columns, grid-auto-flow, grid-auto-rows, grid-column-end, grid-column-start, grid-row-end, grid-row-start, image-orientation, isolation, justify-content, justify-items, justify-self, list-style-position, list-style-type, mix-blend-mode, object-fit, outline-style, overflow-wrap, overflow-x, overflow-y, page-break-after, page-break-before, page-break-inside, paint-order, pointer-events, position, resize, table-layout, text-align, text-decoration-color, text-decoration-line, text-decoration-style, text-overflow, text-transform, touch-action, transform-box, transform-style, white-space, word-break. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): * rendering/style/GridPosition.cpp: (WebCore::operator<<): * rendering/style/GridPosition.h: * rendering/style/GridTrackSize.cpp: Added. (WebCore::operator<<): * rendering/style/GridTrackSize.h: 2020-11-13 Sihui Liu <sihui_liu@apple.com> Implement basic permission check for SpeechRecognition https://bugs.webkit.org/show_bug.cgi?id=218476 <rdar://problem/71222638> Reviewed by Youenn Fablet. Tests: fast/speechrecognition/permission-error.html fast/speechrecognition/start-recognition-in-removed-iframe.html * Modules/speech/SpeechRecognition.cpp: (WebCore::SpeechRecognition::startRecognition): * Modules/speech/SpeechRecognitionConnection.h: * Modules/speech/SpeechRecognitionRequest.cpp: (WebCore::SpeechRecognitionRequest::create): Deleted. * Modules/speech/SpeechRecognitionRequest.h: (WebCore::SpeechRecognitionRequest::clientOrigin const): * Modules/speech/SpeechRecognitionRequestInfo.h: (WebCore::SpeechRecognitionRequestInfo::encode const): (WebCore::SpeechRecognitionRequestInfo::decode): * Modules/speech/SpeechRecognitionUpdate.cpp: (WebCore::SpeechRecognitionUpdate::create): (WebCore::SpeechRecognitionUpdate::error const): (WebCore::SpeechRecognitionUpdate::result const): * Modules/speech/SpeechRecognitionUpdate.h: * page/DummySpeechRecognitionProvider.h: 2020-11-13 Kate Cheney <katherine_cheney@apple.com> Can't login to Microsoft Teams https://bugs.webkit.org/show_bug.cgi?id=218778 <rdar://problem/36331568> Reviewed by John Wilander. This is a temporary quirk to assist a high-traffic website while they complete the large task of migrating away from login flows that require third party cookies. This quirk will be removed when the site is updated. Create a quirk to call the Storage Access API on behalf of Microsoft. No new tests, site-specific quirk. * dom/Element.cpp: (WebCore::Element::dispatchMouseEvent): Pass additional parameters to be able to dispatch a synthetic click if storage access is granted. * loader/ResourceLoadObserver.h: (WebCore::ResourceLoadObserver::setDomainsWithCrossPageStorageAccess): (WebCore::ResourceLoadObserver::hasCrossPageStorageAccess const): Store domains in the web process to avoid async calls to the network process. (WebCore::isMicrosoftLoginElement): (WebCore::isMicrosoftDomain): * page/Quirks.cpp: (WebCore::Quirks::triggerOptionalStorageAccessQuirk const): This is the quirk. * page/Quirks.h: * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::setDomainsWithCrossPageStorageAccess): (WebCore::NetworkStorageSession::grantCrossPageStorageAccess): (WebCore::NetworkStorageSession::hasStorageAccess const): (WebCore::NetworkStorageSession::grantStorageAccess): (WebCore::NetworkStorageSession::removeAllStorageAccess): (WebCore::NetworkStorageSession::storageAccessQuirks): (WebCore::NetworkStorageSession::canRequestStorageAccessForLoginPurposesWithoutPriorUserInteraction): (WebCore::NetworkStorageSession::loginDomainForFirstParty): (WebCore::NetworkStorageSession::mapToTopDomain): The user might go directly to login.live.com to sign in to Microsoft Teams, but may not have seen the Storage Access prompt. In this case, we should map live.com to microsoft.com and request storage access for microsoftonline.com under microsoft.com. Since login.live.com is used for other Microsoft login flows besides Teams, a user may have to grant storage access to microsoftonline.com even when it is not needed to complete the login. But this guarantees they will always be successfully logged into all Microsoft accounts. * platform/network/NetworkStorageSession.h: In order for the user to stay logged in between sessions, we should update NetworkStorageSession to grant storage access based on values stored in the ITP database for quirk domains. 2020-11-13 Brian Burg <bburg@apple.com> REGRESSION(r269701): inspector/console/webcore-logging.html is crashing https://bugs.webkit.org/show_bug.cgi?id=218840 <rdar://problem/71310952> Reviewed by Devin Rousso. This test is triggering a bizarre backtrace that fails the assertion ASSERT(m_frontendLoaded) in the frontend dispatcher. The sequence of events present in the stack trace is as follows: 1. Test.html finishes loading. 2. DOMContentLoaded event listener eventually calls InspectorFrontendHost::loaded(). 3. InspectorFrontendClient::frontendLoaded() calls -[NSWindow showWindow:] on the inspector window, which makes the inspected webpage window unfocus and resign first responder. 4. Unfocusing causes an activity state change and style recalc. Script is unsafe to execute under this. 5. Synchronously under the style recalc, inspector instrumentation is triggered when layers change. 6. The backend sends a protocol event, which is synchronously dispatched to the frontend. 7. Due to script evaluation being unsafe in (4), the frontend dispatcher tries to suspend. This hits the assertion because the frontend dispatcher hasn't been notified that the frontend finished loading as part of (3). This only affects WebKitLegacy clients, where events 1-7 happen synchronously from top to bottom due to the single process architecture. In the multiprocess case, frontendLoaded is an async IPC message and frontend evaluations are not affected by the state of the inspected page. * inspector/InspectorFrontendAPIDispatcher.cpp: (WebCore::InspectorFrontendAPIDispatcher::frontendLoaded): Dispatch messages iff not suspended. (WebCore::InspectorFrontendAPIDispatcher::suspend): Remove the assertion that is incorrect. Allow clients of this class to call suspend() before frontendLoaded(). (WebCore::InspectorFrontendAPIDispatcher::unsuspend): Using a similar argument as above, it is possible that WebKitLegacy may unsuspend the dispatcher before the frontend has fully loaded. 2020-11-13 Sam Weinig <weinig@apple.com> Move some more WebKit and WebKitLegacy preferences bound to Settings to WebPreferences.yaml https://bugs.webkit.org/show_bug.cgi?id=218914 Reviewed by Tim Horton. Moves AppleMailPaginationQuirkEnabled, ContentDispositionAttachmentSandboxEnabled and UseImageDocumentForSubframePDF from Settings.yaml to WebPreferences.yaml and merges in WebCore values for ScrollingPerformanceLoggingEnabled. * page/Settings.yaml: 2020-11-13 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r269776. The test added with this change is asserting Reverted changeset: "Null check anchorNode of endingSelection start" https://bugs.webkit.org/show_bug.cgi?id=218492 https://trac.webkit.org/changeset/269776 2020-11-13 Geoffrey Garen <ggaren@apple.com> Removed DeferrableTaskTimer https://bugs.webkit.org/show_bug.cgi?id=218874 Reviewed by Chris Dumez. It was (mostly) redundant. * platform/Timer.h: (WebCore::Timer::schedule): This helper function does the same job that DeferrableTaskTimer used to do. (WebCore::DeferrableTaskTimer::fired): Deleted. (WebCore::DeferrableTaskTimer::doTask): Deleted. (WebCore::DeferrableTaskTimer::cancel): Deleted. * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::fetchData): Use the new helper function. * platform/mediarecorder/MediaRecorderPrivateMock.h: No need for a data member anymore since we can use the schedule() convenience function instead. 2020-11-13 Claudio Saavedra <csaavedra@igalia.com> Non-unified build fixes. https://bugs.webkit.org/show_bug.cgi?id=218905 Unreviewed. * Modules/mediarecorder/MediaRecorder.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.h: * animation/WebAnimationUtilities.h: * display/css/DisplayBoxDecorationData.h: * dom/BoundaryPoint.cpp: * dom/EventDispatcher.cpp: * html/HTMLFrameOwnerElement.h: * layout/integration/LayoutIntegrationInlineContentBuilder.h: * loader/DocumentWriter.h: * page/FrameTree.h: * platform/encryptedmedia/CDMPrivate.cpp: * rendering/InlineTextBox.cpp: 2020-11-12 Darin Adler <darin@apple.com> Remove unused advanced plug-in features: snapshotting and plug-in load policy https://bugs.webkit.org/show_bug.cgi?id=218835 Reviewed by Tim Horton. * Headers.cmake: Removed some headers. * Sources.txt: Removed some source files. * WebCore.xcodeproj/project.pbxproj: Ditto. * css/CSSPrimitiveValueMappings.h: Removed SnapshottedPluginOverlayPart. * css/CSSValueKeywords.in: Removed snapshotted-plugin-overlay. * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::HTMLPlugInElement): Moved member initialization to the class definition. (WebCore::HTMLPlugInElement::canProcessDrag const): Deleted. (WebCore::HTMLPlugInElement::defaultEventHandler): Removed snapshot-specific code. (WebCore::HTMLPlugInElement::swapRendererTimerFired): Removed code to handle DisplayingSnapshot state. (WebCore::HTMLPlugInElement::setDisplayState): Ditto. * html/HTMLPlugInElement.h: Removed WaitingForSnapshot, DisplayingSnapshot, Restarting and RestartingWithPendingMouseClick states, updateSnapshot, dispatchPendingMouseClick, isRestartedPlugin, and canProcessDrag. Marked some more functions final, made a couple non-virtual, and moved some things from public to protected and protected to private. * html/HTMLPlugInImageElement.cpp: (WebCore::titleText): Deleted. (WebCore::subtitleText): Deleted. (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Removed a few data members. (WebCore::HTMLPlugInImageElement::setDisplayState): Deleted. (WebCore::HTMLPlugInImageElement::createElementRenderer): Removed code to handle the DisplayingSnapshot case. (WebCore::HTMLPlugInImageElement::childShouldCreateRenderer const): Removed code to handle a snapshotted plug-in. (WebCore::HTMLPlugInImageElement::willRecalcStyle): Removed check for the DisplayingSnapshot case. (WebCore::HTMLPlugInImageElement::updateSnapshot): Deleted. (WebCore::plugInImageElementIsolatedWorld): Deleted. (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Deleted. (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const): Deleted. (WebCore::HTMLPlugInImageElement::removeSnapshotTimerFired): Deleted. (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns): Deleted. (WebCore::HTMLPlugInImageElement::userDidClickSnapshot): Deleted. (WebCore::HTMLPlugInImageElement::setIsPrimarySnapshottedPlugIn): Deleted. (WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn): Deleted. (WebCore::HTMLPlugInImageElement::dispatchPendingMouseClick): Deleted. (WebCore::HTMLPlugInImageElement::simulatedMouseClickTimerFired): Deleted. (WebCore::documentHadRecentUserGesture): Deleted. (WebCore::HTMLPlugInImageElement::checkSizeChangeForSnapshotting): Deleted. (WebCore::is100Percent): Deleted. (WebCore::isSmallerThanTinySizingThreshold): Deleted. (WebCore::HTMLPlugInImageElement::isTopLevelFullPagePlugin const): Deleted. (WebCore::HTMLPlugInImageElement::checkSnapshotStatus): Deleted. (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Deleted. (WebCore::HTMLPlugInImageElement::subframeLoaderDidCreatePlugIn): Deleted. (WebCore::HTMLPlugInImageElement::defaultEventHandler): Deleted. * html/HTMLPlugInImageElement.h: Removed the functions mentioned above. Also loadedUrl, snapshotImage, needsCheckForSizeChange, setNeedsCheckForSizeChange, snapshotDecision, isRestartedPlugin, m_loadedUrl, m_pendingClickEventFromSnapshot, m_simulatedMouseClickTimer, m_removeSnapshotTimer, m_snapshotImage, m_createdDuringUserGesture, m_isRestartedPlugin, m_needsCheckForSizeChange, m_plugInWasCreated, m_deferredPromotionToPrimaryPlugIn, m_sizeWhenSnapshotted, m_snapshotDecision, and m_plugInDimensionsSpecified. * loader/SubframeLoader.cpp: (WebCore::FrameLoader::SubframeLoader::loadPlugin): Removed calls to subframeLoaderWillCreatePlugIn/DidCreatePlugIn. * page/DragController.cpp: (WebCore::DragController::canProcessDrag): Removed special case for plug-ins. * page/FrameView.cpp: (WebCore::FrameView::addEmbeddedObjectToUpdate): Removed call to needsCheckForSizeChange. (WebCore::FrameView::updateEmbeddedObject): Removed special case for snapshotted plug-in and call to needsCheckForSizeChange. * page/Page.cpp: (WebCore::Page::Page): Removed m_plugInClient. * page/Page.h: Ditto. * page/PageConfiguration.cpp: Removed PlugInClient.h. * page/PageConfiguration.h: Removed plugInClient. * page/PlugInClient.h: Removed. * page/Settings.yaml: Removed MaximumPlugInSnapshotAttempts. * platform/ThemeTypes.cpp: (WebCore::operator<<): Removed SnapshottedPluginOverlayPart. * platform/ThemeTypes.h: Ditto. * plugins/PluginViewBase.h: Removed canProcessDrag, shouldAlwaysAutoStart, and beginSnapshottingRunningPlugin. * rendering/RenderBoxModelObject.h: Added an export because the linker failed. Not sure what triggered this. * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::paintSnapshotImage): Deleted. (WebCore::RenderEmbeddedObject::paintContents): Deleted. (WebCore::RenderEmbeddedObject::layout): Removed code that was only for snahpshotted plug-ins, guarded both by an explicit check for snapshot state and by a check of canHaveChildren (now always false). (WebCore::RenderEmbeddedObject::canHaveChildren const): Deleted. * rendering/RenderEmbeddedObject.h: Marked the class final, made everything private that was protected, removed functions mentioned above, and virtual canHaveWidget function. * rendering/RenderLayerBacking.cpp: (WebCore::isRestartedPlugin): Deleted. (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const): Removed call to isRestartedPlugin. * rendering/RenderObject.h: Removed isSnapshottedPlugIn. * rendering/RenderSnapshottedPlugIn.cpp: Removed. * rendering/RenderSnapshottedPlugIn.h: Removed. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::paint): Removed SnapshottedPluginOverlayPart. * rendering/RenderTheme.h: Removed paintSnapshottedPluginOverlay. * rendering/RenderThemeMac.h: Ditto. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay): Deleted. * testing/Internals.cpp: (WebCore::Internals::isPluginSnapshotted): Always return false. 2020-11-13 Sam Weinig <weinig@apple.com> Cleanup InternalSettings https://bugs.webkit.org/show_bug.cgi?id=218881 Reviewed by Darin Adler. Cleanup InternalSettings by removing all the functions that duplicated functionality already implemented by InternalSettingsGenerated, sorting the remaining functions by setting class, and replacing string parameters with proper IDL enums. * testing/InternalSettings.cpp: * testing/InternalSettings.h: * testing/InternalSettings.idl: Remove duplicate functions and add enums for EditingBehavior, PDFImageCachingPolicy, StorageBlockingPolicy, SystemLayoutDirection, TrackKind, and UserInterfaceDirectionPolicy. Most of these map directly to existing WebCore enums (and FontLoadTimingOverride was easily updated to match the WebCore enum), but new enums were needed for EditingBehavior, PDFImageCachingPolicy and StorageBlockingPolicy to keep existing tests working. The UserInterfaceDirectionPolicy enum is different than what the tests expect (tests used "View" rather then "System") but were updated to match. * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::setMediaCaptureRequiresSecureConnection): Deleted. * testing/Internals.h: Remove now unused function setMediaCaptureRequiresSecureConnection. This should be done by the test runner or individual tests as needed. * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::setAllowsAnySSLCertificate): Switch to calling DeprecatedGlobalSettings directly rather than hopping through InternalSettings. This allows us to remove the InternalSettings function. 2020-11-12 Simon Fraser <simon.fraser@apple.com> Force wheel event listeners on the root to be passive https://bugs.webkit.org/show_bug.cgi?id=218842 <rdar://problem/71312668> Reviewed by Chris Dumez. Following Blink (https://www.chromestatus.com/feature/6662647093133312) force 'wheel' and 'mousewheel' event listeners on root objects (window, document and body) to be passive if they were not explicitly registered as non-passive. This behavior is controlled by an experimental feature flag, and a linked-on-or-after check to avoid changing behavior for apps that embed WebKit until they link against new SDKs. Tests: fast/events/wheel/wheel-event-listeners-on-body-made-passive.html fast/events/wheel/wheel-event-listeners-on-document-made-passive.html fast/events/wheel/wheel-event-listeners-on-window-left-active.html fast/events/wheel/wheel-event-listeners-on-window-made-passive.html * page/Quirks.cpp: (WebCore::Quirks::shouldMakeEventListenerPassive): * platform/cocoa/VersionChecks.h: 2020-11-13 Antti Koivisto <antti@apple.com> [LFC][Integration] Tighten inline-block coverage conditions https://bugs.webkit.org/show_bug.cgi?id=218901 Reviewed by Zalan Bujtas. The current ones allow some non-inline-blocks. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForChild): 2020-11-13 Julian Gonzalez <julian_a_gonzalez@apple.com> Crash in ReplaceSelectionCommand::moveNodeOutOfAncestor https://bugs.webkit.org/show_bug.cgi?id=218878 Reviewed by Alex Christensen. Add a missing null check inside moveNodeOutOfAncestor, as splitTreeToNode() can return nullptr. Test: editing/execCommand/crash-deleting-after-inserting-text-horizontal-rule.html * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor): 2020-11-13 Rob Buis <rbuis@igalia.com> Null check anchorNode of endingSelection start https://bugs.webkit.org/show_bug.cgi?id=218492 Reviewed by Alex Christensen. Null check anchorNode of endingSelection start. Test: editing/deleting/delete-contenteditable-crash.html * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::mergeParagraphs): 2020-11-13 Aditya Keerthi <akeerthi@apple.com> [iOS][FCR] Add an internal feature flag to enable the new appearance https://bugs.webkit.org/show_bug.cgi?id=218873 <rdar://problem/71345270> Reviewed by Tim Horton. Add a feature flag for the iOS form control refresh, so that the feature can be tested. A new user-agent stylesheet is introduced for the refresh so that the new styles can be opted in to at runtime. Only styles which differ from the existing stylesheet will be added to the new one. * DerivedSources-input.xcfilelist: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * css/iOSFormControlRefresh.css: Added. * style/InspectorCSSOMWrappers.cpp: (WebCore::Style::InspectorCSSOMWrappers::collectDocumentWrappers): * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement): * style/UserAgentStyle.h: 2020-11-13 Antoine Quint <graouts@webkit.org> Support more properties on ::marker https://bugs.webkit.org/show_bug.cgi?id=218894 <rdar://problem/71368343> Reviewed by Antti Koivisto. In preparation for the support of animations on ::marker and other pseudo-elements, we add support for animation and transition properties and add more rules to the user-agent stylesheet as defined by https://drafts.csswg.org/css-lists-3/#marker-properties. * css/html.css: (::marker): * rendering/RenderListItem.cpp: (WebCore::RenderListItem::computeMarkerStyle const): * style/PropertyCascade.cpp: (WebCore::Style::isValidMarkerStyleProperty): 2020-11-13 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Add initial bidi support https://bugs.webkit.org/show_bug.cgi?id=218884 Reviewed by Antti Koivisto. In this patch, we introduce the Bidi Run and the Iterator and use the BidiResolver to compute the bidi boundaries. Currently only single direction content is passed in to the BidiResolver which meas that we always end up with one and only one Bidi run. * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::Iterator::offset const): (WebCore::LayoutIntegration::Iterator::currentRun const): (WebCore::LayoutIntegration::Iterator::runOffset const): (WebCore::LayoutIntegration::Iterator::operator== const): (WebCore::LayoutIntegration::Iterator::operator!= const): (WebCore::LayoutIntegration::Iterator::atEnd const): (WebCore::LayoutIntegration::Iterator::Iterator): (WebCore::LayoutIntegration::Iterator::direction const): (WebCore::LayoutIntegration::Iterator::increment): (WebCore::LayoutIntegration::BidiRun::start const): (WebCore::LayoutIntegration::BidiRun::end const): (WebCore::LayoutIntegration::BidiRun::level const): (WebCore::LayoutIntegration::BidiRun::next const): (WebCore::LayoutIntegration::BidiRun::setNext): (WebCore::LayoutIntegration::BidiRun::takeNext): (WebCore::LayoutIntegration::BidiRun::BidiRun): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const): 2020-11-13 Miguel Gomez <magomez@igalia.com> [GTK][WPE] CSS backdrop overlay corners are not rounded on results.webkit.org https://bugs.webkit.org/show_bug.cgi?id=215445 Reviewed by Carlos Garcia Campos. Pass the backdropFiltersRect from CoordinatedGraphicsLayer through Nicosia to TextureMapperLayer. The latter will use this value to clip when painting the backdrop layer. Based on a patch created by Carlos Garcia Campos <cgarcia@igalia.com>. * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::CompositionLayer::flushState): * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintSelfAndChildren): (WebCore::TextureMapperLayer::setBackdropFiltersRect): * platform/graphics/texmap/TextureMapperLayer.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::setBackdropFilters): (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): 2020-11-13 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Minor rename and cleanup in InlineContentBuilder https://bugs.webkit.org/show_bug.cgi?id=218883 Reviewed by Antti Koivisto. * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::build const): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLineRuns const): (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const): (WebCore::LayoutIntegration::InlineContentBuilder::constructDisplayLineRuns const): Deleted. (WebCore::LayoutIntegration::InlineContentBuilder::constructDisplayLines const): Deleted. * layout/integration/LayoutIntegrationInlineContentBuilder.h: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): 2020-11-13 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Decouple box and text run construction https://bugs.webkit.org/show_bug.cgi?id=218882 Reviewed by Antti Koivisto. This is in preparation for adding bidi support where we may need to split a run on bidi boundaries. * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::constructDisplayLineRuns const): 2020-11-13 Kimmo Kinnunen <kkinnunen@apple.com> Remove uses of MakeCurrent from WebGL implementation https://bugs.webkit.org/show_bug.cgi?id=218178 <rdar://problem/70714561> Reviewed by Dean Jackson. Work towards WebGL implementation which uses GraphicsContextGL abstract base class instead of GraphicsContextGLOpenGL concrete class. Move GraphicsContextGLOpenGL::makeContextCurrent() to private section, as it is an implementation detail of the class. The function is intended to be called at the start of all public functions that might call into OpenGL to ensure that OpenGL uses the right context. Check all return values of makeCurrentContext(). We should not call into OpenGL if the context is not current, as that can lead to corruption, crashes or incorrect results. Add a compile-time warning if the return value is not used. Non-EWS compiled flavors of GraphicsContextGLOpenGL are changed only in best effort manner. Ensure that all functions actually call the makeCurrentContext() function before calling into OpenGL. Non-ANGLE flavors of GraphicsContextGLOpenGL are ensured only in best effort manner. ANGLE flavor of GraphicsContextGLOpenGL function implementations should call directly the ANGLE functions instead of calling them through getExtensions() interface. There is no conditional code inside and the implementation knows exactly which function to call in all situations. There is no abstraction between GraphicsContextGLOpenGL and ExtensionsGL, rather they are in practice the same object currently, semi-artificially split to two. This is true of other flavors of GraphicsContextGLOpenGL, but those are left unchanged in this regard. No new tests, a refactor. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): (WebCore::WebGLRenderingContextBase::initializeNewContext): (WebCore::WebGLRenderingContextBase::validateElementArraySize): (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise): (WebCore::WebGLRenderingContextBase::validateDrawElements): (WebCore::WebGLRenderingContextBase::readPixels): (WebCore::WebGLRenderingContextBase::vertexAttribfvImpl): (WebCore::WebGLRenderingContextBase::initVertexAttrib0): * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::supports): (WebCore::ExtensionsGLANGLE::ensureEnabled): (WebCore::ExtensionsGLANGLE::getTranslatedShaderSourceANGLE): (WebCore::ExtensionsGLANGLE::blitFramebuffer): (WebCore::ExtensionsGLANGLE::renderbufferStorageMultisample): (WebCore::ExtensionsGLANGLE::createVertexArrayOES): (WebCore::ExtensionsGLANGLE::deleteVertexArrayOES): (WebCore::ExtensionsGLANGLE::isVertexArrayOES): (WebCore::ExtensionsGLANGLE::bindVertexArrayOES): (WebCore::ExtensionsGLANGLE::drawBuffersEXT): (WebCore::ExtensionsGLANGLE::drawArraysInstanced): (WebCore::ExtensionsGLANGLE::drawElementsInstanced): (WebCore::ExtensionsGLANGLE::vertexAttribDivisor): (WebCore::ExtensionsGLANGLE::getBooleanvRobustANGLE): (WebCore::ExtensionsGLANGLE::getBufferParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getFloatvRobustANGLE): (WebCore::ExtensionsGLANGLE::getFramebufferAttachmentParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getIntegervRobustANGLE): (WebCore::ExtensionsGLANGLE::getProgramivRobustANGLE): (WebCore::ExtensionsGLANGLE::getRenderbufferParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getShaderivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getUniformfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getUniformivRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribivRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribPointervRobustANGLE): (WebCore::ExtensionsGLANGLE::readPixelsRobustANGLE): (WebCore::ExtensionsGLANGLE::texImage2DRobustANGLE): (WebCore::ExtensionsGLANGLE::texParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::texParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::texSubImage2DRobustANGLE): (WebCore::ExtensionsGLANGLE::compressedTexImage2DRobustANGLE): (WebCore::ExtensionsGLANGLE::compressedTexSubImage2DRobustANGLE): (WebCore::ExtensionsGLANGLE::compressedTexImage3DRobustANGLE): (WebCore::ExtensionsGLANGLE::compressedTexSubImage3DRobustANGLE): (WebCore::ExtensionsGLANGLE::texImage3DRobustANGLE): (WebCore::ExtensionsGLANGLE::texSubImage3DRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryivRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryObjectuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getBufferPointervRobustANGLE): (WebCore::ExtensionsGLANGLE::getIntegeri_vRobustANGLE): (WebCore::ExtensionsGLANGLE::getInternalformativRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribIivRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getUniformuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getActiveUniformBlockivRobustANGLE): (WebCore::ExtensionsGLANGLE::getInteger64vRobustANGLE): (WebCore::ExtensionsGLANGLE::getInteger64i_vRobustANGLE): (WebCore::ExtensionsGLANGLE::getBufferParameteri64vRobustANGLE): (WebCore::ExtensionsGLANGLE::samplerParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::samplerParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getSamplerParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getSamplerParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getFramebufferParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getProgramInterfaceivRobustANGLE): (WebCore::ExtensionsGLANGLE::getBooleani_vRobustANGLE): (WebCore::ExtensionsGLANGLE::getMultisamplefvRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getPointervRobustANGLERobustANGLE): (WebCore::ExtensionsGLANGLE::readnPixelsRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformivRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformuivRobustANGLE): (WebCore::ExtensionsGLANGLE::texParameterIivRobustANGLE): (WebCore::ExtensionsGLANGLE::texParameterIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexParameterIivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexParameterIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::samplerParameterIivRobustANGLE): (WebCore::ExtensionsGLANGLE::samplerParameterIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getSamplerParameterIivRobustANGLE): (WebCore::ExtensionsGLANGLE::getSamplerParameterIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryObjectivRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryObjecti64vRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryObjectui64vRobustANGLE): * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): (WebCore::GraphicsContextGLOpenGL::renderbufferStorage): (WebCore::GraphicsContextGLOpenGL::getIntegerv): (WebCore::GraphicsContextGLOpenGL::getIntegeri_v): (WebCore::GraphicsContextGLOpenGL::getShaderPrecisionFormat): (WebCore::GraphicsContextGLOpenGL::depthRange): (WebCore::GraphicsContextGLOpenGL::clearDepth): (WebCore::GraphicsContextGLOpenGL::readPixels): (WebCore::GraphicsContextGLOpenGL::prepareTexture): (WebCore::GraphicsContextGLOpenGL::readRenderingResults): (WebCore::GraphicsContextGLOpenGL::reshape): (WebCore::GraphicsContextGLOpenGL::activeTexture): (WebCore::GraphicsContextGLOpenGL::attachShader): (WebCore::GraphicsContextGLOpenGL::bindAttribLocation): (WebCore::GraphicsContextGLOpenGL::bindBuffer): (WebCore::GraphicsContextGLOpenGL::bindFramebuffer): (WebCore::GraphicsContextGLOpenGL::bindRenderbuffer): (WebCore::GraphicsContextGLOpenGL::bindTexture): (WebCore::GraphicsContextGLOpenGL::blendColor): (WebCore::GraphicsContextGLOpenGL::blendEquation): (WebCore::GraphicsContextGLOpenGL::blendEquationSeparate): (WebCore::GraphicsContextGLOpenGL::blendFunc): (WebCore::GraphicsContextGLOpenGL::blendFuncSeparate): (WebCore::GraphicsContextGLOpenGL::bufferData): (WebCore::GraphicsContextGLOpenGL::bufferSubData): (WebCore::GraphicsContextGLOpenGL::mapBufferRange): (WebCore::GraphicsContextGLOpenGL::unmapBuffer): (WebCore::GraphicsContextGLOpenGL::copyBufferSubData): (WebCore::GraphicsContextGLOpenGL::getInternalformativ): (WebCore::GraphicsContextGLOpenGL::renderbufferStorageMultisample): (WebCore::GraphicsContextGLOpenGL::texStorage2D): (WebCore::GraphicsContextGLOpenGL::texStorage3D): (WebCore::GraphicsContextGLOpenGL::getActiveUniforms): (WebCore::GraphicsContextGLOpenGL::checkFramebufferStatus): (WebCore::GraphicsContextGLOpenGL::clearColor): (WebCore::GraphicsContextGLOpenGL::clear): (WebCore::GraphicsContextGLOpenGL::clearStencil): (WebCore::GraphicsContextGLOpenGL::colorMask): (WebCore::GraphicsContextGLOpenGL::compileShader): (WebCore::GraphicsContextGLOpenGL::compileShaderDirect): (WebCore::GraphicsContextGLOpenGL::copyTexImage2D): (WebCore::GraphicsContextGLOpenGL::copyTexSubImage2D): (WebCore::GraphicsContextGLOpenGL::cullFace): (WebCore::GraphicsContextGLOpenGL::depthFunc): (WebCore::GraphicsContextGLOpenGL::depthMask): (WebCore::GraphicsContextGLOpenGL::detachShader): (WebCore::GraphicsContextGLOpenGL::disable): (WebCore::GraphicsContextGLOpenGL::disableVertexAttribArray): (WebCore::GraphicsContextGLOpenGL::drawArrays): (WebCore::GraphicsContextGLOpenGL::drawElements): (WebCore::GraphicsContextGLOpenGL::enable): (WebCore::GraphicsContextGLOpenGL::enableVertexAttribArray): (WebCore::GraphicsContextGLOpenGL::finish): (WebCore::GraphicsContextGLOpenGL::flush): (WebCore::GraphicsContextGLOpenGL::framebufferRenderbuffer): (WebCore::GraphicsContextGLOpenGL::framebufferTexture2D): (WebCore::GraphicsContextGLOpenGL::frontFace): (WebCore::GraphicsContextGLOpenGL::generateMipmap): (WebCore::GraphicsContextGLOpenGL::getActiveAttribImpl): (WebCore::GraphicsContextGLOpenGL::getActiveUniformImpl): (WebCore::GraphicsContextGLOpenGL::getAttachedShaders): (WebCore::GraphicsContextGLOpenGL::getAttribLocation): (WebCore::GraphicsContextGLOpenGL::moveErrorsToSyntheticErrorList): (WebCore::GraphicsContextGLOpenGL::getError): (WebCore::GraphicsContextGLOpenGL::getString): (WebCore::GraphicsContextGLOpenGL::hint): (WebCore::GraphicsContextGLOpenGL::isBuffer): (WebCore::GraphicsContextGLOpenGL::isEnabled): (WebCore::GraphicsContextGLOpenGL::isFramebuffer): (WebCore::GraphicsContextGLOpenGL::isProgram): (WebCore::GraphicsContextGLOpenGL::isRenderbuffer): (WebCore::GraphicsContextGLOpenGL::isShader): (WebCore::GraphicsContextGLOpenGL::isTexture): (WebCore::GraphicsContextGLOpenGL::lineWidth): (WebCore::GraphicsContextGLOpenGL::linkProgram): (WebCore::GraphicsContextGLOpenGL::pixelStorei): (WebCore::GraphicsContextGLOpenGL::polygonOffset): (WebCore::GraphicsContextGLOpenGL::sampleCoverage): (WebCore::GraphicsContextGLOpenGL::scissor): (WebCore::GraphicsContextGLOpenGL::shaderSource): (WebCore::GraphicsContextGLOpenGL::stencilFunc): (WebCore::GraphicsContextGLOpenGL::stencilFuncSeparate): (WebCore::GraphicsContextGLOpenGL::stencilMask): (WebCore::GraphicsContextGLOpenGL::stencilMaskSeparate): (WebCore::GraphicsContextGLOpenGL::stencilOp): (WebCore::GraphicsContextGLOpenGL::stencilOpSeparate): (WebCore::GraphicsContextGLOpenGL::texParameterf): (WebCore::GraphicsContextGLOpenGL::texParameteri): (WebCore::GraphicsContextGLOpenGL::uniform1f): (WebCore::GraphicsContextGLOpenGL::uniform1fv): (WebCore::GraphicsContextGLOpenGL::uniform2f): (WebCore::GraphicsContextGLOpenGL::uniform2fv): (WebCore::GraphicsContextGLOpenGL::uniform3f): (WebCore::GraphicsContextGLOpenGL::uniform3fv): (WebCore::GraphicsContextGLOpenGL::uniform4f): (WebCore::GraphicsContextGLOpenGL::uniform4fv): (WebCore::GraphicsContextGLOpenGL::uniform1i): (WebCore::GraphicsContextGLOpenGL::uniform1iv): (WebCore::GraphicsContextGLOpenGL::uniform2i): (WebCore::GraphicsContextGLOpenGL::uniform2iv): (WebCore::GraphicsContextGLOpenGL::uniform3i): (WebCore::GraphicsContextGLOpenGL::uniform3iv): (WebCore::GraphicsContextGLOpenGL::uniform4i): (WebCore::GraphicsContextGLOpenGL::uniform4iv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4fv): (WebCore::GraphicsContextGLOpenGL::useProgram): (WebCore::GraphicsContextGLOpenGL::validateProgram): (WebCore::GraphicsContextGLOpenGL::vertexAttrib1f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib1fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib2f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib2fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib3f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib3fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib4f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib4fv): (WebCore::GraphicsContextGLOpenGL::vertexAttribPointer): (WebCore::GraphicsContextGLOpenGL::vertexAttribIPointer): (WebCore::GraphicsContextGLOpenGL::viewport): (WebCore::GraphicsContextGLOpenGL::createVertexArray): (WebCore::GraphicsContextGLOpenGL::deleteVertexArray): (WebCore::GraphicsContextGLOpenGL::isVertexArray): (WebCore::GraphicsContextGLOpenGL::bindVertexArray): (WebCore::GraphicsContextGLOpenGL::getBooleanv): (WebCore::GraphicsContextGLOpenGL::getBufferParameteriv): (WebCore::GraphicsContextGLOpenGL::getFloatv): (WebCore::GraphicsContextGLOpenGL::getInteger64v): (WebCore::GraphicsContextGLOpenGL::getInteger64i_v): (WebCore::GraphicsContextGLOpenGL::getFramebufferAttachmentParameteriv): (WebCore::GraphicsContextGLOpenGL::getProgramiv): (WebCore::GraphicsContextGLOpenGL::getProgramInfoLog): (WebCore::GraphicsContextGLOpenGL::getRenderbufferParameteriv): (WebCore::GraphicsContextGLOpenGL::getShaderiv): (WebCore::GraphicsContextGLOpenGL::getShaderInfoLog): (WebCore::GraphicsContextGLOpenGL::getTexParameterfv): (WebCore::GraphicsContextGLOpenGL::getTexParameteriv): (WebCore::GraphicsContextGLOpenGL::getUniformfv): (WebCore::GraphicsContextGLOpenGL::getUniformiv): (WebCore::GraphicsContextGLOpenGL::getUniformuiv): (WebCore::GraphicsContextGLOpenGL::getUniformLocation): (WebCore::GraphicsContextGLOpenGL::getVertexAttribfv): (WebCore::GraphicsContextGLOpenGL::getVertexAttribiv): (WebCore::GraphicsContextGLOpenGL::getVertexAttribOffset): (WebCore::GraphicsContextGLOpenGL::texSubImage2D): (WebCore::GraphicsContextGLOpenGL::compressedTexImage2D): (WebCore::GraphicsContextGLOpenGL::compressedTexSubImage2D): (WebCore::GraphicsContextGLOpenGL::createBuffer): (WebCore::GraphicsContextGLOpenGL::createFramebuffer): (WebCore::GraphicsContextGLOpenGL::createProgram): (WebCore::GraphicsContextGLOpenGL::createRenderbuffer): (WebCore::GraphicsContextGLOpenGL::createShader): (WebCore::GraphicsContextGLOpenGL::createTexture): (WebCore::GraphicsContextGLOpenGL::deleteBuffer): (WebCore::GraphicsContextGLOpenGL::deleteFramebuffer): (WebCore::GraphicsContextGLOpenGL::deleteProgram): (WebCore::GraphicsContextGLOpenGL::deleteRenderbuffer): (WebCore::GraphicsContextGLOpenGL::deleteShader): (WebCore::GraphicsContextGLOpenGL::deleteTexture): (WebCore::GraphicsContextGLOpenGL::texImage2DDirect): (WebCore::GraphicsContextGLOpenGL::drawArraysInstanced): (WebCore::GraphicsContextGLOpenGL::drawElementsInstanced): (WebCore::GraphicsContextGLOpenGL::vertexAttribDivisor): (WebCore::GraphicsContextGLOpenGL::getUniformBlockIndex): (WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockName): (WebCore::GraphicsContextGLOpenGL::uniformBlockBinding): (WebCore::GraphicsContextGLOpenGL::createQuery): (WebCore::GraphicsContextGLOpenGL::beginQuery): (WebCore::GraphicsContextGLOpenGL::endQuery): (WebCore::GraphicsContextGLOpenGL::getQueryObjectuiv): (WebCore::GraphicsContextGLOpenGL::createTransformFeedback): (WebCore::GraphicsContextGLOpenGL::deleteTransformFeedback): (WebCore::GraphicsContextGLOpenGL::isTransformFeedback): (WebCore::GraphicsContextGLOpenGL::bindTransformFeedback): (WebCore::GraphicsContextGLOpenGL::beginTransformFeedback): (WebCore::GraphicsContextGLOpenGL::endTransformFeedback): (WebCore::GraphicsContextGLOpenGL::transformFeedbackVaryings): (WebCore::GraphicsContextGLOpenGL::getTransformFeedbackVarying): (WebCore::GraphicsContextGLOpenGL::bindBufferBase): (WebCore::GraphicsContextGLOpenGL::blitFramebuffer): (WebCore::GraphicsContextGLOpenGL::framebufferTextureLayer): (WebCore::GraphicsContextGLOpenGL::invalidateFramebuffer): (WebCore::GraphicsContextGLOpenGL::invalidateSubFramebuffer): (WebCore::GraphicsContextGLOpenGL::readBuffer): (WebCore::GraphicsContextGLOpenGL::copyTexSubImage3D): (WebCore::GraphicsContextGLOpenGL::getFragDataLocation): (WebCore::GraphicsContextGLOpenGL::uniform1ui): (WebCore::GraphicsContextGLOpenGL::uniform2ui): (WebCore::GraphicsContextGLOpenGL::uniform3ui): (WebCore::GraphicsContextGLOpenGL::uniform4ui): (WebCore::GraphicsContextGLOpenGL::uniform1uiv): (WebCore::GraphicsContextGLOpenGL::uniform2uiv): (WebCore::GraphicsContextGLOpenGL::uniform3uiv): (WebCore::GraphicsContextGLOpenGL::uniform4uiv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2x3fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3x2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2x4fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4x2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3x4fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4x3fv): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4i): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4iv): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4ui): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4uiv): (WebCore::GraphicsContextGLOpenGL::drawRangeElements): (WebCore::GraphicsContextGLOpenGL::drawBuffers): (WebCore::GraphicsContextGLOpenGL::clearBufferiv): (WebCore::GraphicsContextGLOpenGL::clearBufferuiv): (WebCore::GraphicsContextGLOpenGL::clearBufferfv): (WebCore::GraphicsContextGLOpenGL::clearBufferfi): (WebCore::GraphicsContextGLOpenGL::deleteQuery): (WebCore::GraphicsContextGLOpenGL::isQuery): (WebCore::GraphicsContextGLOpenGL::getQuery): (WebCore::GraphicsContextGLOpenGL::createSampler): (WebCore::GraphicsContextGLOpenGL::deleteSampler): (WebCore::GraphicsContextGLOpenGL::isSampler): (WebCore::GraphicsContextGLOpenGL::bindSampler): (WebCore::GraphicsContextGLOpenGL::samplerParameteri): (WebCore::GraphicsContextGLOpenGL::samplerParameterf): (WebCore::GraphicsContextGLOpenGL::getSamplerParameterfv): (WebCore::GraphicsContextGLOpenGL::getSamplerParameteriv): (WebCore::GraphicsContextGLOpenGL::fenceSync): (WebCore::GraphicsContextGLOpenGL::isSync): (WebCore::GraphicsContextGLOpenGL::deleteSync): (WebCore::GraphicsContextGLOpenGL::clientWaitSync): (WebCore::GraphicsContextGLOpenGL::waitSync): (WebCore::GraphicsContextGLOpenGL::getSynciv): (WebCore::GraphicsContextGLOpenGL::pauseTransformFeedback): (WebCore::GraphicsContextGLOpenGL::resumeTransformFeedback): (WebCore::GraphicsContextGLOpenGL::bindBufferRange): (WebCore::GraphicsContextGLOpenGL::getUniformIndices): * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::updateCGLContext): * platform/graphics/opengl/ExtensionsGLOpenGL.cpp: (WebCore::ExtensionsGLOpenGL::blitFramebuffer): (WebCore::ExtensionsGLOpenGL::renderbufferStorageMultisample): (WebCore::ExtensionsGLOpenGL::createVertexArrayOES): (WebCore::ExtensionsGLOpenGL::deleteVertexArrayOES): (WebCore::ExtensionsGLOpenGL::isVertexArrayOES): (WebCore::ExtensionsGLOpenGL::bindVertexArrayOES): (WebCore::ExtensionsGLOpenGL::supportsExtension): (WebCore::ExtensionsGLOpenGL::drawBuffersEXT): (WebCore::ExtensionsGLOpenGL::drawArraysInstanced): (WebCore::ExtensionsGLOpenGL::drawElementsInstanced): (WebCore::ExtensionsGLOpenGL::vertexAttribDivisor): * platform/graphics/opengl/ExtensionsGLOpenGLES.cpp: (WebCore::ExtensionsGLOpenGLES::framebufferTexture2DMultisampleIMG): (WebCore::ExtensionsGLOpenGLES::renderbufferStorageMultisampleIMG): (WebCore::ExtensionsGLOpenGLES::renderbufferStorageMultisample): (WebCore::ExtensionsGLOpenGLES::createVertexArrayOES): (WebCore::ExtensionsGLOpenGLES::deleteVertexArrayOES): (WebCore::ExtensionsGLOpenGLES::isVertexArrayOES): (WebCore::ExtensionsGLOpenGLES::bindVertexArrayOES): (WebCore::ExtensionsGLOpenGLES::getGraphicsResetStatusARB): (WebCore::ExtensionsGLOpenGLES::readnPixelsEXT): (WebCore::ExtensionsGLOpenGLES::getnUniformfvEXT): (WebCore::ExtensionsGLOpenGLES::getnUniformivEXT): (WebCore::ExtensionsGLOpenGLES::drawArraysInstanced): (WebCore::ExtensionsGLOpenGLES::drawElementsInstanced): (WebCore::ExtensionsGLOpenGLES::vertexAttribDivisor): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp: (WebCore::GraphicsContextGLOpenGL::renderbufferStorage): (WebCore::GraphicsContextGLOpenGL::getIntegerv): (WebCore::GraphicsContextGLOpenGL::getShaderPrecisionFormat): (WebCore::GraphicsContextGLOpenGL::depthRange): (WebCore::GraphicsContextGLOpenGL::clearDepth): (WebCore::GraphicsContextGLOpenGL::readPixels): * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::prepareTexture): (WebCore::GraphicsContextGLOpenGL::readRenderingResults): (WebCore::GraphicsContextGLOpenGL::reshape): (WebCore::GraphicsContextGLOpenGL::activeTexture): (WebCore::GraphicsContextGLOpenGL::attachShader): (WebCore::GraphicsContextGLOpenGL::bindAttribLocation): (WebCore::GraphicsContextGLOpenGL::bindBuffer): (WebCore::GraphicsContextGLOpenGL::bindFramebuffer): (WebCore::GraphicsContextGLOpenGL::bindRenderbuffer): (WebCore::GraphicsContextGLOpenGL::bindTexture): (WebCore::GraphicsContextGLOpenGL::blendColor): (WebCore::GraphicsContextGLOpenGL::blendEquation): (WebCore::GraphicsContextGLOpenGL::blendEquationSeparate): (WebCore::GraphicsContextGLOpenGL::blendFunc): (WebCore::GraphicsContextGLOpenGL::blendFuncSeparate): (WebCore::GraphicsContextGLOpenGL::bufferData): (WebCore::GraphicsContextGLOpenGL::bufferSubData): (WebCore::GraphicsContextGLOpenGL::checkFramebufferStatus): (WebCore::GraphicsContextGLOpenGL::clearColor): (WebCore::GraphicsContextGLOpenGL::clear): (WebCore::GraphicsContextGLOpenGL::clearStencil): (WebCore::GraphicsContextGLOpenGL::colorMask): (WebCore::GraphicsContextGLOpenGL::compileShader): (WebCore::GraphicsContextGLOpenGL::compileShaderDirect): (WebCore::GraphicsContextGLOpenGL::copyTexImage2D): (WebCore::GraphicsContextGLOpenGL::copyTexSubImage2D): (WebCore::GraphicsContextGLOpenGL::cullFace): (WebCore::GraphicsContextGLOpenGL::depthFunc): (WebCore::GraphicsContextGLOpenGL::depthMask): (WebCore::GraphicsContextGLOpenGL::detachShader): (WebCore::GraphicsContextGLOpenGL::disable): (WebCore::GraphicsContextGLOpenGL::disableVertexAttribArray): (WebCore::GraphicsContextGLOpenGL::drawArrays): (WebCore::GraphicsContextGLOpenGL::drawElements): (WebCore::GraphicsContextGLOpenGL::enable): (WebCore::GraphicsContextGLOpenGL::enableVertexAttribArray): (WebCore::GraphicsContextGLOpenGL::finish): (WebCore::GraphicsContextGLOpenGL::flush): (WebCore::GraphicsContextGLOpenGL::framebufferRenderbuffer): (WebCore::GraphicsContextGLOpenGL::framebufferTexture2D): (WebCore::GraphicsContextGLOpenGL::frontFace): (WebCore::GraphicsContextGLOpenGL::generateMipmap): (WebCore::GraphicsContextGLOpenGL::getActiveAttribImpl): (WebCore::GraphicsContextGLOpenGL::getActiveUniformImpl): (WebCore::GraphicsContextGLOpenGL::getAttachedShaders): (WebCore::GraphicsContextGLOpenGL::getAttribLocation): (WebCore::GraphicsContextGLOpenGL::getAttribLocationDirect): (WebCore::GraphicsContextGLOpenGL::moveErrorsToSyntheticErrorList): (WebCore::GraphicsContextGLOpenGL::getError): (WebCore::GraphicsContextGLOpenGL::getString): (WebCore::GraphicsContextGLOpenGL::hint): (WebCore::GraphicsContextGLOpenGL::isBuffer): (WebCore::GraphicsContextGLOpenGL::isEnabled): (WebCore::GraphicsContextGLOpenGL::isFramebuffer): (WebCore::GraphicsContextGLOpenGL::isProgram): (WebCore::GraphicsContextGLOpenGL::isRenderbuffer): (WebCore::GraphicsContextGLOpenGL::isShader): (WebCore::GraphicsContextGLOpenGL::isTexture): (WebCore::GraphicsContextGLOpenGL::lineWidth): (WebCore::GraphicsContextGLOpenGL::linkProgram): (WebCore::GraphicsContextGLOpenGL::pixelStorei): (WebCore::GraphicsContextGLOpenGL::polygonOffset): (WebCore::GraphicsContextGLOpenGL::sampleCoverage): (WebCore::GraphicsContextGLOpenGL::scissor): (WebCore::GraphicsContextGLOpenGL::shaderSource): (WebCore::GraphicsContextGLOpenGL::stencilFunc): (WebCore::GraphicsContextGLOpenGL::stencilFuncSeparate): (WebCore::GraphicsContextGLOpenGL::stencilMask): (WebCore::GraphicsContextGLOpenGL::stencilMaskSeparate): (WebCore::GraphicsContextGLOpenGL::stencilOp): (WebCore::GraphicsContextGLOpenGL::stencilOpSeparate): (WebCore::GraphicsContextGLOpenGL::texParameterf): (WebCore::GraphicsContextGLOpenGL::texParameteri): (WebCore::GraphicsContextGLOpenGL::uniform1f): (WebCore::GraphicsContextGLOpenGL::uniform1fv): (WebCore::GraphicsContextGLOpenGL::uniform2f): (WebCore::GraphicsContextGLOpenGL::uniform2fv): (WebCore::GraphicsContextGLOpenGL::uniform3f): (WebCore::GraphicsContextGLOpenGL::uniform3fv): (WebCore::GraphicsContextGLOpenGL::uniform4f): (WebCore::GraphicsContextGLOpenGL::uniform4fv): (WebCore::GraphicsContextGLOpenGL::uniform1i): (WebCore::GraphicsContextGLOpenGL::uniform1iv): (WebCore::GraphicsContextGLOpenGL::uniform2i): (WebCore::GraphicsContextGLOpenGL::uniform2iv): (WebCore::GraphicsContextGLOpenGL::uniform3i): (WebCore::GraphicsContextGLOpenGL::uniform3iv): (WebCore::GraphicsContextGLOpenGL::uniform4i): (WebCore::GraphicsContextGLOpenGL::uniform4iv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4fv): (WebCore::GraphicsContextGLOpenGL::useProgram): (WebCore::GraphicsContextGLOpenGL::validateProgram): (WebCore::GraphicsContextGLOpenGL::vertexAttrib1f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib1fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib2f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib2fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib3f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib3fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib4f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib4fv): (WebCore::GraphicsContextGLOpenGL::vertexAttribPointer): (WebCore::GraphicsContextGLOpenGL::viewport): (WebCore::GraphicsContextGLOpenGL::createVertexArray): (WebCore::GraphicsContextGLOpenGL::deleteVertexArray): (WebCore::GraphicsContextGLOpenGL::isVertexArray): (WebCore::GraphicsContextGLOpenGL::bindVertexArray): (WebCore::GraphicsContextGLOpenGL::getBooleanv): (WebCore::GraphicsContextGLOpenGL::getBufferParameteriv): (WebCore::GraphicsContextGLOpenGL::getFloatv): (WebCore::GraphicsContextGLOpenGL::getIntegeri_v): (WebCore::GraphicsContextGLOpenGL::getInteger64v): (WebCore::GraphicsContextGLOpenGL::getInteger64i_v): (WebCore::GraphicsContextGLOpenGL::getFramebufferAttachmentParameteriv): (WebCore::GraphicsContextGLOpenGL::getProgramiv): (WebCore::GraphicsContextGLOpenGL::getNonBuiltInActiveSymbolCount): (WebCore::GraphicsContextGLOpenGL::getProgramInfoLog): (WebCore::GraphicsContextGLOpenGL::getRenderbufferParameteriv): (WebCore::GraphicsContextGLOpenGL::getShaderiv): (WebCore::GraphicsContextGLOpenGL::getShaderInfoLog): (WebCore::GraphicsContextGLOpenGL::getShaderSource): (WebCore::GraphicsContextGLOpenGL::getTexParameterfv): (WebCore::GraphicsContextGLOpenGL::getTexParameteriv): (WebCore::GraphicsContextGLOpenGL::getUniformfv): (WebCore::GraphicsContextGLOpenGL::getUniformiv): (WebCore::GraphicsContextGLOpenGL::getUniformLocation): (WebCore::GraphicsContextGLOpenGL::getVertexAttribfv): (WebCore::GraphicsContextGLOpenGL::getVertexAttribiv): (WebCore::GraphicsContextGLOpenGL::getVertexAttribOffset): (WebCore::GraphicsContextGLOpenGL::texSubImage2D): (WebCore::GraphicsContextGLOpenGL::compressedTexImage2D): (WebCore::GraphicsContextGLOpenGL::compressedTexSubImage2D): (WebCore::GraphicsContextGLOpenGL::createBuffer): (WebCore::GraphicsContextGLOpenGL::createFramebuffer): (WebCore::GraphicsContextGLOpenGL::createProgram): (WebCore::GraphicsContextGLOpenGL::createRenderbuffer): (WebCore::GraphicsContextGLOpenGL::createShader): (WebCore::GraphicsContextGLOpenGL::createTexture): (WebCore::GraphicsContextGLOpenGL::deleteBuffer): (WebCore::GraphicsContextGLOpenGL::deleteFramebuffer): (WebCore::GraphicsContextGLOpenGL::deleteProgram): (WebCore::GraphicsContextGLOpenGL::deleteRenderbuffer): (WebCore::GraphicsContextGLOpenGL::deleteShader): (WebCore::GraphicsContextGLOpenGL::deleteTexture): (WebCore::GraphicsContextGLOpenGL::texImage2DDirect): (WebCore::GraphicsContextGLOpenGL::primitiveRestartIndex): (WebCore::GraphicsContextGLOpenGL::copyBufferSubData): (WebCore::GraphicsContextGLOpenGL::mapBufferRange): (WebCore::GraphicsContextGLOpenGL::unmapBuffer): (WebCore::GraphicsContextGLOpenGL::getInternalformativ): (WebCore::GraphicsContextGLOpenGL::renderbufferStorageMultisample): (WebCore::GraphicsContextGLOpenGL::texStorage2D): (WebCore::GraphicsContextGLOpenGL::texStorage3D): (WebCore::GraphicsContextGLOpenGL::getActiveUniforms): * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp: (WebCore::GraphicsContextGLOpenGL::readPixels): (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): (WebCore::GraphicsContextGLOpenGL::renderbufferStorage): (WebCore::GraphicsContextGLOpenGL::getIntegerv): (WebCore::GraphicsContextGLOpenGL::getShaderPrecisionFormat): (WebCore::GraphicsContextGLOpenGL::depthRange): (WebCore::GraphicsContextGLOpenGL::clearDepth): (WebCore::GraphicsContextGLOpenGL::create): (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): * platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): 2020-11-13 Miguel Gomez <magomez@igalia.com> [GTK][WPE] FilterInfo must cleared when reusing BitmapTextureGL https://bugs.webkit.org/show_bug.cgi?id=218854 Reviewed by Carlos Garcia Campos. Clear the FilterInfo attribute when reusing a BitmapTextureGL. * platform/graphics/texmap/BitmapTextureGL.cpp: (WebCore::BitmapTextureGL::didReset): 2020-11-12 Youenn Fablet <youenn@apple.com> Add infrastructure for WebRTC transforms https://bugs.webkit.org/show_bug.cgi?id=218750 Reviewed by Eric Carlson. Introduce RTCRtpTransform behind a preference. Add binding code with libwebrtc to be able to process encoded content in sender and receiver sides. Add a mock transform to validate the infrastructure is working. Test: webrtc/webrtc-transform.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/mediastream/RTCRtpReceiver+Transform.idl: Added. * Modules/mediastream/RTCRtpReceiver.cpp: (WebCore::RTCRtpReceiver::~RTCRtpReceiver): (WebCore::RTCRtpReceiver::stop): (WebCore::RTCRtpReceiver::setTransform): * Modules/mediastream/RTCRtpReceiver.h: * Modules/mediastream/RTCRtpReceiverBackend.h: * Modules/mediastream/RTCRtpReceiverWithTransform.h: Added. (WebCore::RTCRtpReceiverWithTransform::transform): (WebCore::RTCRtpReceiverWithTransform::setTransform): * Modules/mediastream/RTCRtpSender+Transform.idl: Added. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::~RTCRtpSender): (WebCore::RTCRtpSender::stop): (WebCore::RTCRtpSender::setTransform): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSenderBackend.h: * Modules/mediastream/RTCRtpSenderWithTransform.h: Added. (WebCore::RTCRtpSenderWithTransform::transform): (WebCore::RTCRtpSenderWithTransform::setTransform): * Modules/mediastream/RTCRtpTransform.cpp: Added. (WebCore::RTCRtpTransform::~RTCRtpTransform): (WebCore::RTCRtpTransform::attachToReceiver): (WebCore::RTCRtpTransform::attachToSender): (WebCore::RTCRtpTransform::detachFromReceiver): (WebCore::RTCRtpTransform::detachFromSender): * Modules/mediastream/RTCRtpTransform.h: Added. * Modules/mediastream/RTCRtpTransform.idl: Added. * Modules/mediastream/RTCRtpTransformBackend.h: Added. * Modules/mediastream/RTCRtpTransformableFrame.h: Added. * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp: (WebCore::LibWebRTCRtpReceiverBackend::createRTCRtpTransformBackend): * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.cpp: Added. (WebCore::mediaTypeFromReceiver): (WebCore::LibWebRTCRtpReceiverTransformBackend::LibWebRTCRtpReceiverTransformBackend): (WebCore::LibWebRTCRtpReceiverTransformBackend::~LibWebRTCRtpReceiverTransformBackend): (WebCore::LibWebRTCRtpReceiverTransformBackend::setTransformableFrameCallback): * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.h: Added. * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: (WebCore::LibWebRTCRtpSenderBackend::createRTCRtpTransformBackend): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.cpp: Added. (WebCore::mediaTypeFromSender): (WebCore::LibWebRTCRtpSenderTransformBackend::LibWebRTCRtpSenderTransformBackend): (WebCore::LibWebRTCRtpSenderTransformBackend::~LibWebRTCRtpSenderTransformBackend): (WebCore::LibWebRTCRtpSenderTransformBackend::setTransformableFrameCallback): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.h: Added. * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformBackend.cpp: Added. (WebCore::LibWebRTCRtpTransformBackend::setInputCallback): (WebCore::LibWebRTCRtpTransformBackend::clearTransformableFrameCallback): (WebCore::LibWebRTCRtpTransformBackend::setOutputCallback): (WebCore::LibWebRTCRtpTransformBackend::processTransformedFrame): (WebCore::LibWebRTCRtpTransformBackend::Transform): (WebCore::LibWebRTCRtpTransformBackend::RegisterTransformedFrameCallback): (WebCore::LibWebRTCRtpTransformBackend::RegisterTransformedFrameSinkCallback): (WebCore::LibWebRTCRtpTransformBackend::UnregisterTransformedFrameCallback): (WebCore::LibWebRTCRtpTransformBackend::UnregisterTransformedFrameSinkCallback): * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformBackend.h: Added. (WebCore::LibWebRTCRtpTransformBackend::LibWebRTCRtpTransformBackend): (WebCore::LibWebRTCRtpTransformBackend::Release const): * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.h: Added. (WebCore::LibWebRTCRtpTransformableFrame::LibWebRTCRtpTransformableFrame): (WebCore::LibWebRTCRtpTransformableFrame::toRTCFrame): (WebCore::LibWebRTCRtpTransformableFrame::data const): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): * bindings/scripts/test/JS/JSTestInterface.h: * testing/Internals.cpp: (WebCore::Internals::createMockRTCRtpTransform): * testing/Internals.h: * testing/Internals.idl: * testing/MockRTCRtpTransform.cpp: Added. (WebCore::MockRTCRtpTransformer::create): (WebCore::MockRTCRtpTransformer::clear): (WebCore::MockRTCRtpTransformer::transform): (WebCore::MockRTCRtpTransformer::isProcessing const): (WebCore::MockRTCRtpTransformer::MockRTCRtpTransformer): (WebCore::MockRTCRtpTransform::MockRTCRtpTransform): (WebCore::MockRTCRtpTransform::~MockRTCRtpTransform): (WebCore::MockRTCRtpTransform::isProcessing const): (WebCore::MockRTCRtpTransform::initializeBackendForReceiver): (WebCore::MockRTCRtpTransform::initializeBackendForSender): (WebCore::MockRTCRtpTransform::willClearBackend): * testing/MockRTCRtpTransform.h: Added. * testing/MockRTCRtpTransform.idl: Added. 2020-11-12 Joonghun Park <jh718.park@samsung.com> Unreviewed. Fix the build warning below since r269753. warning: unused parameter ‘spacing’ [-Wunused-parameter] No new tests, no new behaviors. * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawPlatformPattern): 2020-11-12 Sam Weinig <weinig@apple.com> Move more WebKitLegacy specific settings usage to WebPreferences.yaml https://bugs.webkit.org/show_bug.cgi?id=218852 Reviewed by Tim Horton. This batch focuses on settings with defaults based on SDK/host app conditions. * page/Settings.yaml: 2020-11-12 Said Abou-Hallawa <said@apple.com> [GPU Process] GraphicsContext::drawPattern() should take a NativeImage argument https://bugs.webkit.org/show_bug.cgi?id=218865 Reviewed by Simon Fraser. When recording the DisplayList item DrawPattern, the renderingResourceIdentifier of the NativeImage will be recorded. When replaying it back, the renderingResourceIdentifier will be resolved to a NativeImage and the item will be applied the same way we for DrawNativeImage. DrawPattern will be inline DisplayList item and should not need encoding or decoding when sending it to the GPU. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawPattern): * platform/graphics/GraphicsContext.h: (WebCore::GraphicsContext::drawPattern): (WebCore::GraphicsContext::drawPlatformImage): Deleted. * platform/graphics/GraphicsContextImpl.h: * platform/graphics/Image.cpp: (WebCore::Image::drawPattern): * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawPlatformPattern): (WebCore::GraphicsContext::drawPattern): Deleted. * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::drawPattern): * platform/graphics/cairo/GraphicsContextImplCairo.h: * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::drawPlatformPattern): (WebCore::GraphicsContext::drawPattern): Deleted. * platform/graphics/displaylists/DisplayListItemBuffer.cpp: (WebCore::DisplayList::ItemHandle::destroy): (WebCore::DisplayList::ItemHandle::copyTo const): * platform/graphics/displaylists/DisplayListItemType.cpp: (WebCore::DisplayList::isDrawingItem): (WebCore::DisplayList::isInlineItem): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawPattern::DrawPattern): (WebCore::DisplayList::DrawPattern::apply const): (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::DrawPattern::DrawPattern): (WebCore::DisplayList::DrawPattern::imageIdentifier const): (WebCore::DisplayList::DrawPattern::imageSize const): (WebCore::DisplayList::DrawPattern::tileRect const): (WebCore::DisplayList::DrawPattern::patternTransform const): (WebCore::DisplayList::DrawPattern::image const): Deleted. (WebCore::DisplayList::DrawPattern::encode const): Deleted. (WebCore::DisplayList::DrawPattern::decode): Deleted. * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::drawPattern): * platform/graphics/displaylists/DisplayListRecorder.h: * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::applyImageBufferItem): (WebCore::DisplayList::applyNativeImageItem): (WebCore::DisplayList::Replayer::applyItem): * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: (Nicosia::CairoOperationRecorder::drawPattern): * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: * platform/graphics/win/GraphicsContextDirect2D.cpp: (WebCore::GraphicsContext::drawPlatformPattern): (WebCore::GraphicsContext::drawPattern): Deleted. * platform/graphics/win/GraphicsContextImplDirect2D.cpp: (WebCore::GraphicsContextImplDirect2D::drawPattern): * platform/graphics/win/GraphicsContextImplDirect2D.h: 2020-11-12 Chris Dumez <cdumez@apple.com> [GPUProcess] Add basic GPUProcess crash handling for media playback https://bugs.webkit.org/show_bug.cgi?id=218825 Reviewed by Eric Carlson. Add utility function to MediaPlayer to reload the media engine and resume playback if necessary. This is called after the GPU process has crashed so that the playback picks up where it left off. Also add a new seekWhenPossible() function that only attempts to seek once we've received the metadata. Any attempt to seek before the metadata has been received gets ignored otherwise. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::reloadAndResumePlaybackIfNeeded): (WebCore::MediaPlayer::seekWhenPossible): (WebCore::MediaPlayer::readyStateChanged): * platform/graphics/MediaPlayer.h: 2020-11-12 Antti Koivisto <antti@apple.com> [LFC][Integration] VisiblePosition::absoluteSelectionBoundsForLine should use iterator https://bugs.webkit.org/show_bug.cgi?id=218866 Reviewed by Zalan Bujtas. * editing/VisiblePosition.cpp: (WebCore::VisiblePosition::absoluteSelectionBoundsForLine const): Also fix confused logical->physical mapping. The client wants physical position. * editing/VisiblePosition.h: (WebCore::VisiblePosition::inlineBoxAndOffset const): Deleted. 2020-11-12 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Enable inline replaced support https://bugs.webkit.org/show_bug.cgi?id=218514 <rdar://problem/71239028> Reviewed by Antti Koivisto. * layout/integration/LayoutIntegrationCoverage.cpp: 2020-11-12 Zalan Bujtas <zalan@apple.com> [LFC][IFC] FormattingContext::Geometry::computedHeightValue should handle min, max and fit-content https://bugs.webkit.org/show_bug.cgi?id=218853 Reviewed by Antti Koivisto. This is not an actual support for those height values (that's something the caller needs to implement), it's just avoiding the assertion in valueForLength. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const): 2020-11-12 Zalan Bujtas <zalan@apple.com> [LFC][Integration] vertical-align: super and sub values are not supported yet. https://bugs.webkit.org/show_bug.cgi?id=218851 Reviewed by Antti Koivisto. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForChild): 2020-11-12 Antti Koivisto <antti@apple.com> [LFC][IFC] Use inline iterator in VisiblePosition::left/rightVisuallyDistinctCandidate https://bugs.webkit.org/show_bug.cgi?id=218848 Reviewed by Zalan Bujtas. Less direct InlineBox access. The patch also simplifies the iterator by removing separate LineRunIterator. Base RunIterator is used instead and the incompatible traversal functions are explicitly hidden in TextRunIterator. * editing/VisiblePosition.cpp: (WebCore::VisiblePosition::leftVisuallyDistinctCandidate const): (WebCore::VisiblePosition::rightVisuallyDistinctCandidate const): * editing/VisibleUnits.cpp: (WebCore::startPositionForLine): (WebCore::endPositionForLine): * layout/integration/LayoutIntegrationLineIterator.cpp: (WebCore::LayoutIntegration::LineIterator::firstRun const): (WebCore::LayoutIntegration::LineIterator::lastRun const): (WebCore::LayoutIntegration::LineIterator::logicalStartRunWithNode const): (WebCore::LayoutIntegration::LineIterator::logicalEndRunWithNode const): (WebCore::LayoutIntegration::LineIterator::closestRunForPoint): (WebCore::LayoutIntegration::LineIterator::closestRunForLogicalLeftPosition): * layout/integration/LayoutIntegrationLineIterator.h: * layout/integration/LayoutIntegrationRunIterator.cpp: (WebCore::LayoutIntegration::RunIterator::nextOnLine const): (WebCore::LayoutIntegration::RunIterator::previousOnLine const): (WebCore::LayoutIntegration::RunIterator::nextOnLineIgnoringLineBreak const): (WebCore::LayoutIntegration::RunIterator::previousOnLineIgnoringLineBreak const): (WebCore::LayoutIntegration::RunIterator::traverseNextOnLine): (WebCore::LayoutIntegration::RunIterator::traversePreviousOnLine): (WebCore::LayoutIntegration::RunIterator::traverseNextOnLineIgnoringLineBreak): (WebCore::LayoutIntegration::RunIterator::traversePreviousOnLineIgnoringLineBreak): (WebCore::LayoutIntegration::LineRunIterator::LineRunIterator): Deleted. (WebCore::LayoutIntegration::LineRunIterator::traverseNextOnLine): Deleted. (WebCore::LayoutIntegration::LineRunIterator::traversePreviousOnLine): Deleted. (WebCore::LayoutIntegration::LineRunIterator::traverseNextOnLineIgnoringLineBreak): Deleted. (WebCore::LayoutIntegration::LineRunIterator::traversePreviousOnLineIgnoringLineBreak): Deleted. (WebCore::LayoutIntegration::lineRun): Deleted. * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::TextRunIterator::get const): (WebCore::LayoutIntegration::LineRunIterator::LineRunIterator): Deleted. (WebCore::LayoutIntegration::LineRunIterator::operator++): Deleted. 2020-11-12 Sergio Villar Senin <svillar@igalia.com> Crash in RenderBox::overrideContainingBlockContentHeight() https://bugs.webkit.org/show_bug.cgi?id=218504 <rdar://problem/70989103> Reviewed by Zalan Bujtas. It should check the overriding widths map for vertical writing modes because it deals with logical sizes. Instead it was always checking the overriding heights map and thus giving incorrect results. Test: fast/flexbox/flex-column-vertical-rl-dynamic-child-crash.html * rendering/RenderBox.cpp: (WebCore::RenderBox::hasOverridingContainingBlockContentHeight const): Check gOverridingContainingBlockContentLogicalWidthMap for vertical writing modes. 2020-11-12 Zalan Bujtas <zalan@apple.com> Show legacy line layout visual coverage instead of "simple line" layout. https://bugs.webkit.org/show_bug.cgi?id=218695 Reviewed by Antti Koivisto. Paint legacy line layout content with the debug shadow instead of the modern one (and use red instead of blue). * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::paint): (WebCore::LayoutIntegration::LineLayout::debugTextShadow): Deleted. * layout/integration/LayoutIntegrationLineLayout.h: * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintMarkedTextForeground): (WebCore::InlineTextBox::debugTextShadow): * rendering/InlineTextBox.h: 2020-11-12 Said Abou-Hallawa <said@apple.com> [GPU Process] Implement DisplayList::ClipToImageBuffer item https://bugs.webkit.org/show_bug.cgi?id=218843 Reviewed by Tim Horton. Record the renderingResourceIdentifier of the ImageBuffer. At replaying time, the renderingResourceIdentifier of the ClipToImageBuffer will be resolved to an ImageBuffer. The actual clipping will be moved to an new function named ImageBuffer::clipToMask(). * platform/graphics/ConcreteImageBuffer.h: * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::clipToImageBuffer): * platform/graphics/ImageBuffer.h: * platform/graphics/ImageBufferBackend.h: (WebCore::ImageBufferBackend::clipToMask): * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::clipToImageBuffer): Deleted. * platform/graphics/cairo/ImageBufferCairoBackend.cpp: (WebCore::ImageBufferCairoBackend::clipToMask): * platform/graphics/cairo/ImageBufferCairoBackend.h: * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::clipToImageBuffer): Deleted. * platform/graphics/cg/ImageBufferCGBackend.cpp: (WebCore::ImageBufferCGBackend::clipToMask): * platform/graphics/cg/ImageBufferCGBackend.h: * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::append): * platform/graphics/displaylists/DisplayListItemBuffer.cpp: (WebCore::DisplayList::ItemHandle::apply): (WebCore::DisplayList::ItemHandle::destroy): (WebCore::DisplayList::ItemHandle::copyTo const): * platform/graphics/displaylists/DisplayListItemType.cpp: (WebCore::DisplayList::sizeOfItemInBytes): (WebCore::DisplayList::isDrawingItem): (WebCore::DisplayList::isInlineItem): * platform/graphics/displaylists/DisplayListItemType.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::ClipToImageBuffer::apply const): (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::ClipToImageBuffer::ClipToImageBuffer): (WebCore::DisplayList::ClipToImageBuffer::imageBufferIdentifier const): (WebCore::DisplayList::ClipToImageBuffer::destinationRect const): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::clipToImageBuffer): * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::Replayer::applyItem): * platform/graphics/win/GraphicsContextDirect2D.cpp: (WebCore::GraphicsContext::clipToImageBuffer): Deleted. * platform/graphics/win/ImageBufferDirect2DBackend.cpp: (WebCore::ImageBufferDirect2DBackend::clipToMask): * platform/graphics/win/ImageBufferDirect2DBackend.h: 2020-11-11 Ziran Sun <zsun@igalia.com> [css-grid] Percentage height on replaced item with scrollbar https://bugs.webkit.org/show_bug.cgi?id=191462 Reviewed by Manuel Rego Casasnovas. This CL is to subtract scrollbar in computeReplacedLogicalHeightUsing(). In RenderBox::computeReplacedLogicalHeightUsing() we should also subtract scrollbarLogicalHeight() when calculating stretchHeight. Without this subtraction, it caused issues to resolve the percentage heights on grid item replaced children, if the grid item has a scrollbar. It ports the changes from the following patch at Chromium: https://bugs.chromium.org/p/chromium/issues/detail?id=837141 Test files were already ported in WPT at https://github.com/web-platform-tests/wpt/commit/538eedafb15733c6113b44998170a6bbdae7518b * rendering/RenderBox.cpp: (WebCore::RenderBox::computeReplacedLogicalHeightUsing const): 2020-11-11 Said Abou-Hallawa <said@apple.com> [GPU Process] Delete the DisplayList items: DrawImage and DrawTiledImage https://bugs.webkit.org/show_bug.cgi?id=218839 Reviewed by Tim Horton. This is clean up left from r269708. These DisplayList items are not needed anymore. The default implementation of the recording functions in the super classes of GraphicsContextImpl was to call Image::draw() or Image::drawTiled() which we do right now by not recording in the functions: GraphicsContext::drawImage() and GraphicsContext::drawTiledImage(). * platform/graphics/GraphicsContextImpl.cpp: (WebCore::GraphicsContextImpl::drawImageImpl): Deleted. (WebCore::GraphicsContextImpl::drawTiledImageImpl): Deleted. * platform/graphics/GraphicsContextImpl.h: * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::drawImage): Deleted. (WebCore::GraphicsContextImplCairo::drawTiledImage): Deleted. * platform/graphics/cairo/GraphicsContextImplCairo.h: * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::append): * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp: (WebCore::DisplayList::DrawGlyphsRecorder::recordDrawImage): * platform/graphics/displaylists/DisplayListItemBuffer.cpp: (WebCore::DisplayList::ItemHandle::apply): (WebCore::DisplayList::ItemHandle::destroy): (WebCore::DisplayList::ItemHandle::copyTo const): * platform/graphics/displaylists/DisplayListItemType.cpp: (WebCore::DisplayList::sizeOfItemInBytes): (WebCore::DisplayList::isDrawingItem): (WebCore::DisplayList::isInlineItem): * platform/graphics/displaylists/DisplayListItemType.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::operator<<): (WebCore::DisplayList::DrawImage::apply const): Deleted. (WebCore::DisplayList::DrawTiledImage::apply const): Deleted. (WebCore::DisplayList::DrawTiledScaledImage::apply const): Deleted. * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::DrawImage::DrawImage): Deleted. (WebCore::DisplayList::DrawImage::image const): Deleted. (WebCore::DisplayList::DrawImage::source const): Deleted. (WebCore::DisplayList::DrawImage::destination const): Deleted. (WebCore::DisplayList::DrawImage::globalBounds const): Deleted. (WebCore::DisplayList::DrawImage::localBounds const): Deleted. (WebCore::DisplayList::DrawImage::encode const): Deleted. (WebCore::DisplayList::DrawImage::decode): Deleted. (WebCore::DisplayList::DrawTiledImage::image const): Deleted. (WebCore::DisplayList::DrawTiledImage::source const): Deleted. (WebCore::DisplayList::DrawTiledImage::destination const): Deleted. (WebCore::DisplayList::DrawTiledImage::tileSize const): Deleted. (WebCore::DisplayList::DrawTiledImage::spacing const): Deleted. (WebCore::DisplayList::DrawTiledImage::DrawTiledImage): Deleted. (WebCore::DisplayList::DrawTiledImage::globalBounds const): Deleted. (WebCore::DisplayList::DrawTiledImage::localBounds const): Deleted. (WebCore::DisplayList::DrawTiledImage::encode const): Deleted. (WebCore::DisplayList::DrawTiledImage::decode): Deleted. (WebCore::DisplayList::DrawTiledScaledImage::DrawTiledScaledImage): Deleted. (WebCore::DisplayList::DrawTiledScaledImage::image const): Deleted. (WebCore::DisplayList::DrawTiledScaledImage::source const): Deleted. (WebCore::DisplayList::DrawTiledScaledImage::destination const): Deleted. (WebCore::DisplayList::DrawTiledScaledImage::globalBounds const): Deleted. (WebCore::DisplayList::DrawTiledScaledImage::localBounds const): Deleted. (WebCore::DisplayList::DrawTiledScaledImage::encode const): Deleted. (WebCore::DisplayList::DrawTiledScaledImage::decode): Deleted. * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::drawImage): Deleted. (WebCore::DisplayList::Recorder::drawTiledImage): Deleted. * platform/graphics/displaylists/DisplayListRecorder.h: * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: (Nicosia::CairoOperationRecorder::drawImage): Deleted. (Nicosia::CairoOperationRecorder::drawTiledImage): Deleted. * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: * platform/graphics/win/GraphicsContextImplDirect2D.cpp: (WebCore::GraphicsContextImplDirect2D::drawImage): Deleted. (WebCore::GraphicsContextImplDirect2D::drawTiledImage): Deleted. * platform/graphics/win/GraphicsContextImplDirect2D.h: 2020-11-11 Diego Pino Garcia <dpino@igalia.com> Unreviewed, GTK Ubuntu LTS build fix after r269662. * dom/BoundaryPoint.cpp: 2020-11-11 Sam Weinig <weinig@apple.com> Move more WebKitLegacy preferences bound to Settings to WebPreferences.yaml https://bugs.webkit.org/show_bug.cgi?id=218826 Reviewed by Tim Horton. * page/Settings.yaml: Move AcceleratedCompositingForFixedPositionEnabled, ForceWebGLUsesLowPower, RubberBandingForSubScrollableRegionsEnabled, ShrinksStandaloneImagesToFit and VisualViewportEnabled to WebPreferences.yaml 2020-11-11 John Wilander <wilander@apple.com> PCM: Change from ad-click-attribution to private-click-measurement (in all forms, including .well-known URL) https://bugs.webkit.org/show_bug.cgi?id=218730 <rdar://problem/71094296> Reviewed by Alex Christensen. Change to the official name of the proposed standard Private Click Measurement https://github.com/privacycg/private-click-measurement. This includes a change of the reporting URL from "/.well-known/ad-click-attribution/" to "/.well-known/private-click-measurement/". Tests: http/tests/contentextensions/block-private-click-measurement.html http/tests/privateClickMeasurement/anchor-tag-attributes-reflect.html http/tests/privateClickMeasurement/anchor-tag-attributes-validation.html http/tests/privateClickMeasurement/attribution-conversion-through-cross-site-image-redirect.html http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-in-new-window.html http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority.html http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority.html http/tests/privateClickMeasurement/clear-through-website-data-removal.html http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html http/tests/privateClickMeasurement/expired-attributions-removed.html http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority.html http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority.html http/tests/privateClickMeasurement/second-conversion-with-higher-priority.html http/tests/privateClickMeasurement/second-conversion-with-lower-priority.html http/tests/privateClickMeasurement/send-attribution-conversion-request.html http/tests/privateClickMeasurement/store-disabled-in-ephemeral-session.html http/tests/privateClickMeasurement/store-private-click-measurement.html inspector/page/overrideSetting-PrivateClickMeasurementDebugModeEnabled.html * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parsePrivateClickMeasurement const): (WebCore::HTMLAnchorElement::handleClick): (WebCore::HTMLAnchorElement::parseAdClickAttribution const): Deleted. * html/HTMLAnchorElement.h: * html/HTMLAnchorElement.idl: * inspector/InspectorClient.h: * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::disable): (WebCore::InspectorPageAgent::overrideSetting): * inspector/agents/page/PageConsoleAgent.cpp: (WebCore::PageConsoleAgent::getLoggingChannels): * loader/FrameLoader.cpp: (WebCore::FrameLoader::changeLocation): (WebCore::FrameLoader::loadFrameRequest): (WebCore::FrameLoader::loadURL): * loader/FrameLoader.h: * loader/NavigationAction.h: (WebCore::NavigationAction::privateClickMeasurement const): (WebCore::NavigationAction::setPrivateClickMeasurement): (WebCore::NavigationAction::adClickAttribution const): Deleted. (WebCore::NavigationAction::setAdClickAttribution): Deleted. * loader/PrivateClickMeasurement.cpp: Renamed from Source/WebCore/loader/AdClickAttribution.cpp. (WebCore::PrivateClickMeasurement::isValid const): (WebCore::PrivateClickMeasurement::parseConversionRequest): (WebCore::PrivateClickMeasurement::convertAndGetEarliestTimeToSend): (WebCore::PrivateClickMeasurement::markAsExpired): (WebCore::PrivateClickMeasurement::hasExpired const): (WebCore::PrivateClickMeasurement::hasHigherPriorityThan const): (WebCore::PrivateClickMeasurement::reportURL const): (WebCore::PrivateClickMeasurement::json const): (WebCore::PrivateClickMeasurement::markConversionAsSent): (WebCore::PrivateClickMeasurement::wasConversionSent const): (WebCore::PrivateClickMeasurement::toString const): (WebCore::PrivateClickMeasurement::debugModeEnabled): * loader/PrivateClickMeasurement.h: Renamed from Source/WebCore/loader/AdClickAttribution.h. (WebCore::PrivateClickMeasurement::Campaign::Campaign): (WebCore::PrivateClickMeasurement::Campaign::isValid const): (WebCore::PrivateClickMeasurement::Source::Source): (WebCore::PrivateClickMeasurement::Source::operator== const): (WebCore::PrivateClickMeasurement::Source::matches const): (WebCore::PrivateClickMeasurement::Source::isHashTableDeletedValue const): (WebCore::PrivateClickMeasurement::Source::deletedValue): (WebCore::PrivateClickMeasurement::Source::constructDeletedValue): (WebCore::PrivateClickMeasurement::Source::deleteValue): (WebCore::PrivateClickMeasurement::Source::isDeletedValue const): (WebCore::PrivateClickMeasurement::SourceHash::hash): (WebCore::PrivateClickMeasurement::SourceHash::equal): (WebCore::PrivateClickMeasurement::Destination::Destination): (WebCore::PrivateClickMeasurement::Destination::operator== const): (WebCore::PrivateClickMeasurement::Destination::matches const): (WebCore::PrivateClickMeasurement::Destination::isHashTableDeletedValue const): (WebCore::PrivateClickMeasurement::Destination::deletedValue): (WebCore::PrivateClickMeasurement::Destination::constructDeletedValue): (WebCore::PrivateClickMeasurement::Destination::deleteValue): (WebCore::PrivateClickMeasurement::Destination::isDeletedValue const): (WebCore::PrivateClickMeasurement::DestinationHash::hash): (WebCore::PrivateClickMeasurement::DestinationHash::equal): (WebCore::PrivateClickMeasurement::Priority::Priority): (WebCore::PrivateClickMeasurement::Conversion::Conversion): (WebCore::PrivateClickMeasurement::Conversion::isValid const): (WebCore::PrivateClickMeasurement::PrivateClickMeasurement): (WebCore::PrivateClickMeasurement::source const): (WebCore::PrivateClickMeasurement::destination const): (WebCore::PrivateClickMeasurement::earliestTimeToSend const): (WebCore::PrivateClickMeasurement::isEmpty const): (WebCore::PrivateClickMeasurement::encode const): (WebCore::PrivateClickMeasurement::decode): (WebCore::PrivateClickMeasurement::Conversion::encode const): (WebCore::PrivateClickMeasurement::Conversion::decode): (WTF::HashTraits<WebCore::PrivateClickMeasurement::Source>::emptyValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::Source>::constructDeletedValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::Source>::isDeletedValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::Destination>::emptyValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::Destination>::constructDeletedValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::Destination>::isDeletedValue): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::privateClickMeasurementDebugModeEnabled const): (WebCore::RuntimeEnabledFeatures::setPrivateClickMeasurementDebugModeEnabled): (WebCore::RuntimeEnabledFeatures::adClickAttributionDebugModeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setAdClickAttributionDebugModeEnabled): Deleted. * platform/Logging.h: 2020-11-11 Peng Liu <peng.liu6@apple.com> Update RemoteMediaPlayerMIMETypeCache to add the support for AVFoundationMSE media engine https://bugs.webkit.org/show_bug.cgi?id=218788 Reviewed by Eric Carlson. With this patch, we can create MSE media players (AVFoundationMSE) in the GPU process. This patch cleans up `MIMETypeCache`, `AVAssetMIMETypeCache`, and `AVStreamDataParserMIMETypeCache`. A media player factory and `SourceBufferParserAVFObjC` will only need to use one `MIMETypeCache`, either `AVAssetMIMETypeCache` or `AVStreamDataParserMIMETypeCache`, but not both. To be consistent with `MediaPlayerPrivateAVFoundationObjC`, this patch renames `supportsType()` of `MediaPlayerPrivateMediaSourceAVFObjC` to `supportsTypeAndCodecs()`. * platform/graphics/MIMETypeCache.h: * platform/graphics/MediaPlayer.cpp: (WebCore::buildMediaEnginesVector): * platform/graphics/MediaPlayer.h: * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm: (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType): (WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType): * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h: * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm: * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h: * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm: (WebCore::AVStreamDataParserMIMETypeCache::isAvailable const): (WebCore::AVStreamDataParserMIMETypeCache::canDecodeType): (WebCore::AVStreamDataParserMIMETypeCache::supportedTypes): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsTypeAndCodecs): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Deleted. * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm: (WebCore::SourceBufferParserAVFObjC::isContentTypeSupported): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType): 2020-11-11 Tim Horton <timothy_horton@apple.com> Add minimal support for deep color IOSurface backing store to ImageBuffer https://bugs.webkit.org/show_bug.cgi?id=218816 Reviewed by Simon Fraser. No new tests; will be covered by all deep color tests when GPU Process DOM rendering lands. Make it possible to pass a ColorFormat into the ImageBuffer constructor, and add RGB10 and RGB10A8 ColorFormats. We don't currently support get/putImageData for deep color buffers, because that is not needed for ImageBuffers backing RemoteLayerBackingStore (the motivation for this), but if we eventually wanted to more generally support deep color ImageBuffers, that's most of the remaining work. Also, standardize on BGRA8 as the default ColorFormat for buffers. iOS, Cairo, IOSurface, and ShareableBitmap all already use BGRA8 by default; only ImageBuffer with CGBitmap backing store on macOS used RGBA8. So, for sanity's sake (and so that it's easy to have a default passed into the constructor), standardize on BGRA8. * html/CustomPaintCanvas.cpp: (WebCore::CustomPaintCanvas::copiedImage const): * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createImageBuffer const): * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::createBufferForPainting const): * html/ImageBitmap.cpp: (WebCore::ImageBitmap::createImageBuffer): * page/Chrome.cpp: (WebCore::Chrome::createImageBuffer const): * page/Chrome.h: * page/ChromeClient.h: (WebCore::ChromeClient::createImageBuffer const): * platform/HostWindow.h: * platform/graphics/ConcreteImageBuffer.h: (WebCore::ConcreteImageBuffer::create): * platform/graphics/ImageBuffer.cpp: (WebCore::ImageBuffer::create): * platform/graphics/ImageBuffer.h: Plumbing ColorFormat around. * platform/graphics/ImageBufferBackend.cpp: (WebCore::ImageBufferBackend::ImageBufferBackend): (WebCore::ImageBufferBackend::toBGRAData const): (WebCore::ImageBufferBackend::copyImagePixels const): (WebCore::ImageBufferBackend::getImageData const): (WebCore::ImageBufferBackend::putImageData): Assert that copyImagePixels is always operating on a 8-bit buffer, since that's all it supports for now. * platform/graphics/ImageBufferBackend.h: (WebCore::ImageBufferBackend::colorFormat const): (WebCore::ImageBufferBackend::bytesPerRow const): (WebCore::ImageBufferBackend::backendColorFormat const): Deleted. * platform/graphics/RemoteVideoSample.cpp: (WebCore::transferBGRAPixelBufferToIOSurface): * platform/graphics/cairo/ImageBufferCairoBackend.h: * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp: (WebCore::ImageBufferCairoImageSurfaceBackend::create): (WebCore::ImageBufferCairoImageSurfaceBackend::ImageBufferCairoImageSurfaceBackend): * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.h: * platform/graphics/cg/ImageBufferCGBackend.cpp: (WebCore::createBitmapImageAfterScalingIfNeeded): (WebCore::ImageBufferCGBackend::toCFData const): (WebCore::copyImagePixelsAccelerated): * platform/graphics/cg/ImageBufferCGBitmapBackend.cpp: (WebCore::ImageBufferCGBitmapBackend::create): (WebCore::ImageBufferCGBitmapBackend::ImageBufferCGBitmapBackend): (WebCore::ImageBufferCGBitmapBackend::copyNativeImage const): Adopt ColorFormat and standardize on BGRA8. * platform/graphics/cg/ImageBufferCGBitmapBackend.h: * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: (WebCore::ImageBufferIOSurfaceBackend::create): (WebCore::ImageBufferIOSurfaceBackend::ImageBufferIOSurfaceBackend): (WebCore::ImageBufferIOSurfaceBackend::backendColorFormat const): Deleted. * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: (WebCore::IOSurface::IOSurface): (WebCore::IOSurface::ensurePlatformContext): (WebCore::IOSurface::format const): (WebCore::IOSurface::formatForColorFormat): (WebCore::operator<<): * platform/graphics/displaylists/DisplayListImageBuffer.h: (WebCore::DisplayList::ImageBuffer::create): 2020-11-11 Said Abou-Hallawa <said@apple.com> [GPU Process] Cache the NativeImage in GPU Process and allow referencing it with its RemoteResourceIdentifier https://bugs.webkit.org/show_bug.cgi?id=217596 Reviewed by Simon Fraser. In this patch all the drawImage functions will not be recorded as display list items. Instead we are going to let them proceed till they reach lower level calls such as drawNativeImage(). * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::subsamplingLevelForScaleFactor): Because we no longer record DrawImage, calling BitmapImage::draw() is now allowed even if the GraphicsContext is backed by a DisplayList::Recorder. If the image sub-sampling is allowed, which we do for iOS, this function is going to be called. We need to guard using the platformContext by calling hasPlatformContext() first. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawImage): (WebCore::GraphicsContext::drawTiledImage): We have to let these function proceed till they end up calling the DOM rendering for SVGImage, PDFDocumentImage::draw for pdf image and drawNativeImage for the rest. * platform/graphics/ImageBuffer.h: Make ImageBuffer a CanMakeWeakPtr so we can have a HashMap whose values are of type WeakPtr<ImageBuffer>. * platform/graphics/NativeImage.cpp: (WebCore::NativeImage::create): (WebCore::NativeImage::NativeImage): (WebCore::NativeImage::~NativeImage): * platform/graphics/NativeImage.h: (WebCore::NativeImage::renderingResourceIdentifier const): (WebCore::NativeImage::setObserver): Add an observer to NativeImage whose job is to observe when it is being destroyed. Add also an renderingResourceIdentifier so it can be used to reference the NativeImage in a NativeImageHashMap. * platform/graphics/NativeImageReference.h: Added. This definition can be used to encode/decode a Ref<NativeImage> for IPC messages. * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::m_nativeImages): (WebCore::DisplayList::DisplayList::operator=): (WebCore::DisplayList::DisplayList::clear): * platform/graphics/displaylists/DisplayList.h: (WebCore::DisplayList::DisplayList::nativeImages const): (WebCore::DisplayList::DisplayList::cacheImageBuffer): (WebCore::DisplayList::DisplayList::cacheNativeImage): Add the ability to cache the NativeImage in DisplayList such that its renderingResourceIdentifier can be used when recording DrawNativeImage and m_nativeImages can be used to access the NativeImage when replaying back DrawNativeImage. * platform/graphics/displaylists/DisplayListItemBuffer.cpp: (WebCore::DisplayList::ItemHandle::destroy): * platform/graphics/displaylists/DisplayListItemType.cpp: (WebCore::DisplayList::isInlineItem): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::operator<<): (WebCore::DisplayList::DrawNativeImage::apply const): (WebCore::DisplayList::DrawNativeImage::DrawNativeImage): Deleted. * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::DrawImageBuffer::DrawImageBuffer): (WebCore::DisplayList::DrawImageBuffer::imageBufferIdentifier const): (WebCore::DisplayList::DrawNativeImage::DrawNativeImage): (WebCore::DisplayList::DrawNativeImage::imageIdentifier const): (WebCore::DisplayList::DrawImageBuffer::renderingResourceIdentifier const): Deleted. (WebCore::DisplayList::DrawNativeImage::encode const): Deleted. (WebCore::DisplayList::DrawNativeImage::decode): Deleted. DrawNativeImage is an inline item now. No encoding/decoding is needed. * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::drawImageBuffer): (WebCore::DisplayList::Recorder::drawNativeImage): * platform/graphics/displaylists/DisplayListRecorder.h: (WebCore::DisplayList::Recorder::Delegate::cacheNativeImage): Ask the DisplayList::Recorder::Delegate to cache the NativeImage. * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::Replayer::Replayer): (WebCore::DisplayList::Replayer::applyItem): * platform/graphics/displaylists/DisplayListReplayer.h: Resolve the renderingResourceIdentifier of DrawNativeImage to a NativeImage from the m_nativeImages before drawing it. 2020-11-11 Sam Weinig <weinig@apple.com> Remove unused ExperimentalNotificationsEnabled setting https://bugs.webkit.org/show_bug.cgi?id=218813 Reviewed by Tim Horton. * page/Settings.yaml: Remove ExperimentalNotificationsEnabled. It was unused. 2020-11-11 Brian Burg <bburg@apple.com> [Cocoa] Inspector Extensions: Add _WKInspectorExtension and related plumbing https://bugs.webkit.org/show_bug.cgi?id=217783 <rdar://problem/69968787> Reviewed by Devin Rousso. * inspector/InspectorFrontendClient.h: * inspector/InspectorFrontendClientLocal.h: In order for WebInspectorUIExtensionController to work with remote and local inspectors, it stores a weak pointer the inspector's InspectorFrontendClient. Expose the frontend's page so that the frontend API dispatcher can dispatch to it. 2020-11-11 Chris Dumez <cdumez@apple.com> [GPUProcess] Seamlessly resume WebAudio playback if the GPU Process crashes https://bugs.webkit.org/show_bug.cgi?id=218806 Reviewed by Geoffrey Garen. * platform/audio/cocoa/AudioDestinationCocoa.h: Export function so it can be called from WebKit layer. 2020-11-11 Rob Buis <rbuis@igalia.com> Protect ScheduledURLNavigation member https://bugs.webkit.org/show_bug.cgi?id=218593 Reviewed by Alex Christensen. Protect ScheduledURLNavigation member m_url by using a copy since ScheduledURLNavigation itself is not protected and may be cancelled (and thus deleted) just at the time it is sending a message to the UIProcess which encodes the passed m_url member variable. * loader/NavigationScheduler.cpp: 2020-11-11 Antti Koivisto <antti@apple.com> Replace confusing extraWidthToEndOfLine parameter with an enum https://bugs.webkit.org/show_bug.cgi?id=218793 Reviewed by Zalan Bujtas. When a client of localCaretRect wants a rect that extends from caret to the end of the line it gets the length of the remaining line awkwardly via extraWidthToEndOfLine out-parameter and then uses it to mutate the caret rect. Instead just pass an enum telling that an extended rect is required and compute it in when constructing the rect. * editing/Editor.cpp: (WebCore::Editor::firstRectForRange const): * editing/RenderedPosition.cpp: (WebCore::RenderedPosition::absoluteRect const): * editing/RenderedPosition.h: * rendering/RenderBlock.cpp: (WebCore::RenderBlock::localCaretRect const): * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::computeCaretRect const): * rendering/RenderBlockFlow.h: * rendering/RenderBox.cpp: (WebCore::RenderBox::localCaretRect const): * rendering/RenderBox.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::localCaretRectForEmptyElement const): * rendering/RenderBoxModelObject.h: * rendering/RenderInline.cpp: (WebCore::RenderInline::localCaretRect const): * rendering/RenderInline.h: * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::localCaretRect const): * rendering/RenderLineBreak.h: * rendering/RenderObject.cpp: (WebCore::RenderObject::localCaretRect const): * rendering/RenderObject.h: * rendering/RenderObjectEnums.h: * rendering/RenderText.cpp: (WebCore::RenderText::localCaretRect const): * rendering/RenderText.h: * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::localCaretRect const): * rendering/svg/RenderSVGInlineText.h: 2020-11-11 Andres Gonzalez <andresg_22@apple.com> Implementation for AXIsolatedObject methods that return a VisiblePositionRange. https://bugs.webkit.org/show_bug.cgi?id=218783 Reviewed by Chris Fleizach. Fix for the following tests in isolated tree mode: accessibility/mac/attributed-string-with-listitem-multiple-lines.html accessibility/mac/character-offset-from-upstream-position.html Methods that return a VisiblePositionRange need to be called on the main thread. The implementation of each of these methods forward the call to the associated AXObject. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::visiblePositionRange const): (WebCore::AXIsolatedObject::visiblePositionRangeForLine const): (WebCore::AXIsolatedObject::visiblePositionRangeForUnorderedPositions const): (WebCore::AXIsolatedObject::positionOfLeftWord const): (WebCore::AXIsolatedObject::positionOfRightWord const): (WebCore::AXIsolatedObject::leftLineVisiblePositionRange const): (WebCore::AXIsolatedObject::rightLineVisiblePositionRange const): (WebCore::AXIsolatedObject::sentenceForPosition const): (WebCore::AXIsolatedObject::paragraphForPosition const): (WebCore::AXIsolatedObject::styleRangeForPosition const): (WebCore::AXIsolatedObject::visiblePositionRangeForRange const): (WebCore::AXIsolatedObject::lineRangeForPosition const): * accessibility/isolatedtree/AXIsolatedObject.h: 2020-11-11 Eric Carlson <eric.carlson@apple.com> USB microphone not recognized iOS Safari https://bugs.webkit.org/show_bug.cgi?id=211192 <rdar://problem/62607313> Reviewed by Youenn Fablet. Testing requires hardware, tested manually. * platform/mediastream/CaptureDevice.h: Add concept of default device. (WebCore::CaptureDevice::isDefault const): (WebCore::CaptureDevice::setIsDefault): (WebCore::CaptureDevice::encode const): (WebCore::CaptureDevice::decode): * platform/mediastream/ios/AVAudioSessionCaptureDevice.h: Don't retain port description, it is never used. * platform/mediastream/ios/AVAudioSessionCaptureDevice.mm: (WebCore::AVAudioSessionCaptureDevice::create): Add default input parameter. (WebCore::AVAudioSessionCaptureDevice::AVAudioSessionCaptureDevice): Set enabled and default attributes. * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h: * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: (-[WebAVAudioSessionAvailableInputsListener initWithCallback:audioSession:]): Take parent object and audio session. Listen for session route change notification. (-[WebAVAudioSessionAvailableInputsListener invalidate]): (-[WebAVAudioSessionAvailableInputsListener routeDidChange:]): (WebCore::AVAudioSessionCaptureDeviceManager::AVAudioSessionCaptureDeviceManager): Allocate and use an auxiliary audio session because it isn't possible to enumerate all audio inputs without one. (WebCore::AVAudioSessionCaptureDeviceManager::audioSessionDeviceWithUID): No need to call refreshAudioCaptureDevices, audioSessionCaptureDevices does it if necessary. (WebCore::AVAudioSessionCaptureDeviceManager::scheduleUpdateCaptureDevices): New, refresh devices on a task queue because we frequently get more than one notification when a route changes. (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): Sort devices so the default is always first. Only call deviceChanged when something actually changes. (-[WebAVAudioSessionAvailableInputsListener initWithCallback:]): Deleted. (-[WebAVAudioSessionAvailableInputsListener observeValueForKeyPath:ofObject:change:context:]): Deleted. * platform/mediastream/mac/CoreAudioCaptureDevice.cpp: (WebCore::getDeviceInfo): Deal with input and output devices. Translate the data source name if possible. (WebCore::CoreAudioCaptureDevice::create): (WebCore::CoreAudioCaptureDevice::CoreAudioCaptureDevice): Set new `default` attribute. (WebCore::CoreAudioCaptureDevice::defaultDevice): New. * platform/mediastream/mac/CoreAudioCaptureDevice.h: * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: (WebCore::CoreAudioCaptureDeviceManager::scheduleUpdateCaptureDevices): New, coalesce calls to refreshAudioCaptureDevices. (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices): (WebCore::computeAudioDeviceList): No need to check for the default device explicitly. (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices): (WebCore::getDefaultCaptureInputDevice): Deleted. (WebCore::getDefaultCaptureOutputDevice): Deleted. * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h: 2020-11-11 Noam Rosenthal <noam@webkit.org> ContentfulPaintChecker should not trigger plugin snapshotting https://bugs.webkit.org/show_bug.cgi?id=218777 <rdar://problem/71256352> Reviewed by Simon Fraser. Widgets should not be notified when detecting contentful paint. No new tests, a minor optimization. * page/FrameView.cpp: (WebCore::FrameView::willPaintContents): 2020-11-11 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r269680. https://bugs.webkit.org/show_bug.cgi?id=218803 Broke a webgl test on ios-wk2 Reverted changeset: "Remove uses of MakeCurrent from WebGL implementation" https://bugs.webkit.org/show_bug.cgi?id=218178 https://trac.webkit.org/changeset/269680 2020-11-11 Adrian Perez de Castro <aperez@igalia.com> [GStreamer] Fix build due to unhandled AudioConfiguration Optional<T> members introduced in r269631 Unreviewed build fix. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::isConfigurationSupported const): Use .valueOr(0) in arguments to GST_DEBUG() macro to avoid passing non-POD types through varargs. 2020-11-11 Antti Koivisto <antti@apple.com> [LFC][Integration] Pass replaced box baseline to IFC https://bugs.webkit.org/show_bug.cgi?id=218801 Reviewed by Zalan Bujtas. This fixes <attachment> element tests (like fast/attachment/attachment-title.html) with full replaced element support enabled. It is also needed for the future inline-block support. (WebCore::LayoutIntegration::LineLayout::updateReplacedDimensions): 2020-11-11 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Add modern line layout statistics https://bugs.webkit.org/show_bug.cgi?id=218782 Reviewed by Antti Koivisto. notifyutil -p com.apple.WebKit.showModernLineLayoutCoverage and com.apple.WebKit.showModernLineLayoutReasons. e.g. nytimes.com: --------------------------------------------------- Modern line layout coverage: 64.20% Number of blocks: total(196) legacy(71) Content length: total(8313) legacy(2976) nested renderers: 20.77% flow does not establishes inline formatting context: 3.04% non top level column: 6.56% missing glyph or glyph needs another font: 0.02% unsupported TextFragment: 0.31% text-shadow: 12.80% --------------------------------------------------- * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::printReason): (WebCore::LayoutIntegration::printReasons): (WebCore::LayoutIntegration::printTextForSubtree): (WebCore::LayoutIntegration::textLengthForSubtree): (WebCore::LayoutIntegration::collectNonEmptyLeafRenderBlockFlows): (WebCore::LayoutIntegration::collectNonEmptyLeafRenderBlockFlowsForCurrentPage): (WebCore::LayoutIntegration::printModernLineLayoutBlockList): (WebCore::LayoutIntegration::printModernLineLayoutCoverage): (WebCore::LayoutIntegration::canUseForLineLayoutWithReason): 2020-11-11 Kimmo Kinnunen <kkinnunen@apple.com> Remove uses of MakeCurrent from WebGL implementation https://bugs.webkit.org/show_bug.cgi?id=218178 <rdar://problem/70714561> Reviewed by Dean Jackson. Work towards WebGL implementation which uses GraphicsContextGL abstract base class instead of GraphicsContextGLOpenGL concrete class. Move GraphicsContextGLOpenGL::makeContextCurrent() to private section, as it is an implementation detail of the class. The function is intended to be called at the start of all public functions that might call into OpenGL to ensure that OpenGL uses the right context. Check all return values of makeCurrentContext(). We should not call into OpenGL if the context is not current, as that can lead to corruption, crashes or incorrect results. Add a compile-time warning if the return value is not used. Non-EWS compiled flavors of GraphicsContextGLOpenGL are changed only in best effort manner. Ensure that all functions actually call the makeCurrentContext() function before calling into OpenGL. Non-ANGLE flavors of GraphicsContextGLOpenGL are ensured only in best effort manner. ANGLE flavor of GraphicsContextGLOpenGL function implementations should call directly the ANGLE functions instead of calling them through getExtensions() interface. There is no conditional code inside and the implementation knows exactly which function to call in all situations. There is no abstraction between GraphicsContextGLOpenGL and ExtensionsGL, rather they are in practice the same object currently, semi-artificially split to two. This is true of other flavors of GraphicsContextGLOpenGL, but those are left unchanged in this regard. No new tests, a refactor. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): (WebCore::WebGLRenderingContextBase::initializeNewContext): (WebCore::WebGLRenderingContextBase::validateElementArraySize): (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise): (WebCore::WebGLRenderingContextBase::validateDrawElements): (WebCore::WebGLRenderingContextBase::readPixels): (WebCore::WebGLRenderingContextBase::vertexAttribfvImpl): (WebCore::WebGLRenderingContextBase::initVertexAttrib0): * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::supports): (WebCore::ExtensionsGLANGLE::ensureEnabled): (WebCore::ExtensionsGLANGLE::getTranslatedShaderSourceANGLE): (WebCore::ExtensionsGLANGLE::blitFramebuffer): (WebCore::ExtensionsGLANGLE::renderbufferStorageMultisample): (WebCore::ExtensionsGLANGLE::createVertexArrayOES): (WebCore::ExtensionsGLANGLE::deleteVertexArrayOES): (WebCore::ExtensionsGLANGLE::isVertexArrayOES): (WebCore::ExtensionsGLANGLE::bindVertexArrayOES): (WebCore::ExtensionsGLANGLE::drawBuffersEXT): (WebCore::ExtensionsGLANGLE::drawArraysInstanced): (WebCore::ExtensionsGLANGLE::drawElementsInstanced): (WebCore::ExtensionsGLANGLE::vertexAttribDivisor): (WebCore::ExtensionsGLANGLE::getBooleanvRobustANGLE): (WebCore::ExtensionsGLANGLE::getBufferParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getFloatvRobustANGLE): (WebCore::ExtensionsGLANGLE::getFramebufferAttachmentParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getIntegervRobustANGLE): (WebCore::ExtensionsGLANGLE::getProgramivRobustANGLE): (WebCore::ExtensionsGLANGLE::getRenderbufferParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getShaderivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getUniformfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getUniformivRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribivRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribPointervRobustANGLE): (WebCore::ExtensionsGLANGLE::readPixelsRobustANGLE): (WebCore::ExtensionsGLANGLE::texImage2DRobustANGLE): (WebCore::ExtensionsGLANGLE::texParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::texParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::texSubImage2DRobustANGLE): (WebCore::ExtensionsGLANGLE::compressedTexImage2DRobustANGLE): (WebCore::ExtensionsGLANGLE::compressedTexSubImage2DRobustANGLE): (WebCore::ExtensionsGLANGLE::compressedTexImage3DRobustANGLE): (WebCore::ExtensionsGLANGLE::compressedTexSubImage3DRobustANGLE): (WebCore::ExtensionsGLANGLE::texImage3DRobustANGLE): (WebCore::ExtensionsGLANGLE::texSubImage3DRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryivRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryObjectuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getBufferPointervRobustANGLE): (WebCore::ExtensionsGLANGLE::getIntegeri_vRobustANGLE): (WebCore::ExtensionsGLANGLE::getInternalformativRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribIivRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getUniformuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getActiveUniformBlockivRobustANGLE): (WebCore::ExtensionsGLANGLE::getInteger64vRobustANGLE): (WebCore::ExtensionsGLANGLE::getInteger64i_vRobustANGLE): (WebCore::ExtensionsGLANGLE::getBufferParameteri64vRobustANGLE): (WebCore::ExtensionsGLANGLE::samplerParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::samplerParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getSamplerParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getSamplerParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getFramebufferParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getProgramInterfaceivRobustANGLE): (WebCore::ExtensionsGLANGLE::getBooleani_vRobustANGLE): (WebCore::ExtensionsGLANGLE::getMultisamplefvRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getPointervRobustANGLERobustANGLE): (WebCore::ExtensionsGLANGLE::readnPixelsRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformivRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformuivRobustANGLE): (WebCore::ExtensionsGLANGLE::texParameterIivRobustANGLE): (WebCore::ExtensionsGLANGLE::texParameterIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexParameterIivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexParameterIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::samplerParameterIivRobustANGLE): (WebCore::ExtensionsGLANGLE::samplerParameterIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getSamplerParameterIivRobustANGLE): (WebCore::ExtensionsGLANGLE::getSamplerParameterIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryObjectivRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryObjecti64vRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryObjectui64vRobustANGLE): * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): (WebCore::GraphicsContextGLOpenGL::renderbufferStorage): (WebCore::GraphicsContextGLOpenGL::getIntegerv): (WebCore::GraphicsContextGLOpenGL::getIntegeri_v): (WebCore::GraphicsContextGLOpenGL::getShaderPrecisionFormat): (WebCore::GraphicsContextGLOpenGL::depthRange): (WebCore::GraphicsContextGLOpenGL::clearDepth): (WebCore::GraphicsContextGLOpenGL::readPixels): (WebCore::GraphicsContextGLOpenGL::prepareTexture): (WebCore::GraphicsContextGLOpenGL::readRenderingResults): (WebCore::GraphicsContextGLOpenGL::reshape): (WebCore::GraphicsContextGLOpenGL::activeTexture): (WebCore::GraphicsContextGLOpenGL::attachShader): (WebCore::GraphicsContextGLOpenGL::bindAttribLocation): (WebCore::GraphicsContextGLOpenGL::bindBuffer): (WebCore::GraphicsContextGLOpenGL::bindFramebuffer): (WebCore::GraphicsContextGLOpenGL::bindRenderbuffer): (WebCore::GraphicsContextGLOpenGL::bindTexture): (WebCore::GraphicsContextGLOpenGL::blendColor): (WebCore::GraphicsContextGLOpenGL::blendEquation): (WebCore::GraphicsContextGLOpenGL::blendEquationSeparate): (WebCore::GraphicsContextGLOpenGL::blendFunc): (WebCore::GraphicsContextGLOpenGL::blendFuncSeparate): (WebCore::GraphicsContextGLOpenGL::bufferData): (WebCore::GraphicsContextGLOpenGL::bufferSubData): (WebCore::GraphicsContextGLOpenGL::mapBufferRange): (WebCore::GraphicsContextGLOpenGL::unmapBuffer): (WebCore::GraphicsContextGLOpenGL::copyBufferSubData): (WebCore::GraphicsContextGLOpenGL::getInternalformativ): (WebCore::GraphicsContextGLOpenGL::renderbufferStorageMultisample): (WebCore::GraphicsContextGLOpenGL::texStorage2D): (WebCore::GraphicsContextGLOpenGL::texStorage3D): (WebCore::GraphicsContextGLOpenGL::getActiveUniforms): (WebCore::GraphicsContextGLOpenGL::checkFramebufferStatus): (WebCore::GraphicsContextGLOpenGL::clearColor): (WebCore::GraphicsContextGLOpenGL::clear): (WebCore::GraphicsContextGLOpenGL::clearStencil): (WebCore::GraphicsContextGLOpenGL::colorMask): (WebCore::GraphicsContextGLOpenGL::compileShader): (WebCore::GraphicsContextGLOpenGL::compileShaderDirect): (WebCore::GraphicsContextGLOpenGL::copyTexImage2D): (WebCore::GraphicsContextGLOpenGL::copyTexSubImage2D): (WebCore::GraphicsContextGLOpenGL::cullFace): (WebCore::GraphicsContextGLOpenGL::depthFunc): (WebCore::GraphicsContextGLOpenGL::depthMask): (WebCore::GraphicsContextGLOpenGL::detachShader): (WebCore::GraphicsContextGLOpenGL::disable): (WebCore::GraphicsContextGLOpenGL::disableVertexAttribArray): (WebCore::GraphicsContextGLOpenGL::drawArrays): (WebCore::GraphicsContextGLOpenGL::drawElements): (WebCore::GraphicsContextGLOpenGL::enable): (WebCore::GraphicsContextGLOpenGL::enableVertexAttribArray): (WebCore::GraphicsContextGLOpenGL::finish): (WebCore::GraphicsContextGLOpenGL::flush): (WebCore::GraphicsContextGLOpenGL::framebufferRenderbuffer): (WebCore::GraphicsContextGLOpenGL::framebufferTexture2D): (WebCore::GraphicsContextGLOpenGL::frontFace): (WebCore::GraphicsContextGLOpenGL::generateMipmap): (WebCore::GraphicsContextGLOpenGL::getActiveAttribImpl): (WebCore::GraphicsContextGLOpenGL::getActiveUniformImpl): (WebCore::GraphicsContextGLOpenGL::getAttachedShaders): (WebCore::GraphicsContextGLOpenGL::getAttribLocation): (WebCore::GraphicsContextGLOpenGL::moveErrorsToSyntheticErrorList): (WebCore::GraphicsContextGLOpenGL::getError): (WebCore::GraphicsContextGLOpenGL::getString): (WebCore::GraphicsContextGLOpenGL::hint): (WebCore::GraphicsContextGLOpenGL::isBuffer): (WebCore::GraphicsContextGLOpenGL::isEnabled): (WebCore::GraphicsContextGLOpenGL::isFramebuffer): (WebCore::GraphicsContextGLOpenGL::isProgram): (WebCore::GraphicsContextGLOpenGL::isRenderbuffer): (WebCore::GraphicsContextGLOpenGL::isShader): (WebCore::GraphicsContextGLOpenGL::isTexture): (WebCore::GraphicsContextGLOpenGL::lineWidth): (WebCore::GraphicsContextGLOpenGL::linkProgram): (WebCore::GraphicsContextGLOpenGL::pixelStorei): (WebCore::GraphicsContextGLOpenGL::polygonOffset): (WebCore::GraphicsContextGLOpenGL::sampleCoverage): (WebCore::GraphicsContextGLOpenGL::scissor): (WebCore::GraphicsContextGLOpenGL::shaderSource): (WebCore::GraphicsContextGLOpenGL::stencilFunc): (WebCore::GraphicsContextGLOpenGL::stencilFuncSeparate): (WebCore::GraphicsContextGLOpenGL::stencilMask): (WebCore::GraphicsContextGLOpenGL::stencilMaskSeparate): (WebCore::GraphicsContextGLOpenGL::stencilOp): (WebCore::GraphicsContextGLOpenGL::stencilOpSeparate): (WebCore::GraphicsContextGLOpenGL::texParameterf): (WebCore::GraphicsContextGLOpenGL::texParameteri): (WebCore::GraphicsContextGLOpenGL::uniform1f): (WebCore::GraphicsContextGLOpenGL::uniform1fv): (WebCore::GraphicsContextGLOpenGL::uniform2f): (WebCore::GraphicsContextGLOpenGL::uniform2fv): (WebCore::GraphicsContextGLOpenGL::uniform3f): (WebCore::GraphicsContextGLOpenGL::uniform3fv): (WebCore::GraphicsContextGLOpenGL::uniform4f): (WebCore::GraphicsContextGLOpenGL::uniform4fv): (WebCore::GraphicsContextGLOpenGL::uniform1i): (WebCore::GraphicsContextGLOpenGL::uniform1iv): (WebCore::GraphicsContextGLOpenGL::uniform2i): (WebCore::GraphicsContextGLOpenGL::uniform2iv): (WebCore::GraphicsContextGLOpenGL::uniform3i): (WebCore::GraphicsContextGLOpenGL::uniform3iv): (WebCore::GraphicsContextGLOpenGL::uniform4i): (WebCore::GraphicsContextGLOpenGL::uniform4iv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4fv): (WebCore::GraphicsContextGLOpenGL::useProgram): (WebCore::GraphicsContextGLOpenGL::validateProgram): (WebCore::GraphicsContextGLOpenGL::vertexAttrib1f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib1fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib2f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib2fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib3f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib3fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib4f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib4fv): (WebCore::GraphicsContextGLOpenGL::vertexAttribPointer): (WebCore::GraphicsContextGLOpenGL::vertexAttribIPointer): (WebCore::GraphicsContextGLOpenGL::viewport): (WebCore::GraphicsContextGLOpenGL::createVertexArray): (WebCore::GraphicsContextGLOpenGL::deleteVertexArray): (WebCore::GraphicsContextGLOpenGL::isVertexArray): (WebCore::GraphicsContextGLOpenGL::bindVertexArray): (WebCore::GraphicsContextGLOpenGL::getBooleanv): (WebCore::GraphicsContextGLOpenGL::getBufferParameteriv): (WebCore::GraphicsContextGLOpenGL::getFloatv): (WebCore::GraphicsContextGLOpenGL::getInteger64v): (WebCore::GraphicsContextGLOpenGL::getInteger64i_v): (WebCore::GraphicsContextGLOpenGL::getFramebufferAttachmentParameteriv): (WebCore::GraphicsContextGLOpenGL::getProgramiv): (WebCore::GraphicsContextGLOpenGL::getProgramInfoLog): (WebCore::GraphicsContextGLOpenGL::getRenderbufferParameteriv): (WebCore::GraphicsContextGLOpenGL::getShaderiv): (WebCore::GraphicsContextGLOpenGL::getShaderInfoLog): (WebCore::GraphicsContextGLOpenGL::getTexParameterfv): (WebCore::GraphicsContextGLOpenGL::getTexParameteriv): (WebCore::GraphicsContextGLOpenGL::getUniformfv): (WebCore::GraphicsContextGLOpenGL::getUniformiv): (WebCore::GraphicsContextGLOpenGL::getUniformuiv): (WebCore::GraphicsContextGLOpenGL::getUniformLocation): (WebCore::GraphicsContextGLOpenGL::getVertexAttribfv): (WebCore::GraphicsContextGLOpenGL::getVertexAttribiv): (WebCore::GraphicsContextGLOpenGL::getVertexAttribOffset): (WebCore::GraphicsContextGLOpenGL::texSubImage2D): (WebCore::GraphicsContextGLOpenGL::compressedTexImage2D): (WebCore::GraphicsContextGLOpenGL::compressedTexSubImage2D): (WebCore::GraphicsContextGLOpenGL::createBuffer): (WebCore::GraphicsContextGLOpenGL::createFramebuffer): (WebCore::GraphicsContextGLOpenGL::createProgram): (WebCore::GraphicsContextGLOpenGL::createRenderbuffer): (WebCore::GraphicsContextGLOpenGL::createShader): (WebCore::GraphicsContextGLOpenGL::createTexture): (WebCore::GraphicsContextGLOpenGL::deleteBuffer): (WebCore::GraphicsContextGLOpenGL::deleteFramebuffer): (WebCore::GraphicsContextGLOpenGL::deleteProgram): (WebCore::GraphicsContextGLOpenGL::deleteRenderbuffer): (WebCore::GraphicsContextGLOpenGL::deleteShader): (WebCore::GraphicsContextGLOpenGL::deleteTexture): (WebCore::GraphicsContextGLOpenGL::texImage2DDirect): (WebCore::GraphicsContextGLOpenGL::drawArraysInstanced): (WebCore::GraphicsContextGLOpenGL::drawElementsInstanced): (WebCore::GraphicsContextGLOpenGL::vertexAttribDivisor): (WebCore::GraphicsContextGLOpenGL::getUniformBlockIndex): (WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockName): (WebCore::GraphicsContextGLOpenGL::uniformBlockBinding): (WebCore::GraphicsContextGLOpenGL::createQuery): (WebCore::GraphicsContextGLOpenGL::beginQuery): (WebCore::GraphicsContextGLOpenGL::endQuery): (WebCore::GraphicsContextGLOpenGL::getQueryObjectuiv): (WebCore::GraphicsContextGLOpenGL::createTransformFeedback): (WebCore::GraphicsContextGLOpenGL::deleteTransformFeedback): (WebCore::GraphicsContextGLOpenGL::isTransformFeedback): (WebCore::GraphicsContextGLOpenGL::bindTransformFeedback): (WebCore::GraphicsContextGLOpenGL::beginTransformFeedback): (WebCore::GraphicsContextGLOpenGL::endTransformFeedback): (WebCore::GraphicsContextGLOpenGL::transformFeedbackVaryings): (WebCore::GraphicsContextGLOpenGL::getTransformFeedbackVarying): (WebCore::GraphicsContextGLOpenGL::bindBufferBase): (WebCore::GraphicsContextGLOpenGL::blitFramebuffer): (WebCore::GraphicsContextGLOpenGL::framebufferTextureLayer): (WebCore::GraphicsContextGLOpenGL::invalidateFramebuffer): (WebCore::GraphicsContextGLOpenGL::invalidateSubFramebuffer): (WebCore::GraphicsContextGLOpenGL::readBuffer): (WebCore::GraphicsContextGLOpenGL::copyTexSubImage3D): (WebCore::GraphicsContextGLOpenGL::getFragDataLocation): (WebCore::GraphicsContextGLOpenGL::uniform1ui): (WebCore::GraphicsContextGLOpenGL::uniform2ui): (WebCore::GraphicsContextGLOpenGL::uniform3ui): (WebCore::GraphicsContextGLOpenGL::uniform4ui): (WebCore::GraphicsContextGLOpenGL::uniform1uiv): (WebCore::GraphicsContextGLOpenGL::uniform2uiv): (WebCore::GraphicsContextGLOpenGL::uniform3uiv): (WebCore::GraphicsContextGLOpenGL::uniform4uiv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2x3fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3x2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2x4fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4x2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3x4fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4x3fv): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4i): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4iv): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4ui): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4uiv): (WebCore::GraphicsContextGLOpenGL::drawRangeElements): (WebCore::GraphicsContextGLOpenGL::drawBuffers): (WebCore::GraphicsContextGLOpenGL::clearBufferiv): (WebCore::GraphicsContextGLOpenGL::clearBufferuiv): (WebCore::GraphicsContextGLOpenGL::clearBufferfv): (WebCore::GraphicsContextGLOpenGL::clearBufferfi): (WebCore::GraphicsContextGLOpenGL::deleteQuery): (WebCore::GraphicsContextGLOpenGL::isQuery): (WebCore::GraphicsContextGLOpenGL::getQuery): (WebCore::GraphicsContextGLOpenGL::createSampler): (WebCore::GraphicsContextGLOpenGL::deleteSampler): (WebCore::GraphicsContextGLOpenGL::isSampler): (WebCore::GraphicsContextGLOpenGL::bindSampler): (WebCore::GraphicsContextGLOpenGL::samplerParameteri): (WebCore::GraphicsContextGLOpenGL::samplerParameterf): (WebCore::GraphicsContextGLOpenGL::getSamplerParameterfv): (WebCore::GraphicsContextGLOpenGL::getSamplerParameteriv): (WebCore::GraphicsContextGLOpenGL::fenceSync): (WebCore::GraphicsContextGLOpenGL::isSync): (WebCore::GraphicsContextGLOpenGL::deleteSync): (WebCore::GraphicsContextGLOpenGL::clientWaitSync): (WebCore::GraphicsContextGLOpenGL::waitSync): (WebCore::GraphicsContextGLOpenGL::getSynciv): (WebCore::GraphicsContextGLOpenGL::pauseTransformFeedback): (WebCore::GraphicsContextGLOpenGL::resumeTransformFeedback): (WebCore::GraphicsContextGLOpenGL::bindBufferRange): (WebCore::GraphicsContextGLOpenGL::getUniformIndices): * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::updateCGLContext): * platform/graphics/opengl/ExtensionsGLOpenGL.cpp: (WebCore::ExtensionsGLOpenGL::blitFramebuffer): (WebCore::ExtensionsGLOpenGL::renderbufferStorageMultisample): (WebCore::ExtensionsGLOpenGL::createVertexArrayOES): (WebCore::ExtensionsGLOpenGL::deleteVertexArrayOES): (WebCore::ExtensionsGLOpenGL::isVertexArrayOES): (WebCore::ExtensionsGLOpenGL::bindVertexArrayOES): (WebCore::ExtensionsGLOpenGL::supportsExtension): (WebCore::ExtensionsGLOpenGL::drawBuffersEXT): (WebCore::ExtensionsGLOpenGL::drawArraysInstanced): (WebCore::ExtensionsGLOpenGL::drawElementsInstanced): (WebCore::ExtensionsGLOpenGL::vertexAttribDivisor): * platform/graphics/opengl/ExtensionsGLOpenGLES.cpp: (WebCore::ExtensionsGLOpenGLES::framebufferTexture2DMultisampleIMG): (WebCore::ExtensionsGLOpenGLES::renderbufferStorageMultisampleIMG): (WebCore::ExtensionsGLOpenGLES::renderbufferStorageMultisample): (WebCore::ExtensionsGLOpenGLES::createVertexArrayOES): (WebCore::ExtensionsGLOpenGLES::deleteVertexArrayOES): (WebCore::ExtensionsGLOpenGLES::isVertexArrayOES): (WebCore::ExtensionsGLOpenGLES::bindVertexArrayOES): (WebCore::ExtensionsGLOpenGLES::getGraphicsResetStatusARB): (WebCore::ExtensionsGLOpenGLES::readnPixelsEXT): (WebCore::ExtensionsGLOpenGLES::getnUniformfvEXT): (WebCore::ExtensionsGLOpenGLES::getnUniformivEXT): (WebCore::ExtensionsGLOpenGLES::drawArraysInstanced): (WebCore::ExtensionsGLOpenGLES::drawElementsInstanced): (WebCore::ExtensionsGLOpenGLES::vertexAttribDivisor): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp: (WebCore::GraphicsContextGLOpenGL::renderbufferStorage): (WebCore::GraphicsContextGLOpenGL::getIntegerv): (WebCore::GraphicsContextGLOpenGL::getShaderPrecisionFormat): (WebCore::GraphicsContextGLOpenGL::depthRange): (WebCore::GraphicsContextGLOpenGL::clearDepth): (WebCore::GraphicsContextGLOpenGL::readPixels): * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::prepareTexture): (WebCore::GraphicsContextGLOpenGL::readRenderingResults): (WebCore::GraphicsContextGLOpenGL::reshape): (WebCore::GraphicsContextGLOpenGL::activeTexture): (WebCore::GraphicsContextGLOpenGL::attachShader): (WebCore::GraphicsContextGLOpenGL::bindAttribLocation): (WebCore::GraphicsContextGLOpenGL::bindBuffer): (WebCore::GraphicsContextGLOpenGL::bindFramebuffer): (WebCore::GraphicsContextGLOpenGL::bindRenderbuffer): (WebCore::GraphicsContextGLOpenGL::bindTexture): (WebCore::GraphicsContextGLOpenGL::blendColor): (WebCore::GraphicsContextGLOpenGL::blendEquation): (WebCore::GraphicsContextGLOpenGL::blendEquationSeparate): (WebCore::GraphicsContextGLOpenGL::blendFunc): (WebCore::GraphicsContextGLOpenGL::blendFuncSeparate): (WebCore::GraphicsContextGLOpenGL::bufferData): (WebCore::GraphicsContextGLOpenGL::bufferSubData): (WebCore::GraphicsContextGLOpenGL::checkFramebufferStatus): (WebCore::GraphicsContextGLOpenGL::clearColor): (WebCore::GraphicsContextGLOpenGL::clear): (WebCore::GraphicsContextGLOpenGL::clearStencil): (WebCore::GraphicsContextGLOpenGL::colorMask): (WebCore::GraphicsContextGLOpenGL::compileShader): (WebCore::GraphicsContextGLOpenGL::compileShaderDirect): (WebCore::GraphicsContextGLOpenGL::copyTexImage2D): (WebCore::GraphicsContextGLOpenGL::copyTexSubImage2D): (WebCore::GraphicsContextGLOpenGL::cullFace): (WebCore::GraphicsContextGLOpenGL::depthFunc): (WebCore::GraphicsContextGLOpenGL::depthMask): (WebCore::GraphicsContextGLOpenGL::detachShader): (WebCore::GraphicsContextGLOpenGL::disable): (WebCore::GraphicsContextGLOpenGL::disableVertexAttribArray): (WebCore::GraphicsContextGLOpenGL::drawArrays): (WebCore::GraphicsContextGLOpenGL::drawElements): (WebCore::GraphicsContextGLOpenGL::enable): (WebCore::GraphicsContextGLOpenGL::enableVertexAttribArray): (WebCore::GraphicsContextGLOpenGL::finish): (WebCore::GraphicsContextGLOpenGL::flush): (WebCore::GraphicsContextGLOpenGL::framebufferRenderbuffer): (WebCore::GraphicsContextGLOpenGL::framebufferTexture2D): (WebCore::GraphicsContextGLOpenGL::frontFace): (WebCore::GraphicsContextGLOpenGL::generateMipmap): (WebCore::GraphicsContextGLOpenGL::getActiveAttribImpl): (WebCore::GraphicsContextGLOpenGL::getActiveUniformImpl): (WebCore::GraphicsContextGLOpenGL::getAttachedShaders): (WebCore::GraphicsContextGLOpenGL::getAttribLocation): (WebCore::GraphicsContextGLOpenGL::getAttribLocationDirect): (WebCore::GraphicsContextGLOpenGL::moveErrorsToSyntheticErrorList): (WebCore::GraphicsContextGLOpenGL::getError): (WebCore::GraphicsContextGLOpenGL::getString): (WebCore::GraphicsContextGLOpenGL::hint): (WebCore::GraphicsContextGLOpenGL::isBuffer): (WebCore::GraphicsContextGLOpenGL::isEnabled): (WebCore::GraphicsContextGLOpenGL::isFramebuffer): (WebCore::GraphicsContextGLOpenGL::isProgram): (WebCore::GraphicsContextGLOpenGL::isRenderbuffer): (WebCore::GraphicsContextGLOpenGL::isShader): (WebCore::GraphicsContextGLOpenGL::isTexture): (WebCore::GraphicsContextGLOpenGL::lineWidth): (WebCore::GraphicsContextGLOpenGL::linkProgram): (WebCore::GraphicsContextGLOpenGL::pixelStorei): (WebCore::GraphicsContextGLOpenGL::polygonOffset): (WebCore::GraphicsContextGLOpenGL::sampleCoverage): (WebCore::GraphicsContextGLOpenGL::scissor): (WebCore::GraphicsContextGLOpenGL::shaderSource): (WebCore::GraphicsContextGLOpenGL::stencilFunc): (WebCore::GraphicsContextGLOpenGL::stencilFuncSeparate): (WebCore::GraphicsContextGLOpenGL::stencilMask): (WebCore::GraphicsContextGLOpenGL::stencilMaskSeparate): (WebCore::GraphicsContextGLOpenGL::stencilOp): (WebCore::GraphicsContextGLOpenGL::stencilOpSeparate): (WebCore::GraphicsContextGLOpenGL::texParameterf): (WebCore::GraphicsContextGLOpenGL::texParameteri): (WebCore::GraphicsContextGLOpenGL::uniform1f): (WebCore::GraphicsContextGLOpenGL::uniform1fv): (WebCore::GraphicsContextGLOpenGL::uniform2f): (WebCore::GraphicsContextGLOpenGL::uniform2fv): (WebCore::GraphicsContextGLOpenGL::uniform3f): (WebCore::GraphicsContextGLOpenGL::uniform3fv): (WebCore::GraphicsContextGLOpenGL::uniform4f): (WebCore::GraphicsContextGLOpenGL::uniform4fv): (WebCore::GraphicsContextGLOpenGL::uniform1i): (WebCore::GraphicsContextGLOpenGL::uniform1iv): (WebCore::GraphicsContextGLOpenGL::uniform2i): (WebCore::GraphicsContextGLOpenGL::uniform2iv): (WebCore::GraphicsContextGLOpenGL::uniform3i): (WebCore::GraphicsContextGLOpenGL::uniform3iv): (WebCore::GraphicsContextGLOpenGL::uniform4i): (WebCore::GraphicsContextGLOpenGL::uniform4iv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4fv): (WebCore::GraphicsContextGLOpenGL::useProgram): (WebCore::GraphicsContextGLOpenGL::validateProgram): (WebCore::GraphicsContextGLOpenGL::vertexAttrib1f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib1fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib2f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib2fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib3f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib3fv): (WebCore::GraphicsContextGLOpenGL::vertexAttrib4f): (WebCore::GraphicsContextGLOpenGL::vertexAttrib4fv): (WebCore::GraphicsContextGLOpenGL::vertexAttribPointer): (WebCore::GraphicsContextGLOpenGL::viewport): (WebCore::GraphicsContextGLOpenGL::createVertexArray): (WebCore::GraphicsContextGLOpenGL::deleteVertexArray): (WebCore::GraphicsContextGLOpenGL::isVertexArray): (WebCore::GraphicsContextGLOpenGL::bindVertexArray): (WebCore::GraphicsContextGLOpenGL::getBooleanv): (WebCore::GraphicsContextGLOpenGL::getBufferParameteriv): (WebCore::GraphicsContextGLOpenGL::getFloatv): (WebCore::GraphicsContextGLOpenGL::getIntegeri_v): (WebCore::GraphicsContextGLOpenGL::getInteger64v): (WebCore::GraphicsContextGLOpenGL::getInteger64i_v): (WebCore::GraphicsContextGLOpenGL::getFramebufferAttachmentParameteriv): (WebCore::GraphicsContextGLOpenGL::getProgramiv): (WebCore::GraphicsContextGLOpenGL::getNonBuiltInActiveSymbolCount): (WebCore::GraphicsContextGLOpenGL::getProgramInfoLog): (WebCore::GraphicsContextGLOpenGL::getRenderbufferParameteriv): (WebCore::GraphicsContextGLOpenGL::getShaderiv): (WebCore::GraphicsContextGLOpenGL::getShaderInfoLog): (WebCore::GraphicsContextGLOpenGL::getShaderSource): (WebCore::GraphicsContextGLOpenGL::getTexParameterfv): (WebCore::GraphicsContextGLOpenGL::getTexParameteriv): (WebCore::GraphicsContextGLOpenGL::getUniformfv): (WebCore::GraphicsContextGLOpenGL::getUniformiv): (WebCore::GraphicsContextGLOpenGL::getUniformLocation): (WebCore::GraphicsContextGLOpenGL::getVertexAttribfv): (WebCore::GraphicsContextGLOpenGL::getVertexAttribiv): (WebCore::GraphicsContextGLOpenGL::getVertexAttribOffset): (WebCore::GraphicsContextGLOpenGL::texSubImage2D): (WebCore::GraphicsContextGLOpenGL::compressedTexImage2D): (WebCore::GraphicsContextGLOpenGL::compressedTexSubImage2D): (WebCore::GraphicsContextGLOpenGL::createBuffer): (WebCore::GraphicsContextGLOpenGL::createFramebuffer): (WebCore::GraphicsContextGLOpenGL::createProgram): (WebCore::GraphicsContextGLOpenGL::createRenderbuffer): (WebCore::GraphicsContextGLOpenGL::createShader): (WebCore::GraphicsContextGLOpenGL::createTexture): (WebCore::GraphicsContextGLOpenGL::deleteBuffer): (WebCore::GraphicsContextGLOpenGL::deleteFramebuffer): (WebCore::GraphicsContextGLOpenGL::deleteProgram): (WebCore::GraphicsContextGLOpenGL::deleteRenderbuffer): (WebCore::GraphicsContextGLOpenGL::deleteShader): (WebCore::GraphicsContextGLOpenGL::deleteTexture): (WebCore::GraphicsContextGLOpenGL::texImage2DDirect): (WebCore::GraphicsContextGLOpenGL::primitiveRestartIndex): (WebCore::GraphicsContextGLOpenGL::copyBufferSubData): (WebCore::GraphicsContextGLOpenGL::mapBufferRange): (WebCore::GraphicsContextGLOpenGL::unmapBuffer): (WebCore::GraphicsContextGLOpenGL::getInternalformativ): (WebCore::GraphicsContextGLOpenGL::renderbufferStorageMultisample): (WebCore::GraphicsContextGLOpenGL::texStorage2D): (WebCore::GraphicsContextGLOpenGL::texStorage3D): (WebCore::GraphicsContextGLOpenGL::getActiveUniforms): * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp: (WebCore::GraphicsContextGLOpenGL::readPixels): (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): (WebCore::GraphicsContextGLOpenGL::renderbufferStorage): (WebCore::GraphicsContextGLOpenGL::getIntegerv): (WebCore::GraphicsContextGLOpenGL::getShaderPrecisionFormat): (WebCore::GraphicsContextGLOpenGL::depthRange): (WebCore::GraphicsContextGLOpenGL::clearDepth): (WebCore::GraphicsContextGLOpenGL::create): (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): * platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): 2020-11-11 Kimmo Kinnunen <kkinnunen@apple.com> Refactor VideoTextureCopier to be specific to a particular GraphicsContextGL and polymorphic to it https://bugs.webkit.org/show_bug.cgi?id=217218 <rdar://problem/69876433> Reviewed by Dean Jackson. Work towards WebGL implementation which uses GraphicsContextGL abstract base class instead of GraphicsContextGLOpenGL concrete class. Relatively minimal changes to make AVFOUNDATION variants of MediaPlayerPrivate compile when GraphicsContextGL is passed as the context instead of GraphicsContextGLOpenGL. Changes functionality so that the conversion resources (shaders, FBO) are allocated per context instead of previously per video element. This also means that context loss is handled correctly for the element. Removes unused RGB texture copying code from the copy implementation. This was left unused when OpenGL and OpenGL ES backends for AVF users were removed. Makes it possible to have GraphicsContextGLRemote that is able to copy both AVF media textures as well as remote media textures. Makes it possible to have Cocoa variant of GraphicsContextGLOpenGL that is able to copy both AVF media textures as well as remote media textures. Changes only the AVF variants of MediaPlayerPrivate, not the GStreamer variants. Similar interface GraphicsContextGLGStreamer could be implemented for GStreamer if/when remote WebGL would support GStreamer. If this is not done, a downcast from GraphicsContextGL to GraphicsContextGLOpenGL can be added at the moment when the GraphicsContextGLOpenGL uses in core WebGL are modified to GraphicsContextGL uses. No new tests, a refactor. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::asCV): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): * platform/graphics/cv/GraphicsContextGLCV.h: Added. * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp: Renamed from Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp. (WebCore::GraphicsContextGLCVANGLE::GraphicsContextGLCVANGLE): (WebCore::GraphicsContextGLCVANGLE::~GraphicsContextGLCVANGLE): (WebCore::GraphicsContextGLCVANGLE::initializeUVContextObjects): (WebCore::GraphicsContextGLCVANGLE::attachIOSurfaceToTexture): (WebCore::GraphicsContextGLCVANGLE::detachIOSurfaceFromTexture): (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture): * platform/graphics/cv/GraphicsContextGLCVANGLE.h: Renamed from Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.h. * platform/graphics/opengl/GraphicsContextGLOpenGL.h: 2020-11-11 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r269244. https://bugs.webkit.org/show_bug.cgi?id=218483 Patch is breaking tests Reverted changeset: "Stop sending origins from WebProcess to UIProcess for getUserMedia requests" https://bugs.webkit.org/show_bug.cgi?id=218192 https://trac.webkit.org/changeset/269244 2020-11-10 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r269660. https://bugs.webkit.org/show_bug.cgi?id=218786 Crashing in EWS iOS simulator bots Reverted changeset: "PCM: Change from ad-click-attribution to private-click- measurement (in all forms, including .well-known URL)" https://bugs.webkit.org/show_bug.cgi?id=218730 https://trac.webkit.org/changeset/269660 2020-11-10 Chris Dumez <cdumez@apple.com> Webkit incorrectly setting visibilityState to "prerender" when opening link in new tab https://bugs.webkit.org/show_bug.cgi?id=215851 <rdar://problem/67817100> Reviewed by Geoff Garen. Drop "prerender" state from VisibilityState. It has been dropped from the specification and other browser engines so it is confusing to developers: - https://www.w3.org/TR/page-visibility-2/#visibility-states-and-the-visibilitystate-enum * dom/VisibilityState.h: * dom/VisibilityState.idl: * page/Page.cpp: (WebCore::Page::visibilityState const): 2020-11-10 Tim Horton <timothy_horton@apple.com> Use GraphicsContext instead of CGContext in RemoteLayerBackingStore https://bugs.webkit.org/show_bug.cgi?id=218738 Reviewed by Wenson Hsieh. No new tests; just refactoring a heavily-tested codepath. * platform/graphics/GraphicsContext.h: * platform/graphics/Path.h: Export some things. 2020-11-10 Darin Adler <darin@apple.com> Remove another function that implicitly uses the composed tree (intersects with range) https://bugs.webkit.org/show_bug.cgi?id=218726 Reviewed by Ryosuke Niwa. Tests: fast/dom/rangeContainsBoundaryPoint.html fast/dom/rangeIntersectsNode.html fast/dom/rangeIntersectsRange.html * Sources.txt: Added BoundaryPoint.cpp. * WebCore.xcodeproj/project.pbxproj: Ditto. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange const): Use intersects<ComposedTree>. * accessibility/atk/WebKitAccessibleUtil.cpp: (selectionBelongsToObject): Ditto. * dom/BoundaryPoint.cpp: Added. * dom/Range.cpp: (WebCore::Range::isPointInRange): Use contains instead of contains<Tree> since the normal tree is now default. (WebCore::Range::intersectsNode const): Use intersects instead of intersects<Tree> since the normal tree is now default. * dom/SimpleRange.cpp: (WebCore::makeBoundaryPointBeforeNode): Moved to BoundaryPoint.cpp. (WebCore::makeBoundaryPointAfterNode): Ditto. (WebCore::isOffsetBeforeChild): Ditto. (WebCore::order): Ditto. (WebCore::treeOrderForTesting): Ditto. (WebCore::containsForTesting): Added an overload for range and boundary point. (WebCore::intersects): Deleted two of these that were using ComposedTree. (WebCore::intersectsForTesting): Added. (WebCore::intersection): Use intersects<ComposedTree>. (WebCore::contains): Implemented this template function and use it to replac the incorrect specialization we had for ComposedTree. (WebCore::containsCrossingDocumentBoundaries): Added. * dom/SimpleRange.h: Made the contains functions template arguments default to Tree. Added another overload of containsForTesting and added intersectsForTesting. Removed intersects functions that were deprecated; the ones that used ComposedTree. Added containsCrossingDocumentBoundaries. * editing/Editor.cpp: (WebCore::isFrameInRange): Use intersects<ComposedTree>. (WebCore::Editor::scanSelectionForTelephoneNumbers): Ditto. * editing/FrameSelection.cpp: (WebCore::FrameSelection::respondToNodeModification): Ditto. * editing/VisiblePosition.cpp: (WebCore::makeVisiblePositionRange): Added. * editing/VisiblePosition.h: Added makeVisiblePositionRange, which takes an Optional<SimpleRange>. * page/DOMSelection.cpp: (WebCore::DOMSelection::addRange): Use intersects instead of intersects<Tree> since the normal tree is now default. (WebCore::DOMSelection::containsNode const): Use intersects/contains instead of intersects/contains<Tree> since the normal tree is now default. * page/DragController.cpp: (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret): Use intersects<ComposedTree>. * testing/Internals.cpp: (WebCore::Internals::rangeContainsBoundaryPoint): Added. (WebCore::Internals::rangeIntersectsNode): Added. (WebCore::Internals::rangeIntersectsRange): Added. * testing/Internals.h: Updated for the above. * testing/Internals.idl: Ditto. 2020-11-10 John Wilander <wilander@apple.com> PCM: Change from ad-click-attribution to private-click-measurement (in all forms, including .well-known URL) https://bugs.webkit.org/show_bug.cgi?id=218730 <rdar://problem/71094296> Reviewed by Devin Rousso. Change to the official name of the proposed standard Private Click Measurement https://github.com/privacycg/private-click-measurement. This includes a change of the reporting URL from "/.well-known/ad-click-attribution/" to "/.well-known/private-click-measurement/". Tests: http/tests/contentextensions/block-private-click-measurement.html http/tests/privateClickMeasurement/anchor-tag-attributes-reflect.html http/tests/privateClickMeasurement/anchor-tag-attributes-validation.html http/tests/privateClickMeasurement/attribution-conversion-through-cross-site-image-redirect.html http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-in-new-window.html http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority.html http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority.html http/tests/privateClickMeasurement/clear-through-website-data-removal.html http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html http/tests/privateClickMeasurement/expired-attributions-removed.html http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority.html http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority.html http/tests/privateClickMeasurement/second-conversion-with-higher-priority.html http/tests/privateClickMeasurement/second-conversion-with-lower-priority.html http/tests/privateClickMeasurement/send-attribution-conversion-request.html http/tests/privateClickMeasurement/store-disabled-in-ephemeral-session.html http/tests/privateClickMeasurement/store-private-click-measurement.html inspector/page/overrideSetting-PrivateClickMeasurementDebugModeEnabled.html * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parsePrivateClickMeasurement const): (WebCore::HTMLAnchorElement::handleClick): (WebCore::HTMLAnchorElement::parseAdClickAttribution const): Deleted. * html/HTMLAnchorElement.h: * html/HTMLAnchorElement.idl: * inspector/InspectorClient.h: * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::disable): (WebCore::InspectorPageAgent::overrideSetting): * inspector/agents/page/PageConsoleAgent.cpp: (WebCore::PageConsoleAgent::getLoggingChannels): * loader/FrameLoader.cpp: (WebCore::FrameLoader::changeLocation): (WebCore::FrameLoader::loadFrameRequest): (WebCore::FrameLoader::loadURL): * loader/FrameLoader.h: * loader/NavigationAction.h: (WebCore::NavigationAction::privateClickMeasurement const): (WebCore::NavigationAction::setPrivateClickMeasurement): (WebCore::NavigationAction::adClickAttribution const): Deleted. (WebCore::NavigationAction::setAdClickAttribution): Deleted. * loader/PrivateClickMeasurement.cpp: Renamed from Source/WebCore/loader/AdClickAttribution.cpp. (WebCore::PrivateClickMeasurement::isValid const): (WebCore::PrivateClickMeasurement::parseConversionRequest): (WebCore::PrivateClickMeasurement::convertAndGetEarliestTimeToSend): (WebCore::PrivateClickMeasurement::markAsExpired): (WebCore::PrivateClickMeasurement::hasExpired const): (WebCore::PrivateClickMeasurement::hasHigherPriorityThan const): (WebCore::PrivateClickMeasurement::reportURL const): (WebCore::PrivateClickMeasurement::json const): (WebCore::PrivateClickMeasurement::markConversionAsSent): (WebCore::PrivateClickMeasurement::wasConversionSent const): (WebCore::PrivateClickMeasurement::toString const): (WebCore::PrivateClickMeasurement::debugModeEnabled): * loader/PrivateClickMeasurement.h: Renamed from Source/WebCore/loader/AdClickAttribution.h. (WebCore::PrivateClickMeasurement::Campaign::Campaign): (WebCore::PrivateClickMeasurement::Campaign::isValid const): (WebCore::PrivateClickMeasurement::Source::Source): (WebCore::PrivateClickMeasurement::Source::operator== const): (WebCore::PrivateClickMeasurement::Source::matches const): (WebCore::PrivateClickMeasurement::Source::isHashTableDeletedValue const): (WebCore::PrivateClickMeasurement::Source::deletedValue): (WebCore::PrivateClickMeasurement::Source::constructDeletedValue): (WebCore::PrivateClickMeasurement::Source::deleteValue): (WebCore::PrivateClickMeasurement::Source::isDeletedValue const): (WebCore::PrivateClickMeasurement::SourceHash::hash): (WebCore::PrivateClickMeasurement::SourceHash::equal): (WebCore::PrivateClickMeasurement::Destination::Destination): (WebCore::PrivateClickMeasurement::Destination::operator== const): (WebCore::PrivateClickMeasurement::Destination::matches const): (WebCore::PrivateClickMeasurement::Destination::isHashTableDeletedValue const): (WebCore::PrivateClickMeasurement::Destination::deletedValue): (WebCore::PrivateClickMeasurement::Destination::constructDeletedValue): (WebCore::PrivateClickMeasurement::Destination::deleteValue): (WebCore::PrivateClickMeasurement::Destination::isDeletedValue const): (WebCore::PrivateClickMeasurement::DestinationHash::hash): (WebCore::PrivateClickMeasurement::DestinationHash::equal): (WebCore::PrivateClickMeasurement::Priority::Priority): (WebCore::PrivateClickMeasurement::Conversion::Conversion): (WebCore::PrivateClickMeasurement::Conversion::isValid const): (WebCore::PrivateClickMeasurement::PrivateClickMeasurement): (WebCore::PrivateClickMeasurement::source const): (WebCore::PrivateClickMeasurement::destination const): (WebCore::PrivateClickMeasurement::earliestTimeToSend const): (WebCore::PrivateClickMeasurement::isEmpty const): (WebCore::PrivateClickMeasurement::encode const): (WebCore::PrivateClickMeasurement::decode): (WebCore::PrivateClickMeasurement::Conversion::encode const): (WebCore::PrivateClickMeasurement::Conversion::decode): (WTF::HashTraits<WebCore::PrivateClickMeasurement::Source>::emptyValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::Source>::constructDeletedValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::Source>::isDeletedValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::Destination>::emptyValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::Destination>::constructDeletedValue): (WTF::HashTraits<WebCore::PrivateClickMeasurement::Destination>::isDeletedValue): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::privateClickMeasurementDebugModeEnabled const): (WebCore::RuntimeEnabledFeatures::setPrivateClickMeasurementDebugModeEnabled): (WebCore::RuntimeEnabledFeatures::adClickAttributionDebugModeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setAdClickAttributionDebugModeEnabled): Deleted. * platform/Logging.h: 2020-11-10 Simon Fraser <simon.fraser@apple.com> Make PlatformWheelEventPhase an enum class https://bugs.webkit.org/show_bug.cgi?id=218772 Reviewed by Tim Horton. Change PlatformWheelEventPhase to be an enum class. Changed code that maps between NSEventPhase and PlatformWheelEventPhase to not treat NSEventPhase as a set of bits, since it only ever contains one of the bits. * dom/WheelEvent.h: * page/EventHandler.cpp: (WebCore::handleWheelEventPhaseInScrollableArea): (WebCore::handleWheelEventInAppropriateEnclosingBox): * page/WheelEventTestMonitor.cpp: (WebCore::WheelEventTestMonitor::receivedWheelEvent): * page/mac/EventHandlerMac.mm: (WebCore::findEnclosingScrollableContainer): (WebCore::EventHandler::recordWheelEventForDeltaFilter): (WebCore::EventHandler::processWheelEventForScrollSnap): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::willWheelEventStartSwipeGesture): * page/scrolling/ScrollingTreeGestureState.cpp: (WebCore::ScrollingTreeGestureState::handleGestureCancel): (WebCore::ScrollingTreeGestureState::nodeDidHandleEvent): * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::canHandleWheelEvent const): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent): * platform/PlatformWheelEvent.cpp: (WebCore::operator<<): * platform/PlatformWheelEvent.h: (WebCore::PlatformWheelEvent::useLatchedEventElement const): (WebCore::PlatformWheelEvent::isGestureStart const): (WebCore::PlatformWheelEvent::isGestureContinuation const): (WebCore::PlatformWheelEvent::shouldResetLatching const): (WebCore::PlatformWheelEvent::isNonGestureEvent const): (WebCore::PlatformWheelEvent::isEndOfMomentumScroll const): (WebCore::PlatformWheelEvent::isGestureBegin const): (WebCore::PlatformWheelEvent::isGestureCancel const): (WebCore::PlatformWheelEvent::isEndOfNonMomentumScroll const): (WebCore::PlatformWheelEvent::isTransitioningToMomentumScroll const): * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::handleWheelEvent): * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): (WebCore::toWheelEventStatus): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::phaseFromNSEventPhase): (WebCore::momentumPhaseForEvent): (WebCore::phaseForEvent): * platform/mac/ScrollAnimatorMac.mm: (WebCore::ScrollAnimatorMac::handleWheelEventPhase): (WebCore::newGestureIsStarting): (WebCore::gestureShouldBeginSnap): 2020-11-10 Geoffrey Garen <ggaren@apple.com> Stop using objc_autoreleasePool{Push, Pop} in RunLoop observers https://bugs.webkit.org/show_bug.cgi?id=218728 Reviewed by Tim Horton. Use in a RunLoop observer is deprecated when a built-in version of the behavior is available (because the conflicting pool management commands crash each other). This is UIWebView, so there are no rules. Tested manually, at a safe distance. * platform/ios/wak/WebCoreThread.mm: (WebRunLoopLockInternal): (WebRunLoopUnlockInternal): (WebRunLoopEnableNested): (WebRunLoopDisableNested): (RunWebThread): 2020-11-10 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Enable vertical alignment on replaced content https://bugs.webkit.org/show_bug.cgi?id=218101 Reviewed by Antti Koivisto. * layout/integration/LayoutIntegrationCoverage.cpp: 2020-11-10 Said Abou-Hallawa <said@apple.com> [macCatalyst] Fix various build breaks https://bugs.webkit.org/show_bug.cgi?id=218771 Reviewed by Tim Horton. Use PlatformImagePtr which is encapsulated in NativeImage. * editing/cocoa/DictionaryLookup.mm: (-[WebRevealHighlight drawHighlightContentForItem:context:]): 2020-11-10 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for replaced element baseline https://bugs.webkit.org/show_bug.cgi?id=218767 Reviewed by Antti Koivisto. Replaced elements can have set baselines. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): * layout/layouttree/LayoutReplacedBox.h: (WebCore::Layout::ReplacedBox::setBaseline): (WebCore::Layout::ReplacedBox::baseline const): 2020-11-10 Youenn Fablet <youenn@apple.com> and Victor M Jaquez <vjaquez@igalia.com> Update WebRTC liwebrtc to M87 https://bugs.webkit.org/show_bug.cgi?id=218436 Reviewed by Eric Carlson. Move from deprecated to new APIs. Covered by existing tests. * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp: (WebCore::LibWebRTCRtpTransceiverBackend::setDirection): (WebCore::LibWebRTCRtpTransceiverBackend::stop): * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::fillRTCDataChannelStats): * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: (WebCore::GStreamerVideoFrameLibWebRTC::ToI420): * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h: * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerEncodedImageBuffer::create): (WebCore::GStreamerEncodedImageBuffer::GStreamerEncodedImageBuffer): (WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder): (WebCore::GStreamerVideoEncoder::Fragmentize): Deleted. * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: * testing/MockLibWebRTCPeerConnection.h: 2020-11-10 Rob Buis <rbuis@igalia.com> Parse aspect-ratio CSS property https://bugs.webkit.org/show_bug.cgi?id=218437 Reviewed by Darin Adler. Parse aspect-ratio CSS property according to the specification [1]. [1] https://drafts.csswg.org/css-sizing-4/#aspect-ratio * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSProperties.json: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): (WebCore::operator==): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeAspectRatio): (WebCore::CSSPropertyParser::parseSingleValue): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::aspectRatioWidth const): (WebCore::RenderStyle::aspectRatioHeight const): (WebCore::RenderStyle::setAspectRatio): (WebCore::RenderStyle::initialAspectRatioWidth): (WebCore::RenderStyle::initialAspectRatioHeight): * rendering/style/RenderStyleConstants.cpp: (WebCore::operator<<): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueWebkitAspectRatio): (WebCore::Style::BuilderCustom::applyInitialAspectRatio): (WebCore::Style::BuilderCustom::applyInheritAspectRatio): (WebCore::Style::BuilderCustom::applyValueAspectRatio): 2020-11-10 Wenson Hsieh <wenson_hsieh@apple.com> REGRESSION (r269525): Many layout tests crash when run under ASan https://bugs.webkit.org/show_bug.cgi?id=218733 <rdar://problem/71206273> Reviewed by Tim Horton. When running tests under ASan, many layout tests crash under `Vector::asanBufferSizeWillChangeTo`, which (when ASan is enabled) will crash when the start of the buffer is misaligned to 8 bytes. When appending `DrawGlyph` display list items that have Vectors with inline capacities, the start of a buffer may end up at an offset that is not aligned to 8 bytes, since all display list items are currently laid out back-to-back, with a single byte to represent the item type and each item's data following immediately thereafter. To address this, adjust display list item buffer logic to make sure that for each item that is appended to an item buffer, both the item type and the item itself are aligned to 8 bytes. * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::iterator::updateCurrentItem): * platform/graphics/displaylists/DisplayListItemBuffer.cpp: (WebCore::DisplayList::ItemHandle::copyTo const): (WebCore::DisplayList::ItemBuffer::swapWritableBufferIfNeeded): (WebCore::DisplayList::ItemBuffer::appendEncodedData): (WebCore::DisplayList::ItemBuffer::appendDataAndLength): Deleted. * platform/graphics/displaylists/DisplayListItemBuffer.h: (WebCore::DisplayList::ItemHandle::type const): (WebCore::DisplayList::ItemHandle::get const): (WebCore::DisplayList::ItemBuffer::append): (WebCore::DisplayList::ItemBuffer::uncheckedAppend): (WebCore::DisplayList::ItemHandle::size const): Deleted. * platform/graphics/displaylists/DisplayListItemType.cpp: (WebCore::DisplayList::sizeOfItemInBytes): (WebCore::DisplayList::paddedSizeOfTypeAndItemInBytes): Change `sizeOfItemInBytes` to `paddedSizeOfTypeAndItemInBytes`, and make it include both the padded size of an item type (8 bytes), the size of the item itself, and the minimum amount of padding after the item that's required to make sure the total size is aligned to 8 bytes. * platform/graphics/displaylists/DisplayListItemType.h: 2020-11-10 Antti Koivisto <antti@apple.com> [LFC][Integration] Move caret rect computation out of iterator https://bugs.webkit.org/show_bug.cgi?id=218747 Reviewed by Zalan Bujtas. Move it to RenderBlockFlow which it mostly deals with. * layout/integration/LayoutIntegrationLineIterator.cpp: (WebCore::LayoutIntegration::PathLine::computeCaretRect const): Deleted. * layout/integration/LayoutIntegrationLineIterator.h: (WebCore::LayoutIntegration::PathLine::selectionRect const): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::computeCaretRect const): * rendering/RenderBlockFlow.h: * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::localCaretRect const): * rendering/RenderText.cpp: (WebCore::RenderText::localCaretRect const): 2020-11-10 Andres Gonzalez <andresg_22@apple.com> Fix for LayoutTests/accessibility/mac/search-predicate.html in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=218732 Reviewed by Chris Fleizach. Test: accessibility/mac/search-predicate.html. - Implemented AXIsolatedObject::scrollXXX methods. - Added handling of "AXIsOnScreen" attribute to WebAccessibilityOobjectWrapperMac. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::performFunctionOnMainThread const): (WebCore::AXIsolatedObject::scrollToMakeVisible const): (WebCore::AXIsolatedObject::scrollToMakeVisibleWithSubFocus const): (WebCore::AXIsolatedObject::scrollToGlobalPoint const): (WebCore::AXIsolatedObject::performFunctionOnMainThread): Deleted. (WebCore::AXIsolatedObject::isVisible const): Deleted. * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 2020-11-10 Chris Dumez <cdumez@apple.com> Crash when accessing OfflineAudioContext.length after failing to construct rendering AudioBuffer https://bugs.webkit.org/show_bug.cgi?id=218754 <rdar://problem/71186978> Reviewed by Eric Carlson. OfflineAudioContext.length should return the length passed to the constructor, even if we failed to construct the internal AudioBuffer (and obviously we should not crash). This matches the behavior of Firefox and Chrome. I have also added a console message when we fail to construct the internal rendering AudioBuffer, for clarity. Test: webaudio/OfflineAudioContext/bad-buffer-length.html * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::OfflineAudioContext): (WebCore::OfflineAudioContext::create): * Modules/webaudio/OfflineAudioContext.h: 2020-11-10 Jer Noble <jer.noble@apple.com> Add support for AudioConfiguration.spatialRendering https://bugs.webkit.org/show_bug.cgi?id=218727 <rdar://problem/71213348> Reviewed by Eric Carlson. Test: media/mediacapabilities/mock-decodingInfo-spatialRendering.html Add support for spatialRendring. On Cocoa ports, this will query AVAudioContext for spatial rendering support. Drive-by fix: The AudioConfiguration.idl marks sampleRate, bitrate, and channels as optional; those need to be reflected in the C++ struct. * Modules/mediacapabilities/AudioConfiguration.idl: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::exernalDeviceDisplayNameForPlayer): * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: (WebCore::createMediaPlayerDecodingConfigurationCocoa): * platform/mediacapabilities/AudioConfiguration.h: * platform/mediacapabilities/MediaCapabilitiesLogging.cpp: (WebCore::toJSONObject): * platform/mock/MediaEngineConfigurationFactoryMock.cpp: (WebCore::canDecodeMedia): (WebCore::canSmoothlyDecodeMedia): (WebCore::canPowerEfficientlyDecodeMedia): (WebCore::canSmoothlyEncodeMedia): (WebCore::canPowerEfficientlyEncodeMedia): 2020-11-10 Chris Dumez <cdumez@apple.com> [GPUProcess] Regression(r268632) Garbage is rendered on speakers when using WebAudio https://bugs.webkit.org/show_bug.cgi?id=218729 Reviewed by Eric Carlson. * platform/audio/cocoa/AudioDestinationCocoa.h: * platform/mock/MockAudioDestinationCocoa.cpp: (WebCore::MockAudioDestinationCocoa::start): (WebCore::MockAudioDestinationCocoa::stop): (WebCore::MockAudioDestinationCocoa::tick): * platform/mock/MockAudioDestinationCocoa.h: Make AudioDestinationCocoa::m_dispatchToRenderThread private so that subclasses cannot set it. Update MockAudioDestinationCocoa to use m_dispatchToRenderThread to dispatch to the render thread when available, instead of unconditionally dispatching to its own WorkQueue and then expecting AudioDestinationCocoa::render() to render to the actual rendering thread. 2020-11-10 Antti Koivisto <antti@apple.com> [LFC][Integration] Allow object-fit https://bugs.webkit.org/show_bug.cgi?id=218740 Reviewed by Zalan Bujtas. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForChild): 2020-11-10 Antoine Quint <graouts@webkit.org> align-self should be a discrete animatable property https://bugs.webkit.org/show_bug.cgi?id=218742 Reviewed by Antti Koivisto. * animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): 2020-11-10 Antoine Quint <graouts@webkit.org> [Web Animations] KeyframeEffect.pseudoElement does not return a valid string when targeting ::marker or ::first-letter https://bugs.webkit.org/show_bug.cgi?id=218741 <rdar://problem/71229846> Reviewed by Dean Jackson. We used to use PseudoElement::pseudoElementNameForEvents() to go from PseudoId to a String, but PseudoElement only knows about ::before and ::after and not about valid pseudo-elements. We remove that method and create an equivalent in WebAnimationUtilities that knows about all public pseudo-elements. * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::enqueueDOMEvent): * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::pseudoElement const): * animation/WebAnimationUtilities.cpp: (WebCore::pseudoIdAsString): * animation/WebAnimationUtilities.h: * dom/PseudoElement.cpp: (WebCore::PseudoElement::pseudoElementNameForEvents): Deleted. * dom/PseudoElement.h: 2020-11-10 Martin Robinson <mrobinson@igalia.com> Scroll-snap on the root aligns to the body margin edge, not the viewport edge https://bugs.webkit.org/show_bug.cgi?id=210476 <rdar://problem/61755103> Reviewed by Simon Fraser. When passing the frame viewport to updateSnapOffsetsForScrollableArea, be sure to put it into the coordinate system of the root element padding box. This means offsetting it by the margins of the root element. Tests: tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-horizontal-with-margin.html tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical-with-margin.html * page/FrameView.cpp: (WebCore::FrameView::updateSnapOffsets): Offset viewport by top and left margins of the root element. 2020-11-09 Tim Horton <timothy_horton@apple.com> Exceptions under PlatformCALayerCocoa::drawLayerContents with DisplayList-backed layers https://bugs.webkit.org/show_bug.cgi?id=218731 Reviewed by Simon Fraser. No new tests; all tests will cover this once GPU Process for DOM rendering lands. * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayer::drawLayerContents): Refactor this function to use three state savers, all released by scope instead of explicitly. This fixes the bug in the title, which was that we would call +restoreGraphicsState on NSGraphicsContext regardless of whether we have a platform context or not (while we'd only save if we /did/ have one). * platform/graphics/ios/FontAntialiasingStateSaver.h: (WebCore::FontAntialiasingStateSaver::~FontAntialiasingStateSaver): (WebCore::FontAntialiasingStateSaver::restore): Deleted. Make FontAntialiasingStateSaver behave like all of the other -StateSavers, performing "restore" in its destructor. * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::drawWindowContent): We don't have to restore explicitly anymore. 2020-11-09 Said Abou-Hallawa <said@apple.com> [GPU Process] Control the life cycle of the platform image by a new class named NativeImage https://bugs.webkit.org/show_bug.cgi?id=218427 Reviewed by Simon Fraser. This adds a new level of indirection around NativeImagePtr which is now renamed PlatformImagePtr. The goal is to control the life cycle of the PlatfromImagePtr in WebKit regardless if it is retained outside WebKit or not. In future patches, deleting the NativeImage will be observed by RemoteResoureCache such that it will be removed from the GPUP cache when the object is destroyed in WebP. The new structural hierarchy of the bitmap image is the following: - CachedImage (responsible of receiving the encoded image data) - BitmapImage (responsible of decoding the image data) - NativeImage (represents an image frame and controls the life cycle of PlatformImagePtr in WebKit) - PlatformImagePtr (represents a platform image and it is the result of ImageDecoder) * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::nativeImageForCurrentTime): * html/HTMLVideoElement.h: * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::drawImage): * page/mac/TextIndicatorWindow.mm: (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): (createContentCrossfadeAnimation): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::BitmapImage): (WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded): (WebCore::BitmapImage::nativeImage): (WebCore::BitmapImage::nativeImageForCurrentFrame): (WebCore::BitmapImage::preTransformedNativeImageForCurrentFrame): (WebCore::BitmapImage::nativeImageOfSize): (WebCore::BitmapImage::framesNativeImages): (WebCore::drawNativeImage): (WebCore::BitmapImage::draw): * platform/graphics/BitmapImage.h: * platform/graphics/ConcreteImageBuffer.h: * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawNativeImage): * platform/graphics/GraphicsContext.h: (WebCore::GraphicsContext::drawNativeImage): (WebCore::GraphicsContext::drawPlatformImage): * platform/graphics/GraphicsContextGLImageExtractor.h: * platform/graphics/GraphicsContextImpl.h: * platform/graphics/Icon.h: * platform/graphics/Image.h: (WebCore::Image::nativeImage): (WebCore::Image::nativeImageForCurrentFrame): (WebCore::Image::preTransformedNativeImageForCurrentFrame): (WebCore::Image::nativeImageOfSize): * platform/graphics/ImageBackingStore.h: * platform/graphics/ImageBuffer.cpp: (WebCore::ImageBuffer::sinkIntoNativeImage): * platform/graphics/ImageBuffer.h: * platform/graphics/ImageBufferBackend.cpp: (WebCore::ImageBufferBackend::sinkIntoNativeImage): * platform/graphics/ImageBufferBackend.h: * platform/graphics/ImageDecoder.h: * platform/graphics/ImageFrame.cpp: (WebCore::ImageFrame::clearImage): (WebCore::ImageFrame::singlePixelSolidColor const): * platform/graphics/ImageFrame.h: (WebCore::ImageFrame::nativeImage const): * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::ImageSource): (WebCore::ImageSource::setNativeImage): (WebCore::ImageSource::cacheMetadataAtIndex): (WebCore::ImageSource::cachePlatformImageAtIndex): (WebCore::ImageSource::cachePlatformImageAtIndexAsync): (WebCore::ImageSource::startAsyncDecodingQueue): (WebCore::ImageSource::frameAtIndexCacheIfNeeded): (WebCore::ImageSource::createFrameImageAtIndex): (WebCore::ImageSource::frameImageAtIndex): (WebCore::ImageSource::frameImageAtIndexCacheIfNeeded): (WebCore::ImageSource::cacheNativeImageAtIndex): Deleted. (WebCore::ImageSource::cacheNativeImageAtIndexAsync): Deleted. * platform/graphics/ImageSource.h: (WebCore::ImageSource::create): * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::nativeImageForCurrentTime): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::nativeImageForCurrentTime): * platform/graphics/NativeImage.cpp: Copied from Source/WebCore/platform/graphics/NativeImagePtr.h. (WebCore::NativeImage::create): (WebCore::NativeImage::NativeImage): * platform/graphics/NativeImage.h: (WebCore::NativeImage::platformImage const): * platform/graphics/PlatformImage.h: Renamed from Source/WebCore/platform/graphics/NativeImagePtr.h. * platform/graphics/VideoLayerManager.h: * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h: * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoFullscreenInlineImage): (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage): (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): (WebCore::MediaPlayerPrivateAVFoundationObjC::nativeImageForCurrentTime): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::nativeImageForCurrentTime): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastImage): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateCurrentFrameImage): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h: * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm: (WebCore::VideoLayerManagerObjC::setVideoFullscreenLayer): (WebCore::VideoLayerManagerObjC::updateVideoFullscreenInlineImage): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateContentsImage): * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::drawShadowLayerBuffer): (WebCore::Cairo::drawShadowImage): (WebCore::Cairo::fillShadowBuffer): (WebCore::Cairo::drawPlatformImage): (WebCore::Cairo::drawNativeImage): Deleted. * platform/graphics/cairo/CairoOperations.h: * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawPlatformImage): (WebCore::GraphicsContext::clipToImageBuffer): (WebCore::GraphicsContext::drawPattern): (WebCore::GraphicsContext::platformDrawNativeImage): Deleted. * platform/graphics/cairo/GraphicsContextGLCairo.cpp: (WebCore::GraphicsContextGLImageExtractor::extractImage): * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::drawImageBuffer): (WebCore::GraphicsContextImplCairo::drawNativeImage): (WebCore::GraphicsContextImplCairo::drawPattern): (WebCore::GraphicsContextImplCairo::clipToImageBuffer): * platform/graphics/cairo/GraphicsContextImplCairo.h: * platform/graphics/cairo/ImageBufferCairoBackend.cpp: (WebCore::ImageBufferCairoBackend::draw): (WebCore::ImageBufferCairoBackend::drawPattern): * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.cpp: (WebCore::ImageBufferCairoSurfaceBackend::copyNativeImage const): (WebCore::ImageBufferCairoSurfaceBackend::cairoSurfaceCoerceToImage const): (WebCore::ImageBufferCairoSurfaceBackend::toBGRAData const): * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.h: * platform/graphics/cairo/NativeImageCairo.cpp: (WebCore::NativeImage::size const): (WebCore::NativeImage::hasAlpha const): (WebCore::NativeImage::singlePixelSolidColor const): (WebCore::NativeImage::clearSubimages): (WebCore::nativeImageSize): Deleted. (WebCore::nativeImageHasAlpha): Deleted. (WebCore::nativeImageSinglePixelSolidColor): Deleted. (WebCore::drawNativeImage): Deleted. (WebCore::clearNativeImageSubimages): Deleted. * platform/graphics/cairo/PatternCairo.cpp: (WebCore::Pattern::createPlatformPattern const): * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::drawPlatformImage): (WebCore::GraphicsContext::drawPattern): (WebCore::GraphicsContext::clipToImageBuffer): (WebCore::GraphicsContext::platformDrawNativeImage): Deleted. * platform/graphics/cg/GraphicsContextGLCG.cpp: (WebCore::GraphicsContextGLImageExtractor::extractImage): (WebCore::GraphicsContextGLOpenGL::paintToCanvas): * platform/graphics/cg/ImageBufferCGBackend.cpp: (WebCore::createBitmapImageAfterScalingIfNeeded): (WebCore::ImageBufferCGBackend::copyImage const): (WebCore::ImageBufferCGBackend::draw): (WebCore::ImageBufferCGBackend::toCFData const): * platform/graphics/cg/ImageBufferCGBitmapBackend.cpp: (WebCore::ImageBufferCGBitmapBackend::copyNativeImage const): * platform/graphics/cg/ImageBufferCGBitmapBackend.h: * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: (WebCore::ImageBufferIOSurfaceBackend::copyNativeImage const): (WebCore::ImageBufferIOSurfaceBackend::sinkIntoNativeImage): (WebCore::ImageBufferIOSurfaceBackend::drawConsuming): * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoderCG::createFrameImageAtIndex): * platform/graphics/cg/ImageDecoderCG.h: * platform/graphics/cg/NativeImageCG.cpp: (WebCore::NativeImage::size const): (WebCore::NativeImage::hasAlpha const): (WebCore::NativeImage::singlePixelSolidColor const): (WebCore::NativeImage::clearSubimages): (WebCore::nativeImageSize): Deleted. (WebCore::nativeImageHasAlpha): Deleted. (WebCore::nativeImageSinglePixelSolidColor): Deleted. (WebCore::clearNativeImageSubimages): Deleted. * platform/graphics/cg/PatternCG.cpp: (WebCore::Pattern::createPlatformPattern const): * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm: (WebCore::FilterEffectRendererCoreImage::imageForSourceGraphic): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawNativeImage::DrawNativeImage): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::DrawNativeImage::decode): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::drawNativeImage): * platform/graphics/displaylists/DisplayListRecorder.h: * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::createFrameImageAtIndex): * platform/graphics/gstreamer/ImageDecoderGStreamer.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::nativeImageForCurrentTime): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gtk/ImageGtk.cpp: (WebCore::BitmapImage::getGdkPixbuf): (WebCore::BitmapImage::gdkTexture): * platform/graphics/ios/IconIOS.mm: (WebCore::Icon::Icon): (WebCore::Icon::createIconForImage): (WebCore::Icon::paint): * platform/graphics/mac/ImageMac.mm: (WebCore::BitmapImage::tiffRepresentation): (WebCore::BitmapImage::snapshotNSImage): * platform/graphics/nicosia/NicosiaImageBufferPipe.cpp: (Nicosia::NicosiaImageBufferPipeSource::handle): * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: (Nicosia::CairoOperationRecorder::drawNativeImage): (Nicosia::CairoOperationRecorder::drawPattern): (Nicosia::CairoOperationRecorder::clipToImageBuffer): * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: * platform/graphics/texmap/BitmapTextureGL.cpp: (WebCore::BitmapTextureGL::updateContents): * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper): (WebCore::GraphicsLayerTextureMapper::setContentsToImage): * platform/graphics/texmap/GraphicsLayerTextureMapper.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer): (WebCore::CoordinatedGraphicsLayer::setContentsToImage): (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: * platform/graphics/win/Direct2DOperations.cpp: (WebCore::Direct2D::drawPlatformImage): (WebCore::Direct2D::drawNativeImage): Deleted. * platform/graphics/win/Direct2DOperations.h: * platform/graphics/win/GraphicsContextDirect2D.cpp: (WebCore::GraphicsContext::drawPlatformImage): (WebCore::GraphicsContext::platformDrawNativeImage): Deleted. * platform/graphics/win/GraphicsContextImplDirect2D.cpp: (WebCore::GraphicsContextImplDirect2D::drawNativeImage): * platform/graphics/win/GraphicsContextImplDirect2D.h: * platform/graphics/win/ImageBufferDirect2DBackend.cpp: (WebCore::ImageBufferDirect2DBackend::create): (WebCore::ImageBufferDirect2DBackend::ImageBufferDirect2DBackend): (WebCore::ImageBufferDirect2DBackend::copyNativeImage const): (WebCore::createCroppedImageIfNecessary): (WebCore::ImageBufferDirect2DBackend::copyImage const): (WebCore::ImageBufferDirect2DBackend::sinkIntoImage): (WebCore::ImageBufferDirect2DBackend::compatibleBitmap): * platform/graphics/win/ImageBufferDirect2DBackend.h: * platform/graphics/win/ImageCGWin.cpp: (WebCore::BitmapImage::create): (WebCore::BitmapImage::drawFrameMatchingSourceSize): * platform/graphics/win/ImageCairoWin.cpp: (WebCore::BitmapImage::drawFrameMatchingSourceSize): * platform/graphics/win/ImageDecoderDirect2D.cpp: (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex): * platform/graphics/win/ImageDecoderDirect2D.h: * platform/graphics/win/NativeImageDirect2D.cpp: (WebCore::NativeImage::size const): (WebCore::NativeImage::hasAlpha const): (WebCore::NativeImage::singlePixelSolidColor const): (WebCore::NativeImage::clearSubimages): (WebCore::nativeImageSize): Deleted. (WebCore::nativeImageHasAlpha): Deleted. (WebCore::nativeImageSinglePixelSolidColor): Deleted. (WebCore::drawNativeImage): Deleted. (WebCore::clearNativeImageSubimages): Deleted. * platform/gtk/CursorGtk.cpp: (WebCore::createCustomCursor): * platform/gtk/DragImageGtk.cpp: (WebCore::createDragImageFromImage): * platform/image-decoders/ScalableImageDecoder.cpp: (WebCore::ScalableImageDecoder::createFrameImageAtIndex): * platform/image-decoders/ScalableImageDecoder.h: * platform/image-decoders/cairo/ImageBackingStoreCairo.cpp: (WebCore::ImageBackingStore::image const): * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::emitFrame): * platform/mediastream/mac/DisplayCaptureSourceCocoa.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): * platform/win/DragImageCGWin.cpp: (WebCore::createDragImageFromImage): * platform/win/DragImageCairoWin.cpp: (WebCore::createDragImageFromImage): * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintSystemPreviewBadge): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::nativeImageForCurrentFrame): (WebCore::SVGImage::nativeImage): * svg/graphics/SVGImage.h: * svg/graphics/SVGImageForContainer.cpp: (WebCore::SVGImageForContainer::nativeImageForCurrentFrame): * svg/graphics/SVGImageForContainer.h: 2020-11-09 Chris Dumez <cdumez@apple.com> Unexpose obsolete HTMLAppletElement interface https://bugs.webkit.org/show_bug.cgi?id=218677 Reviewed by Darin Adler. Drop support for HTMLAppletElement. This feature is obsolete and has been removed from the HTML specification. The <applet> element was removed in Gecko 56 and Chrome 47 already. No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSPluginElementFunctions.cpp: * bindings/js/JSPluginElementFunctions.h: * html/CachedHTMLCollection.h: (WebCore::nameShouldBeVisibleInDocumentAll): * html/GenericCachedHTMLCollection.cpp: (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches const): * html/HTMLAppletElement.cpp: Removed. * html/HTMLAppletElement.h: Removed. * html/HTMLAppletElement.idl: Removed. * html/HTMLNameCollection.cpp: (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch): (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch): (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch): * html/HTMLPlugInImageElement.h: * html/HTMLTagNames.in: * loader/EmptyClients.cpp: * loader/EmptyFrameLoaderClient.h: * loader/FrameLoaderClient.h: * loader/SubframeLoader.cpp: * loader/SubframeLoader.h: * rendering/RenderEmbeddedObject.cpp: * rendering/RenderEmbeddedObject.h: 2020-11-09 Julian Gonzalez <julian_a_gonzalez@apple.com> Null dereference in CompositeEditCommand::splitTreeToNode() due to not checking for top of DOM tree https://bugs.webkit.org/show_bug.cgi?id=218215 Reviewed by Ryosuke Niwa. Add a check for a non-existent parent node when splitting a tree, and fix up a caller to not pass a node without a parent node. Test: editing/inserting/insert-list-in-iframe-in-list.html * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::unlistifyParagraph): 2020-11-09 Wenson Hsieh <wenson_hsieh@apple.com> Rename ImageBuffer::flushDisplayList to ImageBuffer::submitDisplayList https://bugs.webkit.org/show_bug.cgi?id=218720 Reviewed by Tim Horton. Rename `flushDisplayList` to `submitDisplayList`, to better capture the fact that it's only responsible for applying the contents of the given display list rather than performing a context flush, or applying and clearing out the contents of the given display list. No change in behavior. * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::submitDisplayList): (WebCore::ImageBuffer::flushDisplayList): Deleted. 2020-11-09 Alan Bujtas <zalan@apple.com> Unreviewed, reverting r269603. Needs Safari patch Reverted changeset: "Show legacy line layout visual coverage instead of "simple line" layout." https://bugs.webkit.org/show_bug.cgi?id=218695 https://trac.webkit.org/changeset/269603 2020-11-09 Zalan Bujtas <zalan@apple.com> Show legacy line layout visual coverage instead of "simple line" layout. https://bugs.webkit.org/show_bug.cgi?id=218695 Reviewed by Antti Koivisto. Paint legacy line layout content with the debug shadow instead of the modern one (and use red instead of blue). * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::paint): (WebCore::LayoutIntegration::LineLayout::debugTextShadow): Deleted. * layout/integration/LayoutIntegrationLineLayout.h: * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintMarkedTextForeground): (WebCore::InlineTextBox::debugTextShadow): * rendering/InlineTextBox.h: 2020-11-09 Simon Fraser <simon.fraser@apple.com> [LFC Display] Implement background bleed avoidance, and border-radius clipping of backgrounds https://bugs.webkit.org/show_bug.cgi?id=218713 Reviewed by Zalan Bujtas. Make BoxDecorationPainter into a class so it can hold references to the box, rounded rect etc, and settle on a policy of passing PaintingContext as an argument to all the painting functions. Add code to compute the BackgroundBleedAvoidance policy, and implement the various policies following rendering code. * display/css/DisplayBoxDecorationData.cpp: (WebCore::Display::BorderEdge::obscuresBackgroundEdge const): (WebCore::Display::BoxDecorationData::hasBorder const): (WebCore::Display::BoxDecorationData::hasBorderRadius const): (WebCore::Display::BoxDecorationData::borderObscuresBackground const): (WebCore::Display::BoxDecorationData::borderObscuresBackgroundEdge const): * display/css/DisplayBoxDecorationData.h: (WebCore::Display::borderWidths): * display/css/DisplayBoxDecorationPainter.cpp: (WebCore::Display::BorderPainter::BorderPainter): (WebCore::Display::roundedRectWithIncludedRadii): (WebCore::Display::roundedInsetBorderForRect): (WebCore::Display::BorderPainter::drawBoxSideFromPath const): (WebCore::Display::BorderPainter::clipBorderSidePolygon const): (WebCore::Display::BorderPainter::drawLineForBoxSide const): (WebCore::Display::BorderPainter::paintOneBorderSide const): (WebCore::Display::BorderPainter::paintBorderSides const): (WebCore::Display::BorderPainter::paintTranslucentBorderSides const): (WebCore::Display::shrinkRectByOneDevicePixel): (WebCore::Display::BorderPainter::borderInnerRectAdjustedForBleedAvoidance const): (WebCore::Display::BorderPainter::paintBorders const): (WebCore::Display::BoxDecorationPainter::paintBorders const): (WebCore::Display::BoxDecorationPainter::paintFillLayer const): (WebCore::Display::BoxDecorationPainter::BoxDecorationPainter): (WebCore::Display::BoxDecorationPainter::computeBorderRect): (WebCore::Display::BoxDecorationPainter::paintBackgroundImages const): (WebCore::Display::BoxDecorationPainter::backgroundRoundedRectAdjustedForBleedAvoidance const): (WebCore::Display::BoxDecorationPainter::paintBackground const): (WebCore::Display::BoxDecorationPainter::determineBackgroundBleedAvoidance): (WebCore::Display::BoxDecorationPainter::paintBackgroundAndBorders const): (): Deleted. (WebCore::Display::BorderPainter::roundedBorderForRect const): Deleted. (WebCore::Display::BorderPainter::roundedInsetBorderForRect const): Deleted. (WebCore::Display::BoxDecorationPainter::paintBorders): Deleted. (WebCore::Display::paintFillLayer): Deleted. (WebCore::Display::BoxDecorationPainter::paintBackgroundImages): Deleted. (WebCore::Display::BoxDecorationPainter::paintBackground): Deleted. (WebCore::Display::BoxDecorationPainter::paintBackgroundAndBorders): Deleted. * display/css/DisplayBoxDecorationPainter.h: (WebCore::Display::BoxDecorationPainter::borderRoundedRect const): (WebCore::Display::BoxDecorationPainter::includeLeftEdge const): (WebCore::Display::BoxDecorationPainter::includeRightEdge const): * display/css/DisplayBoxPainter.cpp: (WebCore::Display::BoxPainter::paintBoxDecorations): * display/css/DisplayStyle.cpp: (WebCore::Display::Style::backgroundHasOpaqueTopLayer const): * display/css/DisplayStyle.h: 2020-11-09 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Enable inline image support https://bugs.webkit.org/show_bug.cgi?id=217874 Reviewed by Antti Koivisto. * layout/integration/LayoutIntegrationCoverage.cpp: 2020-11-09 Fujii Hironori <Hironori.Fujii@sony.com> [TextureMapper] backdrop-filter should use the identity transform to render the root layer https://bugs.webkit.org/show_bug.cgi?id=218699 Reviewed by Don Olmstead. Even thouth CSS reflections mirror the content, backdrop-filter in the reflection doesn't. It sees through the background. css3/filters/backdrop/backdrop-filter-with-reflection.html is the test case. * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica): (WebCore::TextureMapperLayer::paintIntoSurface): (WebCore::TextureMapperLayer::paintWithIntermediateSurface): Removed TextureMapperPaintOptions::isReplica. 2020-11-09 Per Arne Vollan <pvollan@apple.com> [macOS] System sounds should be played in the UI process https://bugs.webkit.org/show_bug.cgi?id=218405 <rdar://problem/70898846> Reviewed by Darin Adler. In preparation of blocking the system sound server in the WebContent process, system sounds should be played in the UI process. This patch creates a system sound manager, which delegates the sound request if a delegate is present, otherwise the function PAL::systemBeep will be called. API test: WebKit.SystemBeep * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * editing/Editor.cpp: (WebCore::Editor::cut): (WebCore::Editor::copy): (WebCore::Editor::performDelete): * editing/EditorCommand.cpp: (WebCore::executeSelectToMark): (WebCore::executeSwapWithMark): * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::takeFindStringFromSelection): * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::beep): * platform/SystemSoundDelegate.h: Added. (WebCore::SystemSoundDelegate::~SystemSoundDelegate): (WebCore::SystemSoundDelegate::systemBeep): * platform/SystemSoundManager.cpp: Added. (WebCore::SystemSoundManager::singleton): (WebCore::SystemSoundManager::setSystemSoundDelegate): (WebCore::SystemSoundManager::systemBeep): * platform/SystemSoundManager.h: Added. * platform/audio/StereoPanner.cpp: * testing/Internals.cpp: (WebCore::Internals::systemBeep): * testing/Internals.h: * testing/Internals.idl: 2020-11-09 Wenson Hsieh <wenson_hsieh@apple.com> Clean up some code after inline display list refactoring https://bugs.webkit.org/show_bug.cgi?id=218714 Reviewed by Tim Horton. See below for more details. * platform/graphics/displaylists/DisplayListItems.h: Remove a couple of extraneous `encode()` and `decode()` method declarations. * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::Replayer::replay): Add a missing `++` for this counter variable. 2020-11-09 Fujii Hironori <Hironori.Fujii@sony.com> [TextureMapper] The top and left sides of drop-shadow are clipped https://bugs.webkit.org/show_bug.cgi?id=218647 Reviewed by Don Olmstead. TextureMapperLayer::computeOverlapRegions incorrectly calculated the local bounding rect for top and left of outsets. The drop-shadow was incorrectly blended with the content. Test: compositing/filters/drop-shadow.html * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeOverlapRegions): Stopped using std::max for the left and top of outsets. Stopped taking the unite with unfilteredTargetRect because outsets are always positive. * platform/graphics/texmap/TextureMapperShaderProgram.cpp: Fixed sourceOver(). 2020-11-09 Devin Rousso <drousso@apple.com> autofocus of text input should not select text https://bugs.webkit.org/show_bug.cgi?id=218585 <rdar://problem/60130704> Reviewed by Wenson Hsieh. Test: fast/forms/input-text-autofocus.html * dom/Document.h: * history/CachedPage.cpp: (WebCore::CachedPage::restore): * html/HTMLInputElement.h: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::updateFocusAppearance): (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus): (WebCore::HTMLInputElement::runPostTypeUpdateTasks): (WebCore::HTMLInputElement::didAttachRenderers): * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::updateFocusAppearance): * html/InputType.cpp: (WebCore::InputType::accessKeyAction): * page/EventHandler.cpp: (WebCore::EventHandler::dispatchMouseEvent): * page/FocusController.cpp: (WebCore::FocusController::advanceFocusInDocumentOrder): (WebCore::FocusController::advanceFocusDirectionallyInContainer): Slightly rework `SelectionRestorationMode` to replace `SetDefault` with two new values: - `PlaceCaretAtStart` puts the caret at the start, regardless of any cached selection - `SelectAll` selects all text, regardless of any cached selection (existing behavior) In order to preserve existing behavior, the default `Restore` will have the same effect as `SelectAll` if there is no cached selection (and is renamed to `RestoreOrSelectAll` as such). * dom/Element.h: * dom/Element.cpp: (WebCore::Element::focus): * html/HTMLLabelElement.h: * html/HTMLLabelElement.cpp: (WebCore::HTMLLabelElement::focus): * html/HTMLLegendElement.h: * html/HTMLLegendElement.cpp: (WebCore::HTMLLegendElement::focus): Replace the `bool restorePreviousSelection` with `SelectionRestorationMode` since that's what it's eventually used for anyways. This also allows for more flexibility in behavior, such as callers using the new `SelectionRestorationMode` values. * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::didAttachRenderers): Change to `PlaceCaretAtStart` to match other browsers. 2020-11-09 Antti Koivisto <antti@apple.com> [LFC] Initialize border style correctly https://bugs.webkit.org/show_bug.cgi?id=218712 Reviewed by Zalan Bujtas. Tested by fast/events/drag-image-with-border-image.html with image integration enabled. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedBorder const): BorderValue::boxModelWidth() doesn't take non-color decorations into account. Calling style.borderLeftWidth() and pals does the right thing. * rendering/style/BorderValue.h: (WebCore::BorderValue::style const): (WebCore::BorderValue::boxModelWidth const): Deleted. Remove this unneeded helper. 2020-11-09 Chris Lord <clord@igalia.com> [GTK] kinetic scroll speed should be cumulative https://bugs.webkit.org/show_bug.cgi?id=203914 Reviewed by Carlos Garcia Campos. Accumulate velocity in the same direction with ScrollAnimationKinetic. * platform/ScrollAnimationKinetic.cpp: (WebCore::ScrollAnimationKinetic::stop): (WebCore::ScrollAnimationKinetic::start): (WebCore::ScrollAnimationKinetic::animationTimerFired): (WebCore::ScrollAnimationKinetic::deltaToNextFrame): * platform/ScrollAnimationKinetic.h: 2020-11-09 Chris Dumez <cdumez@apple.com> Look at parents when event bubbles for input element activation behavior https://bugs.webkit.org/show_bug.cgi?id=218660 Reviewed by Ryosuke Niwa. When a click event is dispatched at a node that is not an HTMLInputElement, and if the event bubbles, we should look up the tree to see if there is an HTMLInputElement that we should trigger activation behavior for. Prevously, we were failing to do this. The new behavior is consistent with Blink. No new tests, rebaselined existing test. * dom/EventDispatcher.cpp: (WebCore::findInputElementInEventPath): (WebCore::EventDispatcher::dispatchEvent): 2020-11-09 Chris Lord <clord@igalia.com> [GTK][WPE] Scrolling with mouse wheel doesn't work on iframes with async scrolling enabled https://bugs.webkit.org/show_bug.cgi?id=214179 Reviewed by Žan Doberšek. Implement ScrollingTree::scrollingNodeForPoint in ScrollingTreeNicosia. This fixes overflow and iframe scrolling when async scrolling is enabled on WPE and GTK ports. * page/scrolling/ThreadedScrollingTree.h: * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren): * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: * page/scrolling/nicosia/ScrollingTreeNicosia.cpp: (WebCore::collectDescendantLayersAtPoint): (WebCore::ScrollingTreeNicosia::scrollingNodeForPoint): * page/scrolling/nicosia/ScrollingTreeNicosia.h: * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::commitStateBeforeChildren): * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h: * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::CompositionLayer::flushState): (Nicosia::CompositionLayer::accessPending): 2020-11-09 Chris Lord <clord@igalia.com> REGRESSION(r269503): [GTK][WPE] >200 tests are failing https://bugs.webkit.org/show_bug.cgi?id=218654 <rdar://problem/71116949> Reviewed by Žan Doberšek. Replace the NativeImagePtr calls with ImageBuffer::draw. With the cairo implementation, in the cases where it's possible, it amounts to the same thing, but the draw implementation also handles cases that the previous patch didn't. * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::drawImageBuffer): 2020-11-08 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Cleanup LayoutIntegration::Line interface https://bugs.webkit.org/show_bug.cgi?id=218690 Reviewed by Daniel Bates and Antti Koivisto. LayoutIntegration::Line has the following set of geometries: Line rect and line box size: Line is always as tall as the line box is. However they may differ in width. While line box encloses all the inline level boxes on the line horizontally, the line itself may be shorter (and trigger horizontal overflow). Enclosing content rect: It encloses all inline level boxes both vertically and horizontally. In certain cases (see line-height property) the line (and the line box) is not as tall as the inline level boxes on the line. Scrollable overflow rect: It's mainly the line box (encloses the inline level boxes horizontally) with some end padding adjustment for the caret (see legacy line layout). Ink overflow rect: Regular ink overflow e.g. stroke, letter spacing. * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: (WebCore::LayoutIntegration::InlineContentBuilder::constructDisplayLines const): 2020-11-08 Fujii Hironori <Hironori.Fujii@sony.com> TextureMapperLayer::computeOverlapRegions: Accumulate nested replica transform matrices recursively https://bugs.webkit.org/show_bug.cgi?id=218364 Reviewed by Don Olmstead. Transformed nested reflection layers were wrongly clipped because computeOverlapRegions applied replica transform matrices incorrectly. Test: compositing/reflections/nested-reflection-opacity2.html * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::resolveOverlaps): (WebCore::TextureMapperLayer::computeOverlapRegions): (WebCore::TextureMapperLayer::paintUsingOverlapRegions): * platform/graphics/texmap/TextureMapperLayer.h: 2020-11-08 Fujii Hironori <Hironori.Fujii@sony.com> [GraphicsLayerTextureMapper] reflection masks aren't applied https://bugs.webkit.org/show_bug.cgi?id=218429 Reviewed by Don Olmstead. The backing store of the mask layer of replica layers aren't updated at all since r178111. * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers): Use updateBackingStoreIncludingSubLayers for the replica layer to update backing stores recursively instead of updating only one layer by using updateBackingStoreIfNeeded. 2020-11-08 Darin Adler <darin@apple.com> Remove another function that implicitly uses the composed tree (documentOrder on nodes and boundary points) https://bugs.webkit.org/show_bug.cgi?id=218673 Reviewed by Ryosuke Niwa. Test: fast/dom/treeOrderBoundaryPoint.html * accessibility/AXObjectCache.cpp: (WebCore::characterOffsetsInOrder): Use treeOrder<ComposedTree>. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::misspellingRange const): Ditto. (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): Ditto. * dom/BoundaryPoint.h: Removed documentOrder, added treeOrderForTesting. * dom/Node.cpp: Updated comment referring to documentOrder. * dom/Position.cpp: (WebCore::documentOrder): Use treeOrder<ComposedTree>. * dom/SimpleRange.cpp: (WebCore::treeOrderForTesting): Added. (WebCore::documentOrder): Deleted. (WebCore::compareByComposedTreeOrder): Renamed from compareByDocumentOrder and use treeOrder<ComposedTree>. (WebCore::unionRange): Use compareByComposedTreeOrder. (WebCore::intersection): Ditto. * dom/SimpleRange.h: Removed documentOrder. Also removed some repeated function and function template declarations that were left in here by accident. * editing/TextIterator.cpp: (WebCore::characterCount): Use treeOrder<ComposedTree>. * testing/Internals.cpp: (WebCore::Internals::treeOrderBoundaryPoints): Added. * testing/Internals.h: Ditto. * testing/Internals.idl: Ditto. 2020-11-07 Rob Buis <rbuis@igalia.com> Fix warning related to unsigned >=0 ASSERT https://bugs.webkit.org/show_bug.cgi?id=218682 Reviewed by Fujii Hironori. Source/WebCore/rendering/RenderText.cpp:592:19: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits] * rendering/RenderText.cpp: (WebCore::createVisiblePositionAfterAdjustingOffsetForBiDi): 2020-11-07 Rob Buis <rbuis@igalia.com> Fix GTK debug build https://bugs.webkit.org/show_bug.cgi?id=218683 Reviewed by Fujii Hironori. Commit r269435 forgot to account for Frame* -> WeakPtr<Frame> change in this ASSERT. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::finishedLoading): 2020-11-07 Simon Fraser <simon.fraser@apple.com> [LFC Display] Implement CSS border painting https://bugs.webkit.org/show_bug.cgi?id=218685 Reviewed by Zalan Bujtas. Add Display::BoxDecorationPainter() which paints borders and backgrounds for the given box, and implement border drawing. Future patches will add support for BackgroundBleedAvoidance and background clipping for border-radius. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * display/css/DisplayBoxDecorationData.cpp: (WebCore::Display::BorderEdge::BorderEdge): (WebCore::Display::BorderEdge::obscuresBackground const): (WebCore::Display::calculateBorderEdges): (WebCore::Display::adjacentSidesForSide): * display/css/DisplayBoxDecorationData.h: (WebCore::Display::BorderEdge::width const): (WebCore::Display::BorderEdge::style const): (WebCore::Display::BorderEdge::color const): (WebCore::Display::BorderEdge::isTransparent const): (WebCore::Display::BorderEdge::isPresent const): (WebCore::Display::BorderEdge::hasVisibleColorAndStyle const): (WebCore::Display::BorderEdge::shouldRender const): (WebCore::Display::BorderEdge::presentButInvisible const): (WebCore::Display::BorderEdge::widthForPainting const): (WebCore::Display::BorderEdge::innerWidth const): (WebCore::Display::BorderEdge::outerWidth const): (WebCore::Display::BoxDecorationData::setBackgroundImageGeometry): (WebCore::Display::BoxDecorationData::borderEdges const): (WebCore::Display::BoxDecorationData::setBorderEdges): (WebCore::Display::BoxDecorationData::borderRadii const): (WebCore::Display::BoxDecorationData::setBorderRadii): (WebCore::Display::BoxDecorationData::hasBorderImage const): (WebCore::Display::BoxDecorationData::roundedBorderRect const): Deleted. (WebCore::Display::BoxDecorationData::setRoundedBorderRect): Deleted. * display/css/DisplayBoxDecorationPainter.cpp: Added. (WebCore::Display::BorderPainter::BorderPainter): (WebCore::Display::BorderPainter::edgesShareColor): (WebCore::Display::BorderPainter::borderStyleFillsBorderArea): (WebCore::Display::BorderPainter::borderStyleHasInnerDetail): (WebCore::Display::BorderPainter::styleRequiresClipPolygon): (WebCore::Display::BorderPainter::borderStyleIsDottedOrDashed): (WebCore::Display::BorderPainter::borderWillArcInnerEdge): (WebCore::Display::BorderPainter::borderStyleHasUnmatchedColorsAtCorner): (WebCore::Display::BorderPainter::colorsMatchAtCorner const): (WebCore::Display::BorderPainter::colorNeedsAntiAliasAtCorner const): (WebCore::Display::BorderPainter::calculateBorderStyleColor): (WebCore::Display::BorderPainter::willBeOverdrawn const): (WebCore::Display::BorderPainter::borderStylesRequireMitre): (WebCore::Display::BorderPainter::calculateAdjustedInnerBorder): (WebCore::Display::BorderPainter::joinRequiresMitre const): (WebCore::Display::roundedRectWithIncludedRadii): (WebCore::Display::BorderPainter::roundedBorderForRect const): (WebCore::Display::BorderPainter::roundedInsetBorderForRect const): (WebCore::Display::BorderPainter::drawBoxSideFromPath const): (WebCore::Display::BorderPainter::clipBorderSidePolygon const): (WebCore::Display::BorderPainter::drawLineForBoxSide const): (WebCore::Display::BorderPainter::paintOneBorderSide const): (WebCore::Display::BorderPainter::paintBorderSides const): (WebCore::Display::BorderPainter::paintTranslucentBorderSides const): (WebCore::Display::BorderPainter::paintBorders const): (WebCore::Display::BoxDecorationPainter::paintBorders): (WebCore::Display::paintFillLayer): (WebCore::Display::BoxDecorationPainter::paintBackgroundImages): (WebCore::Display::BoxDecorationPainter::paintBackground): (WebCore::Display::BoxDecorationPainter::paintBackgroundAndBorders): * display/css/DisplayBoxDecorationPainter.h: Copied from Source/WebCore/display/css/DisplayBoxDecorationData.cpp. * display/css/DisplayBoxFactory.cpp: (WebCore::Display::BoxFactory::constructBoxDecorationData const): (WebCore::Display::BoxFactory::setupBoxModelBox const): * display/css/DisplayBoxPainter.cpp: (WebCore::Display::BoxPainter::paintBoxDecorations): (WebCore::Display::BoxPainter::paintFillLayer): Deleted. (WebCore::Display::BoxPainter::paintBackgroundImages): Deleted. * display/css/DisplayStyle.cpp: (WebCore::Display::Style::Style): (WebCore::Display::Style::hasVisibleBorder const): Deleted. * display/css/DisplayStyle.h: (WebCore::Display::Style::borderLeft const): Deleted. (WebCore::Display::Style::borderRight const): Deleted. (WebCore::Display::Style::borderTop const): Deleted. (WebCore::Display::Style::borderBottom const): Deleted. * platform/graphics/FloatRoundedRect.h: 2020-11-07 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Introduce InlineContentBuilder https://bugs.webkit.org/show_bug.cgi?id=218684 Reviewed by Antti Koivisto. Move the display run and line construction to this new class. This is in preparation for expanding the construction coverage to support features like bidirectional content handling. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/inlineformatting/InlineContentBreaker.cpp: * layout/integration/LayoutIntegrationInlineContentBuilder.cpp: Added. (WebCore::LayoutIntegration::lineOverflowWidth): (WebCore::LayoutIntegration::InlineContentBuilder::InlineContentBuilder): (WebCore::LayoutIntegration::InlineContentBuilder::build const): (WebCore::LayoutIntegration::InlineContentBuilder::computeLineLevelVisualAdjustmentsForRuns const): (WebCore::LayoutIntegration::InlineContentBuilder::constructDisplayLineRuns const): (WebCore::LayoutIntegration::InlineContentBuilder::constructDisplayLines const): * layout/integration/LayoutIntegrationInlineContentBuilder.h: Added. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): (WebCore::LayoutIntegration::lineOverflowWidth): Deleted. 2020-11-07 Simon Fraser <simon.fraser@apple.com> REGRESSION (r268476): Sometimes zooming does not work on purpleair.com/map https://bugs.webkit.org/show_bug.cgi?id=218680 <rdar://problem/70418612> Reviewed by Zalan Bujtas. Loading purpleair.com/map and quickly panning then zooming would often fail to zoom the map, and rubberband instead. This happened because the composited layer containing the WebGL canvas would switch to into tiled mode, and that would fail to set the event region on the new platform layer. The fix is to just add the 'EventRegionChanged' flag to the list of properties that need to get updated after a tiled layer switch. Test: fast/scrolling/mac/wheel-event-listener-region-tiled-layer-switch.html * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::determineWheelEventProcessing): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::changeLayerTypeTo): 2020-11-06 Simon Fraser <simon.fraser@apple.com> A programmatic scroll to a new location should stop rubberbanding https://bugs.webkit.org/show_bug.cgi?id=218672 Reviewed by Tim Horton. This is a better version of the fix in r269373. That fix attempted to stop a rubberband if there was a programmatic scroll that moved you away from the edge where any active rubberband was happening. However, the code ran too late; by the time ScrollController::scrollPositionChanged() is called, the position has already changed, but more importantly the requested scroll position had already been clamped between min and max scroll position, where the behavior of maximumScrollPosition() is affected by whether the rubberbanding is active (see ScrollingTreeFrameScrollingNodeMac::maximumScrollPosition() and its use of totalContentsSizeForRubberBand()). The result of this was that the active rubberband triggered clamping of the requested scroll position before we got a chance to stop the rubberband, breaking some programmatic scrolls on netflix.com. Fix by plumbing through willDoProgrammaticScroll() which stops the rubberband before maximumScrollPosition() gets a chance to clamp the position. Will be tested after one additional required patch to come. * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::scrollTo): (WebCore::ScrollingTreeScrollingNode::isRubberBanding const): Deleted. * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::willDoProgrammaticScroll): (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::willDoProgrammaticScroll): (WebCore::ScrollingTreeOverflowScrollingNodeMac::currentScrollPositionChanged): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::willDoProgrammaticScroll): (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollPositionIsNotRubberbandingEdge const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::currentScrollPositionChanged): * platform/RectEdges.h: (WebCore::operator<<): * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::notifyPositionChanged): * platform/cocoa/ScrollController.h: (WebCore::ScrollController::rubberBandingEdges const): * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::scrollPositionChanged): (WebCore::ScrollController::stopRubberbanding): 2020-11-06 Simon Fraser <simon.fraser@apple.com> Programmatic scrolls need updated scrolling geometry https://bugs.webkit.org/show_bug.cgi?id=218676 Reviewed by Tim Horton. Part of rdar://problem/69599531: Scrolling on netflix.com sometimes jumps to the top. A programmatic scroll can happen right after content changes affect the scrolled content size, and need to be committed right away to avoid the scrolling thread continuing to process events or run rubberbanding based on stale state. So when we get requestScrollPositionUpdate(), update the scrolling node geometry and immediately commit the scrolling tree. Test: fast/scrolling/mac/programmatic-scroll-overrides-rubberband.html * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate): 2020-11-06 Peng Liu <peng.liu6@apple.com> PiP return to element full screen is not smooth on some websites https://bugs.webkit.org/show_bug.cgi?id=218419 Reviewed by Jer Noble. In r265562, we added the support that a video in picture-in-picture can return to element fullscreen directly if the fullscreen API is supported. The basic idea of the implementation is to request the element to enter fullscreen when the video needs to exit picture-in-picture, and start exiting picture-in-picture after the element fullscreen transition is completed. On the iOS port, the entering element fullscreen transition needs to be done in 500 ms. Otherwise, AVKit will start the exiting picture-in-picture animation and notify VideoFullscreenInterfaceAVKit about the progress before the element fullscreen implementation has done the job. When that happens, the exiting picture-in-picture animation will be incorrect and we have to use mechanisms to protect the state of VideoFullscreenInterfaceAVKit. Unfortunately, on some websites, the entering element fullscreen transition does take longer than than 500 ms due to complex CSS style updates. In this patch, when a video in picture-in-picture needs to return to element fullscreen, it will return to a `temporary` fullscreen state (video fullscreen) with a smooth animation implemented by AVKit. The video will continue playing in the temporary fullscreen state while the element fullscreen transition is happening in the background which is invisible to users. After the element fullscreen transition is done, VideoFullscreenInterfaceAVKit exits the temporary fullscreen state and returns to standby. Users won't notice the temporary fullscreen state because media controls are hidden in that state. This patch also fixes issues found in stress tests. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::exitFullscreen): For exitVideoFullscreenToModeWithoutAnimation(), we should not set `m_changingVideoFullscreenMode` to true, because there won't be confirmation to reset m_changingVideoFullscreenMode to false. (WebCore::HTMLMediaElement::setVideoFullscreenStandby): When the exit fullscreen request is rejected, we should not set `m_videoFullscreenStandby` to false. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitSetPresentationMode): Only protect too fast setPresentationMode() calls from JS code. (WebCore::HTMLVideoElement::setPresentationMode): (WebCore::HTMLVideoElement::didEnterFullscreenOrPictureInPicture): (WebCore::HTMLVideoElement::didExitFullscreenOrPictureInPicture): (WebCore::HTMLVideoElement::setVideoFullscreenFrame): Rename `m_isEnteringPictureInPicture` to `m_enteringPictureInPicture` and `m_isExitingPictureInPicture` to `m_exitingPictureInPicture`. * html/HTMLVideoElement.h: Ditto. * page/ChromeClient.h: (WebCore::ChromeClient::exitVideoFullscreenForVideoElement): Add a completion handler parameter so that the caller can be notified that the request is rejected. * platform/cocoa/VideoFullscreenChangeObserver.h: Remove an unused function `fullscreenWillReturnToInline()`. * platform/cocoa/VideoFullscreenModel.h: (WebCore::VideoFullscreenModelClient::prepareToExitPictureInPicture): Deleted. * platform/ios/VideoFullscreenInterfaceAVKit.h: Function `exitFullscreen()` now returns a boolean value indicating the request is accepted or rejected. Add a function `preparedToReturnToStandby()`, which is used to notify VideoFullscreenInterfaceAVKit that the video is ready to return to standby. Add a parameter `shouldNotifyModel` to `setMode()` and `clearMode()`. `shouldNotifyModel` is `true` when a request to enter/exit picture-in-picture is from AVKit. Remove unused `m_stopPictureInPictureTimer` and the related function. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit): Remove unused `m_stopPictureInPictureTimer`. (VideoFullscreenInterfaceAVKit::exitFullscreen): We don't need to check whether `m_watchdogTimer` is active before stopping it. When a video is entering picture-in-picture, we should reject the request to exit fullscreen. (VideoFullscreenInterfaceAVKit::cleanupFullscreen): Remove unused code. (VideoFullscreenInterfaceAVKit::invalidate): Fix an issue in stress tests. (VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStop): (VideoFullscreenInterfaceAVKit::didStartPictureInPicture): When a video is entering picture-in-picture from standby, we may need to return to element fullscreen in the future. So we may need to return to the video fullscreen state implemented by AVKit. Also, we should delay the `didEnterPictureInPicture` notification in `doEnterFullscreen()` until VideoFullscreenInterfaceAVKit completely enters picture-in-picture. (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture): A minor clean-up. (VideoFullscreenInterfaceAVKit::willStopPictureInPicture): A minor clean-up. (VideoFullscreenInterfaceAVKit::didStopPictureInPicture): Notify the observer that a video has exited picture-in-picture. If the video needs to return to element fullscreen, the video is actually in the temporary fullscreen state. Also, move `didExitPictureInPicture()` to `cleanupFullscreen()`. (VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler): Minor clean-up and disable picture-in-picture support temporarily. Explained in WebKit/ChangeLog. (VideoFullscreenInterfaceAVKit::setHasVideoContentLayer): When a video is entering standby state, we need to call `returnToStandby()` if `m_returningToStandby` is true. (VideoFullscreenInterfaceAVKit::doSetup): Remove unused code. (VideoFullscreenInterfaceAVKit::preparedToReturnToStandby): Return to standby after the element fullscreen transition is completed. (VideoFullscreenInterfaceAVKit::doEnterFullscreen): Move `m_videoFullscreenModel->didEnterPictureInPicture()` from `didStartPictureInPicture()` to this function. (VideoFullscreenInterfaceAVKit::doExitFullscreen): Minor clean-up. (VideoFullscreenInterfaceAVKit::exitFullscreenHandler): (VideoFullscreenInterfaceAVKit::enterFullscreenHandler): Hide the media controls provided by AVKit when the video is in the temporary fullscreen state. (VideoFullscreenInterfaceAVKit::returnToStandby): Call `didSetupFullscreen()` to return to standby. (VideoFullscreenInterfaceAVKit::setMode): (VideoFullscreenInterfaceAVKit::clearMode): (VideoFullscreenInterfaceAVKit::stopPictureInPictureTimerFired): Deleted. (VideoFullscreenInterfaceAVKit::setReadyToStopPictureInPicture): Deleted. * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::fullscreenMayReturnToInline): (VideoFullscreenControllerContext::fullscreenWillReturnToInline): Deleted. * platform/mac/VideoFullscreenInterfaceMac.h: * platform/mac/VideoFullscreenInterfaceMac.mm: (WebCore::VideoFullscreenInterfaceMac::setMode): (WebCore::VideoFullscreenInterfaceMac::exitFullscreen): 2020-11-06 Wenson Hsieh <wenson_hsieh@apple.com> Remove `localBounds` and `globalBounds` methods from display list items that are not drawing items https://bugs.webkit.org/show_bug.cgi?id=218675 Reviewed by Tim Horton and Devin Rousso. In r269525, I refactored display list items to no longer derive from base classes (i.e. `DisplayList::Item` and `DisplayList::DrawingItem`). In doing so, I ended up adding the `localBounds` and `globalBounds` methods everywhere, since these methods are called from within the templated `DisplayList::Recorder::append` method if the given type is a drawing item (that is, the static `isDrawingItem` flag is set). However, for non-drawing items such as state change items, `FlushContext`, and `MetaCommandSwitchTo`, having these methods makes no sense. We can fix this by leveraging `constexpr if` to only update item extents for display list item types that are drawing items. This allows us to remove these two methods from all display list items that are not drawing items. * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::Save::localBounds const): Deleted. (WebCore::DisplayList::Save::globalBounds const): Deleted. (WebCore::DisplayList::Restore::localBounds const): Deleted. (WebCore::DisplayList::Restore::globalBounds const): Deleted. (WebCore::DisplayList::Translate::localBounds const): Deleted. (WebCore::DisplayList::Translate::globalBounds const): Deleted. (WebCore::DisplayList::Rotate::localBounds const): Deleted. (WebCore::DisplayList::Rotate::globalBounds const): Deleted. (WebCore::DisplayList::Scale::localBounds const): Deleted. (WebCore::DisplayList::Scale::globalBounds const): Deleted. (WebCore::DisplayList::SetCTM::localBounds const): Deleted. (WebCore::DisplayList::SetCTM::globalBounds const): Deleted. (WebCore::DisplayList::ConcatenateCTM::localBounds const): Deleted. (WebCore::DisplayList::ConcatenateCTM::globalBounds const): Deleted. (WebCore::DisplayList::SetInlineFillGradient::localBounds const): Deleted. (WebCore::DisplayList::SetInlineFillGradient::globalBounds const): Deleted. (WebCore::DisplayList::SetInlineFillColor::localBounds const): Deleted. (WebCore::DisplayList::SetInlineFillColor::globalBounds const): Deleted. (WebCore::DisplayList::SetInlineStrokeColor::localBounds const): Deleted. (WebCore::DisplayList::SetInlineStrokeColor::globalBounds const): Deleted. (WebCore::DisplayList::SetStrokeThickness::localBounds const): Deleted. (WebCore::DisplayList::SetStrokeThickness::globalBounds const): Deleted. (WebCore::DisplayList::SetState::localBounds const): Deleted. (WebCore::DisplayList::SetState::globalBounds const): Deleted. (WebCore::DisplayList::SetLineCap::localBounds const): Deleted. (WebCore::DisplayList::SetLineCap::globalBounds const): Deleted. (WebCore::DisplayList::SetLineDash::localBounds const): Deleted. (WebCore::DisplayList::SetLineDash::globalBounds const): Deleted. (WebCore::DisplayList::SetLineJoin::localBounds const): Deleted. (WebCore::DisplayList::SetLineJoin::globalBounds const): Deleted. (WebCore::DisplayList::SetMiterLimit::localBounds const): Deleted. (WebCore::DisplayList::SetMiterLimit::globalBounds const): Deleted. (WebCore::DisplayList::ClearShadow::localBounds const): Deleted. (WebCore::DisplayList::ClearShadow::globalBounds const): Deleted. (WebCore::DisplayList::Clip::localBounds const): Deleted. (WebCore::DisplayList::Clip::globalBounds const): Deleted. (WebCore::DisplayList::ClipOut::localBounds const): Deleted. (WebCore::DisplayList::ClipOut::globalBounds const): Deleted. (WebCore::DisplayList::ClipOutToPath::localBounds const): Deleted. (WebCore::DisplayList::ClipOutToPath::globalBounds const): Deleted. (WebCore::DisplayList::ClipPath::localBounds const): Deleted. (WebCore::DisplayList::ClipPath::globalBounds const): Deleted. (WebCore::DisplayList::ClipToDrawingCommands::localBounds const): Deleted. (WebCore::DisplayList::ClipToDrawingCommands::globalBounds const): Deleted. (WebCore::DisplayList::ApplyStrokePattern::localBounds const): Deleted. (WebCore::DisplayList::ApplyStrokePattern::globalBounds const): Deleted. (WebCore::DisplayList::ApplyFillPattern::localBounds const): Deleted. (WebCore::DisplayList::ApplyFillPattern::globalBounds const): Deleted. (WebCore::DisplayList::ApplyDeviceScaleFactor::localBounds const): Deleted. (WebCore::DisplayList::ApplyDeviceScaleFactor::globalBounds const): Deleted. (WebCore::DisplayList::FlushContext::localBounds const): Deleted. (WebCore::DisplayList::FlushContext::globalBounds const): Deleted. (WebCore::DisplayList::MetaCommandSwitchTo::localBounds const): Deleted. (WebCore::DisplayList::MetaCommandSwitchTo::globalBounds const): Deleted. * platform/graphics/displaylists/DisplayListRecorder.h: (WebCore::DisplayList::Recorder::appendWithoutUpdatingExtents): (WebCore::DisplayList::Recorder::append): 2020-11-06 Andres Gonzalez <andresg_22@apple.com> Fix for LayoutTests/accessibility/Mac/accesskey.html in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=218669 Reviewed by Chris Fleizach. Test: LayoutTests/accessibility/mac/accesskey.html. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): String properties need to be isolated-copied to be used on AX secondary thread. 2020-11-06 Wenson Hsieh <wenson_hsieh@apple.com> Add new display list item types in preparation for webkit.org/b/218426 https://bugs.webkit.org/show_bug.cgi?id=218588 Reviewed by Simon Fraser. Introduce these new item types. See below for more details. * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::append): * platform/graphics/displaylists/DisplayListItemBuffer.cpp: (WebCore::DisplayList::ItemHandle::apply): (WebCore::DisplayList::ItemHandle::destroy): (WebCore::DisplayList::ItemHandle::copyTo): (WebCore::DisplayList::ItemBuffer::swapWritableBufferIfNeeded): Let `ItemBuffer` automatically append "switch to command buffer" item whenever it runs out of space in its current writable buffer, and either allocates a new buffer or calls into the client to grab a new buffer. * platform/graphics/displaylists/DisplayListItemType.cpp: (WebCore::DisplayList::sizeOfItemInBytes): (WebCore::DisplayList::isDrawingItem): (WebCore::DisplayList::isInlineItem): * platform/graphics/displaylists/DisplayListItemType.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::FlushContext::apply const): (WebCore::DisplayList::operator<<): (WebCore::DisplayList::MetaCommandSwitchTo::apply const): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::FlushContext::FlushContext): (WebCore::DisplayList::FlushContext::identifier const): (WebCore::DisplayList::FlushContext::localBounds const): (WebCore::DisplayList::FlushContext::globalBounds const): Add `FlushContext`, which will indicate to the client that it should flush its backing graphics context. The only data in this item is a `DisplayList::FlushIdentifier`, which will be used by the display list client to coordinate flush timing. (WebCore::DisplayList::MetaCommandSwitchTo::MetaCommandSwitchTo): (WebCore::DisplayList::MetaCommandSwitchTo::identifier const): (WebCore::DisplayList::MetaCommandSwitchTo::localBounds const): (WebCore::DisplayList::MetaCommandSwitchTo::globalBounds const): Add an item to represent switching to a new item buffer. This is automatically appended by the display list itself when it runs out of space on the current writable buffer, and will allow display list clients (in particular, the remote rendering backend in the GPU process) to seamlessly continue reading display list items when all item data in a display list item buffer has been exhausted. Also, add a FIXME here for pulling `MetaCommandSwitchTo` out of the set of display list items. We plan on tackling this as a part of generalizing concurrent display list architecture in a way that can be used for serializing WebGL commands as well. 2020-11-06 Wenson Hsieh <wenson_hsieh@apple.com> Add a display list item to represent stroking a single line https://bugs.webkit.org/show_bug.cgi?id=218589 Reviewed by Tim Horton. Add support for the new display list item, and append it when we know we're stroking a Path that consists of a single line. No change in behavior. * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::append): * platform/graphics/displaylists/DisplayListItemBuffer.cpp: (WebCore::DisplayList::ItemHandle::apply): (WebCore::DisplayList::ItemHandle::destroy): (WebCore::DisplayList::ItemHandle::copyTo const): * platform/graphics/displaylists/DisplayListItemType.cpp: (WebCore::DisplayList::sizeOfItemInBytes): (WebCore::DisplayList::isDrawingItem): (WebCore::DisplayList::isInlineItem): * platform/graphics/displaylists/DisplayListItemType.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::StrokeLine::localBounds const): (WebCore::DisplayList::StrokeLine::apply const): (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::StrokeLine::StrokeLine): (WebCore::DisplayList::StrokeLine::start const): (WebCore::DisplayList::StrokeLine::end const): (WebCore::DisplayList::StrokeLine::globalBounds const): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::strokePath): 2020-11-06 Chris Dumez <cdumez@apple.com> Event targets should be cleared after dispatch if target pointed to a shadow tree https://bugs.webkit.org/show_bug.cgi?id=218638 Reviewed by Darin Adler. Event target & relatedTarget should be cleared after dispatch if target pointed to a shadow tree: - https://dom.spec.whatwg.org/#concept-event-dispatch (Steps 5.10, 5.11 and 10) Tests: fast/events/shadow-tree-resetTargets-after-move-in.html fast/events/shadow-tree-resetTargets-after-move-out.html fast/events/shadow-tree-resetTargets.html * dom/Event.h: (WebCore::Event::setRelatedTarget): * dom/EventContext.cpp: (WebCore::MouseOrFocusEventContext::handleLocalEvents const): * dom/EventContext.h: (WebCore::EventContext::relatedTarget const): * dom/EventDispatcher.cpp: (WebCore::isInShadowTree): (WebCore::EventDispatcher::dispatchEvent): * dom/FocusEvent.h: * dom/MouseEvent.h: 2020-11-06 Sam Weinig <weinig@apple.com> Further progress towards merging Settings.yaml into WebPreferences.yaml https://bugs.webkit.org/show_bug.cgi?id=218663 Reviewed by Tim Horton. * Scripts/GenerateSettings.rb: Change GenerateSettings.rb to take the list of templates in as arguments rather than hard coding it. This matches GeneratePreferences and will make it easier to switch over. * DerivedSources.make: Update call to GenerateSettings.rb to pass templates and adopt static pattern list to make it very clear what needs to be generated. * WebCoreMacros.cmake: Update call to GenerateSettings.rb to pass templates * page/SettingsDefaultValues.h: Removed. * Scripts/SettingsTemplates/Settings.cpp.erb: * WebCore.xcodeproj/project.pbxproj: Remove SettingsDefaultValues.h inlining defaults directly in the yaml files. * page/Settings.yaml: Add defaults directly in the definition rather than relying on compiled constants. * page/SettingsBase.cpp: (WebCore::SettingsBase::initializeDefaultFontFamilies): (WebCore::SettingsBase::defaultMinimumZoomFontSize): Deleted. (WebCore::SettingsBase::defaultTextAutosizingEnabled): Deleted. (WebCore::SettingsBase::defaultDownloadableBinaryFontsEnabled): Deleted. (WebCore::SettingsBase::defaultContentChangeObserverEnabled): Deleted. (WebCore::SettingsBase::defaultMediaContentTypesRequiringHardwareSupport): Deleted. * page/SettingsBase.h: * page/cocoa/SettingsBaseCocoa.mm: (WebCore::SettingsBase::defaultTextAutosizingEnabled): Deleted. (WebCore::SettingsBase::defaultMediaContentTypesRequiringHardwareSupport): Deleted. Remove defaults that are now inlined into the yaml files. Move some that have to remain to more appropriate / private locations. * platform/graphics/BitmapImage.h: Update comment to indicate the the default is now defined in the settings definition. 2020-11-06 Rob Buis <rbuis@igalia.com> Only restore saved layer scroll position for RenderBox https://bugs.webkit.org/show_bug.cgi?id=218502 Reviewed by Simon Fraser. The layer scroll position is only used by RenderBox renderers, so when restoring the saved scroll position only restore for RenderBox renderers. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): 2020-11-06 Rob Buis <rbuis@igalia.com> Null check anchorBox https://bugs.webkit.org/show_bug.cgi?id=218499 Reviewed by Zalan Bujtas. Null check anchorBox before calling the renderer method on it. * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp): 2020-11-06 Zalan Bujtas <zalan@apple.com> Empty text runs can't be split any further. https://bugs.webkit.org/show_bug.cgi?id=218506 Reviewed by David Kilzer and Ryosuke Niwa. This patch ensures that when we can't fit an empty text run on the line (available space is negative) we don't try to split it even when the style says so. * layout/inlineformatting/InlineContentBreaker.cpp: (WebCore::Layout::InlineContentBreaker::processOverflowingContent const): (WebCore::Layout::InlineContentBreaker::tryBreakingTextRun const): * layout/inlineformatting/text/TextUtil.cpp: (WebCore::Layout::TextUtil::fixedPitchWidth): (WebCore::Layout::TextUtil::split): 2020-11-06 Wenson Hsieh <wenson_hsieh@apple.com> Move DisplayListFlushIdentifier into WebCore as DisplayList::FlushIdentifier https://bugs.webkit.org/show_bug.cgi?id=218586 Reviewed by Simon Fraser. Add DisplayList::FlushIdentifier. See WebKit for more ChangeLogs. * platform/graphics/displaylists/DisplayList.h: 2020-11-06 Wenson Hsieh <wenson_hsieh@apple.com> Unreviewed, fix the Windows 10 debug build after r269525 Speculative fix: add `NO_RETURN_DUE_TO_ASSERT` to method declarations in DisplayListItems.h as well. * platform/graphics/displaylists/DisplayListItems.h: 2020-11-06 Joey Arhar <jarhar@chromium.org> Text gets clobbered when assigning to input.defaultValue https://bugs.webkit.org/show_bug.cgi?id=217156 Reviewed by Darin Adler. This fixes a bug where script assigning to the defaultValue property of a number or email input causes the text the user entered into the input to be clobbered when it doesn't perfectly match the sanitized string returned by the .value property. Test: LayoutTests/fast/forms/defaultValue-clobbering.html * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseAttribute): 2020-11-06 Antoine Quint <graouts@webkit.org> Accelerated animations of individual transform properties should apply rotate before scale https://bugs.webkit.org/show_bug.cgi?id=218659 Reviewed by Simon Fraser. Not that applying scale before rotate makes any difference, but applying the operations in the order specified in the CSS Transforms spec will make the code easier to understand between this and RenderStyle::applyTransform(). No test since there is no change of behavior. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateAnimations): 2020-11-06 Wenson Hsieh <wenson_hsieh@apple.com> [Concurrent display lists] Encode display list items directly into shared memory https://bugs.webkit.org/show_bug.cgi?id=218406 Reviewed by Tim Horton. This patch refactors display lists (and display list items) in preparation for upcoming changes to allow the GPU and web processes to concurrently read and write display list item data, which allows us to achieve significant improvements in performance on many graphics benchmarks in MotionMark by removing overhead involved in serializing and deserializing display list items over IPC. To implement this, rather than using IPC to encode and decode each item, we will instead store display list items directly in memory shared between the web and GPU processes. This strategy, of course, will not work for display list items that contain pointers. Unfortunately, this affects all display list items at the moment, since all items are subclasses of `DisplayList::Item`, and therefore contain vtable pointers, even if all members are plain data types. Thus, the first step towards being able to read and write items directly in shared memory is to remove this vtable pointer by making display list items no longer inherit from `DrawingItem` or `Item`. Currently, display lists are backed by `Vector<Ref<Item>>`; however, this no longer works once none of the display list items are descended from a common base class. To address this, we introduce `DisplayList::ItemBuffer`, which encapsulates logic to manage one or more data segments that contain display list item data (i.e. display list items stacked adjacent to each other in memory). Display lists now append inline display list items by constructing these items directly inside the item buffer using placement-new. However, many types of display list items do not consist entirely of inline data; some of these are obvious, such as `DrawImage`, `DrawGlyphs`, or `StrokePath` (since a `Path` may be arbitrarily complex). Other out-of- line item types are less obvious: for instance, `FillRoundedRect` is an out-of-line item due to the fact that the color of the rect (`FillRoundedRect::m_color`) may be an extended color, which then contains a pointer. In these cases, we can't simply encode the item in shared memory and read it in the GPU process, since the pointer (if it pointed to anything other than null in the web process) will point to arbitrary memory in the GPU process. Instead, we can leverage our existing IPC infrastructure here by encoding each of these out-of-line items as data and decoding them from this data in the GPU process. To do this, we delegate out to WebKit2 to encode out-of-line display list items using WebKit's `IPC::Encoder`, and pass back a `SharedBuffer` which we then copy into the item buffer. This delegation happens through the `ItemBufferWritingClient` class, which has an implementation in WebKit2. On the decoding side in the GPU process, we then ask `ItemBufferReadingClient` (if set) to convert this encoded data back into a display list item. In WebKit2, we implement this interface and use the corresponding `IPC::Decoder` to decode the data we serialized earlier. If no client is specified or the client does not require custom encoding/decoding for the given item type, we fall back to constructing the item directly inside the writable item buffer data. To make it easier to reason about these new (inheritance-free) display list items, we additionally introduce `ItemHandle`, which wraps a pointer to a display list item and provides several helper methods. The first byte of each item handle always points to an `ItemType`, and the following `N` bytes contain the item itself, where `N` is the size of the item class. Here are some examples of how to use an `ItemHandle`: `DisplayList::ItemType type = itemHandle.type();` (This matches the current inheritance model) `if (itemHandle.is<StrokePath>()) {...` (Replaces is<> in the current model) `auto& setStateItem = itemHandle.get<SetState>();` (Replaces downcast<> in the current model) `itemHandle.apply(myGraphicsContext);` (This matches the current inheritance model) `bool isDrawingItem = itemHandle.isDrawingItem();` (Replaces checks for `is<DrawingItem>(item)`) When writing display lists for the GPU process, the writing client (a `ItemBufferWritingClient`) will be asked to provide `ItemBufferHandle`s where the item buffer will place item data (whether encoded, or as an inline object). However, when using display lists outside of this context (e.g. in other parts of WebCore, such as the glyph drawing cache), we don't have a `ItemBufferWritingClient`. To handle this, the item buffer instead allocates its own (non-shared-memory) buffers, which it manages and deletes when it is done. If any out-of-line items are constructed within these buffers, `ItemBuffer` will additionally call their destructors prior to deleting these buffers. See per-change comments below for more details. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/GraphicsContext.h: * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::DisplayList): (WebCore::DisplayList::DisplayList::operator=): Implement the move assignment operator and move constructor by exchanging ownership of the item buffer. (WebCore::DisplayList::DisplayList::clear): (WebCore::DisplayList::DisplayList::shouldDumpForFlags): (WebCore::DisplayList::DisplayList::asText const): (WebCore::DisplayList::DisplayList::dump const): Adjust the format when printing display lists to `TextStream`. Now that drawing item extents are tracked on the display list rather than being on each drawing item, we print them out after each item (as opposed to being in the middle of each item). (WebCore::DisplayList::DisplayList::sizeInBytes const): Tally up the size of the display list by taking the sum of the sizes of each readonly segment, as well as the writable buffer size. (WebCore::DisplayList::DisplayList::isEmpty const): A DisplayList is empty if it contains no item data: in other words, there are no readonly buffer segments, and there is also nothing written to the writable buffer segment. (WebCore::DisplayList::DisplayList::itemBuffer): (WebCore::DisplayList::DisplayList::setItemBufferClient): (WebCore::DisplayList::DisplayList::forEachItemBuffer const): Add a helper to iterate over each ItemBufferHandle in the display list. This includes all readonly handles, and then the writable handle (if it exists). (WebCore::DisplayList::DisplayList::setTracksDrawingItemExtents): Add an option to allow the display list to track drawing item extents. Currently, display lists always track extents for drawing items; however, when propagating display lists to the GPU process for playback, these extents were never sent along with IPC, and so this ended up just being unnecessary work. Additionally, the initial clip in the GPU process is also never set, so computing these extents never helped. That said, drawing item extents are still printed out for the purposes of testing, so we need to keep this logic intact; this refactoring only disables extent computation for display lists being sent to the GPU process via remote image buffers. In a future patch, we could refactor this so that drawing items contain extent rects as inline data that can be consulted in the GPU process. (WebCore::DisplayList::DisplayList::append): Display list items are no longer constructed ahead of time, and then appended to the display list. Instead, `append` now takes the type of the item to append as a template typename argument, as well as the arguments that will be used to construct the item. (WebCore::DisplayList::DisplayList::iterator::atEnd const): (WebCore::DisplayList::DisplayList::iterator::updateCurrentItem): (WebCore::DisplayList::DisplayList::iterator::advance): (WebCore::DisplayList::DisplayList::iterator::clearCurrentItem): (WebCore::DisplayList::DisplayList::iterator::moveToEnd): (WebCore::DisplayList::DisplayList::iterator::moveCursorToStartOfCurrentBuffer): Implement a C++ iterator for DisplayList. This makes it possible to write code like this: ``` // Suppose displayList is an instance of DisplayList::DisplayList. for (auto [item, extent] : displayList) { // Do things with item, which is a DisplayList::ItemHandle. // Maybe do things with extent, which is an Optional<FloatRect>. } ``` * platform/graphics/displaylists/DisplayList.h: (WebCore::DisplayList::DisplayList::tracksDrawingItemExtents const): (WebCore::DisplayList::DisplayList::iterator::iterator): (WebCore::DisplayList::DisplayList::iterator::~iterator): (WebCore::DisplayList::DisplayList::iterator::operator==): (WebCore::DisplayList::DisplayList::iterator::operator!=): (WebCore::DisplayList::DisplayList::iterator::operator++): (WebCore::DisplayList::DisplayList::iterator::operator* const): (WebCore::DisplayList::DisplayList::begin const): (WebCore::DisplayList::DisplayList::end const): (WebCore::DisplayList::DisplayList::itemBufferIfExists const): (WebCore::DisplayList::DisplayList::addDrawingItemExtent): (WebCore::DisplayList::DisplayList::append): (WebCore::DisplayList::Item::type const): Deleted. (WebCore::DisplayList::Item::isDrawingItem const): Deleted. (WebCore::DisplayList::DisplayList::list const): Deleted. (WebCore::DisplayList::DisplayList::itemAt): Deleted. (WebCore::DisplayList::DisplayList::isEmpty const): Deleted. (WebCore::DisplayList::DisplayList::appendItem): Deleted. (WebCore::DisplayList::DisplayList::list): Deleted. (WebCore::DisplayList::DisplayList::encode const): Deleted. (WebCore::DisplayList::DisplayList::decode): Deleted. Remove the ability to `encode` and `decode` display lists, for the time being. For the communication between the web and GPU processes, we now use `SharedDisplayListHandle`. Unfortunately, this does mean that the extant `ClipToDrawingCommands` display list item will be broken for the time being. In a followup patch, I plan to reimplement `DisplayList::encode` and `decode` in the new inline item model by encoding each item (either as inline data or via `IPC::Encoder::encodeSingleObject`). However, this is contingent on all display list item types (e.g. `DrawImage` and `DrawGlyph`) not relying on `IPC::Attachment` for encoding, so support for `ClipToDrawingCommands` will need to wait until after fonts and images are working. * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp: (WebCore::DisplayList::DrawGlyphsRecorder::recordDrawGlyphs): (WebCore::DisplayList::DrawGlyphsRecorder::recordDrawImage): * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderHarfBuzz.cpp: (WebCore::DisplayList::DrawGlyphsRecorder::drawGlyphs): * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderWin.cpp: (WebCore::DisplayList::DrawGlyphsRecorder::drawGlyphs): Change these to use the new templated `DisplayList::append` method. * platform/graphics/displaylists/DisplayListDrawingContext.h: (WebCore::DisplayList::DrawingContext::takeDisplayList): Use `std::exchange` instead of `WTFMove`. This is actually necessary in order to ensure correctness (i.e. no leaks or double-freeing), since the `DisplayList` instance that is being moved from needs to be empty so that it does not try to call destructors on the items formerly inside of it. * platform/graphics/displaylists/DisplayListItemBuffer.cpp: Added. (WebCore::DisplayList::ItemHandle::apply): (WebCore::DisplayList::ItemHandle::destroy): Add helper methods to apply a display list item to a `GraphicsContext` and call the display list item's destructor, respectively. (WebCore::DisplayList::ItemHandle::copyTo const): Add a helper method to copy the item into the destination handle (calling the copy constructor of the item type in the process). This is used when copying a validated display list item into the temporary item buffer in `DisplayList::iterator`. (WebCore::DisplayList::ItemBuffer::ItemBuffer): (WebCore::DisplayList::ItemBuffer::~ItemBuffer): (WebCore::DisplayList::m_allocatedBuffers): In the case where there is no `m_writingClient` (for instance, when using in-process `DisplayList`s to optimize text painting), the display list item buffer is responsible for creating and managing data buffers. As such, it needs to remember to free any buffers that it allocated when appending, and must also destroy any out-of-line display list items (i.e. items with nontrivial destructors) when it is finished. (WebCore::DisplayList::m_readOnlyBuffers): (WebCore::DisplayList::m_writableBuffer): (WebCore::DisplayList::m_writtenNumberOfBytes): See main ChangeLog entry above for more details. (WebCore::DisplayList::ItemBuffer::operator=): (WebCore::DisplayList::ItemBuffer::createItemBuffer): (WebCore::DisplayList::ItemBuffer::forEachItemBuffer const): (WebCore::DisplayList::ItemBuffer::clear): (WebCore::DisplayList::ItemBuffer::swapWritableBufferIfNeeded): (WebCore::DisplayList::ItemBuffer::appendDataAndLength): * platform/graphics/displaylists/DisplayListItemBuffer.h: Added. (WebCore::DisplayList::ItemBufferHandle::operator bool const): (WebCore::DisplayList::ItemBufferHandle::operator! const): (WebCore::DisplayList::ItemHandle::operator bool const): (WebCore::DisplayList::ItemHandle::operator! const): (WebCore::DisplayList::ItemHandle::type const): (WebCore::DisplayList::ItemHandle::size const): (WebCore::DisplayList::ItemHandle::is const): (WebCore::DisplayList::ItemHandle::get const): (WebCore::DisplayList::ItemBufferWritingClient::~ItemBufferWritingClient): (WebCore::DisplayList::ItemBufferReadingClient::~ItemBufferReadingClient): (WebCore::DisplayList::ItemBuffer::sizeInBytes const): (WebCore::DisplayList::ItemBuffer::isEmpty const): (WebCore::DisplayList::ItemBuffer::append): (WebCore::DisplayList::ItemBuffer::setClient): (WebCore::DisplayList::ItemBuffer::readOnlyBuffers const): (WebCore::DisplayList::ItemBuffer::uncheckedAppend): * platform/graphics/displaylists/DisplayListItems.cpp: The changes in this file make up most of the code churn in this patch, but the changes are mostly mechanical. In summary, this patch: - Add static constexprs for the `ItemType` of each display list item class, as well as whether or not each class is inline, and also whether or not each class is a drawing item. - Remove `encode` and `decode` methods from inline item classes. - Remove all overridden methods; each class now implements individual methods to `apply`, compute `globalBounds` (if applicable), and compute `localBounds` (again, if applicable). - Adjusts textstream dumping helpers, so that they no longer dump as a `DrawingItem` before dumping each member. (WebCore::DisplayList::SetInlineFillGradient::SetInlineFillGradient): (WebCore::DisplayList::SetState::SetState): (WebCore::DisplayList::DrawGlyphs::DrawGlyphs): (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const): (WebCore::DisplayList::DrawGlyphs::apply const): (WebCore::DisplayList::operator<<): (WebCore::DisplayList::DrawNativeImage::DrawNativeImage): (WebCore::DisplayList::DrawPattern::DrawPattern): (WebCore::DisplayList::DrawLinesForText::DrawLinesForText): (WebCore::DisplayList::DrawFocusRingRects::DrawFocusRingRects): (WebCore::DisplayList::FillRectWithGradient::FillRectWithGradient): (WebCore::DisplayList::PutImageData::PutImageData): (WebCore::DisplayList::PaintFrameForMedia::PaintFrameForMedia): (WebCore::DisplayList::Item::Item): Deleted. (WebCore::DisplayList::Item::sizeInBytes): Deleted. (WebCore::DisplayList::DrawingItem::DrawingItem): Deleted. (WebCore::DisplayList::Save::Save): Deleted. (WebCore::DisplayList::Restore::Restore): Deleted. (WebCore::DisplayList::Translate::Translate): Deleted. (WebCore::DisplayList::Rotate::Rotate): Deleted. (WebCore::DisplayList::Scale::Scale): Deleted. (WebCore::DisplayList::SetCTM::SetCTM): Deleted. (WebCore::DisplayList::ConcatenateCTM::ConcatenateCTM): Deleted. (WebCore::DisplayList::SetInlineFillGradient::create): Deleted. (WebCore::DisplayList::SetInlineFillColor::create): Deleted. (WebCore::DisplayList::SetInlineStrokeColor::create): Deleted. (WebCore::DisplayList::SetStrokeThickness::create): Deleted. (WebCore::DisplayList::SetLineCap::SetLineCap): Deleted. (WebCore::DisplayList::SetLineDash::SetLineDash): Deleted. (WebCore::DisplayList::SetLineJoin::SetLineJoin): Deleted. (WebCore::DisplayList::SetMiterLimit::SetMiterLimit): Deleted. (WebCore::DisplayList::ClearShadow::ClearShadow): Deleted. (WebCore::DisplayList::Clip::Clip): Deleted. (WebCore::DisplayList::ClipOut::ClipOut): Deleted. (WebCore::DisplayList::ClipOutToPath::ClipOutToPath): Deleted. (WebCore::DisplayList::ClipPath::ClipPath): Deleted. (WebCore::DisplayList::ClipToDrawingCommands::ClipToDrawingCommands): Deleted. (WebCore::DisplayList::DrawGlyphs::localBounds const): Deleted. (WebCore::DisplayList::DrawImage::DrawImage): Deleted. (WebCore::DisplayList::DrawTiledImage::DrawTiledImage): Deleted. (WebCore::DisplayList::DrawTiledScaledImage::DrawTiledScaledImage): Deleted. (WebCore::DisplayList::DrawImageBuffer::DrawImageBuffer): Deleted. (WebCore::DisplayList::DrawRect::DrawRect): Deleted. (WebCore::DisplayList::DrawLine::DrawLine): Deleted. (WebCore::DisplayList::DrawDotsForDocumentMarker::DrawDotsForDocumentMarker): Deleted. (WebCore::DisplayList::DrawEllipse::DrawEllipse): Deleted. (WebCore::DisplayList::DrawPath::DrawPath): Deleted. (WebCore::DisplayList::DrawFocusRingPath::DrawFocusRingPath): Deleted. (WebCore::DisplayList::FillRect::FillRect): Deleted. (WebCore::DisplayList::FillRectWithColor::FillRectWithColor): Deleted. (WebCore::DisplayList::FillCompositedRect::FillCompositedRect): Deleted. (WebCore::DisplayList::FillRoundedRect::FillRoundedRect): Deleted. (WebCore::DisplayList::FillRectWithRoundedHole::FillRectWithRoundedHole): Deleted. (WebCore::DisplayList::FillInlinePath::FillInlinePath): Deleted. (WebCore::DisplayList::FillPath::FillPath): Deleted. (WebCore::DisplayList::FillEllipse::FillEllipse): Deleted. (WebCore::DisplayList::PaintFrameForMedia::create): Deleted. (WebCore::DisplayList::StrokeRect::StrokeRect): Deleted. (WebCore::DisplayList::StrokeEllipse::StrokeEllipse): Deleted. (WebCore::DisplayList::StrokeInlinePath::StrokeInlinePath): Deleted. (WebCore::DisplayList::StrokePath::StrokePath): Deleted. (WebCore::DisplayList::ClearRect::ClearRect): Deleted. (WebCore::DisplayList::BeginTransparencyLayer::BeginTransparencyLayer): Deleted. (WebCore::DisplayList::EndTransparencyLayer::EndTransparencyLayer): Deleted. (WebCore::DisplayList::ApplyStrokePattern::ApplyStrokePattern): Deleted. (WebCore::DisplayList::ApplyFillPattern::ApplyFillPattern): Deleted. (WebCore::DisplayList::ApplyDeviceScaleFactor::ApplyDeviceScaleFactor): Deleted. * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::Save::localBounds const): (WebCore::DisplayList::Save::globalBounds const): (WebCore::DisplayList::Restore::localBounds const): (WebCore::DisplayList::Restore::globalBounds const): (WebCore::DisplayList::Translate::Translate): (WebCore::DisplayList::Translate::localBounds const): (WebCore::DisplayList::Translate::globalBounds const): (WebCore::DisplayList::Rotate::Rotate): (WebCore::DisplayList::Rotate::localBounds const): (WebCore::DisplayList::Rotate::globalBounds const): (WebCore::DisplayList::Scale::Scale): (WebCore::DisplayList::Scale::localBounds const): (WebCore::DisplayList::Scale::globalBounds const): (WebCore::DisplayList::SetCTM::SetCTM): (WebCore::DisplayList::SetCTM::localBounds const): (WebCore::DisplayList::SetCTM::globalBounds const): (WebCore::DisplayList::ConcatenateCTM::ConcatenateCTM): (WebCore::DisplayList::ConcatenateCTM::localBounds const): (WebCore::DisplayList::ConcatenateCTM::globalBounds const): (WebCore::DisplayList::SetInlineFillGradient::localBounds const): (WebCore::DisplayList::SetInlineFillGradient::globalBounds const): (WebCore::DisplayList::SetInlineFillColor::SetInlineFillColor): (WebCore::DisplayList::SetInlineFillColor::color const): (WebCore::DisplayList::SetInlineFillColor::localBounds const): (WebCore::DisplayList::SetInlineFillColor::globalBounds const): (WebCore::DisplayList::SetInlineStrokeColor::SetInlineStrokeColor): (WebCore::DisplayList::SetInlineStrokeColor::color const): (WebCore::DisplayList::SetInlineStrokeColor::localBounds const): (WebCore::DisplayList::SetInlineStrokeColor::globalBounds const): (WebCore::DisplayList::SetStrokeThickness::SetStrokeThickness): (WebCore::DisplayList::SetStrokeThickness::thickness const): (WebCore::DisplayList::SetStrokeThickness::localBounds const): (WebCore::DisplayList::SetStrokeThickness::globalBounds const): (WebCore::DisplayList::SetState::localBounds const): (WebCore::DisplayList::SetState::globalBounds const): (WebCore::DisplayList::SetState::decode): (WebCore::DisplayList::SetLineCap::SetLineCap): (WebCore::DisplayList::SetLineCap::localBounds const): (WebCore::DisplayList::SetLineCap::globalBounds const): (WebCore::DisplayList::SetLineDash::SetLineDash): (WebCore::DisplayList::SetLineDash::localBounds const): (WebCore::DisplayList::SetLineDash::globalBounds const): (WebCore::DisplayList::SetLineDash::decode): (WebCore::DisplayList::SetLineJoin::SetLineJoin): (WebCore::DisplayList::SetLineJoin::localBounds const): (WebCore::DisplayList::SetLineJoin::globalBounds const): (WebCore::DisplayList::SetMiterLimit::SetMiterLimit): (WebCore::DisplayList::SetMiterLimit::localBounds const): (WebCore::DisplayList::SetMiterLimit::globalBounds const): (WebCore::DisplayList::ClearShadow::localBounds const): (WebCore::DisplayList::ClearShadow::globalBounds const): (WebCore::DisplayList::Clip::Clip): (WebCore::DisplayList::Clip::rect const): (WebCore::DisplayList::Clip::localBounds const): (WebCore::DisplayList::Clip::globalBounds const): (WebCore::DisplayList::ClipOut::ClipOut): (WebCore::DisplayList::ClipOut::rect const): (WebCore::DisplayList::ClipOut::localBounds const): (WebCore::DisplayList::ClipOut::globalBounds const): (WebCore::DisplayList::ClipOutToPath::ClipOutToPath): (WebCore::DisplayList::ClipOutToPath::localBounds const): (WebCore::DisplayList::ClipOutToPath::globalBounds const): (WebCore::DisplayList::ClipOutToPath::decode): (WebCore::DisplayList::ClipPath::ClipPath): (WebCore::DisplayList::ClipPath::localBounds const): (WebCore::DisplayList::ClipPath::globalBounds const): (WebCore::DisplayList::ClipPath::decode): (WebCore::DisplayList::ClipToDrawingCommands::ClipToDrawingCommands): (WebCore::DisplayList::ClipToDrawingCommands::localBounds const): (WebCore::DisplayList::ClipToDrawingCommands::globalBounds const): (WebCore::DisplayList::ClipToDrawingCommands::encode const): (WebCore::DisplayList::ClipToDrawingCommands::decode): (WebCore::DisplayList::DrawGlyphs::globalBounds const): (WebCore::DisplayList::DrawGlyphs::localBounds const): (WebCore::DisplayList::DrawGlyphs::encode const): (WebCore::DisplayList::DrawGlyphs::decode): (WebCore::DisplayList::DrawImage::DrawImage): (WebCore::DisplayList::DrawImage::globalBounds const): (WebCore::DisplayList::DrawImage::localBounds const): (WebCore::DisplayList::DrawImage::decode): (WebCore::DisplayList::DrawTiledImage::DrawTiledImage): (WebCore::DisplayList::DrawTiledImage::globalBounds const): (WebCore::DisplayList::DrawTiledImage::localBounds const): (WebCore::DisplayList::DrawTiledImage::decode): (WebCore::DisplayList::DrawTiledScaledImage::DrawTiledScaledImage): (WebCore::DisplayList::DrawTiledScaledImage::globalBounds const): (WebCore::DisplayList::DrawTiledScaledImage::localBounds const): (WebCore::DisplayList::DrawTiledScaledImage::decode): (WebCore::DisplayList::DrawImageBuffer::DrawImageBuffer): (WebCore::DisplayList::DrawImageBuffer::globalBounds const): (WebCore::DisplayList::DrawImageBuffer::localBounds const): (WebCore::DisplayList::DrawImageBuffer::decode): (WebCore::DisplayList::DrawNativeImage::source const): (WebCore::DisplayList::DrawNativeImage::destinationRect const): (WebCore::DisplayList::DrawNativeImage::globalBounds const): (WebCore::DisplayList::DrawNativeImage::localBounds const): (WebCore::DisplayList::DrawNativeImage::decode): (WebCore::DisplayList::DrawPattern::DrawPattern): (WebCore::DisplayList::DrawPattern::globalBounds const): (WebCore::DisplayList::DrawPattern::localBounds const): (WebCore::DisplayList::DrawPattern::decode): (WebCore::DisplayList::BeginTransparencyLayer::BeginTransparencyLayer): (WebCore::DisplayList::BeginTransparencyLayer::localBounds const): (WebCore::DisplayList::BeginTransparencyLayer::globalBounds const): (WebCore::DisplayList::EndTransparencyLayer::localBounds const): (WebCore::DisplayList::EndTransparencyLayer::globalBounds const): (WebCore::DisplayList::DrawRect::DrawRect): (WebCore::DisplayList::DrawRect::globalBounds const): (WebCore::DisplayList::DrawRect::localBounds const): (WebCore::DisplayList::DrawLine::DrawLine): (WebCore::DisplayList::DrawLine::globalBounds const): (WebCore::DisplayList::DrawLinesForText::globalBounds const): (WebCore::DisplayList::DrawLinesForText::decode): (WebCore::DisplayList::DrawDotsForDocumentMarker::DrawDotsForDocumentMarker): (WebCore::DisplayList::DrawDotsForDocumentMarker::globalBounds const): (WebCore::DisplayList::DrawEllipse::DrawEllipse): (WebCore::DisplayList::DrawEllipse::rect const): (WebCore::DisplayList::DrawEllipse::globalBounds const): (WebCore::DisplayList::DrawEllipse::localBounds const): (WebCore::DisplayList::DrawPath::DrawPath): (WebCore::DisplayList::DrawPath::globalBounds const): (WebCore::DisplayList::DrawPath::localBounds const): (WebCore::DisplayList::DrawPath::decode): (WebCore::DisplayList::DrawFocusRingPath::DrawFocusRingPath): (WebCore::DisplayList::DrawFocusRingPath::globalBounds const): (WebCore::DisplayList::DrawFocusRingPath::decode): (WebCore::DisplayList::DrawFocusRingRects::globalBounds const): (WebCore::DisplayList::DrawFocusRingRects::decode): (WebCore::DisplayList::FillRect::FillRect): (WebCore::DisplayList::FillRect::rect const): (WebCore::DisplayList::FillRect::globalBounds const): (WebCore::DisplayList::FillRect::localBounds const): (WebCore::DisplayList::FillRectWithColor::FillRectWithColor): (WebCore::DisplayList::FillRectWithColor::globalBounds const): (WebCore::DisplayList::FillRectWithColor::localBounds const): (WebCore::DisplayList::FillRectWithColor::decode): (WebCore::DisplayList::FillRectWithGradient::rect const): (WebCore::DisplayList::FillRectWithGradient::gradient const): (WebCore::DisplayList::FillRectWithGradient::globalBounds const): (WebCore::DisplayList::FillRectWithGradient::localBounds const): (WebCore::DisplayList::FillRectWithGradient::decode): (WebCore::DisplayList::FillCompositedRect::FillCompositedRect): (WebCore::DisplayList::FillCompositedRect::globalBounds const): (WebCore::DisplayList::FillCompositedRect::localBounds const): (WebCore::DisplayList::FillCompositedRect::decode): (WebCore::DisplayList::FillRoundedRect::FillRoundedRect): (WebCore::DisplayList::FillRoundedRect::globalBounds const): (WebCore::DisplayList::FillRoundedRect::localBounds const): (WebCore::DisplayList::FillRoundedRect::decode): (WebCore::DisplayList::FillRectWithRoundedHole::FillRectWithRoundedHole): (WebCore::DisplayList::FillRectWithRoundedHole::globalBounds const): (WebCore::DisplayList::FillRectWithRoundedHole::localBounds const): (WebCore::DisplayList::FillRectWithRoundedHole::decode): (WebCore::DisplayList::FillInlinePath::FillInlinePath): (WebCore::DisplayList::FillInlinePath::globalBounds const): (WebCore::DisplayList::FillInlinePath::localBounds const): (WebCore::DisplayList::FillPath::FillPath): (WebCore::DisplayList::FillPath::globalBounds const): (WebCore::DisplayList::FillPath::localBounds const): (WebCore::DisplayList::FillPath::decode): (WebCore::DisplayList::FillEllipse::FillEllipse): (WebCore::DisplayList::FillEllipse::globalBounds const): (WebCore::DisplayList::FillEllipse::localBounds const): (WebCore::DisplayList::PutImageData::imageData const): (WebCore::DisplayList::PutImageData::localBounds const): (WebCore::DisplayList::PutImageData::globalBounds const): (WebCore::DisplayList::PutImageData::encode const): (WebCore::DisplayList::PutImageData::decode): (WebCore::DisplayList::PaintFrameForMedia::localBounds const): (WebCore::DisplayList::PaintFrameForMedia::globalBounds const): (WebCore::DisplayList::StrokeRect::StrokeRect): (WebCore::DisplayList::StrokeRect::globalBounds const): (WebCore::DisplayList::StrokeInlinePath::StrokeInlinePath): (WebCore::DisplayList::StrokeInlinePath::globalBounds const): (WebCore::DisplayList::StrokePath::StrokePath): (WebCore::DisplayList::StrokePath::globalBounds const): (WebCore::DisplayList::StrokePath::decode): (WebCore::DisplayList::StrokeEllipse::StrokeEllipse): (WebCore::DisplayList::StrokeEllipse::rect const): (WebCore::DisplayList::StrokeEllipse::globalBounds const): (WebCore::DisplayList::ClearRect::ClearRect): (WebCore::DisplayList::ClearRect::rect const): (WebCore::DisplayList::ClearRect::globalBounds const): (WebCore::DisplayList::ClearRect::localBounds const): (WebCore::DisplayList::ApplyStrokePattern::localBounds const): (WebCore::DisplayList::ApplyStrokePattern::globalBounds const): (WebCore::DisplayList::ApplyFillPattern::localBounds const): (WebCore::DisplayList::ApplyFillPattern::globalBounds const): (WebCore::DisplayList::ApplyDeviceScaleFactor::ApplyDeviceScaleFactor): (WebCore::DisplayList::ApplyDeviceScaleFactor::localBounds const): (WebCore::DisplayList::ApplyDeviceScaleFactor::globalBounds const): (WebCore::DisplayList::DrawingItem::setExtent): Deleted. (WebCore::DisplayList::DrawingItem::extent const): Deleted. (WebCore::DisplayList::DrawingItem::extentKnown const): Deleted. (WebCore::DisplayList::DrawingItem::localBounds const): Deleted. (WebCore::DisplayList::DrawingItem::globalBounds const): Deleted. (WebCore::DisplayList::Save::create): Deleted. (WebCore::DisplayList::Save::encode const): Deleted. (WebCore::DisplayList::Save::decode): Deleted. (WebCore::DisplayList::Restore::create): Deleted. (WebCore::DisplayList::Restore::encode const): Deleted. (WebCore::DisplayList::Restore::decode): Deleted. (WebCore::DisplayList::Translate::create): Deleted. (WebCore::DisplayList::Translate::encode const): Deleted. (WebCore::DisplayList::Translate::decode): Deleted. (WebCore::DisplayList::Rotate::create): Deleted. (WebCore::DisplayList::Rotate::encode const): Deleted. (WebCore::DisplayList::Rotate::decode): Deleted. (WebCore::DisplayList::Scale::create): Deleted. (WebCore::DisplayList::Scale::encode const): Deleted. (WebCore::DisplayList::Scale::decode): Deleted. (WebCore::DisplayList::SetCTM::create): Deleted. (WebCore::DisplayList::SetCTM::encode const): Deleted. (WebCore::DisplayList::SetCTM::decode): Deleted. (WebCore::DisplayList::ConcatenateCTM::create): Deleted. (WebCore::DisplayList::ConcatenateCTM::encode const): Deleted. (WebCore::DisplayList::ConcatenateCTM::decode): Deleted. (WebCore::DisplayList::SetInlineFillGradient::create): Deleted. (WebCore::DisplayList::SetInlineFillGradient::encode const): Deleted. (WebCore::DisplayList::SetInlineFillGradient::decode): Deleted. (WebCore::DisplayList::SetInlineFillColor::encode const): Deleted. (WebCore::DisplayList::SetInlineFillColor::decode): Deleted. (WebCore::DisplayList::SetInlineStrokeColor::encode const): Deleted. (WebCore::DisplayList::SetInlineStrokeColor::decode): Deleted. (WebCore::DisplayList::SetStrokeThickness::encode const): Deleted. (WebCore::DisplayList::SetStrokeThickness::decode): Deleted. (WebCore::DisplayList::SetState::create): Deleted. (WebCore::DisplayList::SetLineCap::create): Deleted. (WebCore::DisplayList::SetLineCap::encode const): Deleted. (WebCore::DisplayList::SetLineCap::decode): Deleted. (WebCore::DisplayList::SetLineDash::create): Deleted. (WebCore::DisplayList::SetLineJoin::create): Deleted. (WebCore::DisplayList::SetLineJoin::encode const): Deleted. (WebCore::DisplayList::SetLineJoin::decode): Deleted. (WebCore::DisplayList::SetMiterLimit::create): Deleted. (WebCore::DisplayList::SetMiterLimit::encode const): Deleted. (WebCore::DisplayList::SetMiterLimit::decode): Deleted. (WebCore::DisplayList::ClearShadow::create): Deleted. (WebCore::DisplayList::ClearShadow::encode const): Deleted. (WebCore::DisplayList::ClearShadow::decode): Deleted. (WebCore::DisplayList::Clip::create): Deleted. (WebCore::DisplayList::Clip::encode const): Deleted. (WebCore::DisplayList::Clip::decode): Deleted. (WebCore::DisplayList::ClipOut::create): Deleted. (WebCore::DisplayList::ClipOut::encode const): Deleted. (WebCore::DisplayList::ClipOut::decode): Deleted. (WebCore::DisplayList::ClipOutToPath::create): Deleted. (WebCore::DisplayList::ClipPath::create): Deleted. (WebCore::DisplayList::ClipToDrawingCommands::create): Deleted. (WebCore::DisplayList::DrawGlyphs::create): Deleted. (WebCore::DisplayList::DrawImage::create): Deleted. (WebCore::DisplayList::DrawTiledImage::create): Deleted. (WebCore::DisplayList::DrawTiledScaledImage::create): Deleted. (WebCore::DisplayList::DrawImageBuffer::create): Deleted. (WebCore::DisplayList::DrawNativeImage::create): Deleted. (WebCore::DisplayList::DrawPattern::create): Deleted. (WebCore::DisplayList::BeginTransparencyLayer::create): Deleted. (WebCore::DisplayList::BeginTransparencyLayer::encode const): Deleted. (WebCore::DisplayList::BeginTransparencyLayer::decode): Deleted. (WebCore::DisplayList::EndTransparencyLayer::create): Deleted. (WebCore::DisplayList::EndTransparencyLayer::encode const): Deleted. (WebCore::DisplayList::EndTransparencyLayer::decode): Deleted. (WebCore::DisplayList::DrawRect::create): Deleted. (WebCore::DisplayList::DrawRect::encode const): Deleted. (WebCore::DisplayList::DrawRect::decode): Deleted. (WebCore::DisplayList::DrawLine::create): Deleted. (WebCore::DisplayList::DrawLine::encode const): Deleted. (WebCore::DisplayList::DrawLine::decode): Deleted. (WebCore::DisplayList::DrawLinesForText::create): Deleted. (WebCore::DisplayList::DrawDotsForDocumentMarker::create): Deleted. (WebCore::DisplayList::DrawDotsForDocumentMarker::encode const): Deleted. (WebCore::DisplayList::DrawDotsForDocumentMarker::decode): Deleted. (WebCore::DisplayList::DrawEllipse::create): Deleted. (WebCore::DisplayList::DrawEllipse::encode const): Deleted. (WebCore::DisplayList::DrawEllipse::decode): Deleted. (WebCore::DisplayList::DrawPath::create): Deleted. (WebCore::DisplayList::DrawFocusRingPath::create): Deleted. (WebCore::DisplayList::DrawFocusRingRects::create): Deleted. (WebCore::DisplayList::FillRect::create): Deleted. (WebCore::DisplayList::FillRect::encode const): Deleted. (WebCore::DisplayList::FillRect::decode): Deleted. (WebCore::DisplayList::FillRectWithColor::create): Deleted. (WebCore::DisplayList::FillRectWithGradient::create): Deleted. (WebCore::DisplayList::FillCompositedRect::create): Deleted. (WebCore::DisplayList::FillRoundedRect::create): Deleted. (WebCore::DisplayList::FillRectWithRoundedHole::create): Deleted. (WebCore::DisplayList::FillInlinePath::create): Deleted. (WebCore::DisplayList::FillInlinePath::encode const): Deleted. (WebCore::DisplayList::FillInlinePath::decode): Deleted. (WebCore::DisplayList::FillPath::create): Deleted. (WebCore::DisplayList::FillEllipse::create): Deleted. (WebCore::DisplayList::FillEllipse::encode const): Deleted. (WebCore::DisplayList::FillEllipse::decode): Deleted. (WebCore::DisplayList::PutImageData::create): Deleted. (WebCore::DisplayList::PaintFrameForMedia::encode const): Deleted. (WebCore::DisplayList::PaintFrameForMedia::decode): Deleted. (WebCore::DisplayList::StrokeRect::create): Deleted. (WebCore::DisplayList::StrokeRect::encode const): Deleted. (WebCore::DisplayList::StrokeRect::decode): Deleted. (WebCore::DisplayList::StrokeInlinePath::create): Deleted. (WebCore::DisplayList::StrokeInlinePath::encode const): Deleted. (WebCore::DisplayList::StrokeInlinePath::decode): Deleted. (WebCore::DisplayList::StrokePath::create): Deleted. (WebCore::DisplayList::StrokeEllipse::create): Deleted. (WebCore::DisplayList::StrokeEllipse::encode const): Deleted. (WebCore::DisplayList::StrokeEllipse::decode): Deleted. (WebCore::DisplayList::ClearRect::create): Deleted. (WebCore::DisplayList::ClearRect::encode const): Deleted. (WebCore::DisplayList::ClearRect::decode): Deleted. (WebCore::DisplayList::ApplyStrokePattern::create): Deleted. (WebCore::DisplayList::ApplyStrokePattern::encode const): Deleted. (WebCore::DisplayList::ApplyStrokePattern::decode): Deleted. (WebCore::DisplayList::ApplyFillPattern::create): Deleted. (WebCore::DisplayList::ApplyFillPattern::encode const): Deleted. (WebCore::DisplayList::ApplyFillPattern::decode): Deleted. (WebCore::DisplayList::ApplyDeviceScaleFactor::create): Deleted. (WebCore::DisplayList::ApplyDeviceScaleFactor::encode const): Deleted. (WebCore::DisplayList::ApplyDeviceScaleFactor::decode): Deleted. (WebCore::DisplayList::Item::encode const): Deleted. (WebCore::DisplayList::Item::decode): Deleted. Delete the generic `Item::encode` and `Item::decode` methods, since only out-of-line display list items have encode and decode functions now. * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::putImageData): (WebCore::DisplayList::Recorder::appendStateChangeItem): (WebCore::DisplayList::Recorder::clearShadow): (WebCore::DisplayList::Recorder::setLineCap): (WebCore::DisplayList::Recorder::setLineDash): (WebCore::DisplayList::Recorder::setLineJoin): (WebCore::DisplayList::Recorder::setMiterLimit): (WebCore::DisplayList::Recorder::drawImage): (WebCore::DisplayList::Recorder::drawTiledImage): (WebCore::DisplayList::Recorder::drawImageBuffer): (WebCore::DisplayList::Recorder::drawNativeImage): (WebCore::DisplayList::Recorder::drawPattern): (WebCore::DisplayList::Recorder::save): (WebCore::DisplayList::Recorder::restore): (WebCore::DisplayList::Recorder::translate): (WebCore::DisplayList::Recorder::rotate): (WebCore::DisplayList::Recorder::scale): (WebCore::DisplayList::Recorder::concatCTM): (WebCore::DisplayList::Recorder::setCTM): (WebCore::DisplayList::Recorder::beginTransparencyLayer): (WebCore::DisplayList::Recorder::endTransparencyLayer): (WebCore::DisplayList::Recorder::drawRect): (WebCore::DisplayList::Recorder::drawLine): (WebCore::DisplayList::Recorder::drawLinesForText): (WebCore::DisplayList::Recorder::drawDotsForDocumentMarker): (WebCore::DisplayList::Recorder::drawEllipse): (WebCore::DisplayList::Recorder::drawPath): (WebCore::DisplayList::Recorder::drawFocusRing): (WebCore::DisplayList::Recorder::fillRect): (WebCore::DisplayList::Recorder::fillRoundedRect): (WebCore::DisplayList::Recorder::fillRectWithRoundedHole): (WebCore::DisplayList::Recorder::fillPath): (WebCore::DisplayList::Recorder::fillEllipse): (WebCore::DisplayList::Recorder::strokeRect): (WebCore::DisplayList::Recorder::strokePath): (WebCore::DisplayList::Recorder::strokeEllipse): (WebCore::DisplayList::Recorder::clearRect): (WebCore::DisplayList::Recorder::applyStrokePattern): (WebCore::DisplayList::Recorder::applyFillPattern): (WebCore::DisplayList::Recorder::clip): (WebCore::DisplayList::Recorder::clipOut): (WebCore::DisplayList::Recorder::clipPath): (WebCore::DisplayList::Recorder::clipToDrawingCommands): (WebCore::DisplayList::Recorder::paintFrameForMedia): (WebCore::DisplayList::Recorder::applyDeviceScaleFactor): Change these methods that append display list items en masse, such that they go from this: `m_displayList.append(Foo::create(arg1, arg2, arg3));` ...to this: `m_displayList.append<Foo>(arg1, arg2, arg3);` (WebCore::DisplayList::Recorder::extentFromLocalBounds const): (WebCore::DisplayList::Recorder::appendItemAndUpdateExtent): Deleted. (WebCore::DisplayList::Recorder::appendItem): Deleted. (WebCore::DisplayList::Recorder::updateItemExtent const): Deleted. Extents are now automatically updated (unless otherwise specified) for any drawing items that are appended. * platform/graphics/displaylists/DisplayListRecorder.h: (WebCore::DisplayList::Recorder::append): * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::Replayer::replay): * platform/graphics/displaylists/DisplayListReplayer.h: (WebCore::DisplayList::Replayer::Delegate::apply): 2020-11-06 Truitt Savell <tsavell@apple.com> Unreviewed, reverting r269486. Caused 50+ timeouts on Mac Debug WK2 Reverted changeset: "[Cocoa] Inspector Extensions: Add _WKInspectorExtension and related plumbing" https://bugs.webkit.org/show_bug.cgi?id=217783 https://trac.webkit.org/changeset/269486 2020-11-06 Jer Noble <jer.noble@apple.com> Do not allow pages to enter fullscreen while an exit fullscreen operation is ongoing. https://bugs.webkit.org/show_bug.cgi?id=218640 <rdar://problem/70697738> Reviewed by Eric Carlson. Test: fullscreen/full-screen-enter-while-exiting.html Pages can inadvertantly trap users in fullscreen mode by attempting to enter fullscreen during an exit fullscreen operation, when both the exit and enter were triggered by a user gesture. While this is not explicitly forbidden by the Fullscreen specification, we already reject requests in similar situations, such as when the document was hidden between the request and when the request was handled. * dom/FullscreenManager.cpp: (WebCore::FullscreenManager::requestFullscreenForElement): (WebCore::FullscreenManager::exitFullscreen): (WebCore::FullscreenManager::didExitFullscreen): * dom/FullscreenManager.h: 2020-11-06 Alex Christensen <achristensen@webkit.org> Fix crashes around NetworkStorageSession::registerCookieChangeListenersIfNecessary https://bugs.webkit.org/show_bug.cgi?id=218626 <rdar://66837628> Reviewed by Chris Dumez. We need to check if the NetworkStorageSession has been deallocated before using its member variables in a callback from CFNetwork. * platform/network/NetworkStorageSession.h: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::registerCookieChangeListenersIfNecessary): 2020-11-06 Antti Koivisto <antti@apple.com> [LFC][Integration] localCaretOffset should use iterator https://bugs.webkit.org/show_bug.cgi?id=218620 Reviewed by Zalan Bujtas. Convert all localCaretRect implementations to use the inline iterator. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::localCaretRectForCharacterOffset): * editing/RenderedPosition.cpp: (WebCore::RenderedPosition::absoluteRect const): * editing/VisiblePosition.cpp: (WebCore::VisiblePosition::localCaretRect const): * layout/integration/LayoutIntegrationLineIterator.cpp: (WebCore::LayoutIntegration::PathLine::computeCaretRect const): * layout/integration/LayoutIntegrationLineIterator.h: (WebCore::LayoutIntegration::PathLine::logicalLeft const): (WebCore::LayoutIntegration::PathLine::logicalRight const): * layout/integration/LayoutIntegrationLineIteratorLegacyPath.h: (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalLeft const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalRight const): * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::LineIteratorModernPath::logicalLeft const): (WebCore::LayoutIntegration::LineIteratorModernPath::logicalRight const): * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::PathTextRun::positionForOffset const): * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: (WebCore::LayoutIntegration::RunIteratorLegacyPath::offsetForPosition const): (WebCore::LayoutIntegration::RunIteratorLegacyPath::positionForOffset const): * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::positionForOffset const): (WebCore::LayoutIntegration::RunIteratorModernPath::selectionRect const): (WebCore::LayoutIntegration::RunIteratorModernPath::clampedOffset const): Make clampedOffset return 0 based offset like it does in InlineTextBox to make porting easier. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::localCaretRect const): (WebCore::RenderBlock::localCaretRect): Deleted. * rendering/RenderBlock.h: * rendering/RenderBox.cpp: (WebCore::RenderBox::localCaretRect const): (WebCore::RenderBox::localCaretRect): Deleted. * rendering/RenderBox.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::localCaretRectForEmptyElement const): (WebCore::RenderBoxModelObject::localCaretRectForEmptyElement): Deleted. * rendering/RenderBoxModelObject.h: * rendering/RenderInline.cpp: (WebCore::RenderInline::localCaretRect const): (WebCore::RenderInline::localCaretRect): Deleted. * rendering/RenderInline.h: * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::localCaretRect const): (WebCore::RenderLineBreak::linesBoundingBox const): (WebCore::RenderLineBreak::localCaretRect): Deleted. * rendering/RenderLineBreak.h: * rendering/RenderObject.cpp: (WebCore::RenderObject::localCaretRect const): (WebCore::RenderObject::localCaretRect): Deleted. * rendering/RenderObject.h: * rendering/RenderText.cpp: (WebCore::RenderText::localCaretRect const): (WebCore::RenderText::localCaretRect): Deleted. * rendering/RenderText.h: * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::createTextBox): (WebCore::RenderSVGInlineText::localCaretRect const): (WebCore::RenderSVGInlineText::localCaretRect): Deleted. * rendering/svg/RenderSVGInlineText.h: 2020-11-06 Oriol Brufau <obrufau@igalia.com> [css-grid] Prevent FindUsedFlexFraction from iterating items twice https://bugs.webkit.org/show_bug.cgi?id=218630 Reviewed by Javier Fernandez. IndefiniteSizeStrategy::findUsedFlexFraction needs to iterate all grid items that cross a flexible track. To do so it, takes the indices of the flex tracks, and for each one it uses GridIterator to iterate the items in that track. Then, to avoid processing the same item multiple times, it used to check that the item started in the current flex track, not in a previous one. However, this was insufficient: it wasn't taking into account that an item can be in a single flex track, but span multiple tracks in the other axis. Therefore, this patch changes it to use the same approach as in GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes, i.e. creates a HashSet outside of the loop, and inserts each given grid item to it, checking whether it's a new entry or not. This is a port of https://crrev.com/821910 from Chromium. * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction const): 2020-11-06 Chris Lord <clord@igalia.com> REGRESSION(r269503): [GTK][WPE] >200 tests are failing https://bugs.webkit.org/show_bug.cgi?id=218654 Reviewed by Žan Doberšek. Implement GraphicsContextImplCairo::drawImageBuffer. Prior to r269503, this function had an error return code, but this was removed and so its implementation is now mandatory. * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::drawImageBuffer): 2020-11-06 Martin Robinson <mrobinson@igalia.com> Scroll snap specified on :root doesn't work https://bugs.webkit.org/show_bug.cgi?id=210469 <rdar://problem/61746676> Properly handle scroll-snap-type on the root element. This change is originally based on a patch by Simon Fraser. Reviewed by Simon Fraser. Tests: tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-horizontal-legacy.html tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical-legacy.html tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-mainframe-legacy.html * page/FrameView.cpp: (WebCore::FrameView::updateSnapOffsets): Send the body or root element style depending on where the scroll-snap properties are set, but always use the FrameView viewport when calculating geometry for scroll snap. * page/scrolling/AxisScrollSnapOffsets.cpp: (WebCore::updateSnapOffsetsForScrollableArea): Accept a viewport rectangle from the caller and also eliminate redundant argument that was causing a bit of confusion. * page/scrolling/AxisScrollSnapOffsets.h: Update the function declaration. * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::clearSnapOffsets): Added a helper to clear both vertical and horizontal snap info. * platform/ScrollableArea.h: * rendering/RenderBox.cpp: (WebCore::RenderBox::findEnclosingScrollableContainerForSnapping const): Renamed findEnclosingScrollableContainer to this because now it is only useful for scroll snapping. The only preexisting caller was the scroll snap code. (WebCore::RenderBox::findEnclosingScrollableContainer const): Deleted. * rendering/RenderBox.h: Updated method name. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateSnapOffsets): Update to reflect changes to updateSnapOffsetsForScrollableArea. * rendering/RenderObject.cpp: (WebCore::RenderObject::enclosingScrollableContainerForSnapping const): Always return the document root as the container instead of the body. The body never captures scroll snap points. 2020-11-05 Said Abou-Hallawa <said@apple.com> [GPU Process] Use the Ref counting of ImageBuffer to control its life cycle in Web Process and GPU Process https://bugs.webkit.org/show_bug.cgi?id=218529 Reviewed by Simon Fraser. Every ImageBuffer will have a valid RenderingResourceIdentifer. It can be either generated when the ImageBuffer is created. Or it can be set by the caller. Setting it by the caller will happen only in the GPUP where we need it match what was generated in the WebP. When recording a DrawImageBuffer item, a Ref<ImageBuffer> of the source ImageBuffer will be added to a HashSet in DisplayList. The goal is keep this ImageBuffer alive till the DisplayList is cleared. The HashSet will be cleared in DisplayList::clear() which will happen when either the DisplayList is replayed back or sent to the GPUP. This HashSet can be used to resolve the RenderingResourceIdentifer to an ImageBuffer when replaying back the DisplayList either in WebP or in GPUP. * platform/graphics/ConcreteImageBuffer.h: (WebCore::ConcreteImageBuffer::ConcreteImageBuffer): * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawImageBuffer): (WebCore::GraphicsContext::drawConsumingImageBuffer): * platform/graphics/GraphicsContextImpl.h: * platform/graphics/ImageBuffer.h: * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::drawImageBuffer): * platform/graphics/cairo/GraphicsContextImplCairo.h: * platform/graphics/displaylists/DisplayList.cpp: (WebCore::DisplayList::DisplayList::clear): * platform/graphics/displaylists/DisplayList.h: (WebCore::DisplayList::DisplayList::imageBuffers const): (WebCore::DisplayList::DisplayList::cacheImageBuffer): * platform/graphics/displaylists/DisplayListItemType.cpp: (WebCore::DisplayList::isInlineItem): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawImageBuffer::DrawImageBuffer): (WebCore::DisplayList::DrawImageBuffer::apply const): * platform/graphics/displaylists/DisplayListItems.h: * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::drawImageBuffer): * platform/graphics/displaylists/DisplayListRecorder.h: (WebCore::DisplayList::Recorder::Delegate::~Delegate): (WebCore::DisplayList::Recorder::Delegate::lockRemoteImageBuffer): Deleted. * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::Replayer::Replayer): (WebCore::DisplayList::Replayer::applyItem): (WebCore::DisplayList::Replayer::replay): * platform/graphics/displaylists/DisplayListReplayer.h: * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: (Nicosia::CairoOperationRecorder::drawImageBuffer): * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: 2020-11-05 Chris Dumez <cdumez@apple.com> window.event should not be affected by nodes moving post-dispatch https://bugs.webkit.org/show_bug.cgi?id=218635 Reviewed by Geoffrey Garen. window.event should not be affected by nodes moving post-dispatch: - https://dom.spec.whatwg.org/#concept-event-listener-invoke In particular, window.event should not get set when the event target was inside a shadow tree initially when dispatchEvent() got called, even if the event target gets moved out of the shadow tree during the execution of the event listeners. Previously, our code was checking if the node was in a shadow tree at the point of calling each event listener, instead of doing that check very initially when dispatchEvent() is called. No new tests, rebaselined existing test. * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent): * dom/Event.cpp: (WebCore::Event::setCurrentTarget): (WebCore::Event::resetAfterDispatch): * dom/Event.h: (WebCore::Event::currentTargetIsInShadowTree const): * dom/EventContext.cpp: (WebCore::EventContext::handleLocalEvents const): * dom/EventContext.h: (WebCore::EventContext::isCurrentTargetInShadowTree const): * dom/EventPath.cpp: (WebCore::WindowEventContext::handleLocalEvents const): 2020-11-05 Alex Christensen <achristensen@webkit.org> Align GBK and gb18030 encoder and decoder with specification and other browsers https://bugs.webkit.org/show_bug.cgi?id=218380 Reviewed by David Kilzer. We had been limping along using ICU with some post-processing to encode and decode legacy-encoded Simplified Chinese text, but I implemented the standard with tests and compared behavior with other browsers. A few characters and several of the ranges from https://encoding.spec.whatwg.org/index-gb18030-ranges.txt were missing from our copy of ICU's encoding tables. I derive the encoding table from ICU's with one correction, then assert that it is equal to a reference copy of the table. This keeps a release build of WebKit small. Firefox's GBK decoder accepts anything that a gb18030 encoder would generate, which makes it more permissive than Chrome's, but the spec says to be this permissive so we will, and we will have sites that currently work only in Firefox also work in WebKit. See https://encoding.spec.whatwg.org/#gbk-decoder Also, Chrome and WebKit before this change do not implement https://encoding.spec.whatwg.org/#gb18030-decoder step 7, which decodes 0x80 into U+20AC, the Euro sign. No comprehensive tests had been written, so I wrote such tests to cover each failure mode and each range. Existing tests covered the differences between GBK and gb18030 encoding and some of the code points from https://encoding.spec.whatwg.org/index-gb18030.txt . Comparison with ICU revealed exactly one difference between ICU's decoder and Firefox's implementation, which was that a pointer of 6555 should map to a code point of U+e5e5, so I added that code point to the unit tests. Because that was the only difference between ICU and the whatwg standard, I felt it would have been overkill to test each of the 23940 code points, but I did move the Simplified Chinese legacy encoding tests to their own directory like Traditional Chinese, Korean, and Japanese. Tests: imported/w3c/web-platform-tests/encoding/legacy-mb-schinese/gb18030/gb18030-decoder.html imported/w3c/web-platform-tests/encoding/legacy-mb-schinese/gb18030/gb18030-encoder.html imported/w3c/web-platform-tests/encoding/legacy-mb-schinese/gbk/gbk-encoder.html * platform/text/EncodingTables.cpp: (WebCore::gb18030): * platform/text/EncodingTables.h: (WebCore::CompareSecond::operator()): (WebCore::makeSecondAdapter): * platform/text/TextCodecCJK.cpp: (WebCore::TextCodecCJK::registerEncodingNames): (WebCore::TextCodecCJK::registerCodecs): (WebCore::eucJPEncode): (WebCore::iso2022JPEncode): (WebCore::shiftJISEncode): (WebCore::eucKREncode): (WebCore::big5Encode): (WebCore::gb18030Ranges): (WebCore::gb18030RangesCodePoint): (WebCore::gb18030RangesPointer): (WebCore::gb18030EncodeIndex): (WebCore::TextCodecCJK::gb18030Decode): (WebCore::gbEncodeShared): (WebCore::gb18030Encode): (WebCore::TextCodecCJK::gbkDecode): (WebCore::gbkEncode): (WebCore::TextCodecCJK::decode): (WebCore::TextCodecCJK::encode const): * platform/text/TextCodecCJK.h: * platform/text/TextCodecICU.cpp: (WebCore::TextCodecICU::createICUConverter const): (WebCore::TextCodecICU::decode): (WebCore::TextCodecICU::encode const): (WebCore::fallbackForGBK): Deleted. (WebCore::gbkCallbackEscape): Deleted. (WebCore::gbkUrlEscapedEntityCallack): Deleted. (WebCore::gbkCallbackSubstitute): Deleted. * platform/text/TextCodecICU.h: 2020-11-05 Alex Christensen <achristensen@webkit.org> Add null checks effectively in UserInputBridge https://bugs.webkit.org/show_bug.cgi?id=218622 <rdar://problem/70724960> Reviewed by Wenson Hsieh. * replay/UserInputBridge.cpp: (WebCore::UserInputBridge::reloadFrame): (WebCore::UserInputBridge::stopLoadingFrame): * replay/UserInputBridge.h: 2020-11-05 Myles C. Maxfield <mmaxfield@apple.com> [Cocoa] REGRESSION(r269211): Text with emoji can trigger drawing corruption https://bugs.webkit.org/show_bug.cgi?id=218636 <rdar://problem/71066011> Reviewed by Simon Fraser. We have an optimization for frequently-painting layers that we will turn text drawing commands into display lists. r269211 added a bunch of context state introspection and recreation code to make sure that the state being recorded matches the state during playback. However, that code is incompatible with this cache idea, where the same DL might be played back into multiple places. The solution is to have two kinds of text display list drawing: 1. Deconstruct drawing commands into a series of commands. E.g. emoji will get deconstructed into DrawImage commands. This kind of drawing must do state introspection to make sure the emoji is drawn in the right place 2. Don't deconstruct the drawing commands; simply gather up the DrawGlyphs commands and record them directly. This doesn't do state introspection. GPU Process display lists use the first kind, while this text cache optimization uses the second kind. Test: fast/text/frequent-text.html * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::displayListForTextRun const): * platform/graphics/displaylists/DisplayListDrawGlyphsRecorder.h: * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp: (WebCore::DisplayList::DrawGlyphsRecorder::DrawGlyphsRecorder): (WebCore::DisplayList::DrawGlyphsRecorder::drawGlyphs): * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderHarfBuzz.cpp: (WebCore::DisplayList::DrawGlyphsRecorder::DrawGlyphsRecorder): * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderWin.cpp: (WebCore::DisplayList::DrawGlyphsRecorder::DrawGlyphsRecorder): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::Recorder): * platform/graphics/displaylists/DisplayListRecorder.h: 2020-11-05 John Wilander <wilander@apple.com> PCM: Switch to JSON report format https://bugs.webkit.org/show_bug.cgi?id=218634 <rdar://problem/70469923> Reviewed by Brent Fulgham. The standards conversation has landed in attribution reports in a JSON format as opposed to the currently implemented URL format. Discussion here: https://github.com/privacycg/private-click-measurement/issues/30 No new tests. Existing layout and API tests were updated. * Headers.cmake: Added platform/network/HTTPHeaderValues.h to be able to expose it to WebKit. * WebCore.xcodeproj/project.pbxproj: Now exporting platform/network/HTTPHeaderValues.h. * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::handleClick): Changed a function call from AdClickAttribution::url() to AdClickAttribution::reportURL(). * loader/AdClickAttribution.cpp: (WebCore::AdClickAttribution::reportURL const): The URL no longer carries the report values. Renamed from AdClickAttribution::url(). (WebCore::AdClickAttribution::json const): New function to generate and return the report JSON. (WebCore::AdClickAttribution::url const): Deleted. Renamed to AdClickAttribution::reportURL(). (WebCore::AdClickAttribution::referrer const): Deleted. The referrer is now part of the report JSON. (WebCore::AdClickAttribution::urlForTesting const): Deleted. This class no longer needs to help generate test URLs since report values are now in JSON. * loader/AdClickAttribution.h: * platform/network/FormData.h: Added export of create(const CString&). * platform/network/HTTPHeaderValues.cpp: (WebCore::HTTPHeaderValues::applicationJSONContentType): Used create the new JSON report request. * platform/network/HTTPHeaderValues.h: Added export of maxAge0(). 2020-11-05 Brian Burg <bburg@apple.com> [Cocoa] Inspector Extensions: Add _WKInspectorExtension and related plumbing https://bugs.webkit.org/show_bug.cgi?id=217783 <rdar://problem/69968787> Reviewed by Devin Rousso. * inspector/InspectorFrontendClient.h: * inspector/InspectorFrontendClientLocal.h: In order for WebInspectorUIExtensionController to work with remote and local inspectors, it stores a weak pointer the inspector's InspectorFrontendClient. Expose the frontend's page so that the frontend API dispatcher can dispatch to it. 2020-11-05 Chris Dumez <cdumez@apple.com> Add implementation for Object.getOwnPropertyNames() on HTMLDocument https://bugs.webkit.org/show_bug.cgi?id=218625 Reviewed by Geoffrey Garen. Add implementation for Object.getOwnPropertyNames() on HTMLDocument so that it properly returns names of the properties that would be returned by the named property getter. This aligns our behavior with Blink and Gecko. No new tests, rebaselined existing test. * dom/TreeScopeOrderedMap.cpp: (WebCore::TreeScopeOrderedMap::keys const): * dom/TreeScopeOrderedMap.h: * html/HTMLDocument.cpp: (WebCore::HTMLDocument::supportedPropertyNames const): 2020-11-05 Chris Dumez <cdumez@apple.com> Expose referrerPolicy attribute on HTMLLinkElement and HTMLAreaElement https://bugs.webkit.org/show_bug.cgi?id=218632 Reviewed by Geoffrey Garen. Expose referrerPolicy attribute on HTMLLinkElement and HTMLAreaElement: - https://html.spec.whatwg.org/multipage/semantics.html#htmllinkelement - https://html.spec.whatwg.org/multipage/image-maps.html#htmlareaelement No new tests, rebaselined existing tests. * html/HTMLAreaElement.idl: * html/HTMLLinkElement.idl: 2020-11-05 Chris Dumez <cdumez@apple.com> DOMStringList, TextMetrics & ImageBitmapRenderingContext should be exposed to workers https://bugs.webkit.org/show_bug.cgi?id=218631 Reviewed by Geoffrey Garen. DOMStringList, TextMetrics & ImageBitmapRenderingContext should be exposed to workers: - https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#domstringlist - https://html.spec.whatwg.org/multipage/canvas.html#textmetrics - https://html.spec.whatwg.org/multipage/canvas.html#imagebitmaprenderingcontext No new tests, rebaselined existing test. * dom/DOMStringList.idl: * html/TextMetrics.idl: * html/canvas/ImageBitmapRenderingContext.idl: 2020-11-05 Chris Dumez <cdumez@apple.com> Crash in AudioBuffer::sampleRate() https://bugs.webkit.org/show_bug.cgi?id=218603 Reviewed by Geoffrey Garen. Have OfflineAudioDestinationNode store the sample rate instead of getting it from the render buffer. It is possible for an OfflineAudioContext to have no rendering buffer when constructing this rendering buffer fails (e.g. because the length is too large). Test: webaudio/OfflineAudioContext-bad-buffer-crash.html * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::AudioContext): * Modules/webaudio/AudioContext.h: * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::AudioDestinationNode): * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode): * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::OfflineAudioContext): (WebCore::OfflineAudioContext::create): * Modules/webaudio/OfflineAudioContext.h: * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode): * Modules/webaudio/OfflineAudioDestinationNode.h: * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::WebKitAudioContext): * Modules/webaudio/WebKitAudioContext.h: * Modules/webaudio/WebKitOfflineAudioContext.cpp: (WebCore::WebKitOfflineAudioContext::WebKitOfflineAudioContext): (WebCore::WebKitOfflineAudioContext::create): * Modules/webaudio/WebKitOfflineAudioContext.h: 2020-11-05 Adrian Perez de Castro <aperez@igalia.com> [GTK] Add missing const_cast in gdk_event_get_source_device() Unreviewed build fix. * platform/gtk/GtkVersioning.h: (gdk_event_get_source_device): 2020-11-05 Don Olmstead <don.olmstead@sony.com> Non-unified build fixes, early November 2020 edition https://bugs.webkit.org/show_bug.cgi?id=218628 Unreviewed non-unified build fix. * display/css/DisplayBox.cpp: * display/css/DisplayBoxFactory.cpp: * display/css/DisplayBoxFactory.h: * page/PageConfiguration.cpp: * rendering/style/StyleContentAlignmentData.cpp: * rendering/style/StyleContentAlignmentData.h: * rendering/style/StyleSelfAlignmentData.cpp: * rendering/style/StyleSelfAlignmentData.h: 2020-11-05 Youenn Fablet <youenn@apple.com> WebSocket constructor should not throw in case port is blocked https://bugs.webkit.org/show_bug.cgi?id=218617 Reviewed by Alex Christensen. Update as per spec, see https://github.com/web-platform-tests/wpt/pull/5212. Covered by existing tests. * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::connect): 2020-11-05 Simon Fraser <simon.fraser@apple.com> Clean up ScrollingStateTree setPropertyChangesAfterReattach() code https://bugs.webkit.org/show_bug.cgi?id=218621 Reviewed by Antti Koivisto. Replace lots of individual setPropertyChangedInternal() calls with a single call with an OptionSet<> argument. The virtual applicableProperties() calls base classes to generate an OptionSet<> of all the properties for a node type. * page/scrolling/ScrollingStateFixedNode.cpp: (WebCore::ScrollingStateFixedNode::applicableProperties const): (WebCore::ScrollingStateFixedNode::setPropertyChangesAfterReattach): Deleted. * page/scrolling/ScrollingStateFixedNode.h: * page/scrolling/ScrollingStateFrameScrollingNode.cpp: (WebCore::ScrollingStateFrameScrollingNode::applicableProperties const): (WebCore::ScrollingStateFrameScrollingNode::setPropertyChangesAfterReattach): Deleted. * page/scrolling/ScrollingStateFrameScrollingNode.h: * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::applicableProperties const): (WebCore::ScrollingStateNode::setPropertyChangesAfterReattach): * page/scrolling/ScrollingStateNode.h: (WebCore::ScrollingStateNode::setPropertiesChangedInternal): * page/scrolling/ScrollingStateOverflowScrollProxyNode.cpp: (WebCore::ScrollingStateOverflowScrollProxyNode::applicableProperties const): (WebCore::ScrollingStateOverflowScrollProxyNode::setPropertyChangesAfterReattach): Deleted. * page/scrolling/ScrollingStateOverflowScrollProxyNode.h: * page/scrolling/ScrollingStatePositionedNode.cpp: (WebCore::ScrollingStatePositionedNode::applicableProperties const): (WebCore::ScrollingStatePositionedNode::setPropertyChangesAfterReattach): Deleted. * page/scrolling/ScrollingStatePositionedNode.h: * page/scrolling/ScrollingStateScrollingNode.cpp: (WebCore::ScrollingStateScrollingNode::applicableProperties const): (WebCore::ScrollingStateScrollingNode::setPropertyChangesAfterReattach): Deleted. * page/scrolling/ScrollingStateScrollingNode.h: * page/scrolling/ScrollingStateStickyNode.cpp: (WebCore::ScrollingStateStickyNode::applicableProperties const): (WebCore::ScrollingStateStickyNode::setPropertyChangesAfterReattach): Deleted. * page/scrolling/ScrollingStateStickyNode.h: 2020-11-05 Wenson Hsieh <wenson_hsieh@apple.com> Clean up Source/WebCore/platform/graphics/DashArray.h https://bugs.webkit.org/show_bug.cgi?id=218619 Reviewed by Simon Fraser. Attempting to #include <WebCore/DisplayList.h> in API tests currently results in a compilation error when parsing `DashArray.h`, due to the `CGFloat` type being unknown. Fix this by including `CoreGraphics.h` if `USE(CG)` is defined. * platform/graphics/DashArray.h: Also do some more cleanup around this file: - Use `#pragma once` instead of `#define`-based header guards. - Use `using` instead of `typedef` - Add a missing `namespace WebCore` around this file * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: Add WebCore namespaces for `DashArray`. 2020-11-05 Chris Dumez <cdumez@apple.com> <input disabled> does not fire click events after dispatchEvent https://bugs.webkit.org/show_bug.cgi?id=215461 <rdar://problem/67030950> Reviewed by Darin Adler. We should allow mouse events from JS to get dispatched on disabled form controls. Only mouse events from the user and calling input.click() should not cause an event to get dispatched on disabled form controls. Tests: fast/dom/HTMLInputElement/disabled-checkbox-click.html fast/dom/HTMLInputElement/disabled-radio-click.html * dom/Node.cpp: (WebCore::Node::handleLocalEvents): Allow mouse events from JS to get dispatched on disabled form controls. Trusted mouse events (events from the user-agent) are still not dispatched on disabled form controls. * html/RadioInputType.cpp: (WebCore::RadioInputType::didDispatchClick): Fix post activation behavior for radio input elements so that we set the elements' checkedness to false if the activation was cancelled and we are not restoring the checkedness of the previously checked element in the group. - https://html.spec.whatwg.org/#the-input-element:legacy-canceled-activation-behavior (Step 2) 2020-11-05 Antoine Quint <graouts@webkit.org> REGRESSION (r263179): CSS checkbox no longer visible in iOS 14 https://bugs.webkit.org/show_bug.cgi?id=216690 <rdar://problem/69156576> Reviewed by Simon Fraser. We revert the changes to RenderBox::addVisualEffectOverflow() introduced in r263179 for bug 213260. Instead of that original change, which affected painting instead of hit-testing, we now ensure that RenderBlock::nodeAtPoint() will check the hit-test point is within an element's clipped bounds before considering its children. Whether the element has a self-painting layer should have no bearing here. Tests: fast/box-shadow/box-shadow-with-zero-height.html fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container-2.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::nodeAtPoint): * rendering/RenderBox.cpp: (WebCore::RenderBox::addVisualEffectOverflow): 2020-11-03 Darin Adler <darin@apple.com> Remove more functions that implicitly use composed tree https://bugs.webkit.org/show_bug.cgi?id=218544 Reviewed by Ryosuke Niwa. * dom/Node.cpp: (WebCore::commonInclusiveAncestor): Changed this into a function template. * dom/Node.h: Ditto. Note this defaults to the traditional tree, and callers have all been modified to use composed tree explicitly. * dom/Position.cpp: (WebCore::commonInclusiveAncestor): Changed return type to a raw pointer. Since I created this returning a smart pointer, Ryosuke clarified that our approach to object lifetime does not involve returning smart pointers in cases like this. Call commonInclusiveAncestor<ComposedTree>. (WebCore::documentOrder): Ditto. * dom/Position.h: Updated return value. * dom/Range.cpp: (WebCore::Range::commonAncestorContainer const): Made this non-inline. Note that this now calls the non-composed-tree version of commonInclusiveAncestor, which is what we want, but since live ranges maintain the invariant that both containers are in the same tree, this is not an observable change. * dom/Range.h: Made commonAncestorContainer non-inline. Not critical to optimize out the function call. * dom/SimpleRange.cpp: (WebCore::commonInclusiveAncestor): Changed this into a function template. * dom/SimpleRange.h: Updated for the above. * editing/ChangeListTypeCommand.cpp: (WebCore::listConversionTypeForSelection): Use commonInclusiveAncestor<ComposedTree>. * editing/EditingStyle.cpp: (WebCore::EditingStyle::styleAtSelectionStart): Ditto. * editing/Editor.cpp: (WebCore::Editor::adjustedSelectionRange): Ditto. * editing/FormatBlockCommand.cpp: (WebCore::FormatBlockCommand::elementForFormatBlockCommand): Ditto. * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::scheduleObservationUpdate): Ditto. (WebCore::TextManipulationController::replace): Ditto. * editing/VisiblePosition.cpp: (WebCore::commonInclusiveAncestor): Added. (WebCore::intersects): Added. (WebCore::contains): Added. (WebCore::intersection): Added. (WebCore::midpoint): Added. * editing/VisiblePosition.h: Added functions that work with VisiblePositionRange. These are used in WebKit editing-related code for iOS, and having these higher level operations is starting to make that code more readable. This was originally motivated because it was a use of a function template outside WebCore and I wanted to sidestep the need to export, which I can't figure out how to do yet. But the refactoring ended up changing the code completely. * editing/cocoa/HTMLConverter.mm: (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted): Updated since commonInclusiveAncestor does not return a smart pointer any more. * editing/markup.cpp: (WebCore::serializePreservingVisualAppearanceInternal): Ditto. * page/DragController.cpp: (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret): Use commonInclusiveAncestor<ComposedTree>. * page/EventHandler.cpp: (WebCore::targetNodeForClickEvent): Ditto. * page/TextIndicator.cpp: (WebCore::estimatedBackgroundColorForRange): Ditto. (WebCore::initializeIndicator): Ditto. * rendering/RenderObject.cpp: (WebCore::RenderObject::collectSelectionRectsInternal): Ditto. 2020-11-05 Alex Christensen <achristensen@webkit.org> Fix build after r269435 https://bugs.webkit.org/show_bug.cgi?id=218599 * loader/FrameLoader.cpp: (WebCore::FrameLoader::opener): (WebCore::FrameLoader::opener const): 2020-11-05 Aditya Keerthi <akeerthi@apple.com> [macOS] Toggling dark mode does not update the scrollbar appearance in overflow: scroll elements https://bugs.webkit.org/show_bug.cgi?id=218538 <rdar://problem/68953006> Reviewed by Simon Fraser. This functionality regressed in r260276 with the introduction of async overflow scrolling on macOS. The appearance of the scrollbar is determined by [WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]. Prior to r260276, ScrollbarThemeMac::paint was responsible for painting the scrollbar, using [NSScrollerImp drawKnob]. Calling this method results in a call to effectiveAppearanceForScrollerImp:, ensuring the scrollbar has the correct appearance. However, async overflow scrolling no longer paints the scrollbar using drawKnob, and a call to effectiveAppearanceForScrollImp: is no longer made when switching between light/dark appearances. Since we no longer draw the knob ourselves, and the NSScrollerImp does not belong to an NSView, the scrollbar does not automatically get repainted on an appearance change. To fix, we need to ensure the scrollbar is repainted by making a call to [NSScrollerImp setNeedsDisplay:] when the page's appearance changes. This should be done for all scrollbars to ensure their appearance is up to date. Note that hovering over the scrollbar still results in an update to its appearance, since AppKit always repaints the scrollbar on hover. Test: fast/scrolling/mac/overflow-scrollbars-toggle-dark-mode.html * dom/Document.cpp: (WebCore::Document::invalidateScrollbars): Tell the FrameView to invalidate scrollbars in all its ScrollableAreas. * dom/Document.h: * page/FrameView.cpp: (WebCore::FrameView::invalidateScrollbarsForAllScrollableAreas): * page/FrameView.h: * page/Page.cpp: (WebCore::Page::appearanceDidChange): Tell each document to invalidate its scrollbars. * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::setScrollbarOverlayStyle): (WebCore::ScrollableArea::invalidateScrollbars): Moved scrollbar invalidation out of setScrollbarOverlayStyle and into its own method, so that it can be called for all ScrollableAreas in a FrameView. * platform/ScrollableArea.h: 2020-11-05 Alex Christensen <achristensen@webkit.org> Store WeakPtr<Frame> instead of Frame* https://bugs.webkit.org/show_bug.cgi?id=218599 Reviewed by Youenn Fablet. No change in behavior, but this probably fixes some bugs. * bindings/js/WindowProxy.cpp: (WebCore::WindowProxy::WindowProxy): (WebCore::WindowProxy::frame const): * bindings/js/WindowProxy.h: (WebCore::WindowProxy::frame const): Deleted. * dom/Document.cpp: (WebCore::Document::willBeRemovedFromFrame): (WebCore::Document::canNavigateInternal): (WebCore::Document::setDesignMode): (WebCore::Document::getDesignMode const): Deleted. * dom/Document.h: * html/HTMLFrameOwnerElement.cpp: (WebCore::HTMLFrameOwnerElement::setContentFrame): (WebCore::HTMLFrameOwnerElement::disconnectContentFrame): * html/HTMLFrameOwnerElement.h: (WebCore::HTMLFrameOwnerElement::contentFrame const): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::frameForId): (WebCore::InspectorPageAgent::frameId): * inspector/agents/InspectorPageAgent.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::stopLoading): (WebCore::DocumentLoader::willSendRequest): (WebCore::DocumentLoader::commitLoad): (WebCore::DocumentLoader::detachFromFrame): (WebCore::DocumentLoader::removeSubresourceLoader): (WebCore::DocumentLoader::subresourceLoaderFinishedLoadingOnePart): * loader/DocumentWriter.cpp: (WebCore::DocumentWriter::createDocument): (WebCore::DocumentWriter::decoder): (WebCore::DocumentWriter::setFrame): * loader/DocumentWriter.h: (WebCore::DocumentWriter::setFrame): Deleted. * loader/FrameLoader.cpp: (WebCore::FrameLoader::detachFromAllOpenedFrames): (WebCore::FrameLoader::opener): (WebCore::FrameLoader::setOpener): (WebCore::FrameLoader::hasOpenedFrames const): (WebCore::FrameLoader::addExtraFieldsToRequest): * loader/FrameLoader.h: * loader/FrameNetworkingContext.h: (WebCore::FrameNetworkingContext::FrameNetworkingContext): (WebCore::FrameNetworkingContext::frame const): * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::update): (WebCore::ApplicationCacheGroup::didFinishLoadingEntry): (WebCore::ApplicationCacheGroup::didFailLoadingEntry): (WebCore::ApplicationCacheGroup::didFailLoadingManifest): (WebCore::ApplicationCacheGroup::startLoadingEntry): * loader/appcache/ApplicationCacheGroup.h: * page/AbstractFrame.h: * page/Frame.cpp: (WebCore::Frame::Frame): (WebCore::Frame::addDestructionObserver): (WebCore::Frame::removeDestructionObserver): * page/Frame.h: * page/FrameDestructionObserver.cpp: (WebCore::FrameDestructionObserver::frame const): (WebCore::FrameDestructionObserver::observeFrame): * page/FrameDestructionObserver.h: (WebCore::FrameDestructionObserver::frame const): Deleted. * page/FrameTree.cpp: (WebCore::FrameTree::FrameTree): (WebCore::FrameTree::parent const): (WebCore::FrameTree::appendChild): (WebCore::FrameTree::removeChild): (WebCore::FrameTree::traverseNextInPostOrder const): * page/FrameTree.h: (WebCore::FrameTree::previousSibling const): (WebCore::FrameTree::lastChild const): (WebCore::FrameTree::FrameTree): Deleted. * rendering/RenderScrollbar.cpp: (WebCore::RenderScrollbar::RenderScrollbar): * rendering/RenderScrollbar.h: 2020-11-05 Alex Christensen <achristensen@webkit.org> Use fewer raw pointers and more const correctness in Frame.h https://bugs.webkit.org/show_bug.cgi?id=218598 Reviewed by Youenn Fablet. * loader/FrameLoader.cpp: (WebCore::FrameLoader::opener): Deleted. * loader/FrameLoader.h: * page/Frame.cpp: (WebCore::Frame::Frame): (WebCore::Frame::page const): (WebCore::Frame::ownerElement const): (WebCore::Frame::ownerRenderer const): * page/Frame.h: (WebCore::Frame::loader const): Deleted. (WebCore::Frame::ownerElement const): Deleted. (WebCore::Frame::page const): Deleted. 2020-11-05 Alex Christensen <achristensen@webkit.org> Use std::exchange instead of WTFMove to avoid using members after moving them in NavigationScheduler.cpp https://bugs.webkit.org/show_bug.cgi?id=218597 Reviewed by Wenson Hsieh. This shouldn't change behavior, but it leaves the members in a defined state. * loader/NavigationScheduler.cpp: (WebCore::NavigationScheduler::timerFired): (WebCore::NavigationScheduler::cancel): 2020-11-05 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Add visual support for text-overflow: ellipsis https://bugs.webkit.org/show_bug.cgi?id=218572 Reviewed by Antti Koivisto. In this patch we replace the trailing overflow content with ellipsis: 1. Check if the current run is the last run on the line that can include the ellipsis text without getting clipped. 2. "Empty" any subsequent runs as far as Run::renderedContent() is concerned (see Run::originalContent vs. Run::renderedContent) * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): 2020-11-05 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Transition hyphenated content to Run::renderedContent() https://bugs.webkit.org/show_bug.cgi?id=218552 Reviewed by Antti Koivisto. Currently hyphenated content is being constructed during paint time. This patch takes advantage of the new Run::renderedContent() API. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): (WebCore::LayoutIntegration::LineLayout::paint): 2020-11-05 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Let's compute display lines visual alignments first before the runs https://bugs.webkit.org/show_bug.cgi?id=218551 Reviewed by Antti Koivisto. In this patch we pre-compute visual adjustement properties that we later use during run construction (e.g. whether the runs on the line need vertical snapping). This patch is also in preparation for adding support for "text-overflow: ellipsis". The pre-computed LineLevelVisualAdjustmentsForRuns.needsTrailingContentReplacement will drive the content truncation logic for the ellipsis. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::lineOverflowWidth): (WebCore::LayoutIntegration::LineLayout::constructContent): 2020-11-05 Yusuke Suzuki <ysuzuki@apple.com> Unreviewed, build fix for ARM64E part 2 https://bugs.webkit.org/show_bug.cgi?id=218587 * cssjit/SelectorCompiler.h: 2020-11-05 Yusuke Suzuki <ysuzuki@apple.com> Unreviewed, build fix for ARM64E https://bugs.webkit.org/show_bug.cgi?id=218587 * cssjit/SelectorCompiler.h: 2020-11-04 Said Abou-Hallawa <said@apple.com> [GPU Process] Move the internal GPU rendering flags from WebPage to WebProcess https://bugs.webkit.org/show_bug.cgi?id=218549 Reviewed by Tim Horton. Add a new RenderingPurpose for DOM rendering. * platform/graphics/RenderingMode.h: 2020-11-04 Yusuke Suzuki <ysuzuki@apple.com> Apply JITCage to CSSJIT https://bugs.webkit.org/show_bug.cgi?id=218587 Reviewed by Mark Lam. Since CSSJIT does not call JIT function recursively, supporting it in JITCage is simple: we can have trampoline in C and jump to JIT code, and instead of doing "ret", returning back to C code via jump. No behavior change. * WebCore.xcodeproj/project.pbxproj: * cssjit/CSSPtrTag.h: Removed. * cssjit/CompiledSelector.h: * cssjit/FunctionCall.h: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::compile): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateReturn): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker): * cssjit/SelectorCompiler.h: (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorChecker): (WebCore::SelectorCompiler::querySelectorSimpleSelectorChecker): (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerWithCheckingContext): (WebCore::SelectorCompiler::querySelectorSelectorCheckerWithCheckingContext): (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction): Deleted. (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction): Deleted. (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext): Deleted. (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext): Deleted. * dom/SelectorQuery.cpp: (WebCore::SelectorDataList::executeCompiledSimpleSelectorChecker const): (WebCore::SelectorDataList::executeCompiledSelectorCheckerWithCheckingContext const): (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const): (WebCore::SelectorDataList::execute const): * dom/SelectorQuery.h: * style/ElementRuleCollector.cpp: (WebCore::Style::ElementRuleCollector::ruleMatches): 2020-11-04 Chris Dumez <cdumez@apple.com> window.event may get set on wrong global when dispatching an event https://bugs.webkit.org/show_bug.cgi?id=218546 Reviewed by Sam Weinig. As per the specification [1], while invoking an event listener, we should set the global's 'current event', stating that global is the 'listener callback’s associated Realm’s global object'. It also states we should do so only if global is a Window object. Previously, we were setting the 'current event' on the wrong global. We were using the global of the object the event listener was registered on. [1] https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke Tests: fast/events/window-event-onerror-recursive.html fast/events/window-event-onerror.html fast/events/window-event-recursive.html * bindings/js/JSDOMGlobalObject.cpp: * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::setCurrentEvent): (WebCore::JSDOMWindowBase::currentEvent const): * bindings/js/JSDOMWindowBase.h: * bindings/js/JSErrorHandler.cpp: (WebCore::JSErrorHandler::handleEvent): * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent): 2020-11-04 Eric Carlson <eric.carlson@apple.com> Transparent video poster image doesn't keep element transparent once first frame is preloaded https://bugs.webkit.org/show_bug.cgi?id=218391 <rdar://problem/70916944> Reviewed by Jer Noble. Redo the poster frame logic to use the `show poster flag` logic from the spec. Test: media/video-poster-visible-after-first-video-frame.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_showPoster. (WebCore::HTMLMediaElement::prepareForLoad): m_displayMode was removed. (WebCore::HTMLMediaElement::selectMediaResource): Call setShowPosterFlag. (WebCore::HTMLMediaElement::loadResource): Remove calls to setDisplayMode and updateDisplayState, they have been deleted. (WebCore::HTMLMediaElement::waitForSourceChange): Call setShowPosterFlag. Update spec text. (WebCore::HTMLMediaElement::noneSupported): Call setShowPosterFlag. (WebCore::HTMLMediaElement::mediaLoadingFailed): Remove call to updateDisplayState. (WebCore::HTMLMediaElement::setReadyState): Ditto. (WebCore::HTMLMediaElement::seekWithTolerance): Call setShowPosterFlag. (WebCore::HTMLMediaElement::seekTask): Check m_showPoster, not displayMode. (WebCore::HTMLMediaElement::playInternal): Call setShowPosterFlag. (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Don't check displayMode. (WebCore::HTMLMediaElement::updatePlayState): No more setDisplayMode. (WebCore::HTMLMediaElement::userCancelledLoad): Call setShowPosterFlag. (WebCore::HTMLMediaElement::setShowPosterFlag): (WebCore::HTMLMediaElement::mediaPlayerFirstVideoFrameAvailable): Deleted. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::showPosterFlag const): (WebCore::HTMLMediaElement::setShowPosterFlag): (WebCore::HTMLMediaElement::displayMode const): Deleted. (WebCore::HTMLMediaElement::setDisplayMode): Deleted. (WebCore::HTMLMediaElement::updateDisplayState): Deleted. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::didAttachRenderers): No more updateDisplayState. (WebCore::HTMLVideoElement::parseAttribute): Ditto. Call updateFromElement when poster is removed. (WebCore::HTMLVideoElement::shouldDisplayPosterImage const): New. (WebCore::HTMLVideoElement::mediaPlayerFirstVideoFrameAvailable): New, update player and renderer if the poster isn't supposed to be visible. (WebCore::HTMLVideoElement::setDisplayMode): Deleted. (WebCore::HTMLVideoElement::updateDisplayState): Deleted. * html/HTMLVideoElement.h: * rendering/RenderVideo.cpp: (WebCore::RenderVideo::failedToLoadPosterImage const): New. * rendering/RenderVideo.h: * testing/Internals.cpp: (WebCore::Internals::elementShouldDisplayPosterImage const): * testing/Internals.h: * testing/Internals.idl: 2020-11-04 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Introduce LayoutIntegration::Run::renderedContent https://bugs.webkit.org/show_bug.cgi?id=218550 Reviewed by Antti Koivisto. This is in preparation for supporting "text-overflow: ellipsis" where the rendered content could be very different from the original content (e.g. runs after the truncation go completely blank) * layout/integration/LayoutIntegrationLine.h: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): (WebCore::LayoutIntegration::LineLayout::paint): * layout/integration/LayoutIntegrationRun.h: (WebCore::LayoutIntegration::Run::TextContent::originalContent const): (WebCore::LayoutIntegration::Run::TextContent::renderedContent const): (WebCore::LayoutIntegration::Run::isLineBreak const): (WebCore::LayoutIntegration::Run::TextContent::TextContent): (WebCore::LayoutIntegration::Run::TextContent::content const): Deleted. * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::text const): 2020-11-04 Antti Koivisto <antti@apple.com> REGRESSION (r257839): Miscomputed style due to computed 'rem' value in matched declaration cache https://bugs.webkit.org/show_bug.cgi?id=218561 <rdar://problem/70074191> Reviewed by Zalan Bujtas. Test: fast/dom/focus-rem-style-update.html Call to focus() causes computed style update for the element’s ancestor chain before the the document has otherwise been styled (using the shortcut mechanism introduced in r257839). This style, which uses ‘rem’ unit and so depends on root element font size, gets cached in MatchedDeclarationsCache. The root font size then changes but during the resulting style update we use this cached value, failing to re-resolve ‘rem’. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveElement): Invalidate matched declarations cache also when there is no existing document element style. 2020-11-04 Chris Dumez <cdumez@apple.com> REGRESSION(r268161?): [ macOS ] imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/processing-after-resume.https.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=217542 <rdar://problem/70159546> Reviewed by Youenn Fablet. When the script calls suspend(), we call AudioDestinationCocoa::stop() to stop rendering and then resolve the suspend promise. At this point, the script saves the AudioContext's current sample frame and expects this value to not change until the AudioContext is resumed. The issue was that we previously were potentially resolving the promise on the main thread while the last rendering quantum was still being processed on the AudioWorklet thread. This meant that the sample frame could still increase a bit, a short while after the suspend promise has been resolved. To address the issue, we now do a round trip to the AudioWorklet thread after stopping rendering, to make sure we only resolve the promise after the last rendering quantum has been processed on the AudioWorklet thread. No new tests, unskipped existing test. * Modules/webaudio/AudioDestinationNode.h: Use an std::atomic<size_t> for AudioDestinationNode's currentSampleFrame since this value is being written by the rendering thread and read by the main thread. * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::startRendering): * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestinationCocoa::stop): 2020-11-04 Said Abou-Hallawa <said@apple.com> [GPU Process] Enable Document based ImageBitmap and OffscreenCanvas drawing to use GPU Process rendering https://bugs.webkit.org/show_bug.cgi?id=217735 Reviewed by Simon Fraser. Add a new static method ImageBitmap::createImageBuffer() which takes a ScriptExecutionContext. It gets HostWindow from ScriptExecutionContext. If a HostWindow exists, creating the ImageBuffer will be delegated to WebChromeClient which will create a RemoteImageBuffer in Web Process and a RemoteImageBufferProxy in the GPU Process. Rename all the variables of type ScriptExecutionContext to 'scriptExecutionContext' to avoid confusing it with GraphicsContext, CanvasRenderingContext and WebGLRenderingContext. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readImageBitmap): * html/ImageBitmap.cpp: (WebCore::ImageBitmap::create): (WebCore::ImageBitmap::createImageBuffer): (WebCore::ImageBitmap::resolveWithBlankImageBuffer): (WebCore::ImageBitmap::createPromise): (WebCore::ImageBitmap::createFromBuffer): * html/ImageBitmap.h: * html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::create): (WebCore::OffscreenCanvas::OffscreenCanvas): (WebCore::OffscreenCanvas::createContextWebGL): (WebCore::OffscreenCanvas::transferToImageBitmap): (WebCore::OffscreenCanvas::securityOrigin const): (WebCore::OffscreenCanvas::cssValuePool): (WebCore::OffscreenCanvas::createImageBuffer const): (WebCore::OffscreenCanvas::takeImageBuffer const): 2020-11-04 David Kilzer <ddkilzer@apple.com> WebKit should remove unused debug variant support <https://webkit.org/b/218315> <rdar://problem/70785369> Reviewed by Darin Adler. Remove support for building the debug variant since it is currently unused. We now set default values for the DEAD_CODE_STRIPPING, DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL and STRIP_INSTALLED_PRODUCT variables. Also move these values out of the Xcode project into Base.xcconfig files using the [config=Debug] specifier so that these overrides are next to the definitions. * Configurations/Base.xcconfig: * WebCore.xcodeproj/project.pbxproj: 2020-11-04 Wenson Hsieh <wenson_hsieh@apple.com> Add some missing header includes in media sources https://bugs.webkit.org/show_bug.cgi?id=218568 Reviewed by Eric Carlson. * Modules/mediarecorder/MediaRecorderProvider.h: Include `WTFString.h`. 2020-11-04 Simon Fraser <simon.fraser@apple.com> A programmatic scroll should stop any rubberbanding https://bugs.webkit.org/show_bug.cgi?id=218545 Reviewed by Antti Koivisto. Part of rdar://problem/69599531: Scrolling on netflix.com sometimes jumps to the top. If the scrolling thread is in the middle of a rubberband (say, when a modal overlay is up), and then the main thread triggers a programmatic scroll to some other location, we should stop rubberbanding immediately. If we don't, then the rubberband timer continues to generate scrolls on the scrolling thread which get to the main thread after it has handled the programatic scroll, thus resetting the scroll position. This change shares some edgePinnedState() around which is used to allow rubberbanding to continue of the programmatic scroll is to the edge which is already pinned (commonly the top). Also address some review comments from a previous patch. Very hard to make tests that do things while rubberbanding is happening. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::applyLayerPositionsInternal): (WebCore::ScrollingTree::addPendingScrollUpdate): (WebCore::ScrollingTree::takePendingScrollUpdates): * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::scrollTo): (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::currentScrollPositionChanged): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::currentScrollPositionChanged): (WebCore::ScrollingTreeScrollingNodeDelegateMac::edgePinnedState const): * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::notifyPositionChanged): * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::edgePinnedState const): * platform/ScrollableArea.h: * platform/cocoa/ScrollController.h: * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::snapRubberBandTimerFired): (WebCore::ScrollController::scrollPositionChanged): (WebCore::ScrollController::stopRubberbanding): (WebCore::ScrollController::updateRubberBandingState): (WebCore::ScrollController::updateRubberBandingEdges): (WebCore::ScrollController::scrolledToRubberbandingEdge const): * platform/mac/ScrollAnimatorMac.h: * platform/mac/ScrollAnimatorMac.mm: (WebCore::ScrollAnimatorMac::edgePinnedState const): * platform/mock/ScrollAnimatorMock.h: 2020-11-04 Youenn Fablet <youenn@apple.com> Make functional WebRTC encoders in GPUProcess https://bugs.webkit.org/show_bug.cgi?id=218498 Reviewed by Eric Carlson. Exporting necessary methods and allow to override creation of encoder factory in WebKit. Covered by existing tests. * WebCore.xcodeproj/project.pbxproj: * platform/graphics/cv/PixelBufferConformerCV.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h: 2020-11-03 Antoine Quint <graouts@webkit.org> align-items should be a discrete animatable property https://bugs.webkit.org/show_bug.cgi?id=218535 <rdar://problem/71012428> Reviewed by Dean Jackson. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): * rendering/style/StyleSelfAlignmentData.cpp: Added. (WebCore::operator<<): * rendering/style/StyleSelfAlignmentData.h: 2020-11-03 Tyler Wilcock <twilco.o@protonmail.com> Ignore order when parsing inset and color for box-shadow https://bugs.webkit.org/show_bug.cgi?id=182677 Reviewed by Simon Fraser. According to the spec [1], box-shadow should allow the inset keyword, a color, and the lengths component in any order. Our implementation allowed only 2 out of the 4 possible orders; fix our parsing to match the spec. [1]: https://drafts.csswg.org/css-backgrounds/#typedef-shadow Above description is (almost) a direct quote from <cnardi@chromium.org> who previously submitted a patch for this bug. Change is covered by existing test LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/box-shadow-valid.html and new test LayoutTests/fast/box-shadow/box-shadow-invalid-values.html * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeSingleShadow): Parse inset, color, and lengths component of a single <shadow> in any order. 2020-11-03 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Rename Run::needsHyphen to hasHyphen https://bugs.webkit.org/show_bug.cgi?id=218541 Reviewed by Sam Weinig. 1. Integration uses the term "has" instead of "needs". 2. Runs will gain the hyphen character soon (when we introduce the concept of rendered content (vs. original content)). * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::paint): * layout/integration/LayoutIntegrationRun.h: (WebCore::LayoutIntegration::Run::TextContent::hasHyphen const): (WebCore::LayoutIntegration::Run::TextContent::TextContent): (WebCore::LayoutIntegration::Run::TextContent::needsHyphen const): Deleted. * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::hasHyphen const): 2020-11-03 Sihui Liu <sihui_liu@apple.com> Set up basic infrastructure for SpeechRecognition https://bugs.webkit.org/show_bug.cgi?id=218216 <rdar://problem/70703788> Reviewed by Youenn Fablet. Introduce SpeechRecognitionConnectionClient, SpeechRecognitionConnection and SpeechRecognitionServer. SpeechRecognition is a SpeechRecognitionConnectionClient that can send SpeechRecognitionRequest to SpeechRecognitionServer via SpeechRecognitionConnection. Currently we have one SpeechRecogntionConnection and one SpeechRecogntionServer per page. SpeechRecognitionServer will be responsible for handling SpeechRecognitionRequests, including audio capturing and hosting speech recognition engine, and that implementation is not included in this patch. Our current plan is put SpeechRecognitionServer in UI process (or GPU process when media code is all moved) and keep SpeechRecognitionConnectionClient in web process. Test: fast/speechrecognition/start-recognition-twice-exception.html * Headers.cmake: * Modules/speech/SpeechRecognition.cpp: (WebCore::SpeechRecognition::create): (WebCore::SpeechRecognition::SpeechRecognition): (WebCore::SpeechRecognition::startRecognition): (WebCore::SpeechRecognition::stopRecognition): (WebCore::SpeechRecognition::abortRecognition): (WebCore::SpeechRecognition::didStart): (WebCore::SpeechRecognition::didStartCapturingAudio): (WebCore::SpeechRecognition::didStartCapturingSound): (WebCore::SpeechRecognition::didStartCapturingSpeech): (WebCore::SpeechRecognition::didStopCapturingSpeech): (WebCore::SpeechRecognition::didStopCapturingSound): (WebCore::SpeechRecognition::didStopCapturingAudio): (WebCore::SpeechRecognition::didFindNoMatch): (WebCore::SpeechRecognition::didReceiveResult): (WebCore::SpeechRecognition::didError): (WebCore::SpeechRecognition::didEnd): * Modules/speech/SpeechRecognition.h: * Modules/speech/SpeechRecognitionConnection.h: Added. (WebCore::SpeechRecognitionConnection::~SpeechRecognitionConnection): * Modules/speech/SpeechRecognitionConnectionClient.h: Added. (WebCore::SpeechRecognitionConnectionClient::SpeechRecognitionConnectionClient): (WebCore::SpeechRecognitionConnectionClient::identifier const): * Modules/speech/SpeechRecognitionConnectionClientIdentifier.h: Added. * Modules/speech/SpeechRecognitionError.h: Added. (WebCore::SpeechRecognitionError::encode const): (WebCore::SpeechRecognitionError::decode): * Modules/speech/SpeechRecognitionErrorCode.h: * Modules/speech/SpeechRecognitionRequest.cpp: Added. (WebCore::SpeechRecognitionRequest::create): (WebCore::SpeechRecognitionRequest::SpeechRecognitionRequest): * Modules/speech/SpeechRecognitionRequest.h: Added. (WebCore::SpeechRecognitionRequest::clientIdentifier const): (WebCore::SpeechRecognitionRequest::lang const): (WebCore::SpeechRecognitionRequest::continuous const): (WebCore::SpeechRecognitionRequest::interimResults const): (WebCore::SpeechRecognitionRequest::maxAlternatives const): * Modules/speech/SpeechRecognitionRequestInfo.h: Added. (WebCore::SpeechRecognitionRequestInfo::encode const): (WebCore::SpeechRecognitionRequestInfo::decode): * Modules/speech/SpeechRecognitionResultData.h: Added. (WebCore::SpeechRecognitionAlternativeData::encode const): (WebCore::SpeechRecognitionAlternativeData::decode): (WebCore::SpeechRecognitionResultData::encode const): (WebCore::SpeechRecognitionResultData::decode): * Modules/speech/SpeechRecognitionResultList.h: * Modules/speech/SpeechRecognitionUpdate.cpp: Added. (WebCore::convertEnumerationToString): (WebCore::SpeechRecognitionUpdate::create): (WebCore::SpeechRecognitionUpdate::createError): (WebCore::SpeechRecognitionUpdate::createResult): (WebCore::SpeechRecognitionUpdate::SpeechRecognitionUpdate): (WebCore::SpeechRecognitionUpdate::error const): (WebCore::SpeechRecognitionUpdate::result const): * Modules/speech/SpeechRecognitionUpdate.h: Added. (WebCore::SpeechRecognitionUpdate::clientIdentifier const): (WebCore::SpeechRecognitionUpdate::type const): (WebCore::SpeechRecognitionUpdate::encode const): (WebCore::SpeechRecognitionUpdate::decode): (WTF::LogArgument<WebCore::SpeechRecognitionUpdateType>::toString): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/TaskSource.h: * loader/EmptyClients.cpp: (WebCore::pageConfigurationWithEmptyClients): * page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::speechRecognitionConnection): * page/Page.h: * page/PageConfiguration.cpp: (WebCore::PageConfiguration::PageConfiguration): * page/PageConfiguration.h: * page/DummySpeechRecognitionProvider.h: Added. * page/SpeechRecognitionProvider.h: Added. 2020-11-03 Keith Rollin <krollin@apple.com> Include path in generated IDL dependencies https://bugs.webkit.org/show_bug.cgi?id=218480 Reviewed by Brent Fulgham. Changes in Bug 218378 and Bug 217696 have lessened the reliance on VPATH to find files. This means that more places need to be explicit about the locations of their files. This change updates preprocess-idls.pl to include full- and partial-paths when generating dependency information. No new tests -- this is a build system change. * bindings/scripts/preprocess-idls.pl: (RemovePWD): 2020-11-03 Dean Jackson <dino@apple.com> Link against the ANGLE Shared Library https://bugs.webkit.org/show_bug.cgi?id=218539 <rdar://problem/69062211> Reviewed by Tim Horton. Weak link against libANGLE-shared.dylib. * Configurations/WebCore.xcconfig: * Configurations/WebCoreTestSupport.xcconfig: * Sources.txt: Stop compiling ANGLEWebKitBridge. * SourcesGTK.txt: * SourcesWPE.txt: * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::isANGLEAvailable): Add a helper to check if ANGLE loaded properly. (WebCore::GraphicsContextGLOpenGL::create): 2020-11-03 Geoffrey Garen <ggaren@apple.com> Drop most uses of the phrase 'neuter' from the tree https://bugs.webkit.org/show_bug.cgi?id=218536 Reviewed by Tim Horton. In ArrayBuffer use cases, the spec has gone with "detached". In other cases, I picked something. * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::create): (WebCore::AudioBuffer::AudioBuffer): (WebCore::AudioBuffer::hasDetachedChannelBuffer const): * Modules/webaudio/AudioBuffer.h: * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::initialize): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::SerializedScriptValue::create): * html/ImageBitmap.cpp: (WebCore::ImageBitmap::createPromise): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::putImageData): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texImageSourceHelper): * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageDecoder::headerAvailable): 2020-11-03 Wenson Hsieh <wenson_hsieh@apple.com> Adjust some compile-time guards in GraphicsContextCG.cpp https://bugs.webkit.org/show_bug.cgi?id=218534 Reviewed by Tim Horton. Rename `USE_DRAW_PATH_DIRECT` to `HAVE(CG_CONTEXT_DRAW_PATH_DIRECT)`, and delete the associated FIXME comment. Also, put the line segment stroking optimization added in r268240 behind a new compile-time flag, `USE(CG_CONTEXT_STROKE_LINE_SEGMENTS_WHEN_STROKING_PATH)`. Note that we use `USE` rather than `HAVE` for this flag, due to the fact that this API exists on all CoreGraphics platforms (but we only intend to use it in certain configurations). * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::drawPath): (WebCore::GraphicsContext::fillPath): (WebCore::GraphicsContext::strokePath): 2020-11-03 Antoine Quint <graouts@webkit.org> align-content should be a discrete animatable property https://bugs.webkit.org/show_bug.cgi?id=218530 Reviewed by Simon Fraser. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/CSSPropertyAnimation.cpp: (WebCore::DiscretePropertyWrapper::DiscretePropertyWrapper): (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): * rendering/style/StyleContentAlignmentData.cpp: Added. (WebCore::operator<<): * rendering/style/StyleContentAlignmentData.h: 2020-11-03 Rini Patel <rini_patel@apple.com> [GPU Process] Flush canvas displayList from doAfterUpdateRendering https://bugs.webkit.org/show_bug.cgi?id=218401 Reviewed by Simon Fraser. Leverage prepareCanvasesForDisplayIfNeeded() for canvas 2D context to flush the display list items via doAfterUpdateRendering. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createContext2d): (WebCore::HTMLCanvasElement::prepareForDisplay): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::prepareForDisplay): * html/canvas/CanvasRenderingContext2DBase.h: * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::flushDrawingContextAndCommit): 2020-11-03 Wenson Hsieh <wenson_hsieh@apple.com> Replace DisplayList::Recorder::Delegate::(will|did)AppendItem with (will|did)AppendItemOfType https://bugs.webkit.org/show_bug.cgi?id=218518 Reviewed by Simon Fraser. In preparation for larger changes to display lists and display list items in <webkit.org/b/218406>, replace `DisplayList::Recorder::Delegate`'s `willAppendItem` and `didAppendItem` client hooks with `willAppendItemOfType` and `didAppendItemOfType` instead. Once all display list items are no longer ref-counted objects that inherit from `DisplayList::Item`, plumbing these items through virtual client hooks will introduce unnecessary complexity and runtime overhead. Instead, we can refactor these methods to only pass the type of the display list item being appended; this is because all extant clients that implement these hooks only require the item for its `ItemType`. * Headers.cmake: Pull `DisplayList::ItemType` out into a separate header: `DisplayListItemType.h`. This header additionally contains several helper functions (`sizeOfItemInBytes`, `isInlineItem`, and `isDrawingItem`) that operate only on `ItemType`s, rather than items themselves. We will use these helper functions as we work towards <webkit.org/b/218406>. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/displaylists/DisplayList.h: * platform/graphics/displaylists/DisplayListItemType.cpp: Added. (WebCore::DisplayList::sizeOfItemInBytes): (WebCore::DisplayList::isDrawingItem): (WebCore::DisplayList::isInlineItem): * platform/graphics/displaylists/DisplayListItemType.h: Added. * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::willAppendItemOfType): Use the new `DisplayList::isDrawingItem(ItemType)` function here, instead of checking whether the item is a subclass of `DrawingItem`. (WebCore::DisplayList::Recorder::didAppendItemOfType): (WebCore::DisplayList::Recorder::appendItem): (WebCore::DisplayList::Recorder::willAppendItem): Deleted. (WebCore::DisplayList::Recorder::didAppendItem): Deleted. * platform/graphics/displaylists/DisplayListRecorder.h: (WebCore::DisplayList::Recorder::Delegate::willAppendItemOfType): (WebCore::DisplayList::Recorder::Delegate::didAppendItemOfType): (WebCore::DisplayList::Recorder::Delegate::willAppendItem): Deleted. (WebCore::DisplayList::Recorder::Delegate::didAppendItem): Deleted. 2020-11-03 Fujii Hironori <Hironori.Fujii@sony.com> [TextureMapper] Crashed in TextureMapperLayer::paintUsingOverlapRegions https://bugs.webkit.org/show_bug.cgi?id=214817 <rdar://problem/66489090> Reviewed by Don Olmstead. TextureMapperLayer::paintUsingOverlapRegions has the expression `overlapRegion.bounds().size().area()` which crashes for a very large layer. computeOverlapRegions returned very large overlap and non-overlap regions without taking the clip bounds into account. Change computeOverlapRegions to return clipped regions. paintUsingOverlapRegions no longer needs to clip the returned regions. Test: compositing/tiling/huge-layer-with-opacity.html * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeOverlapRegions): (WebCore::TextureMapperLayer::paintUsingOverlapRegions): * platform/graphics/texmap/TextureMapperLayer.h: 2020-11-03 Stephan Szabo <stephan.szabo@sony.com> [WinCairo/PlayStation] ICU 68.1 no longer exposes FALSE and TRUE macros by default https://bugs.webkit.org/show_bug.cgi?id=218522 Reviewed by Don Olmstead. * platform/text/TextCodecICU.cpp: Replace use of TRUE with true 2020-11-03 Said Abou-Hallawa <said@apple.com> [GPU Process] Make ImageBuffer RefCounted https://bugs.webkit.org/show_bug.cgi?id=218472 Reviewed by Simon Fraser. This will allow a better life cycle for the ImageBuffer. * html/CanvasBase.cpp: (WebCore::CanvasBase::setImageBuffer const): * html/CanvasBase.h: * html/CustomPaintCanvas.h: * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::setImageBufferAndMarkDirty): * html/HTMLCanvasElement.h: * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::createBufferForPainting const): * html/HTMLVideoElement.h: * html/ImageBitmap.cpp: (WebCore::ImageBitmap::takeImageBuffer): * html/ImageBitmap.h: * html/ImageBitmapBacking.cpp: (WebCore::ImageBitmapBacking::ImageBitmapBacking): (WebCore::ImageBitmapBacking::takeImageBuffer): * html/ImageBitmapBacking.h: * html/OffscreenCanvas.cpp: (WebCore::DetachedOffscreenCanvas::DetachedOffscreenCanvas): (WebCore::DetachedOffscreenCanvas::takeImageBuffer): (WebCore::OffscreenCanvas::takeImageBuffer const): * html/OffscreenCanvas.h: * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::createCompositingBuffer): * html/canvas/CanvasRenderingContext2DBase.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer): * html/canvas/WebGLRenderingContextBase.h: * html/shadow/MediaControlTextTrackContainerElement.cpp: (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::indexForData): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::snapshotNode): (WebCore::InspectorPageAgent::snapshotRect): * page/Chrome.cpp: (WebCore::Chrome::createImageBuffer const): * page/Chrome.h: * page/ChromeClient.h: (WebCore::ChromeClient::createImageBuffer const): * page/FrameSnapshotting.cpp: (WebCore::snapshotFrameRect): (WebCore::snapshotFrameRectWithClip): (WebCore::snapshotSelection): (WebCore::snapshotNode): * page/FrameSnapshotting.h: * page/PageConsoleClient.cpp: (WebCore::PageConsoleClient::screenshot): * page/TextIndicator.cpp: (WebCore::takeSnapshot): * platform/DragImage.cpp: (WebCore::createDragImageFromSnapshot): * platform/HostWindow.h: * platform/graphics/ConcreteImageBuffer.h: (WebCore::ConcreteImageBuffer::create): * platform/graphics/CrossfadeGeneratedImage.cpp: (WebCore::CrossfadeGeneratedImage::drawPattern): * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawConsumingImageBuffer): * platform/graphics/GraphicsContext.h: (WebCore::GraphicsContext::drawConsumingImageBuffer): * platform/graphics/ImageBuffer.cpp: (WebCore::ImageBuffer::create): (WebCore::ImageBuffer::createCompatibleBuffer): (WebCore::ImageBuffer::copyRectToBuffer): (WebCore::ImageBuffer::sinkIntoNativeImage): (WebCore::ImageBuffer::sinkIntoImage): (WebCore::ImageBuffer::drawConsuming): * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::drawConsuming): * platform/graphics/ImageBufferPipe.h: * platform/graphics/ShadowBlur.cpp: * platform/graphics/cg/PDFDocumentImage.h: * platform/graphics/cocoa/IOSurface.h: * platform/graphics/coreimage/FilterEffectRendererCoreImage.h: * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm: (WebCore::FilterEffectRendererCoreImage::clearResult): * platform/graphics/filters/Filter.h: (WebCore::Filter::setSourceImage): * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::clearResult): * platform/graphics/filters/FilterEffect.h: * platform/graphics/nicosia/NicosiaImageBufferPipe.cpp: (Nicosia::NicosiaImageBufferPipeSource::handle): * platform/graphics/nicosia/texmap/NicosiaGCGLLayer.cpp: (Nicosia::GCGLLayer::swapBuffersIfNeeded): * platform/graphics/texmap/BitmapTexture.cpp: (WebCore::BitmapTexture::updateContents): * platform/mock/MockRealtimeVideoSource.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintFillLayerExtended): * rendering/shapes/Shape.cpp: (WebCore::Shape::createRasterShape): * rendering/svg/RenderSVGImage.cpp: (WebCore::RenderSVGImage::invalidateBufferedForeground): * rendering/svg/RenderSVGImage.h: * rendering/svg/RenderSVGResourceClipper.h: * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::postApplyResource): * rendering/svg/RenderSVGResourceFilter.h: * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::createMaskAndSwapContextForTextGradient): (WebCore::clipToTextMask): (WebCore::RenderSVGResourceGradient::postApplyResource): * rendering/svg/RenderSVGResourceGradient.h: * rendering/svg/RenderSVGResourceMasker.cpp: (WebCore::RenderSVGResourceMasker::applyResource): * rendering/svg/RenderSVGResourceMasker.h: * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::createTileImage const): * rendering/svg/RenderSVGResourcePattern.h: * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::createImageBuffer): (WebCore::SVGRenderingContext::clipToImageBuffer): (WebCore::SVGRenderingContext::bufferForeground): * rendering/svg/SVGRenderingContext.h: * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::nativeImageForCurrentFrame): (WebCore::SVGImage::drawPatternForContainer): 2020-11-03 Jer Noble <jer.noble@apple.com> Protect against HTMLMediaElement being destroyed during disptachEvent(). https://bugs.webkit.org/show_bug.cgi?id=218398 <rdar://problem/67613836> Reviewed by Chris Dumez. Make the MainThreadGenericEventQueue protect the target as well as the owner of the queue. Drive-by fix: Create the scoped `eventFiringScope` object after the `protect` object, to ensure that the member variable set by the first scope will safely occur. Drive-by fix #2: Also null-check the result of document().page() within HTMLMediaElement::dispatchEvent(). * dom/GenericEventQueue.cpp: (WebCore::MainThreadGenericEventQueue::dispatchOneEvent): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::dispatchEvent): 2020-11-03 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r268564, r268957, and r268962. https://bugs.webkit.org/show_bug.cgi?id=218525 Caused 9% binary size increase in WebCore Reverted changesets: "CSSStyleDeclaration breaks JS spec (properties not showing up in Object.getOwnPropertyNames)" https://bugs.webkit.org/show_bug.cgi?id=217623 https://trac.webkit.org/changeset/268564 "Remove support for 'pixel' and 'pos' CSSOM prefixes" https://bugs.webkit.org/show_bug.cgi?id=119712 https://trac.webkit.org/changeset/268957 "Remove non-standard 'css'/'Css' prefixed properties on CSSStyleDeclaration" https://bugs.webkit.org/show_bug.cgi?id=218158 https://trac.webkit.org/changeset/268962 2020-11-03 Wenson Hsieh <wenson_hsieh@apple.com> Replace DisplayList::itemCount with DisplayList::isEmpty https://bugs.webkit.org/show_bug.cgi?id=218517 Reviewed by Geoffrey Garen. In preparation for larger changes to display lists and display list items in <webkit.org/b/218406>, replace `DisplayList::itemCount()` with `DisplayList::isEmpty()`. Once display list items are no longer stored in a Vector of ref-counted items, keeping track of the exact item count will be difficult and introduce unnecessary overhead, especially when reconstructing display lists out of shared memory in the GPU process. Instead, change this to simply return whether or not the display list is empty (i.e. contains at least one item), which is what (nearly) all call sites end up using `itemCount()` to determine anyways. No change in behavior. * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::paintRenderingResultsToCanvas): * platform/graphics/displaylists/DisplayList.h: (WebCore::DisplayList::DisplayList::isEmpty const): (WebCore::DisplayList::DisplayList::itemCount const): Deleted. * platform/graphics/displaylists/DisplayListDrawingContext.cpp: (WebCore::DisplayList::DrawingContext::replayDisplayList): * platform/graphics/displaylists/DisplayListImageBuffer.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListRecorder.h: (WebCore::DisplayList::Recorder::isEmpty const): (WebCore::DisplayList::Recorder::itemCount const): Deleted. * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::Replayer::replay): 2020-11-02 Simon Fraser <simon.fraser@apple.com> Scroll position can get reset after programmatic scroll https://bugs.webkit.org/show_bug.cgi?id=218477 Reviewed by Antti Koivisto. Part of rdar://problem/69599531: Scrolling on netflix.com sometimes jumps to the top. Scrolling thread scroll notifications are handled on the main thread asynchronously, and there are two sources of delay: first, the RunLoop::main().dispatch() in ThreadedScrollingTree::scrollingTreeNodeDidScroll(), and second the zero-delay m_updateNodeScrollPositionTimer in AsyncScrollingCoordinator. This is a problem when doing programmatic scrolls, since the main thread can programmatically scroll, then the above asynchrony means that AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() gets called for an earlier user scroll (or, as is often the case on netflix.com, a scroll triggered by the rubberbanding timer on the scrolling thread). This patches addresses these out-of-order scrolls by storing scrolling thread scroll updates in a threadsafe data structure on the scrolling tree, and always applying those on the main thread before handling other scroll changes. This patch removes the zero-delay timer, which did serve a purpose of coalescing scroll notifications from the scrolling thread and UI process (for iOS). With the patch, we still get coalescing per RunLoop::main().dispatch(). We lose coalescing on iOS, but those notifications should be just once per frame. If we find that it was necessary to coalesce, we can put a timer back. Not testable because it's very timing dependent. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::AsyncScrollingCoordinator): (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate): (WebCore::AsyncScrollingCoordinator::synchronizeStateFromScrollingTree): (WebCore::AsyncScrollingCoordinator::noteScrollingThreadSyncCompleteForNode): (WebCore::AsyncScrollingCoordinator::applyPendingScrollUpdates): (WebCore::AsyncScrollingCoordinator::applyScrollUpdate): (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll): Deleted. (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired): Deleted. * page/scrolling/AsyncScrollingCoordinator.h: (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate): Deleted. (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::matchesUpdateType const): Deleted. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::applyLayerPositionsInternal): (WebCore::ScrollingTree::addPendingScrollUpdate): (WebCore::ScrollingTree::takePendingScrollUpdates): * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::ScrollUpdate::ScrollUpdate): (WebCore::ScrollingTree::ScrollUpdate::canMerge const): (WebCore::ScrollingTree::ScrollUpdate::merge): * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll): 2020-11-03 Sam Weinig <weinig@apple.com> Convert Settings.yaml to match the rough schema of the WebPreferences*.yaml files as a first step toward merging them https://bugs.webkit.org/show_bug.cgi?id=218428 Reviewed by Darin Adler. As the first step toward merging Settings.yaml into the WebPreferences*.yaml files update Settings.yaml better match. This includes: - Fix key names start with capital letters. - A 'type' is now required (no more defaulting to bool) - 'initial' is renamed to defaultValue and gains the same per-frontend structure. This also means we can use PLATFORM() specific default values now rather than requiring the SettingsDefaults.h header, though this patch does not take advantage of that yet. - 'type' must now be 'bool', 'double', 'uint32_t' or 'String'. A new refinedType allows Settings to maintain the more explicit enum types / URL types. - Moves comments into the data structure to make it possible to keep them when manipulating the yaml programatically. - Use webcore prefix for webcore specific keys. - Replace single textAutosizingWindowSizeOverride preference which used an IntSize with TextAutosizingWindowSizeOverrideHeight and TextAutosizingWindowSizeOverrideWidth which are representable by one of the core types. * Scripts/GenerateSettings.rb: * Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb: * Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb: * Scripts/SettingsTemplates/Settings.cpp.erb: * Scripts/SettingsTemplates/Settings.h.erb: * WebCore.xcodeproj/project.pbxproj: * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded): * page/Settings.yaml: * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride): 2020-11-03 Antti Koivisto <antti@apple.com> [LFC][Integration] RenderText::absoluteQuads should use iterator https://bugs.webkit.org/show_bug.cgi?id=218508 Reviewed by Zalan Bujtas. * rendering/InlineBox.h: (WebCore::InlineBox::calculateBoundaries const): Deleted. This function is SVG-specific. To reduce confusion, make it non-virtual and available in SVG inline box classes only. * rendering/InlineTextBox.h: * rendering/RenderText.cpp: (WebCore::boundariesForTextRun): (WebCore::ellipsisRectForTextRun): (WebCore::collectAbsoluteQuads): (WebCore::RenderText::absoluteQuadsClippedToEllipsis const): (WebCore::RenderText::absoluteQuads const): (WebCore::RenderText::absoluteQuadsForRange const): (WebCore::RenderText::collectSelectionRectsForLineBoxes): Also inline selectionRectForRange/collectSelectionRectsForRange to the only caller here and make it use iterator. (WebCore::collectAbsoluteQuadsForNonComplexPaths): Deleted. * rendering/RenderTextLineBoxes.cpp: (WebCore::ellipsisRectForBox): Deleted. (WebCore::RenderTextLineBoxes::selectionRectForRange): Deleted. (WebCore::RenderTextLineBoxes::collectSelectionRectsForRange): Deleted. (WebCore::RenderTextLineBoxes::absoluteQuads const): Deleted. * rendering/RenderTextLineBoxes.h: (): Deleted. * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::floatLinesBoundingBox const): (WebCore::RenderSVGInlineText::positionForPoint): (WebCore::RenderSVGInlineText::firstTextBox const): * rendering/svg/RenderSVGInlineText.h: * rendering/svg/SVGInlineFlowBox.cpp: (WebCore::SVGInlineFlowBox::calculateBoundaries const): * rendering/svg/SVGInlineFlowBox.h: * rendering/svg/SVGInlineTextBox.h: 2020-11-03 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Use "isConsideredEmpty" instead of "isVisuallyEmpty" https://bugs.webkit.org/show_bug.cgi?id=218475 Reviewed by Antti Koivisto. In certain cases the line may look visually empty, but still considered non-empty when computing the line box geometry. Use a more precise term to indicated whether the line is empty. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::build): (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::shouldInlineLevelBoxStretchLineBox const): * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::initialize): (WebCore::Layout::Line::removeTrailingTrimmableContent): (WebCore::Layout::Line::append): (WebCore::Layout::Line::appendTextContent): (WebCore::Layout::Line::isRunConsideredEmpty const): (WebCore::Layout::Line::isRunVisuallyNonEmpty const): Deleted. * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::isConsideredEmpty const): (WebCore::Layout::Line::isVisuallyEmpty const): Deleted. * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::LineBox): (WebCore::Layout::m_isConsideredEmpty): (WebCore::Layout::m_isLineVisuallyEmpty): Deleted. * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::isConsideredEmpty const): (WebCore::Layout::LineBox::isLineVisuallyEmpty const): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::layoutInlineContent): (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): * layout/inlineformatting/InlineLineBuilder.h: 2020-11-03 Zalan Bujtas <zalan@apple.com> [LFC] showInlineTreeAndRuns should print the inline level boxes in visual order https://bugs.webkit.org/show_bug.cgi?id=218478 Reviewed by Antti Koivisto. * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::rootInlineBox const): (WebCore::Layout::LineBox::nonRootInlineLevelBoxes const): (WebCore::Layout::LineBox::rootInlineBox): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::showInlineTreeAndRuns): 2020-11-03 Youenn Fablet <youenn@apple.com> REGRESSION (r269244?): ASSERTION FAILED: m_idHashSalt.isEmpty() || m_idHashSalt == salt in WebCore::Document::setDeviceIDHashSalt https://bugs.webkit.org/show_bug.cgi?id=218458 <rdar://problem/70963733> Reviewed by Eric Carlson. Remove no longer needed code. * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::allow): * dom/Document.cpp: * dom/Document.h: (WebCore::Document::hasHadCaptureMediaStreamTrack const): 2020-11-03 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes, early November 2020 edition https://bugs.webkit.org/show_bug.cgi?id=218464 Unreviewed non-unified build fixes. No new tests needed. * editing/VisibleUnits.cpp: Add missing InlineRunAndOffset.h header. * inspector/InspectorFrontendAPIDispatcher.cpp: Add missing InspectorController.h and wtf/RunLoop.h headers. (WebCore::InspectorFrontendAPIDispatcher::frontendGlobalObject): Add missing JSC:: namespace to usage of JSC::JSGlobalObject type. * layout/integration/LayoutIntegrationLineIterator.cpp: Add missing RenderBlockFlow.h header. * rendering/RenderBlockFlow.cpp: Add missing LayoutIntegrationRunIterator.h header. 2020-11-03 Youenn Fablet <youenn@apple.com> Allow low latency H264 encoder in GPUProcess https://bugs.webkit.org/show_bug.cgi?id=218442 Reviewed by Eric Carlson. Pass useLowLatency boolean when creating encoder factory. Manually tested. * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): 2020-11-02 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer] Fix GStreamerCommon.cpp debug category https://bugs.webkit.org/show_bug.cgi?id=218392 Reviewed by Adrian Perez de Castro. GStreamerCommon.cpp lacked a default debug category so debug from that file was not appearing under the WebKit category but empty. * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::initializeGStreamer): 2020-11-02 Chris Dumez <cdumez@apple.com> Crash under WebGLRenderingContextBase::scheduleTaskToDispatchContextLostEvent() https://bugs.webkit.org/show_bug.cgi?id=218474 Reviewed by Geoffrey Garen. After r269227, event loop tasks can get executed even after the script execution context has been stopped. This introduce a flaky crash under: WebGLRenderingContextBase::scheduleTaskToDispatchContextLostEvent() This patch updates the function to not attempt to dispatch the event after the context has been stopped. No new tests, covered by the following tests that are flaky crashing in debug: - webgl/1.0.3/conformance/glsl/misc/non-ascii-comments.vert.html - webgl/2.0.0/conformance/glsl/bugs/sampler-array-using-loop-index.html * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::scheduleTaskToDispatchContextLostEvent): 2020-11-02 Chris Dumez <cdumez@apple.com> REGRESSION (r269214): ASSERTION FAILED: m_state == CLOSED in WebCore::EventSource::abortConnectionAttempt https://bugs.webkit.org/show_bug.cgi?id=218457 <rdar://problem/70963581> Reviewed by Geoffrey Garen. When EventSource::didFail() gets called with an AccessControl error, it calls abortConnectionAttempt() which cancels the load (by calling doExplicitLoadCancellation()). The expectation is that cancelling the load will cause EventSource::didFail() to get called again, this time with a cancellation error, which will set m_state to CLOSED. We're hitting the assertion because EventSource::didFail() is not getting called with a cancellation error when the loader is a WorkerThreadableLoader and thus m_state is not set to CLOSED as expected. The reason for this is that MainThreadBridge::cancel() would return early and not call ThreadableLoaderClientWrapper::didFail() if ThreadableLoaderClientWrapper::done() returns true. ThreadableLoaderClientWrapper::done() returns true when ThreadableLoaderClientWrapper::didFail() was already called previously, which is what's happening in our test. To address the issue, MainThreadBridge::cancel() now calls ThreadableLoaderClientWrapper::didFail() no matter what. This ensures consistency with the DocumentThreadableLoader. No new tests, covered by existing test crashing on the bots. * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::MainThreadBridge::cancel): 2020-11-02 Chris Dumez <cdumez@apple.com> Regression(r269227) imported/w3c/web-platform-tests/service-workers/service-worker/referrer-toplevel-script-fetch.https.html is a flaky crash https://bugs.webkit.org/show_bug.cgi?id=218468 <rdar://problem/70969071> Reviewed by Darin Adler. Code in ServiceWorkerContainer::ready() was queueing an event loop task and then dereferencing scriptExecutionContext() in the task. This is no longer safe after r269227 since tasks may still be run after ActiveDOMObjects have been stopped. To address the issue, we need to null check the scriptExecutionContext. No new tests, covered by existing test. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::ready): 2020-11-02 Devin Rousso <drousso@apple.com> guard UIScribbleInteraction class property observing behind a LOA check https://bugs.webkit.org/show_bug.cgi?id=218463 <rdar://problem/70747966> Reviewed by Tim Horton. Some apps appear to swizzle `-[NSObject addObserver:forKeyPath:options:context:]` without support for the fact that the object can be a class rather than an instance and therefore crash. Use a LOA check to guard observing `+[UIScribbleInteraction isPencilInputExpected]` so that this doesn't happen, but only until the apps update, at which point they can fix it. * platform/cocoa/VersionChecks.h: This appears to be the first instance of observing a class property, so add a new version value for `FirstThatObservesClassProperty`. 2020-11-02 Chris Dumez <cdumez@apple.com> REGRESSION (r269227): Crash in WebCore::WorkerOrWorkletGlobalScope::prepareForDestruction https://bugs.webkit.org/show_bug.cgi?id=218455 <rdar://problem/70963191> Reviewed by Geoffrey Garen. Document::willBeRemovedFromFrame() may have the same PaintWorkletGlobalScope instance more than once in its m_paintWorkletGlobalScopes HashMap, under different keys. As a result, it may call PaintWorkletGlobalScope::prepareForDestruction() more than once on the same instance. This was causing issues because EventLoopTaskGroup::markAsReadyToStop(), when called the second time, would move the state from Stopped and back to ReadyToStop, which is unexpected. To address the issue, EventLoopTaskGroup::markAsReadyToStop() now returns early if the state is "Stopped". Also, I added a boolean check in PaintWorkletGlobalScope's prepareForDestruction() to make sure we only do the work once per instance. No new tests, covered by existing tests. * dom/EventLoop.h: (WebCore::EventLoopTaskGroup::markAsReadyToStop): * worklets/PaintWorkletGlobalScope.h: 2020-11-02 Alan Bujtas <zalan@apple.com> Unreviewed, reverting r269245. 3 LFC tests asserting in WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree Reverted changeset: "[LFC][IFC] Empty lines stay empty even when the imaginary strut is present" https://bugs.webkit.org/show_bug.cgi?id=218420 https://trac.webkit.org/changeset/269245 2020-11-02 Antti Koivisto <antti@apple.com> [LFC][Integration] RenderText::absoluteQuadsForRange should use iterator https://bugs.webkit.org/show_bug.cgi?id=218444 Reviewed by Zalan Bujtas. Add the required iterator support and convert absoluteQuadsForRange to use it. This eliminates ensureLineBoxes from two places. * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::PathTextRun::isSelectable const): (WebCore::LayoutIntegration::PathTextRun::selectionRect const): * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: (WebCore::LayoutIntegration::RunIteratorLegacyPath::isSelectable const): (WebCore::LayoutIntegration::RunIteratorLegacyPath::selectionRect const): * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::offsetForPosition const): (WebCore::LayoutIntegration::RunIteratorModernPath::isSelectable const): (WebCore::LayoutIntegration::RunIteratorModernPath::selectionRect const): (WebCore::LayoutIntegration::RunIteratorModernPath::clampedOffset const): (WebCore::LayoutIntegration::RunIteratorModernPath::createTextRun const): * rendering/RenderText.cpp: (WebCore::RenderText::absoluteRectsForRange const): (WebCore::localQuadForTextRun): (WebCore::RenderText::absoluteQuadsForRange const): * rendering/RenderTextLineBoxes.cpp: (WebCore::localQuadForTextBox): Deleted. (WebCore::RenderTextLineBoxes::absoluteQuadsForRange const): Deleted. (WebCore::RenderTextLineBoxes::absoluteRectsForRange const): Deleted. * rendering/RenderTextLineBoxes.h: 2020-11-02 Chris Dumez <cdumez@apple.com> [ macOS ] webaudio/OfflineAudioContext/onstatechange.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=217543 <rdar://problem/70160122> Reviewed by Alex Christensen. No new tests, unskipped existing test. * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::startRendering): After offline rendering on the audio thread and we go back to the main thread, make sure we queue a task of the event loop to fire the statechange and completion events. We were previously failing to do so and that meant that the ordering with other main thread events (which were queued on the event loop) was not always correct. 2020-11-01 Darin Adler <darin@apple.com> Start removing functions that implicitly use composed tree https://bugs.webkit.org/show_bug.cgi?id=218424 Reviewed by Ryosuke Niwa. Tests: fast/dom/rangeContainsNode.html fast/dom/rangeContainsRange.html fast/dom/treeOrder.html Ryosuke pointed out that most clients should not be using the composed tree, so this is a step in work to make the use of the composed tree explicit. After that we can more easily find and correct call sites where use of the composed tree is incorrect. Likely that most or all cases of treeOrder<ComposedTree> can be changed to just treeOrder and contains<ComposedTree> to just contains; will do those in follow-ups. * Modules/highlight/Highlight.cpp: (WebCore::repaintRange): Simplified code to use boundary points, and changed to use treeOrder<ComposedTree>. * dom/AbstractRange.h: Export makeSimpleRange so it can be used in Internals. * dom/AbstractRange.idl: Export the class so it can be used in Internals. * dom/Node.cpp: (WebCore::parent<ShadowIncludingTree>): Added. (WebCore::treeOrderForTesting): Added. (WebCore::documentOrder): Deleted. * dom/Node.h: Updated for the above. * dom/RadioButtonGroups.cpp: (WebCore::RadioButtonGroup::members const): Use treeOrder<ComposedTree>. * dom/SimpleRange.cpp: (WebCore::contains): Removed a couple contains functions that implicitly use composed tree. (WebCore::containsForTesting): Added. * dom/SimpleRange.h: Updated for the above. Should also make contains<Tree> the default and remove the <Tree> at all call sites, but it's safer to do that in a separate patch after this is landed and builds on all platforms. * editing/Editing.cpp: (WebCore::isNodeVisiblyContainedWithin): Use contains<ComposedTree>. * page/DragController.cpp: (WebCore::DragController::draggableElement const): Ditto. * page/EventHandler.cpp: (WebCore::EventHandler::dispatchMouseEvent): Ditto. Note that this has a call to isDescendantOf right next to it, which does not use the composed tree. * page/Page.cpp: (WebCore::Page::findTextMatches): Use treeOrder<ComposedTree>. (WebCore::replaceRanges): Ditto. * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): Use contains<ComposedTree>. * testing/Internals.cpp: (WebCore::string): Added. (WebCore::convertType): Added. (WebCore::Internals::treeOrder): Added. (WebCore::Internals::rangeContainsNode): Added. (WebCore::Internals::rangeContainsRange): Added. * testing/Internals.h: Updated for added functions above. * testing/Internals.idl: Ditto. These functions were tested in a TestWebKitAPI test, but we plan to move those types of tests to internals-based tests instead. 2020-11-02 Martin Robinson <mrobinson@igalia.com> [GLIB] REGRESSION(r269144) imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-scrollMargin.html is failing https://bugs.webkit.org/show_bug.cgi?id=218358 Reviewed by Simon Fraser. Finish some missing pieces of exposing scroll-margin when ENABLE_SCROLL_SNAP is off. This allows non-scroll-snap ports to use scroll-margin. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): Move scroll margin code out of the ENABLE_SCROLL_SNAP block. * css/CSSProperties.json: Remove ENABLE_SCROLL_SNAP requirement for scroll-margin properties. * css/StyleProperties.cpp: (WebCore::StyleProperties::getPropertyValue const): Move scroll-margin code out of ENABLE_SCROLL_MARGIN block. (WebCore::StyleProperties::asText const): Ditto. * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Ditto. (WebCore::CSSPropertyParser::parseShorthand): Ditto. 2020-11-02 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Empty lines stay empty even when the imaginary strut is present https://bugs.webkit.org/show_bug.cgi?id=218420 Reviewed by Antti Koivisto. Use the more correct runs.isEmpty() check to decide whether the root inline box should stay empty. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): 2020-11-02 Youenn Fablet <youenn@apple.com> Stop sending origins from WebProcess to UIProcess for getUserMedia requests https://bugs.webkit.org/show_bug.cgi?id=218192 Reviewed by Eric Carlson. No change of behavior, move UserMediaRequestIdentifier in its own header. Covered by existing tests. * Headers.cmake: * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::userMediaDocumentOrigin const): Deleted. (WebCore::UserMediaRequest::topLevelDocumentOrigin const): Deleted. * Modules/mediastream/UserMediaRequest.h: * Modules/mediastream/UserMediaRequestIdentifier.h: * WebCore.xcodeproj/project.pbxproj: 2020-11-01 Mason Xiao <me@masonx.ca> REGRESSION (r252689): box-shadow with inset and negative spread renders incorrectly https://bugs.webkit.org/show_bug.cgi?id=209930 Reviewed by Simon Fraser. r252689 introduced a typo when refactoring the calculation of xOffset. Instead of subtracting the shadowSpread, it was added. This caused issues when the shadowSpread was greater than approximately half of the enclosing element's width. Test: fast/box-shadow/negative-inset-box-shadow.html * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintBoxShadow): Change sign of shadowSpread in xOffset calculation for inset 2020-11-01 Simon Fraser <simon.fraser@apple.com> [LFC Display] Pass deviceScaleFactor around with GraphicsContext at paint time https://bugs.webkit.org/show_bug.cgi?id=218423 Reviewed by Zalan Bujtas. Border painting code will need to use deviceScaleFactor at paint time, so make a small struct that bundles GraphicsContext& and deviceScaleFactor together, and pass that to paint functions. * WebCore.xcodeproj/project.pbxproj: * display/DisplayLayerController.cpp: (WebCore::Display::LayerController::RootLayerClient::paintContents): * display/css/DisplayBoxPainter.cpp: (WebCore::Display::BoxPainter::paintFillLayer): (WebCore::Display::BoxPainter::paintBackgroundImages): (WebCore::Display::BoxPainter::paintBoxDecorations): (WebCore::Display::BoxPainter::paintBoxContent): (WebCore::Display::BoxPainter::paintBox): * display/css/DisplayBoxPainter.h: * display/css/DisplayCSSPainter.cpp: (WebCore::Display::CSSPainter::recursivePaintDescendants): (WebCore::Display::CSSPainter::paintStackingContext): (WebCore::Display::CSSPainter::paintTree): * display/css/DisplayCSSPainter.h: * display/css/DisplayPaintingContext.h: Copied from Source/WebCore/display/css/DisplayBoxPainter.h. 2020-11-01 Zalan Bujtas <zalan@apple.com> [LegacyInlineLayout] Remove collapsible trailing whitespace when it is followed by a hard line break https://bugs.webkit.org/show_bug.cgi?id=216902 <rdar://problem/69812136> Reviewed by Darin Adler. Ignore collapsible trailing whitespace followed by hard linebreak while computing the preferred width. Such content is input to the trimming logic, and it should be handled accordingly. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const): 2020-11-01 Tyler Wilcock <twilco.o@protonmail.com> background-size should not accept negative values https://bugs.webkit.org/show_bug.cgi?id=183990 Reviewed by Darin Adler. Reject negative background-size length-percentage values, as these are explicitly disallowed by the spec. https://www.w3.org/TR/2017/CR-css-backgrounds-3-20171017/#the-background-size Change is covered by existing tests that now pass. * css/parser/CSSPropertyParser.cpp: (WebCore::consumeBackgroundSize): Reject negative length-percentage values as is mandated by the spec. 2020-11-01 Chris Fleizach <cfleizach@apple.com> AX: Provide build workaround while isSystemVoice is not in all SDKs https://bugs.webkit.org/show_bug.cgi?id=218414 Reviewed by Tim Horton. * platform/ios/PlatformSpeechSynthesizerIOS.mm: (WebCore::PlatformSpeechSynthesizer::initializeVoiceList): 2020-11-01 Zalan Bujtas <zalan@apple.com> [LFC][IFC] InlineLevelBox logical rect should only be accessed through LineBox https://bugs.webkit.org/show_bug.cgi?id=218418 Reviewed by Antti Koivisto. InlineLevelBox logical rect is relative to the parent inline box. Calling InlineLevelBox::logicalRect and expect a line relative rect is an easy mistake to make (and one I made myself). Only the LineBuilder and the LineBox should really need access to the relative rect, others should continue to use LineBox::logicalRectForInlineLevelBox. * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::logicalRectForInlineLevelBox const): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineLevelBox::logicalTop const): (WebCore::Layout::LineBox::InlineLevelBox::logicalBottom const): (WebCore::Layout::LineBox::InlineLevelBox::logicalLeft const): (WebCore::Layout::LineBox::InlineLevelBox::logicalWidth const): (WebCore::Layout::LineBox::InlineLevelBox::logicalHeight const): (WebCore::Layout::LineBox::InlineLevelBox::logicalRect const): Deleted. 2020-11-01 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Set the descent layout bounds for atomic inline level boxes https://bugs.webkit.org/show_bug.cgi?id=218421 Reviewed by Antti Koivisto. In most cases the layout bounds descent is 0, but in case of inline-block (or inline table) the decent value may be greater than 0. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): 2020-10-31 Zalan Bujtas <zalan@apple.com> [LFC][Integration] LineIteratorModernPath::top/bottom map to Line::enclosingRect::top/bottom https://bugs.webkit.org/show_bug.cgi?id=218415 Reviewed by Antti Koivisto. Line::enclosingRect includes all the inline level boxes on the line. * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::LineIteratorModernPath::top const): (WebCore::LayoutIntegration::LineIteratorModernPath::bottom const): (WebCore::LayoutIntegration::LineIteratorModernPath::selectionTop const): (WebCore::LayoutIntegration::LineIteratorModernPath::selectionTopForHitTesting const): (WebCore::LayoutIntegration::LineIteratorModernPath::selectionBottom const): (WebCore::LayoutIntegration::LineIteratorModernPath::lineBoxTop const): (WebCore::LayoutIntegration::LineIteratorModernPath::lineBoxBottom const): (WebCore::LayoutIntegration::LineIteratorModernPath::y const): 2020-10-31 Simon Fraser <simon.fraser@apple.com> Clean up BoxSide and BorderEdge code https://bugs.webkit.org/show_bug.cgi?id=218197 Reviewed by Sam Weinig. Change border-drawing functions in RenderBoxModelObject which took BorderEdge[] to use RectEdges<BorderEdge>. In addition, make BoxSide an enum class, and remove the redundant PhysicalBoxSide. Also make BorderEdgeFlags an OptionSet<>. I renamed PhysicalBoxSide to BoxSide because "physical" is a loaded term (it could mean either locally top/right/bottom/left, or refer to absolute "physical coordinates"). This allowed BoxSide to be used in RectEdges, therefore making RectEdges<BorderEdge> the right way to represent the set of edges for a box. An equivalent set of bit flags, BoxSideFlag, allows use in an OptionSet<>. Use more enumeration of sides in the border painting code. * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::rootMargin const): * platform/RectEdges.h: (WebCore::RectEdges::at): (WebCore::RectEdges::top): (WebCore::RectEdges::right): (WebCore::RectEdges::bottom): (WebCore::RectEdges::left): (WebCore::RectEdges::at const): (WebCore::RectEdges::top const): (WebCore::RectEdges::right const): (WebCore::RectEdges::bottom const): (WebCore::RectEdges::left const): (WebCore::RectEdges::setAt): (WebCore::RectEdges::setTop): (WebCore::RectEdges::setRight): (WebCore::RectEdges::setBottom): (WebCore::RectEdges::setLeft): * platform/text/WritingMode.h: (WebCore::isHorizontalPhysicalSide): (WebCore::mirrorPhysicalSide): (WebCore::rotatePhysicalSide): (WebCore::mapLogicalSideToPhysicalSide): * rendering/BorderEdge.cpp: (WebCore::borderEdges): (WebCore::BorderEdge::getBorderEdgeInfo): Deleted. * rendering/BorderEdge.h: (WebCore::edgeFlagForSide): (WebCore::includesEdge): (WebCore::includesAdjacentEdges): * rendering/RenderBoxModelObject.cpp: (WebCore::borderWillArcInnerEdge): (WebCore::borderStyleHasUnmatchedColorsAtCorner): (WebCore::colorsMatchAtCorner): (WebCore::colorNeedsAntiAliasAtCorner): (WebCore::willBeOverdrawn): (WebCore::joinRequiresMitre): (WebCore::calculateAdjustedInnerBorder): (WebCore::RenderBoxModelObject::paintOneBorderSide): (WebCore::calculateSideRect): (WebCore::RenderBoxModelObject::paintBorderSides): (WebCore::RenderBoxModelObject::paintTranslucentBorderSides): (WebCore::RenderBoxModelObject::paintBorder): (WebCore::RenderBoxModelObject::drawBoxSideFromPath): (WebCore::RenderBoxModelObject::clipBorderSidePolygon): (WebCore::RenderBoxModelObject::borderObscuresBackgroundEdge const): (WebCore::RenderBoxModelObject::borderObscuresBackground const): * rendering/RenderBoxModelObject.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::drawLineForBoxSide const): (WebCore::RenderElement::paintOutline): * rendering/RenderInline.cpp: (WebCore::RenderInline::paintOutlineForLine): * rendering/RenderMultiColumnSet.cpp: (WebCore::RenderMultiColumnSet::paintColumnRules): * rendering/RenderObject.cpp: (WebCore::RenderObject::calculateBorderStyleColor): * rendering/RenderObjectEnums.h: * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::paintCollapsedBorders): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::offsetTopForRowGroupBorder): (WebCore::RenderTableSection::paintRowGroupBorderIfRequired): (WebCore::physicalBorderForDirection): * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): * rendering/style/NinePieceImage.h: (WebCore::imagePieceHorizontalSide): (WebCore::imagePieceVerticalSide): 2020-10-31 Chris Dumez <cdumez@apple.com> Promises returned by our DOM API have the caller's global instead of the callee's https://bugs.webkit.org/show_bug.cgi?id=218363 Reviewed by Darin Adler and Ryosuke Niwa. Promises returned by our DOM APIs were using the caller's global instead of the callee's global. This behavior was inconsistent with Chrome and Firefox, and was causing failures in web-platform-tests. Because the global of the promise was wrong, the global of the values passed when settling the promise (e.g. the global of the exception used to reject a promise) was also wrong. This patch fixes this. After fixing the global of DOM promises, some tests started failing because they expect the promises coming from subframes to still get settled *after* their iframe has been removed from the document. Such promises get settled properly in Firefox and Chrome. They also used to settle properly in WebKit because we were incorrectly using the caller's global. The issue was that after an iframe gets detached, Document::stopActiveDOMObjects() would get called, which would stop the EventLoopTaskGroup associated with the document and clear all pending tasks from this group in the event loop. To address this, when a Document::stopActiveDOMObjects(), we now mark the Document's EventLoopTaskGroup as "ready to stop" instead of stopping it. Only once ALL groups in the EventLoop are ready to stop, do we actually stop all those groups. This is important because each document has its own group but all documents of similar origins share the same EventLoop. Tests: fast/js-promise-from-detached-iframe.html http/tests/eventloop/promise-from-cross-origin-detached-iframe.html webaudio/promise-global-object.html * bindings/js/JSDOMPromiseDeferred.h: (WebCore::DeferredPromise::shouldIgnoreRequestToFulfill const): (WebCore::callPromiseFunction): * dom/Document.cpp: (WebCore::Document::stopActiveDOMObjects): (WebCore::Document::eventLoop): * dom/EventLoop.cpp: (WebCore::EventLoop::registerGroup): (WebCore::EventLoop::unregisterGroup): (WebCore::EventLoop::stopAssociatedGroupsIfNecessary): * dom/EventLoop.h: (WebCore::EventLoopTaskGroup::EventLoopTaskGroup): (WebCore::EventLoopTaskGroup::~EventLoopTaskGroup): (WebCore::EventLoopTaskGroup::isReadyToStop const): (WebCore::EventLoopTaskGroup::markAsReadyToStop): (WebCore::EventLoopTaskGroup::stopAndDiscardAllTasks): * workers/WorkerOrWorkletGlobalScope.cpp: (WebCore::WorkerOrWorkletGlobalScope::prepareForDestruction): 2020-10-31 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Split inline level box alignment process into multiple phases https://bugs.webkit.org/show_bug.cgi?id=218397 Reviewed by Antti Koivisto. Inline level box alignment inside the line box is described at https://www.w3.org/TR/css-inline-3/#line-layout. The alignment process involves 3 distinct steps: 1. Computing the line box's logical height. This step solely uses the layout bounds geometry of the inline level boxes. 2. Finding the root inline box vertical position. This step is somewhat similar to the final, alignment phase but instead of the logical top, here we compute the baseline offsets. It helps to figure out the root inline box's baseline positing inside the line box. 3. Aligning the inline level boxes by computing their logical top position. These 3 steps are implemented by the following 3 functions: 1. computeLineBoxLogicalHeight() 2. computeRootInlineBoxVerticalPosition() 3. alignInlineLevelBoxes() While some of the code in these functions may look redundant, they work with different type of geometries (layout bounds vs. normal ascent/descent/logical height). * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::setVerticalGeometryForInlineBox const): (WebCore::Layout::LineBoxBuilder::alignInlineLevelBoxesVerticallyAndComputeLineBoxHeight): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::logicalRectForTextRun const): (WebCore::Layout::LineBox::logicalRectForInlineLevelBox const): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineLevelBox::style const): (WebCore::Layout::LineBox::InlineLevelBox::fontMetrics const): Deleted. 2020-10-31 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Generate RootInlineBox::lineTop/lineBottom matching geometries https://bugs.webkit.org/show_bug.cgi?id=218412 Reviewed by Antti Koivisto. Line::enclosingRect's y() and maxY() match RootInlineBox::lineTop() and lineBottom() vertical coordinates. It is required by the line iterator as some clients are apparently interested in the overflown area. * layout/integration/LayoutIntegrationLine.h: (WebCore::LayoutIntegration::Line::Line): (WebCore::LayoutIntegration::Line::enclosingRect const): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): * layout/integration/LayoutIntegrationPagination.cpp: (WebCore::LayoutIntegration::makeAdjustedContent): 2020-10-31 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Rename ContainerStart/End to InlineBoxStart/End https://bugs.webkit.org/show_bug.cgi?id=218410 Reviewed by Antti Koivisto. ContainerStart/End inline items are triggered by inline boxes. "An inline box is one that is both inline-level and whose contents participate in its containing inline formatting context." * layout/inlineformatting/InlineContentBreaker.cpp: (WebCore::Layout::isTextContent): (WebCore::Layout::isVisuallyEmptyWhitespaceContent): (WebCore::Layout::isNonContentRunsOnly): (WebCore::Layout::InlineContentBreaker::processOverflowingTextContent const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentIfNeeded): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::collectHangingTrailingWhitespaceContent): (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): * layout/inlineformatting/InlineItem.h: (WebCore::Layout::InlineItem::isInlineBoxStart const): (WebCore::Layout::InlineItem::isInlineBoxEnd const): (WebCore::Layout::InlineItem::isContainerStart const): Deleted. (WebCore::Layout::InlineItem::isContainerEnd const): Deleted. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::visuallyCollapsePreWrapOverflowContent): (WebCore::Layout::Line::append): (WebCore::Layout::Line::appendInlineBoxStart): (WebCore::Layout::Line::appendInlineBoxEnd): (WebCore::Layout::Line::appendTextContent): (WebCore::Layout::Line::isRunVisuallyNonEmpty const): (WebCore::Layout::Line::TrimmableTrailingContent::remove): (WebCore::Layout::Line::appendInlineContainerStart): Deleted. (WebCore::Layout::Line::appendInlineContainerEnd): Deleted. * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::Run::isInlineBoxStart const): (WebCore::Layout::Line::Run::isInlineBoxEnd const): (WebCore::Layout::Line::Run::isContainerStart const): Deleted. (WebCore::Layout::Line::Run::isContainerEnd const): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineCandidate::InlineContent::appendInlineItem): (WebCore::Layout::LineBuilder::inlineItemWidth const): (WebCore::Layout::LineBuilder::nextContentForLine): (WebCore::Layout::LineBuilder::nextWrapOpportunity const): 2020-10-30 Chris Dumez <cdumez@apple.com> Usage of allWorkletGlobalScopesSet() in WorkletGlobalScope is not thread-safe https://bugs.webkit.org/show_bug.cgi?id=218408 Reviewed by Geoff Garen. The WorkletGlobalScope constructor / destructor were adding / removing themselves in allWorkletGlobalScopesSet(), without locking. This used to be safe when we only had paint worklets, because those are main-thread only. However, AudioWorketGlobalScopes get constructed / destroyed on background thread so this is no longer safe. Since this is only used by Internals for layout tests to figure out how many worklet instances are alive, I replaced the map with an std::atomic<unsigned>. No new tests, found when running existing tests with GuardMalloc. * testing/Internals.cpp: (WebCore::Internals::isAnyWorkletGlobalScopeAlive const): * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): (WebCore::WorkletGlobalScope::~WorkletGlobalScope): (WebCore::WorkletGlobalScope::numberOfWorkletGlobalScopes): * worklets/WorkletGlobalScope.h: 2020-10-29 Myles C. Maxfield <mmaxfield@apple.com> [Cocoa] [GPU Process] Perform image decoding of color fonts in the Web Process https://bugs.webkit.org/show_bug.cgi?id=217506 Reviewed by Simon Fraser. Core Text itself doesn't know how to draw things; it has to rely on Core Graphics to do that. However, Core Graphics only understands the simplest of text drawing concepts; it doesn't understand things like color fonts or emoji. Core Text sits between the application and Core Graphics, and is responsible for splitting up an arbitrary draw command into individual simple pieces which Core Graphics can understand. For example, when you ask Core Text to draw a string which is of the form "outlines emoji outlines", Core Text will end up telling Core Graphics to draw the first outlines, then draw the emoji image (using Core Graphics's normal image drawing routines), then draw the remaining outlines. This is exactly the same kind of filtering we want to do for the GPU Process. We want to be able to separate out the glyphs which are rendered using outlines from the emoji glyphs which are rendered using images. We want to handle the image glyphs ourself in WebKit using our own image drawing display list facilities, which will cause images to be decoded in the Web Process, thereby increasing the security of the GPU Process. So, this patch implements a custom CGContext, backed by a function table that is populated in WebKit. We pass this custom CGContext into Core Text, which does its normal splitting up of outlines / images, and calls glyph / image drawing functions on our CGContext. Because these functions are implemented by WebKit, this effectively makes WebKit able to intercept the drawing calls, and implement them ourself by appending items to the current display list. So, when Core Text tells our CGContext to draw an emoji, our callback runs and we "just" append a DrawImage display list item. I use scare-quotes around "just" because it is a bit more complicated than that. Core Text internally can change the fill/stroke color (for COLR glyphs), the text matrix (it should be updated between adjacent runs), the CTM, and the shadow state (because Core Text sometimes will implement shadows itself by just drawing the text two times). So, in our CGContext callback, we have to look at the state of the CGContext, figure out if anything changed (because we're not notified when changes happen), and if things did change, append additional display list items to make a parallel change happen at draw time. Tests added in https://trac.webkit.org/r269177 * Headers.cmake: * PlatformAppleWin.cmake: * PlatformWinCairo.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/FreeType.cmake: * platform/graphics/cg/ImageBufferCGBackend.cpp: (WebCore::ImageBufferCGBackend::setupContext): * platform/graphics/coretext/FontCascadeCoreText.cpp: (WebCore::fillVectorWithHorizontalGlyphPositions): * platform/graphics/displaylists/DisplayListDrawGlyphsRecorder.h: Added. * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp: Added. (WebCore::DisplayList::beginLayer): VTable callback for creating a transparency layer. (WebCore::DisplayList::endLayer): Ditto for ending a transparency layer. (WebCore::DisplayList::drawGlyphs): VTable callback for drawing outline glyphs. (WebCore::DisplayList::drawImage): VTable callback for drawing an image. (WebCore::DisplayList::DrawGlyphsRecorder::createInternalContext): Set up the custom CGContext infrastructure. Hook up the VTable callbacks. (WebCore::DisplayList::DrawGlyphsRecorder::DrawGlyphsRecorder): (WebCore::DisplayList::DrawGlyphsRecorder::populateInternalState): We need to save the GraphicsContext state at the beginning of the entry point, so we can restore anything that changed when we're done. (WebCore::DisplayList::DrawGlyphsRecorder::populateInternalContext): Because Core Text internally interrogates the CGContext to see if it needs to do things like draw shadows itself, we need to make sure that the recorder's state is mirrored in our custom CGContext. This applies all the relevant state to our CGContext so it's ready when Core Text asks for it. (WebCore::DisplayList::DrawGlyphsRecorder::prepareInternalContext): Call the above two functions. (WebCore::DisplayList::DrawGlyphsRecorder::concludeInternalContext): Called once when we're done. This function cleans up, by possibly appending additional display list items to restore the state back to what it was when we started. (WebCore::DisplayList::DrawGlyphsRecorder::updateFillColor): Detect a changed fill color, and if it has changed, append a display list item to make a parallel change at drawing time. (WebCore::DisplayList::DrawGlyphsRecorder::updateStrokeColor): Ditto for the stroke color. (WebCore::DisplayList::DrawGlyphsRecorder::updateCTM): Ditto for the CTM. (WebCore::DisplayList::shadowIsCleared): (WebCore::DisplayList::DrawGlyphsRecorder::updateShadow): Ditto for the shadow state. (WebCore::DisplayList::DrawGlyphsRecorder::recordBeginLayer): Hook this up to beginTransparencyLayer(). (WebCore::DisplayList::DrawGlyphsRecorder::recordEndLayer): Hook this up to endTransparencyLayer(). (WebCore::DisplayList::computeAdvancesFromPositions): CGContext gives us positions, but our display list infrastructure requires advances. Simply subtract to convert between them. (WebCore::DisplayList::DrawGlyphsRecorder::recordDrawGlyphs): The callback that appends a DrawGlyphs display list item. Note it has to call the various update() functions to detect changes in the CGContext state. (WebCore::DisplayList::DrawGlyphsRecorder::recordDrawImage): Ditto for a DrawImage display list item. (WebCore::DisplayList::DrawGlyphsRecorder::drawGlyphs): The main entry point. Simply set up, do the work, then clean up. * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderHarfBuzz.cpp: Added. Dummy implementation to make the other ports continue to compile. (WebCore::DisplayList::DrawGlyphsRecorder::DrawGlyphsRecorder): (WebCore::DisplayList::DrawGlyphsRecorder::drawGlyphs): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::Recorder): (WebCore::DisplayList::Recorder::drawGlyphs): Call m_drawGlyphsRecorder.drawGlyphs() instead of just appending a DrawGlyphs command. (WebCore::DisplayList::Recorder::concatCTM): Tiny optimization. (WebCore::DisplayList::Recorder::clipToDrawingCommands): The current clipToDrawingCommands's context CTM didn't match the parallel one used during playback. In order to make the CTMs match are recording and playback time, we have to make sure they start off the same. * platform/graphics/displaylists/DisplayListRecorder.h: DisplayList::Recorder owns a DrawGlyphsRecorder, whose lifetime equals that of the DisplayList::Recorder. Rather than destroying / recreating the DrawGlyphsRecorder, the DrawGlyphsRecorder class is smart enough to clean up after itself so it can be reused multiple times. 2020-10-30 Brian Burg <bburg@apple.com> Web Inspector: move InspectorFrontendAPIDispatcher to WebCore, clean up uses https://bugs.webkit.org/show_bug.cgi?id=217835 <rdar://problem/70384407> Reviewed by Devin Rousso. Expose the dispatcher as part of the InspectorFrontendClient API so that other code can use the dispatcher regardless of whether it's a WebInspectorUI or RemoteWebInspectorUI. Add an InspectorFrontendAPIDispatcher instance and getter to InspectorFrontendClientLocal. Adopt the JSONValue-based InspectorFrontendAPIDispatcher::dispatch() method in InspectorFrontendClientLocal. Remove the redundant parallel queuing implementation. Remove redundant public methods that are available on InspectorFrontendAPIDispatcher. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Moved files. * inspector/InspectorFrontendAPIDispatcher.cpp: Renamed from Source/WebKit/WebProcess/Inspector/WebInspectorFrontendAPIDispatcher.cpp. (WebCore::InspectorFrontendAPIDispatcher::InspectorFrontendAPIDispatcher): (WebCore::InspectorFrontendAPIDispatcher::reset): (WebCore::InspectorFrontendAPIDispatcher::frontendLoaded): (WebCore::InspectorFrontendAPIDispatcher::suspend): (WebCore::InspectorFrontendAPIDispatcher::unsuspend): (WebCore::InspectorFrontendAPIDispatcher::dispatchCommand): (WebCore::InspectorFrontendAPIDispatcher::dispatchMessageAsync): (WebCore::InspectorFrontendAPIDispatcher::evaluateOrQueueExpression): (WebCore::InspectorFrontendAPIDispatcher::evaluateQueuedExpressions): (WebCore::InspectorFrontendAPIDispatcher::evaluateExpression): (WebCore::InspectorFrontendAPIDispatcher::evaluateExpressionForTesting): Add new dispatch() method. Remove other dispatch methods that can be expressed using the new JSON::Value-based method. If it's not possible to evaluate JS immediately, schedule a one-shot task to try again on a different event loop turn. * inspector/InspectorFrontendAPIDispatcher.h: Renamed from Source/WebKit/WebProcess/Inspector/WebInspectorFrontendAPIDispatcher.h. Add new dispatch() method which takes a vector of JSON::Value objects and serializes them into command arguments for the frontend. * inspector/InspectorFrontendClient.h: * inspector/InspectorFrontendClientLocal.h: * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal): (WebCore::InspectorFrontendClientLocal::frontendLoaded): (WebCore::InspectorFrontendClientLocal::pagePaused): (WebCore::InspectorFrontendClientLocal::pageUnpaused): (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): (WebCore::InspectorFrontendClientLocal::setAttachedWindow): (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): (WebCore::InspectorFrontendClientLocal::startProfilingJavaScript): (WebCore::InspectorFrontendClientLocal::stopProfilingJavaScript): (WebCore::InspectorFrontendClientLocal::showConsole): (WebCore::InspectorFrontendClientLocal::showResources): (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Use InspectorFrontendAPIDispatcher to dispatch commands to the frontend. (WebCore::InspectorFrontendClientLocal::dispatch): Deleted. (WebCore::InspectorFrontendClientLocal::dispatchMessage): Deleted. (WebCore::InspectorFrontendClientLocal::dispatchMessageAsync): Deleted. (WebCore::InspectorFrontendClientLocal::evaluateOnLoad): Deleted. These are redundant with InspectorFrontendAPIDispatcher. * testing/Internals.cpp: (WebCore::InspectorStubFrontend::sendMessageToFrontend): Use frontend dispatcher directly. 2020-10-30 Chris Fleizach <cfleizach@apple.com> AX: Incorrect list of voices being displayed on iOS https://bugs.webkit.org/show_bug.cgi?id=218293 Reviewed by Per Arne Vollan. Limit the voices that we display in WebSpeech to only built-in system voices. This was the intention of the "compact" decision, but some mobile assets have compact voices, which are not available WebContent. * platform/ios/PlatformSpeechSynthesizerIOS.mm: (WebCore::PlatformSpeechSynthesizer::initializeVoiceList): 2020-10-30 Keith Rollin <krollin@apple.com> Further lessen reliance on VPATH in WebCore/DerivedSources.make https://bugs.webkit.org/show_bug.cgi?id=218378 <rdar://problem/70730895> Reviewed by Darin Adler. Bug 217696 updated WebCore/DerivedSources.make to rely less on VPATH and make more use of explicit partial or full paths. The solution there, however, did not go far enough, and led to failures when building WebKit for Safari Tech Preview and using old SDKs that contains files that have since been "upstreamed" into WebKit. Address this problem by taking further control of how DerivedSources.make finds needed files instead of using the VPATH mechanism. No new tests -- this is a build fix. * DerivedSources.make: 2020-10-30 Fujii Hironori <Hironori.Fujii@sony.com> [TextureMapper] Replica layers don't blend correctly because computeOverlapRegions doesn't take TextureMapperPaintOptions::transform into account https://bugs.webkit.org/show_bug.cgi?id=218307 Reviewed by Don Olmstead. Blending in replica layers didn't work as expected because computeOverlapRegions didn't take the transform of TextureMapperPaintOptions into account. Rendering replica layers are achieved by using the transform. TextureMapperLayer::paintWithIntermediateSurface also should take the transform. commitSurface no longer needs to transform by it. Test: compositing/reflections/opacity-in-reflection.html * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeOverlapRegions): (WebCore::TextureMapperLayer::paintUsingOverlapRegions): (WebCore::commitSurface): (WebCore::TextureMapperLayer::paintWithIntermediateSurface): * platform/graphics/texmap/TextureMapperLayer.h: 2020-10-30 Chris Dumez <cdumez@apple.com> BaseAudioContext.decodeAudioData() should throw an InvalidStateError when document is not fully active https://bugs.webkit.org/show_bug.cgi?id=218400 Reviewed by Darin Adler. BaseAudioContext.decodeAudioData() should throw an InvalidStateError when document is not fully active: - https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-decodeaudiodata We were previously throwing a NotAllowedError instead. No new tests, rebaselined existing tests. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::decodeAudioData): 2020-10-30 Youenn Fablet <youenn@apple.com> Increase camera failing timer to 30 seconds https://bugs.webkit.org/show_bug.cgi?id=218389 Reviewed by Eric Carlson. From testing, 3 seconds is not always enough if getUserMedia is quickly called multiple times. Let's increase to 30 seconds to give room for slow systems while still being able to identify failures. * platform/mediastream/mac/AVVideoCaptureSource.h: 2020-10-30 Antti Koivisto <antti@apple.com> REGRESSION (r269146): ASSERTION FAILED: didNeedLayout || logicalHeight() == oldHeight in WebCore::RenderBlockFlow::ensureLineBoxes https://bugs.webkit.org/show_bug.cgi?id=218350 <rdar://problem/70822708> Reviewed by Zalan Bujtas. Dropping of ensureLineBoxes call revealed a bug in text control style updates. RenderTextControlSingleLine mutates style of the innerTextElement() renderer by altering the height property. On style update this mutation is lost which causes ensureLineBoxes for innerTextElement() to miscompute block height if RenderTextControlSingleLine layout has not happened before. * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::styleDidChange): Don't zero the dimension properties of the innerTextElement() unnecessarily. Instead see of the underlying style has actually changed and set the style only in that case. That will then trigger layout as needed. 2020-10-30 Simon Fraser <simon.fraser@apple.com> Convert ScrollingTreeNode change flags to an OptionSet<> https://bugs.webkit.org/show_bug.cgi?id=218374 Reviewed by Antti Koivisto. Address the FIXME in ScrollingStateNode.h and use an OptionSet<> for the ScrollingState tree change flags. This required moving them all into the same enum class in ScrollingStateNode. * page/scrolling/ScrollingStateFixedNode.cpp: (WebCore::ScrollingStateFixedNode::setPropertyChangesAfterReattach): (WebCore::ScrollingStateFixedNode::updateConstraints): (WebCore::ScrollingStateFixedNode::setPropertyChangedBitsAfterReattach): Deleted. * page/scrolling/ScrollingStateFixedNode.h: * page/scrolling/ScrollingStateFrameScrollingNode.cpp: (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode): (WebCore::ScrollingStateFrameScrollingNode::setPropertyChangesAfterReattach): (WebCore::ScrollingStateFrameScrollingNode::setFrameScaleFactor): (WebCore::ScrollingStateFrameScrollingNode::setEventTrackingRegions): (WebCore::ScrollingStateFrameScrollingNode::setScrollBehaviorForFixedElements): (WebCore::ScrollingStateFrameScrollingNode::setLayoutViewport): (WebCore::ScrollingStateFrameScrollingNode::setMinLayoutViewportOrigin): (WebCore::ScrollingStateFrameScrollingNode::setMaxLayoutViewportOrigin): (WebCore::ScrollingStateFrameScrollingNode::setOverrideVisualViewportSize): (WebCore::ScrollingStateFrameScrollingNode::setHeaderHeight): (WebCore::ScrollingStateFrameScrollingNode::setFooterHeight): (WebCore::ScrollingStateFrameScrollingNode::setTopContentInset): (WebCore::ScrollingStateFrameScrollingNode::setRootContentsLayer): (WebCore::ScrollingStateFrameScrollingNode::setCounterScrollingLayer): (WebCore::ScrollingStateFrameScrollingNode::setInsetClipLayer): (WebCore::ScrollingStateFrameScrollingNode::setContentShadowLayer): (WebCore::ScrollingStateFrameScrollingNode::setHeaderLayer): (WebCore::ScrollingStateFrameScrollingNode::setFooterLayer): (WebCore::ScrollingStateFrameScrollingNode::setVisualViewportIsSmallerThanLayoutViewport): (WebCore::ScrollingStateFrameScrollingNode::setFixedElementsLayoutRelativeToFrame): (WebCore::ScrollingStateFrameScrollingNode::setAsyncFrameOrOverflowScrollingEnabled): (WebCore::ScrollingStateFrameScrollingNode::setPropertyChangedBitsAfterReattach): Deleted. * page/scrolling/ScrollingStateFrameScrollingNode.h: * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::ScrollingStateNode): (WebCore::ScrollingStateNode::setPropertyChanged): (WebCore::ScrollingStateNode::setPropertyChangesAfterReattach): (WebCore::ScrollingStateNode::appendChild): (WebCore::ScrollingStateNode::insertChild): (WebCore::ScrollingStateNode::removeChildAtIndex): (WebCore::ScrollingStateNode::setLayer): (WebCore::ScrollingStateNode::setPropertyChangedBitsAfterReattach): Deleted. * page/scrolling/ScrollingStateNode.h: (WebCore::ScrollingStateNode::hasChangedProperties const): (WebCore::ScrollingStateNode::hasChangedProperty const): (WebCore::ScrollingStateNode::resetChangedProperties): (WebCore::ScrollingStateNode::changedProperties const): (WebCore::ScrollingStateNode::setChangedProperties): (WebCore::ScrollingStateNode::setPropertyChangedInternal): (WebCore::ScrollingStateNode::setPropertyChangedBit): Deleted. * page/scrolling/ScrollingStateOverflowScrollProxyNode.cpp: (WebCore::ScrollingStateOverflowScrollProxyNode::setPropertyChangesAfterReattach): (WebCore::ScrollingStateOverflowScrollProxyNode::setOverflowScrollingNode): (WebCore::ScrollingStateOverflowScrollProxyNode::setPropertyChangedBitsAfterReattach): Deleted. * page/scrolling/ScrollingStateOverflowScrollProxyNode.h: * page/scrolling/ScrollingStatePositionedNode.cpp: (WebCore::ScrollingStatePositionedNode::setPropertyChangesAfterReattach): (WebCore::ScrollingStatePositionedNode::setRelatedOverflowScrollingNodes): (WebCore::ScrollingStatePositionedNode::updateConstraints): (WebCore::ScrollingStatePositionedNode::setPropertyChangedBitsAfterReattach): Deleted. * page/scrolling/ScrollingStatePositionedNode.h: * page/scrolling/ScrollingStateScrollingNode.cpp: (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): (WebCore::ScrollingStateScrollingNode::setPropertyChangesAfterReattach): (WebCore::ScrollingStateScrollingNode::setScrollableAreaSize): (WebCore::ScrollingStateScrollingNode::setTotalContentsSize): (WebCore::ScrollingStateScrollingNode::setReachableContentsSize): (WebCore::ScrollingStateScrollingNode::setScrollPosition): (WebCore::ScrollingStateScrollingNode::setScrollOrigin): (WebCore::ScrollingStateScrollingNode::setHorizontalSnapOffsets): (WebCore::ScrollingStateScrollingNode::setVerticalSnapOffsets): (WebCore::ScrollingStateScrollingNode::setHorizontalSnapOffsetRanges): (WebCore::ScrollingStateScrollingNode::setVerticalSnapOffsetRanges): (WebCore::ScrollingStateScrollingNode::setCurrentHorizontalSnapPointIndex): (WebCore::ScrollingStateScrollingNode::setCurrentVerticalSnapPointIndex): (WebCore::ScrollingStateScrollingNode::setScrollableAreaParameters): (WebCore::ScrollingStateScrollingNode::setSynchronousScrollingReasons): (WebCore::ScrollingStateScrollingNode::setRequestedScrollData): (WebCore::ScrollingStateScrollingNode::setIsMonitoringWheelEvents): (WebCore::ScrollingStateScrollingNode::setScrollContainerLayer): (WebCore::ScrollingStateScrollingNode::setScrolledContentsLayer): (WebCore::ScrollingStateScrollingNode::setHorizontalScrollbarLayer): (WebCore::ScrollingStateScrollingNode::setVerticalScrollbarLayer): (WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach): Deleted. * page/scrolling/ScrollingStateScrollingNode.h: * page/scrolling/ScrollingStateStickyNode.cpp: (WebCore::ScrollingStateStickyNode::setPropertyChangesAfterReattach): (WebCore::ScrollingStateStickyNode::updateConstraints): (WebCore::ScrollingStateStickyNode::setPropertyChangedBitsAfterReattach): Deleted. * page/scrolling/ScrollingStateStickyNode.h: * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::nodeWasReattachedRecursive): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::commitTreeState): * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: (WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren): * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren): (WebCore::ScrollingTreeScrollingNode::commitStateAfterChildren): * page/scrolling/cocoa/ScrollingTreeFixedNode.mm: (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren): * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm: (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren): * page/scrolling/cocoa/ScrollingTreePositionedNode.mm: (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren): * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren): * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm: (WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars): * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren): (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode): * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp: (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren): * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren): * page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.cpp: (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren): * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::commitStateAfterChildren): * page/scrolling/nicosia/ScrollingTreePositionedNode.cpp: (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren): * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp: (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren): 2020-10-30 Alejandro G. Castro <alex@igalia.com> Fix build error with release build with -DLOG_DISABLED=0 https://bugs.webkit.org/show_bug.cgi?id=218338 Add the proper ifdefs to solve it. Reviewed by Adrian Perez de Castro. * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::build const): 2020-10-30 Miguel Gomez <magomez@igalia.com> [GTK] Direct composited images may not be rendered after a window resize https://bugs.webkit.org/show_bug.cgi?id=218292 Reviewed by Carlos Garcia Campos. Ensure that valid buffers passed for ImageBackings are not destroyed until the CoordinatedGraphicsScene consumes them. * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp: (Nicosia::ImageBackingTextureMapperImpl::flushUpdate): * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): (WebCore::CoordinatedGraphicsLayer::purgeBackingStores): 2020-10-29 Aditya Keerthi <akeerthi@apple.com> [Cocoa] Remove soft linking of NetworkExtension.framework https://bugs.webkit.org/show_bug.cgi?id=218314 <rdar://problem/70785239> Reviewed by Andy Estes. WebCore should link NetworkExtension.framework normally, to avoid the runtime cost associated with soft linking. * Configurations/WebCore.xcconfig: On macOS, weak link the framework since NetworkExtension.framework is not available on the Base System. * platform/cocoa/NetworkExtensionContentFilter.h: Added the isRequired static method to avoid soft linking NetworkExtension.framework in WebKit. * platform/cocoa/NetworkExtensionContentFilter.mm: Only compile this file in the ENABLE(CONTENT_FILTERING) build, as its functionality is unavailable on tvOS. (WebCore::NetworkExtensionContentFilter::enabled): (WebCore::NetworkExtensionContentFilter::initialize): (WebCore::NetworkExtensionContentFilter::unblockHandler const): (WebCore::NetworkExtensionContentFilter::isRequired): 2020-10-29 Chris Dumez <cdumez@apple.com> Regression(PSON): Back/forward navigation may hang https://bugs.webkit.org/show_bug.cgi?id=216611 <rdar://problem/68992714> Reviewed by Geoffrey Garen. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadItem): Add assertion that would have hit when reproducing the bug. A crash in debug is better than hanging. 2020-10-29 Jiewen Tan <jiewen_tan@apple.com> [WebAuthn] Make WebContent process talk to the WebAuthn process for WebAuthn requests https://bugs.webkit.org/show_bug.cgi?id=218070 <rdar://problem/70384404> Reviewed by Brent Fulgham. Covered by existing tests. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebAuthenticationModernEnabled): (WebCore::RuntimeEnabledFeatures::webAuthenticationModernEnabled const): Adds bindings in WebCore. 2020-10-29 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Make WebCore::ContainerNode::ChildChangeType enum class https://bugs.webkit.org/show_bug.cgi?id=218298 Reviewed by Darin Adler. And this patch moved to `ChildChangeType` to under `ChildChange`. This patch also move `ChildChangeSource` to under `ChildChange` and specify a base type. * dom/CharacterData.cpp: (WebCore::CharacterData::parserAppendData): (WebCore::CharacterData::setDataAndUpdate): (WebCore::CharacterData::notifyParentAfterChange): * dom/CharacterData.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): (WebCore::ContainerNode::removeNodeWithScriptAssertion): (WebCore::executeNodeInsertionWithScriptAssertion): (WebCore::ContainerNode::takeAllChildrenFrom): (WebCore::ContainerNode::insertBefore): (WebCore::ContainerNode::parserInsertBefore): (WebCore::ContainerNode::replaceChild): (WebCore::ContainerNode::removeChild): (WebCore::ContainerNode::parserRemoveChild): (WebCore::ContainerNode::replaceAllChildrenWithNewText): (WebCore::ContainerNode::removeChildren): (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): (WebCore::ContainerNode::parserAppendChild): (WebCore::affectsElements): (WebCore::ContainerNode::childrenChanged): (WebCore::ContainerNode::replaceChildren): * dom/ContainerNode.h: (WebCore::ContainerNode::ChildChange::isInsertion const): * dom/Element.cpp: (WebCore::Element::childrenChanged): * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::childrenChanged): * html/HTMLElement.cpp: (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged): * html/HTMLElement.h: * html/HTMLOutputElement.cpp: (WebCore::HTMLOutputElement::childrenChanged): * svg/SVGClipPathElement.cpp: (WebCore::SVGClipPathElement::childrenChanged): * svg/SVGElement.cpp: (WebCore::SVGElement::childrenChanged): * svg/SVGFELightElement.cpp: (WebCore::SVGFELightElement::childrenChanged): * svg/SVGFilterElement.cpp: (WebCore::SVGFilterElement::childrenChanged): * svg/SVGFilterPrimitiveStandardAttributes.cpp: (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged): * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::childrenChanged): * svg/SVGMarkerElement.cpp: (WebCore::SVGMarkerElement::childrenChanged): * svg/SVGMaskElement.cpp: (WebCore::SVGMaskElement::childrenChanged): * svg/SVGPatternElement.cpp: (WebCore::SVGPatternElement::childrenChanged): 2020-10-29 Sihui Liu <sihui_liu@apple.com> Unreviewed, reverting r268192. PLT regression - rdar://problem/70141350 Reverted changeset: "Adjust heuristic for checking whether view reaches visually non-empty state" https://bugs.webkit.org/show_bug.cgi?id=217400 https://trac.webkit.org/changeset/268192 2020-10-29 Said Abou-Hallawa <said@apple.com> REGRESSION(269065): [GPU Process]: Order of drawing has to be preserved when drawing a canvas to another canvas https://bugs.webkit.org/show_bug.cgi?id=218324 Reviewed by Simon Fraser. Allow DisplayList::Recorder::Delegate to take an action after appending a DisplayList::Item to its DisplayList::DisplayList. Test: fast/canvas/canvas-draw-canvas-on-canvas-flushing-order.html * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::didAppendItem): (WebCore::DisplayList::Recorder::appendItemAndUpdateExtent): (WebCore::DisplayList::Recorder::appendItem): * platform/graphics/displaylists/DisplayListRecorder.h: (WebCore::DisplayList::Recorder::Delegate::didAppendItem): 2020-10-29 Noam Rosenthal <noam@webkit.org> REGRESSION(r268249): image-orientation:none is broken for local (file://) urls https://bugs.webkit.org/show_bug.cgi?id=217808 <rdar://problem/70603407> Reviewed by Myles C. Maxfield. Use isCORSSameOrigin() instead of isOriginClean(), it's a more accureate method for this purpose. Allow image-orientation: none overriding when the image is local or a data-url. Test: fast/images/image-orientation-none-local.html * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::allowsOrientationOverride const): 2020-10-29 Antti Koivisto <antti@apple.com> [LFC][Integration] Rename text run localStart/EndOffset to start/end https://bugs.webkit.org/show_bug.cgi?id=218344 Reviewed by Zalan Bujtas. There is no danger of confusion and these are called just start/end elsewhere. * dom/Position.cpp: (WebCore::Position::upstream const): (WebCore::Position::downstream const): * editing/TextIterator.cpp: (WebCore::TextIterator::handleTextRun): * editing/VisibleUnits.cpp: (WebCore::startPositionForLine): (WebCore::endPositionForLine): * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::PathTextRun::start const): (WebCore::LayoutIntegration::PathTextRun::end const): (WebCore::LayoutIntegration::PathTextRun::localStartOffset const): Deleted. (WebCore::LayoutIntegration::PathTextRun::localEndOffset const): Deleted. * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: (WebCore::LayoutIntegration::RunIteratorLegacyPath::start const): (WebCore::LayoutIntegration::RunIteratorLegacyPath::end const): (WebCore::LayoutIntegration::RunIteratorLegacyPath::localStartOffset const): Deleted. (WebCore::LayoutIntegration::RunIteratorLegacyPath::localEndOffset const): Deleted. * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::minimumCaretOffset const): (WebCore::LayoutIntegration::RunIteratorModernPath::maximumCaretOffset const): (WebCore::LayoutIntegration::RunIteratorModernPath::start const): (WebCore::LayoutIntegration::RunIteratorModernPath::end const): (WebCore::LayoutIntegration::RunIteratorModernPath::localStartOffset const): Deleted. (WebCore::LayoutIntegration::RunIteratorModernPath::localEndOffset const): Deleted. * rendering/RenderBlockFlow.cpp: (WebCore::positionForRun): * rendering/RenderText.cpp: (WebCore::createVisiblePositionAfterAdjustingOffsetForBiDi): (WebCore::RenderText::positionForPoint): (WebCore::RenderText::caretMinOffset const): (WebCore::RenderText::caretMaxOffset const): (WebCore::RenderText::countRenderedCharacterOffsetsUntil const): (WebCore::containsOffset): 2020-10-29 Antti Koivisto <antti@apple.com> [LFC][Integration] Rename top/bottomWithLeading to lineBoxTop/Bottom https://bugs.webkit.org/show_bug.cgi?id=218340 Reviewed by Zalan Bujtas. These match the spec concept of line box. For clarity rename the legacy fields and functions in RootInlineBox too. * layout/integration/LayoutIntegrationLineIterator.h: (WebCore::LayoutIntegration::PathLine::lineBoxTop const): (WebCore::LayoutIntegration::PathLine::lineBoxBottom const): (WebCore::LayoutIntegration::PathLine::topWithLeading const): Deleted. (WebCore::LayoutIntegration::PathLine::bottomWithLeading const): Deleted. * layout/integration/LayoutIntegrationLineIteratorLegacyPath.h: (WebCore::LayoutIntegration::LineIteratorLegacyPath::lineBoxTop const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::lineBoxBottom const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::topWithLeading const): Deleted. (WebCore::LayoutIntegration::LineIteratorLegacyPath::bottomWithLeading const): Deleted. * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::LineIteratorModernPath::lineBoxTop const): (WebCore::LayoutIntegration::LineIteratorModernPath::lineBoxBottom const): (WebCore::LayoutIntegration::LineIteratorModernPath::topWithLeading const): Deleted. (WebCore::LayoutIntegration::LineIteratorModernPath::bottomWithLeading const): Deleted. * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::layoutRunsAndFloatsInRange): (WebCore::ComplexLineLayout::linkToEndLineIfNeeded): (WebCore::ComplexLineLayout::checkFloatInCleanLine): (WebCore::ComplexLineLayout::determineStartPosition): (WebCore::ComplexLineLayout::determineEndPosition): (WebCore::ComplexLineLayout::checkPaginationAndFloatsAtEndLine): (WebCore::ComplexLineLayout::lineWidthForPaginatedLineChanged const): (WebCore::ComplexLineLayout::matchedEndLine): (WebCore::ComplexLineLayout::updateFragmentForLine const): * rendering/RenderBlockFlow.cpp: (WebCore::calculateMinimumPageHeight): (WebCore::RenderBlockFlow::adjustLinePositionForPagination): (WebCore::RenderBlockFlow::markLinesDirtyInBlockRange): (WebCore::RenderBlockFlow::positionForPointWithInlineChildren): * rendering/RenderBox.cpp: (WebCore::RenderBox::positionLineBox): * rendering/RenderLayoutState.cpp: (WebCore::RenderLayoutState::computeLineGridPaginationOrigin): * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::collectSelectionRects): * rendering/RenderText.cpp: (WebCore::RenderText::collectSelectionRects): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::adjustPosition): (WebCore::RootInlineBox::alignBoxesInBlockDirection): (WebCore::RootInlineBox::lineSnapAdjustment const): (WebCore::RootInlineBox::outputLineBox const): * rendering/RootInlineBox.h: (WebCore::RootInlineBox::lineBoxTop const): (WebCore::RootInlineBox::lineBoxBottom const): (WebCore::RootInlineBox::setLineTopBottomPositions): (WebCore::RootInlineBox::lineTopWithLeading const): Deleted. (WebCore::RootInlineBox::lineBottomWithLeading const): Deleted. 2020-10-29 Antti Koivisto <antti@apple.com> [LFC][Integration] RenderBlockFlow::positionForPointWithInlineChildren should use iterator https://bugs.webkit.org/show_bug.cgi?id=218283 Reviewed by Zalan Bujtas. Reduce InlineBox access and eliminate one ensureLineBoxes() call. * layout/integration/LayoutIntegrationLineIterator.h: (WebCore::LayoutIntegration::PathLine::topWithLeading const): (WebCore::LayoutIntegration::PathLine::bottomWithLeading const): (WebCore::LayoutIntegration::PathLine::legacyRootInlineBox const): * layout/integration/LayoutIntegrationLineIteratorLegacyPath.h: (WebCore::LayoutIntegration::LineIteratorLegacyPath::topWithLeading const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::bottomWithLeading const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::legacyRootInlineBox const): * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::LineIteratorModernPath::topWithLeading const): (WebCore::LayoutIntegration::LineIteratorModernPath::bottomWithLeading const): (WebCore::LayoutIntegration::LineIteratorModernPath::legacyRootInlineBox const): * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::legacyInlineBox const): * rendering/RenderBlockFlow.cpp: (WebCore::positionForRun): (WebCore::RenderBlockFlow::positionForPointWithInlineChildren): (WebCore::RenderBlockFlow::positionForBox const): Deleted. * rendering/RenderBlockFlow.h: 2020-10-29 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Implement outputLineTreeAndMark for IFC https://bugs.webkit.org/show_bug.cgi?id=218310 Reviewed by Antti Koivisto. Add a legacy like inline tree output. This helps when comparing legacy and modern line tree geometries. "<div>before<img>after<div>" generates the following output: DIV RenderBlock at (x, y) size width x height renderer->(address) node->(address) line at (x, y) size (width x height) baseline (y) Inline level boxes: Root inline box at (x, y) size (width x height) baseline (y) ascent (ascent/layout bounds ascent) descent (descent/layout bounds descent) Atomic inline level box at (x, y) size (width x height) baseline (y) ascent (ascent/layout bounds ascent) descent (descent/layout bounds descent) Runs: text run at (x, y) size (width x height) run(start, end) box run at (x, y) size (width x height) text run at (x, y) size (width x height) run(start, end) * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineLevelBox::LayoutBounds::height const): (WebCore::Layout::LineBox::InlineLevelBox::layoutBounds const): (WebCore::Layout::LineBox::InlineLevelBox::isRootInlineBox const): * layout/integration/LayoutIntegrationCoverage.cpp: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::outputLineTree const): * layout/integration/LayoutIntegrationLineLayout.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::showInlineTreeAndRuns): (WebCore::Layout::outputLayoutTree): (WebCore::Layout::outputInlineRuns): Deleted. * layout/layouttree/LayoutTreeBuilder.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::outputLineTreeAndMark const): 2020-10-29 Martin Robinson <mrobinson@igalia.com> Make scroll-margin independent of scroll snapping and have it apply when scrolling to anchors https://bugs.webkit.org/show_bug.cgi?id=218076 Reviewed by Simon Fraser. * dom/Element.cpp: (WebCore::Element::scrollIntoView): Use absoluteAnchorRectWithScrollMargin, taking into account scroll-margin. (WebCore::Element::scrollIntoViewIfNeeded): Ditto. (WebCore::Element::scrollIntoViewIfNotVisible): Ditto. * page/FrameView.cpp: (WebCore::FrameView::scrollToAnchor): Ditto. * rendering/RenderBox.cpp: (WebCore::RenderBox::absoluteAnchorRectWithScrollMargin const): Added this override which properly converts the scroll-margin to LayoutUnits and applies it to absoluteAnchorRect. * rendering/RenderBox.h: Added method declaration. * rendering/RenderElement.cpp: (WebCore::RenderElement::absoluteAnchorRectWithScrollMargin const): Added implementation that simply calls absoluteAnchorRect. * rendering/RenderElement.h: Added declaration of new virtual absoluteAnchorRectWithScrollMargin. * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::styleDidChange): Get the scroll-margin directly from the style instead of the now-removed ScrollSnapArea. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::scrollMargin const): Move scroll-margin and scroll-snap-align to m_rareNonInheritedData and get rid of intermediate ScrollSnapArea. These two properties are no independent. (WebCore::RenderStyle::scrollMarginTop const): Ditto. (WebCore::RenderStyle::scrollMarginBottom const): Ditto. (WebCore::RenderStyle::scrollMarginLeft const): Ditto. (WebCore::RenderStyle::scrollMarginRight const): Ditto. (WebCore::RenderStyle::setScrollMarginTop): Ditto. (WebCore::RenderStyle::setScrollMarginBottom): Ditto. (WebCore::RenderStyle::setScrollMarginLeft): Ditto. (WebCore::RenderStyle::setScrollMarginRight): Ditto. (WebCore::RenderStyle::scrollSnapAlign const): Ditto. (WebCore::RenderStyle::setScrollSnapAlign): Ditto. (WebCore::RenderStyle::hasSnapPosition const): Ditto. (WebCore::RenderStyle::scrollSnapArea const): Deleted. * rendering/style/RenderStyle.h: Add accessors for scroll-margin and moved hasSnapPosition from ScrollSnapArea. * rendering/style/StyleRareNonInheritedData.cpp: Removed intermediate ScrollSnapArea data structure and moved members here. (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Ditto. (WebCore::StyleRareNonInheritedData::operator== const): Ditto. * rendering/style/StyleRareNonInheritedData.h: Ditto. * rendering/style/StyleScrollSnapPoints.cpp: Ditto. (WebCore::StyleScrollSnapArea::copy const): Deleted. (WebCore::StyleScrollSnapArea::StyleScrollSnapArea): Deleted. * rendering/style/StyleScrollSnapPoints.h: Removed ScrollSnapArea. (WebCore::StyleScrollSnapArea::create): Deleted. (WebCore::StyleScrollSnapArea::hasSnapPosition const): Deleted. 2020-10-29 Chris Lord <clord@igalia.com> [GTK] Smooth scrolling should not apply to continuous scrolling with sync scrolling https://bugs.webkit.org/show_bug.cgi?id=218133 Reviewed by Adrian Perez de Castro. Respect PlatformWheelEvent.hasPreciseScrollingDeltas in the base ScrollAnimator class, and make sure the flag is set correctly for GdkEvent. * SourcesGTK.txt: * platform/PlatformWheelEvent.h: (WebCore::PlatformWheelEvent::setHasPreciseScrollingDeltas): * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::scroll): (WebCore::ScrollAnimator::scrollWithoutAnimation): (WebCore::ScrollAnimator::handleWheelEvent): * platform/ScrollAnimator.h: * platform/gtk/GtkVersioning.h: (gdk_event_get_source_device): * platform/gtk/PlatformWheelEventGtk.cpp: Removed. 2020-10-29 Cathie Chen <cathiechen@igalia.com> IntersectionObserverCallback leaks https://bugs.webkit.org/show_bug.cgi?id=218225 Reviewed by Ryosuke Niwa. Unless the page is unloaded, JSIntersectionObserverCallback and objects inside it can not be garbage collected properly. To fix this, make IntersectionObserverCallback as a weak callback. To keep it alive, in JSIntersectionObserver::visitAdditionalChildren add the callback to visitor. Test: intersection-observer/intersection-observer-callback-leak.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSIntersectionObserverCustom.cpp: Copied from Source/WebCore/page/IntersectionObserverCallback.idl. (WebCore::JSIntersectionObserver::visitAdditionalChildren): * page/IntersectionObserver.h: (WebCore::IntersectionObserver::callbackConcurrently): * page/IntersectionObserver.idl: * page/IntersectionObserverCallback.h: (WebCore::IntersectionObserverCallback::hasCallback const): * page/IntersectionObserverCallback.idl: 2020-10-28 Julian Gonzalez <julian_a_gonzalez@apple.com> Null dereference in CompositeEditCommand::cloneParagraphUnderNewElement() due to not checking for top of DOM tree https://bugs.webkit.org/show_bug.cgi?id=218132 Reviewed by Ryosuke Niwa. When iterating through parent nodes, cloneParagraphUnderNewElement() has to be careful to check for the top of the DOM tree (where parentNode() returns nullptr) and stop iterating. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement): 2020-10-28 Ryosuke Niwa <rniwa@webkit.org> REGRESSION(r267329): Crash in VisibleSelection::toNormalizedRange() https://bugs.webkit.org/show_bug.cgi?id=218276 Reviewed by Wenson Hsieh. The crash was a symptom of the issue that m_extent or m_base could be null but not the other when canonicalizing a non-null Position with VisiblePosition will make it null. Fixed the bug by making sure base and extent's nullness match. Test: editing/selection/delete-selection-with-disconnected-extent.html * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::setBaseAndExtentToDeepEquivalents): 2020-10-28 Chris Dumez <cdumez@apple.com> Web Audio broken on iOS 14 after switching app https://bugs.webkit.org/show_bug.cgi?id=217606 <rdar://problem/70231769> Reviewed by Eric Carlson. When we call AudioOutputUnitStart(), AVFoundation checks if we are allowed to play by making sure that our application is foreground. In order to do that, AVFoundation needs the PID of our hosting application. We provide this PID whenever the following function is called: MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary() The issue was that we were not calling providePresentingApplicationPIDIfNecessary() before starting WebAudio playback. As a result, AVFoundation was relying on the visibility of the WebContent process itself. This was causing a race because RunningBoard gets notified that the WebContent process is visible a little later than for the UIProcess. When the UIProcess would become foreground, we would send the SetApplicationState IPC to the WebProcess, which would update the page's visibility and cause us to stop the media session interruption. This would cause us to call AudioOutputUnitStart(), which would fail because AVFoundation would ask RunningBoard if the WebContent process is foreground. At this point, RunningBoard would not necessarily know yet that the WebContent process is visible. However, RunningBoard reliably knows the UIProcess is visible at this point. We now call this function inside MediaSessionManageriOS::sessionWillBeginPlayback() since this gets called by WebAudio code before starting the playback. * platform/audio/cocoa/AudioOutputUnitAdaptor.cpp: (WebCore::AudioOutputUnitAdaptor::start): Add some error logging when the call to AudioOutputUnitStart() fails to facilitate debugging such issues in the future. * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): 2020-10-28 Conrad Shultz <conrad_shultz@apple.com> Remove diagnostic logging for plug-ins https://bugs.webkit.org/show_bug.cgi?id=218304 Reviewed by Tim Horton. There's no longer a need to pipe diagnostic logging up to clients. * history/BackForwardCache.cpp: (WebCore::canCacheFrame): * loader/SubframeLoader.cpp: (WebCore::logPluginRequest): Remove a now-unused parameter. (WebCore::FrameLoader::SubframeLoader::requestObject): (WebCore::FrameLoader::SubframeLoader::createJavaAppletWidget): * page/DiagnosticLoggingKeys.cpp: (WebCore::DiagnosticLoggingKeys::pluginLoadedKey): Deleted. (WebCore::DiagnosticLoggingKeys::pluginLoadingFailedKey): Deleted. (WebCore::DiagnosticLoggingKeys::pageContainsPluginKey): Deleted. (WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey): Deleted. (WebCore::DiagnosticLoggingKeys::hasPluginsKey): Deleted. * page/DiagnosticLoggingKeys.h: 2020-10-28 Jer Noble <jer.noble@apple.com> [MSE] Handle trackId changing across Initialization Segments https://bugs.webkit.org/show_bug.cgi?id=218294 <rdar://problem/70771306> Reviewed by Eric Carlson. Test: media/media-source/media-source-trackid-change.html When appending an initialization segment after the receivedFirstInitializationSegment flag is true, and when the number of video or audio tracks is 1, the trackId is allowed to change across initialiaztion segments. When this occurs, move the TrackBuffer inside the trackBufferMap to refer to the new trackId, so that when MediaSamples are parsed, they're put into the correct TrackBuffer. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): * html/track/AudioTrack.cpp: (WebCore::AudioTrack::setPrivate): * html/track/InbandTextTrack.cpp: (WebCore::InbandTextTrack::setPrivate): * html/track/VideoTrack.cpp: (WebCore::VideoTrack::setPrivate): 2020-10-28 Tim Horton <timothy_horton@apple.com> macCatalyst WebGL on Apple Silicon devices is using a software renderer https://bugs.webkit.org/show_bug.cgi?id=218303 <rdar://problem/70587571> Reviewed by Geoffrey Garen. * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::needsEAGLOnMac): (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget): (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery): (WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget): (WebCore::isiOSAppOnMac): Deleted. See ANGLE ChangeLog. 2020-10-28 Fujii Hironori <Hironori.Fujii@sony.com> TextureMapperLayer::paintWithIntermediateSurface: Reduce BitmapTextures by unifying replicaSurface and mainSurface https://bugs.webkit.org/show_bug.cgi?id=217943 Reviewed by Don Olmstead. TextureMapperLayer::paintWithIntermediateSurface was using two BitmapTextures for the main layer and replica layer. But, a single BitmapTexture suffices. Create a BitmapTexture and render both layers onto it. No new tests, no behavior changes. * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintIntoSurface): (WebCore::TextureMapperLayer::paintWithIntermediateSurface): * platform/graphics/texmap/TextureMapperLayer.h: 2020-10-28 Zalan Bujtas <zalan@apple.com> [LFC][IFC] horizontalAlignmentOffset should check for empty run list https://bugs.webkit.org/show_bug.cgi?id=218285 <rdar://problem/70730722> Reviewed by Antti Koivisto. LineBoxBuilder functions check for empty run list except this static helper. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::horizontalAlignmentOffset): 2020-10-28 Chris Dumez <cdumez@apple.com> AudioBuffer channels should be neuterable / detachable https://bugs.webkit.org/show_bug.cgi?id=218286 Reviewed by Eric Carlson. AudioBuffer channels should be neuterable / detachable: - https://webaudio.github.io/web-audio-api/#acquire-the-content When the one of the channels' buffers gets detached/neutered, the array returned by getChannelData(0) is neutered and thus has zero length. Internally though, if channelData() gets called and ANY of the channels' buffers are detached, we return a new empty array, as per the specification. This makes sure we end up with silence on all channels when any of the channels gets detached, which is consistent with the specification and Firefox (Blink seems to crash). To make the AudioBuffer API less error-prone when used natively, I updated length() and duration() to return 0 whenever any of the channels is detached. This is safer since channelData() returns 0-length arrays in this case. The Web API keeps returning the original values though so they rely on new originalLength() / originalDuration() getters. No new tests, rebaselined / updated existing tests. * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::create): (WebCore::AudioBuffer::AudioBuffer): (WebCore::AudioBuffer::invalidate): (WebCore::AudioBuffer::channelData): (WebCore::AudioBuffer::zero): (WebCore::AudioBuffer::hasDetachedChannelBuffer const): * Modules/webaudio/AudioBuffer.h: (WebCore::AudioBuffer::originalLength const): (WebCore::AudioBuffer::originalDuration const): (WebCore::AudioBuffer::length const): (WebCore::AudioBuffer::duration const): * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::setBuffer): * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::initialize): 2020-10-28 Philippe Normand <pnormand@igalia.com> [GStreamer] Multi-channel (>2) support for the AudioFileReader https://bugs.webkit.org/show_bug.cgi?id=215255 Reviewed by Xabier Rodriguez-Calvar. The audio file reader used to handle up to stereo audio layouts. It can now handle up to 5.1 surround layouts. This patch also modernizes the coding style of this module in various parts. * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: (WebCore::initializeDebugCategory): (WebCore::AudioFileReader::handleSample): (WebCore::AudioFileReader::handleMessage): (WebCore::AudioFileReader::handleNewDeinterleavePad): (WebCore::AudioFileReader::plugDeinterleave): (WebCore::AudioFileReader::decodeAudioForBusCreation): (WebCore::AudioFileReader::createBus): (WebCore::createBusFromAudioFile): (WebCore::createBusFromInMemoryAudioFile): 2020-10-28 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer][EME][Thunder] Do not sanitize CENC init data https://bugs.webkit.org/show_bug.cgi?id=218182 Reviewed by Philippe Normand. In certain cases, like smoothstreaming with PlayReady, the init datas we are getting are correct but are not in PSSH box format they would be "sanitized away". In this patch you can enable sanitization customization depending on the CDM you're using. * Modules/encryptedmedia/CDM.cpp: (WebCore::CDM::sanitizeInitData): * platform/encryptedmedia/CDMPrivate.cpp: (WebCore::CDMPrivate::sanitizeInitData const): * platform/encryptedmedia/CDMPrivate.h: * platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::CDMPrivateThunder::sanitizeInitData const): * platform/graphics/gstreamer/eme/CDMThunder.h: 2020-10-28 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for case when nested vertical alignment affects the root inlinebox vertical position https://bugs.webkit.org/show_bug.cgi?id=218271 Reviewed by Antti Koivisto. Let's start tracking the nested vertical alignment offsets from the root's baseline. It enables us to find out how much offset the root inlinebox's baseline is required inside the line box. e.g. <div style="font-size: 50px;"> root inlinebox text content <span style="font-size: 10px; vertical-align: text-bottom">and some nested text with an image <img src="broken.jpg" style="vertical-align: baseline; height: 100px; width: 100px;"> </span> </div> In this case, the nested inline box (<span>) has 'text-bottom' vertical alignment which may stretch the line box and may push the root inlinebox downwards so as the nested <img> (aligned with the <span>'s baseline). We simply compute the absolute offset value for each inline level boxes as we walk the "tree" and hold on to the maximum value. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::alignInlineLevelBoxesVerticallyAndComputeLineBoxHeight): 2020-10-28 Philippe Normand <pnormand@igalia.com> [GStreamer] Mock video source doesn't set framerate on its caps https://bugs.webkit.org/show_bug.cgi?id=218248 Reviewed by Xabier Rodriguez-Calvar. Set framerate on the sample caps and reduce code duplication. * platform/graphics/gstreamer/MediaSampleGStreamer.cpp: (WebCore::MediaSampleGStreamer::createImageSample): * platform/graphics/gstreamer/MediaSampleGStreamer.h: * platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp: (WebCore::MockRealtimeVideoSourceGStreamer::updateSampleBuffer): 2020-10-28 Philippe Normand <pnormand@igalia.com> [GStreamer] Using audio files for the <img> tag triggers warnings https://bugs.webkit.org/show_bug.cgi?id=218245 Reviewed by Xabier Rodriguez-Calvar. Plug non-video pads to a fake sink in order to maintain a valid pipeline. Later we should switch to decodebin3 and rely on the stream selection facilities. * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::InnerDecoder::connectDecoderPad): (WebCore::ImageDecoderGStreamer::InnerDecoder::preparePipeline): 2020-10-28 Xabier Rodriguez Calvar <calvaris@igalia.com> Unreviewed, reverting r269033. 269043 Reverted changeset: "[EME][GStreamer] Decode base64 init data if needed" https://bugs.webkit.org/show_bug.cgi?id=218175 https://trac.webkit.org/changeset/269033 2020-10-27 Wenson Hsieh <wenson_hsieh@apple.com> [Concurrent display lists] Add alternate versions of existing display list items that only contain inline data https://bugs.webkit.org/show_bug.cgi?id=218259 Reviewed by Tim Horton. In preparation for supporting concurrent generation and consumption of display list items in the GPU process, add new variants of some existing display list items that contain only "inline data" (i.e. no pointers). No change in behavior; see below for more details. * platform/graphics/Path.cpp: (WebCore::Path::isEmpty const): (WebCore::Path::addQuadCurveTo): (WebCore::Path::addBezierCurveTo): (WebCore::Path::Path): * platform/graphics/Path.h: Add a helper method to convert `InlinePathData` to `Path`. (WebCore::Path::inlineData const): (WebCore::Path::encode const): (WebCore::Path::hasInlineData const): Rename `hasAnyInlineData` to just `hasInlineData`, and make it public. (WebCore::Path::releasePlatformPathIfPossible const): Deleted. Additionally, remove `releasePlatformPathIfPossible()` altogether. This method was used to ensure that `StrokePath` and `FillPath` wouldn't keep their `Path`'s platform `CGPathRef`s around after applying the item in the GPU process, which leads to accumulating a pool of unused `CGPathRef`s after playing back a display list that contains many `Path` objects. However, since `StrokeInlinePath` and `FillInlinePath` now exist, the `Path` object we create when applying those items is always going to be temporary, which allows us to avoid this problem. (WebCore::Path::hasAnyInlineData const): Deleted. * platform/graphics/cg/PathCG.cpp: (WebCore::Path::platformPath const): (WebCore::Path::isNull const): * platform/graphics/displaylists/DisplayList.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::Item::sizeInBytes): (WebCore::DisplayList::SetInlineFillGradient::SetInlineFillGradient): (WebCore::DisplayList::SetInlineFillGradient::gradient const): (WebCore::DisplayList::SetInlineFillGradient::create): (WebCore::DisplayList::SetInlineFillGradient::apply const): (WebCore::DisplayList::SetInlineFillGradient::isInline): Introduce a new SetInlineFillGradient item to represent setting the fill gradient to a gradient with at most 4 color stops, with only inline colors. This inline data is pulled out of the `Gradient` upon construction, and later used to reconstruct a `Gradient` during playback. (WebCore::DisplayList::operator<<): (WebCore::DisplayList::SetInlineFillColor::create): (WebCore::DisplayList::SetInlineFillColor::apply const): Change `SetFillColor` to `SetInlineFillColor`, and make it pass around an `SRGB<uint8_t>` instead of a `Color`, since the latter could contain a pointer to an extended color. (WebCore::DisplayList::SetInlineStrokeColor::create): (WebCore::DisplayList::SetInlineStrokeColor::apply const): Similar to the above, but when setting the stroke color to an inline (non-extended) color. (WebCore::DisplayList::SetStrokeThickness::create): (WebCore::DisplayList::SetStrokeThickness::apply const): (WebCore::DisplayList::FillInlinePath::FillInlinePath): (WebCore::DisplayList::FillInlinePath::apply const): (WebCore::DisplayList::FillPath::apply const): (WebCore::DisplayList::StrokePath::apply const): (WebCore::DisplayList::StrokeInlinePath::localBounds const): (WebCore::DisplayList::StrokeInlinePath::apply const): (WebCore::DisplayList::StrokeInlinePath::StrokeInlinePath): Add `StrokeInlinePath` and `FillInlinePath`, which contain `InlinePathData` instead of `Path` objects and only construct `path()` objects when needed (i.e. when applying to a `GraphicsContext`). (WebCore::DisplayList::SetFillColor::create): Deleted. (WebCore::DisplayList::SetFillColor::apply const): Deleted. (WebCore::DisplayList::SetStrokeState::create): Deleted. (WebCore::DisplayList::SetStrokeState::apply const): Deleted. * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::SetInlineFillGradient::create): (WebCore::DisplayList::SetInlineFillGradient::encode const): (WebCore::DisplayList::SetInlineFillGradient::decode): (WebCore::DisplayList::SetInlineFillColor::color const): (WebCore::DisplayList::SetInlineFillColor::SetInlineFillColor): (WebCore::DisplayList::SetInlineFillColor::encode const): (WebCore::DisplayList::SetInlineFillColor::decode): (WebCore::DisplayList::SetInlineStrokeColor::color const): (WebCore::DisplayList::SetInlineStrokeColor::SetInlineStrokeColor): (WebCore::DisplayList::SetInlineStrokeColor::encode const): (WebCore::DisplayList::SetInlineStrokeColor::decode): (WebCore::DisplayList::SetStrokeThickness::thickness const): (WebCore::DisplayList::SetStrokeThickness::SetStrokeThickness): (WebCore::DisplayList::SetStrokeThickness::encode const): (WebCore::DisplayList::SetStrokeThickness::decode): Pull stroke thickness out into its own display list item. (WebCore::DisplayList::FillInlinePath::create): (WebCore::DisplayList::FillInlinePath::path const): (WebCore::DisplayList::FillInlinePath::encode const): (WebCore::DisplayList::FillInlinePath::decode): (WebCore::DisplayList::StrokeInlinePath::create): (WebCore::DisplayList::StrokeInlinePath::path const): (WebCore::DisplayList::StrokeInlinePath::encode const): (WebCore::DisplayList::StrokeInlinePath::decode): (WebCore::DisplayList::Item::encode const): (WebCore::DisplayList::Item::decode): (WebCore::DisplayList::SetFillColor::color const): Deleted. (WebCore::DisplayList::SetFillColor::SetFillColor): Deleted. (WebCore::DisplayList::SetFillColor::encode const): Deleted. (WebCore::DisplayList::SetFillColor::decode): Deleted. (WebCore::DisplayList::SetStrokeState::color const): Deleted. (WebCore::DisplayList::SetStrokeState::hasColor const): Deleted. (WebCore::DisplayList::SetStrokeState::thickness const): Deleted. (WebCore::DisplayList::SetStrokeState::hasThickness const): Deleted. (WebCore::DisplayList::SetStrokeState::SetStrokeState): Deleted. (WebCore::DisplayList::SetStrokeState::encode const): Deleted. (WebCore::DisplayList::SetStrokeState::decode): Deleted. Split `SetStrokeState` out into separate items tracking thickness and stroke color. * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::containsOnlyInlineStateChanges): Refactor this code so that it emits multiple display list items if multiple inline states change. Previously, this was only done for simultaneous stroke color and stroke thickness changes (via the `SetStrokeState` item); this was done to avoid creating more display list items than needed. However, once all inline display list items are constructed directly in shared memory, there will be (almost) zero overhead for splitting this into separate items. (WebCore::DisplayList::Recorder::appendStateChangeItem): (WebCore::DisplayList::Recorder::willAppendItem): (WebCore::DisplayList::Recorder::fillPath): (WebCore::DisplayList::Recorder::strokePath): (WebCore::DisplayList::containsOnlyStrokeColorOrThicknessChange): Deleted. (WebCore::DisplayList::containsOnlyFillColorChange): Deleted. (WebCore::DisplayList::createStateChangeItem): Deleted. Additionally refactor this method so that it is now a private method that appends to `m_displayList`, instead of returning a display list item to be appended. This will become important in a future patch, which will replace the existing `append` method with a templated version that takes the display list item type as a template argument. * platform/graphics/displaylists/DisplayListRecorder.h: 2020-10-27 Said Abou-Hallawa <said@apple.com> Make RenderingMode a bool enum and remove ShouldAccelerate https://bugs.webkit.org/show_bug.cgi?id=218264 Reviewed by Tim Horton. Convert RenderingMode back to be a bool enum. ShouldAccelerate will be removed so no conversion from RenderingMode to ShouldAccelerate and vice versa is needed anymore. Only one instance of ImageBuffer::create() will be handling creating the remote and display list ImageBuffers. -- Remove unused createImageBuffer() method in HostWindow and ChromeClient. -- Remove unused argument 'ShouldUseDisplayList' from createImageBuffer() of HostWindow, ChromeClient and WebChromeClient. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createImageBuffer const): * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::createBufferForPainting const): * html/HTMLVideoElement.h: * html/ImageBitmap.cpp: (WebCore::ImageBitmap::createPromise): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::createPattern): * page/Chrome.cpp: (WebCore::Chrome::createImageBuffer const): * page/Chrome.h: * page/ChromeClient.h: (WebCore::ChromeClient::createImageBuffer const): * platform/HostWindow.h: * platform/graphics/ImageBuffer.cpp: (WebCore::ImageBuffer::create): * platform/graphics/ImageBuffer.h: * platform/graphics/RenderingMode.h: 2020-10-27 Chris Dumez <cdumez@apple.com> AudioBuffer.getChannelData(x) should keep returning the same JS wrapper for a given channel https://bugs.webkit.org/show_bug.cgi?id=218265 Reviewed by Geoff Garen. AudioBuffer.getChannelData(x) should keep returning the same JS wrapper for a given channel. This is the behavior of Chrome & Firefox and is covered by Web-Platform-Tests. No new tests, rebaselined existing test. * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::AudioBuffer): (WebCore::AudioBuffer::releaseMemory): (WebCore::AudioBuffer::getChannelData): (WebCore::AudioBuffer::visitChannelWrappers): * Modules/webaudio/AudioBuffer.h: * Modules/webaudio/AudioBuffer.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-10-27 Brent Fulgham <bfulgham@apple.com> Remove leftover DiagnosticLoggingKey after r268458 https://bugs.webkit.org/show_bug.cgi?id=218263 <rdar://problem/70738034> Reviewed by Darin Adler. Remove the leftover DiagnosticKey for ResourceLoadStatistics telemetry now that the actual data is no longer generated. * page/DiagnosticLoggingKeys.cpp: (WebCore::DiagnosticLoggingKeys::resourceLoadStatisticsTelemetryKey): Deleted. * page/DiagnosticLoggingKeys.h: 2020-10-27 Jer Noble <jer.noble@apple.com> [Mac] Audio and Video element creation up to 300x slower than other browsers https://bugs.webkit.org/show_bug.cgi?id=218206 <rdar://problem/62451019> Reviewed by Eric Carlson. Tests: PerformanceTests/Media/AudioElementCreation.html PerformanceTests/Media/VideoElementCreation.html Currently, a large percent of the element creation code occurrs as a result of adding its session to PlatformMediaSessionManager, which forces iterating over all extant sessions and then to set various properties of the audio hardware in response. This patch addresses the bulk of those expensive calls, but more performance optimizations are available to further reduce media element creation costs. When an <audio> element is created, we set the preferred audio output buffer size to a large value for performance reasons. However, there's no need to repeatedly call into CoreAudio if the buffer size is already set to that same high value. Store the result of setting the preferred buffer size, and also add a property change listener to detect other callers modifying that same value, so that all set operations with identical sizes become no-ops, and all queries just return cached values. When any media element is created, the entire list of extant sessions is iterated and properties on each are queried. Rather than do these inside the same run-loop, use a TaskQueue to enqueue a task to query the list of created elements during the next run-loop. Between these two optimization, the runtime cost of creating 1000 audio elements is reduced (on this engineer's machine) from 2s to 40ms. * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::beginInterruption): (WebCore::PlatformMediaSessionManager::addSession): (WebCore::PlatformMediaSessionManager::removeSession): (WebCore::PlatformMediaSessionManager::sessionStateChanged): (WebCore::PlatformMediaSessionManager::forEachDocumentSession): (WebCore::PlatformMediaSessionManager::forEachSession): (WebCore::PlatformMediaSessionManager::anyOfSessions const): * platform/audio/PlatformMediaSessionManager.h: * platform/audio/mac/AudioSessionMac.mm: (WebCore::AudioSessionPrivate::addSampleRateObserverIfNeeded): (WebCore::AudioSessionPrivate::handleSampleRateChange): (WebCore::AudioSessionPrivate::addBufferSizeObserverIfNeeded): (WebCore::AudioSessionPrivate::handleBufferSizeChange): (WebCore::AudioSession::sampleRate const): (WebCore::AudioSession::bufferSize const): (WebCore::AudioSession::preferredBufferSize const): (WebCore::AudioSession::setPreferredBufferSize): 2020-10-27 Chris Dumez <cdumez@apple.com> [GPUProcess] Use async IPC for RemoteAudioDestinationManager's StartAudioDestination / StopAudioDestination https://bugs.webkit.org/show_bug.cgi?id=218251 Reviewed by Geoffrey Garen. DefaultAudioDestinationNode::resume() / suspend() were already asynchronous operations. However, they expected AudioDestination::start() / stop() to finish synchronously and would simply call their completion handler asynchronously. Instead, we now make AudioDestination::start() / stop() asynchronous as well. This allows us to use asynchronous IPC for RemoteAudioDestinationManager's StartAudioDestination / StopAudioDestination. As a result of this change, I had to make AudioDestinationNode::startRendering() asynchronous as well since it uses AudioDestination::start() internally. As an improvement, the completion handler to AudioDestinationNode's startRendering() / resume() / suspend() is now provided with an exception in cases where they fail. This allows the call sites to properly deal with such errors instead of assuming things were successsful. No new tests, no Web-facing beahvior change. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::suspendRendering): (WebCore::AudioContext::resumeRendering): (WebCore::AudioContext::startRendering): (WebCore::AudioContext::mayResumePlayback): (WebCore::AudioContext::suspendPlayback): * Modules/webaudio/AudioDestinationNode.h: (WebCore::AudioDestinationNode::resume): (WebCore::AudioDestinationNode::suspend): (WebCore::AudioDestinationNode::close): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::startRendering): (WebCore::DefaultAudioDestinationNode::resume): (WebCore::DefaultAudioDestinationNode::suspend): (WebCore::DefaultAudioDestinationNode::close): * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::startOfflineRendering): (WebCore::OfflineAudioContext::resumeOfflineRendering): * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::startRendering): * Modules/webaudio/OfflineAudioDestinationNode.h: * platform/audio/AudioDestination.h: (WebCore::AudioDestination::start): (WebCore::AudioDestination::stop): * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestinationCocoa::start): (WebCore::AudioDestinationCocoa::stop): * platform/audio/cocoa/AudioDestinationCocoa.h: * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::AudioDestinationGStreamer::start): (WebCore::AudioDestinationGStreamer::stop): * platform/audio/gstreamer/AudioDestinationGStreamer.h: * platform/mock/MockAudioDestinationCocoa.cpp: (WebCore::MockAudioDestinationCocoa::start): (WebCore::MockAudioDestinationCocoa::stop): * platform/mock/MockAudioDestinationCocoa.h: 2020-10-27 Fujii Hironori <Hironori.Fujii@sony.com> [TextureMapper][GTK] Test compositing/clipping/border-radius-stacking-context-clip.html is failing https://bugs.webkit.org/show_bug.cgi?id=214868 Reviewed by Carlos Garcia Campos. If a replica layer has m_state.pos, m_layerTransforms.combined should be translated by them. * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeTransformsRecursive): * platform/graphics/texmap/TextureMapperLayer.h: 2020-10-27 Martin Robinson <mrobinson@igalia.com> Overflow scrollIntoView wrong with borders https://bugs.webkit.org/show_bug.cgi?id=152660 Reviewed by Simon Fraser. Tests: fast/overflow/scrollIntoView-nested-in-area-with-border.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): Offset the exposure rect by the border so that it is relative to the content rectangle. 2020-10-27 Lauro Moura <lmoura@igalia.com> Unreviewed. Followup for r269058: Update bindings reference files * bindings/scripts/test/JS/JSTestDOMJIT.cpp: 2020-10-27 Said Abou-Hallawa <sabouhallawa@apple.com> [GPU Process]: Implement DisplayList::DrawImageBuffer item https://bugs.webkit.org/show_bug.cgi?id=217566 Reviewed by Simon Fraser. Add the DrawImageBuffer DisplayList item. It will be used only for GPU rendering. The renderingResourceIdentifier of the source ImageBuffer will be recorded. For details on how drawing an ImageBuffer to another ImageBuffer works see the WebKit ChangeLog. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawImageBuffer): (WebCore::GraphicsContext::drawConsumingImageBuffer): * platform/graphics/GraphicsContextImpl.h: * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::drawImageBuffer): * platform/graphics/cairo/GraphicsContextImplCairo.h: * platform/graphics/displaylists/DisplayList.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::Item::sizeInBytes): (WebCore::DisplayList::DrawImageBuffer::DrawImageBuffer): (WebCore::DisplayList::DrawImageBuffer::apply const): (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::DrawImageBuffer::create): (WebCore::DisplayList::DrawImageBuffer::renderingResourceIdentifier const): (WebCore::DisplayList::DrawImageBuffer::source const): (WebCore::DisplayList::DrawImageBuffer::destinationRect const): (WebCore::DisplayList::DrawImageBuffer::options const): (WebCore::DisplayList::DrawImageBuffer::encode const): (WebCore::DisplayList::DrawImageBuffer::decode): (WebCore::DisplayList::Item::encode const): (WebCore::DisplayList::Item::decode): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::drawImageBuffer): * platform/graphics/displaylists/DisplayListRecorder.h: (WebCore::DisplayList::Recorder::Delegate::lockRemoteImageBuffer): * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: (Nicosia::CairoOperationRecorder::drawImageBuffer): * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: 2020-10-27 Zalan Bujtas <zalan@apple.com> showRenderTree should output line vertical geometry. https://bugs.webkit.org/show_bug.cgi?id=218252 Reviewed by Antti Koivisto. In addition to the root inlinebox geometry, we should also print the line vertical geometry as they could be very different in certain cases. <div style="line-height: 100px;"> text <img src="broken" style="width: 50px; height: 50px;"> </div> would produce something these: Line: (top: 5 bottom: 59) with leading (top: 0 bottom: 100) RootInlineBox at (0,41) size 51.76x18 (0x137faef70) renderer->(0x137faec00) * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::outputLineBox const): * rendering/RootInlineBox.h: 2020-10-27 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Accessory bar next/previous buttons do not work on inputs in shadow roots https://bugs.webkit.org/show_bug.cgi?id=203292 Reviewed by Ryosuke Niwa. Tests: fast/shadow-dom/ios/accessory-bar-work-on-input-with-tabindex-in-shadow-tree.html * page/FocusController.cpp: (WebCore::FocusController::nextFocusableElement): (WebCore::FocusController::previousFocusableElement): 2020-10-27 Michael Catanzaro <mcatanzaro@gnome.org> Follow-up for: REGRESSION(r267727): Warning spam from JSC_DECLARE_CUSTOM_GETTER https://bugs.webkit.org/show_bug.cgi?id=217585 <rdar://problem/70376946> Unreviewed follow-up to r268587. I missed one spot that needs to use JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL. This is causing warnings in various generated bindings files. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): 2020-10-27 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for vertical-align: -webkit-baseline-middle https://bugs.webkit.org/show_bug.cgi?id=218243 Reviewed by Antti Koivisto. "-webkit-baseline-middle: The center of the element is aligned with the baseline of the text." https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariCSSRef/Articles/StandardCSSProperties.html This patch makes LayoutTests/dom/html/level2/html/ cases not assert. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::alignInlineLevelBoxesVerticallyAndComputeLineBoxHeight): 2020-10-27 Philippe Normand <pnormand@igalia.com> [GStreamer] Bad handling of audio files in the ImageDecoder https://bugs.webkit.org/show_bug.cgi?id=218239 Reviewed by Adrian Perez de Castro. The final main thread notification needs to be blocking otherwise the decoder might get disposed of too early. Test: fast/images/animated-image-mp3-crash.html * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::pushEncodedData): 2020-10-27 Carlos Alberto Lopez Perez <clopez@igalia.com> Fix build for non-unified builds after r269041. https://bugs.webkit.org/show_bug.cgi?id=218233 Unreviewed build fix. Add missing include that can cause a build breakage for non-unified builds or for unified builds depending on how the included files are listed- * rendering/RenderBlockFlow.cpp: 2020-10-27 Kenneth Russell <kbr@chromium.org> [ iOS wk2 ] webgl/1.0.3/conformance/textures/copy-tex-image-2d-formats.html is failing. https://bugs.webkit.org/show_bug.cgi?id=209139 Reviewed by Dean Jackson. On ANGLE backend, use wipeAlphaChannelFromPixels on iOS family, similarly to macOS, when reading back from alpha:false WebGL contexts. On both backends, apply this only for UNSIGNED_BYTE readbacks. Covered by existing WebGL conformance tests. * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::readnPixelsRobustANGLE): * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::readPixels): 2020-10-27 Noam Rosenthal <noam@webkit.org> compositing/iframes/layout-on-compositing-change.html can assert under ContentfulPaintChecker https://bugs.webkit.org/show_bug.cgi?id=218204 <rdar://problem/70694218> Reviewed by Simon Fraser. Paints from child iframes should not be considered when checking for first-contentful-paint. The previous w3c test allegedly checking for it was actualy testing something else. Tests: LayoutTests/imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-ignore-from-subframe.html. * rendering/RenderWidget.cpp: (WebCore::RenderWidget::paint): Avoid iframe painting if we're in contentfulness detection fake-paint. 2020-10-27 Chris Dumez <cdumez@apple.com> Calling AudioContext.suspend() / resume() while already suspended / running should resolve the promise right away https://bugs.webkit.org/show_bug.cgi?id=218236 Reviewed by Sam Weinig. Calling AudioContext.suspend() / resume() while already suspended / running should resolve the promise right away. This is the behavior in the specification [1][2] and matches Blink / Gecko. [1] https://www.w3.org/TR/webaudio/#dom-audiocontext-suspend [2] https://www.w3.org/TR/webaudio/#dom-audiocontext-resume Tests: webaudio/resume-context-while-running.html webaudio/suspend-context-while-suspended.html * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::suspendRendering): (WebCore::AudioContext::resumeRendering): 2020-10-27 Chris Lord <clord@igalia.com> [GLIB] imported/w3c/web-platform-tests/html/canvas/offscreen/line-styles/2d.line.width.transformed.html is a flaky crash https://bugs.webkit.org/show_bug.cgi?id=217986 Reviewed by Simon Fraser. Fix race condition caused by use of OffscreenCanvas::scriptExecutionContext() on main thread. Instead of passing a reference to the OffscreenCanvas object when dealing with the placeholder canvas on the main thread, encapsulate the necessary data in a separate, ThreadSafeRefCounted object and pass that instead, negating the need to call back to the Worker thread to release the reference. Covered by existing tests. * html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::create): (WebCore::OffscreenCanvas::OffscreenCanvas): (WebCore::OffscreenCanvas::detach): (WebCore::OffscreenCanvas::setPlaceholderCanvas): (WebCore::OffscreenCanvas::pushBufferToPlaceholder): (WebCore::OffscreenCanvas::commitToPlaceholderCanvas): * html/OffscreenCanvas.h: 2020-10-27 Antti Koivisto <antti@apple.com> [LFC][Integration] Use iterator for next/previousLinePosition https://bugs.webkit.org/show_bug.cgi?id=218233 Reviewed by Zalan Bujtas. Add the required capabilities to the line iterator and also use them in a few other places. * editing/VisibleUnits.cpp: (WebCore::absoluteLineDirectionPointToLocalPointInBlock): (WebCore::previousLinePosition): (WebCore::nextLinePosition): * layout/integration/LayoutIntegrationInlineContent.cpp: (WebCore::LayoutIntegration::InlineContent::containingBlock const): * layout/integration/LayoutIntegrationInlineContent.h: * layout/integration/LayoutIntegrationLineIterator.cpp: (WebCore::LayoutIntegration::firstLineFor): (WebCore::LayoutIntegration::lastLineFor): (WebCore::LayoutIntegration::LineIterator::closestRunForPoint): (WebCore::LayoutIntegration::LineIterator::closestRunForLogicalLeftPosition): (WebCore::LayoutIntegration::PathLine::blockDirectionPointInLine const): * layout/integration/LayoutIntegrationLineIterator.h: (WebCore::LayoutIntegration::LineIterator::LineIterator): (WebCore::LayoutIntegration::PathLine::y const): (WebCore::LayoutIntegration::PathLine::logicalHeight const): (WebCore::LayoutIntegration::PathLine::isHorizontal const): (WebCore::LayoutIntegration::PathLine::containingBlock const): * layout/integration/LayoutIntegrationLineIteratorLegacyPath.h: (WebCore::LayoutIntegration::LineIteratorLegacyPath::y const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalHeight const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::isHorizontal const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::containingBlock const): * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::LineIteratorModernPath::y const): (WebCore::LayoutIntegration::LineIteratorModernPath::logicalHeight const): (WebCore::LayoutIntegration::LineIteratorModernPath::isHorizontal const): (WebCore::LayoutIntegration::LineIteratorModernPath::containingBlock const): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::firstLine const): (WebCore::LayoutIntegration::LineLayout::lastLine const): * layout/integration/LayoutIntegrationLineLayout.h: (WebCore::LayoutIntegration::LineLayout::flow const): (WebCore::LayoutIntegration::LineLayout::flow): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::findClosestTextAtAbsolutePoint): (WebCore::RenderBlockFlow::positionForPointWithInlineChildren): * rendering/RootInlineBox.cpp: (WebCore::isEditableLeaf): Deleted. (WebCore::RootInlineBox::closestLeafChildForPoint): Deleted. (WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition): Deleted. This functionality moves to the line iterator. * rendering/RootInlineBox.h: 2020-10-27 Miguel Gomez <magomez@igalia.com> [WPE] REGRESSION(r268992) Redefinition of min() inside TextureMapperShaderProgram for GLES > 3.0 https://bugs.webkit.org/show_bug.cgi?id=218231 Reviewed by Sergio Villar Senin. Remove the definition of the min() function and replace its usage with an if. This works for every GLSL version. * platform/graphics/texmap/TextureMapperShaderProgram.cpp: (WebCore::TextureMapperShaderProgram::create): (WebCore::STRINGIFY): Deleted. 2020-10-27 Chris Dumez <cdumez@apple.com> AudioContext.suspend() should not reject promise when audio session is interrupted https://bugs.webkit.org/show_bug.cgi?id=218235 Reviewed by Darin Adler. AudioContext.suspend() should not reject promise when audio session is interrupted. Being "interrupted" is an internal WebKit concept and rejecting the promise here is confusing to Web developers. We now no longer throw when AudioContext.suspend() is called while interrupted. Instead, we set the 'wasSuspendedByJavascript' flag and register a state change listener to resolve the promise when the state changes to "suspended". When the interruption ends, AudioContext::mayResumePlayback() gets called with shouldResume=false, causing us to update the state from "interrupted" to "suspended", which resolves the suspend promise. Test: webaudio/suspend-context-while-interrupted.html * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::suspendRendering): 2020-10-27 Antti Koivisto <antti@apple.com> Assert in BoxTree::layoutBoxForRenderer() under RenderLayer::updateScrollCornerStyle() https://bugs.webkit.org/show_bug.cgi?id=218205 <rdar://problem/70694256> Reviewed by Zalan Bujtas. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::containing): Similar to RenderReplica, RenderScrollbarPart is a fake renderer that is not in the tree even though it has the parent pointer set. 2020-10-27 Zalan Bujtas <zalan@apple.com> RenderStyle::resetPadding sets incorrect computed value (auto) https://bugs.webkit.org/show_bug.cgi?id=218211 Reviewed by Antti Koivisto. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::resetPadding): 2020-10-27 Philippe Normand <pnormand@igalia.com> [GStreamer] Device monitor issue in AudioDestination https://bugs.webkit.org/show_bug.cgi?id=217959 Reviewed by Xabier Rodriguez-Calvar. Remove workaround for false-positive GstDeviceMonitor critical warnings. The GStreamer patch fixing this issue was backported to the Flatpak SDK in bug #218021. * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::maximumNumberOfOutputChannels): 2020-10-27 Xabier Rodriguez Calvar <calvaris@igalia.com> [EME][GStreamer] Decode base64 init data if needed https://bugs.webkit.org/show_bug.cgi?id=218175 Reviewed by Philippe Normand. There are certain strings with certain key systems that deliver initialization data encoded as base64 so we need to decode it first. * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: (WebCore::InitData::InitData): (WebCore::InitData::decodeBase64IfNeeded): 2020-10-15 Sergio Villar Senin <svillar@igalia.com> [WebXR] Move OpenXR calls off the main thread https://bugs.webkit.org/show_bug.cgi?id=217752 Reviewed by Youenn Fablet. The OpenXR API is synchronous. Many of the calls involve dealing with external hardware devices meaning that they have to potential to block the main thread. They should be moved to a different thread in order to avoid that. The PlatformXR::Instance creates a WorkQueue which is going to be used by the OpenXR devices to issue OpenXR calls and also serialize them to ensure that they are executed sequentially. The OpenXRDevice's are created in the main thread anyway because we need to get weak pointers from them in the main thread. * Modules/webxr/WebXRSystem.cpp: (WebCore::WebXRSystem::ensureImmersiveXRDeviceIsSelected): Use a scoped exit to call callback. Also the Vector of immersive devices is now a pointer which might be null, meaning no available devices. * platform/xr/PlatformXR.h: Added a "using" for the Vector of devices. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::Instance::Impl::queue const): New getter returning the WorkQueue. (PlatformXR::Instance::Impl::enumerateApiLayerProperties const): Added an ASSERT. (PlatformXR::Instance::Impl::checkInstanceExtensionProperties const): Ditto. (PlatformXR::Instance::Impl::Impl): Create the OpenXR WorkQueue and dispatch a task to perform the OpenXR system initialization in the queue. (PlatformXR::Instance::Impl::~Impl): Delete the instance in the WorkQueue (PlatformXR::Instance::enumerateImmersiveXRDevices): Moved the code to a task in the WorkQueue. (PlatformXR::OpenXRDevice::OpenXRDevice): Ditto. Also added a completion handler to notify the caller about the end of the device initialization process. (PlatformXR::OpenXRDevice::collectSupportedSessionModes): Added an ASSERT. (PlatformXR::OpenXRDevice::collectConfigurationViews): Ditto. * platform/xr/openxr/PlatformXROpenXR.h: Added WorkQueue attribute and parameter to device constructor. 2020-10-27 Xabier Rodriguez Calvar <calvaris@igalia.com> [EME][GStreamer] Fix logging in utilities https://bugs.webkit.org/show_bug.cgi?id=218174 Reviewed by Philippe Normand. There is some logging in GStreamerEMEUtilities.h that was not using debugging categories properly. It does now. * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: (WebCore::InitData::InitData): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: 2020-10-27 Xabier Rodriguez Calvar <calvaris@igalia.com> [EME][GStreamer][Thunder] Make response parsing message more robust https://bugs.webkit.org/show_bug.cgi?id=218172 Reviewed by Philippe Normand. ParsedResponseMessage checks now for empty buffers and we assert on that in the code. We also add some other checks that could trigger crashes if failed. No new tests needed, just a rework. * platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::ParsedResponseMessage::ParsedResponseMessage): (WebCore::ParsedResponseMessage::isValid const): (WebCore::ParsedResponseMessage::operator bool const): (WebCore::ParsedResponseMessage::operator! const): (WebCore::CDMInstanceSessionThunder::challengeGeneratedCallback): (WebCore::CDMInstanceSessionThunder::updateLicense): (WebCore::CDMInstanceSessionThunder::loadSession): (WebCore::CDMInstanceSessionThunder::removeSessionData): 2020-10-27 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Make WebCore::FocusDirection to enum class https://bugs.webkit.org/show_bug.cgi?id=218162 Reviewed by Darin Adler. * dom/Document.cpp: (WebCore::Document::adjustFocusedNodeOnNodeRemoval): (WebCore::Document::focusNavigationStartingNode const): * dom/Document.h: * dom/Element.h: * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::handleFocusEvent): * page/EventHandler.cpp: (WebCore::focusDirectionForKey): (WebCore::handleKeyboardSelectionMovement): (WebCore::EventHandler::accessibilityPreventsEventPropagation): (WebCore::EventHandler::defaultKeyboardEventHandler): (WebCore::EventHandler::defaultTabEventHandler): * page/FocusController.cpp: (WebCore::dispatchEventsOnWindowAndFocusedElement): (WebCore::FocusController::advanceFocus): (WebCore::FocusController::findFocusableElementAcrossFocusScope): (WebCore::FocusController::findFocusableElementWithinScope): (WebCore::FocusController::findFocusableElementOrScopeOwner): (WebCore::FocusController::findElementWithExactTabIndex): (WebCore::FocusController::nextFocusableElementOrScopeOwner): (WebCore::FocusController::previousFocusableElementOrScopeOwner): * page/FocusController.h: * page/FocusDirection.h: * page/SpatialNavigation.cpp: (WebCore::isHorizontalMove): (WebCore::areRectsFullyAligned): (WebCore::areRectsMoreThanFullScreenApart): (WebCore::isRectInDirection): (WebCore::hasOffscreenRect): (WebCore::scrollInDirection): (WebCore::canScrollInDirection): (WebCore::entryAndExitPointsForDirection): (WebCore::isValidCandidate): (WebCore::distanceDataForNode): (WebCore::canBeScrolledIntoView): (WebCore::virtualRectForDirection): * page/SpatialNavigation.h: 2020-10-27 Kimmo Kinnunen <kkinnunen@apple.com> REGRESSION (r268386): Flashes of inverted color when zooming the map on windy.com https://bugs.webkit.org/show_bug.cgi?id=218177 <rdar://problem/70676037> Reviewed by Dean Jackson. Refactoring r268386 changed the behavior so that a new WebGL drawing buffer would be created when CA would be using the oldest IOSurface display buffer of the WebGL layer. Before r268386 the WebGL would just draw on top of the IOSurface even if CA was using it. This change made the existing bug of using uninitialized IOSurfaces visible, since IOSurfaces seem to be initialized with red. The existing bug was probably in r262366. The fix in this commit fixes the case where WebGL context is drawn to but the CA does not display the contents. Draw would cause preparation of the drawing buffer for display, along with the contract that drawing buffer might be uninitialized. However, the clear of the drawing buffer was marked needed only during display. Case that failed at the time of writing was the case where after draw, the element would be removed by setting display:none. This would return red contents, e.g. uninitialized IOSurface contents. Before r268386 this would first return red until 3 buffers had passed and then it would start recycling old display buffer contents. The naming is not fixed in this commit due to just fixing the regression. Other ports contain code that makes renaming or restructuring the callbacks more confusing for the other ports. Test: fast/canvas/webgl/webgl-clear-composited-notshowing.html * WebCore.xcodeproj/project.pbxproj: * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::prepareForDisplay): * platform/graphics/cocoa/WebGLLayer.h: * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer initWithDevicePixelRatio:contentsOpaque:]): (-[WebGLLayer display]): (-[WebGLLayer detachClient]): * platform/graphics/cocoa/WebGLLayerClient.h: Removed. * platform/graphics/opengl/GraphicsContextGLOpenGL.h: 2020-10-26 Said Abou-Hallawa <sabouhallawa@apple.com> [GPU Process]: Introduce RemoteResourceCacheProxy to manage the remote resources in Web Process https://bugs.webkit.org/show_bug.cgi?id=217558 Reviewed by Simon Fraser. Rename Recorder::Observer to Recorder::Delegate because it will be responsible for creating DisplayListItems in future patches. So it will not be just an observer. Also do not make DisplayList::ImageBuffer a superclass of it. RemoteImageBufferProxy, which is a superclass of DisplayList::ImageBuffer, will be the superclass of Recorder::Delegate. Make ImageBufferBackend::isAccelerated a static member instead of a virtual method. RemoteRenderingBackendProxy would want to know whether the backend of an ImageBuffer isAccelerated or not without having to create it. ImageBufferBackend::isAccelerated will be set to false and ImageBufferIOSurfaceBackend::isAccelerated will be set to true. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/ConcreteImageBuffer.h: * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::renderingResourceIdentifier const): * platform/graphics/ImageBufferBackend.h: (WebCore::ImageBufferBackend::isAccelerated const): Deleted. * platform/graphics/RenderingResourceIdentifier.h: Renamed from Source/WebCore/platform/graphics/RemoteResourceIdentifier.h. * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: (WebCore::ImageBufferIOSurfaceBackend::isAccelerated const): Deleted. * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: * platform/graphics/displaylists/DisplayListDrawingContext.cpp: (WebCore::DisplayList::DrawingContext::DrawingContext): * platform/graphics/displaylists/DisplayListDrawingContext.h: (WebCore::DisplayList::DrawingContext::DrawingContext): * platform/graphics/displaylists/DisplayListImageBuffer.h: (WebCore::DisplayList::ImageBuffer::ImageBuffer): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::Recorder): (WebCore::DisplayList::Recorder::willAppendItem): * platform/graphics/displaylists/DisplayListRecorder.h: (WebCore::DisplayList::Recorder::Delegate::~Delegate): (WebCore::DisplayList::Recorder::Observer::~Observer): Deleted. (WebCore::DisplayList::Recorder::Observer::willAppendItem): Deleted. 2020-10-26 Stephan Szabo <stephan.szabo@sony.com> evictCodedFrames does extra work if RELEASE_LOG_DISABLED is set https://bugs.webkit.org/show_bug.cgi?id=218203 Reviewed by Eric Carlson. Undo part of previous logging change that prevents checking if the buffer is still full after the first part of eviction if RELEASE_LOG_DISABLED is set. * Modules/mediasource/SourceBuffer.cpp: 2020-10-26 Simon Fraser <simon.fraser@apple.com> REGRESSION (r260276): Unable to click on image and text link at the bottom of https://www.nytimes.com/ article https://bugs.webkit.org/show_bug.cgi?id=218137 <rdar://problem/70439526> Reviewed by Zalan Bujtas. r238725 made RenderLayers for accelerated overflow:scroll be self-painting, but that changes paint and hit-testing order, which affected this nytimes article (the failing element has large negative margin-top). This is the fundamental compositing bug, but we can work around it in this case by only making the layer self-painting if it does actually scroll. Test: fast/layers/overflow-scroll-self-painting.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateScrollInfoAfterLayout): Need to update isSelfPaintingLayer() after layout because now it depends on scrollable overflow. (WebCore::RenderLayer::shouldBeSelfPaintingLayer const): Consult hasCompositedScrollableOverflow() rather than canUseCompositedScrolling(). 2020-10-26 Chris Dumez <cdumez@apple.com> Improve exception messages when AudioContext.suspend() / resume() promises are rejected https://bugs.webkit.org/show_bug.cgi?id=218210 Reviewed by Geoffrey Garen. Improve exception messages when AudioContext.suspend() / resume() promises are rejected. No new tests, rebaselined existing tests. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::suspendRendering): (WebCore::AudioContext::resumeRendering): 2020-10-26 Adrian Perez de Castro <aperez@igalia.com> Unreviewed non-unified build fix * animation/KeyframeEffectStack.h: Add missing forward declaration for RenderStyle. * workers/WorkerOrWorkletThread.cpp: Add missing headers ThreadGlobalData.h and WorkerOrWorkletGlobalScope.h 2020-10-26 Truitt Savell <tsavell@apple.com> Unreviewed, reverting r268947. Caused 60 image failures on Catalina WK2 Reverted changeset: "REGRESSION (r260276): Unable to click on image and text link at the bottom of https://www.nytimes.com/ article" https://bugs.webkit.org/show_bug.cgi?id=218137 https://trac.webkit.org/changeset/268947 2020-10-26 Antti Koivisto <antti@apple.com> [LFC][Integration] Use term "modern line layout" in RenderBlockFlow https://bugs.webkit.org/show_bug.cgi?id=218200 Reviewed by Zalan Bujtas. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::containing): (WebCore::LayoutIntegration::LineLayout::releaseCaches): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutInlineChildren): (WebCore::RenderBlockFlow::styleDidChange): (WebCore::RenderBlockFlow::hitTestInlineChildren): (WebCore::RenderBlockFlow::addOverflowFromInlineChildren): (WebCore::RenderBlockFlow::markLinesDirtyInBlockRange): (WebCore::RenderBlockFlow::firstLineBaseline const): (WebCore::RenderBlockFlow::inlineBlockBaseline const): (WebCore::RenderBlockFlow::lineCount const): (WebCore::RenderBlockFlow::paintInlineChildren): (WebCore::RenderBlockFlow::hasLines const): (WebCore::RenderBlockFlow::invalidateLineLayoutPath): (WebCore::RenderBlockFlow::layoutModernLines): (WebCore::RenderBlockFlow::ensureLineBoxes): (WebCore::RenderBlockFlow::layoutLFCLines): Deleted. * rendering/RenderBlockFlow.h: (WebCore::RenderBlockFlow::hasModernLineLayout const): (WebCore::RenderBlockFlow::modernLineLayout const): (WebCore::RenderBlockFlow::modernLineLayout): (WebCore::RenderBlockFlow::hasLayoutFormattingContextLineLayout const): Deleted. (WebCore::RenderBlockFlow::layoutFormattingContextLineLayout const): Deleted. (WebCore::RenderBlockFlow::layoutFormattingContextLineLayout): Deleted. 2020-10-26 Alex Christensen <achristensen@webkit.org> Inclusive software: Remove instances of "dumb" from the code https://bugs.webkit.org/show_bug.cgi?id=217778 Reviewed by Simon Fraser. * Modules/webaudio/AudioNode.h: * dom/GCReachableRef.h: * page/EventHandler.cpp: (WebCore::EventHandler::handleDrag): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::addToLine): 2020-10-26 Fujii Hironori <Hironori.Fujii@sony.com> [TextureMapper] min(genIType) isn't supported for GLSL ES < 3.0 https://bugs.webkit.org/show_bug.cgi?id=218164 Reviewed by Don Olmstead. Nothing is drawn in AC mode of WinCairo port since r268923. r268923 added a shader code of using min of int type which is supported since GLSL ES 3.0. * platform/graphics/texmap/TextureMapperShaderProgram.cpp: Added fragmentTemplateES to define int type of min. (WebCore::TextureMapperShaderProgram::create): 2020-10-26 Sam Weinig <weinig@apple.com> JSC special function forward declarations (e.g. JSC_DECLARE_HOST_FUNCTION) that are internal to a cpp file should be declared with static to avoid external linkage https://bugs.webkit.org/show_bug.cgi?id=218159 Reviewed by Darin Adler. Add static prefix when declarations are constrained to the cpp file. This should help out the linker by using the correct linkage type. * page/DOMWindow.idl: * bindings/js/JSDOMWindowCustom.cpp: Add ForwardDeclareInHeader to showModalDialog to allow it to be access from JSDOMWindowCustom.cpp. This also means we can remove the redundant forward declaration. * bindings/scripts/CodeGeneratorJS.pm: Prefix declarations that are constrained to the cpp files with static. * bindings/scripts/test/JS/JSDOMWindow.cpp: * bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.cpp: * bindings/scripts/test/JS/JSExposedToWorkerAndWindow.cpp: * bindings/scripts/test/JS/JSPaintWorkletGlobalScope.cpp: * bindings/scripts/test/JS/JSServiceWorkerGlobalScope.cpp: * bindings/scripts/test/JS/JSTestCEReactions.cpp: * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: * bindings/scripts/test/JS/JSTestCallTracer.cpp: * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: * bindings/scripts/test/JS/JSTestConditionalIncludes.cpp: * bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp: * bindings/scripts/test/JS/JSTestDOMJIT.cpp: * bindings/scripts/test/JS/JSTestDefaultToJSON.cpp: * bindings/scripts/test/JS/JSTestDefaultToJSONFilteredByExposed.cpp: * bindings/scripts/test/JS/JSTestDefaultToJSONIndirectInheritance.cpp: * bindings/scripts/test/JS/JSTestDefaultToJSONInherit.cpp: * bindings/scripts/test/JS/JSTestDefaultToJSONInheritFinal.cpp: * bindings/scripts/test/JS/JSTestDomainSecurity.cpp: * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: * bindings/scripts/test/JS/JSTestEnabledForContext.cpp: * bindings/scripts/test/JS/JSTestEventConstructor.cpp: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestException.cpp: * 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/JSTestLegacyFactoryFunction.cpp: * bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.cpp: * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.cpp: * bindings/scripts/test/JS/JSTestMapLike.cpp: * bindings/scripts/test/JS/JSTestMapLikeWithOverriddenOperations.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.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/JSTestNamedSetterWithLegacyOverrideBuiltIns.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp: * bindings/scripts/test/JS/JSTestNode.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestOperationConditional.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: * bindings/scripts/test/JS/JSTestPluginInterface.cpp: * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: * bindings/scripts/test/JS/JSTestReadOnlyMapLike.cpp: * bindings/scripts/test/JS/JSTestReadOnlySetLike.cpp: * bindings/scripts/test/JS/JSTestReportExtraMemoryCost.cpp: * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: * bindings/scripts/test/JS/JSTestSetLike.cpp: * bindings/scripts/test/JS/JSTestSetLikeWithOverriddenOperations.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: * bindings/scripts/test/JS/JSWorkerGlobalScope.cpp: * bindings/scripts/test/JS/JSWorkletGlobalScope.cpp: Update tests with new output. 2020-10-26 Peng Liu <peng.liu6@apple.com> Clean up CAAudioStreamDescription https://bugs.webkit.org/show_bug.cgi?id=217552 Reviewed by Youenn Fablet. Remove an unused private function. * platform/audio/cocoa/CAAudioStreamDescription.h: 2020-10-26 Peng Liu <peng.liu6@apple.com> Video immediately exits full screen and pauses https://bugs.webkit.org/show_bug.cgi?id=218103 Reviewed by Jer Noble. A follow-up patch of r265437 to enable the quirk when a video element's class names contain `amp-html5` and `amp-media-element`. * page/Quirks.cpp: (WebCore::Quirks::needsAkamaiMediaPlayerQuirk const): 2020-10-26 Antti Koivisto <antti@apple.com> Move some functions from RenderBlockFlow to RenderDeprecatedFlexbox https://bugs.webkit.org/show_bug.cgi?id=218194 Reviewed by Zalan Bujtas. It is the only client. * rendering/EllipsisBox.cpp: (WebCore::EllipsisBox::markupBox const): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::lineAtIndex const): Deleted. (WebCore::getHeightForLineCount): Deleted. (WebCore::RenderBlockFlow::heightForLineCount): Deleted. * rendering/RenderBlockFlow.h: * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::shouldCheckLines): (WebCore::lineAtIndex): (WebCore::getHeightForLineCount): (WebCore::heightForLineCount): (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp): 2020-10-26 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Account for margin start when setting the renderer's border box location https://bugs.webkit.org/show_bug.cgi?id=218190 Reviewed by Antti Koivisto. After r268950 replaced runs start at the margin box logical left. Let's offset the border box location with the margin value. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::appendInlineContainerStart): <span> should take negative margins into account as well. (WebCore::Layout::Line::appendNonReplacedInlineBox): rename. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): 2020-10-26 Youenn Fablet <youenn@apple.com> Use a WeakHashSet for Document::m_captionPreferencesChangedElements https://bugs.webkit.org/show_bug.cgi?id=218170 Reviewed by Eric Carlson. Refactoring to move from raw pointer to weak pointer. For that purpose, we use WeakHashSet and WeakHashSet::forEach for extra safety. No observable change of behavior. * dom/Document.cpp: (WebCore::Document::registerForCaptionPreferencesChangedCallbacks): (WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks): (WebCore::Document::captionPreferencesChanged): * dom/Document.h: 2020-10-26 Youenn Fablet <youenn@apple.com> Make use of signalling thread when creating the peer connection factory https://bugs.webkit.org/show_bug.cgi?id=218169 Reviewed by Eric Carlson. Covered by existing tests. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::LibWebRTCProvider::factory): This will free the networking thread from some tasks which is better for performance reasons, as well as more consistent. 2020-10-26 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer][EME] Remove unused protection even in common decryptor https://bugs.webkit.org/show_bug.cgi?id=218183 Reviewed by Philippe Normand. Removing unused decryptor attribute, reminiscence of the past. * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: 2020-10-26 Antti Koivisto <antti@apple.com> [LFC][Integration] Allow all replaced elements https://bugs.webkit.org/show_bug.cgi?id=218074 Reviewed by Zalan Bujtas. Add a #define to allow all RenderReplaced in modern line layout. Also add one for inline-blocks. Both are disabled for now. * layout/integration/LayoutIntegrationBoxTree.cpp: (WebCore::LayoutIntegration::BoxTree::buildTree): * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForChild): (WebCore::LayoutIntegration::canUseForLineLayoutWithReason): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::containing): (WebCore::LayoutIntegration::LineLayout::hitTest): Implement hit testing. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutLFCLines): 2020-10-26 Xabier Rodriguez Calvar <calvaris@igalia.com> [EME] Fix casts and sizes printing https://bugs.webkit.org/show_bug.cgi?id=218171 Reviewed by Philippe Normand. Fix size printing and casts in CDMThunder and ClearKey. * platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp: (WebCore::CDMProxyClearKey::cencDecryptSubsampled): * platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::ParsedResponseMessage::ParsedResponseMessage): (WebCore::CDMInstanceSessionThunder::requestLicense): (WebCore::CDMInstanceSessionThunder::updateLicense): (WebCore::CDMInstanceSessionThunder::loadSession): (WebCore::CDMInstanceSessionThunder::removeSessionData): 2020-10-26 Zalan Bujtas <zalan@apple.com> [LFC] Rename functions with ContentWidth/HeightAndMargin return type https://bugs.webkit.org/show_bug.cgi?id=218165 Reviewed by Antti Koivisto. E.g. inlineBlockWidthAndMargin does not indicate whether it computes border, padding or content box width. Let's rename Geometry::*WidthAndMargin and Geometry::*HeightAndMargin to Geometry::*ContentWidthAndMargin and Geometry::*ContentHeightAndMargin. * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedContentWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedContentHeightAndMargin const): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedContentWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingContentHeightAndMargin const): (WebCore::Layout::FormattingContext::Geometry::floatingContentWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedContentHeightAndMargin const): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedContentWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): Deleted. (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin const): Deleted. (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Deleted. (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin const): Deleted. (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): Deleted. (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const): Deleted. (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedContentHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedContentWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedContentWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowContentHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowContentWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::computedContentWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::computedWidthAndMargin): Deleted. * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin): (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockContentWidthAndMargin): (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockContentHeightAndMargin const): (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin): Deleted. (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const): Deleted. 2020-10-26 Youenn Fablet <youenn@apple.com> Add support for VP9 Profile 2 (10-bit color) in WebRTC https://bugs.webkit.org/show_bug.cgi?id=217673 <rdar://problem/70283885> Reviewed by Eric Carlson. In case software VP9 decoded buffer is 10 bits, we use kCVPixelFormatType_420YpCbCr10BiPlanarFullRange. Test: webrtc/vp9-profile2.html * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool): (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame): * platform/mediastream/mac/RealtimeVideoUtilities.h: * platform/mediastream/mac/RealtimeVideoUtilities.mm: (WebCore::createPixelBufferPool): 2020-10-26 Youenn Fablet <youenn@apple.com> Remove MediaPlayer::m_visible https://bugs.webkit.org/show_bug.cgi?id=217810 Reviewed by Eric Carlson. MediaPlayer::visible() is only used by MediaPlayerPrivateAVFoundation and MediaPlayerPrivateGStreamer but they have their own m_visible state. We need to keep m_visible and add m_visibleForCanvas to keep the state when changing of engine. No change of behavior. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::setVisible): (WebCore::MediaPlayer::setVisibleForCanvas): * platform/graphics/MediaPlayer.h: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::preferredRenderingMode const): (WebCore::MediaPlayerPrivateAVFoundation::isReadyForVideoSetup const): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::paint): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: 2020-10-26 Xabier Rodriguez Calvar <calvaris@igalia.com> [EME][Thunder][GStreamer] Assert on 0 length messages from Thunder https://bugs.webkit.org/show_bug.cgi?id=218173 Reviewed by Philippe Normand. * platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::CDMInstanceSessionThunder::CDMInstanceSessionThunder): Assert on 0 length messages to get a crash and be able to analyze why. 2020-10-26 Emilio Cobos Álvarez <emilio@crisal.io> Drop sorting and deduplication of media queries. https://bugs.webkit.org/show_bug.cgi?id=217751 Reviewed by Simon Fraser. This matches what Gecko has shipped for ages. The spec used to contain the sorting but not the de-duplication. Both the spec and Chromium have been updated to match Gecko, see https://github.com/w3c/csswg-drafts/issues/5627 * css/MediaQuery.cpp: (WebCore::MediaQuery::MediaQuery): Don't sort / dedup Tests: imported/w3c/web-platform-tests/css/cssom/mediaquery-sort-dedup.html 2020-10-25 Sam Weinig <weinig@apple.com> Remove non-standard 'css'/'Css' prefixed properties on CSSStyleDeclaration https://bugs.webkit.org/show_bug.cgi?id=218158 Reviewed by Simon Fraser. Remove support for 'css'/'Css' prefixed properties of CSSStyleDeclaration which are no longer supported by any other browser. * css/CSSStyleDeclaration.cpp: * css/makeprop.pl: 2020-10-25 Simon Fraser <simon.fraser@apple.com> [LFC Display] Move code for painting a single Display::Box into its own class https://bugs.webkit.org/show_bug.cgi?id=218161 Reviewed by Antti Koivisto. Move box-painting code into its own class, so that CSSPainter is about CSS stacking context logic, and BoxPainter is about how to paint a single box. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * display/css/DisplayBoxPainter.cpp: Copied from Source/WebCore/display/css/DisplayCSSPainter.cpp. (WebCore::Display::BoxPainter::paintFillLayer): (WebCore::Display::BoxPainter::paintBackgroundImages): (WebCore::Display::BoxPainter::paintBoxDecorations): (WebCore::Display::BoxPainter::paintBoxContent): (WebCore::Display::BoxPainter::paintBox): * display/css/DisplayBoxPainter.h: Copied from Source/WebCore/display/css/DisplayCSSPainter.h. * display/css/DisplayCSSPainter.cpp: (WebCore::Display::CSSPainter::recursivePaintDescendants): (WebCore::Display::CSSPainter::paintStackingContext): (WebCore::Display::CSSPainter::paintFillLayer): Deleted. (WebCore::Display::CSSPainter::paintBackgroundImages): Deleted. (WebCore::Display::CSSPainter::paintBoxDecorations): Deleted. (WebCore::Display::CSSPainter::paintBoxContent): Deleted. (WebCore::Display::CSSPainter::paintBox): Deleted. * display/css/DisplayCSSPainter.h: 2020-10-25 Simon Fraser <simon.fraser@apple.com> [LFC Display] Move display box creation and geometry computation out of Display::TreeBuilder https://bugs.webkit.org/show_bug.cgi?id=218160 Reviewed by Zalan Bujtas. Make Display::BoxFactory, which has the responsibility of making Display::Boxes, and setting up their style and geometry. This moves all of the pixel snapping code out of Display::TreeBuilder. Display::Box subclasses declare Display::BoxFactory as a friend class so that the factory can call geometry setter functions (to avoid passing long lists of arguments down through constructors). Display::TextBox's text() is no longer Optional<> because we only make text boxes for runs with text. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::TreeBuilder): (WebCore::Display::TreeBuilder::build const): (WebCore::Display::TreeBuilder::buildInlineDisplayTree const): (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const): (WebCore::Display::TreeBuilder::computeBoxDecorationData const): Deleted. (WebCore::Display::TreeBuilder::displayBoxForRootBox const): Deleted. (WebCore::Display::TreeBuilder::displayBoxForLayoutBox const): Deleted. * display/DisplayTreeBuilder.h: * display/css/DisplayBoxDecorationData.cpp: (WebCore::Display::BoxDecorationData::create): Deleted. * display/css/DisplayBoxDecorationData.h: * display/css/DisplayBoxFactory.cpp: Added. (WebCore::Display::BoxFactory::BoxFactory): (WebCore::Display::BoxFactory::displayBoxForRootBox const): (WebCore::Display::BoxFactory::displayBoxForLayoutBox const): (WebCore::Display::BoxFactory::displayBoxForTextRun const): (WebCore::Display::BoxFactory::setupBoxGeometry const): (WebCore::Display::BoxFactory::constructBoxDecorationData const): (WebCore::Display::BoxFactory::setupBoxModelBox const): * display/css/DisplayBoxFactory.h: Copied from Source/WebCore/display/DisplayTreeBuilder.h. * display/css/DisplayBoxModelBox.cpp: * display/css/DisplayBoxModelBox.h: (WebCore::Display::BoxModelBox::absoluteBorderBoxRect const): (WebCore::Display::BoxModelBox::absolutePaddingBoxRect const): (WebCore::Display::BoxModelBox::absoluteContentBoxRect const): (WebCore::Display::BoxModelBox::boxDecorationData const): (WebCore::Display::BoxModelBox::setAbsolutePaddingBoxRect): (WebCore::Display::BoxModelBox::setAbsoluteContentBoxRect): * display/css/DisplayCSSPainter.cpp: (WebCore::Display::CSSPainter::paintBoxContent): * display/css/DisplayFillLayerImageGeometry.cpp: (WebCore::Display::calculateFillLayerImageGeometry): * display/css/DisplayFillLayerImageGeometry.h: * display/css/DisplayImageBox.cpp: (WebCore::Display::ImageBox::ImageBox): (WebCore::Display::m_image): (): Deleted. (WebCore::Display::ImageBox::setImage): Deleted. * display/css/DisplayImageBox.h: (WebCore::Display::ImageBox::image const): * display/css/DisplayReplacedBox.cpp: (WebCore::Display::ReplacedBox::ReplacedBox): * display/css/DisplayReplacedBox.h: (WebCore::Display::ReplacedBox::setReplacedContentRect): * display/css/DisplayTextBox.cpp: (WebCore::Display::m_text): (WebCore::Display::TextBox::debugDescription const): * display/css/DisplayTextBox.h: (WebCore::Display::TextBox::text const): 2020-10-25 Sam Weinig <weinig@apple.com> Remove support for 'pixel' and 'pos' CSSOM prefixes https://bugs.webkit.org/show_bug.cgi?id=119712 Reviewed by Simon Fraser. Remove support for pixel/pos prefixed properties of CSSStyleDeclaration which are no longer supported by any other browser. * bindings/scripts/CodeGeneratorJS.pm: (GenerateAttributeGetterBodyDefinition): (GenerateAttributeSetterBodyDefinition): * css/CSSStyleDeclaration.cpp: (WebCore::CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName): (WebCore::CSSStyleDeclaration::getPropertyValueInternalForPosOrPixelPrefixed): Deleted. (WebCore::CSSStyleDeclaration::setPropertyValueInternalForPosOrPixelPrefixed): Deleted. * css/CSSStyleDeclaration.h: * css/makeprop.pl: 2020-10-24 Simon Fraser <simon.fraser@apple.com> [LFC Display] Implement background image painting https://bugs.webkit.org/show_bug.cgi?id=218155 Reviewed by Zalan Bujtas. Introduce BoxDecorationData, which stores per-Box box pixel-snapped geometry for backgrounds and borders. A BoxModelBox that has box decorations will own one. BoxDecorationData has a vector of FillLayerImageGeometry, which stores pixel-snapped geometry for background image painting. Code in DisplayFillLayerImageGeometry computes this geometry (code based on rendering code). BoxModelBox needs to store pixel snapped padding and content boxes for decoration painting. Currently TreeBuilder::computeBoxDecorationData() sets up these rects and makes BoxDecorationData, but this isn't really tree building, so I'd like to move that code somewhere else in future patches. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::computeBoxDecorationData const): (WebCore::Display::TreeBuilder::displayBoxForLayoutBox const): * display/DisplayTreeBuilder.h: * display/css/DisplayBox.cpp: * display/css/DisplayBox.h: * display/css/DisplayBoxDecorationData.cpp: Copied from Source/WebCore/display/css/DisplayBox.cpp. (WebCore::Display::BoxDecorationData::create): * display/css/DisplayBoxDecorationData.h: Copied from Source/WebCore/display/css/DisplayCSSPainter.h. (WebCore::Display::BoxDecorationData::backgroundImageGeometry const): (WebCore::Display::BoxDecorationData::setBackgroundImageGeometry): (WebCore::Display::BoxDecorationData::roundedBorderRect const): (WebCore::Display::BoxDecorationData::setRoundedBorderRect): * display/css/DisplayBoxModelBox.cpp: (WebCore::Display::BoxModelBox::setBoxDecorationData): * display/css/DisplayBoxModelBox.h: (WebCore::Display::BoxModelBox::absolutePaddingBoxRect const): (WebCore::Display::BoxModelBox::setAbsolutePaddingBoxRect): (WebCore::Display::BoxModelBox::absoluteContentBoxRect const): (WebCore::Display::BoxModelBox::setAbsoluteContentBoxRect): (WebCore::Display::BoxModelBox::boxDecorationData const): * display/css/DisplayCSSPainter.cpp: (WebCore::Display::CSSPainter::paintFillLayer): (WebCore::Display::CSSPainter::paintBackgroundImages): (WebCore::Display::CSSPainter::paintBoxDecorations): * display/css/DisplayCSSPainter.h: * display/css/DisplayFillLayerImageGeometry.cpp: Added. (WebCore::Display::resolveWidthForRatio): (WebCore::Display::resolveHeightForRatio): (WebCore::Display::resolveAgainstIntrinsicWidthOrHeightAndRatio): (WebCore::Display::resolveAgainstIntrinsicRatio): (WebCore::Display::calculateImageIntrinsicDimensions): (WebCore::Display::calculateFillTileSize): (WebCore::Display::getSpace): (WebCore::Display::resolveEdgeRelativeLength): (WebCore::Display::pixelSnappedFillLayerImageGeometry): (WebCore::Display::geometryForLayer): (WebCore::Display::calculateFillLayerImageGeometry): * display/css/DisplayFillLayerImageGeometry.h: Copied from Source/WebCore/display/DisplayTreeBuilder.h. (WebCore::Display::FillLayerImageGeometry::FillLayerImageGeometry): (WebCore::Display::FillLayerImageGeometry::destRect const): (WebCore::Display::FillLayerImageGeometry::phase const): (WebCore::Display::FillLayerImageGeometry::tileSize const): (WebCore::Display::FillLayerImageGeometry::spaceSize const): (WebCore::Display::FillLayerImageGeometry::hasNonLocalGeometry const): (WebCore::Display::FillLayerImageGeometry::relativePhase const): (WebCore::Display::FillLayerImageGeometry::clip): * display/css/DisplayStyle.cpp: (WebCore::Display::deepCopy): (WebCore::Display::Style::Style): (WebCore::Display::Style::hasBackgroundImage const): * display/css/DisplayStyle.h: (WebCore::Display::Style::backgroundLayers const): (WebCore::Display::Style::hasBackgroundImage const): Deleted. 2020-10-24 Simon Fraser <simon.fraser@apple.com> [LFC Display] Create display boxes for atomic inlines and inline blocks https://bugs.webkit.org/show_bug.cgi?id=218153 Reviewed by Zalan Bujtas. When iterating line runs, recurse into container layout boxes for inline-block, and make display boxes for other textless runs for other atomic inlines like replaced elements. * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::buildInlineDisplayTree const): 2020-10-24 Simon Fraser <simon.fraser@apple.com> [LFC Display] Simplify display tree building https://bugs.webkit.org/show_bug.cgi?id=218152 Reviewed by Zalan Bujtas. Rather than tracking container/current child display boxes in various places in the code, wrap it up in a small InsertionPosition struct and TreeBuilder::insert() which handles the setFirstChild/setNextSibling logic. * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::build const): (WebCore::Display::TreeBuilder::insert const): (WebCore::Display::TreeBuilder::buildInlineDisplayTree const): (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const): * display/DisplayTreeBuilder.h: 2020-10-24 Jer Noble <jer.noble@apple.com> [BigSur] Appending a new WebM init segment between Cluster elements throws an error https://bugs.webkit.org/show_bug.cgi?id=218149 <rdar://problem/70416537> Reviewed by Eric Carlson. Test: media/media-source/media-source-webm-init-inside-segment.html The WebM Byte Stream Format specification states that an "initialization segment" consists of both a leading Ebml element and Segment element, and a "media segment" consists of a single Cluster element. However, while both Ebml and Segment elements are top-level, Cluster elements are contained within a Segment. This means if a client pushes a new "initialization segment" after parsing some-but-not-all Clusters within a Segment, the new Ebml and Segment elements will be parsed as children of the preceeding Segment, and the subsquent Segment will overflow its "parent's" size. In order to support appending a new "initialization segment" while still in the middle of parsing the previous Segment element, first improve our state tracking in order to determine what the current parent element is. Then, when we detect that an Ebml element is parsed while still inside a Segment, abort with a simulated error, which when caught, will indicate that the parser needs to be reset, and the reader "rewound" to the Ebml's position. To allow the reader to rewind, we must not throw away appended data as we iterate over them. Instead, we will only discard read samples once each parsing pass is fully complete. This allows us to "rewind" across appended segment boundaries, if necessary. Because all WTF::Deque iterators are invalidated whenever any element is removed, and because we do not need random-access to the elements in the deque, replace the Deque with a StdList to store the incoming data. * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm: (WebCore::SourceBufferParserAVFObjC::setLogger): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): * platform/graphics/cocoa/SourceBufferParser.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WTF::LogArgument<webm::Id>::toString): (WTF::LogArgument<WebCore::SourceBufferParserWebM::State>::toString): (WebCore::logChannel): (WebCore::logClassName): (WebCore::SourceBufferParserWebM::appendData): (WebCore::SourceBufferParserWebM::resetParserState): (WebCore::SourceBufferParserWebM::invalidate): (WebCore::SourceBufferParserWebM::setLogger): (WebCore::SourceBufferParserWebM::OnElementBegin): (WebCore::SourceBufferParserWebM::OnElementEnd): (WebCore::SourceBufferParserWebM::OnEbml): (WebCore::SourceBufferParserWebM::OnSegmentBegin): (WebCore::SourceBufferParserWebM::OnInfo): (WebCore::SourceBufferParserWebM::OnTrackEntry): * platform/graphics/cocoa/SourceBufferParserWebM.h: 2020-10-24 Antti Koivisto <antti@apple.com> [LFC][Integration] Replaced elements in newly created line layout should always be updated https://bugs.webkit.org/show_bug.cgi?id=218150 Reviewed by Zalan Bujtas. Test: fast/inline/inline-with-img-dynamic.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutLFCLines): We may need to recreate line layout while children still have valid style. Ensure that replaced dimensions are still updated. 2020-10-24 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Negative margin start pulls the replaced box to logical left direction https://bugs.webkit.org/show_bug.cgi?id=218147 Reviewed by Antti Koivisto. Account for negative margin start when computing the logical left position on the line. This patch fixes LayoutTests/imported/w3c/web-platform-tests/css/css-multicol/multicol-inherit-002-expected.xht. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::appendNonReplacedInlineBox): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::inlineItemWidth const): (WebCore::Layout::LineBuilder::nextContentForLine): 2020-10-24 Zalan Bujtas <zalan@apple.com> [LFC] BoxGeometry logicalWidth/Height/Rect functions are confusing https://bugs.webkit.org/show_bug.cgi?id=218145 Reviewed by Antti Koivisto. BoxGeometry represents the layout node both as a box relative to the containing block (BoxGeometry::logicalRect(), logicalLeft(), logicalWidth()) and as a box relative to the border box (BoxGeometry::marginBox(), paddingBox(), contentBox()). These 2 sets of geometries may be confusing in certain cases, e.g. logicalWidth() does not say whether it's border, padding or content box. BoxGometry is mostly used as a box relative to the border box (0, 0, border box width, border box height) so let's make the other set as a static API. * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::build const): (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const): (WebCore::Display::TreeBuilder::displayBoxForRootBox const): (WebCore::Display::TreeBuilder::displayBoxForLayoutBox const): * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const): (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const): (WebCore::Layout::FormattingContext::Geometry::complicatedCases const): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const): * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear): (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition const): * layout/flexformatting/FlexFormattingContext.cpp: (WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): (WebCore::Layout::FloatingContext::mapTopLeftToFloatingStateRoot const): (WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const): (WebCore::Layout::FloatingState::FloatItem::bottom const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::inlineItemWidth const): * layout/layouttree/LayoutBoxGeometry.cpp: (WebCore::Layout::BoxGeometry::borderBox const): * layout/layouttree/LayoutBoxGeometry.h: (WebCore::Layout::BoxGeometry::logicalTop): (WebCore::Layout::BoxGeometry::logicalLeft): (WebCore::Layout::BoxGeometry::logicalTopLeft): (WebCore::Layout::BoxGeometry::borderRect): (WebCore::Layout::BoxGeometry::marginRect): (WebCore::Layout::BoxGeometry::logicalBottom const): Deleted. (WebCore::Layout::BoxGeometry::logicalRight const): Deleted. (WebCore::Layout::BoxGeometry::logicalBottomRight const): Deleted. (WebCore::Layout::BoxGeometry::logicalSize const): Deleted. (WebCore::Layout::BoxGeometry::logicalWidth const): Deleted. (WebCore::Layout::BoxGeometry::logicalHeight const): Deleted. (WebCore::Layout::BoxGeometry::isEmpty const): Deleted. (WebCore::Layout::BoxGeometry::logicalRect const): Deleted. (WebCore::Layout::BoxGeometry::logicalRectWithMargin const): Deleted. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutBox): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const): * layout/tableformatting/TableLayout.cpp: (WebCore::Layout::TableFormattingContext::TableLayout::distributedVerticalSpace): * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext): 2020-10-23 Simon Fraser <simon.fraser@apple.com> REGRESSION (r260276): Unable to click on image and text link at the bottom of https://www.nytimes.com/ article https://bugs.webkit.org/show_bug.cgi?id=218137 <rdar://problem/70439526> Reviewed by Zalan Bujtas. r238725 made RenderLayers for accelerated overflow:scroll be self-painting, but that changes paint and hit-testing order, which affected this nytimes article (the failing element has large negative margin-top). This is the fundamental compositing bug, but we can work around it in this case by only making the layer self-painting if it does actually scroll. Test: fast/layers/overflow-scroll-self-painting.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateScrollInfoAfterLayout): Need to update isSelfPaintingLayer() after layout because now it depends on scrollable overflow. (WebCore::RenderLayer::shouldBeSelfPaintingLayer const): Consult hasCompositedScrollableOverflow() rather than canUseCompositedScrolling(). 2020-10-22 Darin Adler <darin@apple.com> REGRESSION(r266295): DOMSelection's addRange and containsNode behave incorrectly when selection crosses shadow boundaries https://bugs.webkit.org/show_bug.cgi?id=218007 Reviewed by Ryosuke Niwa. Test: editing/selection/selections-across-trees.html * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::linkClickPoint): Update for the new name of isPointInRange, contains<ComposedTree>. We can return and change it from ComposedTree to something else since that's likely not the tree we need here. (WebCore::AccessibilityRenderObject::setSelectedTextRange): Ditto. (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange const): Ditto. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (isWhiteSpaceBetweenSentences): Ditto. * dom/BoundaryPoint.h: Update to use TreeType enumeration instead of classes. * dom/Node.cpp: (WebCore::depth): Ditto. (WebCore::commonInclusiveAncestorAndChildren): Ditto. (WebCore::treeOrder): Ditto. * dom/Node.h: Ditto. * dom/Range.cpp: (WebCore::Range::isPointInRange): Updated since we renamed isPointInRange to be an overload of contains. * dom/SimpleRange.cpp: (WebCore::treeOrder): Update to use TreeType enumeration instead of classes. (WebCore::contains): Ditto. Also renamed isPointInRange to an overload of contains. Also added converted the contains that takes two ranges to a function template. (WebCore::intersects): Ditto. * dom/SimpleRange.h: Reorganized the functions so all the deprecated functions that silently use ComposedTree are grouped together. Updated the function templates to use TreeType enumeration instead of classes. Added a couple more function templates that we used to fix DOMSelection. * editing/FrameSelection.cpp: (WebCore::FrameSelection::contains const): Update for the new name of sPointInRange, contains<ComposedTree>. We can return and change it from ComposedTree to something else since that's likely not the tree we need here. * editing/mac/DictionaryLookupLegacy.mm: (WebCore::selectionContainsPosition): Ditto. * page/DOMSelection.cpp: (WebCore::DOMSelection::addRange): Use intersects<Tree> because we don't want to use the composed tree here. (WebCore::DOMSelection::containsNode const): Use intersects<Tree> and contains<Tree>. Evantually <Tree> will be the default and we can come back here and edit down these calls for brevity, but first we have to make all the uses of ComposedTree explicit. 2020-10-23 Eric Carlson <eric.carlson@apple.com> [Media in GPU Process] in-band metadata cues sometimes crash https://bugs.webkit.org/show_bug.cgi?id=218106 <rdar://problem/70226170> Reviewed by Jer Noble. No new tests, enabled existing test in the GPU process. * platform/SerializedPlatformDataCueValue.h: (WebCore::SerializedPlatformDataCueValue::SerializedPlatformDataCueValue): (WebCore::SerializedPlatformDataCueValue::nativeValue const): Make m_nativeValue a RetainPtr<> so the ownership and lifetime of the object is explicit and managed correctly. * platform/mac/SerializedPlatformDataCueMac.mm: (WebCore::SerializedPlatformDataCueMac::encodableValue const): Update for change to native value. (WebCore::jsValueWithAVMetadataItemInContext): Ditto. (WebCore::NSDictionaryWithAVMetadataItem): Return a RetainPtr<NSDictionary> instead of an auto-released dictionary. 2020-10-23 Aditya Keerthi <akeerthi@apple.com> webkit.org/status/ is missing input type=date (and related) features https://bugs.webkit.org/show_bug.cgi?id=195666 Reviewed by Darin Adler. * features.json: Updated to include date and time input types. 2020-10-23 Antoine Quint <graouts@webkit.org> REGRESSION(r268615): certain animations break when moving from one to display to another or resizing the window https://bugs.webkit.org/show_bug.cgi?id=218080 <rdar://problem/70547132> Reviewed by Dean Jackson. Since transform-related animations include non-interpolating animations meant to insert the static base value for a given transform-related CSS property, we need to update animations on GraphicsLayerCA whenever one of the transform-related CSS properties have a new value. We used to rely on GraphicsLayerCA::setTransform() being called with a different transform than the current one to identify such cases, but that is suboptimal because that method can be called with a compound interpolated value of transform-related CSS properties when a rendering update occurs, such as during resizing or moving a window between displays. In those cases, the static base value of the transform-related CSS properties hasn't actually changed. Instead, we now provide the non-animated style from the last style change event to the function resolving keyframe effects so that for a given element we can compare that style with the new, as-yet-non-animated style and see if any of the transform- related CSS properties have been changed. If that is the case, we inform any KeyframeEffect that has a running accelerated animation for any of those CSS properties so that the effect may enqueue an accelerated action that will then notify the GraphicsLayer of such a change, and trigger an animation update. Since we were changing the applyKeyframeEffects() method signature to add the extra RenderStyle needed to compare the current and previous non-animated styles, we also moved that method from Element to KeyframeEffectStack since no Element private API was required. No new test since this was already tested by webanimations/accelerated-translate-animation-underlying-transform-changed-in-flight.html and it's not clear how to test the live-resizing or display-change scenario. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::isRunningAcceleratedTransformRelatedAnimation const): New method called from KeyframeEffectStack::applyKeyframeEffects() to indicate that a keyframe effect has a running accelerated animation targeting a transform-related property. (WebCore::KeyframeEffect::addPendingAcceleratedAction): Ensure that the new AcceleratedAction::TransformChange accelerated action recorded in transformRelatedPropertyDidChange() is not ever set as m_lastRecordedAcceleratedAction as we use this member to identify whether we have a pending running, pause or stop action. (WebCore::KeyframeEffect::transformRelatedPropertyDidChange): New method meant to be called for an effect that has a running accelerated animation targeting a transform-related property to notify that one or more of the target element's transform-related CSS property static values was changed. (WebCore::KeyframeEffect::applyPendingAcceleratedActions): Call transformRelatedPropertyDidChange() on the composited renderer for a AcceleratedAction::TransformChange action. * animation/KeyframeEffect.h: * animation/KeyframeEffectStack.cpp: (WebCore::KeyframeEffectStack::applyKeyframeEffects): Move the method previously exposed on Element to KeyframeEffectStack. Additionally, accept an extra RenderStyle parameter to provide the non-animated style from the last style change event so that we can compare that style with the new, as-yet-non-animated style and see if any of the transform-related CSS properties have been changed and notify the effect should it run an accelerated animation for one of those properties. * animation/KeyframeEffectStack.h: * dom/Element.cpp: (WebCore::Element::applyKeyframeEffects): Deleted. Moved to KeyframeEffectStack. * dom/Element.h: * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::transformRelatedPropertyDidChange): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setTransform): Move the animation-update logic to transformRelatedPropertyDidChange() (WebCore::GraphicsLayerCA::transformRelatedPropertyDidChange): * platform/graphics/ca/GraphicsLayerCA.h: * rendering/RenderElement.h: (WebCore::RenderElement::transformRelatedPropertyDidChange): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::transformRelatedPropertyDidChange): * rendering/RenderLayerBacking.h: * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::transformRelatedPropertyDidChange): * rendering/RenderLayerModelObject.h: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): Pass the non-animated style from the last style change event to KeyframeEffectStack::applyKeyframeEffects() to determine whether this style change event includes a change to any of the transform-related properties. * style/Styleable.h: (WebCore::Styleable::applyKeyframeEffects const): 2020-10-23 Chris Dumez <cdumez@apple.com> AnalyserNode's output should only have one channel https://bugs.webkit.org/show_bug.cgi?id=218125 Reviewed by Eric Carlson. AnalyserNode's output should only have one channel. We were using 2 channels, which was inconsistent with Blink and Gecko. No new tests, rebaselined existing test. * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::AnalyserNode): 2020-10-23 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add initial support for vertical-align: <length> and <percentage> https://bugs.webkit.org/show_bug.cgi?id=218109 Reviewed by Antti Koivisto. Raise (positive value) or lower (negative value) the box by this distance. It fixes css2.1/20110323/vertical-align-boxes-001.htm. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::alignInlineLevelBoxesVerticallyAndComputeLineBoxHeight): 2020-10-23 Miguel Gomez <magomez@igalia.com> [GTK][WPE] Implement antialiased rounded rectangle clipping in TextureMapper https://bugs.webkit.org/show_bug.cgi?id=174457 Reviewed by Carlos Garcia Campos. Implement rounded rectangle clipping in TextureMapperGL, supporting up to 10 simultaneous rounded rectangle clips. TextureMapper::beginClip() now receives a rounded rectangle, and it applies the appropriate clipping method as required. The rounded rectangle clip implementation uses the fragment shader to calculate whether each pixel is inside the defined rounded rectangles, and paints or skips it as needed. * platform/graphics/texmap/ClipStack.cpp: (WebCore::ClipStack::addRoundedRect): * platform/graphics/texmap/ClipStack.h: (WebCore::ClipStack::State::State): (WebCore::ClipStack::roundedRectComponents const): (WebCore::ClipStack::roundedRectInverseTransformComponents const): (WebCore::ClipStack::roundedRectCount const): (WebCore::ClipStack::isRoundedRectClipEnabled const): (WebCore::ClipStack::isRoundedRectClipAllowed const): * platform/graphics/texmap/TextureMapper.h: * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::prepareRoundedRectClip): (WebCore::TextureMapperGL::drawTexture): (WebCore::TextureMapperGL::drawTexturePlanarYUV): (WebCore::TextureMapperGL::drawTextureSemiPlanarYUV): (WebCore::TextureMapperGL::drawTexturePackedYUV): (WebCore::TextureMapperGL::drawSolidColor): (WebCore::TextureMapperGL::beginRoundedRectClip): (WebCore::TextureMapperGL::beginClip): * platform/graphics/texmap/TextureMapperGL.h: * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintSelf): (WebCore::TextureMapperLayer::paintSelfAndChildren): (WebCore::TextureMapperLayer::paintUsingOverlapRegions): * platform/graphics/texmap/TextureMapperShaderProgram.cpp: (WebCore::TextureMapperShaderProgram::create): * platform/graphics/texmap/TextureMapperShaderProgram.h: 2020-10-23 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Fix inline box relative alignment when line-height is set https://bugs.webkit.org/show_bug.cgi?id=218107 Reviewed by Antti Koivisto. Inline box relative vertical alignment logic should use the combination of the layout bounds and the font metric values of the parent inline box. The layout bound values (ascent and descent adjusted with half leading) normally match the font metric values, unless the line-height is set to something other than normal. In such cases the gap affects the vertical position of the child inline level boxes (e.g. text-top aligns with the top of the text (use font metrics) and not with the layout bounds). * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::alignInlineLevelBoxesVerticallyAndComputeLineBoxHeight): 2020-10-21 Sergio Villar Senin <svillar@igalia.com> Rename override sizes to overriding sizes https://bugs.webkit.org/show_bug.cgi?id=217898 Reviewed by Darin Adler. We've been traditionally using the word "override" to refer to those sizes that were explicitly set by layout systems like tables, flex or grid. However that's a grammatical mistake. override is a verb which does not work well as a noun. It'd be more correct to refer to them as "overriding" sizes. No new tests required as this is just a renaming. * WebCore.order: * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::updateRubyForJustifiedText): * rendering/GridLayoutFunctions.cpp: (WebCore::GridLayoutFunctions::hasOverridingContainingBlockContentSizeForChild): (WebCore::GridLayoutFunctions::overridingContainingBlockContentSizeForChild): (WebCore::GridLayoutFunctions::hasOverrideContainingBlockContentSizeForChild): Deleted. (WebCore::GridLayoutFunctions::overrideContainingBlockContentSizeForChild): Deleted. * rendering/GridLayoutFunctions.h: * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::shouldClearOverridingContainingBlockContentSizeForChild): (WebCore::setOverridingContainingBlockContentSizeForChild): (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const): (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const): (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const): (WebCore::GridTrackSizingAlgorithmStrategy::updateOverridingContainingBlockContentSizeForChild const): (WebCore::GridTrackSizingAlgorithmStrategy::minLogicalSizeForChild const): (WebCore::DefiniteSizeStrategy::minLogicalSizeForChild const): (WebCore::DefiniteSizeStrategy::minContentForChild const): (WebCore::shouldClearOverrideContainingBlockContentSizeForChild): Deleted. (WebCore::setOverrideContainingBlockContentSizeForChild): Deleted. (WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild const): Deleted. * rendering/GridTrackSizingAlgorithm.h: * rendering/RenderBlock.cpp: (WebCore::RenderBlock::insertPositionedObject): (WebCore::RenderBlock::computeChildPreferredLogicalWidths const): (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded): * rendering/RenderBox.cpp: (WebCore::RenderBox::willBeDestroyed): (WebCore::RenderBox::styleDidChange): (WebCore::RenderBox::hasOverridingLogicalHeight const): (WebCore::RenderBox::hasOverridingLogicalWidth const): (WebCore::RenderBox::setOverridingLogicalHeight): (WebCore::RenderBox::setOverridingLogicalWidth): (WebCore::RenderBox::clearOverridingLogicalHeight): (WebCore::RenderBox::clearOverridingLogicalWidth): (WebCore::RenderBox::clearOverridingContentSize): (WebCore::RenderBox::overridingLogicalWidth const): (WebCore::RenderBox::overridingLogicalHeight const): (WebCore::RenderBox::overridingContainingBlockContentWidth const): (WebCore::RenderBox::overridingContainingBlockContentHeight const): (WebCore::RenderBox::hasOverridingContainingBlockContentWidth const): (WebCore::RenderBox::hasOverridingContainingBlockContentHeight const): (WebCore::RenderBox::overridingContainingBlockContentLogicalWidth const): (WebCore::RenderBox::overridingContainingBlockContentLogicalHeight const): (WebCore::RenderBox::hasOverridingContainingBlockContentLogicalWidth const): (WebCore::RenderBox::hasOverridingContainingBlockContentLogicalHeight const): (WebCore::RenderBox::setOverridingContainingBlockContentLogicalWidth): (WebCore::RenderBox::setOverridingContainingBlockContentLogicalHeight): (WebCore::RenderBox::clearOverridingContainingBlockContentSize): (WebCore::RenderBox::clearOverridingContainingBlockContentLogicalHeight): (WebCore::RenderBox::containingBlockLogicalWidthForContent const): (WebCore::RenderBox::containingBlockLogicalHeightForContent const): (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight const): (WebCore::RenderBox::computeLogicalWidthInFragment const): (WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem const): (WebCore::RenderBox::computeLogicalHeight const): (WebCore::RenderBox::computePercentageLogicalHeight const): (WebCore::RenderBox::computeReplacedLogicalHeightUsing const): (WebCore::RenderBox::availableLogicalHeightUsing const): (WebCore::RenderBox::containingBlockLogicalWidthForPositioned const): (WebCore::RenderBox::containingBlockLogicalHeightForPositioned const): (WebCore::RenderBox::hasOverrideLogicalHeight const): Deleted. (WebCore::RenderBox::hasOverrideLogicalWidth const): Deleted. (WebCore::RenderBox::setOverrideLogicalHeight): Deleted. (WebCore::RenderBox::setOverrideLogicalWidth): Deleted. (WebCore::RenderBox::clearOverrideLogicalHeight): Deleted. (WebCore::RenderBox::clearOverrideLogicalWidth): Deleted. (WebCore::RenderBox::clearOverrideContentSize): Deleted. (WebCore::RenderBox::overrideLogicalWidth const): Deleted. (WebCore::RenderBox::overrideLogicalHeight const): Deleted. (WebCore::RenderBox::overrideContainingBlockContentWidth const): Deleted. (WebCore::RenderBox::overrideContainingBlockContentHeight const): Deleted. (WebCore::RenderBox::hasOverrideContainingBlockContentWidth const): Deleted. (WebCore::RenderBox::hasOverrideContainingBlockContentHeight const): Deleted. (WebCore::RenderBox::overrideContainingBlockContentLogicalWidth const): Deleted. (WebCore::RenderBox::overrideContainingBlockContentLogicalHeight const): Deleted. (WebCore::RenderBox::hasOverrideContainingBlockContentLogicalWidth const): Deleted. (WebCore::RenderBox::hasOverrideContainingBlockContentLogicalHeight const): Deleted. (WebCore::RenderBox::setOverrideContainingBlockContentLogicalWidth): Deleted. (WebCore::RenderBox::setOverrideContainingBlockContentLogicalHeight): Deleted. (WebCore::RenderBox::clearOverrideContainingBlockContentSize): Deleted. (WebCore::RenderBox::clearOverrideContainingBlockContentLogicalHeight): Deleted. * rendering/RenderBox.h: (WebCore::RenderBox::overridingContentLogicalWidth const): (WebCore::RenderBox::overridingContentLogicalHeight const): (WebCore::RenderBox::overrideContentLogicalWidth const): Deleted. (WebCore::RenderBox::overrideContentLogicalHeight const): Deleted. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight const): (WebCore::RenderBoxModelObject::relativePositionOffset const): * rendering/RenderBoxModelObject.h: (WebCore::RenderBoxModelObject::overridingContainingBlockContentWidth const): (WebCore::RenderBoxModelObject::overridingContainingBlockContentHeight const): (WebCore::RenderBoxModelObject::hasOverridingContainingBlockContentWidth const): (WebCore::RenderBoxModelObject::hasOverridingContainingBlockContentHeight const): (WebCore::RenderBoxModelObject::overrideContainingBlockContentWidth const): Deleted. (WebCore::RenderBoxModelObject::overrideContainingBlockContentHeight const): Deleted. (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentWidth const): Deleted. (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentHeight const): Deleted. * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::widthForChild): (WebCore::heightForChild): (WebCore::gatherFlexChildrenInfo): (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox): (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox): (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp): (WebCore::RenderDeprecatedFlexibleBox::clearLineClamp): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth const): (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild): (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution): (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): (WebCore::RenderFlexibleBox::constructFlexItem): (WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild): (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): * rendering/RenderFullScreen.cpp: (WebCore::RenderFullScreen::unwrapRenderer): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutBlock): (WebCore::RenderGrid::placeItemsOnGrid const): (WebCore::overrideSizeChanged): (WebCore::RenderGrid::updateGridAreaLogicalSize const): (WebCore::RenderGrid::layoutPositionedObject): (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded): (WebCore::RenderGrid::updateAutoMarginsInRowAxisIfNeeded): (WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded): (WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const): * rendering/RenderRubyBase.cpp: (WebCore::RenderRubyBase::adjustInlineDirectionLineBounds const): * rendering/RenderTable.cpp: (WebCore::RenderTable::updateLogicalWidth): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::setOverridingLogicalHeightFromRowHeight): (WebCore::RenderTableCell::setOverrideLogicalHeightFromRowHeight): Deleted. * rendering/RenderTableCell.h: * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::calcRowLogicalHeight): (WebCore::RenderTableSection::relayoutCellIfFlexed): 2020-10-23 Philippe Normand <pnormand@igalia.com> [GStreamer] Replace USE(WEBAUDIO_GSTREAMER) with USE(GSTREAMER) https://bugs.webkit.org/show_bug.cgi?id=218083 Reviewed by Xabier Rodriguez-Calvar. * platform/audio/FFTFrame.h: No need for G_{BEGIN,END}_DECLS dance anymore, these were added upstream 9 years ago. * platform/audio/FFTFrameStub.cpp: * platform/audio/HRTFElevation.cpp: * platform/audio/gstreamer/FFTFrameGStreamer.cpp: 2020-10-22 Alex Christensen <achristensen@webkit.org> Null check platformStrategies when making blob read stream for an NSURLRequest https://bugs.webkit.org/show_bug.cgi?id=218112 <rdar://problem/70507102> Reviewed by Wenson Hsieh. r266187 made it possible to create a DataTransfer without a user event, which allows you to make a FileList, which allows you to submit a multipart form without a user event that calls decidePolicyForNavigationAction with a request that has a form data body that would make a blob upload stream. This causes us to use platformStrategies in the UI process, which dereferences null. Since the blob only really exists in the network process, just return a nil HTTPBody in such an exotic case instead of crashing. Covered by an API test that would hit this crash. Web platform tests were insufficient because WebKitTestRunner does not access WKNavigationAction.request, but Safari does. * platform/PlatformStrategies.cpp: (WebCore::hasPlatformStrategies): * platform/PlatformStrategies.h: * platform/network/FormData.cpp: (WebCore::FormData::containsBlobElement const): (WebCore::FormData::resolveBlobReferences): * platform/network/FormData.h: * platform/network/cf/FormDataStreamCFNet.cpp: (WebCore::createHTTPBodyCFReadStream): 2020-10-22 Simon Fraser <simon.fraser@apple.com> REGRESSION(r268476): [ macOS ] tiled-drawing/scrolling/non-fast-region/handlers-in-iframes.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=218031 <rdar://problem/70532268> Reviewed by Tim Horton. The test exercises wheel event regions in non-composited iframes. These were not reliably updated when all wheel event handlers were removed, because Frame::invalidateContentEventRegionsIfNeeded() early-returned if there were no handlers (but we need to update the regions in this case). Clean up the logic here, and pass in a "reason" so we know that we should do work when there are no handlers. Document::wheelEventHandlersChanged() also needs to invalidate style, since flags in style are used for wheel event region building, and it needs to call invalidateContentEventRegionsIfNeeded(). * dom/Document.cpp: (WebCore::Document::wheelEventHandlersChanged): (WebCore::Document::didAddWheelEventHandler): (WebCore::Document::didRemoveWheelEventHandler): * dom/Document.h: * page/Frame.cpp: (WebCore::Frame::invalidateContentEventRegionsIfNeeded): * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::didLayout): 2020-10-22 Aditya Keerthi <akeerthi@apple.com> [Contact Picker API] Add skeleton implementation of ContactsManager.select() https://bugs.webkit.org/show_bug.cgi?id=218050 <rdar://problem/69862186> Reviewed by Devin Rousso. ContactsManager.select() is the interface that allows clients to present a contact picker. The method should immediately reject when called from a subframe, when called outside user-interaction and when called while a contact picker is already being displayed. Furthermore, the promise is rejected when the supplied properties are empty or invalid. After the conditions necessary for the UI to be presented are verified, ContactsManager.select() calls into the page's Chrome to display the picker. The UI implementation on macOS and iOS will be done in forthcoming patches. See https://wicg.github.io/contact-api/spec/#contacts-manager-select for more information. Tests: contact-picker/contacts-select-invalid-properties-and-options.html contact-picker/contacts-select-requires-user-gesture.html contact-picker/contacts-select-subframe.html * Headers.cmake: * Modules/contact-picker/ContactInfo.h: Added encoder and decoder for IPC. (WebCore::ContactInfo::encode const): (WebCore::ContactInfo::decode): * Modules/contact-picker/ContactInfo.idl: * Modules/contact-picker/ContactProperty.h: * Modules/contact-picker/ContactsManager.cpp: (WebCore::ContactsManager::frame const): (WebCore::ContactsManager::select): * Modules/contact-picker/ContactsManager.h: * Modules/contact-picker/ContactsRequestData.h: Added. ContactsRequestData encapsulates the information required to display a picker UI. This includes the requested properties, the URL of the presenting site, and whether multiple contact selection should be allowed. (WebCore::ContactsRequestData::encode const): (WebCore::ContactsRequestData::decode): * WebCore.xcodeproj/project.pbxproj: * page/Chrome.cpp: (WebCore::Chrome::showContactPicker): * page/Chrome.h: * page/ChromeClient.h: (WebCore::ChromeClient::showContactPicker): 2020-10-22 Chris Dumez <cdumez@apple.com> Use WorkerOrWorkletGlobalScope in WebInspector code instead of WorkerGlobalScope https://bugs.webkit.org/show_bug.cgi?id=218108 Reviewed by Darin Adler and Devin Rousso. Use WorkerOrWorkletGlobalScope in WebInspector code instead of WorkerGlobalScope, in preparation for Worklets support. This will allow us to reuse this code when we add Web Inspector support for Worklets. No new tests, no behavior change yet. * Modules/webaudio/AudioWorkletThread.cpp: (WebCore::AudioWorkletThread::workerDebuggerProxy const): * Modules/webaudio/AudioWorkletThread.h: * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::instrumentingAgentsForWebGPUDevice): (WebCore::InspectorInstrumentation::consoleAgentEnabled): (WebCore::InspectorInstrumentation::timelineAgentTracking): (WebCore::InspectorInstrumentation::instrumentingAgentsFor): (WebCore::InspectorInstrumentation::instrumentingAgentsForRenderer): Deleted. (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope): Deleted. (WebCore::InspectorInstrumentation::instrumentingAgentsForPage): Deleted. (WebCore::InspectorInstrumentation::instrumentingAgentsForContext): Deleted. * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::didClearWindowObjectInWorld): (WebCore::InspectorInstrumentation::isDebuggerPaused): (WebCore::InspectorInstrumentation::identifierForNode): (WebCore::InspectorInstrumentation::addEventListenersToNode): (WebCore::InspectorInstrumentation::willInsertDOMNode): (WebCore::InspectorInstrumentation::didInsertDOMNode): (WebCore::InspectorInstrumentation::willRemoveDOMNode): (WebCore::InspectorInstrumentation::didRemoveDOMNode): (WebCore::InspectorInstrumentation::willModifyDOMAttr): (WebCore::InspectorInstrumentation::didModifyDOMAttr): (WebCore::InspectorInstrumentation::didRemoveDOMAttr): (WebCore::InspectorInstrumentation::willInvalidateStyleAttr): (WebCore::InspectorInstrumentation::didInvalidateStyleAttr): (WebCore::InspectorInstrumentation::documentDetached): (WebCore::InspectorInstrumentation::frameWindowDiscarded): (WebCore::InspectorInstrumentation::mediaQueryResultChanged): (WebCore::InspectorInstrumentation::activeStyleSheetsUpdated): (WebCore::InspectorInstrumentation::didPushShadowRoot): (WebCore::InspectorInstrumentation::willPopShadowRoot): (WebCore::InspectorInstrumentation::didChangeCustomElementState): (WebCore::InspectorInstrumentation::pseudoElementCreated): (WebCore::InspectorInstrumentation::pseudoElementDestroyed): (WebCore::InspectorInstrumentation::didCreateNamedFlow): (WebCore::InspectorInstrumentation::willRemoveNamedFlow): (WebCore::InspectorInstrumentation::didChangeRegionOverset): (WebCore::InspectorInstrumentation::didRegisterNamedFlowContentElement): (WebCore::InspectorInstrumentation::didUnregisterNamedFlowContentElement): (WebCore::InspectorInstrumentation::mouseDidMoveOverElement): (WebCore::InspectorInstrumentation::handleTouchEvent): (WebCore::InspectorInstrumentation::handleMousePress): (WebCore::InspectorInstrumentation::forcePseudoState): (WebCore::InspectorInstrumentation::characterDataModified): (WebCore::InspectorInstrumentation::willSendXMLHttpRequest): (WebCore::InspectorInstrumentation::willFetch): (WebCore::InspectorInstrumentation::didInstallTimer): (WebCore::InspectorInstrumentation::didRemoveTimer): (WebCore::InspectorInstrumentation::didAddEventListener): (WebCore::InspectorInstrumentation::willRemoveEventListener): (WebCore::InspectorInstrumentation::isEventListenerDisabled): (WebCore::InspectorInstrumentation::willPostMessage): (WebCore::InspectorInstrumentation::didPostMessage): (WebCore::InspectorInstrumentation::didFailPostMessage): (WebCore::InspectorInstrumentation::willDispatchPostMessage): (WebCore::InspectorInstrumentation::didDispatchPostMessage): (WebCore::InspectorInstrumentation::willCallFunction): (WebCore::InspectorInstrumentation::didCallFunction): (WebCore::InspectorInstrumentation::willDispatchEvent): (WebCore::InspectorInstrumentation::didDispatchEvent): (WebCore::InspectorInstrumentation::willHandleEvent): (WebCore::InspectorInstrumentation::didHandleEvent): (WebCore::InspectorInstrumentation::willDispatchEventOnWindow): (WebCore::InspectorInstrumentation::didDispatchEventOnWindow): (WebCore::InspectorInstrumentation::eventDidResetAfterDispatch): (WebCore::InspectorInstrumentation::willEvaluateScript): (WebCore::InspectorInstrumentation::didEvaluateScript): (WebCore::InspectorInstrumentation::willFireTimer): (WebCore::InspectorInstrumentation::didFireTimer): (WebCore::InspectorInstrumentation::didInvalidateLayout): (WebCore::InspectorInstrumentation::willLayout): (WebCore::InspectorInstrumentation::didLayout): (WebCore::InspectorInstrumentation::didScroll): (WebCore::InspectorInstrumentation::willComposite): (WebCore::InspectorInstrumentation::didComposite): (WebCore::InspectorInstrumentation::willPaint): (WebCore::InspectorInstrumentation::didPaint): (WebCore::InspectorInstrumentation::willRecalculateStyle): (WebCore::InspectorInstrumentation::didRecalculateStyle): (WebCore::InspectorInstrumentation::didScheduleStyleRecalculation): (WebCore::InspectorInstrumentation::applyUserAgentOverride): (WebCore::InspectorInstrumentation::applyEmulatedMedia): (WebCore::InspectorInstrumentation::willSendRequest): (WebCore::InspectorInstrumentation::willSendRequestOfType): (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache): (WebCore::InspectorInstrumentation::didReceiveResourceResponse): (WebCore::InspectorInstrumentation::didReceiveThreadableLoaderResponse): (WebCore::InspectorInstrumentation::didReceiveData): (WebCore::InspectorInstrumentation::didFinishLoading): (WebCore::InspectorInstrumentation::didFailLoading): (WebCore::InspectorInstrumentation::continueAfterXFrameOptionsDenied): (WebCore::InspectorInstrumentation::continueWithPolicyDownload): (WebCore::InspectorInstrumentation::continueWithPolicyIgnore): (WebCore::InspectorInstrumentation::willLoadXHRSynchronously): (WebCore::InspectorInstrumentation::didLoadXHRSynchronously): (WebCore::InspectorInstrumentation::scriptImported): (WebCore::InspectorInstrumentation::scriptExecutionBlockedByCSP): (WebCore::InspectorInstrumentation::didReceiveScriptResponse): (WebCore::InspectorInstrumentation::domContentLoadedEventFired): (WebCore::InspectorInstrumentation::loadEventFired): (WebCore::InspectorInstrumentation::frameDetachedFromParent): (WebCore::InspectorInstrumentation::didCommitLoad): (WebCore::InspectorInstrumentation::frameDocumentUpdated): (WebCore::InspectorInstrumentation::loaderDetachedFromFrame): (WebCore::InspectorInstrumentation::frameStartedLoading): (WebCore::InspectorInstrumentation::frameStoppedLoading): (WebCore::InspectorInstrumentation::frameScheduledNavigation): (WebCore::InspectorInstrumentation::frameClearedScheduledNavigation): (WebCore::InspectorInstrumentation::defaultAppearanceDidChange): (WebCore::InspectorInstrumentation::willIntercept): (WebCore::InspectorInstrumentation::shouldInterceptRequest): (WebCore::InspectorInstrumentation::shouldInterceptResponse): (WebCore::InspectorInstrumentation::interceptRequest): (WebCore::InspectorInstrumentation::interceptResponse): (WebCore::InspectorInstrumentation::didOpenDatabase): (WebCore::InspectorInstrumentation::didDispatchDOMStorageEvent): (WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStart): (WebCore::InspectorInstrumentation::workerStarted): (WebCore::InspectorInstrumentation::workerTerminated): (WebCore::InspectorInstrumentation::didCreateWebSocket): (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequest): (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponse): (WebCore::InspectorInstrumentation::didCloseWebSocket): (WebCore::InspectorInstrumentation::didReceiveWebSocketFrame): (WebCore::InspectorInstrumentation::didReceiveWebSocketFrameError): (WebCore::InspectorInstrumentation::didSendWebSocketFrame): (WebCore::InspectorInstrumentation::didHandleMemoryPressure): (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes): (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext): (WebCore::InspectorInstrumentation::didChangeCanvasMemory): (WebCore::InspectorInstrumentation::recordCanvasAction): (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrame): (WebCore::InspectorInstrumentation::didEnableExtension): (WebCore::InspectorInstrumentation::didCreateWebGLProgram): (WebCore::InspectorInstrumentation::willDestroyWebGLProgram): (WebCore::InspectorInstrumentation::isWebGLProgramDisabled): (WebCore::InspectorInstrumentation::isWebGLProgramHighlighted): (WebCore::InspectorInstrumentation::willConfigureSwapChain): (WebCore::InspectorInstrumentation::willDestroyWebGPUPipeline): (WebCore::InspectorInstrumentation::willApplyKeyframeEffect): (WebCore::InspectorInstrumentation::didChangeWebAnimationName): (WebCore::InspectorInstrumentation::didSetWebAnimationEffect): (WebCore::InspectorInstrumentation::didChangeWebAnimationEffectTiming): (WebCore::InspectorInstrumentation::didChangeWebAnimationEffectTarget): (WebCore::InspectorInstrumentation::didCreateWebAnimation): (WebCore::InspectorInstrumentation::willDestroyWebAnimation): (WebCore::InspectorInstrumentation::networkStateChanged): (WebCore::InspectorInstrumentation::updateApplicationCacheStatus): (WebCore::InspectorInstrumentation::addMessageToConsole): (WebCore::InspectorInstrumentation::consoleCount): (WebCore::InspectorInstrumentation::consoleCountReset): (WebCore::InspectorInstrumentation::takeHeapSnapshot): (WebCore::InspectorInstrumentation::startConsoleTiming): (WebCore::InspectorInstrumentation::logConsoleTiming): (WebCore::InspectorInstrumentation::stopConsoleTiming): (WebCore::InspectorInstrumentation::consoleTimeStamp): (WebCore::InspectorInstrumentation::startProfiling): (WebCore::InspectorInstrumentation::stopProfiling): (WebCore::InspectorInstrumentation::consoleStartRecordingCanvas): (WebCore::InspectorInstrumentation::consoleStopRecordingCanvas): (WebCore::InspectorInstrumentation::didRequestAnimationFrame): (WebCore::InspectorInstrumentation::didCancelAnimationFrame): (WebCore::InspectorInstrumentation::willFireAnimationFrame): (WebCore::InspectorInstrumentation::didFireAnimationFrame): (WebCore::InspectorInstrumentation::willFireObserverCallback): (WebCore::InspectorInstrumentation::didFireObserverCallback): (WebCore::InspectorInstrumentation::layerTreeDidChange): (WebCore::InspectorInstrumentation::renderLayerDestroyed): (WebCore::InspectorInstrumentation::instrumentingAgentsFor): (WebCore::InspectorInstrumentation::instrumentingAgentsForContext): Deleted. (WebCore::InspectorInstrumentation::instrumentingAgentsForFrame): Deleted. (WebCore::InspectorInstrumentation::instrumentingAgentsForDocument): Deleted. (WebCore::InspectorInstrumentation::instrumentingAgentsForPage): Deleted. (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope): Deleted. * inspector/InspectorWebAgentBase.h: (WebCore::WorkerAgentContext::WorkerAgentContext): * inspector/WorkerDebugger.cpp: (WebCore::WorkerDebugger::WorkerDebugger): (WebCore::WorkerDebugger::attachDebugger): (WebCore::WorkerDebugger::detachDebugger): (WebCore::WorkerDebugger::runEventLoopWhilePaused): * inspector/WorkerDebugger.h: * inspector/WorkerInspectorController.cpp: (WebCore::WorkerInspectorController::WorkerInspectorController): (WebCore::WorkerInspectorController::connectFrontend): (WebCore::WorkerInspectorController::workerAgentContext): (WebCore::WorkerInspectorController::createLazyAgents): (WebCore::WorkerInspectorController::vm): * inspector/WorkerInspectorController.h: * inspector/WorkerToPageFrontendChannel.h: * inspector/agents/worker/ServiceWorkerAgent.cpp: (WebCore::ServiceWorkerAgent::ServiceWorkerAgent): * inspector/agents/worker/WorkerAuditAgent.cpp: (WebCore::WorkerAuditAgent::WorkerAuditAgent): (WebCore::WorkerAuditAgent::injectedScriptForEval): * inspector/agents/worker/WorkerAuditAgent.h: * inspector/agents/worker/WorkerConsoleAgent.cpp: (WebCore::WorkerConsoleAgent::WorkerConsoleAgent): * inspector/agents/worker/WorkerDebuggerAgent.cpp: (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent): (WebCore::WorkerDebuggerAgent::breakpointActionLog): (WebCore::WorkerDebuggerAgent::injectedScriptForEval): * inspector/agents/worker/WorkerDebuggerAgent.h: * inspector/agents/worker/WorkerNetworkAgent.cpp: (WebCore::WorkerNetworkAgent::WorkerNetworkAgent): (WebCore::WorkerNetworkAgent::setResourceCachingDisabledInternal): (WebCore::WorkerNetworkAgent::scriptExecutionContext): * inspector/agents/worker/WorkerNetworkAgent.h: * inspector/agents/worker/WorkerRuntimeAgent.cpp: (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent): (WebCore::WorkerRuntimeAgent::injectedScriptForEval): * inspector/agents/worker/WorkerRuntimeAgent.h: * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): (WebCore::WorkerGlobalScope::prepareForDestruction): * workers/WorkerGlobalScope.h: (WebCore::WorkerGlobalScope::inspectorController const): Deleted. * workers/WorkerOrWorkletGlobalScope.cpp: (WebCore::WorkerOrWorkletGlobalScope::WorkerOrWorkletGlobalScope): (WebCore::WorkerOrWorkletGlobalScope::prepareForDestruction): * workers/WorkerOrWorkletGlobalScope.h: (WebCore::WorkerOrWorkletGlobalScope::inspectorController const): * workers/WorkerOrWorkletThread.h: * workers/WorkerThread.h: (WebCore::WorkerThread::workerDebuggerProxy const): Deleted. 2020-10-22 Simon Fraser <simon.fraser@apple.com> Twitter Photo gallery incorrectly rendered after opening another modal https://bugs.webkit.org/show_bug.cgi?id=217737 <rdar://problem/70314822> Reviewed by Zalan Bujtas. If a layer with a certain configuration of clipping layers had non-zero border-radius, then changes to zero border-radius, we'd fail to undo the composited rounded-corner masking. This was because RenderLayerBacking::updateGeometry() didn't call setMasksToBoundsRect() in the non-rounded corner case. The compositing code in general tries to separate "configuration" changes (i.e. setting up the right layer hierarchy) from "geometry" changes (setting positions and sizes). In this area, those responsibilities were muddied because the return value from setMasksToBoundsRect() was used to know whether the platform-specific GraphicsLayer supports rounded-corner clips. This forced RenderLayerBacking::updateChildClippingStrategy() to do some geometry computation. Clean that up by adding the static GraphicsLayer::supportsRoundedClip(), and use that to know if the platform needs a m_childClippingMaskLayer (all non-CA platforms). Now updateChildClippingStrategy() can be purely about hierarchy, and updateGeometry() can focus on geometry. In updateGeometry(), we are sure to call setMasksToBoundsRect() in the non-rounded corner case too. Test: compositing/style-change/border-radius-change.html * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::supportsRoundedClip): (WebCore::GraphicsLayer::setMasksToBoundsRect): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::setMasksToBoundsRect): Deleted. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayer::supportsRoundedClip): (WebCore::GraphicsLayerCA::setMasksToBoundsRect): * platform/graphics/ca/GraphicsLayerCA.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): (WebCore::RenderLayerBacking::updateChildClippingStrategy): 2020-10-22 Chris Dumez <cdumez@apple.com> Share more code between WorkerThread and AudioWorkletThread https://bugs.webkit.org/show_bug.cgi?id=218051 Reviewed by Geoffrey Garen. Share more code between WorkerThread and AudioWorkletThread by moving more logic to the WorkerOrWorklet base class. No new tests, no web-facing behavior change. * Modules/webaudio/AudioWorkletMessagingProxy.cpp: (WebCore::generateWorkletParameters): * Modules/webaudio/AudioWorkletThread.cpp: (WebCore::AudioWorkletThread::AudioWorkletThread): (WebCore::AudioWorkletThread::createGlobalScope): (WebCore::AudioWorkletThread::workerLoaderProxy): (WebCore::AudioWorkletThread::createThread): (WebCore::AudioWorkletThread::globalScope const): * Modules/webaudio/AudioWorkletThread.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * page/MemoryRelease.cpp: (WebCore::releaseMemory): * page/cocoa/ResourceUsageThreadCocoa.mm: (WebCore::ResourceUsageThread::platformCollectCPUData): * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::ResourceUsageThread::platformCollectCPUData): * workers/DedicatedWorkerThread.cpp: (WebCore::DedicatedWorkerThread::runEventLoop): * workers/WorkerGlobalScope.h: * workers/WorkerOrWorkletGlobalScope.h: (WebCore::WorkerOrWorkletGlobalScope::suspend): (WebCore::WorkerOrWorkletGlobalScope::resume): * workers/WorkerOrWorkletThread.cpp: Copied from Source/WebCore/workers/WorkerThread.cpp. (WebCore::WorkerOrWorkletThread::workerOrWorkletThreadsLock): (WebCore::WorkerOrWorkletThread::WorkerOrWorkletThread): (WebCore::WorkerOrWorkletThread::~WorkerOrWorkletThread): (WebCore::WorkerOrWorkletThread::startRunningDebuggerTasks): (WebCore::WorkerOrWorkletThread::stopRunningDebuggerTasks): (WebCore::WorkerOrWorkletThread::runEventLoop): (WebCore::WorkerOrWorkletThread::workerOrWorkletThread): (WebCore::WorkerOrWorkletThread::start): (WebCore::WorkerOrWorkletThread::stop): (WebCore::WorkerOrWorkletThread::suspend): (WebCore::WorkerOrWorkletThread::resume): (WebCore::WorkerOrWorkletThread::releaseFastMallocFreeMemoryInAllThreads): * workers/WorkerOrWorkletThread.h: (WebCore::WorkerOrWorkletThread::thread const): (WebCore::WorkerOrWorkletThread::globalScope const): (WebCore::WorkerOrWorkletThread::runLoop): (WebCore::WorkerOrWorkletThread::start): (WebCore::WorkerOrWorkletThread::stop): (WebCore::WorkerOrWorkletThread::identifier const): (WebCore::WorkerOrWorkletThread::evaluateScriptIfNecessary): (WebCore::WorkerOrWorkletThread::shouldWaitForWebInspectorOnStartup const): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThreadCount): (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::~WorkerThread): (WebCore::WorkerThread::createThread): (WebCore::WorkerThread::createGlobalScope): (WebCore::WorkerThread::shouldWaitForWebInspectorOnStartup const): (WebCore::WorkerThread::evaluateScriptIfNecessary): (WebCore::WorkerThread::globalScope): * workers/WorkerThread.h: * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::queueTaskToFireFetchEvent): (WebCore::ServiceWorkerThread::queueTaskToPostMessage): (WebCore::ServiceWorkerThread::queueTaskToFireInstallEvent): (WebCore::ServiceWorkerThread::queueTaskToFireActivateEvent): (WebCore::ServiceWorkerThread::finishedEvaluatingScript): * worklets/Worklet.cpp: (WebCore::Worklet::Worklet): * worklets/Worklet.h: (WebCore::Worklet::identifier const): * worklets/WorkletParameters.h: (WebCore::WorkletParameters::isolatedCopy const): 2020-10-22 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes, late-ish October 2020 edition https://bugs.webkit.org/show_bug.cgi?id=218095 Unreviewed non-unified build fix. No new tests needed. * Modules/speech/SpeechRecognitionResultList.h: Include SpeechRecognitionResult.h instead of using a forward declaration. * layout/integration/LayoutIntegrationLineLayout.cpp: Add missing RenderImage.h header. * page/scrolling/ScrollingTreeLatchingController.h: Add missing wtf/OptionSet.h header and forward-declare WheelEventProcessingSteps. * workers/WorkerOrWorkletGlobalScope.cpp: Add missing WorkerOrWorkletThread.h and WorkerRunLoop.h headers. 2020-10-22 Chris Dumez <cdumez@apple.com> Web Audio continues to play when navigating off the web page via an iframe https://bugs.webkit.org/show_bug.cgi?id=218078 Reviewed by Eric Carlson. The page was suspending playback when clicking the link and then resuming playback in the pagehide event handler. The issue is that the AudioContext's state gets updated asynchronously when the page suspends or resume rendering, as per specification. When entering the back/forward cache, AudioContext::suspend() would be called but would do nothing because the state was "suspended", despite the script having just called "resume()". To address the issue, AudioContext::suspend() now early returns only if the context is closed or based on the m_wasSuspendedByScript flag when gets updated synchronously when the script calls suspend() / resume(). Similarly, AudioContext::resume() checks those same flags now. No new tests, this impacts audio rendering on speakers but is not web-observable. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::resumeRendering): Check if the MediaSession is interrupted before asynchronously setting the AudioContext's state to "running". This is important because the state gets updated asynchronously but the MediaSession can be interrupted synchronously when AudioContext::suspend() gets called, which would have set the AudioContext's state to "interrupted". We don't want to incorrectly change the state from "interrupted" to "running" in this case. Note that AudioContext::suspendRendering() already does the same thing. (WebCore::AudioContext::suspend): (WebCore::AudioContext::resume): Only early return if the AudioContext is closed or if the m_wasSuspendedByScript flag is set. The m_wasSuspendedByScript gets updated synchronously when suspendRendering() / resumeRendering() get called, unlike the AudioContext's state which gets updated asynchronously. (WebCore::AudioContext::suspendPlayback): Stop early returning if the state is "suspended". This was wrong since the state gets updated asynchronously. 2020-10-22 Martin Robinson <mrobinson@igalia.com> Rename scroll-snap-margin to scroll-margin https://bugs.webkit.org/show_bug.cgi?id=218075 Reviewed by Simon Fraser. Rename scroll-snap-margin to scroll-margin while leaving scroll-snap-margin still available as an alias for backward compatibility reasons. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): Rename CSS property name. * css/CSSProperties.json: Rename CSS property and add an alias to the old name. * css/StyleProperties.cpp: Changes to reflect new name. (WebCore::StyleProperties::getPropertyValue const): Ditto. (WebCore::StyleProperties::asText const): Ditto. * css/parser/CSSPropertyParser.cpp: Ditto. (WebCore::CSSPropertyParser::parseSingleValue): Ditto. (WebCore::CSSPropertyParser::parseShorthand): Ditto. * page/scrolling/AxisScrollSnapOffsets.cpp: Ditto. (WebCore::updateSnapOffsetsForScrollableArea): Ditto. * rendering/style/RenderStyle.cpp: Ditto. (WebCore::RenderStyle::scrollMargin const): Ditto. (WebCore::RenderStyle::scrollMarginTop const): Ditto. (WebCore::RenderStyle::scrollMarginBottom const): Ditto. (WebCore::RenderStyle::scrollMarginLeft const): Ditto. (WebCore::RenderStyle::scrollMarginRight const): Ditto. (WebCore::RenderStyle::setScrollMarginTop): Ditto. (WebCore::RenderStyle::setScrollMarginBottom): Ditto. (WebCore::RenderStyle::setScrollMarginLeft): Ditto. (WebCore::RenderStyle::setScrollMarginRight): Ditto. (WebCore::RenderStyle::scrollSnapMargin const): Deleted. (WebCore::RenderStyle::scrollSnapMarginTop const): Deleted. (WebCore::RenderStyle::scrollSnapMarginBottom const): Deleted. (WebCore::RenderStyle::scrollSnapMarginLeft const): Deleted. (WebCore::RenderStyle::scrollSnapMarginRight const): Deleted. (WebCore::RenderStyle::setScrollSnapMarginTop): Deleted. (WebCore::RenderStyle::setScrollSnapMarginBottom): Deleted. (WebCore::RenderStyle::setScrollSnapMarginLeft): Deleted. (WebCore::RenderStyle::setScrollSnapMarginRight): Deleted. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialScrollMargin): Added to reflect new name. (WebCore::RenderStyle::initialScrollSnapMargin): Deleted. * rendering/style/StyleScrollSnapPoints.cpp: Changes to reflect new name. (WebCore::StyleScrollSnapArea::StyleScrollSnapArea): Ditto. * rendering/style/StyleScrollSnapPoints.h: Ditto. (WebCore::operator==): Ditto. 2020-10-22 Noam Rosenthal <noam@webkit.org> Support EXIF image resolution in CoreGraphics (macOS/iOS) https://bugs.webkit.org/show_bug.cgi?id=217820 Reviewed by Darin Adler. Spec: https://github.com/whatwg/html/pull/5574 Read EXIF resolution/preferred size from image in decoder using CoreGraphics methods. Separate between image size and sourceSize(), the latter should only be used for accessing the actual pixels of the stored image. Imported relevant w3c tests. Tests: imported/w3c/web-platform-tests/density-size-correction/density-corrected-image-in-canvas.html imported/w3c/web-platform-tests/density-size-correction/density-corrected-image-svg-aspect-ratio.html imported/w3c/web-platform-tests/density-size-correction/density-corrected-image-svg.html imported/w3c/web-platform-tests/density-size-correction/density-corrected-natural-size.html imported/w3c/web-platform-tests/density-size-correction/density-corrected-size-bg.html imported/w3c/web-platform-tests/density-size-correction/density-corrected-size-img.html imported/w3c/web-platform-tests/density-size-correction/density-corrected-size-pseudo-elements.html imported/w3c/web-platform-tests/density-size-correction/density-corrected-various-elements.html * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texImageSourceHelper): Similar to orientation, draw into a buffer before uploading to WebGL also when the image has a density corrected size. * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::preTransformedNativeImageForCurrentFrame): Apply density-correction when pre-transforming image for tile drawing. (WebCore::BitmapImage::draw): Correct the source-rect when drawing the image. (WebCore::BitmapImage::nativeImageForCurrentFrameRespectingOrientation): Deleted. Renamed to preTransformedNativeImageForCurrentFrame. * platform/graphics/BitmapImage.h: * platform/graphics/Image.h: (WebCore::Image::sourceSize const): (WebCore::Image::hasDensityCorrectedSize const): (WebCore::Image::preTransformedNativeImageForCurrentFrame): (WebCore::Image::nativeImageForCurrentFrameRespectingOrientation): Deleted. Expose hasDensityCorrectedSize and sourceSize (for WebGL) and * platform/graphics/ImageDecoder.h: (WebCore::ImageDecoder::frameDensityCorrectedSizeAtIndex const): * platform/graphics/ImageFrame.h: (WebCore::ImageFrame::setDensityCorrectedSize): (WebCore::ImageFrame::densityCorrectedSize const): * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::cacheMetadataAtIndex): (WebCore::ImageSource::densityCorrectedSize): (WebCore::ImageSource::size): (WebCore::ImageSource::sourceSize): * platform/graphics/ImageSource.h: (WebCore::ImageSource::hasDensityCorrectedSize): Expose existence of densityCorrectedSize in Image{Decoder|Source|Frame}. * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::drawPattern): Handle nativeImageForCurrentFrameRespectingOrientation rename. * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::createImageSourceMetadataOptions): (WebCore::densityCorrectedSizeFromProperties): (WebCore::ImageDecoderCG::hotSpot const): (WebCore::ImageDecoderCG::frameDensityCorrectedSizeAtIndex const): (WebCore::ImageDecoderCG::createFrameImageAtIndex): * platform/graphics/cg/ImageDecoderCG.h: * platform/image-decoders/ScalableImageDecoder.h: Decode image resolution from image metadata. * WebCore.xcodeproj/project.pbxproj: * platform/graphics/ImageResolution.h: * platform/graphics/ImageResolution.cpp: Added. 2020-10-22 Youenn Fablet <youenn@apple.com> Introduce worklet destinations and allow to fetch modules with CORS based on destination https://bugs.webkit.org/show_bug.cgi?id=218019 <rdar://problem/70526201> Reviewed by Chris Dumez. Add support for audioworklet and paintworklet fetch destinations. In case of those destinations, use cors mode instead of same-origin mode when fetching worklet top level module. Test: http/wpt/webaudio/audioworklet-addModule-cors.sub.https.html * Modules/fetch/FetchRequest.idl: * loader/FetchOptions.h: (WebCore::isScriptLikeDestination): * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::loadAsynchronously): * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::processNextScriptFetchJobIfNeeded): 2020-10-22 Don Olmstead <don.olmstead@sony.com> [WebGPU] Add Dawn implementation skeleton https://bugs.webkit.org/show_bug.cgi?id=217982 Reviewed by Myles C. Maxfield. Add an empty implementation of the WebGPU types. This gets WebGPU built and linking using Dawn. * PlatformWinCairo.cmake: * platform/Dawn.cmake: Added. * platform/graphics/gpu/GPUPlatformTypes.h: * platform/graphics/gpu/dawn/GPUBindGroupAllocatorDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h. (WebCore::GPUBindGroupAllocator::create): (WebCore::GPUBindGroupAllocator::GPUBindGroupAllocator): (WebCore::GPUBindGroupAllocator::reallocate): (WebCore::GPUBindGroupAllocator::tryReset): * platform/graphics/gpu/dawn/GPUBindGroupDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h. (WebCore::GPUBindGroup::tryCreate): (WebCore::GPUBindGroup::GPUBindGroup): (WebCore::GPUBindGroup::~GPUBindGroup): * platform/graphics/gpu/dawn/GPUBindGroupLayoutDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h. (WebCore::GPUBindGroupLayout::tryCreate): * platform/graphics/gpu/dawn/GPUBufferDawn.cpp: Added. (WebCore::GPUBuffer::tryCreate): (WebCore::GPUBuffer::GPUBuffer): (WebCore::GPUBuffer::~GPUBuffer): (WebCore::GPUBuffer::isReadOnly const): (WebCore::GPUBuffer::state const): (WebCore::GPUBuffer::mapOnCreation): (WebCore::GPUBuffer::registerMappingCallback): (WebCore::GPUBuffer::runMappingCallback): (WebCore::GPUBuffer::stagingBufferForRead): (WebCore::GPUBuffer::stagingBufferForWrite): (WebCore::GPUBuffer::copyStagingBufferToGPU): (WebCore::GPUBuffer::unmap): (WebCore::GPUBuffer::destroy): * platform/graphics/gpu/dawn/GPUCommandBufferDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h. (WebCore::GPUCommandBuffer::tryCreate): (WebCore::GPUCommandBuffer::GPUCommandBuffer): (WebCore::GPUCommandBuffer::copyBufferToBuffer): (WebCore::GPUCommandBuffer::copyBufferToTexture): (WebCore::GPUCommandBuffer::copyTextureToBuffer): (WebCore::GPUCommandBuffer::copyTextureToTexture): * platform/graphics/gpu/dawn/GPUComputePassEncoderDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h. (WebCore::GPUComputePassEncoder::tryCreate): (WebCore::GPUComputePassEncoder::GPUComputePassEncoder): (WebCore::GPUComputePassEncoder::setPipeline): (WebCore::GPUComputePassEncoder::dispatch): (WebCore::GPUComputePassEncoder::platformPassEncoder const): * platform/graphics/gpu/dawn/GPUComputePipelineDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h. (WebCore::GPUComputePipeline::tryCreate): (WebCore::GPUComputePipeline::recompile): * platform/graphics/gpu/dawn/GPUDeviceDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h. (WebCore::GPUDevice::tryCreate): (WebCore::GPUDevice::GPUDevice): * platform/graphics/gpu/dawn/GPUPlatformTypesDawn.h: Added. (WebCore::HandleDeleter<PlatformBuffer>::operator()): (WebCore::HandleDeleter<PlatformCommandBuffer>::operator()): (WebCore::HandleDeleter<PlatformComputePassEncoder>::operator()): (WebCore::HandleDeleter<PlatformComputePipeline>::operator()): (WebCore::HandleDeleter<PlatformDevice>::operator()): (WebCore::HandleDeleter<PlatformDrawable>::operator()): (WebCore::HandleDeleter<PlatformProgrammablePassEncoder>::operator()): (WebCore::HandleDeleter<PlatformQueue>::operator()): (WebCore::HandleDeleter<PlatformRenderPassEncoder>::operator()): (WebCore::HandleDeleter<PlatformRenderPipeline>::operator()): (WebCore::HandleDeleter<PlatformSampler>::operator()): (WebCore::HandleDeleter<PlatformShaderModule>::operator()): (WebCore::HandleDeleter<PlatformSwapLayer>::operator()): (WebCore::HandleDeleter<PlatformTexture>::operator()): * platform/graphics/gpu/dawn/GPUProgrammablePassEncoderDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h. (WebCore::GPUProgrammablePassEncoder::endPass): (WebCore::GPUProgrammablePassEncoder::setBindGroup): * platform/graphics/gpu/dawn/GPUQueueDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h. (WebCore::GPUQueue::tryCreate): (WebCore::GPUQueue::GPUQueue): (WebCore::GPUQueue::submit): (WebCore::GPUQueue::label const): (WebCore::GPUQueue::setLabel const): * platform/graphics/gpu/dawn/GPURenderPassEncoderDawn.cpp: Added. (WebCore::GPURenderPassEncoder::tryCreate): (WebCore::GPURenderPassEncoder::GPURenderPassEncoder): (WebCore::GPURenderPassEncoder::platformPassEncoder const): (WebCore::GPURenderPassEncoder::setPipeline): (WebCore::GPURenderPassEncoder::setBlendColor): (WebCore::GPURenderPassEncoder::setViewport): (WebCore::GPURenderPassEncoder::setScissorRect): (WebCore::GPURenderPassEncoder::setIndexBuffer): (WebCore::GPURenderPassEncoder::setVertexBuffers): (WebCore::GPURenderPassEncoder::draw): (WebCore::GPURenderPassEncoder::drawIndexed): * platform/graphics/gpu/dawn/GPURenderPipelineDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h. (WebCore::GPURenderPipeline::tryCreate): (WebCore::GPURenderPipeline::recompile): * platform/graphics/gpu/dawn/GPUSamplerDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h. (WebCore::GPUSampler::tryCreate): (WebCore::GPUSampler::GPUSampler): * platform/graphics/gpu/dawn/GPUShaderModuleDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h. (WebCore::GPUShaderModule::tryCreate): (WebCore::GPUShaderModule::GPUShaderModule): * platform/graphics/gpu/dawn/GPUSwapChainDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h. (WebCore::GPUSwapChain::tryCreate): (WebCore::GPUSwapChain::GPUSwapChain): (WebCore::GPUSwapChain::tryGetCurrentTexture): (WebCore::GPUSwapChain::present): (WebCore::GPUSwapChain::reshape): (WebCore::GPUSwapChain::platformLayer const): * platform/graphics/gpu/dawn/GPUTextureDawn.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUPlatformTypes.h. (WebCore::GPUTexture::tryCreate): (WebCore::GPUTexture::create): (WebCore::GPUTexture::GPUTexture): (WebCore::GPUTexture::tryCreateDefaultTextureView): 2020-10-22 Chris Dumez <cdumez@apple.com> Turn ScriptExecutionContext::vm() into a pure virtual function https://bugs.webkit.org/show_bug.cgi?id=218057 Reviewed by Geoffrey Garen. Turn ScriptExecutionContext::vm() into a pure virtual function instead of using a non-virtual function that does type-checking inside. * dom/Document.cpp: (WebCore::Document::vm): * dom/Document.h: * dom/EmptyScriptExecutionContext.h: * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::vm): Deleted. * dom/ScriptExecutionContext.h: * workers/WorkerOrWorkletGlobalScope.cpp: (WebCore::WorkerOrWorkletGlobalScope::vm): * workers/WorkerOrWorkletGlobalScope.h: 2020-10-22 Aditya Keerthi <akeerthi@apple.com> [iOS] Prevent presentation of input peripherals when focusing form controls with a validation message https://bugs.webkit.org/show_bug.cgi?id=218004 <rdar://problem/70507678> Reviewed by Wenson Hsieh. Added isFocusingWithValidationMessage() to HTMLFormControlElement so that the state can be encoded in FocusedElementInformation and sent to the UIProcess. See WebKit Changelog for more information. Test: fast/forms/ios/input-peripherals-with-validation-message.html * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::isFocusingWithValidationMessage const): (WebCore::HTMLFormControlElement::focusAndShowValidationMessage): * html/HTMLFormControlElement.h: 2020-10-22 Peng Liu <peng.liu6@apple.com> Let webkitDisplayingFullscreen() return true when a video element’s fullscreen mode is not VideoFullscreenModeNone https://bugs.webkit.org/show_bug.cgi?id=216426 Reviewed by Jer Noble. This patch moves m_changingVideoFullscreenMode of HTMLVideoElement to HTMLMediaElement. The flag is used to protect interfaces regarding video presentation mode changes. It also guards the code path when we use element fullscreen to implement video fullscreen (VIDEO_USES_ELEMENT_FULLSCREEN). It is better to store the flag in HTMLMediaElement to have fine control. This patch reverts the changing regarding HTMLVideoElement::webkitDisplayingFullscreen in r262456. This function will return true in the same run loop as a webkitpresentationmodechanged event is fired when a video element is entering fullscreen or picture-in-picture. Also, this patch adds Internals::isChangingPresentationMode which can be used by layout tests to check whether a video presentation mode change is completed. Covered by existing tests. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::isFullscreen const): Align the implementation with isStandardFullscreen(). (WebCore::HTMLMediaElement::enterFullscreen): Set m_changingVideoFullscreenMode to true if the video element is changing presentation mode. Also fix a bug about the flag m_waitingToEnterFullscreen. (WebCore::HTMLMediaElement::exitFullscreen): Ditto. (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Ditto. (WebCore::HTMLMediaElement::didStopBeingFullscreenElement): Ditto. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::setChangingVideoFullscreenMode): (WebCore::HTMLMediaElement::isChangingVideoFullscreenMode const): (WebCore::HTMLMediaElement::waitingToEnterFullscreen): Deleted. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): Revert the change in r262456. Some web sites expect this function to return true if the video element is entering fullscreen and the event webkitpresentationmodechanged is fired. (WebCore::HTMLVideoElement::setPresentationMode): Remove code regarding m_isChangingVideoFullscreenMode. (WebCore::HTMLVideoElement::didEnterFullscreenOrPictureInPicture): Fix an event firing issue when a video element is entering fullscreen while exiting picture-in-picture. (WebCore::HTMLVideoElement::didExitFullscreenOrPictureInPicture): Fix an event firing issue when a video element is exiting picture-in-picture. (WebCore::HTMLVideoElement::isChangingPresentationMode const): This interface is used by layout tests (through Internals) to check whether a video presentation mode change is completed. (WebCore::HTMLVideoElement::didBecomeFullscreenElement): Deleted. * html/HTMLVideoElement.h: * testing/Internals.cpp: (WebCore::Internals::isChangingPresentationMode const): This interface is used by layout tests to check whether a video presentation mode change is completed. * testing/Internals.h: * testing/Internals.idl: 2020-10-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Handle line box sizing quirks at the line box level https://bugs.webkit.org/show_bug.cgi?id=218060 Reviewed by Antti Koivisto. In this patch the line box vertical sizing behavior (mostly quirk) is moved from the inline box to the line box level. 1. Inline boxes (root and other inline boxes (<span>)) are always sized to their initial height (see layout bounds) regardless of whether they have content or not. 2. They are set to empty initially and we change them to non-empty as they gain (non-inline-level-box) content (e.g. <div>root inline box gains content</div>). 3. Use this empty flag as input to the line box vertical sizing logic (only non-empty inline boxes contribute to the line box height). Note that in standard mode the root inline box starts with an imaginary strut which makes it non-empty even when it has no content. This is most visible with simple block containers like this: <div style="border: 1px solid green"><img></div> In quirks mode the border hugs the image (root inline box does not contribute to the height of the line box), while in standard mode (assume 1. the image is taller than the default font with line spacing, 2. font has 4px descent), there's a 4px gap between the border and the image. 4. While computing the final line rect (InlineFormattingContext::Geometry::computedLineLogicalRect), just rely on the line box height computation (no need to check whether the line has content). 5. Treat <br> as visually non-empty run as it may contribute to the line box visually. 6. Add <br> quirk behavior so that it only contributes to the line box height when the line is empty. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): (WebCore::Layout::LineBoxBuilder::alignInlineLevelBoxesVerticallyAndComputeLineBoxHeight): (WebCore::Layout::InlineFormattingContext::Geometry::computedLineLogicalRect const): * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::shouldInlineLevelBoxStretchLineBox const): * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::isRunVisuallyNonEmpty const): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineLevelBox::verticalAlign const): 2020-10-22 Antti Koivisto <antti@apple.com> [LFC][Integration] Lines with outline should be marked having visual overflow https://bugs.webkit.org/show_bug.cgi?id=218071 Reviewed by Zalan Bujtas. Seen in fast/repaint/focus-ring-repaint.html We may fail to paint newly added outlines correctly. This is a legacy line layout bug exposed by IFC integration. * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::addToLine): Mark when adding content to line. 2020-10-22 Cathie Chen <cathiechen@igalia.com> ResizeObserver is not properly garbage collected https://bugs.webkit.org/show_bug.cgi?id=215158 Reviewed by Frédéric Wang. If ResizeObservers are referenced inside ResizeObserverCallbacks, they are not garbage collected properly. To fix this, add IsWeakCallback to ResizeObserverCallback interface so that it uses JSC::Weak to store the callback. And add the callback to visitor in JSResizeObserver::visitAdditionalChildren() to keep it alive. In order to test ResizeObserver leak, add test interface numberOfResizeObservers() to Internals.idl. Test: resize-observer/resize-observer-callback-leak.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSResizeObserverCustom.cpp: Copied from Source/WebCore/page/ResizeObserverCallback.idl. (WebCore::JSResizeObserver::visitAdditionalChildren): Add callback to SlotVisitor. * dom/Document.h: (WebCore::Document::numberOfResizeObservers const): * page/ResizeObserver.h: (WebCore::ResizeObserver::callback): * page/ResizeObserver.idl: Add JSCustomMarkFunction to the interface. * page/ResizeObserverCallback.h: * page/ResizeObserverCallback.idl: Add IsWeakCallback to the interface. * testing/Internals.cpp: Add numberOfResizeObservers. (WebCore::Internals::numberOfResizeObservers const): * testing/Internals.h: * testing/Internals.idl: 2020-10-22 Philippe Normand <pnormand@igalia.com> [GStreamer] Restrict ImageDecoder to WebProcess https://bugs.webkit.org/show_bug.cgi?id=218023 Reviewed by Carlos Garcia Campos. Ideally this decoder should operate only from the WebProcess (or from the GPUProcess) which should be the only process where GStreamer has been runtime initialized. This is a step towards a GStreamer-free GTK/WPE UIProcess. * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::supportsContainerType): (WebCore::ImageDecoderGStreamer::canDecodeType): 2020-10-22 Martin Robinson <mrobinson@igalia.com> Scroll snap: don't create implicit snap points at scrollmin/scrollmax https://bugs.webkit.org/show_bug.cgi?id=216882 <rdar://problem/69443288> Reviewed by Simon Fraser. * page/scrolling/AxisScrollSnapOffsets.cpp: (WebCore::updateSnapOffsetsForScrollableArea): No longer call adjustmentForTextAutosizing and only conditionally adjust the scroll area by the scroll offset, becauase mapping to container coordinates only applies container scroll offsets in the case that the container is not a ScrollView. (WebCore::adjustAxisSnapOffsetsForScrollExtent): Deleted. 2020-10-21 Alex Christensen <achristensen@webkit.org> Update and pass new URL web platform tests https://bugs.webkit.org/show_bug.cgi?id=218056 Reviewed by Tim Horton. Don't add an extra forward slash at the beginning when setting the path of a file URL that starts with a backslash, which we turn into a forward slash when parsing file URL paths. This conveniently involves removing duplicate code. This matches the behavior of Chrome and the URL spec. Covered by newly passing web platform tests. * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setPathname): 2020-10-21 Alex Christensen <achristensen@webkit.org> Replace O(n^2) algorithm from r268709 with O(n) algorithm https://bugs.webkit.org/show_bug.cgi?id=218062 Reviewed by Alexey Shvayka. r268709 introduced a Vector::findMatching call inside a loop that populates the Vector. This causes very slow construction of URLSearchParams with large dictionaries with 16-bit keys. To speed things up, keep a HashMap of the 16-bit strings we have already inserted to their index in the Vector so we don't need to search the Vector. * bindings/js/JSDOMConvertRecord.h: 2020-10-21 Carlos Alberto Lopez Perez <clopez@igalia.com> REGRESSION(r268798): Fix build without ENABLE_LAYOUT_FORMATTING_CONTEXT https://bugs.webkit.org/show_bug.cgi?id=218017 Unreviewed build-fix. * rendering/RenderBox.cpp: (WebCore::RenderBox::styleDidChange): Add missing ifdef guards. 2020-10-21 Sam Weinig <weinig@apple.com> Remove use of in-makefile grepping of FEATURE_AND_PLATFORM_DEFINES https://bugs.webkit.org/show_bug.cgi?id=218001 Reviewed by Darin Adler. Remove use of the $(findstring NEEDLE,$(FEATURE_AND_PLATFORM_DEFINES)) idiom in DerivedSources.make to pave the way to passing FEATURE_AND_PLATFORM_DEFINES as a file to scripts, rather than always on the command line, which is quite noisy. * DerivedSources.make: Remove conditionalized additions to ADDITIONAL_BINDING_IDLS and just always add the concrete set, relying on the existing extended attributes in the IDLs instead. It's also not necessary to ever add the touch related IDL files in WebCore here as no users of DerivedSources.make use those. Also removes conditional additions to USER_AGENT_STYLE_SHEETS and instead adds the appropriate #ifdefs to the css files themselves which are already getting preprocessed appropriately. * css/fullscreen.css: * css/mathml.css: * css/mediaControls.css: * html/shadow/mac/imageControlsMac.css: Put required #ifdefs into the css files themselves, rather than embedding the logic in the makefile. 2020-10-21 Megan Gardner <megan_gardner@apple.com> Stop gap patch fix for regression in r267329. https://bugs.webkit.org/show_bug.cgi?id=218020 <rdar://problem/69542459> Reviewed by Darin Adler. The refactoring in https://bugs.webkit.org/show_bug.cgi?id=216739 caused selections to expand in both directions after a double-click and drag to expand on mac. This behavior was not observed on iOS. This removes the error-prone calculation. Note that this bug does not occur if only testing immediatly moving the drag point to the end of the selection. Dragging across all the words as a real user would needs to be emulated. Test: editing/selection/double-click-and-drag-over-anchor-to-select.html * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::validate): 2020-10-21 Alex Christensen <achristensen@webkit.org> Implement ISO-2022-JP encoder step 3 https://bugs.webkit.org/show_bug.cgi?id=218046 Reviewed by Darin Adler. https://encoding.spec.whatwg.org/#iso-2022-jp-encoder step 3 was put in a few years ago and recently implemented by Firefox. Covered by updated and newly passing web platform tests. * platform/text/TextCodecCJK.cpp: (WebCore::iso2022JPEncode): 2020-10-21 Chris Dumez <cdumez@apple.com> Address post-landing review feedback from Sam Weinig for r268820. * Modules/webaudio/AudioSummingJunction.cpp: (WebCore::AudioSummingJunction::maximumNumberOfChannels const): 2020-10-21 Chris Dumez <cdumez@apple.com> Update FFTFrame::realData() / imagData() to return an AudioFloatArray https://bugs.webkit.org/show_bug.cgi?id=218048 Reviewed by Philippe Normand. Update FFTFrame::realData() / imagData() to return an AudioFloatArray instead of a float*. It is risky to expose a float* since the caller has no way to know the actual size of the array. By returning an AudioFloatArray, the caller can query AudioFloatArray::size() to know the actual size. Note that it is not safe to assume that the size of these arrays is FFTFrame::fftSize() because this is not true for ports using GStreamer. * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::createBandLimitedTables): * Modules/webaudio/RealtimeAnalyser.cpp: (WebCore::RealtimeAnalyser::doFFTAnalysisIfNecessary): * platform/audio/FFTFrame.cpp: (WebCore::FFTFrame::interpolateFrequencyComponents): (WebCore::FFTFrame::scaleFFT): (WebCore::FFTFrame::multiply): (WebCore::FFTFrame::extractAverageGroupDelay): (WebCore::FFTFrame::addConstantGroupDelay): (WebCore::FFTFrame::print): * platform/audio/FFTFrame.h: (WebCore::FFTFrame::realData): (WebCore::FFTFrame::imagData): (WebCore::FFTFrame::realData const): (WebCore::FFTFrame::imagData const): * platform/audio/FFTFrameStub.cpp: (WebCore::FFTFrame::realData const): Deleted. (WebCore::FFTFrame::imagData const): Deleted. * platform/audio/gstreamer/FFTFrameGStreamer.cpp: (WebCore::FFTFrame::FFTFrame): (WebCore::FFTFrame::realData const): Deleted. (WebCore::FFTFrame::imagData const): Deleted. * platform/audio/mac/FFTFrameMac.cpp: (WebCore::FFTFrame::FFTFrame): (WebCore::FFTFrame::doFFT): (WebCore::FFTFrame::realData const): Deleted. (WebCore::FFTFrame::imagData const): Deleted. 2020-10-21 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Add content dependent vertical line snapping https://bugs.webkit.org/show_bug.cgi?id=218034 Reviewed by Antti Koivisto. This patch ensures that IFC integration line snapping matches the legacy line layout snapping behavior (e.g. images prevent line snapping). * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineLevelBox::isAtomicInlineLevelBox const): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): 2020-10-21 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Apply font line-spacing to <br> inline level box https://bugs.webkit.org/show_bug.cgi?id=218043 Reviewed by Antti Koivisto. The inline level box initiated by <br> should be vertically sized the same way as the root inline box is. (e.g. <div>root text<br></div> <- line break's inline level box should match the layout bounds of the root inline box). * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::isRootInlineBox const): (WebCore::Layout::LineBoxBuilder::isRootBox const): (WebCore::Layout::LineBoxBuilder::setVerticalGeometryForInlineBox const): (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): 2020-10-21 Chris Dumez <cdumez@apple.com> Share more code between WorkerGlobalScope and WorkletGlobalScope https://bugs.webkit.org/show_bug.cgi?id=217995 Reviewed by Darin Adler. Share more code between WorkerGlobalScope and WorkletGlobalScope by moving shared logic to WorkerOrWorkletGlobalScope. No new tests, no Web-facing behavior change. * Modules/webaudio/AudioWorkletGlobalScope.cpp: (WebCore::AudioWorkletGlobalScope::prepareForDestruction): * Modules/webaudio/AudioWorkletGlobalScope.h: * Modules/webaudio/AudioWorkletThread.cpp: (WebCore::AudioWorkletThread::stop): * workers/WorkerEventLoop.cpp: (WebCore::WorkerEventLoop::create): (WebCore::WorkerEventLoop::WorkerEventLoop): * workers/WorkerEventLoop.h: * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): (WebCore::WorkerGlobalScope::prepareForDestruction): (WebCore::WorkerGlobalScope::removeAllEventListeners): (WebCore::WorkerGlobalScope::suspend): (WebCore::WorkerGlobalScope::resume): (WebCore::WorkerGlobalScope::close): (WebCore::WorkerGlobalScope::wrapCryptoKey): (WebCore::WorkerGlobalScope::unwrapCryptoKey): (WebCore::WorkerGlobalScope::thread const): * workers/WorkerGlobalScope.h: * workers/WorkerOrWorkletGlobalScope.cpp: (WebCore::WorkerOrWorkletGlobalScope::WorkerOrWorkletGlobalScope): (WebCore::WorkerOrWorkletGlobalScope::prepareForDestruction): (WebCore::WorkerOrWorkletGlobalScope::disableEval): (WebCore::WorkerOrWorkletGlobalScope::disableWebAssembly): (WebCore::WorkerOrWorkletGlobalScope::isJSExecutionForbidden const): (WebCore::WorkerOrWorkletGlobalScope::eventLoop): (WebCore::WorkerOrWorkletGlobalScope::isContextThread const): (WebCore::WorkerOrWorkletGlobalScope::postTask): * workers/WorkerOrWorkletGlobalScope.h: (WebCore::WorkerOrWorkletGlobalScope::isClosing const): (WebCore::WorkerOrWorkletGlobalScope::workerOrWorkletThread const): (WebCore::WorkerOrWorkletGlobalScope::markAsClosing): * workers/WorkerThread.cpp: (WebCore::WorkerThread::stop): * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): (WebCore::WorkletGlobalScope::prepareForDestruction): * worklets/WorkletGlobalScope.h: 2020-10-21 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Line may be able to fit some more content when the current candidate is trimmable https://bugs.webkit.org/show_bug.cgi?id=218044 Reviewed by Antti Koivisto. This patch addresses the cases when the candidate content is partially/fully trimmable and after putting the content on the line, there's still enough room to accommodate some more content. * layout/inlineformatting/InlineContentBreaker.cpp: (WebCore::Layout::InlineContentBreaker::processOverflowingContent const): 2020-10-21 Chris Dumez <cdumez@apple.com> Add addOutput() / removeOutput() utility functions to AudioSummingJunction https://bugs.webkit.org/show_bug.cgi?id=218045 Reviewed by Eric Carlson. Add addOutput() / removeOutput() utility functions to AudioSummingJunction to add or remove outputs from m_outputs and abstract away the call to changedOutputs(). It was awkward that subclasses were modifying m_outputs directly and had to explicitly call changedOutputs() whenever they did. No new tests, no web-facing behavior change. * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::updateChannelsForInputs): * Modules/webaudio/AudioNodeInput.cpp: (WebCore::AudioNodeInput::connect): (WebCore::AudioNodeInput::disconnect): (WebCore::AudioNodeInput::disable): (WebCore::AudioNodeInput::enable): (WebCore::AudioNodeInput::numberOfChannels const): * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::connect): (WebCore::AudioParam::disconnect): * Modules/webaudio/AudioSummingJunction.cpp: (WebCore::AudioSummingJunction::markRenderingStateAsDirty): (WebCore::AudioSummingJunction::addOutput): (WebCore::AudioSummingJunction::removeOutput): (WebCore::AudioSummingJunction::maximumNumberOfChannels const): (WebCore::AudioSummingJunction::changedOutputs): Deleted. * Modules/webaudio/AudioSummingJunction.h: 2020-10-21 Rob Buis <rbuis@igalia.com> Add lazy image loading to feature status page https://bugs.webkit.org/show_bug.cgi?id=208225 Reviewed by Simon Fraser. Add status entry for lazy image loading. * features.json: 2020-10-21 Antti Koivisto <antti@apple.com> [LFC][Integration] Update style of contained layout boxes https://bugs.webkit.org/show_bug.cgi?id=218017 <rdar://problem/70531938> Reviewed by Zalan Bujtas. Followup fix. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::containing): 2020-10-21 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Remove redundant vertical position snapping in the iterator interface https://bugs.webkit.org/show_bug.cgi?id=218039 Reviewed by Antti Koivisto. Snapping is done during display content construction. * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::rect const): (WebCore::LayoutIntegration::verticallyRoundedRect): Deleted. 2020-10-21 Peng Liu <peng.liu6@apple.com> A video element may fail to enter picture-in-picture from fullscreen https://bugs.webkit.org/show_bug.cgi?id=217999 Reviewed by Eric Carlson. When a video element is entering picture-in-picture from fullscreen, WebKit should only fire the `webkitendfullscreenEvent` event, but should not request the player in the UI process to exit fullscreen(picture-in-picture). So the condition to decide sending the exit fullscreen request is wrong because HTMLMediaElement::didBecomeFullscreenElement(), which sets `m_waitingToEnterFullscreen` to false, might be called before dispatching the `webkitendfullscreenEvent` event. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::dispatchEvent): Fix the condition. (WebCore::HTMLMediaElement::exitFullscreen): Set fullscreen mode to VideoFullscreenModeNone. 2020-10-21 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Ascent and descent are rounded to integral position https://bugs.webkit.org/show_bug.cgi?id=218036 Reviewed by Antti Koivisto. In this patch, we round ascent/descent vertical position values to integral to match legacy behavior. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::InlineLevelBox::setBaseline): (WebCore::Layout::LineBox::InlineLevelBox::setDescent): (WebCore::Layout::LineBox::InlineLevelBox::setLayoutBounds): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineLevelBox::setBaseline): Deleted. (WebCore::Layout::LineBox::InlineLevelBox::setDescent): Deleted. (WebCore::Layout::LineBox::InlineLevelBox::setLayoutBounds): Deleted. 2020-10-21 Chris Dumez <cdumez@apple.com> MessagePort & MessageEvent should be exposed to AudioWorklets https://bugs.webkit.org/show_bug.cgi?id=218037 Reviewed by Darin Adler. MessagePort & MessageEvent should be exposed to AudioWorklets: - https://html.spec.whatwg.org/#the-messageevent-interface - https://html.spec.whatwg.org/#message-ports Test: http/wpt/webaudio/the-audio-api/the-audioworklet-interface/exposed-properties.https.html * dom/MessageEvent.idl: * dom/MessagePort.idl: 2020-10-21 Chris Dumez <cdumez@apple.com> Make sure WebAudio API throws exceptions with useful error messages https://bugs.webkit.org/show_bug.cgi?id=218033 Reviewed by Darin Adler. Make sure WebAudio API throws exceptions with useful error messages to be more developer friendly. No new tests, rebaselined existing tests. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::create): * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::startLater): * Modules/webaudio/AudioWorkletGlobalScope.cpp: (WebCore::AudioWorkletGlobalScope::registerProcessor): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createScriptProcessor): (WebCore::BaseAudioContext::finishedRendering): * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::setBuffer): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::startRendering): * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::create): * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::create): * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::startRendering): 2020-10-21 Antoine Quint <graouts@webkit.org> REGRESSION (r263729): transform transition doesn't restart https://bugs.webkit.org/show_bug.cgi?id=218011 Reviewed by Dean Jackson. <rdar://problem/70035130> In the case of accelerated animations, style for the targeted element is not updated while the animation is in flight since the animation is performed by Core Animation. This means that by the time the "transitionend" event is fired, a transition has not yet performed style updates for the element that would have already been performed for a software animations and thus the updates to the completed and running transition maps performed under AnimationTimeline::updateCSSTransitionsForStyleableAndProperty() may be out of sync with the assumptions made in DocumentTimelinesController::updateAnimationsAndSendEvents() that a transition newly marked as finished should be added to the list of completed transitions. Indeed, in the newly-added test, if a style update is forced during the "transitionend" event listener before also clearing the transition styles, two style updates, and thus two calls to updateCSSTransitionsForStyleableAndProperty(), will have been performed by the time updateAnimationsAndSendEvents() runs again and collects completed transitions, during which time the transition in question will have been removed from the list of running transitions and added to the list of completed transitions (first update) and subsequently removed from the list of completed transitions (second update). At this point, setting styles that would start a new transition for this property will not yield a transition since we won't be able to satisfy the requirement that the new target value does not match that of the completed transition. In this change we stop assuming that just because updateAnimationsAndSendEvents() sees a transition as finished for the first time it implies that the transition is still considered a running transition. As such we only add a transition to the list of completed transitions should it be in the list of running transitions. Test: webanimations/transition-restart-after-style-recalc-during-transitionend.html * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::transitionDidComplete): 2020-10-21 Antoine Quint <graouts@webkit.org> Rename hasRunningTransitionsForProperty() and hasCompletedTransitionsForProperty() to be singular https://bugs.webkit.org/show_bug.cgi?id=218014 Reviewed by Geoffrey Garen. Since there is only running or completed transition per property, the name of these methods was misleading. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::updateCSSTransitionsForStyleableAndProperty): * dom/Element.cpp: (WebCore::Element::hasCompletedTransitionForProperty const): (WebCore::Element::hasRunningTransitionForProperty const): (WebCore::Element::hasCompletedTransitionsForProperty const): Deleted. (WebCore::Element::hasRunningTransitionsForProperty const): Deleted. * dom/Element.h: * style/Styleable.h: (WebCore::Styleable::hasCompletedTransitionForProperty const): (WebCore::Styleable::hasRunningTransitionForProperty const): (WebCore::Styleable::hasCompletedTransitionsForProperty const): Deleted. (WebCore::Styleable::hasRunningTransitionsForProperty const): Deleted. 2020-10-21 Antti Koivisto <antti@apple.com> [LFC][Integration] Use LineLayout::containing() in more places https://bugs.webkit.org/show_bug.cgi?id=218029 Reviewed by Zalan Bujtas. * layout/integration/LayoutIntegrationRunIterator.cpp: (WebCore::LayoutIntegration::firstTextRunFor): (WebCore::LayoutIntegration::runFor): (WebCore::LayoutIntegration::lineLayoutSystemFlowForRenderer): Deleted. * rendering/RenderText.cpp: (WebCore::RenderText::usesComplexLineLayoutPath const): (WebCore::RenderText::layoutFormattingContextLineLayout const): Deleted. * rendering/RenderText.h: 2020-10-21 Youenn Fablet <youenn@apple.com> WebRTC VP9 Decoder should be able to use VTB https://bugs.webkit.org/show_bug.cgi?id=217811 Reviewed by Eric Carlson. Add testing support to enable VP9 decoding through VTB for WebRTC. Test: webrtc/vp9-vtb.html * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCVP9VTBSupport): * testing/Internals.h: * testing/Internals.idl: 2020-10-21 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Disable image map content https://bugs.webkit.org/show_bug.cgi?id=218030 Reviewed by Antti Koivisto. Image maps are not supported yet. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForLineLayoutWithReason): 2020-10-21 Chris Dumez <cdumez@apple.com> Simplify ScriptExecutionContext::vm() https://bugs.webkit.org/show_bug.cgi?id=218028 Reviewed by Darin Adler. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::vm): 2020-10-20 Darin Adler <darin@apple.com> REGRESSION(r266295): Range allows start and end containers to belong to different trees https://bugs.webkit.org/show_bug.cgi?id=217895 Reviewed by Ryosuke Niwa. Test: fast/dom/Range/ranges-across-trees.html * dom/BoundaryPoint.h: Added treeOrder<TreeType>. * dom/Node.cpp: (WebCore::parent<Tree>): Added. (WebCore::parent<ComposedTree>): Added. (WebCore::depth): Changed into a template that takes TreeType. (WebCore::commonInclusiveAncestorAndChildren): Ditto. (WebCore::commonInclusiveAncestor): Changed to explicitly use ComposedTree to preserve the current behavior, but likely will return later to make this a template and have it us the normal tree by default. (WebCore::treeOrder): Changed into a template that takes TreeType. (WebCore::documentOrder): Call treeOrder<ComposedTree> to preserve the current behavior. Likely will delete this later after changing callers to use treeOrder. * dom/Node.h: Added Tree, ShadowIncludingTree, and ComposedTree. Added parent and treeOrder function templates. TreeType currently is a set of classes but they could also be objects of another type. Maybe an enumeration named TreeType instead? * dom/Range.cpp: (WebCore::Range::setStart): Use treeOrder instead of documentOrder to use the normal tree instead of the composed tree. (WebCore::Range::setEnd): Ditto. (WebCore::Range::isPointInRange): Use isPointInRange<Tree> instead of isPointInRange to use the normal tree instead of the composed tree. (WebCore::Range::comparePoint const): Use treeOrder instead of documentOrder to use the normal tree instead of the composed tree. (WebCore::Range::compareNode const): Ditto. (WebCore::Range::compareBoundaryPoints const): Ditto. (WebCore::Range::intersectsNode const): Use intersects<Tree> instead of isPointInRange to use the normal tree instead of the composed tree. * dom/SimpleRange.cpp: (WebCore::treeOrder): Changed into a template that takes TreeType. (WebCore::documentOrder): Call treeOrder<ComposedTree> to preserve the current behavior. Likely will delete this later after changing callers to use treeOrder. (WebCore::isPointInRange): Changed into a template that takes TreeType. For now the default tree type is still ComposedTree, but will change that later. (WebCore::intersects): Ditto. (WebCore::contains<Tree>): Added. (WebCore::contains<ComposedTree>): Added. * dom/SimpleRange.h: Added isPointInRange, intersects, and treeOrder function templates. 2020-10-21 Antti Koivisto <antti@apple.com> [LFC][Integration] Update style of contained layout boxes https://bugs.webkit.org/show_bug.cgi?id=218017 Reviewed by Zalan Bujtas. Update layout box style on style change as needed. This fixes at least fast/replaced/max-width-percent.html with image support enabled. The patch also contains refactoring to make BoxTree non-const and moves the style update code there. * layout/integration/LayoutIntegrationBoxTree.cpp: (WebCore::LayoutIntegration::BoxTree::BoxTree): (WebCore::LayoutIntegration::BoxTree::buildTree): (WebCore::LayoutIntegration::BoxTree::updateStyle): (WebCore::LayoutIntegration::BoxTree::layoutBoxForRenderer): (WebCore::LayoutIntegration::BoxTree::layoutBoxForRenderer const): (WebCore::LayoutIntegration::BoxTree::rendererForLayoutBox): (WebCore::LayoutIntegration::BoxTree::rendererForLayoutBox const): * layout/integration/LayoutIntegrationBoxTree.h: (WebCore::LayoutIntegration::BoxTree::flow const): (WebCore::LayoutIntegration::BoxTree::flow): * layout/integration/LayoutIntegrationInlineContent.cpp: (WebCore::LayoutIntegration::InlineContent::rendererForLayoutBox const): * layout/integration/LayoutIntegrationInlineContent.h: * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::LineIteratorModernPath::logicalStartRunWithNode const): (WebCore::LayoutIntegration::LineIteratorModernPath::logicalEndRunWithNode const): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::LineLayout): (WebCore::LayoutIntegration::LineLayout::containing): (WebCore::LayoutIntegration::LineLayout::updateReplacedDimensions): (WebCore::LayoutIntegration::LineLayout::updateStyle): (WebCore::LayoutIntegration::LineLayout::constructContent): (WebCore::LayoutIntegration::LineLayout::textRunsFor const): (WebCore::LayoutIntegration::LineLayout::runFor const): (WebCore::LayoutIntegration::LineLayout::rendererForLayoutBox const): (WebCore::LayoutIntegration::LineLayout::paint): (WebCore::LayoutIntegration::LineLayout::hitTest): * layout/integration/LayoutIntegrationLineLayout.h: * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::renderer const): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::styleDidChange): * rendering/RenderBox.cpp: (WebCore::RenderBox::styleDidChange): Update the line layout style. 2020-10-21 Philippe Normand <pnormand@igalia.com> Un-needed casts in Screen::{width,height}() https://bugs.webkit.org/show_bug.cgi?id=218013 Reviewed by Darin Adler. * page/Screen.cpp: (WebCore::Screen::height const): There is no need to convert from float to long and then unsigned. (WebCore::Screen::width const): Ditto. 2020-10-20 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] flex-basis not animatable https://bugs.webkit.org/show_bug.cgi?id=180435 Reviewed by Antoine Quint. Make flex-basis property animatable as per spec. This allows us to pass ~100 flexbox animation subtests. * animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Mark flex-basis as animatable. 2020-10-21 Youenn Fablet <youenn@apple.com> [iOS] Disable audio capture in the background for non Safari applications https://bugs.webkit.org/show_bug.cgi?id=217948 <rdar://problem/70241557> Reviewed by Eric Carlson. We do not have good OS support when capturing audio in a WebProcess for a backgrounded application. Until we have proper support, it seems best to mute audio capture when being backgrounded. Manually tested. * platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm: (WebCore::RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange): 2020-10-21 Philippe Normand <pnormand@igalia.com> [GStreamer] Create video sink only for video player https://bugs.webkit.org/show_bug.cgi?id=217974 Reviewed by Xabier Rodriguez-Calvar. There's no need for a video sink when the media player is created for an <audio> element. * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::initializeGStreamerAndRegisterWebKitElements): Downrank the GL video sink, as we create it on-demand and not through autovideosink anyway. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Avoid creating useless video sink. 2020-10-20 Julian Gonzalez <julian_a_gonzalez@apple.com> Release assert in ~Node due to render element of pseudo element not getting removed in time https://bugs.webkit.org/show_bug.cgi?id=217996 Reviewed by Ryosuke Niwa. When attaching a shadow root to an element, remember to tear down renderers not only if one exists on the element, but also if it uses display: contents. * dom/Element.cpp: (WebCore::Element::addShadowRoot): 2020-10-20 Sihui Liu <sihui_liu@apple.com> Add stubs for SpeechRecognition https://bugs.webkit.org/show_bug.cgi?id=217780 <rdar://problem/70350727> Unreviewed build fix after r268762. * Modules/speech/SpeechRecognitionResultList.h: 2020-10-20 Chris Dumez <cdumez@apple.com> Merge WorkerScriptController and WorkletScriptController into WorkerOrWorkletScriptController https://bugs.webkit.org/show_bug.cgi?id=217980 Reviewed by Darin Adler. Merge WorkerScriptController and WorkletScriptController into WorkerOrWorkletScriptController to share more code between workers and worklets. No new tests, no Web-facing behavior change. * Modules/webaudio/AudioWorkletThread.cpp: (WebCore::AudioWorkletThread::workletThread): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::clearDOMGuardedObjects): (WebCore::toJSDOMGlobalObject): * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::JSDOMWindowBase): (WebCore::JSDOMWindowBase::finishCreation): (WebCore::JSDOMWindowBase::proxy const): * bindings/js/JSDOMWindowBase.h: * bindings/js/JSWorkerGlobalScopeBase.cpp: (WebCore::toJS): * bindings/js/JSWorkerGlobalScopeBase.h: (WebCore::JSWorkerGlobalScopeBase::wrapped const): * bindings/js/JSWorkletGlobalScopeBase.cpp: (WebCore::toJS): * bindings/js/JSWorkletGlobalScopeBase.h: (WebCore::JSWorkletGlobalScopeBase::wrapped const): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::execute): * bindings/js/ScriptState.cpp: * bindings/js/WorkerScriptController.cpp: Removed. * bindings/js/WorkerScriptController.h: Removed. * dom/ScriptExecutionContext.cpp: * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::setupNewlyCreatedServiceWorker): * workers/DedicatedWorkerGlobalScope.h: (isType): * workers/WorkerConsoleClient.cpp: (WebCore::WorkerConsoleClient::WorkerConsoleClient): (WebCore::WorkerConsoleClient::messageWithTypeAndLevel): (WebCore::WorkerConsoleClient::count): (WebCore::WorkerConsoleClient::countReset): (WebCore::WorkerConsoleClient::time): (WebCore::WorkerConsoleClient::timeLog): (WebCore::WorkerConsoleClient::timeEnd): * workers/WorkerConsoleClient.h: * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): (WebCore::WorkerGlobalScope::disableEval): (WebCore::WorkerGlobalScope::disableWebAssembly): (WebCore::WorkerGlobalScope::importScripts): (WebCore::WorkerGlobalScope::isJSExecutionForbidden const): * workers/WorkerGlobalScope.h: * workers/WorkerOrWorkletGlobalScope.cpp: Copied from Source/WebCore/workers/WorkerOrWorkletScriptController.h. (WebCore::WorkerOrWorkletGlobalScope::WorkerOrWorkletGlobalScope): * workers/WorkerOrWorkletGlobalScope.h: (WebCore::WorkerOrWorkletGlobalScope::script const): (WebCore::WorkerOrWorkletGlobalScope::clearScript): * workers/WorkerOrWorkletScriptController.cpp: Renamed from Source/WebCore/worklets/WorkletScriptController.cpp. (WebCore::WorkerOrWorkletScriptController::WorkerOrWorkletScriptController): (WebCore::WorkerOrWorkletScriptController::~WorkerOrWorkletScriptController): (WebCore::WorkerOrWorkletScriptController::attachDebugger): (WebCore::WorkerOrWorkletScriptController::detachDebugger): (WebCore::WorkerOrWorkletScriptController::forbidExecution): (WebCore::WorkerOrWorkletScriptController::isExecutionForbidden const): (WebCore::WorkerOrWorkletScriptController::scheduleExecutionTermination): (WebCore::WorkerOrWorkletScriptController::isTerminatingExecution const): (WebCore::WorkerOrWorkletScriptController::releaseHeapAccess): (WebCore::WorkerOrWorkletScriptController::acquireHeapAccess): (WebCore::WorkerOrWorkletScriptController::addTimerSetNotification): (WebCore::WorkerOrWorkletScriptController::removeTimerSetNotification): (WebCore::WorkerOrWorkletScriptController::setException): (WebCore::WorkerOrWorkletScriptController::disableEval): (WebCore::WorkerOrWorkletScriptController::disableWebAssembly): (WebCore::WorkerOrWorkletScriptController::evaluate): (WebCore::WorkerOrWorkletScriptController::initScriptWithSubclass): (WebCore::WorkerOrWorkletScriptController::initScript): * workers/WorkerOrWorkletScriptController.h: (WebCore::WorkerOrWorkletScriptController::globalScopeWrapper): (WebCore::WorkerOrWorkletScriptController::vm): (WebCore::WorkerOrWorkletScriptController::globalScope const): (WebCore::WorkerOrWorkletScriptController::initScriptIfNeeded): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): * worklets/WorkletConsoleClient.cpp: Removed. * worklets/WorkletConsoleClient.h: Removed. * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): (WebCore::WorkletGlobalScope::~WorkletGlobalScope): (WebCore::WorkletGlobalScope::prepareForDestruction): (WebCore::WorkletGlobalScope::evaluate): (WebCore::WorkletGlobalScope::isJSExecutionForbidden const): (WebCore::WorkletGlobalScope::disableEval): (WebCore::WorkletGlobalScope::disableWebAssembly): (WebCore::WorkletGlobalScope::notifyFinished): * worklets/WorkletGlobalScope.h: * worklets/WorkletScriptController.h: Removed. 2020-10-20 Megan Gardner <megan_gardner@apple.com> Rename HighlightMap to HighlightRegister and HighlightRangeGroup to Highlight to match current spec https://bugs.webkit.org/show_bug.cgi?id=217919 Reviewed by Ryosuke Niwa. No new tests, no new behavior, rename only. https://drafts.csswg.org/css-highlight-api-1/ * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/highlight/Highlight.cpp: Renamed from Source/WebCore/Modules/highlight/HighlightRangeGroup.cpp. (WebCore::Highlight::Highlight): (WebCore::Highlight::create): (WebCore::Highlight::initializeSetLike): (WebCore::Highlight::removeFromSetLike): (WebCore::Highlight::clearFromSetLike): (WebCore::Highlight::addToSetLike): * Modules/highlight/Highlight.h: Renamed from Source/WebCore/Modules/highlight/HighlightRangeGroup.h. * Modules/highlight/Highlight.idl: Renamed from Source/WebCore/Modules/highlight/HighlightRangeGroup.idl. * Modules/highlight/HighlightRegister.cpp: Renamed from Source/WebCore/Modules/highlight/HighlightMap.cpp. (WebCore::HighlightRegister::initializeMapLike): (WebCore::HighlightRegister::setFromMapLike): (WebCore::HighlightRegister::clear): (WebCore::HighlightRegister::remove): * Modules/highlight/HighlightRegister.h: Renamed from Source/WebCore/Modules/highlight/HighlightMap.h. (WebCore::HighlightRegister::create): (WebCore::HighlightRegister::map const): * Modules/highlight/HighlightRegister.idl: Renamed from Source/WebCore/Modules/highlight/HighlightMap.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * css/DOMCSSNamespace.cpp: (WebCore::DOMCSSNamespace::highlights): * css/DOMCSSNamespace.h: * css/DOMCSSNamespace.idl: * dom/Document.cpp: (WebCore::Document::commonTeardown): (WebCore::Document::highlightRegister): (WebCore::Document::updateHighlightPositions): (WebCore::Document::highlightMap): Deleted. * dom/Document.h: * rendering/HighlightData.cpp: * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::collectMarkedTextsForHighlights const): * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::calculateHighlightColor const): * rendering/SelectionRangeData.cpp: 2020-10-20 Antoine Quint <graouts@webkit.org> REGRESSION (r268483): Map jumps around while zooming on windy.com, strava.com https://bugs.webkit.org/show_bug.cgi?id=217987 <rdar://problem/70418548> Reviewed by Simon Fraser. When several animations targetting the same property and the same layer are overlapping, we used to always override the previous animations. With r268483 we started maintaining all active animations and let them run, potentially with additivity if the animation could be broken into several animations each targeting a given transform operation. On top of that, with r268615 and the support for accelerated animation of individual CSS transform properties (translate, scale and rotate), all transform-related animations were made additive. This meant that we would always run active animations targeting "transform" in a way where they would be additive rather than being replaced. Any animation targeting "transform" will yield one or several accelerated animations, and the first of this animation set will always have a 0 index. So now, when we compile a list of transform animations in GraphicsLayerCA::updateAnimations(), we reset that list any time we encounted an animation with a 0 index, ensuring only the top-most transform animation is applied. We also fix an issue where we didn't account for the possibility that a single KeyframeEffect could yield several transform animations with the same name in pauseAnimation() and removeAnimation(). We now pause or remove all animations with the provided name. Test: webanimations/accelerated-overlapping-transform-animations.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::pauseAnimation): (WebCore::GraphicsLayerCA::removeAnimation): (WebCore::GraphicsLayerCA::updateAnimations): 2020-10-20 Jer Noble <jer.noble@apple.com> [media-session] Basic support for MediaSession.setPositionState() and MediaSession.setActionHandler() https://bugs.webkit.org/show_bug.cgi?id=217963 Reviewed by Eric Carlson. Tests: media/media-session/mock-actionHandlers.html media/media-session/mock-currentPosition.html Add basic support for setPositionState() and currentTime calculations of the Media Session standard, basic support for setActionHandler(), and Internals methods to query the internal state of both those APIs from layout tests. * Modules/mediasession/MediaSession.cpp: (WebCore::MediaSession::setMetadata): (WebCore::MediaSession::setPlaybackState): (WebCore::MediaSession::setActionHandler): (WebCore::MediaSession::handlerForAction const): (WebCore::MediaSession::setPositionState): (WebCore::MediaSession::currentPosition const): * Modules/mediasession/MediaSession.h: (WebCore::MediaSession::playbackState const): * Modules/mediasession/MediaSession.idl: * Modules/mediasession/MediaSessionAction.h: * Modules/mediasession/MediaSessionActionDetails.idl: * testing/Internals.cpp: (WebCore::Internals::currentMediaSessionPosition): (WebCore::Internals::sendMediaSessionAction): * testing/Internals.h: * testing/Internals.idl: 2020-10-20 Don Olmstead <don.olmstead@sony.com> [WebGPU] Increase portability of GPUBindGroup https://bugs.webkit.org/show_bug.cgi?id=217978 Reviewed by Myles C. Maxfield. Remove more uses of USE(METAL) around the GPUBindGroup related constructs to increase portability. Introduce a platform specific type for an offset into the GPU Buffer. No new tests. No change in behavior. * platform/graphics/gpu/GPUBindGroup.h: (WebCore::GPUBindGroup::argumentBuffer const): * platform/graphics/gpu/GPUBindGroupAllocator.h: (WebCore::GPUBindGroupAllocator::argumentBuffer const): * platform/graphics/gpu/cocoa/GPUBindGroupAllocatorMetal.mm: * platform/graphics/gpu/cocoa/GPUPlatformTypesMetal.h: 2020-10-20 Don Olmstead <don.olmstead@sony.com> Non-unified build fixes, late October 2020 edition https://bugs.webkit.org/show_bug.cgi?id=217983 Unreviewed build fix. No new tests. No change in behavior. * bindings/js/JSEventCustom.cpp: (WebCore::toJS): * display/DisplayTreeBuilder.h: * layout/integration/LayoutIntegrationLineLayout.cpp: * workers/WorkerOrWorkletScriptController.h: 2020-10-20 Sihui Liu <sihui_liu@apple.com> Add stubs for SpeechRecognition https://bugs.webkit.org/show_bug.cgi?id=217780 <rdar://problem/70350727> Reviewed by Youenn Fablet. Add bindings code and a feature flag for SpeechRecognition. Spec: https://wicg.github.io/speech-api/#speechreco-section. This patch includes all interfaces of SpeechRecognition, except SpeechGrammar and SpeechGrammarList. We have not decided what grammar format and types we are going to support, or how we are going to support it if it is not defined in exisiting speech recognition service. So let's add those interfaces after we figure this out. No new tests. Rebaseline existins tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/speech/SpeechRecognition.cpp: Added. (WebCore::SpeechRecognition::create): (WebCore::SpeechRecognition::SpeechRecognition): (WebCore::SpeechRecognition::suspend): (WebCore::SpeechRecognition::startRecognition): (WebCore::SpeechRecognition::stopRecognition): (WebCore::SpeechRecognition::abortRecognition): (WebCore::SpeechRecognition::activeDOMObjectName const): * Modules/speech/SpeechRecognition.h: Added. (WebCore::SpeechRecognition::lang const): (WebCore::SpeechRecognition::setLang): (WebCore::SpeechRecognition::continuous const): (WebCore::SpeechRecognition::setContinuous): (WebCore::SpeechRecognition::interimResults const): (WebCore::SpeechRecognition::setInterimResults): (WebCore::SpeechRecognition::maxAlternatives const): (WebCore::SpeechRecognition::setMaxAlternatives): * Modules/speech/SpeechRecognition.idl: Added. * Modules/speech/SpeechRecognitionAlternative.cpp: Added. (WebCore::SpeechRecognitionAlternative::create): (WebCore::SpeechRecognitionAlternative::SpeechRecognitionAlternative): * Modules/speech/SpeechRecognitionAlternative.h: Added. * Modules/speech/SpeechRecognitionAlternative.idl: Added. * Modules/speech/SpeechRecognitionErrorCode.h: Added. * Modules/speech/SpeechRecognitionErrorCode.idl: Added. * Modules/speech/SpeechRecognitionErrorEvent.cpp: Added. (WebCore::SpeechRecognitionErrorEvent::create): (WebCore::SpeechRecognitionErrorEvent::SpeechRecognitionErrorEvent): (WebCore::SpeechRecognitionErrorEvent::eventInterface const): * Modules/speech/SpeechRecognitionErrorEvent.h: Added. * Modules/speech/SpeechRecognitionErrorEvent.idl: Added. * Modules/speech/SpeechRecognitionEvent.cpp: Added. (WebCore::SpeechRecognitionEvent::create): (WebCore::SpeechRecognitionEvent::SpeechRecognitionEvent): (WebCore::SpeechRecognitionEvent::eventInterface const): * Modules/speech/SpeechRecognitionEvent.h: Added. * Modules/speech/SpeechRecognitionEvent.idl: Added. * Modules/speech/SpeechRecognitionResult.cpp: Added. (WebCore::SpeechRecognitionResult::create): (WebCore::SpeechRecognitionResult::SpeechRecognitionResult): (WebCore::SpeechRecognitionResult::item const): * Modules/speech/SpeechRecognitionResult.h: Added. * Modules/speech/SpeechRecognitionResult.idl: Added. * Modules/speech/SpeechRecognitionResultList.cpp: Added. (WebCore::SpeechRecognitionResultList::create): (WebCore::SpeechRecognitionResultList::item const): (WebCore::SpeechRecognitionResultList::add): (WebCore::SpeechRecognitionResultList::SpeechRecognitionResultList): * Modules/speech/SpeechRecognitionResultList.h: Added. * Modules/speech/SpeechRecognitionResultList.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/EventNames.in: * dom/EventTargetFactory.in: 2020-10-20 Don Olmstead <don.olmstead@sony.com> Fix non-c-typedef-for-linkage warning in SocketStreamHandle https://bugs.webkit.org/show_bug.cgi?id=217979 Reviewed by Alex Christensen. The warning was because the anonymous type was not C-compatible due to a default member initializer, so remove the typedef and name the struct. No new tests. No change in behavior. * platform/network/SocketStreamHandle.h: 2020-10-20 Antoine Quint <graouts@webkit.org> REGRESSION(r268615): some accelerated transform tests are failing https://bugs.webkit.org/show_bug.cgi?id=217851 <rdar://problem/70394402> Reviewed by Dean Jackson. When we added support for accelerated individual transform properties animations, we added the notion of base transform animations which are used to set the base value of any transform-related property that is not animated. Those animations were defined to start as early as possible, assuming that a very small value after 0s was as early as possible. However, it's possible that other animations start with a negative time if they have a delay or are seeked, if the value returned by CACurrentMediaTime() is smaller than that delay. This means that if the machine had been booted for less time than an accelerated animation's delay, the base transform animation wouldn't overlap. We now ensure that those base transform animations start as early as the earliest animation that is being committed in a call to GraphicsLayerCA::updateAnimations(). * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateAnimations): (WebCore::GraphicsLayerCA::setAnimationOnLayer): * platform/graphics/ca/GraphicsLayerCA.h: (WebCore::GraphicsLayerCA::LayerPropertyAnimation::computedBeginTime const): 2020-10-20 Rob Buis <rbuis@igalia.com> Introduce Selection specific mixin of GlobalEventHandlers https://bugs.webkit.org/show_bug.cgi?id=217248 Reviewed by Sam Weinig. Introduce Selection specific mixin of GlobalEventHandlers [1] by splitting out the interface from Document+Selection.idl. This also means the HTMLBodyElement specific selectionchange IDL is superflous and can be removed. Behavior matches Chrome and Firefox. Test: fast/dom/event-handler-attributes.html [1] https://w3c.github.io/selection-api/#dom-globaleventhandlers * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * dom/Document+Selection.idl: * dom/Element.idl: * dom/GlobalEventHandlers+Selection.idl: Copied from Source/WebCore/dom/Document+Selection.idl. 2020-10-20 Antti Koivisto <antti@apple.com> Implement <forgiving-selector-list> for :is/:where https://bugs.webkit.org/show_bug.cgi?id=217814 <rdar://problem/70384483> Reviewed by Sam Weinig. The spec now says :is/:where should parse as a forgiving selector list: https://drafts.csswg.org/selectors/#matches * contentextensions/ContentExtensionParser.cpp: (WebCore::ContentExtensions::isValidCSSSelector): * css/CSSPageRule.cpp: (WebCore::CSSPageRule::setSelectorText): * css/CSSSelectorList.h: (WebCore::CSSSelectorList::isEmpty const): (WebCore::CSSSelectorList::isValid const): Deleted. An empty CSSSelectorList is now valid. Represent invalid CSSSelectorList with Optional where needed. * css/CSSStyleRule.cpp: (WebCore::CSSStyleRule::setSelectorText): * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseSelector): * css/parser/CSSParser.h: * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::consumePageRule): (WebCore::CSSParserImpl::consumeStyleRule): * css/parser/CSSSelectorParser.cpp: (WebCore::parseCSSSelector): (WebCore::CSSSelectorParser::consumeComplexSelectorList): (WebCore::CSSSelectorParser::consumeComplexForgivingSelectorList): Add function for consuming <forgiving-selector-list>. (WebCore::CSSSelectorParser::consumePseudo): Use it for :is/:where. * css/parser/CSSSelectorParser.h: * dom/SelectorQuery.cpp: * inspector/InspectorStyleSheet.cpp: (WebCore::isValidSelectorListString): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::highlightSelector): * style/RuleSet.cpp: (WebCore::Style::RuleSet::addStyleRule): 2020-10-15 Jer Noble <jer.noble@apple.com> Add skeleton implementation of Media Session API https://bugs.webkit.org/show_bug.cgi?id=217797 Reviewed by Darin Adler. Tests: imported/w3c/web-platform-tests/mediasession/idlharness.window.html imported/w3c/web-platform-tests/mediasession/mediametadata.html imported/w3c/web-platform-tests/mediasession/playbackstate.html imported/w3c/web-platform-tests/mediasession/positionstate.html imported/w3c/web-platform-tests/mediasession/setactionhandler.html Add an initial, no-op, implementation of the Media Session API. Note, the WPT test results include a failing test of Object.isFrozen(); the bindings generator does not currently support generating a FrozenArray of dictionary values. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/mediasession/MediaImage.h: Added. * Modules/mediasession/MediaImage.idl: Added. * Modules/mediasession/MediaMetadata.h: Added. (WebCore::MediaMetadata::create): (WebCore::MediaMetadata::MediaMetadata): (WebCore::MediaMetadata::setMediaSession): (WebCore::MediaMetadata::title const): (WebCore::MediaMetadata::setTitle): (WebCore::MediaMetadata::artist const): (WebCore::MediaMetadata::setArtist): (WebCore::MediaMetadata::album const): (WebCore::MediaMetadata::setAlbum): (WebCore::MediaMetadata::artwork const): (WebCore::MediaMetadata::setArtwork): (WebCore::MediaMetadata::metadataUpdated): * Modules/mediasession/MediaMetadata.idl: Added. * Modules/mediasession/MediaMetadataInit.h: Added. * Modules/mediasession/MediaMetadataInit.idl: Added. * Modules/mediasession/MediaPositionState.h: Added. * Modules/mediasession/MediaPositionState.idl: Added. * Modules/mediasession/MediaSession.cpp: Added. (WebCore::MediaSession::create): (WebCore::MediaSession::MediaSession): (WebCore::MediaSession::setMetadata): (WebCore::MediaSession::setPlaybackState): (WebCore::MediaSession::setActionHandler): (WebCore::MediaSession::setPositionState): (WebCore::MediaSession::metadataUpdated): * Modules/mediasession/MediaSession.h: Added. (WebCore::MediaSession::metadata const): (WebCore::MediaSession::playbackState const): * Modules/mediasession/MediaSession.idl: Added. * Modules/mediasession/MediaSessionAction.h: Added. * Modules/mediasession/MediaSessionAction.idl: Added. * Modules/mediasession/MediaSessionActionDetails.h: Added. * Modules/mediasession/MediaSessionActionDetails.idl: Added. * Modules/mediasession/MediaSessionActionHandler.h: Added. * Modules/mediasession/MediaSessionActionHandler.idl: Added. * Modules/mediasession/MediaSessionPlaybackState.h: Added. * Modules/mediasession/MediaSessionPlaybackState.idl: Added. * Modules/mediasession/Navigator+MediaSession.idl: Added. * Modules/mediasession/NavigatorMediaSession.cpp: Added. (WebCore::NavigatorMediaSession::NavigatorMediaSession): (WebCore::NavigatorMediaSession::mediaSession): (WebCore::NavigatorMediaSession::from): (WebCore::NavigatorMediaSession::supplementName): * Modules/mediasession/NavigatorMediaSession.h: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-10-20 Philippe Normand <pnormand@igalia.com> Unreviewed, temporary workaround for bug #217959 * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::maximumNumberOfOutputChannels): Return a hard-coded value until the device monitor issue is fixed. 2020-10-20 Devin Rousso <drousso@apple.com> Web Inspector: REGRESSION(r260076): crash under InspectorInstrumentation::willApplyKeyframeEffect https://bugs.webkit.org/show_bug.cgi?id=217936 Reviewed by Brian Burg. Speculative fix by null-checking `targetElementOrPseudoElement()` before using it. Before r260076 this was not necessary as `m_target` is null-checked earlier in the function, but after it can now return `nullptr` depending on the value of `m_pseudoId`. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::apply): 2020-10-20 Michael Catanzaro <mcatanzaro@gnome.org> Unused parameter warning in GraphicsContextCairo.cpp https://bugs.webkit.org/show_bug.cgi?id=217954 Unreviewed. * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::platformDrawNativeImage): 2020-10-20 Chris Dumez <cdumez@apple.com> Drop explicit calls to BaseAudioContext::refNode() https://bugs.webkit.org/show_bug.cgi?id=217926 Reviewed by Eric Carlson. Drop explicit calls to BaseAudioContext::refNode(). Instead we now rely on the sourceNodeWillBeginPlayback() signal to ref the source AudioNode. This simplifies the code a bit. I also did some renaming for clarity, so be explicit about the fact we are dealing with *source* nodes here. No new tests, no Web-facing behavior change. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::create): (WebCore::AudioBufferSourceNode::startPlaying): * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::sourceNodeWillBeginPlayback): * Modules/webaudio/AudioContext.h: * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::startLater): (WebCore::AudioScheduledSourceNode::finish): * Modules/webaudio/AudioWorkletNode.cpp: (WebCore::AudioWorkletNode::create): (WebCore::AudioWorkletNode::didFinishProcessingOnRenderingThread): Only call sourceNodeWillBeginPlayback() / sourceNodeDidFinishPlayback() when the AudioWorklet is actually a *source* node, meaning that it has outputs. This behavior is consistent with Blink. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::~BaseAudioContext): (WebCore::BaseAudioContext::uninitialize): (WebCore::BaseAudioContext::createScriptProcessor): (WebCore::BaseAudioContext::derefFinishedSourceNodes): (WebCore::BaseAudioContext::refSourceNode): (WebCore::BaseAudioContext::derefSourceNode): (WebCore::BaseAudioContext::derefUnfinishedSourceNodes): (WebCore::BaseAudioContext::sourceNodeWillBeginPlayback): (WebCore::BaseAudioContext::sourceNodeDidFinishPlayback): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/ConstantSourceNode.cpp: (WebCore::ConstantSourceNode::create): * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::create): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::create): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::eventListenersDidChange): (WebCore::ScriptProcessorNode::virtualHasPendingActivity const): * Modules/webaudio/ScriptProcessorNode.h: Use ActiveDOMObject logic to keep the script wrapper alive instead of relying on the AudioContext to do so. We keep the wrapper alive as long as the context's state is not closed and as long as there is an audioprocess event listener registered. This behavior is consistent with what Blink does. * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createWebKitOscillator): (WebCore::WebKitAudioContext::createWebKitBufferSource): 2020-10-20 Philippe Normand <pnormand@igalia.com> [GStreamer] REGRESSION(r266559): imported/w3c/web-platform-tests/webaudio/the-audio-api/the-destinationnode-interface/destination.html is failing https://bugs.webkit.org/show_bug.cgi?id=216171 Reviewed by Xabier Rodriguez-Calvar. The AudioDestination now probes the audio sink to find the maximum number of output channels it supports. The AudioDestination is also now able to render >2 channels from the AudioBus. The AudioProvider also handles more than 2 channels. This patch also includes various code cleanups as these files were not updated much during the past few years. Covered by existing webaudio tests. * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::initializeDebugCategory): (WebCore::maximumNumberOfOutputChannels): (WebCore::AudioDestination::create): (WebCore::AudioDestination::maxChannelCount): (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer): (WebCore::AudioDestinationGStreamer::~AudioDestinationGStreamer): (WebCore::AudioDestinationGStreamer::handleMessage): (WebCore::AudioDestinationGStreamer::start): (WebCore::AudioDestinationGStreamer::stop): * platform/audio/gstreamer/AudioDestinationGStreamer.h: * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: (WebCore::initializeDebugCategory): (WebCore::copyGStreamerBuffersToAudioChannel): (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer): (WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer): (WebCore::AudioSourceProviderGStreamer::provideInput): (WebCore::AudioSourceProviderGStreamer::handleSample): (WebCore::AudioSourceProviderGStreamer::setClient): (WebCore::AudioSourceProviderGStreamer::handleNewDeinterleavePad): (WebCore::AudioSourceProviderGStreamer::handleRemovedDeinterleavePad): (WebCore::AudioSourceProviderGStreamer::deinterleavePadsConfigured): (WebCore::AudioSourceProviderGStreamer::clearAdapters): * platform/audio/gstreamer/AudioSourceProviderGStreamer.h: 2020-10-20 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] order property should be animatable https://bugs.webkit.org/show_bug.cgi?id=209876 Reviewed by Antoine Quint. Make order property animatable as per spec. This allows us to pass ~150 flexbox animation subtests. * animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Mark property as animatable. 2020-10-19 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] flex-shrink property should be animatable https://bugs.webkit.org/show_bug.cgi?id=209874 Reviewed by Manuel Rego Casasnovas. Make flew-shrink animatable as per spec. Also clamp its minimum value to 0 as it cannot be a negative number. This allows us to pass a bunch of flexbox animation subtests. * animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Mark flex-shrink as animatable. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setFlexShrink): Clamp minimum value to 0. 2020-10-20 Philippe Normand <pnormand@igalia.com> and Pavel Feldman <pavel.feldman@gmail.com> Web Inspector: Add setScreenSizeOverride API to the Page agent https://bugs.webkit.org/show_bug.cgi?id=213242 Reviewed by Devin Rousso. Allow the WebInspector Page agent to override the Screen size for media queries. Test: inspector/page/setScreenSizeOverride.html * css/MediaQueryEvaluator.cpp: Use the Frame::screenSize() method to query the screen dimensions. (WebCore::deviceAspectRatioEvaluate): (WebCore::deviceHeightEvaluate): (WebCore::deviceWidthEvaluate): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::setScreenSizeOverride): Implementation of the new API hooking into the WebCore::Frame::setOverrideScreenSize() method. * inspector/agents/InspectorPageAgent.h: * page/Frame.cpp: (WebCore::Frame::screenSize const): New entry point to query the screen size, this takes into account the optional overriden screen size. (WebCore::Frame::setOverrideScreenSize): API used by the Page agent to fake a new screen size. * page/Frame.h: * page/Page.cpp: * page/Screen.cpp: Use the Frame::screenSize() method to query the screen dimensions. (WebCore::Screen::height const): (WebCore::Screen::width const): 2020-10-02 Antoine Quint <graouts@webkit.org> TranslateTransformOperation shouldn't take in a FloatSize to convert z as a double https://bugs.webkit.org/show_bug.cgi?id=217246 Reviewed by Darin Adler. The method used to get z as a double didn't use the FloatSize parameter, so we remove it. Since there already is a z() method without an argument returning the underlying Length, we rename the method returning a double to make it clear what type of value it's returning a double, and given how the call sites converts to a float eventually, we return a float directly. We also follow the same pattern for x and y. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::getTransformFunctionValue): * platform/graphics/transforms/TranslateTransformOperation.h: 2020-10-19 Simon Fraser <simon.fraser@apple.com> Fix crash in RenderLayerBacking::updateClippingStackLayerGeometry() https://bugs.webkit.org/show_bug.cgi?id=217940 <rdar://problem/70316952> Reviewed by Tim Horton. Crash data suggest that entry.clipData.clippingLayer (which is a WeakRef<RenderLayer>) can be null, so check it. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateClippingStackLayerGeometry): 2020-10-19 Alexey Shvayka <shvaikalesh@gmail.com> [WebIDL] %Interface%.prototype.constructor should be defined on [[Set]] receiver https://bugs.webkit.org/show_bug.cgi?id=216533 Reviewed by Darin Adler. 1. Create a setter-less CustomGetterSetter instead of generating "constructor" setter. 2. Remove unused $needsConstructorTable variable. 3. Remove [LegacyNoInterfaceObject] branch as it's precluded by NeedsConstructorProperty. Test: imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/interface-prototype-constructor-set-receiver.html * bindings/scripts/CodeGeneratorJS.pm: (GeneratePropertiesHashTable): (GenerateImplementation): * bindings/scripts/test/JS/*: Updated. 2020-10-19 Alexey Shvayka <shvaikalesh@gmail.com> [WebIDL] convertRecord() should handle duplicate keys for USVString records https://bugs.webkit.org/show_bug.cgi?id=217612 Reviewed by Sam Weinig. Before this patch, due to unpaired surrogates replacement in stringToUSVString(), convertRecord() could append the same key multiple times, violating the spec [1]. This change adds duplicate handling while preserving common case performance, and aligns WebKit with Blink and Gecko. Since a Proxy object can no longer return duplicate keys [2], only USVString records needed to be fixed. Test: imported/w3c/web-platform-tests/url/urlsearchparams-constructor.any.html [1] https://heycam.github.io/webidl/#es-record (step 4.2.4 + example below) [2] https://github.com/tc39/ecma262/pull/833 * bindings/js/JSDOMConvertRecord.h: 2020-10-19 Wenson Hsieh <wenson_hsieh@apple.com> [MotionMark] Add state change items to represent changes to stroke and fill state https://bugs.webkit.org/show_bug.cgi?id=217911 Reviewed by Simon Fraser. Add two new display list items to represent changes to stroke thickness and/or stroke color, and fill color. These state changes account for almost all of the state changes in MotionMark's canvas rendering subtests (i.e. lines, arcs, and paths). This significantly reduces the memory overhead caused by maintaining display list items in the web and GPU processes when running Canvas Lines and Canvas Arcs. Currently, each `SetState` item is currently 120 bytes; after this change, each state change item will decrease to either 24 (for `SetFillColor`) or 32 (for `SetStrokeState`) bytes. No change in behavior. * platform/graphics/displaylists/DisplayList.h: (WebCore::DisplayList::Item::isStateItem const): Deleted. (WebCore::DisplayList::Item::isStateItemType): Deleted. Remove a couple of unused methods, as well as an unused constexpr. * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::Item::sizeInBytes): (WebCore::DisplayList::SetFillColor::create): (WebCore::DisplayList::SetFillColor::apply const): (WebCore::DisplayList::operator<<): Add the `SetFillColor` item, which represents a call to `GraphicsContext::setFillColor`. (WebCore::DisplayList::SetStrokeState::create): (WebCore::DisplayList::SetStrokeState::apply const): Add the `SetStrokeState` item, which represents a call to `GraphicsContext::setStrokeThickness` and/or `GraphicsContext::setStrokeColor`. (WebCore::DisplayList::SetState::accumulate): Deleted. Remove an unused method. * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::SetFillColor::color const): (WebCore::DisplayList::SetFillColor::SetFillColor): (WebCore::DisplayList::SetFillColor::encode const): (WebCore::DisplayList::SetFillColor::decode): (WebCore::DisplayList::SetStrokeState::color const): (WebCore::DisplayList::SetStrokeState::hasColor const): (WebCore::DisplayList::SetStrokeState::thickness const): (WebCore::DisplayList::SetStrokeState::hasThickness const): Instead of using two `Optional<T>` members, store two `bool` flags corresponding to thickness and stroke color. This allows us to make the `SetStrokeState` item 32 bytes instead of 40 bytes, due to the extra padding that would otherwise exist after each of the `Optional` members. (WebCore::DisplayList::SetStrokeState::SetStrokeState): (WebCore::DisplayList::SetStrokeState::encode const): (WebCore::DisplayList::SetStrokeState::decode): (WebCore::DisplayList::Item::encode const): (WebCore::DisplayList::Item::decode): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::containsOnlyStrokeColorOrThicknessChange): (WebCore::DisplayList::containsOnlyFillColorChange): (WebCore::DisplayList::createStateChangeItem): Instead of always appending `SetState` items, append either `SetStrokeState` or `SetFillColor` if the only changed flags are stroke thickness or stroke color, or fill color (respectively). (WebCore::DisplayList::Recorder::willAppendItem): 2020-10-19 Simon Fraser <simon.fraser@apple.com> Fix possible crash in GraphicsLayerCA::computeVisibleAndCoverageRect() https://bugs.webkit.org/show_bug.cgi?id=217930 <rdar://problem/70316943> Reviewed by Tim Horton. If we made a m_overflowControlsHostLayerAncestorClippingStack, make sure we unparent its layers when tearing down the RenderLayerBacking, and when we determine that we longer need a m_ancestorClippingStack (having a m_overflowControlsHostLayerAncestorClippingStack implies that we have a m_ancestorClippingStack). * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::destroyGraphicsLayers): (WebCore::RenderLayerBacking::updateAncestorClipping): 2020-10-19 Chris Dumez <cdumez@apple.com> Replace execStateFrom*() functions with globalObject() overloads https://bugs.webkit.org/show_bug.cgi?id=217912 Reviewed by Darin Adler. Introduce globalObject() overloads to replace existing execStateFrom*() functions. This is a first step to promote code sharing. Ideally, code would not have to differentiate workers from worklets as much as possible. No new tests, no Web-facing behavior change. * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::scriptExecutionContext const): * bindings/js/ScriptState.cpp: (WebCore::execStateFromWorkerOrWorkletGlobalScope): * bindings/js/ScriptState.h: * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::globalScopeWrapper): * bindings/js/WorkerScriptController.h: * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::vm): (WebCore::ScriptExecutionContext::execState): * inspector/agents/worker/WorkerAuditAgent.cpp: (WebCore::WorkerAuditAgent::injectedScriptForEval): * inspector/agents/worker/WorkerDebuggerAgent.cpp: (WebCore::WorkerDebuggerAgent::injectedScriptForEval): * inspector/agents/worker/WorkerRuntimeAgent.cpp: (WebCore::WorkerRuntimeAgent::injectedScriptForEval): * workers/WorkerOrWorkletScriptController.h: * worklets/WorkletScriptController.cpp: (WebCore::WorkletScriptController::globalScopeWrapper): * worklets/WorkletScriptController.h: 2020-10-19 Timothy Horton <timothy_horton@apple.com> Adjust a comment about an antique way to override the UA on iOS * platform/ios/UserAgentIOS.mm: (WebCore::standardUserAgentWithApplicationName): Reference https://bugs.webkit.org/show_bug.cgi?id=217927 which has a plan for getting rid of this (and mentions at least one client who currently depends on this). 2020-10-19 Wenson Hsieh <wenson_hsieh@apple.com> [MotionMark] Make DisplayList::FillPath discard its WebCore::Path after applying https://bugs.webkit.org/show_bug.cgi?id=217906 Reviewed by Tim Horton. Let `FillPath::apply` clear out the platform `CGPathRef` in `m_path` after application to avoid accumulating a pool of `CGPathRef`s for each `Path` that is being filled. This gives us a small (~1-2%) win on the Canvas Arcs subtest in MotionMark, which processes ~1.7 million FillPath operations. To achieve this, instead of using `WTFMove`, add a new helper method on `Path` to explicitly clear out the platform path pointer in the case where it can be regenerated from inline data. * platform/graphics/Path.h: (WebCore::Path::releasePlatformPathIfPossible const): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::FillPath::apply const): (WebCore::DisplayList::StrokePath::apply const): * platform/graphics/displaylists/DisplayListItems.h: 2020-10-19 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r267175 and r267779. https://bugs.webkit.org/show_bug.cgi?id=217923 Regressed NYTimes's DOM content loaded time by 400% Reverted changesets: "MutationObserverRegistration should be ref counted" https://bugs.webkit.org/show_bug.cgi?id=216528 https://trac.webkit.org/changeset/267175 "Crash while loading a confluence page" https://bugs.webkit.org/show_bug.cgi?id=217111 https://trac.webkit.org/changeset/267779 2020-10-19 Patrick Angle <pangle@apple.com> Web Inspector: REGRESSION(r265231): Overlay: node info sometimes draws on one line https://bugs.webkit.org/show_bug.cgi?id=217416 Reviewed by Brian Burg. No new tests - user interface fix. Restored advancing to the next line for drawing two-line element titles (for elements with a Role). * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::drawElementTitle): 2020-10-19 Said Abou-Hallawa <sabouhallawa@apple.com> [GPU Process] Clean the DisplayList recording of the NativeImage https://bugs.webkit.org/show_bug.cgi?id=217573 Reviewed by Simon Fraser. 1) Move the definition of NativeImagePtr to a separate header file named NativeImagePtr. 2) Remove the class ImageHandle and allow encoding and decoding NativeImagePtr directly. 3) Remove the compilation directives around the DisplayList::DrawNativeImage item and the method drawNativeImage(). 4) Move the drawNativeImage() methods to the sources of their callers. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * loader/cache/MemoryCache.h: * platform/graphics/BitmapImage.cpp: (WebCore::drawNativeImage): * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawNativeImage): * platform/graphics/GraphicsContext.h: (WebCore::GraphicsContext::drawNativeImage): * platform/graphics/GraphicsContextImpl.h: * platform/graphics/Image.h: * platform/graphics/ImageBufferBackend.h: * platform/graphics/NativeImage.h: * platform/graphics/NativeImagePtr.h: Copied from Source/WebCore/platform/graphics/NativeImage.h. * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::platformDrawNativeImage): (WebCore::GraphicsContext::drawNativeImage): Deleted. * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::platformDrawNativeImage): (WebCore::GraphicsContext::drawNativeImage): Deleted. * platform/graphics/cg/NativeImageCG.cpp: (WebCore::drawNativeImage): Deleted. * platform/graphics/displaylists/DisplayList.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::Item::sizeInBytes): (WebCore::DisplayList::DrawNativeImage::DrawNativeImage): (WebCore::DisplayList::DrawNativeImage::apply const): (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::DrawNativeImage::encode const): (WebCore::DisplayList::DrawNativeImage::decode): (WebCore::DisplayList::Item::encode const): (WebCore::DisplayList::Item::decode): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::drawNativeImage): * platform/graphics/displaylists/DisplayListRecorder.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/nicosia/NicosiaImageBufferPipe.cpp: * platform/graphics/win/GraphicsContextDirect2D.cpp: (WebCore::GraphicsContext::platformDrawNativeImage): (WebCore::GraphicsContext::drawNativeImage): Deleted. 2020-10-19 Antoine Quint <graouts@webkit.org> Move remaining Web Animations runtime-enabled features to settings https://bugs.webkit.org/show_bug.cgi?id=217903 Reviewed by Sam Weinig. * animation/KeyframeEffect.cpp: (WebCore::processKeyframeLikeObject): (WebCore::processIterableKeyframes): (WebCore::processPropertyIndexedKeyframes): (WebCore::KeyframeEffect::getKeyframes): * animation/KeyframeEffect.idl: * animation/WebAnimation.idl: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebAnimationsCompositeOperationsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webAnimationsCompositeOperationsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebAnimationsMutableTimelinesEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webAnimationsMutableTimelinesEnabled const): Deleted. 2020-10-19 Antti Koivisto <antti@apple.com> [LFC][Integration] Respect relayoutChildren flag https://bugs.webkit.org/show_bug.cgi?id=217902 Reviewed by Zalan Bujtas. Ensure we layout replaced children when relayoutChildren is set. Fixes fast/images/decode-render-static-image.html and others. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutLFCLines): 2020-10-13 Sergio Villar Senin <svillar@igalia.com> Sanitize the usage of override sizes https://bugs.webkit.org/show_bug.cgi?id=217479 Reviewed by Manuel Rego Casasnovas. RenderBox had two values, overrideContentLogicalWidth and overrideContentLogicalHeight which were used by a variety of layout systems (like tables, grid or flex) in different ways. Although names clearly stated that they were content sizes the reality is that they were used as either border box sizes, content box sizes, or even content box + scrollbar sizes. This patch addresses a comment in RenderBox which was precisely advocating for turning overrideContentLogicalXXX back into overrideLogicalXXX. Most of the changes of this CL are just renames because the code has specific branches to handle specific situations so it didn't actually matter which kind of size we were actually storing. However there are some tricky replacements as in the case of flex, grid and tables that required careful modifications. It's critical for these layout systems to know which size we're storing in the overrides because that would determine whether or not we need to add/substract things like borders, paddings or scrollbar sizes to use them. Note that apart from renaming the overrideContentLogicalXXX to overrideLogicalXXX we're "adding" overrideContentLogicalXXX to the RenderBox interface, so it gives the impression that we are not renaming it. However the new implementation is quite different, they retrieve the content box sizes from the override (border box) sizes we store. As a nice side effect a new test is passing now after these changes. * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::updateRubyForJustifiedText): Renames. * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const): Renames. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::computeChildPreferredLogicalWidths const): Renames. (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const): Ditto. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded): Renames + store the border box width instead of the content box's. * rendering/RenderBox.cpp: (WebCore::RenderBox::hasOverrideLogicalHeight const): Renamed. (WebCore::RenderBox::hasOverrideLogicalWidth const): Ditto. (WebCore::RenderBox::setOverrideLogicalHeight): Ditto. (WebCore::RenderBox::setOverrideLogicalWidth): Ditto. (WebCore::RenderBox::clearOverrideLogicalHeight): Ditto. (WebCore::RenderBox::clearOverrideLogicalWidth): Ditto. (WebCore::RenderBox::clearOverrideContentSize): Ditto. (WebCore::RenderBox::overrideLogicalWidth const): Ditto. (WebCore::RenderBox::overrideLogicalHeight const): Ditto. (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight const): Renames. (WebCore::RenderBox::computeLogicalWidthInFragment const): Renames + return the stored override border box width directly. (WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem const): Renames. (WebCore::RenderBox::computeLogicalHeight const): Renames. Apart from that moved some code around so all branches work with border box sizes instead of mixing them with content box sizes. (WebCore::RenderBox::computePercentageLogicalHeight const): Return the content box size after removing computed paddings and borders from the stored override size. (WebCore::RenderBox::computeReplacedLogicalHeightUsing const): Renames + compute the borderbox size from the stored override size. (WebCore::RenderBox::availableLogicalHeightUsing const): Return the content box size after removing computed paddings and borders from the stored override size. (WebCore::RenderBox::hasOverrideContentLogicalHeight const): Deleted. (WebCore::RenderBox::hasOverrideContentLogicalWidth const): Deleted. (WebCore::RenderBox::setOverrideContentLogicalHeight): Deleted. (WebCore::RenderBox::setOverrideContentLogicalWidth): Deleted. (WebCore::RenderBox::clearOverrideContentLogicalHeight): Deleted. (WebCore::RenderBox::clearOverrideContentLogicalWidth): Deleted. (WebCore::RenderBox::overrideContentLogicalWidth const): Deleted. (WebCore::RenderBox::overrideContentLogicalHeight const): Deleted. * rendering/RenderBox.h: (WebCore::RenderBox::overrideContentLogicalWidth const): "New" method. It existed before but it was renamed to overrideLogicalWidth. We're adding a completely different implementation for this one. (WebCore::RenderBox::overrideContentLogicalHeight const): Ditto. * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::widthForChild): New method to retrieve the border box width. (WebCore::heightForChild): New method to retrieve the border box height. (WebCore::contentWidthForChild): Use widthForChild() which handles overrides. (WebCore::contentHeightForChild): Use heightForChild() which handles overrides. (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox): Ditto. (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox): Ditto. (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp): Do not substract border and padding before setting the override because we now store the border box height not the content box height. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth const): Renames. (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution): Return the content box size (does not include scrollbar). (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): Ditto. (WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild): Add border and padding before setting the override. (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): Do not substract border and padding before setting the override as we are storing border box sizes. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutBlock): Renames. (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded): Renames + do not substract border and padding before setting the override as we are storing border box sizes. * rendering/RenderRubyBase.cpp: (WebCore::RenderRubyBase::adjustInlineDirectionLineBounds const): Renames. * rendering/RenderTable.cpp: (WebCore::RenderTable::updateLogicalWidth): Renames. * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::setOverrideLogicalHeightFromRowHeight): Renames + do not substract border and padding before setting the override as we are storing border box sizes. (WebCore::RenderTableCell::setOverrideContentLogicalHeightFromRowHeight): Deleted. * rendering/RenderTableCell.h: Renames. * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::calcRowLogicalHeight): Renames. (WebCore::RenderTableSection::relayoutCellIfFlexed): Ditto. 2020-10-19 Martin Robinson <mrobinson@igalia.com> axis in scroll-snap-type should be required https://bugs.webkit.org/show_bug.cgi?id=210468 <rdar://problem/61746766> Reviewed by Simon Fraser. * css/parser/CSSPropertyParser.cpp: (WebCore::consumeScrollSnapType): The first value is either the scroll axis or 'none'. * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertScrollSnapType): If the first value is 'none', the default values of ScrollSnapType should be fine. If we have a second value, use it. Otherwise the default for strictness is "proximity." 2020-10-18 Joonghun Park <jh718.park@samsung.com> Unreviewed. Remove the duplicated IGNORE_WARNINGS_BEGIN("frame-address") calls from r268661. No new tests, no new behaviors. * domjit/JSDocumentDOMJIT.cpp: (WebCore::DOMJIT::JSC_DEFINE_JIT_OPERATION): 2020-10-18 Joonghun Park <jh718.park@samsung.com> Unreviewed. Remove the build warning below since r267727. warning: calling ‘void* __builtin_frame_address(unsigned int)’ with a nonzero argument is unsafe [-Wframe-address] No new tests, no new behaviors. * domjit/JSDocumentDOMJIT.cpp: (WebCore::DOMJIT::JSC_DEFINE_JIT_OPERATION): 2020-10-18 Zalan Bujtas <zalan@apple.com> [LFC][IFC][Quirk] No soft wrapping opportunity before/after image content when the root is a table cell https://bugs.webkit.org/show_bug.cgi?id=217894 Reviewed by Antti Koivisto. This quirk behavior matches both FF and Chrome. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::hasSoftWrapOpportunityAtImage const): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::isAtSoftWrapOpportunity): (WebCore::Layout::LineBuilder::nextContentForLine): (WebCore::Layout::LineBuilder::nextWrapOpportunity const): (WebCore::Layout::nextWrapOpportunity): Deleted. * layout/inlineformatting/InlineLineBuilder.h: * layout/integration/LayoutIntegrationBoxTree.cpp: (WebCore::LayoutIntegration::BoxTree::buildTree): 2020-10-18 Emilio Cobos Álvarez <emilio@crisal.io> Serialize aspect ratio with spaces around the slash. https://bugs.webkit.org/show_bug.cgi?id=217888 Reviewed by Sam Weinig. Tests: web-platform-tests/css/mediaqueries/aspect-ratio-serialization-expected.txt * css/CSSAspectRatioValue.cpp: (WebCore::CSSAspectRatioValue::customCSSText const): Add the spaces. 2020-10-18 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Do not create imaginary strut when in limited quirks mode https://bugs.webkit.org/show_bug.cgi?id=217889 Reviewed by Antti Koivisto. Only standard mode produces imaginary strut (exclude both full and limited quirks mode). * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): 2020-10-18 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Do not snap the vertical position of a render replaced to integral value https://bugs.webkit.org/show_bug.cgi?id=217885 Reviewed by Antti Koivisto. Apparently legacy inline layout only snaps text content. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): 2020-10-18 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Inline level boxes are at the incorrect position when line is horizontally aligned https://bugs.webkit.org/show_bug.cgi?id=217887 Reviewed by Antti Koivisto. Inline boxes (as opposed to runs) are constructed after the horizontal alignment is computed so their position already includes the horizontal offset. No need to offset the again at logicalRectForInlineLevelBox. * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::logicalRectForInlineLevelBox const): 2020-10-18 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add quirks mode for root inline box height stretching https://bugs.webkit.org/show_bug.cgi?id=217881 Reviewed by Antti Koivisto. When the imaginary strut is not applicable (in quirks mode), the root inline box is stretched as it gains either text or some other inline level box content. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): 2020-10-17 Darin Adler <darin@apple.com> Remove "lazy offset" optmization from Range to prepare to derive it from SimpleRange https://bugs.webkit.org/show_bug.cgi?id=217878 Reviewed by Sam Weinig. Rysouke has suggested that we change Range so it can derive from SimpleRange. Specifically, AbstractRange will derive from SimpleRange, and both StaticRange and Range will continue to derive from that, and almost all functions will be non-virtual. Doing this means we will lose the likely-unimportant "lazy offset" that Range has today, where boundary point offsets are only computed on demand. This patch removes that optimization without changing anything else, so we can do performance tests and bisecting on just this part of the change. * dom/RangeBoundaryPoint.h: Rename m_offset and m_childBefore and don't use an Optional for the offset any more. 2020-10-16 Darin Adler <darin@apple.com> Add AbstractRange https://bugs.webkit.org/show_bug.cgi?id=217846 Reviewed by Ryosuke Niwa. This makes us more accurately match the DOM specification, makes Range and StaticRange objects slightly bigger since they now have a virtual table pointer, and makes the AbstractRange methods a bit slower to call from JavaScript since they are backed by C++ virtual functions. * CMakeLists.txt: Added AbstractRange files. * DerivedSources-input.xcfilelist: Ditto. * DerivedSources-output.xcfilelist: Ditto. * DerivedSources.make: Ditto. * Headers.cmake: Ditto. * Sources.txt: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. Also removed reference to non-existent JSAudioNodeCustom.cpp and moved JSStaticRange file from the Events group into the Ranges group. * bindings/js/JSAbstractRangeCustom.cpp: Added. (WebCore::toJS): Added. Just the default implementation. Would be nice if we did not have to write this. (WebCore::toJSNewlyCreated): Make either a StaticRange or Range wrapper depending on whether this is a live range or not. * bindings/js/JSEventCustom.cpp: Removed lots of unneeded includes. (WebCore::toJS): Stopped using "using namespace JSC". * bindings/js/WebCoreBuiltinNames.h: Added AbstractRange. * dom/AbstractRange.cpp: Added. (WebCore::makeSimpleRange): Added. * dom/AbstractRange.h: Added. * dom/AbstractRange.idl: Added. * dom/Range.h: Changed to derive from AbstractRange instead of from RefCounted. Also marked this final since it's now polymorphic. Marked all the functions that override final as well, to check that they correctly override the virtual functions in the base class. Added private isLiveRange function override that returns true. Added SPECIALIZE_TYPE_TRAITS_BEGIN/END so we can do is<Range>. * dom/Range.idl: Removed ImplementationLacksVTable. Added JSGenerateToNativeObject. Inherit from AbstractRange. Removed the 5 attribute getters that are now inherited from AbstractRange. * dom/StaticRange.h: Changed to derive from AbstractRange instead of from RefCounted. Also marked this final since it's now polymorphic. Added functions to override the ones from StaticRange, calling through to the ones from SimpleRange (I thought there was a way to do this with using, but I couldn't figure that out). Added private isLiveRange function override that returns false. Added SPECIALIZE_TYPE_TRAITS_BEGIN/END so we can do is<StaticRange>. * dom/StaticRange.idl: Removed EnabledBySetting=InputEvents since this should now always be included. I think we should probably remove the InputEvents setting now entirely. Removed ImplementationLacksVTable. Added JSGenerateToNativeObject. Inherit from AbstractRange. Removed all 5 attribute getters, which are now inherited from AbstractRange. 2020-10-17 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Incorrect inline level box geometry https://bugs.webkit.org/show_bug.cgi?id=217875 Reviewed by Antti Koivisto. While the generated runs have the correct geometry (they are painted at the correct position), the associated box geometry is incorrect which results in broken render tree dumps and incorrect geometry related DOM values. In this patch we use the correct LineBox API to get the InlineLevelBox's geometry (LineBox::InlineLevelBox::logicalRect is relative to the parent inline box and not relative to the line box). * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): 2020-10-17 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Atomic inline level box run height includes the vertical margin https://bugs.webkit.org/show_bug.cgi?id=217873 Reviewed by Antti Koivisto. RenderBox::setLocation takes the border box location. Let's not include the margin before value. (Atomic inline level box runs include the margin box per spec, see https://www.w3.org/TR/css-inline-3/#line-layout) * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): 2020-10-17 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Remove redundant InlineFormattingContext::Geometry::LineRectAndLineBoxOffset https://bugs.webkit.org/show_bug.cgi?id=217872 Reviewed by Antti Koivisto. After webkit.org/b/217832, the line box offset is always 0 (line space offsetting has moved to the inline box alignment). * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::computedLineLogicalRect const): 2020-10-17 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Introduce layout bounds based vertical alignment https://bugs.webkit.org/show_bug.cgi?id=217832 Reviewed by Antti Koivisto. This patch introduces the layout bounds concept on the inline boxes. It help with implementing https://www.w3.org/TR/css-inline-3/#line-layout (2.2. Layout Within Line Boxes) where layout bounds are used extensively (essentially the layout bound drives the inline box's aligned vertical position within the line box -as opposed to its logical height. Though they may match in many cases.) With this patch nested inline boxes are positioned relative to their parent inline boxes and LineBox::logicalRectForInlineLevelBox/logicalRectForTextRun resolves them to be relative to the line box (which then used for generating display inline runs with relative to the line coordinates). * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::build): (WebCore::Layout::LineBoxBuilder::setVerticalGeometryForInlineBox const): (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): (WebCore::Layout::LineBoxBuilder::alignInlineLevelBoxesVerticallyAndComputeLineBoxHeight): (WebCore::Layout::InlineFormattingContext::Geometry::computedLineLogicalRect const): (WebCore::Layout::LineBoxBuilder::adjustInlineBoxesLogicalHeight): Deleted. * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::logicalRectForTextRun const): (WebCore::Layout::LineBox::logicalRectForInlineLevelBox const): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineLevelBox::LayoutBounds::height const): (WebCore::Layout::LineBox::InlineLevelBox::setLayoutBounds): (WebCore::Layout::LineBox::InlineLevelBox::layoutBounds const): (WebCore::Layout::LineBox::InlineLevelBox::lineSpacing const): Deleted. (WebCore::Layout::LineBox::InlineLevelBox::setLineSpacing): Deleted. 2020-10-17 Antti Koivisto <antti@apple.com> [LFC][Integration] Skip renderers with self-painting layers in painting code https://bugs.webkit.org/show_bug.cgi?id=217871 Reviewed by Zalan Bujtas. Fixes fast/images/exif-orientation-background.html and similar. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::paint): 2020-10-17 Myles C. Maxfield <mmaxfield@apple.com> REGRESSION(r268561): Synthetic oblique text is drawn upside-down https://bugs.webkit.org/show_bug.cgi?id=217867 <rdar://problem/70400846> Reviewed by Darin Adler. I made a typo. Test: fast/text/synthetic-oblique.html * platform/graphics/FontCascade.h: (WebCore::FontCascade::syntheticObliqueAngle): * platform/graphics/coretext/FontCascadeCoreText.cpp: (WebCore::computeOverallTextMatrix): 2020-10-16 Said Abou-Hallawa <sabouhallawa@apple.com> [GPU Process] Introduce RemoteResourceCache to manage the resources in the GPU Process https://bugs.webkit.org/show_bug.cgi?id=217554 Reviewed by Simon Fraser. Add a new virtual method named ImageBuffer::flushDisplayList() which applies a DisplayList to the ImageBuffer::context(). * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::flushDisplayList): 2020-10-16 Devin Rousso <drousso@apple.com> Web Inspector: rename `Highlight` so it doesn't conflict with CSS `Highlight` https://bugs.webkit.org/show_bug.cgi?id=217858 Reviewed by Megan Gardner. No new tests as there is no behavior change since this is purely a rename. * inspector/InspectorOverlay.h: (WebCore::InspectorOverlay::Highlight::setDataFromConfig): Added. (WebCore::Highlight::Highlight): Deleted. (WebCore::Highlight::setDataFromConfig): Deleted. * inspector/InspectorOverlay.cpp: (WebCore::buildRendererHighlight): (WebCore::buildNodeHighlight): (WebCore::buildQuadHighlight): (WebCore::quadToPath): (WebCore::drawOutlinedQuadWithClip): (WebCore::drawOutlinedQuad): (WebCore::drawFragmentHighlight): (WebCore::drawShapeHighlight): (WebCore::InspectorOverlay::getHighlight const): (WebCore::InspectorOverlay::highlightNodeList): (WebCore::InspectorOverlay::highlightNode): (WebCore::InspectorOverlay::highlightQuad): (WebCore::InspectorOverlay::drawQuadHighlight): (WebCore::InspectorOverlay::drawBounds): (WebCore::InspectorOverlay::drawElementTitle): * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject): (WebCore::InspectorDOMAgent::innerHighlightQuad): (WebCore::InspectorDOMAgent::highlightNode): (WebCore::InspectorDOMAgent::highlightNodeList): (WebCore::InspectorDOMAgent::highlightFrame): * inspector/InspectorController.h: * inspector/InspectorController.cpp: (WebCore::InspectorController::getHighlight const): * testing/Internals.cpp: (WebCore::Internals::inspectorHighlightRects): 2020-10-16 Peng Liu <peng.liu6@apple.com> [Media in GPU Process] Use CARingBuffer to transfer audio data of an audio destination from a web process to the GPU Process https://bugs.webkit.org/show_bug.cgi?id=217715 Reviewed by Jer Noble. Decouple the audio output unit management from AudioDestinationCocoa so that we can run it remotely in other processes, like the GPU process. No new tests, no behavior change. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/AudioDestination.h: Export hardwareSampleRate(). * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestination::create): Remove an unnecessary function call. (WebCore::AudioDestinationCocoa::AudioDestinationCocoa): Add a parameter configureAudioOutputUnit so that we can disable the AudioOutputUnitAdaptor in AudioDestinationCocoa when we need to run the AudioOutputUnitAdaptor in another process. (WebCore::AudioDestinationCocoa::start): (WebCore::AudioDestinationCocoa::stop): (WebCore::AudioDestinationCocoa::getAudioStreamBasicDescription): Rename setAudioStreamBasicDescription() to getAudioStreamBasicDescription() because the function essentially queries the description. (WebCore::AudioDestinationCocoa::hasEnoughFrames const): Add this function so that a subclass can check whether the FIFO has enough audio samples to render. (WebCore::AudioDestinationCocoa::render): Replace the AudioTimeStamp* parameter because we only need two fields of AudioTimeStamp in this function. (WebCore::AudioDestinationCocoa::~AudioDestinationCocoa): Deleted. (WebCore::AudioDestinationCocoa::setAudioStreamBasicDescription): Deleted. (WebCore::AudioDestinationCocoa::inputProc): Deleted. This function is moved to AudioOutputUnitAdaptor. * platform/audio/cocoa/AudioDestinationCocoa.h: (WebCore::AudioDestinationCocoa::outputUnit): Deleted. * platform/audio/cocoa/AudioOutputUnitAdaptor.cpp: Added. (WebCore::AudioOutputUnitAdaptor::AudioOutputUnitAdaptor): (WebCore::AudioOutputUnitAdaptor::~AudioOutputUnitAdaptor): (WebCore::AudioOutputUnitAdaptor::start): (WebCore::AudioOutputUnitAdaptor::stop): (WebCore::AudioOutputUnitAdaptor::inputProc): * platform/audio/cocoa/AudioOutputUnitAdaptor.h: Added. * platform/audio/ios/AudioOutputUnitAdaptorIOS.cpp: Renamed from Source/WebCore/platform/audio/ios/AudioDestinationIOS.cpp. (WebCore::AudioOutputUnitAdaptor::configure): * platform/audio/mac/AudioOutputUnitAdaptorMac.cpp: Renamed from Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp. (WebCore::AudioOutputUnitAdaptor::configure): * platform/mock/MockAudioDestinationCocoa.cpp: (WebCore::MockAudioDestinationCocoa::tick): 2020-10-16 Karl Rackler <rackler@apple.com> Unreviewed, reverting r268178. This reverts commit r268178 because it caused a test failure. Reverted changeset: "Fix image-loading-lazy-multiple-times.html" https://bugs.webkit.org/show_bug.cgi?id=216979 https://trac.webkit.org/changeset/268178 2020-10-16 Antoine Quint <graouts@webkit.org> Support accelerated animation of individual transform CSS properties https://bugs.webkit.org/show_bug.cgi?id=217842 <rdar://problem/70391914> Reviewed by Dean Jackson. In order to support accelerated animation of individual transform CSS properties, we make a list of the various animations targeting animation-related properties in GraphicsLayerCA::updateAnimations() and apply an animation for each of those properties in their expected application order – translate, scale, rotate and then transform – using Core Animation's additive animation mode. When one of those properties does not have an animation, we create a non-interpolating base transform value animation set with both from and to values matching the value set in CSS for this particular property. We use a new transformMatrixForProperty() method on the GraphicsLayerClient to obtain this value. We also add a non-additive, non-interpolating identity transform first to make sure all the additive animations build on top of a neutral transform and not the underlying value applied to the layer. Finally, when GraphicsLayerCA::setTransform() is updated, we update the animations to ensure that any base transform value animation is updated to match the current value of the CSS properties contributing to the compound layer transform. Tests: webanimations/accelerated-transform-related-animation-property-order.html webanimations/accelerated-translate-animation-additional-animation-added-in-flight.html webanimations/accelerated-translate-animation-underlying-transform-changed-in-flight.html webanimations/accelerated-translate-animation-with-transform.html webanimations/accelerated-translate-animation.html * animation/CSSPropertyAnimation.cpp: Add the necessary animationIsAccelerated() overrides for each of the individual CSS transform property animation wrappers to indicate that accelerated animations are supported. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::validateTransformOperations): Update the ASSERT to check that the animated property is any of the transform-related properties. * platform/graphics/GraphicsLayer.h: (WebCore::TransformAnimationValue::TransformAnimationValue): Add a new constructor that takes a single TransformOperation* value as input instead of a TransformOperations& so that the values coming from the individual CSS transform properties can be used to create a TransformAnimationValue in RenderLayerBacking::startAnimation(). * platform/graphics/GraphicsLayerClient.h: Add the new animated property identifiers for the individual CSS transform properties. (WebCore::animatedPropertyIsTransformOrRelated): Add a new utility to identify any of the transform-related animated property identifiers. (WebCore::GraphicsLayerClient::transformMatrixForProperty const): New method called from GraphicsLayerCA::updateAnimations() to query the client, such as RenderLayerBacking, for the TransformationMatrix representing a given CSS property value to be used for base transform value non-interpolating animations. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::propertyIdToString): Account for the new animated property identifiers. (WebCore::GraphicsLayerCA::setTransform): If we are currently running a transform-related animation, a change in underlying transform value means we must re-evaluate all transform-related animations to ensure that the base value transform animations are current. (WebCore::GraphicsLayerCA::moveOrCopyAnimations): (WebCore::GraphicsLayerCA::addAnimation): (WebCore::GraphicsLayerCA::updateAnimations): When updating animations, keep track of the most recent animation applicable to each individual CSS transform property and the list of animations targeting the transform CSS property. Then, ensure those animations are applied in the specified order – translate, scale, rotate and transform – by adding those animations as additive CA animations with non-interpolating base transform value animations for each property that does not have a specified interpolating animation. (WebCore::GraphicsLayerCA::isRunningTransformAnimation const): Ensure we also consider paused animations as "running" animations. (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): Whether a transform animation needs to be run using the additive mode is now determined in updateAnimations() so we remove all code related to working out whether animations ought to be additive. (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): We force the creation of CATransform3D values for individual CSS transform properties since only this mode guarantees that additivity of such animations will yield the expected result where the transforms are multiplied rather than simply adding float values of individual components. * platform/graphics/ca/GraphicsLayerCA.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::startAnimation): Ensure we start animations for the individual CSS transform properties. (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty): (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty): (WebCore::RenderLayerBacking::transformMatrixForProperty const): Implement the new GraphicsLayerClient method to provide a matrix that can be used as a value for non-interpolating base value transform animations in GraphicsLayerCA::updateAnimations() for any of the transform-related CSS properties. * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): Ensure that an animation for any of the transform-related CSS properties yields composition of the target layer. (WebCore::RenderLayerCompositor::isRunningTransformAnimation const): * rendering/style/WillChangeData.cpp: (WebCore::propertyTriggersCompositingOnBoxesOnly): Ensure that setting the will-change CSS property to any of the transform-related CSS properties yields composition of the target. 2020-10-16 Jiewen Tan <jiewen_tan@apple.com> [WebAuthn] Remove experimental feature flag: WebAuthenticationLocalAuthenticatorEnabled https://bugs.webkit.org/show_bug.cgi?id=217796 <rdar://problem/70358912> Reviewed by Brent Fulgham. * Modules/webauthn/PublicKeyCredential.cpp: (WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable): * page/Settings.yaml: 2020-10-16 Andres Gonzalez <andresg_22@apple.com> Revert AXCoreObject::topDocumentFrameView change that caused build failure on iOS debug. https://bugs.webkit.org/show_bug.cgi?id=217841 Reviewed by Chris Fleizach. No change in functionality, reverting part of previous re-work. * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/ios/AccessibilityObjectIOS.mm: (WebCore::AccessibilityObject::convertRectToPlatformSpace const): (WebCore::AccessibilityObject::topDocumentFrameView const): Deleted. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilityWebDocumentView]): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/AccessibilityObjectMac.mm: (WebCore::AccessibilityObject::topDocumentFrameView const): Deleted. 2020-10-16 Eric Carlson <eric.carlson@apple.com> [GPU Process] Implement VideoPlaybackMetrics https://bugs.webkit.org/show_bug.cgi?id=217439 <rdar://problem/60179370> Reviewed by Jer Noble. Test: media/video-playback-quality.html * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::getVideoPlaybackQuality): * platform/graphics/MediaPlayer.h: * platform/graphics/VideoPlaybackQualityMetrics.h: Added. (WebCore::VideoPlaybackQualityMetrics::encode const): (WebCore::VideoPlaybackQualityMetrics::decode): 2020-10-16 Eric Carlson <eric.carlson@apple.com> [GPU Process] Implement mediaPlayerGetRawCookies https://bugs.webkit.org/show_bug.cgi?id=217739 <rdar://problem/70313370> Reviewed by Youenn Fablet. Plumb mediaPlayerGetRawCookies through from the GPU process to the Web process, which is used to provide site cookies to AVFoundation for AirPlay. This has always been a synchronous API, which we don't want between processes, so change the interface to take a completion handler and restructure the caller to use it. Tested manually. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaPlayerGetRawCookies const): * html/HTMLMediaElement.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::getRawCookies const): * platform/graphics/MediaPlayer.h: (WebCore::MediaPlayerClient::mediaPlayerGetRawCookies const): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): 2020-10-16 Jiewen Tan <jiewen_tan@apple.com> [WebAuthn] Implement a dummy WebAuthnProcess https://bugs.webkit.org/show_bug.cgi?id=217559 <rdar://problem/70168749> Reviewed by Brent Fulgham. No tests. * en.lproj/Localizable.strings: Provides a name for the WebAuthn process. 2020-10-16 Don Olmstead <don.olmstead@sony.com> [WebGPU] Centralize Platform Defines https://bugs.webkit.org/show_bug.cgi?id=217725 Reviewed by Myles C. Maxfield. Centralize all the Metal forward declarations and GPU platform type definitions into GPUPlatformTypesMetal.h. Each platform implementing WebGPU will have its own version of the file which contains the same definitions. This file is then referenced by GPUPlatformTypes.h. This is in preparation for adding a Dawn based implementation which requires more substantial definitions than the Metal backend. No new tests. No change in behavior. * WebCore.xcodeproj/project.pbxproj: * platform/graphics/gpu/GPUBindGroup.h: * platform/graphics/gpu/GPUBindGroupAllocator.h: * platform/graphics/gpu/GPUBindGroupLayout.h: * platform/graphics/gpu/GPUBuffer.h: (WebCore::GPUBuffer::platformBuffer const): * platform/graphics/gpu/GPUCommandBuffer.h: * platform/graphics/gpu/GPUComputePassEncoder.h: * platform/graphics/gpu/GPUComputePipeline.h: * platform/graphics/gpu/GPUDevice.h: * platform/graphics/gpu/GPUPlatformTypes.h: Added. * platform/graphics/gpu/GPUProgrammablePassEncoder.h: * platform/graphics/gpu/GPUQueue.h: * platform/graphics/gpu/GPURenderPassEncoder.h: * platform/graphics/gpu/GPURenderPipeline.h: * platform/graphics/gpu/GPUSampler.h: * platform/graphics/gpu/GPUShaderModule.h: * platform/graphics/gpu/GPUSwapChain.h: * platform/graphics/gpu/GPUTexture.h: * platform/graphics/gpu/cocoa/GPUPlatformTypesMetal.h: Added. 2020-10-16 Chris Dumez <cdumez@apple.com> Move even more AudioContext-specific logic out of BaseAudioContext https://bugs.webkit.org/show_bug.cgi?id=217803 Reviewed by Eric Carlson. Move even more AudioContext-specific logic out of BaseAudioContext and into AudioContext. In particular, all the logic related to autoplay restrictions, audible state, and platform media session interruptions only apply to AudioContext and not OfflineAudioContext. No new tests, no Web-facing behavior change. * Modules/webaudio/AudioContext.cpp: (WebCore::shouldDocumentAllowWebAudioToAutoPlay): (WebCore::AudioContext::AudioContext): (WebCore::AudioContext::constructCommon): (WebCore::AudioContext::~AudioContext): (WebCore::AudioContext::willPausePlayback): (WebCore::AudioContext::mediaState const): (WebCore::AudioContext::mayResumePlayback): (WebCore::AudioContext::willBeginPlayback): (WebCore::AudioContext::visibilityStateChanged): (WebCore::AudioContext::suspend): (WebCore::AudioContext::resume): (WebCore::AudioContext::suspendPlayback): (WebCore::AudioContext::hostingDocumentIdentifier const): (WebCore::AudioContext::isSuspended const): (WebCore::AudioContext::pageMutedStateDidChange): (WebCore::AudioContext::mediaCanStart): (WebCore::AudioContext::logger const): * Modules/webaudio/AudioContext.h: (WebCore::AudioContext::behaviorRestrictions const): (WebCore::AudioContext::addBehaviorRestriction): (WebCore::AudioContext::removeBehaviorRestriction): (WebCore::AudioContext::userGestureRequiredForAudioStart const): (WebCore::AudioContext::pageConsentRequiredForAudioStart const): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): (WebCore::BaseAudioContext::~BaseAudioContext): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::startOfflineRendering): * testing/Internals.cpp: (WebCore::Internals::setAudioContextRestrictions): * testing/Internals.h: * testing/Internals.idl: 2020-10-16 Sam Weinig <weinig@apple.com> ENABLE_LEGACY_CSS_VENDOR_PREFIXES and RuntimeEnabledFeatures::legacyCSSVendorPrefixesEnabled() don't do anything https://bugs.webkit.org/show_bug.cgi?id=217833 Reviewed by Simon Fraser. Remove support for ENABLE_LEGACY_CSS_VENDOR_PREFIXES, which only guarded code that also checked legacyCSSVendorPrefixesEnabled(), which was never enabled. * css/CSSStyleDeclaration.cpp: * css/parser/CSSPropertyParser.cpp: (WebCore::cssPropertyID): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setLegacyCSSVendorPrefixesEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::legacyCSSVendorPrefixesEnabled const): Deleted. 2020-10-16 Antti Koivisto <antti@apple.com> [LFC][Integration] Allow images in inline content https://bugs.webkit.org/show_bug.cgi?id=217757 Reviewed by Zalan Bujtas. Add support for inline images in integrated modern inline layout. This patch doesn't yet enable the support (it is behind an ifdef). * dom/Position.cpp: (WebCore::Position::ensureLineBoxes const): * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::geometryForBox const): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): * layout/integration/LayoutIntegrationBoxTree.cpp: (WebCore::LayoutIntegration::BoxTree::buildTree): * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForLineLayoutWithReason): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::updateReplacedDimensions): (WebCore::LayoutIntegration::LineLayout::constructContent): (WebCore::LayoutIntegration::LineLayout::prepareLayoutState): (WebCore::LayoutIntegration::LineLayout::paint): * layout/integration/LayoutIntegrationLineLayout.h: * layout/layouttree/LayoutReplacedBox.h: (WebCore::Layout::ReplacedBox::contentSizeForIntegration const): (WebCore::Layout::ReplacedBox::setContentSizeForIntegration): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutLFCLines): * rendering/RenderLineBreak.cpp: 2020-10-16 Youenn Fablet <youenn@apple.com> sdpFmtLine should be missing from RTCRtpCodecCapability instead of being an empty string https://bugs.webkit.org/show_bug.cgi?id=217818 Reviewed by Eric Carlson. Covered by updated test. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::toRTCRtpCapabilities): If line is empty, make sure to return a null string instead. 2020-10-16 Philippe Normand <pnormand@igalia.com> [GStreamer] Remove unused ElementType values from the registry scanner https://bugs.webkit.org/show_bug.cgi?id=217824 Reviewed by Xabier Rodriguez-Calvar. r268576 introduced new values in the ElementType enum but they were unused and introduced inconsistency in in fillMimeTypeSetFromCapsMapping(). If this function needs to be used for encoding configurations it will need to be refactored but that's not a scenario I foresee, so for now, remove unused enum values. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::fillMimeTypeSetFromCapsMapping): * platform/graphics/gstreamer/GStreamerRegistryScanner.h: 2020-10-16 Michael Catanzaro <mcatanzaro@gnome.org> REGRESSION(r267727): Warning spam from JSC_DECLARE_CUSTOM_GETTER https://bugs.webkit.org/show_bug.cgi?id=217585 Reviewed by Yusuke Suzuki. SelectorCompiler.cpp needs the new JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL. * cssjit/SelectorCompiler.cpp: 2020-10-16 Philippe Normand <pnormand@igalia.com> Unreviewed, follow-up to r268576 Revert a chunk of r268576 that introduced a regression in audio-related tests. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::fillMimeTypeSetFromCapsMapping): Add an ASSERT and modify mime-type and codec hashmaps in-place. 2020-10-16 Andres Gonzalez <andresg_22@apple.com> Refactor [WebAccessibilityObjectWrapper convertRectToSpace] so that the platform-specific code is in their corresponding AX object platform implementations. https://bugs.webkit.org/show_bug.cgi?id=217785 Reviewed by Chris Fleizach. No change in functionality, code refactor and cleanup. [WebAccessibilityObjectWrapperBase convertRectToSpace] had two different code paths for Mac and iOS, defeating the purpose of a base class. This re-factoring Simplifies the wrapper code by moving the platform- specific implementations to their corresponding AX object implementations of convertRectToPlatformSpace. Some code cleanup. * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/ios/AccessibilityObjectIOS.mm: (WebCore::AccessibilityObject::topDocumentFrameView const): (WebCore::AccessibilityObject::convertRectToPlatformSpace const): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilityWebDocumentView]): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::convertRectToPlatformSpace const): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/AccessibilityObjectMac.mm: (WebCore::AccessibilityObject::topDocumentFrameView const): (WebCore::AccessibilityObject::convertRectToPlatformSpace const): * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper position]): 2020-10-16 Philippe Normand <pnormand@igalia.com> [GStreamer] Audio worklet support https://bugs.webkit.org/show_bug.cgi?id=217760 Reviewed by Xabier Rodriguez-Calvar. This patch hooks WebAudio worklet rendering support into the GStreamer WebAudio backend. * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer): (WebCore::AudioDestinationGStreamer::start): Set the render callback if it was provided. * platform/audio/gstreamer/AudioDestinationGStreamer.h: * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webKitWebAudioSrcAllocateBuffersAndRenderAudio): Invoke the bus rendering through the render callback if it was set. (webkitWebAudioSourceSetDispatchToRenderThreadCallback): * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.h: 2020-10-16 Kimmo Kinnunen <kkinnunen@apple.com> Refactor WebGL implementation to use only GraphicsContextGL part 1 https://bugs.webkit.org/show_bug.cgi?id=217213 <rdar://problem/69876105> Reviewed by Dean Jackson. Part 1 of work towards WebGL implementation which uses GraphicsContextGL abstract base class instead of GraphicsContextGLOpenGL concrete class. Move pixel data related static helper funcions from GraphicsContextGLOpenGL to GraphicsContextGL. These are normal pixel format calculation functions that do not have concrete class implementation details. Move pixel pack related structures to GraphicsContextGL. Rename GraphicsContextGLOpenGL::ImageExtractor to GraphicsContextGLImageExtractor. The GraphicsContextGL class interface is already quite lengthy and the image extractor is not very tied to the context class. Introduce a virtual member function in GraphicsContextGL for each call that is likely needed for the WebGL implementation. No new tests, a refactor. * WebCore.xcodeproj/project.pbxproj: * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getPackPixelStoreParams const): (WebCore::WebGL2RenderingContext::getUnpackPixelStoreParams const): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texImageArrayBufferViewHelper): (WebCore::WebGLRenderingContextBase::texImageImpl): (WebCore::WebGLRenderingContextBase::getPackPixelStoreParams const): (WebCore::WebGLRenderingContextBase::getUnpackPixelStoreParams const): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/GraphicsContextGL.cpp: (WebCore::getDataFormat): (WebCore::texelBytesForFormat): (WebCore::packPixels): (WebCore::GraphicsContextGL::computeFormatAndTypeParameters): (WebCore::GraphicsContextGL::computeImageSizeInBytes): (WebCore::GraphicsContextGL::possibleFormatAndTypeForInternalFormat): (WebCore::GraphicsContextGL::packImageData): (WebCore::GraphicsContextGL::extractImageData): (WebCore::GraphicsContextGL::extractTextureData): * platform/graphics/GraphicsContextGL.h: (WebCore::GraphicsContextGL::Client::~Client): (WebCore::GraphicsContextGL::addClient): (WebCore::GraphicsContextGL::removeClient): (WebCore::GraphicsContextGL::getInternalFramebufferSize const): * platform/graphics/GraphicsContextGLImageExtractor.cpp: Copied from Source/WebCore/platform/graphics/win/GraphicsContextGLDirect2D.cpp. (WebCore::GraphicsContextGLImageExtractor::GraphicsContextGLImageExtractor): * platform/graphics/GraphicsContextGLImageExtractor.h: Added. (WebCore::GraphicsContextGLImageExtractor::extractSucceeded): (WebCore::GraphicsContextGLImageExtractor::imagePixelData): (WebCore::GraphicsContextGLImageExtractor::imageWidth): (WebCore::GraphicsContextGLImageExtractor::imageHeight): (WebCore::GraphicsContextGLImageExtractor::imageSourceFormat): (WebCore::GraphicsContextGLImageExtractor::imageAlphaOp): (WebCore::GraphicsContextGLImageExtractor::imageSourceUnpackAlignment): (WebCore::GraphicsContextGLImageExtractor::imageHtmlDomSource): * platform/graphics/angle/GraphicsContextGLANGLE.cpp: * platform/graphics/cairo/GraphicsContextGLCairo.cpp: (WebCore::GraphicsContextGLImageExtractor::extractImage): * platform/graphics/cg/GraphicsContextGLCG.cpp: (WebCore::GraphicsContextGLImageExtractor::extractImage): * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: (WebCore::GraphicsContextGLOpenGL::texImage2DResourceSafe): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: * platform/graphics/win/GraphicsContextGLDirect2D.cpp: (WebCore::GraphicsContextGLImageExtractor::extractImage): 2020-10-16 Youenn Fablet <youenn@apple.com> Add support for GPUProcess WebAudio media element providers https://bugs.webkit.org/show_bug.cgi?id=217704 Reviewed by Eric Carlson. Update AudioSourceProviderAVFObjC so that a specific ring buffer can be provided and to be notified of new samples being pushed. Covered by existing web audio tests run with GPUProcess. * WebCore.xcodeproj/project.pbxproj: * platform/audio/AudioSourceProvider.h: (WebCore::AudioSourceProvider::isHandlingAVPlayer const): * platform/audio/cocoa/AudioSampleDataSource.mm: (WebCore::AudioSampleDataSource::pullSamplesInternal): When we are too close to the end of available data, do as if we are paused and keep the same time entry for the next read operation. This will basically make us wait for the next push of data before restarting to read succesfully. * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h: (isType): * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: (WebCore::AudioSourceProviderAVFObjC::prepare): (WebCore::AudioSourceProviderAVFObjC::process): (WebCore::AudioSourceProviderAVFObjC::setAudioCallback): (WebCore::AudioSourceProviderAVFObjC::setRingBufferCreationCallback): * platform/mediastream/mac/WebAudioSourceProviderCocoa.mm: (WebCore::WebAudioSourceProviderCocoa::receivedNewAudioSamples): We should use the input sample rate to compute the input media time. 2020-10-16 Philippe Normand <pnormand@igalia.com> [GStreamer] Encoder probing support for the registry scanner https://bugs.webkit.org/show_bug.cgi?id=217750 Reviewed by Xabier Rodriguez-Calvar. The scanner is now able to probe for platform encoders for the most common formats: avc1, av1, ogg, theora, aac and opus. The muxers for webm and mp4 are also checked. No new tests, existing mediacapabilities test cover this change. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::GStreamerRegistryScanner): (WebCore::GStreamerRegistryScanner::~GStreamerRegistryScanner): (WebCore::GStreamerRegistryScanner::mimeTypeSet): (WebCore::GStreamerRegistryScanner::isContainerTypeSupported const): (WebCore::GStreamerRegistryScanner::hasElementForMediaType const): (WebCore::GStreamerRegistryScanner::fillMimeTypeSetFromCapsMapping): (WebCore::GStreamerRegistryScanner::initializeDecoders): (WebCore::GStreamerRegistryScanner::initializeEncoders): (WebCore::GStreamerRegistryScanner::isCodecSupported const): (WebCore::GStreamerRegistryScanner::isContentTypeSupported const): (WebCore::GStreamerRegistryScanner::areAllCodecsSupported const): (WebCore::GStreamerRegistryScanner::isAVC1CodecSupported const): (WebCore::GStreamerRegistryScanner::configurationNameForLogging const): (WebCore::GStreamerRegistryScanner::isConfigurationSupported const): * platform/graphics/gstreamer/GStreamerRegistryScanner.h: (WebCore::GStreamerRegistryScanner::isDecodingSupported const): (WebCore::GStreamerRegistryScanner::isEncodingSupported const): * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::supportsContainerType): (WebCore::ImageDecoderGStreamer::canDecodeType): * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.cpp: (WebCore::createMediaPlayerEncodingConfigurationGStreamer): * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes): (WebCore::MediaPlayerPrivateGStreamer::supportsType): * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::parseDemuxerSrcPadCaps): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::getSupportedTypes): (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType): * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp: (WebCore::factories): 2020-10-15 Keith Rollin <krollin@apple.com> Lessen the reliance on VPATH in WebCore/DerivedSources.make https://bugs.webkit.org/show_bug.cgi?id=217696 <rdar://problem/70279941> Reviewed by Darin Adler. Due to the way vpath/VPATH works in `make`, we can get into a situation where necessarily IDL files are not copied to their correct locations. WebKit comes with many IDL files. When building for internal purposes, Apple can add to or modify this set of IDL files. When creating Engineering builds, these additional IDL files are copied to .../WebKitBuild/<configuration>/usr/local/includes. When performing Production builds, these IDL files are included in the SDK. This arrangement can be seen in DerivedSources.make: vpath %.idl $(BUILT_PRODUCTS_DIR)/usr/local/include $(SDKROOT)/usr/local/include In order to get these IDL files into a location where they can be uniformly found and handled, there is a step in DerivedSources.make that copies them to the current directory, which is WebKitBuild/<configuration>/DerivedSources/WebCore: $(ADDITIONAL_BINDING_IDLS) : % : WebKitAdditions/% cp $< . The IDL files specified in ADDITIONAL_BINDING_IDLS are specified as bare files names, meaning that vpath and VPATH are employed to find them. Given the vpath specification previously shown, if the IDL files can be found in $(BUILT_PRODUCTS_DIR)/usr/local/include, they are copied locally. Otherwise, they should be found in $(SDKROOT)/usr/local/include and copied locally. As it turns out, vpath/VPATH resolution is performed not only on the prerequisites of the build rule, but also the target (see section 4.5.3 of the GNU `make` manual). This means that the files specified on the left side of the `cp` rule above are also searched for. And since the standard IDL files (the ones that are being replaced with the Apple-specific versions) can be found on VPATH as it's defined in DerivedSources.make (specifically, in $(WebCore)/dom), then those files participate in determining if the `cp` rule is executed. Consider the normal build case: repositories are checked out (applying the current modification timestamp to the files). During the build, the files in $(ADDITIONAL_BINDING_IDLS) are copied to either BUILT_PRODUCTS_DIR or to SDKROOT, which again modifies their timestamps. We eventually get to the build rule for the `cp` operation. Because the files in WebKitAdditions (be it in the local build directory or the SDK) are *newer* than the checked-out ones in $(WebCore)/dom due to their having been copied after they were checked-out, then the `cp` command is invoked and then files are copied to the current build directory. However, consider a slightly different build case. In this case, projects are checked out and built one at a time. So the project producing the files in ADDITIONAL_BINDING_IDLS is checked out and then the IDL files are copied to their intermediate location and have their timestamps set to that time. Later, WebCore is checked out, and DerivedSources.make is eventually invoked. Now, the files in $(WebCore)/dom are *newer* than those in WebKitAdditions. `make` determines that the IDL files are up-to-date and does not execute the `cp` commands. The IDL files are not copied, and the build then either fails (because of missing files) or proceeds incorrectly (because the wrong IDL files are found). The solution to this issue is to lessen the reliance on vpath/VPATH in DerivedSources.make. Instead, be more explicit about where files can be found and trim down vpath/VPATH to it's bare minimum. With vpath/VPATH reduced, we remove the issue of files being accidentally discovered that we don't want discovered. The modifications effected to make this change are: - Remove the definition of VPATH. - Dynamically build up an idl-only "VPATH" as needed with the "vpath" directive. - Manually look for the additional IDL files at their expected locations without using vpath/VPATH. - For the files that used to be found on VPATH, specify their actual locations (typically by prefixing them with $(WebCore). - (Cleanup) Consistently refer to local files with bare names (that is, remove the "./" that some files were prefixed with). - (Cleanup) Use consistent spacing around "<" and ">" redirection symbols. - (Cleanup) Remove some redundant prerequisites from the build rule involving IDL_INTERMEDIATE_PATTERNS. No new tests -- no new or changed functionality. * DerivedSources.make: 2020-10-15 Chris Dumez <cdumez@apple.com> Move AudioContext-specific logic out of BaseAudioContext https://bugs.webkit.org/show_bug.cgi?id=217794 Reviewed by Geoffrey Garen. Move AudioContext-specific logic out of BaseAudioContext and into the AudioContext class. This required having WebKitAudioContext subclass AudioContext instead of BaseAudioContext. No new tests, no Web-facing behavior change. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::AudioContext): (WebCore::AudioContext::suspendRendering): (WebCore::AudioContext::resumeRendering): (WebCore::AudioContext::nodeWillBeginPlayback): (WebCore::AudioContext::startRendering): (WebCore::AudioContext::lazyInitialize): (WebCore::AudioContext::willPausePlayback): * Modules/webaudio/AudioContext.h: (WebCore::AudioContext::AudioContext): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::lazyInitialize): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::nodeWillBeginPlayback): (WebCore::BaseAudioContext::mediaSession const): * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::WebKitAudioContext): * Modules/webaudio/WebKitAudioContext.h: (WebCore::WebKitAudioContext::listener): 2020-10-15 Sam Weinig <weinig@apple.com> CSSStyleDeclaration breaks JS spec (properties not showing up in Object.getOwnPropertyNames) https://bugs.webkit.org/show_bug.cgi?id=217623 Reviewed by Darin Adler. Replace named getter/setter based implementation of access to CSSStyleDeclaration property values with a generated partial interface that lists all the properties exactly. To keep things consistent with existing behavior, in addition to the spec'd properties, we also maintain additional properties such as Epub* (in addition to the epub* properties the spec says we should), and Css, css, Pos, pos, Pixel, and Pixel prefixed properties. As a follow up, we should consider removing these as they are not supported by the standard or other browsers. * CMakeLists.txt: * DerivedSources-output.xcfilelist: * DerivedSources.make: Generate CSSStyleDeclaration+PropertyNames.idl and ensure it is compile together with the other bindings. * css/makeprop.pl: Add generation of CSSStyleDeclaration+PropertyNames.idl from CSSProperties.json. * bindings/scripts/IDLAttributes.json: Remove CallNamedSetterOnlyForSupportedProperties and DefaultDefineOwnProperty extended attributes, which now have no users, and add the CSSProperty extended attribute, used to avoid unnecessary implementation overhead for each property. Rather, in an analogous way to EventHandlers, the bindings now directly pass in the associate CSSPropertyID to an appropriate CSSStyleDeclaration function. * bindings/scripts/CodeGeneratorJS.pm: (GenerateInvokeNamedPropertySetter): (GeneratePut): (GeneratePutByIndex): (GenerateDefineOwnProperty): Remove all use of CallNamedSetterOnlyForSupportedProperties. (InstanceOverridesDefineOwnProperty): Remove support for DefaultDefineOwnProperty, which is now unused. (ToMethodName): Match the actual setting name, and don't transform names that start with CSSOM. (GenerateAttributeGetterBodyDefinition): (GenerateAttributeSetterBodyDefinition): Add support for the new CSSProperty extended attribute which uses the passsed value to to directly call CSSStyleDeclaration functions with a CSSPropertyID. * css/CSSStyleDeclaration.cpp: (WebCore::CSSStyleDeclaration::setPropertyValueInternal): (WebCore::CSSStyleDeclaration::getPropertyValueInternalForPosOrPixelPrefixed): (WebCore::CSSStyleDeclaration::setPropertyValueInternalForPosOrPixelPrefixed): (WebCore::CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName): (WebCore::CSSStyleDeclaration::namedItem): Deleted. (WebCore::CSSStyleDeclaration::setNamedItem): Deleted. (WebCore::CSSStyleDeclaration::supportedPropertyNames const): Deleted. * css/CSSStyleDeclaration.h: Replace old named getter/setter support code with new helpers which operate directly on CSSPropertyIDs. * css/CSSStyleDeclaration.idl: Update to match the current spec (almost, still need to getPropertyPriority to not return null) and remove custom named getter/setter operations. 2020-10-15 Myles C. Maxfield <mmaxfield@apple.com> [Cocoa] Don't change the text matrix multiple times inside FontCascade::drawGlyphs() https://bugs.webkit.org/show_bug.cgi?id=217749 Reviewed by Simon Fraser. FontCascade::drawGlyphs() may actually call CTFontDrawGlyphs() 4 times: 2 for synthetic bold, times 2 for emulated shadows that we draw ourselves. Previously, each of these calls can have a different text matrix, because showGlyphsWithAdvances() called CGContextSetTextPosition(), which affects the text matrix. This makes https://bugs.webkit.org/show_bug.cgi?id=217506 difficult, because we don't actually track the text matrix inside the GraphicsContext. In that patch, we call FontCascade::drawGlyphs() and intercept the resulting CGContext calls. However, if we detect a modified text matrix inside those CGContext calls, we have no way of knowing whether it was modified by WebKit or internally inside Core Text. We need to know this, though, because the modifications Core Text makes have to be preserved across to the GPU process, but the modifications WebKit makes need to not be preserved (since the GPU process will make them naturally). Tracking the text matrix in the CGContext (a la the CTM) is unnecessary; all we need to know is whether WebKit changed it or Core Text changed it. Therefore, this patch migrates all the text matrix computation into standalone functions that can be called from GPU Process infrastructure, so we can know what WebKit does there (and also what Core Text does, by omission). This only works, though, if the text matrix is identical for all the calls to CTFontDrawGlyphs() inside FontCascade::drawGlyphs(). This patch enforces this by emulating CGContextSetTextPosition() ourselves by adding a constant to all the glyph positions. Performance is not a conern because we already iterate over all the glyphs inside showGlyphsWithAdvances(), so we're already paying the cost of the loop. No new tests because there is no behavior change. * platform/graphics/FontCascade.h: (WebCore::FontCascade::syntheticObliqueAngle): Deleted. * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::showLetterpressedGlyphsWithAdvances): * platform/graphics/coretext/FontCascadeCoreText.cpp: (WebCore::rotateLeftTransform): (WebCore::fillVectorWithHorizontalGlyphPositions): (WebCore::fillVectorWithVerticalGlyphPositions): (WebCore::showGlyphsWithAdvances): (WebCore::computeOverallTextMatrix): (WebCore::computeVerticalTextMatrix): (WebCore::FontCascade::drawGlyphs): 2020-10-15 Chris Dumez <cdumez@apple.com> Cache JS arguments in AudioWorkletProcessor::process() for performance https://bugs.webkit.org/show_bug.cgi?id=217685 Reviewed by Geoffrey Garen. Cache JS arguments in AudioWorkletProcessor::process() for performance. Blink has the same optimization here: - https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/modules/webaudio/audio_worklet_processor.cc No new tests, no Web-facing behavior change. * Modules/webaudio/AudioWorkletProcessor.cpp: (WebCore::busChannelCount): (WebCore::constructFrozenJSArray): (WebCore::copyDataFromJSArrayToBuses): (WebCore::copyDataFromBusesToJSArray): (WebCore::copyDataFromParameterMapToJSObject): (WebCore::busTopologyMatchesJSArray): (WebCore::parameterMapTopologyMatchesJSObject): (WebCore::zeroJSArray): (WebCore::AudioWorkletProcessor::buildJSArguments): (WebCore::AudioWorkletProcessor::process): * Modules/webaudio/AudioWorkletProcessor.h: 2020-10-15 Chris Dumez <cdumez@apple.com> [Cocoa] Simplify logic for caching FFTSetups in FFTFrame https://bugs.webkit.org/show_bug.cgi?id=217782 Reviewed by Eric Carlson. Simplify logic for caching FFTSetups in FFTFrame: - Use a local static (NeverDestroyed) to cache the FFTSetups to avoid heap allocation and simplify logic a bit. - Drop FFTFrame::cleanup() since it is dead code. No new tests, no Web-facing behavior change. * platform/audio/FFTFrame.h: * platform/audio/FFTFrameStub.cpp: * platform/audio/gstreamer/FFTFrameGStreamer.cpp: * platform/audio/mac/FFTFrameMac.cpp: (WebCore::FFTFrame::fftSetupForSize): 2020-10-15 Chris Dumez <cdumez@apple.com> Use std::fill_n() instead of for loops in ConstantSourceNode https://bugs.webkit.org/show_bug.cgi?id=217777 Reviewed by Eric Carlson. Use std::fill_n() instead of for loops in ConstantSourceNode. No new tests, no Web-facing behavior change. * Modules/webaudio/ConstantSourceNode.cpp: (WebCore::ConstantSourceNode::process): 2020-10-15 Chris Dumez <cdumez@apple.com> Avoid double zero'ing of AudioArray in DelayDSPKernel constructors https://bugs.webkit.org/show_bug.cgi?id=217779 Reviewed by Darin Adler. Avoid double zero'ing of AudioArray in DelayDSPKernel constructors. The constructors were calling AudioArray::resize() to allocate the array memory and then AudioArray::zero() to zero-out the memory. The second step is unnecessary since AudioArray::resize() already takes care of zeroing out the memory after allocation. No new tests, no Web-facing behavior change. * Modules/webaudio/DelayDSPKernel.cpp: (WebCore::DelayDSPKernel::DelayDSPKernel): 2020-10-15 Chris Dumez <cdumez@apple.com> Use std::fill_n() instead of for loops in AudioParamTimeline https://bugs.webkit.org/show_bug.cgi?id=217775 Reviewed by Darin Adler. Use std::fill_n() instead of for loops in AudioParamTimeline. No new tests, no Web facing behavior change. * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::fillWithValue): (WebCore::AudioParamTimeline::valuesForFrameRange): (WebCore::AudioParamTimeline::valuesForFrameRangeImpl): (WebCore::AudioParamTimeline::processExponentialRamp): (WebCore::AudioParamTimeline::processCancelValues): (WebCore::AudioParamTimeline::processSetTarget): (WebCore::AudioParamTimeline::processSetValueCurve): 2020-10-15 Chris Dumez <cdumez@apple.com> Use std::fill_n() instead of for loops in AudioParam::calculateFinalValues() https://bugs.webkit.org/show_bug.cgi?id=217766 Reviewed by Geoffrey Garen. Use std::fill_n() instead of for loops in AudioParam::calculateFinalValues(). No new tests, no Web-facing behavior change. * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::calculateFinalValues): 2020-10-15 Wenson Hsieh <wenson_hsieh@apple.com> Add a fast codepath to compute the bounding rect of an inline arc path https://bugs.webkit.org/show_bug.cgi?id=217764 Reviewed by Tim Horton. This is a followup to r268320, which added an implementation of `Path::fastBoundingRect` for the inline `ArcData` case, but left `Path::boundingRect` as-is. This means that currently, a call to `Path::boundingRect` in the case of a simple arc path (represented in `ArcData`) will cause a `CGPath` to be allocated and set up, when we could instead just compute the exact bounds of the path using the center, radius, and start and end angles. * platform/graphics/Path.cpp: (WebCore::computeArcBounds): Add a helper function to compute the exact bounds of a circular arc. This helper works by first fitting the rect to the start and end positions, and then extending to the top, left, bottom, or right edges as needed (i.e. if the start and end angles intersect the top-, left-, bottom- or right-most points in the circle). (WebCore::Path::boundingRectFromInlineData const): 2020-10-15 Sam Weinig <weinig@apple.com> [WebIDL] Bindings do not support two attributes or functions with the same name only differing by case of first character https://bugs.webkit.org/show_bug.cgi?id=217776 Reviewed by Chris Dumez. Due to needing to support cases like CSSStyleDeclaration#webkitAlignSelf and CSSStyleDeclaration#WebkitAlignSelf, the naming convention for the c-wrapper functions in the generated bindings had to be updated to not ignore the case of the leading character. The new convention uses a leading _ (unless the identifier already starts with one) changing a function such as jsDOMWindowInstanceFunctionShowModalDialog to jsDOMWindowInstanceFunction_showModalDialog. * bindings/js/JSDOMWindowCustom.cpp: * bindings/js/JSLocationCustom.cpp: Update for new c-function naming convention. * bindings/scripts/CodeGeneratorJS.pm: (MangleAttributeOrFunctionName): (GetAttributeGetterName): (GetAttributeSetterName): (GetFunctionName): Add a leading underscore to all mangled attribute and function names and remove leading capitalization. This allows us to have attributes and functions with the same name except for the capitalization of the first letter. * bindings/scripts/test/JS/*: Update bindings test results for new c-function naming scheme. 2020-10-15 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo][GraphicsLayerTextureMapper] css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection-remove.html is crashing https://bugs.webkit.org/show_bug.cgi?id=217746 Reviewed by Don Olmstead. If replica layers is removed, replicaLayer() and can be null in commitLayerChanges(). Null checking is needed. * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayerTextureMapper::commitLayerChanges): Added null checking for maskLayer() and replicaLayer(). 2020-10-15 Antoine Quint <graouts@webkit.org> Updating an individual transform CSS property has no visual change when composited https://bugs.webkit.org/show_bug.cgi?id=217769 <rdar://problem/70344280> Reviewed by Simon Fraser. Ensure that changes to the translate, scale and rotate CSS properties have the same effect than when the transform property is changed for composited elements. Tests: transforms/2d/rotate-change-composited.html transforms/2d/scale-change-composited.html transforms/2d/translate-change-composited.html * platform/graphics/transforms/RotateTransformOperation.h: * platform/graphics/transforms/ScaleTransformOperation.h: * platform/graphics/transforms/TranslateTransformOperation.h: * rendering/RenderLayerCompositor.cpp: (WebCore::recompositeChangeRequiresGeometryUpdate): (WebCore::styleHas3DTransformOperation): (WebCore::styleTransformOperationsAreRepresentableIn2D): (WebCore::RenderLayerCompositor::requiresCompositingForTransform const): (WebCore::RenderLayerCompositor::layerHas3DContent const): 2020-10-15 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo][GraphicsLayerTextureMapper] A parent layer's filter isn't applied to its child layer at the first paint https://bugs.webkit.org/show_bug.cgi?id=217748 Reviewed by Don Olmstead. * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayerTextureMapper::setFilters): Removed unnecessary checking of m_layer.textureMapper(). 2020-10-15 Simon Fraser <simon.fraser@apple.com> Scrolls in the passive event region only send one wheel event to the DOM https://bugs.webkit.org/show_bug.cgi?id=217719 Reviewed by Tim Horton. When we hit the scrolling thread latching codepath, we'd always use { WheelEventProcessingSteps::ScrollingThread } for the steps, but that caused us to not send DOM events. Latching has to store the steps from when latching occurs (we should not re-hit-test to get the region state on every event), so fix up ScrollingTreeLatchingController to do that. Test: fast/scrolling/latching/latched-scroll-in-passive-region.html * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::determineWheelEventProcessing): (WebCore::ScrollingTree::handleWheelEvent): (WebCore::ScrollingTree::handleWheelEventWithNode): * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeLatchingController.cpp: (WebCore::ScrollingTreeLatchingController::receivedWheelEvent): (WebCore::ScrollingTreeLatchingController::latchingDataForEvent const): (WebCore::ScrollingTreeLatchingController::latchedNodeID const): (WebCore::ScrollingTreeLatchingController::latchedNodeAndSteps const): (WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent): (WebCore::ScrollingTreeLatchingController::nodeWasRemoved): (WebCore::ScrollingTreeLatchingController::clearLatchedNode): (WebCore::ScrollingTreeLatchingController::latchedNodeForEvent const): Deleted. * page/scrolling/ScrollingTreeLatchingController.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread): 2020-10-15 Andres Gonzalez <andresg_22@apple.com> Fix for multiple accessibility layout tests in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=217745 Reviewed by Chris Fleizach. Fix for the following tests in accessibility isolated tree mode: accessibility/mac/abbr-acronym-tags.html accessibility/mac/aria-image-emits-object-replacement.html accessibility/mac/attributed-string-includes-highlighting.html accessibility/mac/attributed-string/attributed-string-for-range-with-options.html accessibility/mac/attributed-string/attributed-string-for-range.html accessibility/mac/character-offset-visible-position-conversion-with-emoji.html accessibility/mac/element-for-text-marker.html accessibility/mac/listmarker-suffix.html accessibility/mac/media-emits-object-replacement.html accessibility/mac/stale-textmarker-crash.html accessibility/mac/string-range-contains-listmarker.html accessibility/mac/text-marker-for-index.html accessibility/mac/text-marker-length.html accessibility/mac/text-marker-paragraph-nav.html accessibility/mac/text-marker-range-for-node-without-children.html accessibility/mac/text-marker-sentence-nav.html accessibility/mac/text-marker-word-nav-collapsed-whitespace.html accessibility/mac/text-marker-word-nav.html accessibility/mac/text-markers-for-input-with-placeholder.html accessibility/mac/webkit-scrollarea-position.html accessibility/text-marker/text-marker-previous-next.html accessibility/text-marker/text-marker-range-stale-node-crash.html accessibility/text-marker/text-marker-range-with-removed-node-crash.html accessibility/text-marker/text-marker-with-user-select-none.html * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::convertFrameToSpace const): (WebCore::AXIsolatedObject::elementRange const): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper position]): 2020-10-15 Chris Dumez <cdumez@apple.com> Vectorize StereoPanner's panToTargetValue() https://bugs.webkit.org/show_bug.cgi?id=217765 Reviewed by Geoffrey Garen. Vectorize StereoPanner's panToTargetValue(). No new tests, no Web-facing behavior change. * platform/audio/StereoPanner.cpp: (WebCore::StereoPanner::panToTargetValue): * platform/audio/VectorMath.cpp: (WebCore::VectorMath::multiplyByScalar): (WebCore::VectorMath::multiplyByScalarThenAddToOutput): (WebCore::VectorMath::multiplyByScalarThenAddToVector): * platform/audio/VectorMath.h: 2020-10-15 Chris Lord <clord@igalia.com> [GTK][WPE] Add support for smooth scrolling animation with async scrolling https://bugs.webkit.org/show_bug.cgi?id=210382 Reviewed by Carlos Garcia Campos. Respect smooth-scrolling setting and fix deadlock issues with async scrolling on nicosia path. No new tests, no functional change. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::scrollAnimatorEnabled const): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::ThreadedScrollingTree): * page/scrolling/ThreadedScrollingTree.h: (WebCore::ThreadedScrollingTree::scrollAnimatorEnabled const): * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeFrameScrollingNodeNicosia::ScrollingTreeFrameScrollingNodeNicosia): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::ensureScrollAnimationKinetic): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::ensureScrollAnimationSmooth): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::stopScrollAnimations): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionRelatedLayers): * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::ScrollingTreeOverflowScrollingNodeNicosia): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::commitStateAfterChildren): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::repositionScrollingLayers): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::ensureScrollAnimationKinetic): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::ensureScrollAnimationSmooth): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::stopScrollAnimations): * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h: * platform/PlatformWheelEvent.h: * platform/ScrollAnimation.h: * platform/ScrollAnimationKinetic.cpp: (WebCore::ScrollAnimationKinetic::isActive const): * platform/ScrollAnimationKinetic.h: * platform/ScrollAnimationSmooth.cpp: (WebCore::ScrollAnimationSmooth::scroll): (WebCore::ScrollAnimationSmooth::isActive const): * platform/ScrollAnimationSmooth.h: * platform/generic/ScrollAnimatorGeneric.cpp: (WebCore::ScrollAnimatorGeneric::ensureSmoothScrollingAnimation): 2020-10-15 Youenn Fablet <youenn@apple.com> Introduce a RemoteAudioSourceProvider to receive audio samples for web audio from GPUProcess https://bugs.webkit.org/show_bug.cgi?id=217710 Reviewed by Eric Carlson. Split WebAudioSourceProviderAVFObjC MediaStreamTrack specific bits in a separate MediaStreamTrackAudioSourceProviderAVFObjC class. This allows reusing WebAudioSourceProviderAVFObjC for samples coming from audio playback living in GPUProcess. No change of behavior. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/cocoa/AudioSampleBufferList.cpp: * platform/audio/cocoa/AudioSampleBufferList.h: * platform/audio/cocoa/AudioSampleDataSource.h: * platform/audio/cocoa/AudioSampleDataSource.mm: * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::audioSourceProvider): * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/WebAudioSourceProvider.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: * platform/mediastream/mac/MediaStreamTrackAudioSourceProviderCocoa.cpp: Added. (WebCore::MediaStreamTrackAudioSourceProviderCocoa::create): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::MediaStreamTrackAudioSourceProviderCocoa): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::~MediaStreamTrackAudioSourceProviderCocoa): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::hasNewClient): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::trackEnabledChanged): (WebCore::MediaStreamTrackAudioSourceProviderCocoa::audioSamplesAvailable): * platform/mediastream/mac/MediaStreamTrackAudioSourceProviderCocoa.h: Added. * platform/mediastream/mac/MockAudioSharedUnit.h: * platform/mediastream/mac/MockAudioSharedUnit.mm: * platform/mediastream/mac/WebAudioSourceProviderCocoa.h: Renamed from Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h. * platform/mediastream/mac/WebAudioSourceProviderCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm. (WebCore::WebAudioSourceProviderCocoa::WebAudioSourceProviderCocoa): (WebCore::WebAudioSourceProviderCocoa::~WebAudioSourceProviderCocoa): (WebCore::WebAudioSourceProviderCocoa::setClient): (WebCore::WebAudioSourceProviderCocoa::provideInput): (WebCore::WebAudioSourceProviderCocoa::prepare): (WebCore::WebAudioSourceProviderCocoa::receivedNewAudioSamples): 2020-10-15 Antti Koivisto <antti@apple.com> Remove <br> render tree dump quirk https://bugs.webkit.org/show_bug.cgi?id=209813 Reviewed by Zalan Bujtas. Stop lying about <br> box dimensions. * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::PathRun::baseline const): Deleted. (WebCore::LayoutIntegration::PathRun::useLineBreakBoxRenderTreeDumpQuirk const): Deleted. * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: (WebCore::LayoutIntegration::RunIteratorLegacyPath::isLineBreak const): (WebCore::LayoutIntegration::RunIteratorLegacyPath::baseline const): Deleted. (WebCore::LayoutIntegration::RunIteratorLegacyPath::useLineBreakBoxRenderTreeDumpQuirk const): Deleted. * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::baseline const): Deleted. (WebCore::LayoutIntegration::RunIteratorModernPath::useLineBreakBoxRenderTreeDumpQuirk const): Deleted. * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::boundingBoxForRenderTreeDump const): Deleted. * rendering/RenderLineBreak.h: * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): 2020-10-15 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes, mid October 2020, take two https://bugs.webkit.org/show_bug.cgi?id=217734 Unreviewed build fix. No new tests needed. * Modules/webaudio/AudioWorklet.cpp: Add missing AudioWorkletProcessor.h header. * Modules/webaudio/AudioWorkletGlobalScope.cpp: Add missing BaseAudioContext.h header. * Modules/webaudio/AudioWorkletNode.cpp: Add missing AudioParamDescriptor.h header. * Modules/webaudio/AudioWorkletNode.h: Add missing forward declaration for the JSC::JSGlobalObject type. * workers/WorkerRunLoop.cpp: Add missing JavaScriptCore/JSRunLoopTimer.h header, move inclusion of WorkerRunLoop.h header up to please the style checker. 2020-10-14 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] flex-grow property should be animatable https://bugs.webkit.org/show_bug.cgi?id=209872 Reviewed by Antoine Quint. Make flew-grow animatable as per spec. This allows us to pass a bunch of flexbox animation subtests. * animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Add the wrapper for flex-grow. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setFlexGrow): Clamp flex-grow to 0 as negative values are invalid. 2020-10-14 Chris Dumez <cdumez@apple.com> Rename VectorMath::multiplyThenAddScalar() for clarity https://bugs.webkit.org/show_bug.cgi?id=217744 Reviewed by Darin Adler. Rename VectorMath::multiplyThenAddScalar() to VectorMath::multiplyByScalarThenAddToOutput() for clarity. The previous name was a bit confusing and hopefully the new name makes it clearer what the function actually does. If not, I also improved the comment next to the function. * platform/audio/AudioBus.cpp: (WebCore::AudioBus::speakersSumFromByDownMixing): * platform/audio/VectorMath.cpp: (WebCore::VectorMath::multiplyByScalarThenAddToOutput): * platform/audio/VectorMath.h: 2020-10-14 Chris Dumez <cdumez@apple.com> Vectorize downmixing in AudioBus::createByMixingToMono() https://bugs.webkit.org/show_bug.cgi?id=217743 Reviewed by Darin Adler. Vectorize downmixing in AudioBus::createByMixingToMono(). No new tests, no Web-facing behavior change. * platform/audio/AudioBus.cpp: (WebCore::AudioBus::createByMixingToMono): * platform/audio/VectorMath.cpp: (WebCore::VectorMath::addVectorsThenMultiplyByScalar): * platform/audio/VectorMath.h: 2020-10-14 James Darpinian <jdarpinian@chromium.org> Unity RubysAdventure demo does not render properly if WebGL2 is enabled. https://bugs.webkit.org/show_bug.cgi?id=215846 Reviewed by Kenneth Russell. uniform*v srcLength parameter needs to be divided by the uniform component size before passing to OpenGL's count parameter. Test: webgl/conformance2/uniforms/gl-uniform-arrays-sub-source.html * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::uniform2uiv): (WebCore::WebGL2RenderingContext::uniform3uiv): (WebCore::WebGL2RenderingContext::uniform4uiv): (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv): (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv): (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv): (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv): (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv): (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv): (WebCore::WebGL2RenderingContext::uniform2fv): (WebCore::WebGL2RenderingContext::uniform3fv): (WebCore::WebGL2RenderingContext::uniform4fv): (WebCore::WebGL2RenderingContext::uniform2iv): (WebCore::WebGL2RenderingContext::uniform3iv): (WebCore::WebGL2RenderingContext::uniform4iv): (WebCore::WebGL2RenderingContext::uniformMatrix2fv): (WebCore::WebGL2RenderingContext::uniformMatrix3fv): (WebCore::WebGL2RenderingContext::uniformMatrix4fv): 2020-10-14 Andres Gonzalez <andresg_22@apple.com> Support AXCoreObject::elementPath for text elements. https://bugs.webkit.org/show_bug.cgi?id=215206 Reviewed by Chris Fleizach. Test: accessibility/text-element-path.html Text elements now support returning a Path in those cases where the element consists of the last part of a line and the beginning of the next line. Heuristics were added to avoid to compute the element Path for those cases in which the bounding rectangle is suitable. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::supportsPath const): (WebCore::AccessibilityRenderObject::elementPath const): 2020-10-14 Alexey Shvayka <shvaikalesh@gmail.com> Use @putByValDirect instead of Array.prototype.@push in built-ins https://bugs.webkit.org/show_bug.cgi?id=175432 Reviewed by Yusuke Suzuki. Use @arrayPush() intrinsic instead of Array.prototype.@push. No new tests, no behavior change. * Modules/streams/ReadableByteStreamInternals.js: (readableByteStreamControllerPull): (readableByteStreamControllerEnqueueChunk): (readableByteStreamControllerPullInto): (readableStreamAddReadIntoRequest): * Modules/streams/ReadableStreamInternals.js: (readableStreamAddReadRequest): * Modules/streams/StreamInternals.js: (enqueueValueWithSize): * Modules/streams/WritableStreamInternals.js: (writableStreamAddWriteRequest): 2020-10-14 Don Olmstead <don.olmstead@sony.com> Non-unified build fixes, mid October 2020 https://bugs.webkit.org/show_bug.cgi?id=217721 Reviewed by Yusuke Suzuki. * Modules/webgpu/WebGPUShaderModule.h: * html/canvas/EXTTextureCompressionRGTC.cpp: * layout/floats/FloatingContext.cpp: * layout/floats/FloatingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: * layout/inlineformatting/InlineLine.cpp: * platform/graphics/gpu/GPUDevice.cpp: * rendering/RenderReplaced.cpp: * workers/WorkerRunLoop.cpp: 2020-10-14 Megan Gardner <megan_gardner@apple.com> Refactor HighlightData https://bugs.webkit.org/show_bug.cgi?id=217711 Reviewed by Darin Adler. HighlightData was renamed when it was used for more that selections, but more than half the file was only supposed to be used to deal with the current selection, so I've split it back out into a more reasonable set of files. Also made offsets no longer optional, as there doesn't seem to be a need. Extended the HighlightData setRenderRange into InlineTextBox, as it's a better way to calculate that does not use deprecated functions. No behavior change. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * editing/FrameSelection.cpp: (WebCore::FrameSelection::setNeedsSelectionUpdate): (WebCore::DragCaretController::nodeWillBeRemoved): (WebCore::FrameSelection::respondToNodeModification): (WebCore::FrameSelection::willBeRemovedFromFrame): (WebCore::FrameSelection::focusedOrActiveStateChanged): (WebCore::FrameSelection::updateAppearance): * page/FrameView.cpp: (WebCore::FrameView::paintContentsForSnapshot): * platform/DragImage.cpp: (WebCore::ScopedFrameSelectionState::~ScopedFrameSelectionState): (WebCore::createDragImageForRange): * rendering/HighlightData.cpp: (WebCore::RenderRangeIterator::RenderRangeIterator): (WebCore::RenderRangeIterator::current const): (WebCore::RenderRangeIterator::next): (WebCore::RenderRangeIterator::checkForSpanner): (WebCore::rendererAfterOffset): (WebCore::HighlightData::highlightStateForRenderer): (): Deleted. (WebCore::isValidRendererForSelection): Deleted. (WebCore::containingBlockBelowView): Deleted. (WebCore::collectSelectionData): Deleted. (WebCore::HighlightData::HighlightData): Deleted. (WebCore::HighlightData::setSelection): Deleted. (WebCore::HighlightData::clearSelection): Deleted. (WebCore::HighlightData::repaintSelection const): Deleted. (WebCore::HighlightData::collectBounds const): Deleted. (WebCore::HighlightData::applySelection): Deleted. * rendering/HighlightData.h: (WebCore::RenderRange::RenderRange): (WebCore::RenderRange::start const): (WebCore::RenderRange::end const): (WebCore::RenderRange::startOffset const): (WebCore::RenderRange::endOffset const): (WebCore::RenderRange::operator== const): (WebCore::HighlightData::startOffset const): (WebCore::HighlightData::endOffset const): (WebCore::HighlightData::RenderRange::RenderRange): Deleted. (WebCore::HighlightData::RenderRange::start const): Deleted. (WebCore::HighlightData::RenderRange::end const): Deleted. (WebCore::HighlightData::RenderRange::startOffset const): Deleted. (WebCore::HighlightData::RenderRange::endOffset const): Deleted. (WebCore::HighlightData::RenderRange::operator== const): Deleted. (WebCore::HighlightData::bounds const): Deleted. (WebCore::HighlightData::boundsClippedToVisibleContent const): Deleted. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::collectMarkedTextsForHighlights const): * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::calculateHighlightColor const): * rendering/RenderView.h: * rendering/SelectionRangeData.cpp: Copied from Source/WebCore/rendering/HighlightData.cpp. (WebCore::rendererAfterOffset): (WebCore::isValidRendererForSelection): (WebCore::containingBlockBelowView): (WebCore::collectSelectionData): (WebCore::SelectionRangeData::SelectionData): (WebCore::SelectionRangeData::set): (WebCore::SelectionRangeData::clear): (WebCore::SelectionRangeData::repaint const): (WebCore::SelectionRangeData::collectBounds const): (WebCore::SelectionRangeData::apply): * rendering/SelectionRangeData.h: Added. (WebCore::SelectionRangeData::bounds const): (WebCore::SelectionRangeData::boundsClippedToVisibleContent const): 2020-10-14 Antoine Quint <graouts@webkit.org> Simplify management of LayerPropertyAnimation instances in GraphicsLayerCA https://bugs.webkit.org/show_bug.cgi?id=217707 <rdar://problem/70291140> Reviewed by Dean Jackson. The management of LayerPropertyAnimation instances in GraphicsLayerCA spread those animations between different data structures. We now simplify this to be a single Vector<LayerPropertyAnimation> with three new properties. The m_playState property indicates: - whether the animation has been added to the list but awaiting the next commit to be played (PlayPending) - whether the animation has been committed and playing (Playing) - whether the animation has been marked to be paused but awaiting the next commit to be paused (PausePending) - whether the animation has been committed and paused (Paused) The m_pendingRemoval property indicates whether the animation has been marked for removal upon the next commit. The m_beginTime property indicates the time at which the animation was first added, ensuring that the animation can be removed and re-added while preserving the same begin time. As such, when GraphicsLayerCA::updateAnimations() is called we remove all animations from the layer, filter m_animations to only have animations that are not marked as pending removal, and add the now-current list of animations to the layer. No new test since this change is refactoring only and should not have any change in behavior. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::moveOrCopyAnimations): (WebCore::GraphicsLayerCA::animationIsRunning const): (WebCore::animationCanBeAccelerated): (WebCore::GraphicsLayerCA::pauseAnimation): (WebCore::GraphicsLayerCA::removeAnimation): (WebCore::GraphicsLayerCA::platformCALayerAnimationStarted): (WebCore::GraphicsLayerCA::updateAnimations): (WebCore::GraphicsLayerCA::isRunningTransformAnimation const): (WebCore::GraphicsLayerCA::setAnimationOnLayer): (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer): (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer): (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): (WebCore::animationIdentifier): Deleted. (WebCore::GraphicsLayerCA::animationCanBeAccelerated const): Deleted. (WebCore::GraphicsLayerCA::addProcessingActionForAnimation): Deleted. (WebCore::GraphicsLayerCA::ensureLayerAnimations): Deleted. * platform/graphics/ca/GraphicsLayerCA.h: (WebCore::GraphicsLayerCA::hasAnimations const): (WebCore::GraphicsLayerCA::LayerPropertyAnimation::animationIdentifier const): (WebCore::GraphicsLayerCA::moveAnimations): (WebCore::GraphicsLayerCA::copyAnimations): (WebCore::GraphicsLayerCA::animationIsRunning const): Deleted. (WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction): Deleted. 2020-10-14 Youenn Fablet <youenn@apple.com> MediaRecorder .stop should not throw in Inactive state https://bugs.webkit.org/show_bug.cgi?id=217705 Reviewed by Eric Carlson. Update according spec changes in https://github.com/w3c/mediacapture-record/pull/158. stop no longer throws if media recorder is inactive. Covered by updated test. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::stopRecording): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: 2020-10-13 Simon Fraser <simon.fraser@apple.com> Allow passive mouse wheel event listeners to not force synchronous scrolling https://bugs.webkit.org/show_bug.cgi?id=158439 <rdar://problem/28265360> Reviewed by Tim Horton. Turn on ENABLE_WHEEL_EVENT_REGIONS for macOS, and hit-test the passive and active regions in ScrollingTree::determineWheelEventProcessin() to determine whether scrolling needs to happen on the main thread, communicating via WheelEventProcessingSteps. Now that we use EventRegion to store wheel event region information, we no longer need to consult wheel event targets im ScrollingCoordinator::absoluteEventTrackingRegionsForFrame(), but the non-fast region does still contain rectangles for non-fast-scrollable overflow if async overflow scrolling is disabled. Frame::invalidateContentEventRegionsIfNeeded() needs a fix to ensure that when wheel event handlers in non-fast-scrollable subframes change we invalidate event regions. Finally, when the processing steps given to EventHandler::handleWheelEvent() do not include MainThreadForScrolling, then we shouldn't scroll here. The check in EventHandler::handleWheelEvent() applies to frames, and the one in EventHandler::defaultWheelEventHandler() applies to overflow:scroll. Test: fast/scrolling/mac/slow-scrolling-overflow.html * page/EventHandler.cpp: (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::defaultWheelEventHandler): * page/Frame.cpp: (WebCore::Frame::invalidateContentEventRegionsIfNeeded): * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::determineWheelEventProcessing): 2020-10-14 Devin Rousso <drousso@apple.com> Web Inspector: REGRESSION(r267148): new Big Sur styles are not used https://bugs.webkit.org/show_bug.cgi?id=217682 <rdar://problem/70269030> Reviewed by Brian Burg. r267148 changed `navigator.userAgent` from `11_0` to `10_15_7`. This breaks Web Inspector styling, which relied on this value to know what OS version it was running on in order to know which styles to use. * inspector/InspectorFrontendHost.idl: * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::platformVersionName const): Added. Derive a lowercased kekab-cased platform version name from `__MAC_OS_X_VERSION_MIN_REQUIRED`. 2020-10-14 Zalan Bujtas <zalan@apple.com> [LFC] Use the term overridden instead of override to indicate priority values https://bugs.webkit.org/show_bug.cgi?id=217657 Reviewed by Antti Koivisto. The OverriddenHorizontal/Vertical structures are used to pass in priority values (e.g. use the "max-height" value instead of the computed "height" value) to geometry computation functions. * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases const): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin const): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry const): (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin const): (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): * layout/LayoutUnits.h: * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h: * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContextQuirks.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::Quirks::overriddenTableHeight const): (WebCore::Layout::TableWrapperBlockFormattingContext::Quirks::overrideTableHeight const): Deleted. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin): (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const): 2020-10-14 Andres Gonzalez <andresg_22@apple.com> [ macOS ] accessibility/mac/select-element-selection-with-optgroups.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=215649 <rdar://problem/67406148> Reviewed by Chris Fleizach. Test: accessibility/mac/select-element-selection-with-optgroups.html. Fix this test by using Promises and waiting for the correct events. No longer flaky. Also fixed the test in isolated tree mode, for which several changes detailed below were necessary. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::objectsForIDs const): Added this utility method to retrieve a Vector of AX objects given their IDs. * accessibility/AXObjectCache.h: * accessibility/AccessibilityListBox.cpp: (WebCore::AccessibilityListBox::canSetSelectedChildren const): (WebCore::AccessibilityListBox::setSelectedChildren): (WebCore::AccessibilityListBox::canSetSelectedChildrenAttribute const): Became canSetSelectedChildren since Attribute was unnecessary and misleading. * accessibility/AccessibilityListBox.h: * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: (WebCore::AXCoreObject::setSelectedChildren): Exposes this functionality in the base class so that it is accessible for AX and isolated objects. (WebCore::AXCoreObject::isNativeListBox const): Deleted. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): (WebCore::AXIsolatedObject::setSelectedChildren): Implements this functionality by forwarding to the main thread and retrieving the correspodning AX objects. (WebCore::AXIsolatedObject::isAccessibilityListBoxInstance const): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::objectsForIDs const): (WebCore::AXIsolatedTree::idsForObjects const): * accessibility/isolatedtree/AXIsolatedTree.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]): (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]): Instead of special casing AccessibilityListBox class, it allows to set selected children for all objects that canSetSelectedChildren. Eliminates the downcast that does not work for isolated objects. 2020-10-14 Zan Dobersek <zdobersek@igalia.com> Remove ACCELERATED_2D_CANVAS build flags and guarded code https://bugs.webkit.org/show_bug.cgi?id=217603 Reviewed by Carlos Garcia Campos. Remove code guarded by the ACCELERATED_2D_CANVAS build guard, along with related build system cruft. This feature was only implemented for Cairo, and even then was using an experimental GL-oriented backend of Cairo that was not providing necessarily better performance or experience and is not seeing further development. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createContext2d): (WebCore::HTMLCanvasElement::createContextBitmapRenderer): (WebCore::HTMLCanvasElement::shouldAccelerate const): (WebCore::HTMLCanvasElement::createImageBuffer const): * html/ImageBitmap.cpp: * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::isAccelerated const): (WebCore::CanvasRenderingContext2DBase::drawImage): (WebCore::CanvasRenderingContext2DBase::createPattern): (WebCore::CanvasRenderingContext2DBase::didDraw): (WebCore::CanvasRenderingContext2DBase::platformLayer const): Deleted. * html/canvas/CanvasRenderingContext2DBase.h: * html/canvas/ImageBitmapRenderingContext.cpp: * platform/Cairo.cmake: * platform/SourcesCairo.txt: * platform/graphics/GLContext.h: * platform/graphics/PlatformImageBuffer.h: * platform/graphics/cairo/CairoUtilities.cpp: (WebCore::cairoSurfaceSize): * platform/graphics/cairo/ImageBufferCairoGLSurfaceBackend.cpp: Removed. * platform/graphics/cairo/ImageBufferCairoGLSurfaceBackend.h: Removed. * platform/graphics/egl/GLContextEGL.cpp: (WebCore::GLContextEGL::~GLContextEGL): (WebCore::GLContextEGL::cairoDevice): Deleted. * platform/graphics/egl/GLContextEGL.h: * platform/graphics/glx/GLContextGLX.cpp: (WebCore::GLContextGLX::~GLContextGLX): (WebCore::GLContextGLX::cairoDevice): Deleted. * platform/graphics/glx/GLContextGLX.h: * platform/graphics/gpu/Texture.cpp: Removed. * platform/graphics/gpu/Texture.h: Removed. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::nativeImageForCurrentTime): * rendering/RenderLayerBacking.cpp: (WebCore::canvasCompositingStrategy): (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::containsPaintedContent const): (WebCore::RenderLayerBacking::contentChanged): 2020-10-14 Kimmo Kinnunen <kkinnunen@apple.com> REGRESSION: fast/canvas/webgl/context-attributes-alpha.html fails https://bugs.webkit.org/show_bug.cgi?id=217697 Reviewed by Antti Koivisto. The original work in "Cocoa: Make WebGLLayer not dependent on GraphicsContextGLOpenGL" was missing the hunk to initialize WebGLLayer contentsOpaque. Neither the EWS nor the local testing used the test case. No new tests, tested by fast/canvas/webgl/context-attributes-alpha.html. * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): * platform/graphics/cocoa/WebGLLayer.h: * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer initWithClient:devicePixelRatio:contentsOpaque:]): (-[WebGLLayer initWithClient:devicePixelRatio:]): Deleted. 2020-10-13 Antoine Quint <graouts@webkit.org> transform-origin is applied on top of invidivual CSS transform properties on composited layers https://bugs.webkit.org/show_bug.cgi?id=217661 <rdar://problem/70259960> Reviewed by Simon Fraser. Ensure that transform origin is only applied when the RenderStyle::applyTransform() call site would opt into it. This caused the call under RenderLayerBacking::updateTransform() to apply the transform origin even though the resulting CALayer already relies on the anchorPoint property. Tests: transforms/2d/rotate-composited.html transforms/2d/scale-composited.html transforms/2d/translate-composited.html * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::applyTransform const): (WebCore::requireTransformOrigin): Deleted. 2020-10-13 Megan Gardner <megan_gardner@apple.com> Paint CSS highlights over images https://bugs.webkit.org/show_bug.cgi?id=217417 <rdar://problem/58459054> Reviewed by Darin Adler. Add support to paint CSS pseudo highlights over images that are in the range of the defined highlight. Test: http/wpt/css/css-highlight-api/highlight-image.html * rendering/HighlightData.cpp: (WebCore::HighlightData::highlightStateForRenderer): * rendering/HighlightData.h: * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::potentialHighlightColor const): (WebCore::RenderReplaced::paint): * rendering/RenderReplaced.h: 2020-10-13 Sam Weinig <weinig@apple.com> [WebIDL] Add support for identifiers with dashes ('-') https://bugs.webkit.org/show_bug.cgi?id=217667 Reviewed by Darin Adler. To support CSSStyleDeclaration.idl correctly, we need to add support for dashes ('-') in WebIDL identifers. * bindings/scripts/IDLParser.pm: Update identifer regular expression to match current spec which allows for dashes ('-'). * bindings/scripts/CodeGeneratorJS.pm: (MangleAttributeOrFunctionName): Helper to centralize mangling required to construct valid c++ identifiers from the WebIDL identifiers, since now WebIDL identifiers can contain dashes ('-'), which is not valid in c++. For now, we use a very simple mangling which replaces all dashes ('-') with the string "_dash_". (GetAttributeGetterName): (GetAttributeSetterName): (GetFunctionName): Clarify and cleanup logic a bit and call the new mangler. (GenerateImplementation): GetAttributeGetterName will now always use the $className, so this caller needs to actually pass the right value in. Previously, the $generatorName it passed in was not actually used. Also removes some duplicate definitions of $interfaceName. * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/TestObj.idl: Adds tests for various combinations of underscores and dashes in identifiers. 2020-10-13 Chris Dumez <cdumez@apple.com> Simplify AudioNode::checkNumberOfChannelsForInput() https://bugs.webkit.org/show_bug.cgi?id=217674 Reviewed by Geoffrey Garen. Simplify AudioNode::checkNumberOfChannelsForInput() by simply calling updateInternalBus() on the input in release. We only iterate m_inputs in debug to make sure this is an input associated with this node. * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::checkNumberOfChannelsForInput): 2020-10-13 Chris Dumez <cdumez@apple.com> It should be possible to create an AudioWorkletNode for a context that has finished rendering https://bugs.webkit.org/show_bug.cgi?id=217666 Reviewed by Eric Carlson. It should be possible to create an AudioWorkletNode for a context that has finished rendering. We were previously throwing an exception when trying to create an AudioWorkletNode for a context whose state is "closed" (OfflineAudioContext's state becomes closed as soon as rendering finishes). This was causing us to fail a WPT test and did not match Blink's behavior. No new tests, rebaselined existing test. * Modules/webaudio/AudioWorkletNode.cpp: (WebCore::AudioWorkletNode::create): 2020-10-13 Chris Dumez <cdumez@apple.com> WebAudio tests are crashing in debug when enabling the GPU process https://bugs.webkit.org/show_bug.cgi?id=217663 Reviewed by Geoff Garen. No new tests, unskipped existing tests. * WebCore.xcodeproj/project.pbxproj: * platform/audio/PushPullFIFO.h: Export PushPullFIFO so that it can be used at WebKit layer. 2020-10-13 Keith Rollin <krollin@apple.com> Remove leftover MACOSX_DEPLOYMENT_TARGET_macosx support https://bugs.webkit.org/show_bug.cgi?id=217649 <rdar://problem/70236877> Reviewed by Darin Adler. Bug 42796 introduced MACOSX_DEPLOYMENT_TARGET_<PLATFORM> as "support for compiling WebKit against iOS SDKs". Support for the iOS part of this feature was later removed in several changes, including Bug 139212, Bug 139463 and Bug 144762. However, vestiges have remained for five or six years in the form of MACOSX_DEPLOYMENT_TARGET_macosx. The inclusion of the platform in MACOSX_DEPLOYMENT_TARGET is no longer needed and can be removed. This changes brings most projects in conformance with other projects that don't support including the platform in MACOSX_DEPLOYMENT_TARGET, including WebEditingTester, gtest, WebKitTestRunner, MiniBrowser, and TestWebKitAPI. Along the way, remove a couple of left-over references to macOS 10.16, and a couple of places where [sdk=macosx*] was still being used. With this change, initialization of MACOSX_DEPLOYMENT_TARGET should be consistent across all projects, with two exceptions: WebKitLauncher (which hardcodes it to 10.12) and libwebrtc's copy of googletest (which hardcodes it to 10.4). The reasons for these hard-coded values is not apparent, so leave them be. No new tests -- no changed functionality. * Configurations/DebugRelease.xcconfig: 2020-10-13 Simon Fraser <simon.fraser@apple.com> Plumb OptionSet<WheelEventProcessingSteps> through the wheel event handling code https://bugs.webkit.org/show_bug.cgi?id=217660 Reviewed by Tim Horton. Async scrolling in passive wheel event regions will require that the main thread event handling code knows that the scrolling thread did the scrolling. To propagate this information, plumb OptionSet<WheelEventProcessingSteps> through. No behavior change. * page/EventHandler.cpp: (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::passWheelEventToWidget): * page/EventHandler.h: * page/ios/EventHandlerIOS.mm: (WebCore::EventHandler::wheelEvent): (WebCore::EventHandler::passWheelEventToWidget): * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::wheelEvent): (WebCore::EventHandler::passWheelEventToWidget): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::determineWheelEventProcessing): (WebCore::ScrollingTree::handleWheelEvent): * page/scrolling/ScrollingTree.h: (WebCore::WheelEventHandlingResult::handled): (WebCore::WheelEventHandlingResult::unhandled): (WebCore::ScrollingTree::handleWheelEvent): * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::handleWheelEvent): * page/scrolling/ThreadedScrollingTree.h: * platform/PlatformWheelEvent.cpp: (WebCore::operator<<): * replay/UserInputBridge.cpp: (WebCore::UserInputBridge::handleWheelEvent): * replay/UserInputBridge.h: 2020-10-13 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo][MediaFoundation] Many test cases are timing out by waiting for events https://bugs.webkit.org/show_bug.cgi?id=217463 Reviewed by Don Olmstead. The ended event wasn't dispatched because MediaFoundation winds back currentTime to 0 at the end of play back. The currentTime should keep the position. Added m_sessionEnded to return the duration in currentTime() if m_sessionEnded is true. currentTime() didn't work for audio elements because m_presenter is available only for videos. Use IMFMediaSession::GetClock instead. seek() started play back even if it is paused. Added m_seeking to remember it is seeking and pause the session in onSessionStarted if m_seeking and m_paused are true. Update NetworkState properly. Return NetworkState::FormatError on MF_E_TOPO_CODEC_NOT_FOUND, NetworkState::DecodeError on MEError event. MEError event with MF_E_NOT_INITIALIZED status was dispatch if SetVideoPosition is called while the session is not started. Deffer calling SetVideoPosition to onSessionStarted. * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation): (WebCore::MediaPlayerPrivateMediaFoundation::play): (WebCore::MediaPlayerPrivateMediaFoundation::seeking const): (WebCore::MediaPlayerPrivateMediaFoundation::seek): (WebCore::MediaPlayerPrivateMediaFoundation::currentTime const): (WebCore::MediaPlayerPrivateMediaFoundation::buffered const): (WebCore::MediaPlayerPrivateMediaFoundation::setSize): (WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource): (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent): (WebCore::MediaPlayerPrivateMediaFoundation::updateReadyState): (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet): (WebCore::MediaPlayerPrivateMediaFoundation::onSessionStarted): (WebCore::MediaPlayerPrivateMediaFoundation::onSessionEnded): (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::currentTime): Deleted. * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: 2020-10-13 Chris Dumez <cdumez@apple.com> 'parameters' argument to AudioWorkletProcessor.process() is not spec-compliant https://bugs.webkit.org/show_bug.cgi?id=217637 Reviewed by Darin Adler. 'parameters' argument to AudioWorkletProcessor.process() is not spec-compliant: - https://www.w3.org/TR/webaudio/#dom-audioworkletprocessor-process-inputs-outputs-parameters-parameters Its type should not be a JS Map, as evidenced by how WPT tests use it. We now pass a generic JS Object, as Blink is doing. Also, as per the specification, if no automation is scheduled during the render quantum, the array may have length 1 with the array element being the constant value of the AudioParam for the render quantum. No new tests, rebaselined existing tests. * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::hasSampleAccurateValues): * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::hasValues const): * Modules/webaudio/AudioParamTimeline.h: This is an optimization to avoid calculating sample accurate values if the first timeline event is still in the future. At some point, we should consider improving the logic to do so when all events are in the past, similarly to what Blink is doing. * Modules/webaudio/AudioWorkletNode.cpp: (WebCore::AudioWorkletNode::initializeAudioParameters): Do not initialize memory for the AudioFloatArrays of each AudioParam yet since we won't know until process() is called if size will be 1 or renderQuantumSize and since the size can change dynamically. (WebCore::AudioWorkletNode::process): As per the specification, if there is no timeline event, we pass an array that has length 1 and whose element is the constant value. * Modules/webaudio/AudioWorkletProcessor.cpp: (WebCore::constructFrozenKeyValueObject): (WebCore::AudioWorkletProcessor::process): Instead of passing the parameters as a JS map, we now use a simple frozen object. We also make sure the Float32Array we pass JS has length 1 if the input array constains a constant value. This behavior is consistent with what Blink is doing. * Modules/webaudio/DelayDSPKernel.cpp: (WebCore::DelayDSPKernel::DelayDSPKernel): * Modules/webaudio/RealtimeAnalyser.cpp: (WebCore::RealtimeAnalyser::setFftSize): * platform/audio/AudioArray.h: (WebCore::AudioArray::AudioArray): (WebCore::AudioArray::resize): (WebCore::AudioArray::at): (WebCore::AudioArray::zero): (WebCore::AudioArray::zeroRange): (WebCore::AudioArray::copyToRange): (WebCore::AudioArray::containsConstantValue const): * platform/audio/Biquad.cpp: (WebCore::Biquad::Biquad): * platform/audio/ReverbConvolverStage.cpp: (WebCore::ReverbConvolverStage::ReverbConvolverStage): * platform/audio/ios/AudioFileReaderIOS.cpp: (WebCore::AudioFileReader::createBus): * platform/audio/mac/AudioFileReaderMac.cpp: (WebCore::AudioFileReader::createBus): Rename AudioArray::allocate() to AudioArray::resize() for clarity since it can be called multiple times after construction of the AudioArray. Make it a no-op if the new size is the same as the old one. Also add a utility function to check if the array constains a constant value. 2020-10-13 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Introduce InlineLevelBox::LineBreakBox and GenericInlineLevelBox https://bugs.webkit.org/show_bug.cgi?id=217646 Reviewed by Antti Koivisto. This is in preparation for adding support for https://www.w3.org/TR/css-inline-3/#layout-bounds. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): Cleaning up a bit and moving adjustVerticalGeometryForNonEmptyInlineBox to a dedicated function. constructInlineLevelBoxes was getting a bit too busy. * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::InlineLevelBox::InlineLevelBox): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineLevelBox::createRootInlineBox): (WebCore::Layout::LineBox::InlineLevelBox::createAtomicInlineLevelBox): (WebCore::Layout::LineBox::InlineLevelBox::createInlineBox): (WebCore::Layout::LineBox::InlineLevelBox::createLineBreakBox): (WebCore::Layout::LineBox::InlineLevelBox::createGenericInlineLevelBox): 2020-10-13 Youenn Fablet <youenn@apple.com> Webcam video from navigator.mediaDevices.getUserMedia() to 2D canvas fails on Safari on iPhone https://bugs.webkit.org/show_bug.cgi?id=217578 <rdar://problem/70183875> Reviewed by Eric Carlson. It is unneeded for MediaStream video backends to enqueue samples to the display layer if the video element is hidden. In iOS, the samples may never be flushed which might cause capture failing after enqueuing too many camera samples. To avoid that, we no longer enqueue samples to the display layer when the player is not visible. In case of canvas painting, other backends need to be made visible for canvas painting to work. For MediaStream backend, we do not need that since we always keep the last sample. For that reason, we keep the backend as not visible even if canvas happens. We do so by introducing a setVisibleForCanvas that is a no-op for MediaStream backend and similar to setVisible for other backends. For good measure, we now flush the MediaStream display layer whenever visibility changed. Manually tested. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::paintCurrentFrameInContext): * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::setVisibleForCanvas): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::setVisibleForCanvas): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVisible): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVisibleForCanvas): 2020-10-13 Youenn Fablet <youenn@apple.com> Improve computation of default audio input and output devices https://bugs.webkit.org/show_bug.cgi?id=217652 <rdar://problem/69857857> Reviewed by Eric Carlson. Add support for computation of the default audio output device. Fix a bug in the computation of the default device on the first call to refreshAudioCaptureDevices. Refactor the code as follows to make it easier to read: - for each case we want to refresh devices, compute a Vector of audio devices, first microphones, then speakers. - make sure to put in that list the default microphone first in the list and the default speaker just after the last microphone in the list. - check whether the list is equal to the current list of audio devices. If it is equal, abort. - update microphone and speaker lists and send notification of device change. Minor refactoring to make CoreAudioCaptureDevice isAlive a private method. Manually tested. * platform/mediastream/mac/CoreAudioCaptureDevice.cpp: (WebCore::CoreAudioCaptureDevice::CoreAudioCaptureDevice): * platform/mediastream/mac/CoreAudioCaptureDevice.h: * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: (WebCore::getDefaultCaptureOutputDevice): (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices): (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices): 2020-10-13 Michael Catanzaro <mcatanzaro@gnome.org> [SOUP] webkit_web_view_get_https_status() broken with service workers https://bugs.webkit.org/show_bug.cgi?id=216038 Reviewed by Carlos Garcia Campos. This implements CertificateInfo::isolatedCopy for libsoup ports. This is impossible to do completely, because we cannot copy the private key portion of the GTlsCertificate, because it is a write-only property, because it might be backed by a hardware token and therefore really impossible to write software to get it. If we were to implement g_tls_certificate_copy() in GLib -- which I will probably do eventually, because I need this outside WebKit as well -- then GTlsCertificate implementations could copy the private key or PKCS#11 handle or whatever. But anyway, let not perfect be the enemy of the good. We only need this for service workers currently. (Probably that's all we'll *ever* need it for.) So we are only working with server certificates, and the private portion of the certificate is guaranteed to not exist (because servers don't send us their private keys), and we can just forget about it. As long as nobody tries to copy a client certificate in the future -- where we really would need the private key portion of the certificate -- this will be perfectly fine. Actually copying the certificate is kind of annoying, because a chain of certificates is represented by having the main (server) certificate keep a reference to its issuer, which is not referenced anywhere else, so we have to reconstruct the chain in reverse order starting from the final certificate, working back towards the server cert. Fun. Let's also be careful to construct a completely new GByteArray rather than expecting the GTlsCertificate implementation to copy it for us. Because GTlsCertificate is implemented by an extension point and applications and system administrators can -- and do -- implement their own, implementations could do anything, including keep a reference to the GByteArray that we pass in. It would be nice to have a test for this, but writing tests is hard. Also, I don't really want to learn what service workers are. :) Drive-by fix: also remove explicit from a constructor that doesn't need it. * platform/network/soup/CertificateInfo.h: (WebCore::CertificateInfo::isolatedCopy const): * platform/network/soup/CertificateInfoSoup.cpp: (WebCore::createCertificate): (WebCore::CertificateInfo::isolatedCopy const): 2020-10-13 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Remove fully collapsed trailing run https://bugs.webkit.org/show_bug.cgi?id=217653 Reviewed by Antti Koivisto. We don't attach fully collapsible runs to the line. When Line::appendText sees an inline item that would generate such run (e.g. <div>foobar <span> <span></div> - the inline text item inside the <span> would generate fully collapsed run) it simply ignores it and will not generate a run for it. In this patch when the trailing trimmable run is fully collapsed, we should not only collapse it, but also remove it from the line. Test: fast/layoutformattingcontext/replaced-and-trailing-trimmable-content.html * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::TrimmableTrailingContent::addFullyTrimmableContent): (WebCore::Layout::Line::TrimmableTrailingContent::addPartiallyTrimmableContent): (WebCore::Layout::Line::TrimmableTrailingContent::remove): * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::TrimmableTrailingContent::isEmpty const): (WebCore::Layout::Line::TrimmableTrailingContent::reset): 2020-10-13 Philippe Normand <pnormand@igalia.com> [GStreamer] Crash in WebCore::GStreamerRegistryScanner::isAVC1CodecSupported https://bugs.webkit.org/show_bug.cgi?id=217647 Reviewed by Xabier Rodriguez-Calvar. The registry scanner was assuming the avc1 codec field is always of the form avc1.codecprofile, which is wrong. Covered by test: media/media-can-play-mpeg4-video.html * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::isAVC1CodecSupported const): Check for '.' presence and fallback to unconstrained check if no profile or level information was extracted. 2020-10-13 Adrian Perez de Castro <aperez@igalia.com> [GTK] Make gamepads visible after their first input is received https://bugs.webkit.org/show_bug.cgi?id=217494 Reviewed by Carlos Garcia Campos. Turns out this was mostly working already, with a small caveat: Sometimes there would be a timing issue if m_inputNotificationTimer would be fired before having a chance of setting the m_initialGamepadsConnected flag, and in that case the early return would prevent dispatchPlatformGamepadInputActivity() from ever being called. This re-arms the timer to be fired again in the next event loop iteration if the flag was unset, so it will be checked again after it has been toggled. This same approach is used by HIDGamepadProvider in the Mac port, for example. * platform/gamepad/manette/ManetteGamepadProvider.cpp: (WebCore::ManetteGamepadProvider::inputNotificationTimerFired): Re-arm timer if m_initialGamepadsConnected was not yet set. 2020-10-13 Kimmo Kinnunen <kkinnunen@apple.com> Cocoa: Make WebGLLayer not dependent on GraphicsContextGLOpenGL https://bugs.webkit.org/show_bug.cgi?id=217212 <rdar://problem/69876022> Reviewed by Dean Jackson. WebGLLayer was needlessly using GraphicsContextGLOpenGL. This is problematic because WebGLLayer should work with upcoming remote GraphicsContextGL implementation. The prepare callgraph was: GCGLOpenGL -> WebGLLayer -> GCGLOpenGL Refactor it to be: GCGLOpenGL -> WebGLLayer Move the back buffer ownership to the GraphicsContextGLOpenGL. Make the front buffer ownership explicit in WebGLLayer. Move the EGL bindings ownerships of all buffers to GraphicsContextGLOpenGL. Make the WebGLLayer not use EGL or OpenGL, it does not need and cannot use it as not all of its clients use OpenGL (i.e. the above mentioned remote use-case). Improves the memory usage by not allocating front buffers unless needed. In case the canvas does not present, will not allocate front buffers at all. Improves error handling of the allocations and EGL bindings. No new tests, a refactor. * WebCore.xcodeproj/project.pbxproj: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): (WebCore::GraphicsContextGLOpenGL::prepareTexture): (WebCore::GraphicsContextGLOpenGL::prepareTextureImpl): * platform/graphics/angle/GraphicsContextGLANGLEUtilities.h: Added. (WebCore::ScopedRestoreTextureBinding::ScopedRestoreTextureBinding): (WebCore::ScopedRestoreTextureBinding::~ScopedRestoreTextureBinding): * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::makeContextCurrent): (WebCore::GraphicsContextGLOpenGL::reshapeDisplayBufferBacking): (WebCore::GraphicsContextGLOpenGL::bindDisplayBufferBacking): (WebCore::GraphicsContextGLOpenGL::prepareForDisplay): (WebCore::GraphicsContextGLOpenGL::didDisplay): * platform/graphics/cocoa/WebGLLayer.h: * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer initWithClient:devicePixelRatio:]): (-[WebGLLayer copyImageSnapshotWithColorSpace:]): (-[WebGLLayer recycleBuffer]): (-[WebGLLayer prepareForDisplayWithContents:]): (-[WebGLLayer display]): (-[WebGLLayer detachClient]): * platform/graphics/cocoa/WebGLLayerClient.h: Copied from Source/WebCore/platform/graphics/cocoa/WebGLLayer.h. (WebCore::WebGLLayerClient::~WebGLLayerClient): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp: (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): 2020-10-12 Yusuke Suzuki <ysuzuki@apple.com> JIT operations do not need extern "C" https://bugs.webkit.org/show_bug.cgi?id=217636 Reviewed by Saam Barati. * domjit/DOMJITHelpers.h: * domjit/JSDocumentDOMJIT.cpp: 2020-10-12 Zalan Bujtas <zalan@apple.com> REGRESSION (r268294): [ iOS wk2 ] imported/blink/fast/css/zoomed-intrinsic-width.html is a constant image failure https://bugs.webkit.org/show_bug.cgi?id=217610 <rdar://problem/70207977> Reviewed by Antti Koivisto. InlineTree snaps line boxes to integral values. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): 2020-10-12 Said Abou-Hallawa <sabouhallawa@apple.com> [GPU Process]: Replace "ImageBufferIdentifier" by a generic identifier named "RemoteResourceIdentifier" https://bugs.webkit.org/show_bug.cgi?id=217550 Reviewed by Simon Fraser. RemoteResourceIdentifier will be used in WebCore when recording drawing a remote ImageBuffer to another remote ImageBuffer. Eventually it will be used drawing a remote NativeImage to a remote ImageBuffer or DOM layer. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/RemoteResourceIdentifier.h: Added. 2020-10-12 Luming Yin <luming_yin@apple.com> [macOS] Workaround for MAC_OS_X_VERSION_MAJOR incorrectly including minor version when building with Xcode 12 on macOS Big Sur SUs https://bugs.webkit.org/show_bug.cgi?id=217602 rdar://70194453 Reviewed by Darin Adler. The previous workaround turns out to be ineffective because we can't set the value of TARGET_MAC_OS_X_VERSION_MAJOR based on a previous value of itself. Introduce a new variable TARGET_MAC_OS_X_VERSION_MAJOR to determine whether we need to explicitly adjust MAC_OS_X_VERSION_MAJOR to 110000. * Configurations/DebugRelease.xcconfig: 2020-10-12 Chris Dumez <cdumez@apple.com> AudioWorkletGlobalScope should perform a microtask checkpoint after each rendering quantum https://bugs.webkit.org/show_bug.cgi?id=217624 Reviewed by Geoffrey Garen. AudioWorkletGlobalScope should perform a microtask checkpoint after each rendering quantum: - https://www.w3.org/TR/webaudio/#rendering-loop (Step 4) Because JSC drains its microtask queue when releasing the API lock, the AudioWorkletGlobalScope grabs the API lock at the beginning of each render quantum, then the process() functions get called for each AudioWorkletProcessor, and finally the AudioWorkletGlobalScope releases the API lock at the end of the render quantum so that the microtask queue is drained then, as per the specification. No new tests, rebaselined existing tests. * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::render): * Modules/webaudio/AudioWorkletGlobalScope.cpp: (WebCore::AudioWorkletGlobalScope::handlePreRenderTasks): (WebCore::AudioWorkletGlobalScope::handlePostRenderTasks): * Modules/webaudio/AudioWorkletGlobalScope.h: 2020-10-12 Chris Dumez <cdumez@apple.com> Calling AudioContext.resume() right after AudioContext.suspend() should not be a no-op https://bugs.webkit.org/show_bug.cgi?id=217628 Reviewed by Darin Adler. We had an issue with our implementation of AudioContext's suspend() / resume(). Both functions would update the AudioContext's state asynchronously (as per specification [1][2]) but would check the state syncronously and return early if the state is already as expected (which is not as per specification). This meant that calling suspend() then resume() right away would leave the context suspended instead of running. [1] https://www.w3.org/TR/webaudio/#dom-audiocontext-suspend [2] https://www.w3.org/TR/webaudio/#dom-audiocontext-resume No new tests, rebaselined existing test. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::setState): (WebCore::BaseAudioContext::suspendRendering): (WebCore::BaseAudioContext::resumeRendering): 2020-10-12 Simon Fraser <simon.fraser@apple.com> Fix wheel event region overlay painting https://bugs.webkit.org/show_bug.cgi?id=217619 Reviewed by Antti Koivisto. TWo changes related to wheel event region overlay painting. First, the painted debug regions were misplaced inside overflow:scroll, because RenderLayerBacking::paintDebugOverlays() used contentOffsetInCompositingLayer() rather than graphicsLayer->offsetFromRenderer() - the scrolled contents layer can have a different offsetFromRenderer to the other GraphicsLayers for a given RenderLayerBacking. Second, with ENABLE(WHEEL_EVENT_REGIONS) we paint the wheel event regions in RenderLayerBacking::paintDebugOverlays() so MouseWheelRegionOverlay should not also paint the old ones. * page/DebugPageOverlays.cpp: (WebCore::MouseWheelRegionOverlay::updateRegion): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintDebugOverlays): 2020-10-12 Chris Dumez <cdumez@apple.com> Use AudioWorkletProcessor to process audio https://bugs.webkit.org/show_bug.cgi?id=217531 Reviewed by Youenn Fablet and Saam Barati. Use AudioWorkletProcessor to process audio: - https://www.w3.org/TR/webaudio/#dom-audioworkletprocessor-process The AudioWorkletNode logic is based on the Blink implementation at: - https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/modules/webaudio/audio_worklet_node.cc This was the last piece of logic needed to make AudioWorklet functional. I did not enable AudioWorklets by default in this patch though because there are still some test failures that we should investigate first. Most AudioWorklet tests are passing though. No new tests, rebaselined existing tests. * Modules/webaudio/AudioParam.h: Return a const reference to avoid refcounting churn. * Modules/webaudio/AudioWorkletGlobalScope.cpp: (WebCore::AudioWorkletGlobalScope::createProcessor): After the JSAudioWorkletProcessor, we construct a JSCallbackData from the JSAudioWorkletProcessor and the global object and call a setter on the AudioWorkletProcessor. The processor will use this when process() is called to forward the call to process() in JavaScript. * Modules/webaudio/AudioWorkletNode.cpp: (WebCore::AudioWorkletNode::create): - Move the logic dealing with AudioParam objects to its own initializeAudioParameters() function. - Call context.refNode(node) so that the node is kept alive by the audio context until playback is finished. The call to context().notifyNodeFinishedProcessing(this) in didFinishProcessingOnRenderingThread() is what notifies the context that we finished playback and allows the node to get destroyed. This is similar to what is done for AudioScheduledSourceNodes. - Call updatePullStatus() so that the node gets added to the automatic pull list if it does not have any outputs. Otherwise, the node would not be used for rendering if it did not have any outputs. (WebCore::AudioWorkletNode::AudioWorkletNode): (WebCore::AudioWorkletNode::~AudioWorkletNode): (WebCore::AudioWorkletNode::initializeAudioParameters): This logic was mostly moved from the create() function. The part that's new is the initialization of m_paramValuesMap to fill it with empty audio arrays. These arrays are used in process() to store the samples from AudioParam objects. (WebCore::AudioWorkletNode::setProcessor): Fire a processor error if the processor gets set to nullptr, indicating that we failed to construct the AudioWorkletProcessor object. (WebCore::AudioWorkletNode::process): Fill m_paramValuesMap with samples from associated AudioParam objects then call AudioWorkletProcessor::process() with input & output AudioBus objects, as well as m_paramValuesMap. If process() returns false or encountered an error, we finish rendering. (WebCore::AudioWorkletNode::didFinishProcessingOnRenderingThread): This is called by process() whenever process() returns false or encountered an error. If process() encountered an error, we make sure to fire a processorevent event to let the script know. Then we null out the processor and finish rendering. (WebCore::AudioWorkletNode::updatePullStatus): If the node has no output, we need to make sure to add it to the automatic pull list in the context so that it is used for rendering. (WebCore::AudioWorkletNode::checkNumberOfChannelsForInput): Use same logic as Blink here. (WebCore::AudioWorkletNode::fireProcessorErrorOnMainThread): Logic to fire a processorerror event on the main thread with a decent error message. (WebCore::AudioWorkletNode::activeDOMObjectName const): (WebCore::AudioWorkletNode::virtualHasPendingActivity const): ActiveDOMObject overrides. * Modules/webaudio/AudioWorkletNode.h: Subclass AudioWorkletNode since we can fire processorerror events at any point during rendering. * Modules/webaudio/AudioWorkletNode.idl: Make it an ActiveDOMObject. * Modules/webaudio/AudioWorkletProcessor.cpp: (WebCore::constructJSFloat32Array): (WebCore::constructJSMap): (WebCore::constructFrozenJSArray): (WebCore::copyDataFromJSArrayToBuses): A bunch of utility functions to convert WebCore types into the suitable JavaScript types that are expected by the process() function. (WebCore::AudioWorkletProcessor::process): Provide implementation for process(): - https://www.w3.org/TR/webaudio/#dom-audioworkletprocessor-process We convert the parameters into the JavaScript types that the JS process() function expects, then call the process() function and finally return the value returned by the JS process() function. (WebCore::AudioWorkletProcessor::setProcessCallback): This is called by the AudioWorkletGlobalScope right after the AudioWorkletProcessor wrapper gets constructed to set the JSCallbackData object that is used by process() to call the JS process() function. * Modules/webaudio/AudioWorkletProcessor.h: * bindings/js/JSCallbackData.h: (WebCore::JSCallbackDataStrong::JSCallbackDataStrong): Make JSCallbackData fast allocated. The bindings and my new code heap-allocate it. * dom/ErrorEvent.cpp: (WebCore::ErrorEvent::ErrorEvent): * dom/ErrorEvent.h: Add an eventType parameter since AudioWorkletNode now needs to dispatch an ErrorEvent whose type is "processorerror", not the generic "error". * dom/MessagePort.cpp: (WebCore::MessagePort::virtualHasPendingActivity const): Fix MessagePort garbase collection logic to properly deal with MessagePorts from worklets. This addresses crashes found by the unskipped layout tests. 2020-10-12 Youenn Fablet <youenn@apple.com> Add support for MediaRecorder bitrate getters https://bugs.webkit.org/show_bug.cgi?id=217383 Reviewed by Eric Carlson. Do a first computation of bitrates when creating the recorder as per spec. Update bit rates when starting the recording. Covered by rebased tests. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::startRecording): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: * platform/mediarecorder/MediaRecorderPrivate.cpp: (WebCore::MediaRecorderPrivate::updateOptions): * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::startRecording): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::startRecording): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: (WebCore::AudioSampleBufferCompressor::bitRate const): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::audioBitRate const): (WebCore::MediaRecorderPrivateWriter::videoBitRate const): (WebCore::MediaRecorderPrivate::updateOptions): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: (WebCore::VideoSampleBufferCompressor::bitRate const): 2020-10-12 Youenn Fablet <youenn@apple.com> Update WebAudioBufferList::zeroFlatBuffer to write up to current size instead of capacity https://bugs.webkit.org/show_bug.cgi?id=217604 <rdar://problem/70164719> Reviewed by Eric Carlson. Covered by http/wpt/mediarecorder/mute-tracks.html. * platform/audio/cocoa/WebAudioBufferList.cpp: (WebCore::WebAudioBufferList::zeroFlatBuffer): Only set values up to size instead of capacity. This is a small optimization and makes sure to not trigger ASAN errors. 2020-10-12 Youenn Fablet <youenn@apple.com> ASSERTION FAILED: REGRESSION(r268052?): WTF::CompletionHandler<void ()>::~CompletionHandler(): Completion handler should always be called !m_function https://bugs.webkit.org/show_bug.cgi?id=217525 <rdar://problem/70147564> Reviewed by Eric Carlson. MediaRecorderPrivateWriter::flushCompressedSampleBuffers cannot take a completion handler since, on destruction the underlying writer may not call the requestMediaDataWhenReadyOnQueue block. Instead, for every fetchData call, we store the completion handler in m_fetchDataCompletionHandler. MediaRecorder is making sure to not call fetchData until the previous one was done. Then we can call flushCompressedSampleBuffers with a Function instead of a CompletionHandler. Minor refactoring in fetchData to improve readability. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers): (WebCore::MediaRecorderPrivateWriter::fetchData): (WebCore::MediaRecorderPrivateWriter::completeFetchData): (WebCore::MediaRecorderPrivateWriter::updateTimeCode): Deleted. 2020-10-12 Simon Fraser <simon.fraser@apple.com> [LFC Display] Introduce BoxModelBox, and clarify some naming https://bugs.webkit.org/show_bug.cgi?id=217601 Reviewed by Zalan Bujtas. Add BoxModelBox, which is a box in the CSS "Box Model" sense; it can draw backgrounds and borders. The base class, Box, just represents some rectangular area (e.g. for text). Rename the "frameRect" functions; "frame" implies relative to the parent, but these are actually root-relative ("absolute"). It's only BoxModelBox for which the term "borderBox" makes sense. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * display/DisplayLayerController.cpp: (WebCore::Display::LayerController::prepareForDisplay): * display/css/DisplayBox.cpp: (WebCore::Display::Box::Box): (WebCore::Display::Box::debugDescription const): * display/css/DisplayBox.h: (WebCore::Display::Box::Box): (WebCore::Display::Box::absoluteBoxRect const): (WebCore::Display::Box::isBoxModelBox const): (WebCore::Display::Box::borderBoxFrame const): Deleted. * display/css/DisplayBoxModelBox.cpp: Copied from Source/WebCore/display/css/DisplayBox.cpp. (WebCore::Display::BoxModelBox::BoxModelBox): (WebCore::Display::BoxModelBox::debugDescription const): * display/css/DisplayBoxModelBox.h: Copied from Source/WebCore/display/css/DisplayContainerBox.h. (WebCore::Display::BoxModelBox::BoxModelBox): (WebCore::Display::BoxModelBox::absoluteBorderBoxRect const): * display/css/DisplayCSSPainter.cpp: (WebCore::Display::CSSPainter::paintBoxDecorations): (WebCore::Display::CSSPainter::paintBoxContent): (WebCore::Display::CSSPainter::paintBox): (WebCore::Display::CSSPainter::recursivePaintDescendants): (WebCore::Display::CSSPainter::paintStackingContext): (WebCore::Display::CSSPainter::recursiveCollectLayers): * display/css/DisplayCSSPainter.h: * display/css/DisplayContainerBox.cpp: (WebCore::Display::ContainerBox::ContainerBox): (WebCore::Display::ContainerBox::debugDescription const): * display/css/DisplayContainerBox.h: * display/css/DisplayImageBox.cpp: (WebCore::Display::ImageBox::debugDescription const): * display/css/DisplayReplacedBox.cpp: (WebCore::Display::ReplacedBox::ReplacedBox): * display/css/DisplayReplacedBox.h: * display/css/DisplayTextBox.cpp: (WebCore::Display::TextBox::debugDescription const): 2020-10-12 Antti Koivisto <antti@apple.com> [LFC][Integration] RenderReplaced::positionForPoint should use the iterator https://bugs.webkit.org/show_bug.cgi?id=217605 Reviewed by Zalan Bujtas. * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::positionForPoint): Also remove an unnecessary ensureLineBoxes. * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::positionForPoint): 2020-10-12 Luming Yin <luming_yin@apple.com> [macOS] Workaround for MAC_OS_X_VERSION_MAJOR incorrectly including minor version when building with Xcode 12 on macOS Big Sur SUs https://bugs.webkit.org/show_bug.cgi?id=217602 rdar://70194453 Reviewed by Darin Adler. Due to a bug in Xcode (rdar://70185899), Xcode 12.0 and Xcode 12.1 Beta incorrectly includes the minor release number in MAC_OS_X_VERSION_MAJOR, which causes Debug and Release builds of WebKit to be misconfigured when building on macOS Big Sur SUs, leading to webpages failing to load. To work around the Xcode bug, when the MAC_OS_X_VERSION_MAJOR includes the minor version number, drop the minor version number by explicitly setting TARGET_MAC_OS_X_VERSION_MAJOR to 110000. Note: This change should be reverted after <rdar://70185899> is resolved. * Configurations/DebugRelease.xcconfig: 2020-10-12 Wenson Hsieh <wenson_hsieh@apple.com> [MotionMark] Add an inline path data type to represent a circular sector https://bugs.webkit.org/show_bug.cgi?id=217568 Reviewed by Darin Adler. The Canvas Arcs subtest consists primarily of two different types of drawing operations: stroking circular arcs (roughly 80% of paths over the course of the subtest) and filling circular sectors (which accounts for the remaining 20%). After r268320, when stroking circular arcs, we currently take full advantage of inline path data by representing a single arc with ArcData. This prevents us from allocating platform CGPath objects for every stroked arc in the web process, and also reduces the overhead of IPC encoding and decoding when serializing and deserializing display list items in the GPU process. However, when filling circular sectors, each sector is a path created by doing the following: 1. Move to (x, y) 2. Add an arc 3. Add a line back to (x, y) In this scenario, step (3) currently bails us out of the inline `ArcData` representation. However, since we're already tracking the fact that we started the path by moving to (x, y), we can change the current `hasStart` bool flag on `ArcData` into a tri-state enum type consisting of `ArcOnly`, `LineAndArc`, and `ClosedLineAndArc`, and simply transition from `LineAndArc` to `ClosedLineAndArc` instead of bailing out of inline path data entirely. This allows us to entirely eliminate `CGPath` creation in the web process, and makes it so that we only reify `CGPath`s in the GPU process, right before we're using it to paint using CoreGraphics. No change in behavior. * platform/graphics/InlinePathData.h: (WebCore::ArcData::encode const): (WebCore::ArcData::decode): Replace the boolean `hasStart` flag with the new enum. * platform/graphics/Path.cpp: (WebCore::Path::currentPoint const): Make it so that asking for `currentPoint` with inline arc data doesn't fall into the slow case and cause us to create a CGPath. (WebCore::Path::addArc): (WebCore::Path::addLineTo): In the case where the path is represented by inline `ArcData` and we're just adding a line back to the `start` location, don't fall back to `CGPathRef`. Instead, just change the `ArcData` type to `ClosedLineAndArc`. * platform/graphics/Path.h: (WebCore::Path::inlineData): Add a private version of the `inlineData<T>` method that returns a mutable reference to the inline data. * platform/graphics/cg/PathCG.cpp: (WebCore::Path::createCGPath const): If the type is `ClosedLineAndArc`, make sure we set up the platform `CGPathRef` by adding a line back to the start of the `start` location. 2020-10-12 Adrian Perez de Castro <aperez@igalia.com> REGRESSION(r256892): [WPE][GTK] Build broken with ENABLE_ACCELERATED_2D_CANVAS=ON https://bugs.webkit.org/show_bug.cgi?id=217384 Most of the patch by Žan Doberšek. Reviewed by Darin Adler. No new tests needed. * platform/graphics/cairo/ImageBufferCairoGLSurfaceBackend.cpp: Move the namespace declaration after the #include statements, to avoid incorrect nested WebCore::WebCore namespace declarations. (WebCore::ImageBufferCairoGLSurfaceBackend::create): Add missing semicolon to statement, use getter for Cairo surface. (WebCore::ImageBufferCairoGLSurfaceBackend::platformLayer const): Rename from ImageBuffer::platformLayer. (WebCore::ImageBufferCairoGLSurfaceBackend::copyToPlatformTexture const): Add missing first argument. * platform/graphics/cairo/ImageBufferCairoGLSurfaceBackend.h: Adapt. 2020-10-12 Martin Robinson <mrobinson@igalia.com> Improve serialization of scroll-snap-type https://bugs.webkit.org/show_bug.cgi?id=217469 Reviewed by Simon Fraser. Improve serialization of scroll-snap-type * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForScrollSnapType): Don't include "proximity" in the serialization, because it is the default value. 2020-10-11 Luming Yin <luming_yin@apple.com> Strip patch version from TARGET_MAC_OS_X_VERSION_MAJOR when building for macOS Big Sur or later https://bugs.webkit.org/show_bug.cgi?id=217594 rdar://70188497 Reviewed by Darin Adler. To ensure successful Mac Catalyst WebKit builds, strip the patch version from TARGET_MAC_OS_X_VERSION_MAJOR by using two `base:`s on MACOSX_DEPLOYMENT_TARGET. * Configurations/Base.xcconfig: 2020-10-11 Michael Catanzaro <mcatanzaro@gnome.org> Build failures and warning under Source/WebCore/layout/integration/ https://bugs.webkit.org/show_bug.cgi?id=217593 Unreviewed, fix two build failures caused by missing #includes. (Forward declarations are not enough here, we need to #include the necessary header.) Also, fix an unused function warning when LFC is not enabled. * layout/integration/LayoutIntegrationLineIterator.cpp: * layout/integration/LayoutIntegrationLineIteratorLegacyPath.h: * layout/integration/LayoutIntegrationRunIterator.cpp: 2020-10-11 Luming Yin <luming_yin@apple.com> Ignore deployment suffix and identifier when computing major OS version for macOS Big Sur and newer https://bugs.webkit.org/show_bug.cgi?id=217584 rdar://70168426 Reviewed by Darin Adler. Stop using MACOSX_DEPLOYMENT_TARGET:suffix:identifier to compute major OS versions. Only use the deployment target base for macOS Big Sur and newer. Keep the manual definitions for legacy versions of macOS. * Configurations/Base.xcconfig: 2020-10-11 Michael Catanzaro <mcatanzaro@gnome.org> -Wunused-param in MediaRecorder.cpp https://bugs.webkit.org/show_bug.cgi?id=217587 Unreviewed, fix build warning * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::isTypeSupported): 2020-10-11 Rob Buis <rbuis@igalia.com> Various test-cases from Gecko assert with ASSERTION FAILED: tagName == mmultiscriptsTag or ASSERTION FAILED: tagName == mrootTag https://bugs.webkit.org/show_bug.cgi?id=202804 Reviewed by Frédéric Wang. Both rootTypeOf and scriptTypeOf were expecting the qualified name to have no prefix, however it is possible in xhtml that prefixes are set, as seen in the Gecko test cases. Failing to detect the qname would hit an ASSERT in both cases. So use QualifiedName.matches which ignores prefixes. Tests: mathml/scripts-with-prefixes.xhtml mathml/square-roots-with-prefixes.xhtml * mathml/MathMLRootElement.cpp: (WebCore::rootTypeOf): * mathml/MathMLScriptsElement.cpp: (WebCore::scriptTypeOf): 2020-10-11 Wenson Hsieh <wenson_hsieh@apple.com> [MotionMark] Computing the fast bounding rect of an arc should not materialize a CGPathRef https://bugs.webkit.org/show_bug.cgi?id=217563 Reviewed by Darin Adler. Avoid hitting the slow case when asking for the fast bounding rect of a `Path`, in the case where the path consists of a single circular arc. This fast bounding rect is intended to be a conservative way to estimate the bounds of the path, such that the actual bounds of the path must lie within the bounds of this fast rect. At the cost of being less accurate, we can make this fast computation much cheaper in the case of a circular arc by simply returning the bounding rect of the circle containing the arc. * platform/graphics/InlinePathData.h: (WebCore::ArcData::encode const): (WebCore::ArcData::decode): Additionally rename what is currently `ArcData`'s `offset` member to `start` instead, and `hasOffset` to `hasStart` for clarity. This point optionally provides the starting point of a line segment that is connected to the circular arc defined by the center point, radius, and start and end angles. Note that this starting point needs to be included in the fast bounding rect computation for this reason (see above). * platform/graphics/Path.cpp: (WebCore::Path::addArc): (WebCore::Path::fastBoundingRect const): (WebCore::Path::fastBoundingRectFromInlineData const): (WebCore::Path::boundingRectFromInlineData const): * platform/graphics/Path.h: * platform/graphics/cg/PathCG.cpp: (WebCore::Path::createCGPath const): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::StrokePath::localBounds const): Also, use the fast bounding rect when estimating `localBounds` of the `StrokePath` item; these local bounds are only used in an optimization that skips display list items during playback, based on the extent of the item, so it's safe to use extents that are potentially inflated. Using the fast bounding rect also helps in the case of the more complex paths encountered in the Canvas Paths subtest of MotionMark, where each Path contains multiple components and cannot be expressed solely with inline path data. 2020-10-09 Yusuke Suzuki <ysuzuki@apple.com> [JSC] Assert Operation and HostFunction are in JITOperationsList https://bugs.webkit.org/show_bug.cgi?id=217500 Reviewed by Saam Barati. * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::populateJITOperations): * testing/js/WebCoreTestSupport.h: 2020-10-10 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Rename LineBox::InlineBox to InlineLevelBox https://bugs.webkit.org/show_bug.cgi?id=217562 Reviewed by Simon Fraser. Let's use spec terms (https://www.w3.org/TR/css-inline-3/) where applicable. InlineLevelBox -> box generated by an inline level element (replaced, non-replaced etc). LineBox contains a list of InlineLevelBoxes. InlineBox -> A non-replaced InlineLevelBox. The contents of an inline box participate in the same inline formatting context as the inline box itself (e.g. <span>this content is in the same IFC as the span box</span>). RootInlineBox -> a special, anonymous inline box for all the IFC content (e.g. <div>this content is part of the root inline box</div>). * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::build): (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes): (WebCore::Layout::LineBoxBuilder::adjustInlineBoxesLogicalHeight): (WebCore::Layout::LineBoxBuilder::alignInlineLevelBoxesVerticallyAndComputeLineBoxHeight): (WebCore::Layout::InlineFormattingContext::Geometry::computedLineLogicalRect const): (WebCore::Layout::LineBoxBuilder::constructInlineBoxes): Deleted. (WebCore::Layout::LineBoxBuilder::computeInlineBoxesLogicalHeight): Deleted. (WebCore::Layout::LineBoxBuilder::alignInlineBoxesVerticallyAndComputeLineBoxHeight): Deleted. * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::InlineLevelBox::InlineLevelBox): (WebCore::Layout::m_type): (WebCore::Layout::LineBox::addRootInlineBox): (WebCore::Layout::LineBox::addInlineLevelBox): (WebCore::Layout::LineBox::logicalRectForTextRun const): (WebCore::Layout::LineBox::InlineBox::InlineBox): Deleted. (WebCore::Layout::m_baseline): Deleted. (): Deleted. (WebCore::Layout::LineBox::addInlineBox): Deleted. * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineLevelBox::isInlineBox const): (WebCore::Layout::LineBox::inlineLevelBoxForLayoutBox const): (WebCore::Layout::LineBox::inlineLevelBoxList const): (WebCore::Layout::LineBox::containsInlineLevelBox const): (WebCore::Layout::LineBox::rootInlineBox): (WebCore::Layout::LineBox::nonRootInlineLevelBoxes const): (WebCore::Layout::LineBox::inlineLevelBoxForLayoutBox): (WebCore::Layout::LineBox::InlineLevelBox::createRootInlineBox): (WebCore::Layout::LineBox::InlineLevelBox::createAtomicInlineLevelBox): (WebCore::Layout::LineBox::InlineLevelBox::createInlineBox): (WebCore::Layout::LineBox::InlineBox::logicalRect const): Deleted. (WebCore::Layout::LineBox::InlineBox::logicalTop const): Deleted. (WebCore::Layout::LineBox::InlineBox::logicalBottom const): Deleted. (WebCore::Layout::LineBox::InlineBox::logicalLeft const): Deleted. (WebCore::Layout::LineBox::InlineBox::logicalWidth const): Deleted. (WebCore::Layout::LineBox::InlineBox::logicalHeight const): Deleted. (WebCore::Layout::LineBox::InlineBox::baseline const): Deleted. (WebCore::Layout::LineBox::InlineBox::descent const): Deleted. (WebCore::Layout::LineBox::InlineBox::isEmpty const): Deleted. (WebCore::Layout::LineBox::InlineBox::setIsNonEmpty): Deleted. (WebCore::Layout::LineBox::InlineBox::lineSpacing const): Deleted. (WebCore::Layout::LineBox::InlineBox::fontMetrics const): Deleted. (WebCore::Layout::LineBox::InlineBox::layoutBox const): Deleted. (WebCore::Layout::LineBox::InlineBox::setLogicalTop): Deleted. (WebCore::Layout::LineBox::InlineBox::setLogicalWidth): Deleted. (WebCore::Layout::LineBox::InlineBox::setLogicalHeight): Deleted. (WebCore::Layout::LineBox::InlineBox::setBaseline): Deleted. (WebCore::Layout::LineBox::InlineBox::setDescent): Deleted. (WebCore::Layout::LineBox::InlineBox::setLineSpacing): Deleted. (WebCore::Layout::LineBox::inlineBoxForLayoutBox const): Deleted. (WebCore::Layout::LineBox::inlineBoxList const): Deleted. (WebCore::Layout::LineBox::nonRootInlineBoxes const): Deleted. (WebCore::Layout::LineBox::inlineBoxForLayoutBox): Deleted. (WebCore::Layout::LineBox::InlineBox::createBoxForRootInlineBox): Deleted. (WebCore::Layout::LineBox::InlineBox::createBoxForAtomicInlineLevelBox): Deleted. (WebCore::Layout::LineBox::InlineBox::createBoxForInlineBox): Deleted. 2020-10-10 Darin Adler <darin@apple.com> replaceChildren() (with no arguments) silently does nothing rather than removing the children https://bugs.webkit.org/show_bug.cgi?id=217537 Reviewed by Sam Weinig. * dom/ContainerNode.cpp: (WebCore::ContainerNode::replaceChildren): Removed incorrect early return when the node is null, instead added some null checks around the parts of the algorithm that should be skipped in that case. 2020-10-10 Sam Weinig <weinig@apple.com> Use WebPreference definitions from shared configuration files in WebCore (Part 1) https://bugs.webkit.org/show_bug.cgi?id=217551 Reviewed by Darin Adler. This begins using the WebPreferences*.yaml files for the generation of WebCore's Settings and InternalSettings classes. In this first part, we only are moving settings that already exist in the WebPreferences*.yaml files. A subsequent change will migrate the remaining additional settings over. * Configurations/WebCore.xcconfig: Add variable (already used by WebKit) to access the WTF build scripts directory for access to the WebPreferences*.yaml files in DerivedSources.make * DerivedSources-input.xcfilelist: Update with new input files, the WebPreferences*.yaml files. * WebCoreMacros.cmake: * DerivedSources.make: Update GenerateSettings.rb call with new parameters. * Scripts/GenerateSettings.rb: Adds support for generating Settings based on preferences in the WebPreferences*.yaml files while maintaining support for the additional settings from Settings.yaml. Adds support for a new key, 'webcoreImplementation' to continue supporting custom implementations in SettingsBase. * Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb: * Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb: * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: * Scripts/SettingsTemplates/Settings.cpp.erb: * Scripts/SettingsTemplates/Settings.h.erb: Update to account for new names (@allSettingsSet) and differentiation between custom and non-custom implementations. * editing/EditorCommand.cpp: * page/Frame.cpp: Update for new name. DOMPasteAllowed -> domPasteAllowed, which matches convention. * page/Settings.yaml: Moved settings that were bound by WebPreferences to WebPreferences. Sorted remaining ones left. * page/SettingsDefaultValues.h: Remove defaults that were the same on all platforms. These are now hardcoded in WebPreferences. * style/StyleFontSizeFunctions.cpp: (WebCore::Style::fontSizeForKeyword): Add explicit type, now that minimumLogicalFontSize is a double, not an int in WebCore (it was already a double at the WebKit/WebKitLegacy level). 2020-10-10 Adrian Perez de Castro <aperez@igalia.com> [GTK] Build broken with ENABLE_GAMEPAD enabled https://bugs.webkit.org/show_bug.cgi?id=217226 Reviewed by Darin Adler. No new tests needed. * Headers.cmake: List SharedGamepadValue.h in WebCore_PRIVATE_FRAMEWORK_HEADERS, which was missing. * platform/gamepad/EmptyGamepadProvider.h: Mark class as final, because the destructor is final itself. * platform/gamepad/manette/ManetteGamepad.cpp: (WebCore::ManetteGamepad::ManetteGamepad): Adapt to use SharedGamepadValue. (WebCore::ManetteGamepad::buttonPressedOrReleased): Ditto. (WebCore::ManetteGamepad::absoluteAxisChanged): Ditto. * platform/gamepad/manette/ManetteGamepad.h: Ditto. * platform/gamepad/manette/ManetteGamepadProvider.cpp: Rename m_connectionDelayTimer to m_initialGamepadsConnectedTimer, which better reflects the usage and also makes the provider a bit more similar to HIDGamepadProvider (from the Mac port). Arrange to use the EventMakesGamepadsVisible flag. (WebCore::ManetteGamepadProvider::ManetteGamepadProvider): Remove the loop that iterates over the pre-detected gamepads because they are being added too early before any client has had the chance to be attached. (WebCore::ManetteGamepadProvider::startMonitoringGamepads): The loop that iterates and adds pre-detected gamepads is moved here, once there is at least a client. This solves hitting an assertion later on when UIGamepadProvider checks that the number of gamepads it has been notified of matches the amount tracked by ManetteGamepadProvider. (WebCore::ManetteGamepadProvider::stopMonitoringGamepads): (WebCore::ManetteGamepadProvider::deviceConnected): (WebCore::ManetteGamepadProvider::deviceDisconnected): (WebCore::ManetteGamepadProvider::initialGamepadsConnectedTimerFired): (WebCore::ManetteGamepadProvider::inputNotificationTimerFired): * platform/gamepad/manette/ManetteGamepadProvider.h: Ditto. 2020-10-10 Simon Fraser <simon.fraser@apple.com> [LFC Display] Only dump the trees when the log channel is enabled https://bugs.webkit.org/show_bug.cgi?id=217560 Reviewed by Zalan Bujtas. Only dump the layout and display trees when the FormattingContextLayout log channel is enabled. Add ability to get the trees as a String for logging. * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::build const): (WebCore::Display::displayTreeAsText): (WebCore::Display::showDisplayTree): * display/DisplayTreeBuilder.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::layoutTreeAsText): (WebCore::Layout::showLayoutTree): * layout/layouttree/LayoutTreeBuilder.h: 2020-10-10 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Turn parent/first child check into establishesInlineFormattingContext in canUseForLineLayoutWithReason https://bugs.webkit.org/show_bug.cgi?id=217545 Reviewed by Antti Koivisto. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForLineLayoutWithReason): * layout/integration/LayoutIntegrationCoverage.h: 2020-10-09 Jer Noble <jer.noble@apple.com> [Mac] AirPlay menu does not show up when AirPlay button is clicked https://bugs.webkit.org/show_bug.cgi?id=217536 <rdar://problem/69973777> Reviewed by Eric Carlson. PAL tries to soft-link the AVRoutePickerView from the AVFoundation framework, rather than the (correct) AVKit framework. Remove AVRoutePickerView from AVFoundationSoftLink.h and use the already declared version inside AVRoutePickerViewTargetPicker.mm. * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.mm: (WebCore::AVRoutePickerViewTargetPicker::isAvailable): 2020-10-09 Zalan Bujtas <zalan@apple.com> [LFC][Display] Remove the WK1-only display painter https://bugs.webkit.org/show_bug.cgi?id=217553 Reviewed by Simon Fraser. This is replaced by /WebCode/display/css/DisplayCSSPainter. * CMakeLists.txt: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::paint): Deleted. * layout/LayoutContext.h: * layout/displaytree/DisplayPainter.cpp: Removed. * layout/displaytree/DisplayPainter.h: Removed. * page/FrameView.cpp: (WebCore::FrameView::paintContents): 2020-10-09 Myles C. Maxfield <mmaxfield@apple.com> [GPU Process] Delete DisplayList::DrawGlyphs::m_blockLocation because it's always 0 https://bugs.webkit.org/show_bug.cgi?id=217541 Reviewed by Wenson Hsieh. There's no reason for it to exist. No new tests because there is no behavior change. * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawGlyphs::DrawGlyphs): (WebCore::DisplayList::DrawGlyphs::computeBounds): (WebCore::DisplayList::DrawGlyphs::localBounds const): (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::DrawGlyphs::create): (WebCore::DisplayList::DrawGlyphs::localAnchor const): (WebCore::DisplayList::DrawGlyphs::anchorPoint const): (WebCore::DisplayList::DrawGlyphs::encode const): (WebCore::DisplayList::DrawGlyphs::decode): (WebCore::DisplayList::DrawGlyphs::blockLocation const): Deleted. (WebCore::DisplayList::DrawGlyphs::setBlockLocation): Deleted. * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::drawGlyphs): 2020-10-09 Myles C. Maxfield <mmaxfield@apple.com> [GPU Process] Mechanical cleanup in DisplayListRecorder https://bugs.webkit.org/show_bug.cgi?id=217539 Reviewed by Sam Weinig. Move duplicated code into a helper function. No new tests because there is no behavior change. * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::drawGlyphs): (WebCore::DisplayList::Recorder::drawImage): (WebCore::DisplayList::Recorder::drawTiledImage): (WebCore::DisplayList::Recorder::drawNativeImage): (WebCore::DisplayList::Recorder::drawPattern): (WebCore::DisplayList::Recorder::beginTransparencyLayer): (WebCore::DisplayList::Recorder::drawRect): (WebCore::DisplayList::Recorder::drawLine): (WebCore::DisplayList::Recorder::drawLinesForText): (WebCore::DisplayList::Recorder::drawDotsForDocumentMarker): (WebCore::DisplayList::Recorder::drawEllipse): (WebCore::DisplayList::Recorder::drawPath): (WebCore::DisplayList::Recorder::drawFocusRing): (WebCore::DisplayList::Recorder::fillRect): (WebCore::DisplayList::Recorder::fillRoundedRect): (WebCore::DisplayList::Recorder::fillRectWithRoundedHole): (WebCore::DisplayList::Recorder::fillPath): (WebCore::DisplayList::Recorder::fillEllipse): (WebCore::DisplayList::Recorder::strokeRect): (WebCore::DisplayList::Recorder::strokePath): (WebCore::DisplayList::Recorder::strokeEllipse): (WebCore::DisplayList::Recorder::clearRect): (WebCore::DisplayList::Recorder::appendItemAndUpdateExtent): * platform/graphics/displaylists/DisplayListRecorder.h: 2020-10-09 Wenson Hsieh <wenson_hsieh@apple.com> [GPU Process] Add additional support for painting video elements to 2D contexts https://bugs.webkit.org/show_bug.cgi?id=217532 Reviewed by Tim Horton. Add support for using `video` elements as sources for `createImageBitmap` and `createPattern` by ensuring that we use display-list-backed image buffers for painting when using the GPU process for media. See below for more details. Tests: fast/canvas/canvas-createPattern-video-loading.html fast/canvas/canvas-createPattern-video-modify.html imported/w3c/web-platform-tests/html/canvas/element/imagebitmap/canvas-createImageBitmap-video-resize.html imported/w3c/web-platform-tests/html/canvas/element/imagebitmap/createImageBitmap-drawImage.html imported/w3c/web-platform-tests/html/canvas/element/imagebitmap/createImageBitmap-flipY.html * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::createBufferForPainting const): * html/HTMLVideoElement.h: Add a helper function to create an `ImageBuffer` compatible with this video element, for the purpose of painting video frames. In particular, if GPU process for media is enabled, we'll create a display-list-backed remote image buffer. * html/ImageBitmap.cpp: (WebCore::ImageBitmap::createPromise): Call into `HTMLVideoElement::createBufferForPainting` to construct the `ImageBuffer`. * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::createPattern): Call into `HTMLVideoElement::createBufferForPainting` to construct the `ImageBuffer`. * platform/graphics/RenderingMode.h: Add a "purpose" enum value for media painting. * platform/graphics/displaylists/DisplayListImageBuffer.h: Adjust this to avoid forcing the platform context to be created in the case where there are no display list items to flush. Needed to avoid crashing when creating `CanvasPattern` with a video element. 2020-10-09 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Enable overflow hidden. https://bugs.webkit.org/show_bug.cgi?id=217488 Reviewed by Antti Koivisto. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForStyle): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::collectOverflow): 2020-10-09 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r267539. Causes WebContent process crash in certain configurations Reverted changeset: "Add libwebrtc.dylib version check" https://bugs.webkit.org/show_bug.cgi?id=216884 https://trac.webkit.org/changeset/267539 2020-10-09 Simon Fraser <simon.fraser@apple.com> Refactor wheel event coalescing into its own class https://bugs.webkit.org/show_bug.cgi?id=217523 Reviewed by Sam Weinig. Export the TextStream outputter. * platform/PlatformWheelEvent.h: 2020-10-09 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Overflow clip blocks visual overflow https://bugs.webkit.org/show_bug.cgi?id=217526 Reviewed by Antti Koivisto. This is in preparation for enabling 'overflow: hidden' for IFC. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::collectOverflow): 2020-10-09 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Expand the line content width with the caret when applicable https://bugs.webkit.org/show_bug.cgi?id=217527 Reviewed by Antti Koivisto. This patch is in preparation for enabling 'overflow: hidden' for IFC. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): 2020-10-09 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo][GraphicsLayerTextureMapper] backdrop-filter support https://bugs.webkit.org/show_bug.cgi?id=217081 Reviewed by Don Olmstead. r264968 added TextureMapper backdrop-filter support for Coordinated Graphics. This change enables it for GraphicsLayerTextureMapper. Existing backdrop-filter tests cover this change, but WinCairo DRT and WTR don't support pixel dump in AC mode yet (Bug 215041). * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayerTextureMapper::commitLayerChanges): (WebCore::GraphicsLayerTextureMapper::flushCompositingState): (WebCore::GraphicsLayerTextureMapper::setBackdropFilters): (WebCore::GraphicsLayerTextureMapper::setBackdropFiltersRect): * platform/graphics/texmap/GraphicsLayerTextureMapper.h: 2020-10-09 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo][GraphicsLayerTextureMapper] Image layers are entirely clipped since r260174 https://bugs.webkit.org/show_bug.cgi?id=217507 Reviewed by Don Olmstead. r260174 added contentsClippingRect to TextureMapperLayer::State to clip the content. However, it implemented setContentsClippingRect only for CoordinatedGraphicsLayer but for GraphicsLayerTextureMapper. Because the initial value of contentsClippingRect is empty, entire image layers are clipped in GraphicsLayerTextureMapper. Existing compositing/images tests covers this change, but WinCairo DRT and WTR don't support pixel dump in AC mode at the moment (Bug 215041). * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayerTextureMapper::setContentsClippingRect): Added. (WebCore::GraphicsLayerTextureMapper::commitLayerChanges): * platform/graphics/texmap/GraphicsLayerTextureMapper.h: 2020-10-09 Aditya Keerthi <akeerthi@apple.com> [macOS] Add editability to input type=month https://bugs.webkit.org/show_bug.cgi?id=217481 <rdar://problem/70097164> Reviewed by Sam Weinig. This patch adds editability to input type=month by leveraging existing logic to add editable components to date/time inputs. Tests: fast/forms/month/month-editable-components/month-editable-components-focus-and-blur-events.html fast/forms/month/month-editable-components/month-editable-components-keyboard-events.html fast/forms/month/month-editable-components/month-editable-components-mouse-events.html * html/MonthInputType.cpp: (WebCore::MonthInputType::formatDateTimeFieldsState const): (WebCore::MonthInputType::setupLayoutParameters const): * platform/text/cocoa/LocaleCocoa.mm: (WebCore::LocaleCocoa::shortMonthFormat): Update presented month format string to match AppKit. 2020-10-09 Keith Miller <keith_miller@apple.com> Finalizers shouldn't run if events can't fire https://bugs.webkit.org/show_bug.cgi?id=214508 Reviewed by Ryosuke Niwa. This patch makes it so the DeferredWorkTimer won't run scheduled tasks if those would not have run if they were scheduled in WebCore. To do this there is now a concept of a ScriptExecutionOwner. The ScriptExecutionOwner is almost always the same as the global object of the pending task (referred to as the ticket). The only exception to this is if the global object is a JSDOMWindowBase, then the ScriptExecutionOwner is the Document's JS wrapper. To tell the status of a ScriptExecutionOwner, the DeferredWorkTimer calls a virtual function on the global object of the ticket, for JSC-only this just always returns Running. For WebCore, we ask the ScriptExecutionContext associated with the ScriptExecutionOwner. * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::currentScriptExecutionOwner): (WebCore::JSDOMWindowBase::scriptExecutionStatus): * bindings/js/JSDOMWindowBase.h: * bindings/js/JSDOMWrapperCache.h: * bindings/js/JSRemoteDOMWindowBase.cpp: * bindings/js/JSWorkerGlobalScopeBase.cpp: (WebCore::JSWorkerGlobalScopeBase::scriptExecutionStatus): * bindings/js/JSWorkerGlobalScopeBase.h: * bindings/js/JSWorkletGlobalScopeBase.cpp: (WebCore::JSWorkletGlobalScopeBase::scriptExecutionStatus): * bindings/js/JSWorkletGlobalScopeBase.h: * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::contextIdentifier const): (WebCore::ScriptExecutionContext::removeFromContextsMap): (WebCore::ScriptExecutionContext::~ScriptExecutionContext): (WebCore::ScriptExecutionContext::jscScriptExecutionStatus const): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): (WebCore::ScriptExecutionContext::postTaskTo): * dom/ScriptExecutionContext.h: 2020-10-09 Kate Cheney <katherine_cheney@apple.com> Promote WKWebView media playback SPI to API https://bugs.webkit.org/show_bug.cgi?id=217335 <rdar://problem/63406100> Reviewed by Jer Noble. Change stopAllMediaPlayback to be more aptly named pauseAllMediaPlayback because it is possible to resume playing media after this is called. 'Stop' implies more permanence. Add a function to the Document and Page objects to see if media playback exists, is paused, or is suspended to determine media playback state. * dom/Document.cpp: (WebCore::Document::~Document): (WebCore::Document::mediaPlaybackExists): (WebCore::Document::mediaPlaybackIsPaused): (WebCore::Document::pauseAllMediaPlayback): (WebCore::Document::stopAllMediaPlayback): Deleted. * dom/Document.h: * page/Page.cpp: (WebCore::Page::mediaPlaybackExists): (WebCore::Page::mediaPlaybackIsPaused): (WebCore::Page::pauseAllMediaPlayback): (WebCore::Page::stopAllMediaPlayback): Deleted. * page/Page.h: * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::pauseAllMediaPlaybackForDocument): (WebCore::PlatformMediaSessionManager::mediaPlaybackIsPaused): (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument): Deleted. * platform/audio/PlatformMediaSessionManager.h: 2020-10-09 Peng Liu <peng.liu6@apple.com> Move some audio buffer management related files from folder "mac" to folder "cocoa" https://bugs.webkit.org/show_bug.cgi?id=217497 Reviewed by Youenn Fablet. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/cocoa/AudioSampleBufferList.cpp: Renamed from Source/WebCore/platform/audio/mac/AudioSampleBufferList.cpp. * platform/audio/cocoa/AudioSampleBufferList.h: Renamed from Source/WebCore/platform/audio/mac/AudioSampleBufferList.h. * platform/audio/cocoa/AudioSampleDataSource.h: Renamed from Source/WebCore/platform/audio/mac/AudioSampleDataSource.h. * platform/audio/cocoa/AudioSampleDataSource.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSampleDataSource.mm. * platform/audio/cocoa/CAAudioStreamDescription.cpp: Renamed from Source/WebCore/platform/audio/mac/CAAudioStreamDescription.cpp. (WebCore::CAAudioStreamDescription::sampleRate const): (WebCore::CAAudioStreamDescription::isPCM const): (WebCore::CAAudioStreamDescription::isInterleaved const): (WebCore::CAAudioStreamDescription::isSignedInteger const): (WebCore::CAAudioStreamDescription::isFloat const): (WebCore::CAAudioStreamDescription::isNativeEndian const): (WebCore::CAAudioStreamDescription::numberOfInterleavedChannels const): (WebCore::CAAudioStreamDescription::numberOfChannelStreams const): (WebCore::CAAudioStreamDescription::numberOfChannels const): (WebCore::CAAudioStreamDescription::sampleWordSize const): (WebCore::CAAudioStreamDescription::bytesPerFrame const): (WebCore::CAAudioStreamDescription::bytesPerPacket const): (WebCore::CAAudioStreamDescription::formatFlags const): (WebCore::CAAudioStreamDescription::operator== const): (WebCore::CAAudioStreamDescription::operator!= const): (WebCore::CAAudioStreamDescription::streamDescription const): (WebCore::CAAudioStreamDescription::streamDescription): Move the inline function definitions out-of-line to fix styling issues. * platform/audio/cocoa/CAAudioStreamDescription.h: Renamed from Source/WebCore/platform/audio/mac/CAAudioStreamDescription.h. * platform/audio/cocoa/CARingBuffer.cpp: Renamed from Source/WebCore/platform/audio/mac/CARingBuffer.cpp. * platform/audio/cocoa/CARingBuffer.h: Renamed from Source/WebCore/platform/audio/mac/CARingBuffer.h. 2020-10-09 Antoine Quint <graouts@webkit.org> CSS transform computed style should not reflect individual transform properties https://bugs.webkit.org/show_bug.cgi?id=217473 <rdar://problem/70091605> Reviewed by Simon Fraser. Because RenderStyle::applyTransform() accounts for the new rotate, scale and translate properties, we need a way to call this method from computedTransform() without accounting for those properties. While we used to only have the option to include or exclude transform-origin, we now allow for multiple options to be specified using a new TransformOperationOption enum and passing an OptionSet<TransformOperationOption> to RenderStyle::applyTransform(). Test: imported/w3c/web-platform-tests/css/css-transforms/transform-and-individual-transform-properties-computed-style.html * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::computeTransformedExtentViaMatrix const): * css/CSSComputedStyleDeclaration.cpp: (WebCore::computedTransform): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateTransform): (WebCore::RenderLayer::currentTransform const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateTransform): (WebCore::RenderLayerBacking::getCurrentTransform const): * rendering/style/RenderStyle.cpp: (WebCore::requireTransformOrigin): (WebCore::RenderStyle::applyTransform const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::applyTransform): * svg/SVGTextElement.cpp: (WebCore::SVGTextElement::animatedLocalTransform const): 2020-10-09 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Enable FlowTextIsEmpty case https://bugs.webkit.org/show_bug.cgi?id=217512 Reviewed by Antti Koivisto. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::appendTextContent): A zero length content is not considered whitespace content (it does not really have type) but it still collapses completely (does not generate a run). and it does not really have a type * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForFontAndText): * layout/integration/LayoutIntegrationCoverage.h: 2020-10-09 Antti Koivisto <antti@apple.com> [LFC][Integration] Add a way to get runs from line iterator https://bugs.webkit.org/show_bug.cgi?id=217518 Reviewed by Zalan Bujtas. And use it in startPositionForLine/endPositionForLine functions in RenderedPosition. * editing/RenderedPosition.h: (WebCore::RenderedPosition::line const): * editing/VisibleUnits.cpp: (WebCore::startPositionForLine): (WebCore::endPositionForLine): * layout/integration/LayoutIntegrationLine.h: (WebCore::LayoutIntegration::Line::Line): (WebCore::LayoutIntegration::Line::firstRunIndex const): (WebCore::LayoutIntegration::Line::runCount const): Lines now track the first run and the run count. * layout/integration/LayoutIntegrationLineIterator.cpp: (WebCore::LayoutIntegration::LineIterator::firstRun const): (WebCore::LayoutIntegration::LineIterator::lastRun const): (WebCore::LayoutIntegration::LineIterator::logicalStartRunWithNode const): (WebCore::LayoutIntegration::LineIterator::logicalEndRunWithNode const): * layout/integration/LayoutIntegrationLineIterator.h: * layout/integration/LayoutIntegrationLineIteratorLegacyPath.h: (WebCore::LayoutIntegration::LineIteratorLegacyPath::firstRun const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::lastRun const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalStartRunWithNode const): (WebCore::LayoutIntegration::LineIteratorLegacyPath::logicalEndRunWithNode const): * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::LineIteratorModernPath::firstRun const): (WebCore::LayoutIntegration::LineIteratorModernPath::lastRun const): (WebCore::LayoutIntegration::LineIteratorModernPath::logicalStartRunWithNode const): (WebCore::LayoutIntegration::LineIteratorModernPath::logicalEndRunWithNode const): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): * layout/integration/LayoutIntegrationPagination.cpp: (WebCore::LayoutIntegration::makeAdjustedContent): * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::RunIteratorModernPath): 2020-10-09 Chris Dumez <cdumez@apple.com> Add proper implementation for WorkletGlobalScope::isContextThread() https://bugs.webkit.org/show_bug.cgi?id=217486 Reviewed by Sam Weinig. Add proper implementation for WorkletGlobalScope::isContextThread() to enable more threading checks in AudioWorklet code. * Modules/webaudio/AudioWorkletGlobalScope.cpp: (WebCore::AudioWorkletGlobalScope::AudioWorkletGlobalScope): (WebCore::AudioWorkletGlobalScope::thread const): * Modules/webaudio/AudioWorkletGlobalScope.h: (WebCore::AudioWorkletGlobalScope::thread): Deleted. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::createdMessagePort): (WebCore::ScriptExecutionContext::destroyedMessagePort): * workers/WorkerGlobalScope.h: * workers/WorkerOrWorkletGlobalScope.h: * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): (WebCore::WorkletGlobalScope::isContextThread const): * worklets/WorkletGlobalScope.h: 2020-10-01 Sergio Villar Senin <svillar@igalia.com> [WebXR] Make enumerateImmersiveXRDevices() asynchronnous https://bugs.webkit.org/show_bug.cgi?id=217172 Reviewed by Youenn Fablet. The call to enumerateImmersiveXRDevices() can block the main thread and thus it should be asynchronous. The specs clearly state that it should be run "in parallel". The list of available devices will be provided to the callback (a CompletionHandler). Note that the OpenXR code is still running on the main thread but it will be migrated in a follow up patch. This change forced us to modify the whole chain of calls that end in enumerateImmersiveXRDevices() in the WebXR code. Good news is that it allowed us to remove some calls to postTask() or queueTaskKeepingObjectAlive() because code is already running "in parallel" after moving to an asynchronnous paradigm so they were redundant. No new tests required as there is no change in behaviour. * Modules/webxr/WebXRSystem.cpp: (WebCore::WebXRSystem::ensureImmersiveXRDeviceIsSelected): Added a callback parameter. Moved most of the code to the callback provided to enumerateImmersiveXRDevices(). (WebCore::WebXRSystem::obtainCurrentDevice): Returns void and accepts a new callback paramater. Had to migrate it because it can eventually call ensureImmersiveXRDeviceIsSelected(). (WebCore::WebXRSystem::isSessionSupported): Removed postTask(), ensureImmersiveXRDeviceIsSelected() is run in parallel. (WebCore::WebXRSystem::requestSession): Removed queueTaskKeepingObjectAlive() as obtainCurrentDevice() is run in parallel. * Modules/webxr/WebXRSystem.h: * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createContextWebGL): Pass a no-op callback to ensureImmersiveXRDeviceIsSelected(). * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::makeXRCompatible): Moved most of the code into the callback of ensureImmersiveXRDeviceIsSelected(). * platform/xr/PlatformXR.h: (PlatformXR::Instance::immersiveXRDevices const): Deleted. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::Instance::enumerateImmersiveXRDevices): Receives a new callback parameter, returns the list of immersive devices to the callback as a const parameter. 2020-10-09 Andres Gonzalez <andresg_22@apple.com> Fix for accessibility tests keyevents-posted-for-increment-actions.html and keyevents-for-increment-actions-with-node-removal.html in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=217501 Reviewed by Chris Fleizach. Implementation of AXIsolatedObject::increment/decrement. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::increment): (WebCore::AXIsolatedObject::decrement): * accessibility/isolatedtree/AXIsolatedObject.h: 2020-10-09 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Remove redundant AvoidanceReason values https://bugs.webkit.org/show_bug.cgi?id=217510 Reviewed by Antti Koivisto. Remove both FlowTextHasSoftHyphen (should have removed when it got enabled) and the redundant FlowHasLineBreak. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForStyle): * layout/integration/LayoutIntegrationCoverage.h: 2020-10-09 Antti Koivisto <antti@apple.com> [LFC][Integration] Rename iterator path variant structs for consistency https://bugs.webkit.org/show_bug.cgi?id=217511 Reviewed by Zalan Bujtas. ModernPath -> RunIteratorModernPath LegacyPath -> RunIteratorLegacyPath ModernLinePath -> LineIteratorModernPath LegacyLinePath -> LineIteratorLegacyPath * layout/integration/LayoutIntegrationLineIterator.h: (WebCore::LayoutIntegration::LineIterator::LineIterator): * layout/integration/LayoutIntegrationLineIteratorLegacyPath.h: (WebCore::LayoutIntegration::LineIteratorLegacyPath::LineIteratorLegacyPath): (WebCore::LayoutIntegration::LineIteratorLegacyPath::operator== const): (WebCore::LayoutIntegration::LegacyLinePath::LegacyLinePath): Deleted. (WebCore::LayoutIntegration::LegacyLinePath::top const): Deleted. (WebCore::LayoutIntegration::LegacyLinePath::bottom const): Deleted. (WebCore::LayoutIntegration::LegacyLinePath::selectionTop const): Deleted. (WebCore::LayoutIntegration::LegacyLinePath::selectionTopForHitTesting const): Deleted. (WebCore::LayoutIntegration::LegacyLinePath::selectionBottom const): Deleted. (WebCore::LayoutIntegration::LegacyLinePath::traverseNext): Deleted. (WebCore::LayoutIntegration::LegacyLinePath::traversePrevious): Deleted. (WebCore::LayoutIntegration::LegacyLinePath::operator== const): Deleted. (WebCore::LayoutIntegration::LegacyLinePath::atEnd const): Deleted. (WebCore::LayoutIntegration::LegacyLinePath::setAtEnd): Deleted. * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::LineIteratorModernPath::LineIteratorModernPath): (WebCore::LayoutIntegration::LineIteratorModernPath::operator== const): (WebCore::LayoutIntegration::ModernLinePath::ModernLinePath): Deleted. (WebCore::LayoutIntegration::ModernLinePath::top const): Deleted. (WebCore::LayoutIntegration::ModernLinePath::bottom const): Deleted. (WebCore::LayoutIntegration::ModernLinePath::selectionTop const): Deleted. (WebCore::LayoutIntegration::ModernLinePath::selectionTopForHitTesting const): Deleted. (WebCore::LayoutIntegration::ModernLinePath::selectionBottom const): Deleted. (WebCore::LayoutIntegration::ModernLinePath::traverseNext): Deleted. (WebCore::LayoutIntegration::ModernLinePath::traversePrevious): Deleted. (WebCore::LayoutIntegration::ModernLinePath::operator== const): Deleted. (WebCore::LayoutIntegration::ModernLinePath::atEnd const): Deleted. (WebCore::LayoutIntegration::ModernLinePath::setAtEnd): Deleted. (WebCore::LayoutIntegration::ModernLinePath::lines const): Deleted. (WebCore::LayoutIntegration::ModernLinePath::line const): Deleted. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::textRunsFor const): (WebCore::LayoutIntegration::LineLayout::runFor const): * layout/integration/LayoutIntegrationRunIterator.cpp: (WebCore::LayoutIntegration::RunIterator::line const): (WebCore::LayoutIntegration::firstTextRunFor): (WebCore::LayoutIntegration::firstTextRunInTextOrderFor): (WebCore::LayoutIntegration::runFor): (WebCore::LayoutIntegration::PathRun::modernPath const): (WebCore::LayoutIntegration::PathRun::legacyPath const): (WebCore::LayoutIntegration::PathRun::modernPath): Deleted. (WebCore::LayoutIntegration::PathRun::legacyPath): Deleted. * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::RunIterator::RunIterator): * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: (WebCore::LayoutIntegration::RunIteratorLegacyPath::RunIteratorLegacyPath): (WebCore::LayoutIntegration::RunIteratorLegacyPath::operator== const): (WebCore::LayoutIntegration::RunIteratorLegacyPath::nextInlineTextBoxInTextOrder const): (WebCore::LayoutIntegration::LegacyPath::LegacyPath): Deleted. (WebCore::LayoutIntegration::LegacyPath::isText const): Deleted. (WebCore::LayoutIntegration::LegacyPath::rect const): Deleted. (WebCore::LayoutIntegration::LegacyPath::isHorizontal const): Deleted. (WebCore::LayoutIntegration::LegacyPath::dirOverride const): Deleted. (WebCore::LayoutIntegration::LegacyPath::isLineBreak const): Deleted. (WebCore::LayoutIntegration::LegacyPath::baseline const): Deleted. (WebCore::LayoutIntegration::LegacyPath::minimumCaretOffset const): Deleted. (WebCore::LayoutIntegration::LegacyPath::maximumCaretOffset const): Deleted. (WebCore::LayoutIntegration::LegacyPath::bidiLevel const): Deleted. (WebCore::LayoutIntegration::LegacyPath::useLineBreakBoxRenderTreeDumpQuirk const): Deleted. (WebCore::LayoutIntegration::LegacyPath::hasHyphen const): Deleted. (WebCore::LayoutIntegration::LegacyPath::text const): Deleted. (WebCore::LayoutIntegration::LegacyPath::localStartOffset const): Deleted. (WebCore::LayoutIntegration::LegacyPath::localEndOffset const): Deleted. (WebCore::LayoutIntegration::LegacyPath::length const): Deleted. (WebCore::LayoutIntegration::LegacyPath::offsetForPosition const): Deleted. (WebCore::LayoutIntegration::LegacyPath::isLastTextRunOnLine const): Deleted. (WebCore::LayoutIntegration::LegacyPath::isLastTextRun const): Deleted. (WebCore::LayoutIntegration::LegacyPath::renderer const): Deleted. (WebCore::LayoutIntegration::LegacyPath::traverseNextTextRun): Deleted. (WebCore::LayoutIntegration::LegacyPath::traverseNextTextRunInTextOrder): Deleted. (WebCore::LayoutIntegration::LegacyPath::traverseNextOnLine): Deleted. (WebCore::LayoutIntegration::LegacyPath::traversePreviousOnLine): Deleted. (WebCore::LayoutIntegration::LegacyPath::operator== const): Deleted. (WebCore::LayoutIntegration::LegacyPath::atEnd const): Deleted. (WebCore::LayoutIntegration::LegacyPath::setAtEnd): Deleted. (WebCore::LayoutIntegration::LegacyPath::legacyInlineBox const): Deleted. (WebCore::LayoutIntegration::LegacyPath::rootInlineBox const): Deleted. (WebCore::LayoutIntegration::LegacyPath::inlineTextBox const): Deleted. (WebCore::LayoutIntegration::LegacyPath::nextInlineTextBoxInTextOrder const): Deleted. * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::RunIteratorModernPath::RunIteratorModernPath): (WebCore::LayoutIntegration::RunIteratorModernPath::operator== const): (WebCore::LayoutIntegration::ModernPath::ModernPath): Deleted. (WebCore::LayoutIntegration::ModernPath::isText const): Deleted. (WebCore::LayoutIntegration::ModernPath::rect const): Deleted. (WebCore::LayoutIntegration::ModernPath::baseline const): Deleted. (WebCore::LayoutIntegration::ModernPath::isHorizontal const): Deleted. (WebCore::LayoutIntegration::ModernPath::dirOverride const): Deleted. (WebCore::LayoutIntegration::ModernPath::isLineBreak const): Deleted. (WebCore::LayoutIntegration::ModernPath::minimumCaretOffset const): Deleted. (WebCore::LayoutIntegration::ModernPath::maximumCaretOffset const): Deleted. (WebCore::LayoutIntegration::ModernPath::bidiLevel const): Deleted. (WebCore::LayoutIntegration::ModernPath::useLineBreakBoxRenderTreeDumpQuirk const): Deleted. (WebCore::LayoutIntegration::ModernPath::hasHyphen const): Deleted. (WebCore::LayoutIntegration::ModernPath::text const): Deleted. (WebCore::LayoutIntegration::ModernPath::localStartOffset const): Deleted. (WebCore::LayoutIntegration::ModernPath::localEndOffset const): Deleted. (WebCore::LayoutIntegration::ModernPath::length const): Deleted. (WebCore::LayoutIntegration::ModernPath::offsetForPosition const): Deleted. (WebCore::LayoutIntegration::ModernPath::isLastTextRunOnLine const): Deleted. (WebCore::LayoutIntegration::ModernPath::isLastTextRun const): Deleted. (WebCore::LayoutIntegration::ModernPath::renderer const): Deleted. (WebCore::LayoutIntegration::ModernPath::traverseNextTextRun): Deleted. (WebCore::LayoutIntegration::ModernPath::traverseNextTextRunInTextOrder): Deleted. (WebCore::LayoutIntegration::ModernPath::traverseNextOnLine): Deleted. (WebCore::LayoutIntegration::ModernPath::traversePreviousOnLine): Deleted. (WebCore::LayoutIntegration::ModernPath::operator== const): Deleted. (WebCore::LayoutIntegration::ModernPath::atEnd const): Deleted. (WebCore::LayoutIntegration::ModernPath::setAtEnd): Deleted. (WebCore::LayoutIntegration::ModernPath::legacyInlineBox const): Deleted. (WebCore::LayoutIntegration::ModernPath::runs const): Deleted. (WebCore::LayoutIntegration::ModernPath::run const): Deleted. (WebCore::LayoutIntegration::ModernPath::line const): Deleted. 2020-10-09 Noam Rosenthal <noam@webkit.org> CSS image-orientation: none should be ignored for cross-origin images https://bugs.webkit.org/show_bug.cgi?id=217294 Reviewed by Youenn Fablet. Per the new spec in https://github.com/w3c/csswg-drafts/issues/5165, the orientation should be baked into the image if the image is cross origin, to avoid exposing remote image orientation to embedders. The meaning of it in practice is that image-orientation: none would have no effect on remote, image as it's the only web-facing feature exposing image-orientation. This change disables image-orientation override for remote images. Tests: http/wpt/css/css-images/image-orientation/image-orientation-none-cross-origin-canvas.html imported/w3c/web-platform-tests/css/css-images/image-orientation/image-orientation-none-cross-origin.html * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::allowsOrientationOverride const): * html/HTMLImageElement.h: Add a check whether an element is allowed to override/expose orientation. * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::drawImage): * rendering/RenderElement.cpp: (WebCore::RenderElement::imageOrientation const): Only apply orientation for eligible images. 2020-10-08 Eric Carlson <eric.carlson@apple.com> Nil-check results of -[AVPlayerItemVideoOutput initWithPixelBufferAttributes:] https://bugs.webkit.org/show_bug.cgi?id=217498 <rdar://problem59666003> Reviewed by Jer Noble. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Log an error and return immediately if -[AVPlayerItemVideoOutput initWithPixelBufferAttributes:] returns nil. 2020-10-08 Myles C. Maxfield <mmaxfield@apple.com> Stop clamping text-underline-offset to 0 https://bugs.webkit.org/show_bug.cgi?id=217455 Reviewed by Simon Fraser. As per the CSSWG resolution at https://github.com/w3c/csswg-drafts/issues/4059 Test: fast/text/negative-underline-position.html * style/InlineTextBoxStyle.cpp: (WebCore::computeUnderlineOffset): 2020-10-08 Wenson Hsieh <wenson_hsieh@apple.com> [MotionMark] Add a fast path for GraphicsContext::strokePath in the case where the path is a line https://bugs.webkit.org/show_bug.cgi?id=217496 Reviewed by Tim Horton. When running the Canvas Lines subtest with GPU process enabled, we currently suffer from increased memory usage in the GPU process. Much of this increased memory usage is due to the allocation of approximately 35 million `CGPathRef`s over the course of the subtest, which ends up dirtying a large number of pages; this also adds a nontrivial amount of overhead due to creating and destroying these platform `CGPathRef`s. We can mitigate most of this overhead in the GPU process by avoiding platform `CGPathRef` allocation entirely when stroking simple line segments in `GraphicsContext::strokePath`. Rather than reifying `Path::m_path` and then using `CGContextDrawPathDirect`, we can simply use `CGContextStrokeLineSegments` with a fixed array of 2 `CGPoint`s. No change in behavior. * platform/graphics/Path.h: (WebCore::Path::inlineData const): * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::strokePath): 2020-10-08 James Darpinian <jdarpinian@chromium.org> Support EXT_texture_compression_rgtc WebGL extension https://bugs.webkit.org/show_bug.cgi?id=217198 Reviewed by Kenneth Russell. Test: webgl/conformance/extensions/ext-texture-compression-rgtc.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMConvertWebGL.cpp: (WebCore::convertToJSValue): * html/canvas/EXTTextureCompressionRGTC.cpp: Added. (WebCore::EXTTextureCompressionRGTC::EXTTextureCompressionRGTC): (WebCore::EXTTextureCompressionRGTC::getName const): * html/canvas/EXTTextureCompressionRGTC.h: Added. * html/canvas/EXTTextureCompressionRGTC.idl: Added. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getExtension): (WebCore::WebGL2RenderingContext::getSupportedExtensions): * html/canvas/WebGLExtension.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::getExtension): (WebCore::WebGLRenderingContext::getSupportedExtensions): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::extensionIsEnabled): (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData): (WebCore::WebGLRenderingContextBase::loseExtensions): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/ExtensionsGL.h: 2020-10-08 Alex Christensen <achristensen@webkit.org> FileReader.result should return null if it isn't done yet https://bugs.webkit.org/show_bug.cgi?id=217484 Reviewed by Geoffrey Garen. This matches Chrome and Firefox. Covered by newly passing web platform tests. * fileapi/FileReader.cpp: (WebCore::FileReader::result const): 2020-10-08 Alex Christensen <achristensen@webkit.org> Implement Blob.stream https://bugs.webkit.org/show_bug.cgi?id=217457 Reviewed by Youenn Fablet. It's implemented in Chrome and Firefox. * Modules/async-clipboard/ClipboardItemBindingsDataSource.h: * bindings/js/ReadableStream.h: (WebCore::toJSNewlyCreated): * bindings/scripts/CodeGeneratorJS.pm: (AddToIncludesForIDLType): * fileapi/Blob.cpp: (WebCore::Blob::stream): * fileapi/Blob.h: * fileapi/Blob.idl: * fileapi/FileReaderLoader.cpp: (WebCore::FileReaderLoader::FileReaderLoader): (WebCore::FileReaderLoader::takeRawData): * fileapi/FileReaderLoader.h: * fileapi/FileReaderLoaderClient.h: 2020-10-08 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] ASSERTION FAILED: m_renderingUpdateRemainingSteps.last().isEmpty() in WebCore::Page::finalizeRenderingUpdate since r268075 https://bugs.webkit.org/show_bug.cgi?id=217490 Reviewed by Simon Fraser. When the assertion failed, m_renderingUpdateRemainingSteps was 0x2000 (ScrollingTreeUpdate). The flag ScrollingTreeUpdate should be used only if ENABLE(ASYNC_SCROLLING). * page/Page.cpp: (WebCore::operator<<): * page/Page.h: Conditioned out ScrollingTreeUpdate by ENABLE(ASYNC_SCROLLING). 2020-10-08 Andres Gonzalez <andresg_22@apple.com> Presidential Executive Order pages not accessible with Safari. https://bugs.webkit.org/show_bug.cgi?id=217415 <rdar://problem/69922416> Reviewed by Chris Fleizach and Simon Fraser. Follow up to the previous change for this bug per Simon Fraser's comment. Check not only the visibility and opacity of the object in question but also of its ancestors. Expanded the test accessibility/aria-modal.html to include the case where the visibility of the modal dialog is determined by the opacity of its parent object. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::isNodeVisible const): 2020-10-08 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Enable float clear for <br> https://bugs.webkit.org/show_bug.cgi?id=217450 Reviewed by Antti Koivisto. This patch enables IFC layout for <br clear> content. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForLineLayoutWithReason): * layout/integration/LayoutIntegrationInlineContent.h: * layout/integration/LayoutIntegrationLine.h: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::constructContent): (WebCore::LayoutIntegration::LineLayout::contentLogicalHeight const): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::clearFloats): Match the floored position of the float boxes in the search tree. 2020-10-08 Kimmo Kinnunen <kkinnunen@apple.com> Mac: Remove OpenGL and OpenGL ES backends https://bugs.webkit.org/show_bug.cgi?id=217374 Reviewed by Darin Adler. Remove macOS OpenGL (CGL) and iOS OpenGL ES (EAGL) implementations of GraphicsContextGLOpenGL. These are not used anymore and cannot be used for conformant WebGL. The two removed backends would just create maintainance burden. Removes TextureCacheCV, this was not implemented for ANGLE and in comments it was said to be disabled in the platform. Fixes a bug where iOS apps on Mac Apple Silicon would not use correct texture target to convert the video frames in VideoTextureCopierCV. Fixes few instances of using GL types in WebGL implementation instead of WebCore defined GCGL types. This is needed now that the includes are (a bit) more correct. No new tests, a refactoring. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * html/canvas/ANGLEInstancedArrays.cpp: (WebCore::ANGLEInstancedArrays::supported): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): (WebCore::WebGLRenderingContextBase::readPixels): * platform/graphics/GraphicsContextGL.cpp: * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): (WebCore::GraphicsContextGLOpenGL::paintRenderingResultsToCanvas): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget): (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery): (WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget): (WebCore::GraphicsContextGLOpenGL::makeContextCurrent): (WebCore::GraphicsContextGLOpenGL::checkGPUStatus): (WebCore::GraphicsContextGLOpenGL::setContextVisibility): (WebCore::GraphicsContextGLOpenGL::screenDidChange): * platform/graphics/cocoa/WebGLLayer.h: * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer initWithGraphicsContextGL:]): (-[WebGLLayer setAnchorPoint:]): (-[WebGLLayer copyImageSnapshotWithColorSpace:]): (-[WebGLLayer prepareForDisplay]): (-[WebGLLayer display]): (-[WebGLLayer releaseGLResources]): (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): (-[WebGLLayer bindFramebufferToNextAvailableSurface]): * platform/graphics/cv/TextureCacheCV.h: Removed. * platform/graphics/cv/TextureCacheCV.mm: Removed. * platform/graphics/cv/VideoTextureCopierCV.cpp: (WebCore::VideoTextureCopierCV::initializeContextObjects): (WebCore::VideoTextureCopierCV::initializeUVContextObjects): (WebCore::VideoTextureCopierCV::attachIOSurfaceToTexture): (WebCore::VideoTextureCopierCV::detachIOSurfaceFromTexture): (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture): (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): * platform/graphics/cv/VideoTextureCopierCV.h: * platform/graphics/ios/GraphicsContextGLOpenGLESIOS.h: Removed. * platform/graphics/opengl/ExtensionsGLOpenGL.cpp: (WebCore::ExtensionsGLOpenGL::blitFramebuffer): (WebCore::ExtensionsGLOpenGL::createVertexArrayOES): (WebCore::ExtensionsGLOpenGL::deleteVertexArrayOES): (WebCore::ExtensionsGLOpenGL::isVertexArrayOES): (WebCore::ExtensionsGLOpenGL::bindVertexArrayOES): (WebCore::ExtensionsGLOpenGL::supportsExtension): (WebCore::ExtensionsGLOpenGL::drawBuffersEXT): (WebCore::ExtensionsGLOpenGL::drawArraysInstanced): (WebCore::ExtensionsGLOpenGL::drawElementsInstanced): (WebCore::ExtensionsGLOpenGL::vertexAttribDivisor): * platform/graphics/opengl/ExtensionsGLOpenGL.h: * platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp: (WebCore::ExtensionsGLOpenGLCommon::initializeAvailableExtensions): * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: (WebCore::GraphicsContextGLOpenGL::setContextVisibility): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp: (WebCore::GraphicsContextGLOpenGL::readPixelsAndConvertToBGRAIfNecessary): (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): (WebCore::GraphicsContextGLOpenGL::resolveMultisamplingIfNecessary): (WebCore::GraphicsContextGLOpenGL::getIntegerv): (WebCore::GraphicsContextGLOpenGL::depthRange): (WebCore::GraphicsContextGLOpenGL::clearDepth): (WebCore::GraphicsContextGLOpenGL::getExtensions): (WebCore::GraphicsContextGLOpenGL::readPixels): * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::paintRenderingResultsToCanvas): (WebCore::GraphicsContextGLOpenGL::copyTexImage2D): (WebCore::GraphicsContextGLOpenGL::copyTexSubImage2D): (WebCore::GraphicsContextGLOpenGL::finish): (WebCore::GraphicsContextGLOpenGL::flush): (WebCore::GraphicsContextGLOpenGL::deleteTexture): * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp: * platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp: (WebCore::GraphicsContextGLOpenGLManager::updateAllContexts): (WebCore::GraphicsContextGLOpenGLManager::updateHighPerformanceState): (WebCore::GraphicsContextGLOpenGLManager::disableHighPerformanceGPUTimerFired): * platform/graphics/opengl/GraphicsContextGLOpenGLManager.h: 2020-10-08 Antti Koivisto <antti@apple.com> [LFC][Integration] Convert RenderText::positionForPoint use iterator https://bugs.webkit.org/show_bug.cgi?id=217468 Reviewed by Zalan Bujtas. Replace InlineBox traversal code with a generic version. * layout/integration/LayoutIntegrationLineIterator.cpp: (WebCore::LayoutIntegration::LineIterator::operator== const): * layout/integration/LayoutIntegrationLineIterator.h: (WebCore::LayoutIntegration::LineIterator::operator!= const): (WebCore::LayoutIntegration::PathLine::top const): (WebCore::LayoutIntegration::PathLine::bottom const): (WebCore::LayoutIntegration::PathLine::selectionTop const): (WebCore::LayoutIntegration::PathLine::selectionTopForHitTesting const): (WebCore::LayoutIntegration::PathLine::selectionBottom const): (WebCore::LayoutIntegration::PathLine::operator!= const): Deleted. (WebCore::LayoutIntegration::PathLine::rect const): Deleted. (WebCore::LayoutIntegration::PathLine::operator== const): Deleted. * layout/integration/LayoutIntegrationLineIteratorLegacyPath.h: (WebCore::LayoutIntegration::LegacyLinePath::top const): (WebCore::LayoutIntegration::LegacyLinePath::bottom const): (WebCore::LayoutIntegration::LegacyLinePath::selectionTop const): (WebCore::LayoutIntegration::LegacyLinePath::selectionTopForHitTesting const): (WebCore::LayoutIntegration::LegacyLinePath::selectionBottom const): (WebCore::LayoutIntegration::LegacyLinePath::rect const): Deleted. * layout/integration/LayoutIntegrationLineIteratorModernPath.h: (WebCore::LayoutIntegration::ModernLinePath::top const): (WebCore::LayoutIntegration::ModernLinePath::bottom const): (WebCore::LayoutIntegration::ModernLinePath::selectionTop const): (WebCore::LayoutIntegration::ModernLinePath::selectionTopForHitTesting const): (WebCore::LayoutIntegration::ModernLinePath::selectionBottom const): (WebCore::LayoutIntegration::ModernLinePath::traversePrevious): (WebCore::LayoutIntegration::ModernLinePath::rect const): Deleted. * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::PathTextRun::offsetForPosition const): * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: (WebCore::LayoutIntegration::LegacyPath::offsetForPosition const): * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::ModernPath::offsetForPosition const): (WebCore::LayoutIntegration::ModernPath::traversePreviousOnLine): * rendering/RenderText.cpp: (WebCore::lineDirectionPointFitsInBox): (WebCore::createVisiblePositionForBox): (WebCore::createVisiblePositionAfterAdjustingOffsetForBiDi): (WebCore::RenderText::positionForPoint): * rendering/RenderTextLineBoxes.cpp: (): Deleted. (WebCore::lineDirectionPointFitsInBox): Deleted. (WebCore::createVisiblePositionForBox): Deleted. (WebCore::createVisiblePositionAfterAdjustingOffsetForBiDi): Deleted. (WebCore::RenderTextLineBoxes::positionForPoint const): Deleted. * rendering/RenderTextLineBoxes.h: 2020-10-08 Sihui Liu <sihui_liu@apple.com> Adjust heuristic for checking whether view reaches visually non-empty state https://bugs.webkit.org/show_bug.cgi?id=217400 Reviewed by Geoffrey Garen. We decide that view reaches visually non-empty state and fire corresponding events when main document is parsed and no more content (font or css resources) is to be loaded. An edge case is when the page has an empty document and depends on async scripts to fill content (like wpt.fyi), then we may fire the events too early. To mitigate this issue, now we don't set the state if content is completely empty and there are scripts to be loaded. Also, because lazily loading elements need rendering update to decide if they can be loaded, we should not wait for scripts where there are such elements. API Test: WebKit.FirstVisuallyNonEmptyMilestoneWithDeferredScriptInEmptyDocument * page/FrameView.cpp: (WebCore::FrameView::checkAndDispatchDidReachVisuallyNonEmptyState): 2020-10-08 Tuomas Karkkainen <tuomas.webkit@apple.com> AudioParamMap.idl has the Exposed extended attribute twice. (With the same value) https://bugs.webkit.org/show_bug.cgi?id=217472 Reviewed by Antti Koivisto. This commit removes one of the two identical Exposed=Window extended attributes from the IDL files. * Modules/webaudio/AudioParamMap.idl: 2020-10-08 Chris Dumez <cdumez@apple.com> Rename AudioParamTimeline::valuesForTimeRangeImpl() and split it into separate functions https://bugs.webkit.org/show_bug.cgi?id=217453 Reviewed by Eric Carlson. Rename AudioParamTimeline::valuesForTimeRangeImpl() to valuesForFrameRangeImpl() since the function takes start / end frames in argument nowadays (This changed fairly recently). Also split event processing into separate function for each event type. This reduces the size of AudioParamTimeline::valuesForTimeRangeImpl() as the function was getting huge. The size will also increase in the future when we vectorize processing for more event types. This change is based on the corresponding Blink implementation: - https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc No new tests, no behavior change. * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::calculateTimelineValues): * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valueForContextTime): (WebCore::AudioParamTimeline::valuesForFrameRange): (WebCore::AudioParamTimeline::valuesForFrameRangeImpl): (WebCore::AudioParamTimeline::processLinearRamp): (WebCore::AudioParamTimeline::processExponentialRamp): (WebCore::AudioParamTimeline::processCancelValues): (WebCore::AudioParamTimeline::processSetTarget): (WebCore::AudioParamTimeline::processSetValueCurve): * Modules/webaudio/AudioParamTimeline.h: (WebCore::AudioParamTimeline::ParamEvent::curve const): * WebCore.xcodeproj/project.pbxproj: 2020-10-08 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Using the mixture of LayoutUnit and InlineLayoutUnit types causes ASSERT(verticalGap >= 0) https://bugs.webkit.org/show_bug.cgi?id=217458 Reviewed by Antti Koivisto. Line gap computation can produce an incorrect result when the LayoutUnit based lineLogicalTop holds LayoutUnit::max() value while lineLogicalRect.bottom() (float atm) holds a larger value. (This is a great opportunity to transition the line logical constraints to InlineRect(FloatRect)). * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::layoutInlineContent): (WebCore::Layout::LineBuilder::constraintsForLine): * layout/inlineformatting/InlineLineBuilder.h: 2020-10-08 Rob Buis <rbuis@igalia.com> Fix image-loading-lazy-multiple-times.html https://bugs.webkit.org/show_bug.cgi?id=216979 Reviewed by Youenn Fablet. Once an image has been lazy loaded, it should be possible to trigger a new lazy load through relevant mutations. Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-multiple-times.html * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): 2020-10-08 Lauro Moura <lmoura@igalia.com> [GTK][WPE] Missing Exif Orientation support https://bugs.webkit.org/show_bug.cgi?id=95299 Reviewed by Carlos Alberto Lopez Perez. CairoOperations::drawSurface is not taking 90/270 degrees orientation changes in account correctly. As in these operations the size of the surfaces will be the same but not exactly equal (by transposing width and height), drawSurface currently wrongly presumes the need for some some padding. The same happens to the scale factors. Covered by existing tests. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::drawNativeImage): Forward usesWidthAsHeight to drawSurface. (WebCore::Cairo::drawSurface): use correct scaling/padding when getting surfaces from images rotated 90/270 degrees. * platform/graphics/cairo/CairoOperations.h: Add new enum to forward Orientation.usesWidthAsHeight. 2020-10-07 Antoine Quint <graouts@webkit.org> Add support for non-accelerated animation of individual transform properties https://bugs.webkit.org/show_bug.cgi?id=217429 <rdar://problem/70046645> Reviewed by Darin Adler. We add support for animating the rotate, scale and translate properties. The required changes were mainly to add the relevant wrappers and blendFunc() implementations in CSSPropertyAnimation.cpp as well as improving the computed style for those properties to match the "shortest serialization principle" from CSSOM so that WPT tests would pass and not fail due to some incorrect computed style output. We also had to update the rareNonInheritedDataChangeRequiresLayout() method such that layout may be required when RenderStyle::diff() is called with changing values for rotate, scale or translate. Additionally, since the rotate, scale and translate properties are currently enabled by a setting, we needed to make sure that setting properties and values on the MutableStyleProperties objects during parsing of styles provided through the Web Animations JS API had a CSSParserContext with knowledge of the current document to access the settings. * animation/CSSPropertyAnimation.cpp: (WebCore::blendFunc): (WebCore::PropertyWrapperScale::PropertyWrapperScale): (WebCore::PropertyWrapperRotate::PropertyWrapperRotate): (WebCore::PropertyWrapperTranslate::PropertyWrapperTranslate): (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): * animation/KeyframeEffect.cpp: (WebCore::processIterableKeyframes): (WebCore::processPropertyIndexedKeyframes): * css/CSSComputedStyleDeclaration.cpp: (WebCore::computedTranslate): (WebCore::computedScale): (WebCore::computedRotate): * platform/graphics/transforms/RotateTransformOperation.h: * platform/graphics/transforms/ScaleTransformOperation.h: * platform/graphics/transforms/TranslateTransformOperation.h: * rendering/style/RenderStyle.cpp: (WebCore::rareNonInheritedDataChangeRequiresLayout): * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): 2020-10-07 Chris Dumez <cdumez@apple.com> Unreviewed, fix Windows build after r268161. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::createdMessagePort): (WebCore::ScriptExecutionContext::destroyedMessagePort): * workers/WorkerOrWorkletGlobalScope.h: (isType): 2020-10-07 Tim Horton <timothy_horton@apple.com> REGRESSION: Safari unable to load PDF in <embed> (docs.legalconnect.com) https://bugs.webkit.org/show_bug.cgi?id=217451 <rdar://problem/69767043> Reviewed by Alex Christensen. Test: fast/replaced/pdf-as-embed-with-no-mime-type-is-not-blank.html If plugins are enabled, we'll always let the request go through, and WebKit will guess that files with PDFPlugin-handled extensions should instantiate PDFPlugin, even if no other plugins are available. However, if plugins are disabled, requestPlugin() will early return if the explicitly specified MIME type is not handled by an application plugin (even though the downstream WebKit code would have happily instantiated an application plugin for us). Application plugins shouldn't depend on the plugin enablement setting. To fix this, have SubframeLoader guess the MIME type if not explicitly specified (matching WebKit's behavior), and allow the request if it matches an application plugin. * loader/SubframeLoader.cpp: (WebCore::findPluginMIMETypeFromURL): Improve this previously logging-only function to use the lastPathComponent of the URL instead of randomly looking at the end of the URL, to ignore query strings and fragments when looking for the file extension. (WebCore::FrameLoader::SubframeLoader::requestPlugin): Make use of findPluginMIMETypeFromURL to guess the MIME type if it's not explicitly specified. If the guessed MIME type is one that is handled by application plugins, allow the request to go out to WebKit (which may then instantiate a PDFPlugin, for example). (WebCore::logPluginRequest): (WebCore::FrameLoader::SubframeLoader::requestObject): (WebCore::FrameLoader::SubframeLoader::createJavaAppletWidget): Pass the URL instead of stringifying it, so we can lastPathComponent as above. 2020-10-07 Chris Dumez <cdumez@apple.com> Constructing a AudioWorkletNode should construct an AudioWorkletProcessor on the Worklet thread https://bugs.webkit.org/show_bug.cgi?id=217442 Reviewed by Geoffrey Garen. Constructing a AudioWorkletNode should construct an AudioWorkletProcessor on the Worklet thread: - https://www.w3.org/TR/webaudio/#AudioWorkletNode-constructors (Step 13) No new tests, rebaselined existing tests. * Modules/webaudio/AudioWorklet.cpp: (WebCore::AudioWorklet::createProcessor): Add createProcessor() function to AudioWorklet which takes care of hopping to the worklet thread in order to call createProcessor() on the AudioWorkletGlobalScope. * Modules/webaudio/AudioWorklet.h: * Modules/webaudio/AudioWorkletGlobalScope.cpp: (WebCore::AudioWorkletGlobalScope::createProcessor): Construct an AudioWorkletProcessor, as specified here: - https://www.w3.org/TR/webaudio/#AudioWorkletProcessor-instantiation (WebCore::AudioWorkletGlobalScope::takePendingProcessorConstructionData): A function to take the pending ProcessorConstructionData. This construction data gets initialized in createProcessor() and gets consumed by AudioWorkletProcessor::create(). * Modules/webaudio/AudioWorkletGlobalScope.h: * Modules/webaudio/AudioWorkletNode.cpp: (WebCore::AudioWorkletNode::create): Improve AudioWorkletNode constructor to actually cause the construction of the AudioWorkletProcessor on the worklet thread, passing it the options and the MessagePort. This is as per the specification here: - https://www.w3.org/TR/webaudio/#AudioWorkletNode-constructors (WebCore::AudioWorkletNode::AudioWorkletNode): (WebCore::AudioWorkletNode::~AudioWorkletNode): (WebCore::AudioWorkletNode::setProcessor): Once the AudioWorkletProcessor is created on the worklet thread, this gets called so that the AudioWorkletNode has a reference to the processor. This will be needed later on once AudioWorkletNode::process() starts doing audio processing through the AudioWorkletProcessor. (WebCore::AudioWorkletNode::process): Improve comment. * Modules/webaudio/AudioWorkletNode.h: * Modules/webaudio/AudioWorkletNode.idl: Pass the global object to the constructor. It is needed now that the constructor serializes script values to pass them to the worklet thread. * Modules/webaudio/AudioWorkletNodeOptions.idl: Add [JSGenerateToJSObject] to AudioWorkletNodeOptions dictionary so that a convertDictionaryToJS() function gets generated for this dictionary. This function is called by the AudioWorkletNode constructor. * Modules/webaudio/AudioWorkletProcessor.cpp: (WebCore::AudioWorkletProcessor::create): (WebCore::AudioWorkletProcessor::AudioWorkletProcessor): * Modules/webaudio/AudioWorkletProcessor.h: (WebCore::AudioWorkletProcessor::name const): (WebCore::AudioWorkletProcessor::port): Implement AudioWorkletProcessor constructor so that its retrieves the pending construction data from the AudioWorkletGlobalScope and properly initializes its name and port. The specification for this is here: - https://www.w3.org/TR/webaudio/#dom-audioworkletprocessor-audioworkletprocessor * Modules/webaudio/AudioWorkletProcessor.idl: Indicate that the constructor may throw an exception as per the specification: - https://www.w3.org/TR/webaudio/#dom-audioworkletprocessor-audioworkletprocessor (Step 1) Also pass the ScriptExecutionContext to the constructor since the constructor needs to retrieve the pending construction data from it: - https://www.w3.org/TR/webaudio/#dom-audioworkletprocessor-audioworkletprocessor (Step 1) * Modules/webaudio/AudioWorkletProcessorConstructionData.h: (WebCore::AudioWorkletProcessorConstructionData::AudioWorkletProcessorConstructionData): (WebCore::AudioWorkletProcessorConstructionData::name const): (WebCore::AudioWorkletProcessorConstructionData::port const): Add class to wrap the AudioWorkletProcess's construction data: - https://www.w3.org/TR/webaudio/#pending-processor-construction-data * Modules/webaudio/AudioWorkletThread.h: Move ThreadSafeRefCounted from this class to the parent class (WorkerOrWorkletThread) since WorkerMessagePortChannelProvider needs to protect a WorkerOrWorkletThread now. * WebCore.xcodeproj/project.pbxproj: Add new header to project. * bindings/js/JSDOMGlobalObject.cpp: (WebCore::toJSDOMGlobalObject): Properly handle WorkletGlobalScope. * dom/MessagePort.cpp: (WebCore::MessagePort::disentangle): (WebCore::MessagePort::disentanglePorts): (WebCore::MessagePort::entanglePorts): (WebCore::MessagePort::entangle): * dom/MessagePort.h: Tweak MessagePort API to support disentangling/entangling a single MessagePort. Previously we had to pass an array of ports. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::createdMessagePort): (WebCore::ScriptExecutionContext::destroyedMessagePort): Tweak assertions to handle AudioWorkletGlobalScopes. * dom/messageports/MessagePortChannelProvider.cpp: (WebCore::MessagePortChannelProvider::fromContext): * dom/messageports/MessageWithMessagePorts.h: * dom/messageports/WorkerMessagePortChannelProvider.cpp: (WebCore::WorkerMessagePortChannelProvider::WorkerMessagePortChannelProvider): (WebCore::WorkerMessagePortChannelProvider::takeAllMessagesForPort): (WebCore::WorkerMessagePortChannelProvider::checkRemotePortForActivity): * dom/messageports/WorkerMessagePortChannelProvider.h: Update WorkerMessagePortChannelProvider to use WorkerOrWorkletScope instead or WorkerGlobalScope. This allows us to reuse this class for AudioWorklets so that MessagePort communication between the main thread and the worklet thread now works. * workers/WorkerOrWorkletThread.h: Move ThreadSafeRefCounted from subclasses to this class so that WorkerMessagePortChannelProvider can protect a WorkerOrWorkletThread. * workers/WorkerThread.h: * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::notifyFinished): Only evaluate the script if we have not already evaluated it in this worklet. I am assuming this is needed because we are not treating the script as a module yet (due to lack of support in workers). Without this changes, the worklet's script would get in a bad state when importing several times the same module (which is something the WPT tests do). (WebCore::WorkletGlobalScope::messagePortChannelProvider): Instantiate WorkerMessagePortChannelProvider if needed. This is needed for MessagePort communication is AudioWorklets. * worklets/WorkletGlobalScope.h: 2020-10-07 Chris Dumez <cdumez@apple.com> Crash under JSAudioWorkletProcessorConstructor::~JSAudioWorkletProcessorConstructor() https://bugs.webkit.org/show_bug.cgi?id=217448 <rdar://problem/70059902> Reviewed by Geoffrey Garen. Make sure we clear out m_processorConstructorMap in AudioWorkletGlobalScope::prepareForTermination() since this map keeps JS wrappers alive. No new tests, already covered by existing tests that are crashing on ASAN bots. * Modules/webaudio/AudioWorkletGlobalScope.cpp: (WebCore::AudioWorkletGlobalScope::prepareForTermination): 2020-10-07 Tyler Wilcock <twilco.o@protonmail.com> background-clip:var(--a) invalidates -webkit-background-clip:text when --a:text https://bugs.webkit.org/show_bug.cgi?id=199410 Reviewed by Darin Adler. Parse the `text` value (CSSValueText) for the `background-clip` property. While the bug this patch is associated with is about CSS variable interactions, the underlying issue is that we weren't parsing the `text` value for `background-clip`. https://www.w3.org/TR/2017/CR-css-backgrounds-3-20171017/#the-background-clip This patch also removes the ability to parse the `-webkit-text` value for the `background-origin` (CSSPropertyBackgroundOrigin) property by removing `CSSValueWebkitText` from `consumeBackgroundBox`. Neither `-webkit-text` nor the unprefixed `text` are valid values for this property. https://www.w3.org/TR/2017/CR-css-backgrounds-3-20171017/#the-background-origin Updated existing `fast/css/background-clip-text.html` test. * css/parser/CSSPropertyParser.cpp: (WebCore::consumeBackgroundBox): Removed `CSSValueWebkitText`. (WebCore::consumeBackgroundClip): Added. (WebCore::consumeBackgroundComponent): Use `consumeBackgroundClip` for the `CSSPropertyBackgroundClip` property case. 2020-10-07 Tyler Wilcock <twilco.o@protonmail.com> Using CSS wide keywords as a fallback for variable substitution works inconsistently. https://bugs.webkit.org/show_bug.cgi?id=197158 Reviewed by Darin Adler. Enable CSS-wide keywords to be used as variable fallbacks. See spec-issue for further discussion: https://github.com/w3c/csswg-drafts/issues/5325 Patch inspired by Chromium's implementation: https://bugs.chromium.org/p/chromium/issues/detail?id=954963#c5 Tests: fast/css/variables/css-wide-keywords-in-fallback-inherited-property.html fast/css/variables/css-wide-keywords-in-fallback-non-inherited-property.html * css/parser/CSSPropertyParser.cpp: Add `maybeConsumeCSSWideKeyword` function. (WebCore::CSSPropertyParser::parseSingleValue): Before trying to parse the property-specific values for the input `property`, first try parsing the CSS-wide keywords via `maybeConsumeCSSWideKeyword`. (WebCore::CSSPropertyParser::consumeCSSWideKeyword): Refactor to use `maybeConsumeCSSWideKeyword`. 2020-10-07 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Use display structures (InlineContent) to provide content height and baseline used values https://bugs.webkit.org/show_bug.cgi?id=217437 Reviewed by Antti Koivisto. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::contentLogicalHeight const): (WebCore::LayoutIntegration::LineLayout::lineCount const): (WebCore::LayoutIntegration::LineLayout::firstLineBaseline const): (WebCore::LayoutIntegration::LineLayout::lastLineBaseline const): 2020-10-07 Zalan Bujtas <zalan@apple.com> Add std::max to make sure the line gap is always larger than 0 (see FIXME). Reviewed by Antti Koivisto. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): 2020-10-07 Wenson Hsieh <wenson_hsieh@apple.com> [GPU Process] Support CanvasRenderingContext2D.drawImage() with HTMLVideoElement https://bugs.webkit.org/show_bug.cgi?id=217339 <rdar://problem/69409029> Reviewed by Darin Adler. Implements support for painting the current video frame into a canvas 2D graphics context. See below for more details. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::paintCurrentFrameInContext): Flip this around to call `GraphicsContext::paintFrameForMedia` with the `MediaPlayer`, instead of calling into `MediaPlayer` with the graphics context. See changes below. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::paintFrameForMedia): * platform/graphics/GraphicsContext.h: Add a `paintFrameForMedia` method that takes a `MediaPlayer` representing a video, and paints the current frame of the video into the context. If the graphics context is backed by an platform context (i.e. `m_impl` is `nullptr`), then we simply call through to `MediaPlayer`'s private impl to paint into the context. Otherwise, we forward the call to the `GraphicsContextImpl` (see the changes to `DisplayListRecorder.cpp` below). * platform/graphics/GraphicsContextImpl.h: Add a new virtual function to paint the current frame of the given `MediaPlayer` into the destination rect. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::playerPrivate const): (WebCore::MediaPlayer::playerPrivate): (WebCore::MediaPlayer::paintCurrentFrameInContext): Deleted. * platform/graphics/MediaPlayer.h: Remove the existing `paintCurrentFrameInContext` method on `MediaPlayer`, which currently takes a graphics context. Instead, move `paintCurrentFrameInContext` to `GraphicsContext`, rename it to `paintFrameForMedia`, and pass it a `MediaPlayer`. Additionally, expose a helper method to get a non-const `MediaPlayerPrivateInterface`, and move both method definitions to the implementation file to avoid style checker errors due to `MediaPlayer` itself being `WEBCORE_EXPORT`-ed. * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::paintFrameForMedia): * platform/graphics/cairo/GraphicsContextImplCairo.h: * platform/graphics/displaylists/DisplayList.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::Item::sizeInBytes): (WebCore::DisplayList::PaintFrameForMedia::create): (WebCore::DisplayList::PaintFrameForMedia::PaintFrameForMedia): (WebCore::DisplayList::PaintFrameForMedia::apply const): (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::PaintFrameForMedia::destination const): (WebCore::DisplayList::PaintFrameForMedia::identifier const): (WebCore::DisplayList::PaintFrameForMedia::encode const): (WebCore::DisplayList::PaintFrameForMedia::decode): (WebCore::DisplayList::Item::encode const): (WebCore::DisplayList::Item::decode): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::paintFrameForMedia): * platform/graphics/displaylists/DisplayListRecorder.h: Add a new display list item, `PaintFrameForMedia`, that paints the current frame of a given `MediaPlayer`. This works by serializing and then deserializing a `MediaPlayerHandle` and destination rect; similar to `PutImageData`, the replayer delegate is responsible for applying this item by mapping the `MediaPlayerHandle` to a concrete `MediaPlayer` instance. * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: (Nicosia::CairoOperationRecorder::paintFrameForMedia): * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: * platform/graphics/win/GraphicsContextImplDirect2D.cpp: (WebCore::GraphicsContextImplDirect2D::paintFrameForMedia): * platform/graphics/win/GraphicsContextImplDirect2D.h: * rendering/RenderVideo.cpp: (WebCore::RenderVideo::paintReplaced): 2020-10-07 Aditya Keerthi <akeerthi@apple.com> [Contact Picker API] Add support for ContactsManager.getProperties() https://bugs.webkit.org/show_bug.cgi?id=217354 <rdar://problem/69862099> Reviewed by Youenn Fablet. ContactsManager.getProperties() returns a list of properties supported by the API. These currently include name, email and tel. Test: contact-picker/contacts-manager-get-properties.html * Modules/contact-picker/ContactsManager.cpp: (WebCore::ContactsManager::getProperties): 2020-10-07 Noam Rosenthal <noam@webkit.org> clip-path: path() ignores page zooming (Command-+) https://bugs.webkit.org/show_bug.cgi?id=217311 <rdar://problem/69977271> Reviewed by Darin Adler. Added a zoom property to BasicShapePath. When BasicShapePath is created from a clip-path, the shape's zoom received the effective zoom. The internal cache in BasicShapePath now uses the zoom as an additional cache key, in addition to windRule, offset and byteStream. Renamed SVGPathTranslatedByteStream to SVGPathTransformedByteStream. Tests: imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-path-interpolation-with-zoom.html imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-path-with-zoom-hittest.html imported/w3c/web-platform-tests/css/css-masking/clip-path/clip-path-path-with-zoom.html Also imported the rest of the w3c clip-path tests. * css/BasicShapeFunctions.cpp: (WebCore::basicShapeForValue): * css/BasicShapeFunctions.h: * rendering/style/BasicShapes.cpp: (WebCore::SVGPathTransformedByteStream::SVGPathTransformedByteStream): (WebCore::SVGPathTransformedByteStream::operator== const): (WebCore::SVGPathTransformedByteStream::operator!= const): (WebCore::SVGPathTransformedByteStream::path const): (WebCore::TransformedByteStreamPathPolicy::isKeyNull): (WebCore::TransformedByteStreamPathPolicy::createValueForKey): (WebCore::cachedTransformedByteStreamPath): (WebCore::BasicShapePath::path): (WebCore::BasicShapePath::operator== const): (WebCore::BasicShapePath::blend const): (WebCore::SVGPathTranslatedByteStream::SVGPathTranslatedByteStream): Deleted. (WebCore::SVGPathTranslatedByteStream::operator== const): Deleted. (WebCore::SVGPathTranslatedByteStream::operator!= const): Deleted. (WebCore::SVGPathTranslatedByteStream::isEmpty const): Deleted. (WebCore::SVGPathTranslatedByteStream::path const): Deleted. (WebCore::TranslatedByteStreamPathPolicy::isKeyNull): Deleted. (WebCore::TranslatedByteStreamPathPolicy::createValueForKey): Deleted. (WebCore::cachedTranslatedByteStreamPath): Deleted. Add zoom to BasicShapePath and related internal structure. * rendering/style/BasicShapes.h: * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertClipPath): Read zoom from current style when creating a BasicShapeClipPath. 2020-10-07 Youenn Fablet <youenn@apple.com> Add support for BlobEvent.timecode https://bugs.webkit.org/show_bug.cgi?id=217379 Reviewed by Eric Carlson. Expose timecode getter for BlobEvent. Make MediaRecorder backend return the timecode value for each fetch data. For the real backend, compute the timecode as the current audio timestamp for the next fetch data request, or the current video timestamp if only video is captured. Covered by rebased test. * Modules/mediarecorder/BlobEvent.cpp: (WebCore::BlobEvent::BlobEvent): * Modules/mediarecorder/BlobEvent.h: * Modules/mediarecorder/BlobEvent.idl: * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::createDataAvailableEvent): (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::requestData): (WebCore::MediaRecorder::fetchData): (WebCore::MediaRecorder::handleTrackChange): (WebCore::MediaRecorder::trackEnded): * Modules/mediarecorder/MediaRecorder.h: * platform/mediarecorder/MediaRecorderPrivate.h: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::fetchData): * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::fetchData): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::clear): (WebCore::MediaRecorderPrivateWriter::stopRecording): (WebCore::MediaRecorderPrivateWriter::fetchData): (WebCore::MediaRecorderPrivateWriter::updateTimeCode): 2020-10-07 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Adjust the inline formatting context root's content height when the last line has float clear https://bugs.webkit.org/show_bug.cgi?id=217432 Reviewed by Antti Koivisto. This patch expands the support for inline content to clear floats (r268122) by taking the clear gap into account when it occurs after the last line (e.g. <div>foobar<br clear=left"></div>). In such cases the inline formatting context's content height needs to be adjusted with the computed clear gap value. Test: fast/layoutformattingcontext/float-avoiding-br-last-line.html * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::setClearGapAfterLastLine): (WebCore::Layout::InlineFormattingState::clearGapAfterLastLine const): (WebCore::Layout::InlineFormattingState::clearLineAndRuns): 2020-10-07 Youenn Fablet <youenn@apple.com> Add support for MediaRecorder pause/resume https://bugs.webkit.org/show_bug.cgi?id=217375 Reviewed by Eric Carlson. Implement pause and resume as per spec. MediaRecorder basically sends pause/resume order to its backend. The backend then stops observing tracks when paused and resumed observing at resume time. For video, we make sure to compute the frame timestamp so that the recorded video continues to play without interruption. Test: http/wpt/mediarecorder/pause-recording.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::pauseRecording): (WebCore::MediaRecorder::resumeRecording): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: * platform/mediarecorder/MediaRecorderPrivate.cpp: (WebCore::MediaRecorderPrivate::pause): (WebCore::MediaRecorderPrivate::resume): * platform/mediarecorder/MediaRecorderPrivate.h: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::pauseRecording): (WebCore::MediaRecorderPrivateAVFImpl::resumeRecording): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::pause): (WebCore::MediaRecorderPrivateWriter::resume): 2020-10-07 Youenn Fablet <youenn@apple.com> MediaRecorder::create should not need to create a MediaRecorderPrivate to validate it can record properly https://bugs.webkit.org/show_bug.cgi?id=217387 Reviewed by Darin Adler. Instead of creating a MediaRecorderPrivate to verify that we can create one, just rely on isTypeSupported. Add a check that page is not null in the create method. Remove assertion that we can create a private recorder in start since thgere is no guarantee that the frame might not be detached. Test: http/wpt/mediarecorder/MediaRecorder-frame.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::createMediaRecorderPrivate): (WebCore::MediaRecorder::startRecording): 2020-10-07 Antti Koivisto <antti@apple.com> [LFC][Integration] Add line iterator https://bugs.webkit.org/show_bug.cgi?id=217427 Reviewed by Zalan Bujtas. Add line iterator. In this patch it is only used to replace onSameLine function. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Position.cpp: (WebCore::Position::rendersInDifferentPosition const): * layout/integration/LayoutIntegrationLineIterator.cpp: Added. (WebCore::LayoutIntegration::LineIterator::LineIterator): (WebCore::LayoutIntegration::LineIterator::atEnd const): (WebCore::LayoutIntegration::LineIterator::next const): (WebCore::LayoutIntegration::LineIterator::previous const): (WebCore::LayoutIntegration::LineIterator::traverseNext): (WebCore::LayoutIntegration::LineIterator::traversePrevious): * layout/integration/LayoutIntegrationLineIterator.h: Added. (WebCore::LayoutIntegration::PathLine::operator!= const): (WebCore::LayoutIntegration::LineIterator::LineIterator): (WebCore::LayoutIntegration::LineIterator::operator++): (WebCore::LayoutIntegration::LineIterator::operator bool const): (WebCore::LayoutIntegration::LineIterator::operator== const): (WebCore::LayoutIntegration::LineIterator::operator!= const): (WebCore::LayoutIntegration::LineIterator::operator* const): (WebCore::LayoutIntegration::LineIterator::operator-> const): (WebCore::LayoutIntegration::PathLine::PathLine): (WebCore::LayoutIntegration::PathLine::rect const): (WebCore::LayoutIntegration::PathLine::operator== const): * layout/integration/LayoutIntegrationLineIteratorLegacyPath.h: Added. (WebCore::LayoutIntegration::LegacyLinePath::LegacyLinePath): (WebCore::LayoutIntegration::LegacyLinePath::rect const): (WebCore::LayoutIntegration::LegacyLinePath::traverseNext): (WebCore::LayoutIntegration::LegacyLinePath::traversePrevious): (WebCore::LayoutIntegration::LegacyLinePath::operator== const): (WebCore::LayoutIntegration::LegacyLinePath::atEnd const): (WebCore::LayoutIntegration::LegacyLinePath::setAtEnd): * layout/integration/LayoutIntegrationLineIteratorModernPath.h: Added. (WebCore::LayoutIntegration::ModernLinePath::ModernLinePath): (WebCore::LayoutIntegration::ModernLinePath::rect const): (WebCore::LayoutIntegration::ModernLinePath::traverseNext): (WebCore::LayoutIntegration::ModernLinePath::traversePrevious): (WebCore::LayoutIntegration::ModernLinePath::operator== const): (WebCore::LayoutIntegration::ModernLinePath::atEnd const): (WebCore::LayoutIntegration::ModernLinePath::setAtEnd): (WebCore::LayoutIntegration::ModernLinePath::lines const): (WebCore::LayoutIntegration::ModernLinePath::line const): * layout/integration/LayoutIntegrationRunIterator.cpp: (WebCore::LayoutIntegration::RunIterator::line const): * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::PathRun::logicalLeft const): (WebCore::LayoutIntegration::PathRun::logicalRight const): (WebCore::LayoutIntegration::PathRun::logicalWidth const): (WebCore::LayoutIntegration::PathRun::logicalHeight const): (WebCore::LayoutIntegration::PathRun::onSameLine const): Deleted. * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: (WebCore::LayoutIntegration::LegacyPath::operator== const): (WebCore::LayoutIntegration::LegacyPath::rootInlineBox const): (WebCore::LayoutIntegration::LegacyPath::onSameLine const): Deleted. * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::verticallyRoundedRect): (WebCore::LayoutIntegration::ModernPath::rect const): (WebCore::LayoutIntegration::ModernPath::operator== const): (WebCore::LayoutIntegration::linePosition): Deleted. (WebCore::LayoutIntegration::ModernPath::onSameLine const): Deleted. 2020-10-07 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add initial support for inline content to clear intrusive floats https://bugs.webkit.org/show_bug.cgi?id=217418 Reviewed by Antti Koivisto. In this patch we introduce the concept of gaps between lines. These gaps are required to clear intrusive floats when the inline content has the clear property set. (This behavior changed in CSS2. Now the clear property only applies to block-level elements.) Adjust the logic in FloatingContext::verticalPositionWithClearance so that it can take an inline level box and make sure that the next line does not start above the clearance position. Test: fast/layoutformattingcontext/float-avoiding-br-simple.html * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::geometryForBox const): * layout/FormattingContext.h: * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::absoluteCoordinates const): (WebCore::Layout::FloatingContext::mapTopLeftToFloatingStateRoot const): (WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::logicalTopForNextLine const): 2020-10-07 Zalan Bujtas <zalan@apple.com> [LFC][Floating] Move FloatingState::top/bottom functions over to FloatingContext https://bugs.webkit.org/show_bug.cgi?id=217411 Reviewed by Antti Koivisto. FormattingState classes are mostly about setters and getters and they don't have any involved logic. While both top() and bottom() are both rather lightweight at the moment, it will change with the upcoming <br clear> feature. Let's just move these function over to FloatingContext. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): (WebCore::Layout::FormattingContext::Geometry::complicatedCases const): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): (WebCore::Layout::FloatingContext::bottom const): The check for isInFormattingContextOf() is redundant, so let's not add that back here. (WebCore::Layout::FloatingContext::top const): * layout/floats/FloatingContext.h: (WebCore::Layout::FloatingContext::leftBottom const): (WebCore::Layout::FloatingContext::rightBottom const): (WebCore::Layout::FloatingContext::bottom const): * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::bottom const): Deleted. (WebCore::Layout::FloatingState::top const): Deleted. * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::leftBottom const): Deleted. (WebCore::Layout::FloatingState::rightBottom const): Deleted. (WebCore::Layout::FloatingState::bottom const): Deleted. 2020-10-07 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r268085. https://bugs.webkit.org/show_bug.cgi?id=217424 Added broken test webgl/conformance/extensions/s3tc-and- rgtc.html Reverted changeset: "Support EXT_texture_compression_rgtc WebGL extension" https://bugs.webkit.org/show_bug.cgi?id=217198 https://trac.webkit.org/changeset/268085 2020-10-07 Youenn Fablet <youenn@apple.com> Make sure to fire the correct set of events in case MediaRecorder stream has track changes https://bugs.webkit.org/show_bug.cgi?id=217316 Reviewed by Eric Carlson. Introduce MediaRecorderPrivate::stop which makes sure to unregister from media sources before stopping. Update firing events according https://w3c.github.io/mediacapture-record/#dom-mediarecorder-start when track set is changed. Covered by updated test. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::stopRecordingInternal): (WebCore::MediaRecorder::handleTrackChange): * platform/mediarecorder/MediaRecorderPrivate.cpp: (WebCore::MediaRecorderPrivate::stop): * platform/mediarecorder/MediaRecorderPrivate.h: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::~MediaRecorderPrivateAVFImpl): (WebCore::MediaRecorderPrivateAVFImpl::stopRecording): * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::~MediaRecorderPrivateMock): (WebCore::MediaRecorderPrivateMock::stopRecording): 2020-10-06 Andres Gonzalez <andresg_22@apple.com> Presidential Executive Order pages not accessible with Safari. https://bugs.webkit.org/show_bug.cgi?id=217415 Reviewed by Chris Fleizach. Test: accessibility/aria-modal.html. These pages have a dialog modal element of the form <div class="popover" role="dialog" aria-modal="true"> with style visible and a display value different from none. This makes WebCore/accessibility to treat it as if the dialog were always visible, and thus do not convey the content of the page outside the dialog to VoiceOver. The author controls the visibility of the dialog using the style opacity. This patch adds the check for the opacity to determine whether an element is visible or not. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::isNodeVisible const): 2020-10-06 Devin Rousso <drousso@apple.com> Move platform logic for CSS `hover` and `pointer` media queries outside of WebCore https://bugs.webkit.org/show_bug.cgi?id=217413 Reviewed by Tim Horton. No change in behavior, covered by existing tests. * css/MediaQueryEvaluator.cpp: (WebCore::hoverEvaluate): (WebCore::pointerEvaluate): * page/ChromeClient.h: * loader/EmptyClients.h: (WebCore::EmptyChromeClient::hoverSupportedByPrimaryPointingDevice const): Added. (WebCore::EmptyChromeClient::pointerCharacteristicsOfPrimaryPointingDevices const): Added. Provide a way for WebCore to get information about the primary pointing device. Refactor logic in `hoverEvaluate` and `pointerEvaluate` to move platform code into the respective `WebKit::WebPage` file. 2020-10-06 Sam Weinig <weinig@apple.com> <input type="datetime-local"> not show calendar UI when it's inside ShadowDOM https://bugs.webkit.org/show_bug.cgi?id=216985 <rdar://problem/69660273> Reviewed by Darin Adler. Tests: fast/forms/date/date-from-frameless-document.html fast/forms/datetimelocal/datetimelocal-from-frameless-document.html fast/forms/month/month-from-frameless-document.html fast/forms/time/time-from-frameless-document.html fast/forms/week/week-from-frameless-document.html The issue here was that frameless documents, such as those created via the <template> element or document.implementation.createHTMLDocument(...) were not able to access the real Settings object, so were creating their own which only contained the default values. So, the solution is to ensure we pass the real Settings object to the Document constructors even when the Frame is null. To do this requires a bit of piping Settings around, but also some simplification. Now, the Settings owned by Document is fully immutable, with the mutableSettings() accessor being removed, as it was not actually needed. The two uses of mutable Settings were for ServiceWorker creation, where we can just use the mutable accessor from Page instead, and in the Document constructor, where the LegacyGetUserMediaEnabled setting was being enabled based on a quirk. This was not only incorrect (as it would effect more than just what the quirk intended) but unnecessary, as we can make the bindings access the quirk directly. The one somewhat complex case was for CachedSVGDocument and CachedSVGFont for which I had to thread settings through CachedResourceLoader and have the CachedSVGDocument and CachedSVGFont hold onto the Settings object until it was time to construct their documents. * bindings/scripts/CodeGeneratorJS.pm: (NeedsRuntimeCheck): (GenerateRuntimeEnableConditionalString): * bindings/scripts/IDLAttributes.json: Add support back for EnabledByQuirk. * Modules/mediastream/Navigator+MediaDevices.idl: Switch to EnabledByQuirk=shouldEnableLegacyGetUserMedia. * page/Quirks.cpp: (WebCore::Quirks::shouldEnableLegacyGetUserMediaQuirk const): (WebCore::Quirks::shouldEnableLegacyGetUserMedia const): Deleted. * page/Quirks.h: Rename quirk to end in "Quirk" to work with the bindings generator. * page/Settings.yaml: Remove now unused legacyGetUserMediaEnabled settings. * Scripts/SettingsTemplates/Settings.h.erb: Export the settings contructor and destructor so it can be used by tests. * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::createPageForServiceWorker): Switch to using the mutable settings from Page. * dom/DOMImplementation.cpp: (WebCore::createXMLDocument): (WebCore::DOMImplementation::createDocument): (WebCore::DOMImplementation::createHTMLDocument): * dom/DOMImplementation.h: * dom/Document.cpp: (WebCore::Document::Document): (WebCore::m_selection): (WebCore::Document::create): (WebCore::Document::createNonRenderedPlaceholder): (WebCore::Document::cloneDocumentWithoutChildren const): (WebCore::Document::ensureTemplateDocument): * dom/Document.h: (WebCore::Document::settings const): (WebCore::Document::create): (WebCore::Document::mutableSettings): Deleted. * dom/XMLDocument.h: (WebCore::XMLDocument::create): (WebCore::XMLDocument::createXHTML): (WebCore::XMLDocument::XMLDocument): * html/FTPDirectoryDocument.cpp: (WebCore::FTPDirectoryDocument::FTPDirectoryDocument): * html/FTPDirectoryDocument.h: * html/HTMLDocument.cpp: (WebCore::HTMLDocument::createSynthesizedDocument): (WebCore::HTMLDocument::HTMLDocument): (WebCore::HTMLDocument::cloneDocumentWithoutChildren const): * html/HTMLDocument.h: (WebCore::HTMLDocument::create): * html/ImageDocument.cpp: (WebCore::ImageDocument::ImageDocument): * html/ImageDocument.h: * html/MediaDocument.cpp: (WebCore::MediaDocument::MediaDocument): * html/MediaDocument.h: * html/PluginDocument.cpp: (WebCore::PluginDocument::PluginDocument): * html/PluginDocument.h: * html/TextDocument.cpp: (WebCore::TextDocument::TextDocument): * html/TextDocument.h: * inspector/DOMPatchSupport.cpp: (WebCore::DOMPatchSupport::patchDocument): * loader/DocumentWriter.cpp: (WebCore::DocumentWriter::createDocument): (WebCore::DocumentWriter::begin): * loader/SinkDocument.cpp: (WebCore::SinkDocument::SinkDocument): * loader/SinkDocument.h: * loader/cache/CachedResourceLoader.cpp: (WebCore::createResource): (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::revalidateResource): (WebCore::CachedResourceLoader::loadResource): * loader/cache/CachedResourceLoader.h: * loader/cache/CachedSVGDocument.cpp: (WebCore::CachedSVGDocument::CachedSVGDocument): (WebCore::CachedSVGDocument::finishLoading): * loader/cache/CachedSVGDocument.h: * loader/cache/CachedSVGFont.cpp: (WebCore::CachedSVGFont::CachedSVGFont): (WebCore::CachedSVGFont::ensureCustomFontData): * loader/cache/CachedSVGFont.h: * page/ios/FrameIOS.mm: (WebCore::Frame::initWithSimpleHTMLDocument): * svg/SVGDocument.cpp: (WebCore::SVGDocument::SVGDocument): (WebCore::SVGDocument::cloneDocumentWithoutChildren const): * svg/SVGDocument.h: (WebCore::SVGDocument::create): * xml/DOMParser.cpp: (WebCore::DOMParser::DOMParser): (WebCore::DOMParser::parseFromString): * xml/DOMParser.h: * xml/XMLHttpRequest.cpp: * xml/XSLTProcessor.cpp: (WebCore::XSLTProcessor::createDocumentFromSource): Thread settings into all the places. 2020-10-06 Chris Dumez <cdumez@apple.com> Add implementation for AudioWorkletGlobalScope.registerProcessor() https://bugs.webkit.org/show_bug.cgi?id=217405 Reviewed by Geoff Garen. Add implementation for AudioWorkletGlobalScope.registerProcessor() that matches very closely the specification at: - https://www.w3.org/TR/webaudio/#dom-audioworkletglobalscope-registerprocessor Also update the AudioWorkletNode constructor implementation as per: - https://www.w3.org/TR/webaudio/#AudioWorkletNode-constructors Now that the AudioWorklet is able to register a processor and AudioParamDescriptors, the AudioWorkletNode constructor is able to make sure that a processor with the given name was indeed registered. We are also able to construct the AudioParam objects based on the AudioParamDescriptors provided when registering the processor. Note that even though it is now possible to register an AudioWorkletProcessor, it is still not used to process the audio. An AudioWorkletNode currently only outputs silence. This will be addresssed in a future patch. No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParam.idl: * Modules/webaudio/AudioParamDescriptor.h: Copied from Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.idl. (WebCore::AudioParamDescriptor::isolatedCopy const): * Modules/webaudio/AudioParamDescriptor.idl: Copied from Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.idl. * Modules/webaudio/AudioWorkletGlobalScope.cpp: (WebCore::AudioWorkletGlobalScope::registerProcessor): * Modules/webaudio/AudioWorkletGlobalScope.h: * Modules/webaudio/AudioWorkletGlobalScope.idl: * Modules/webaudio/AudioWorkletMessagingProxy.cpp: (WebCore::AudioWorkletMessagingProxy::AudioWorkletMessagingProxy): (WebCore::AudioWorkletMessagingProxy::postTaskToAudioWorklet): * Modules/webaudio/AudioWorkletMessagingProxy.h: * Modules/webaudio/AudioWorkletNode.cpp: (WebCore::AudioWorkletNode::create): * Modules/webaudio/AudioWorkletThread.h: (WebCore::AudioWorkletThread::messagingProxy): * Modules/webaudio/AutomationRate.h: Copied from Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.idl. * Modules/webaudio/AutomationRate.idl: Copied from Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.idl. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::addAudioParamDescriptors): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::parameterDescriptorMap const): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-10-06 Zalan Bujtas <zalan@apple.com> [LFC] FormattingContext::Geometry::contentHeightForFormattingContextRoot should take a const ContainerBox& https://bugs.webkit.org/show_bug.cgi?id=217404 Reviewed by Simon Fraser. A formatting context root is always a Layout::ContainerBox (and not just a Layout::Box). * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases const): (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry const): (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createLayoutBox): 2020-10-06 Devin Rousso <drousso@apple.com> CSS hover and "pointer: fine" media queries do not evaluate to true with iOS 13.4 mouse support https://bugs.webkit.org/show_bug.cgi?id=209292 <rdar://problem/60663124> Reviewed by Tim Horton. On iOS, the primary pointer will always be touch input, so the `hover`/`pointer` media query should never change. If a mouse is connected, however, `any-hover`/`any-pointer` should change as now there is at least one device that supports `hover`/`fine`. Note that in the case of `any-pointer` this means that both `coarse` and `fine` will apply. Catalyst assumes that there is always a mouse connected. Spec: https://drafts.csswg.org/mediaqueries-4/#any-input * css/MediaQueryEvaluator.cpp: (WebCore::anyHoverEvaluate): (WebCore::anyPointerEvaluate): * page/ChromeClient.h: * loader/EmptyClients.h: (WebCore::EmptyChromeClient::hoverSupportedByAnyAvailablePointingDevice const): Added. (WebCore::EmptyChromeClient::pointerCharacteristicsOfAllAvailablePointingDevices const): Added. Provide a way for WebCore to get the current state of whether there are any mouse devices. Refactor logic in `anyHoverEvaluate` and `anyPointerEvaluate` to move platform code into the respective `WebKit::WebPage` file. * page/PointerCharacteristics.h: Added. Enum for `Coarse` and `Fine`. * platform/PlatformScreen.h: Export additional functions for use in WebKit. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: 2020-10-06 James Darpinian <jdarpinian@chromium.org> Support EXT_texture_compression_rgtc WebGL extension https://bugs.webkit.org/show_bug.cgi?id=217198 Reviewed by Kenneth Russell. Test: webgl/conformance/extensions/ext-texture-compression-rgtc.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMConvertWebGL.cpp: (WebCore::convertToJSValue): * html/canvas/EXTTextureCompressionRGTC.cpp: Added. (WebCore::EXTTextureCompressionRGTC::EXTTextureCompressionRGTC): (WebCore::EXTTextureCompressionRGTC::getName const): * html/canvas/EXTTextureCompressionRGTC.h: Added. * html/canvas/EXTTextureCompressionRGTC.idl: Added. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getExtension): (WebCore::WebGL2RenderingContext::getSupportedExtensions): * html/canvas/WebGLExtension.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::getExtension): (WebCore::WebGLRenderingContext::getSupportedExtensions): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::extensionIsEnabled): (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData): (WebCore::WebGLRenderingContextBase::loseExtensions): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/ExtensionsGL.h: 2020-10-06 Chris Fleizach <cfleizach@apple.com> AX: Expose lineRangeForPosition for iOS Accessibility code https://bugs.webkit.org/show_bug.cgi?id=217256 <rdar://problem/67478962> Reviewed by Zalan Bujtas. Expose the existing lineRangeForPosition method for iOS accessibility. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper lineMarkersForMarker:]): 2020-10-06 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Move document box special height computation out of contentHeightForFormattingContextRoot https://bugs.webkit.org/show_bug.cgi?id=217402 Reviewed by Simon Fraser. Document box (<html>) is not a formatting context root and while its content height computation is very similar to BFC root height computation, it should not pollute the generic contentHeightForFormattingContextRoot code. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): (WebCore::Layout::FormattingContext::Geometry::complicatedCases const): 2020-10-06 Chris Dumez <cdumez@apple.com> Add implementation for AudioWorkletGlobalScope's currentFrame / currentTime / sampleRate attributes https://bugs.webkit.org/show_bug.cgi?id=217251 Reviewed by Geoffrey Garen. Add implementation for AudioWorkletGlobalScope's currentFrame / currentTime / sampleRate attributes. The AudioContext's sample rate is passed upon constructor since it does not change once the AudioContext has been created. The current sample frame gets updated directly by the AudioDestinationNode on the audio rendering thread, whenever the AudioAudioDestinationNode updates the current frame. The currrentTime gets computed based on the current frame and the sample rate. No new tests, no Web-facing behavior yet because we are not yet executing module scripts in AudioWorklets. * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::render): * Modules/webaudio/AudioWorklet.cpp: (WebCore::AudioWorklet::create): (WebCore::AudioWorklet::AudioWorklet): * Modules/webaudio/AudioWorklet.h: * Modules/webaudio/AudioWorkletGlobalScope.cpp: (WebCore::AudioWorkletGlobalScope::AudioWorkletGlobalScope): * Modules/webaudio/AudioWorkletGlobalScope.h: (WebCore::AudioWorkletGlobalScope::setCurrentFrame): (WebCore::AudioWorkletGlobalScope::currentFrame const): (WebCore::AudioWorkletGlobalScope::sampleRate const): (WebCore::AudioWorkletGlobalScope::currentTime const): * Modules/webaudio/AudioWorkletMessagingProxy.cpp: (WebCore::generateWorkletParameters): * Modules/webaudio/AudioWorkletMessagingProxy.h: (WebCore::AudioWorkletMessagingProxy::workletThread): * Modules/webaudio/AudioWorkletThread.h: (WebCore::AudioWorkletThread::globalScope const): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): * Modules/webaudio/BaseAudioContext.h: * worklets/WorkletParameters.h: (WebCore::WorkletParameters::isolatedCopy const): 2020-10-06 Simon Fraser <simon.fraser@apple.com> Redundant rendering updates can be scheduled from inside Page::updateRendering() https://bugs.webkit.org/show_bug.cgi?id=216726 Reviewed by Tim Horton. The basic model for scheduling rendering updates is that code that needs to trigger an update just calls Page::schedule[Timed]RenderingUpdate(). However, if Page::updateRendering() is already on the stack, and the work to be scheduled will happen later in the current update, we don't have to schedule a new one. To fix this Page::updateRendering() and related functions track which steps remain in the current update, and callers of schedule[Timed]RenderingUpdate() pass the update steps for the work they need to trigger. If the requested steps are included in the remaining steps no new update needs to be scheduled. Note that requesting a step while that step is being executed has to schedule an upate (e.g. requestAnimationFrame inside its own callback has to schedule). At the end of an update, if there are any unfulfilled steps, then we schedule a new update. Add a log channel for EventLoop and and log from various places. In my brief testing, this reduces the number of calls to Page::updateRendering() by 10-25% on some real pages, which could be a significant power saving. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::scheduleAnimationResolution): * display/DisplayLayerController.cpp: (WebCore::Display::LayerController::scheduleRenderingUpdate): * dom/Document.cpp: (WebCore::Document::setNeedsDOMWindowResizeEvent): (WebCore::Document::setNeedsVisualViewportResize): (WebCore::Document::addPendingScrollEventTarget): (WebCore::Document::setNeedsVisualViewportScrollEvent): (WebCore::Document::serviceRequestAnimationFrameCallbacks): (WebCore::Document::intersectionObserversInitialUpdateTimerFired): (WebCore::Document::scheduleRenderingUpdate): (WebCore::Document::scheduleInitialIntersectionObservationUpdate): (WebCore::Document::updateResizeObservations): (WebCore::Document::updateAnimationsAndSendEvents): * dom/Document.h: * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::scheduleAnimation): * page/EventHandler.cpp: (WebCore::EventHandler::scheduleCursorUpdate): * page/FrameView.cpp: (WebCore::FrameView::setViewExposedRect): * page/Page.cpp: (WebCore::Page::updateStyleAfterChangeInEnvironment): (WebCore::Page::scheduleRenderingUpdate): (WebCore::Page::computeUnfulfilledRenderingSteps): (WebCore::Page::triggerRenderingUpdateForTesting): (WebCore::Page::updateRendering): (WebCore::Page::isolatedUpdateRendering): (WebCore::Page::doAfterUpdateRendering): (WebCore::Page::finalizeRenderingUpdate): (WebCore::Page::renderingUpdateCompleted): (WebCore::Page::accessibilitySettingsDidChange): (WebCore::Page::appearanceDidChange): (WebCore::operator<<): * page/Page.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::didChangeViewExposedRect): (WebCore::PageOverlayController::notifyFlushRequired): * page/RenderingUpdateScheduler.cpp: (WebCore::RenderingUpdateScheduler::scheduleAnimation): (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate): (WebCore::RenderingUpdateScheduler::startTimer): (WebCore::RenderingUpdateScheduler::displayRefreshFired): * page/RenderingUpdateScheduler.h: * page/ResizeObserver.cpp: (WebCore::ResizeObserver::observe): * page/WheelEventTestMonitor.cpp: (WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring): (WebCore::WheelEventTestMonitor::scheduleCallbackCheck): * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired): * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::setEventTrackingRegionsDirty): * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit): * platform/Logging.cpp: (WebCore::initializeLogChannelsIfNecessary): * platform/Logging.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::scheduleRenderingUpdateForImage): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::notifyFlushRequired): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::scheduleRenderingUpdate): * rendering/RenderLayerCompositor.h: 2020-10-06 Wenson Hsieh <wenson_hsieh@apple.com> Rename MediaPlayerPrivateRemoteIdentifier to MediaPlayerIdentifier https://bugs.webkit.org/show_bug.cgi?id=217397 Reviewed by Tim Horton. Move `MediaPlayerPrivateRemoteIdentifier` into WebCore, and rename it to `MediaPlayerIdentifier`, such that it isn't necessarily limited to use for GPU Process code. This is preparation for introducing a display list drawing item which will need to reference a remotely hosted `MediaPlayer`. No change in behavior. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::identifier const): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerIdentifier.h: Renamed from Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemoteIdentifier.h. * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::identifier const): 2020-10-06 Alex Christensen <achristensen@webkit.org> Rename namespace Packed to namespace PackedColor https://bugs.webkit.org/show_bug.cgi?id=217391 Reviewed by Simon Fraser. Otherwise "using WTF::Packed;" in wtf/Packed.h causes problems if both headers are included in the same translation unit. * css/StyleColor.cpp: (WebCore::StyleColor::colorFromKeyword): * css/parser/CSSParserFastPaths.cpp: (WebCore::finishParsingHexColor): (WebCore::finishParsingNamedColor): * platform/graphics/Color.h: (WebCore::Color::asInline const): (WebCore::Color::setColor): (WebCore::Color::encode const): (WebCore::Color::decode): * platform/graphics/ColorTypes.h: (WebCore::asSRGBA): (WebCore::Packed::RGBA::RGBA): Deleted. (WebCore::Packed::ARGB::ARGB): Deleted. * platform/graphics/ImageBackingStore.h: (WebCore::ImageBackingStore::blendPixel): (WebCore::ImageBackingStore::pixelValue const): * platform/graphics/cg/ColorCG.cpp: (WebCore::cachedCGColor): * platform/graphics/mac/ColorMac.mm: (WebCore::nsColor): 2020-10-06 Zalan Bujtas <zalan@apple.com> [LFC][Floating] Remove redundant FormattingContextRoot in FloatingContext c'tor https://bugs.webkit.org/show_bug.cgi?id=217398 Reviewed by Antti Koivisto. No need to pass in the root now that FormattingContext has the root() getter. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutInFlowContent): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::FloatingContext): * layout/floats/FloatingContext.h: (WebCore::Layout::FloatingContext::root const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const): (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): 2020-10-06 Luming Yin <luming_yin@apple.com> [macOS] Bump reported current shipping release UA to 10_15_7 https://bugs.webkit.org/show_bug.cgi?id=217364 <rdar://problem/69984962> Reviewed by Alex Christensen. Bump the reported current shipping release UA from 10_15_6 to 10_15_7. * platform/mac/UserAgentMac.mm: (WebCore::standardUserAgentWithApplicationName): 2020-10-06 Chris Dumez <cdumez@apple.com> Update Worklet.addModule() to actually fetch and evaluate the module script https://bugs.webkit.org/show_bug.cgi?id=217242 Reviewed by Geoffrey Garen. Update Worklet.addModule() to actually fetch and evaluate the module script as per: - https://www.w3.org/TR/worklets-1/#dom-worklet-addmodule The WorkletGlobalScope maintains a queue of fetch requests (basically a URL and a completion handler) and uses the existing WorkerScriptLoader to process the requests serially. Based on the result on the load, we call the CompletionHandler which will cause the Worklet.addModule() promise to get resolved or rejected. Test: webaudio/audioworklet-addModule-failure.html * Modules/webaudio/AudioWorkletGlobalScope.cpp: * Modules/webaudio/AudioWorkletGlobalScope.h: Provide workerOrWorkletThread() override for WorkerOrWorkletGlobalScope(), which is a replacement for underlyingThread(). * Modules/webaudio/AudioWorkletMessagingProxy.cpp: (WebCore::AudioWorkletMessagingProxy::AudioWorkletMessagingProxy): (WebCore::AudioWorkletMessagingProxy::createCacheStorageConnection): (WebCore::AudioWorkletMessagingProxy::postTaskToLoader): (WebCore::AudioWorkletMessagingProxy::postTaskForModeToWorkerOrWorkletGlobalScope): * Modules/webaudio/AudioWorkletMessagingProxy.h: Update AudioWorkletMessagingProxy to subclass WorkerLoaderProxy so that AudioWorklet can reuse WorkerScriptLoader. WorkerScriptLoader relies on WorkerLoaderProxy to do thread hopping. * Modules/webaudio/AudioWorkletThread.cpp: (WebCore::AudioWorkletThread::AudioWorkletThread): (WebCore::AudioWorkletThread::workerLoaderProxy): * Modules/webaudio/AudioWorkletThread.h: (WebCore::AudioWorkletThread::create): Subclass the new WorkerOrWorkletThread interface. WorkerOrWorkletThread is a new interface that was adding so that WorkerScriptLoader can be reused by AudioWorklets. * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: (WebCore::WorkerThreadableWebSocketChannel::Peer::send): (WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount): (WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect): (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage): (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData): (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount): (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake): (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose): (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError): (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpgradeURL): (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize): Simple renaming. * WebCore.xcodeproj/project.pbxproj: * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoader::create): * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::WorkerThreadableLoader): (WebCore::WorkerThreadableLoader::loadResourceSynchronously): (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): (WebCore::WorkerThreadableLoader::MainThreadBridge::notifyIsDone): (WebCore::WorkerThreadableLoader::MainThreadBridge::didSendData): (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse): (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData): (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading): (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail): (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming): * loader/WorkerThreadableLoader.h: (WebCore::WorkerThreadableLoader::create): Update WorkerThreadableLoader so that it can be reused by AudioWorklets. * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::wrapCryptoKey): (WebCore::WorkerGlobalScope::unwrapCryptoKey): * workers/WorkerGlobalScope.h: Minor changes to keep building after updates to WorkerOrWorkletGlobalScope. * workers/WorkerLoaderProxy.h: * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::createCacheStorageConnection): (WebCore::WorkerMessagingProxy::postTaskForModeToWorkerOrWorkletGlobalScope): * workers/WorkerMessagingProxy.h: Simple renames. * workers/WorkerOrWorkletGlobalScope.h: (WebCore::WorkerOrWorkletGlobalScope::createUniqueIdentifier): Update WorkerOrWorkletGlobalScope to add a few things WorkerScriptLoader needed to work with both Workers and Worklets. * workers/WorkerOrWorkletThread.h: Added. Added new parent interface for WorkerThread and AudioWorkletThread so that WorkerScriptLoader can work for both Workers and Worklets. * workers/WorkerRunLoop.cpp: (WebCore::WorkerRunLoop::runInMode): (WebCore::WorkerRunLoop::runCleanupTasks): Minor changes to keep building after changes to WorkerOrWorkletGlobalScope. * workers/WorkerThread.h: Subclass the new WorkerOrWorkletThread interface. * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::ServiceWorkerThreadProxy::postTaskForModeToWorkerOrWorkletGlobalScope): (WebCore::ServiceWorkerThreadProxy::createCacheStorageConnection): (WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange): (WebCore::ServiceWorkerThreadProxy::startFetch): (WebCore::ServiceWorkerThreadProxy::cancelFetch): (WebCore::ServiceWorkerThreadProxy::continueDidReceiveFetchResponse): * workers/service/context/ServiceWorkerThreadProxy.h: Simple renames. * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): Make sure we correctly initialize the security origin for the WorkletGlobalScope. Previously, we were using a unique origin so all script loads would have failed with a cross-origin error. (WebCore::WorkletGlobalScope::fetchAndInvokeScript): (WebCore::WorkletGlobalScope::processNextScriptFetchJobIfNeeded): (WebCore::WorkletGlobalScope::didReceiveResponse): (WebCore::WorkletGlobalScope::notifyFinished): (WebCore::WorkletGlobalScope::didCompleteScriptFetchJob): * worklets/WorkletGlobalScope.h: (WebCore::WorkletGlobalScope::responsibleDocument): (WebCore::WorkletGlobalScope::responsibleDocument const): Add implementation for module script fetching using WorkerScriptLoader. This gets called when Worklet.addModule() is called on the main thread. 2020-10-06 Antti Koivisto <antti@apple.com> [LFC][Integration] Add renderer() to iterator https://bugs.webkit.org/show_bug.cgi?id=217382 Reviewed by Zalan Bujtas. Also use it while converting RenderedPosition for the iterator. * dom/Position.h: * editing/RenderedPosition.cpp: (WebCore::rendererFromPosition): (WebCore::RenderedPosition::RenderedPosition): (WebCore::RenderedPosition::previousLeafOnLine const): (WebCore::RenderedPosition::nextLeafOnLine const): (WebCore::RenderedPosition::isEquivalent const): (WebCore::RenderedPosition::bidiLevelOnLeft const): (WebCore::RenderedPosition::bidiLevelOnRight const): (WebCore::RenderedPosition::leftBoundaryOfBidiRun): (WebCore::RenderedPosition::rightBoundaryOfBidiRun): (WebCore::RenderedPosition::atLeftBoundaryOfBidiRun const): (WebCore::RenderedPosition::atRightBoundaryOfBidiRun const): (WebCore::RenderedPosition::positionAtLeftBoundaryOfBiDiRun const): (WebCore::RenderedPosition::positionAtRightBoundaryOfBiDiRun const): (WebCore::RenderedPosition::absoluteRect const): (WebCore::renderObjectContainsPosition): * editing/RenderedPosition.h: (WebCore::RenderedPosition::rootBox): (WebCore::RenderedPosition::atLeftmostOffsetInBox const): (WebCore::RenderedPosition::atRightmostOffsetInBox const): (WebCore::RenderedPosition::uncachedInlineBox): Deleted. (WebCore::RenderedPosition::RenderedPosition): Deleted. * layout/integration/LayoutIntegrationInlineContent.cpp: (WebCore::LayoutIntegration::InlineContent::InlineContent): (WebCore::LayoutIntegration::InlineContent::lineLayout const): (WebCore::LayoutIntegration::InlineContent::rendererForLayoutBox const): * layout/integration/LayoutIntegrationInlineContent.h: (WebCore::LayoutIntegration::InlineContent::create): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::ensureInlineContent): (WebCore::LayoutIntegration::LineLayout::rendererForLayoutBox const): * layout/integration/LayoutIntegrationLineLayout.h: * layout/integration/LayoutIntegrationPagination.cpp: (WebCore::LayoutIntegration::makeAdjustedContent): * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::PathRun::renderer const): * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: (WebCore::LayoutIntegration::LegacyPath::isLastTextRunOnLine const): (WebCore::LayoutIntegration::LegacyPath::isLastTextRun const): (WebCore::LayoutIntegration::LegacyPath::renderer const): * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::ModernPath::renderer const): 2020-10-06 Alex Christensen <achristensen@webkit.org> FileReader should transition to readyState DONE after last onprogress event https://bugs.webkit.org/show_bug.cgi?id=217333 Reviewed by Youenn Fablet. I also bring the abort function in alignment with https://w3c.github.io/FileAPI/ and the behavior of Chrome and Firefox. As suggested by Chris, I added a bool to remember if loading is complete so we can retain existing behavior when abort is called inside the last onprogress event. This is not mentioned by the spec yet, but it matches the existing behavior and the behavior of Chrome, so I added a web platform test for it. * fileapi/FileReader.cpp: (WebCore::FileReader::abort): (WebCore::FileReader::didFinishLoading): (WebCore::FileReader::didFail): * fileapi/FileReader.h: 2020-10-06 Simon Fraser <simon.fraser@apple.com> Rename scheduleTimedRenderingUpdate() to scheduleRenderingUpdate() everywhere https://bugs.webkit.org/show_bug.cgi?id=217367 Reviewed by Alex Christensen. The previously named scheduleImmediateRenderingUpdate() is no more, so all rendering updates that WebCore knows about are of the timed variety. So just call them scheduleRenderingUpdate() everywhere. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::scheduleAnimationResolution): * dom/Document.cpp: (WebCore::Document::setNeedsDOMWindowResizeEvent): (WebCore::Document::setNeedsVisualViewportResize): (WebCore::Document::addPendingScrollEventTarget): (WebCore::Document::setNeedsVisualViewportScrollEvent): (WebCore::Document::scheduleRenderingUpdate): (WebCore::Document::scheduleInitialIntersectionObservationUpdate): (WebCore::Document::updateResizeObservations): (WebCore::Document::scheduleTimedRenderingUpdate): Deleted. * dom/Document.h: * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::scheduleAnimation): * page/ChromeClient.h: (WebCore::ChromeClient::scheduleRenderingUpdate): (WebCore::ChromeClient::scheduleTimedRenderingUpdate): Deleted. * page/Page.cpp: (WebCore::Page::updateStyleAfterChangeInEnvironment): (WebCore::Page::scheduleRenderingUpdate): (WebCore::Page::accessibilitySettingsDidChange): (WebCore::Page::appearanceDidChange): (WebCore::Page::scheduleTimedRenderingUpdate): Deleted. * page/Page.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::didChangeViewExposedRect): (WebCore::PageOverlayController::notifyFlushRequired): * page/RenderingUpdateScheduler.cpp: (WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency): (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate): (WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate): Deleted. * page/RenderingUpdateScheduler.h: * page/ResizeObserver.cpp: (WebCore::ResizeObserver::observe): * page/linux/ResourceUsageOverlayLinux.cpp: * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired): * rendering/RenderElement.cpp: (WebCore::RenderElement::scheduleRenderingUpdateForImage): * svg/graphics/SVGImageClients.h: 2020-10-06 Youenn Fablet <youenn@apple.com> In case all tracks are ended, enqueue a task to stop recording instead of stopping recording https://bugs.webkit.org/show_bug.cgi?id=217372 Reviewed by Eric Carlson. Covered by updated test. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::trackEnded): 2020-10-06 Rob Buis <rbuis@igalia.com> Make value parameter in Document.execCommand non nullable https://bugs.webkit.org/show_bug.cgi?id=217331 Reviewed by Sam Weinig. Make value parameter in Document.execCommand non nullable [1]. Test: editing/execCommand/arguments-combinations.html [1] https://html.spec.whatwg.org/#document * dom/Document+HTML.idl: * editing/EditorCommand.cpp: (WebCore::executeInsertImage): 2020-10-06 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes, early October 2020 edition, take two https://bugs.webkit.org/show_bug.cgi?id=217344 Unreviewed build fix. No new tests needed. * Modules/contact-picker/ContactInfo.h: Add missing wtf/Forward.h and wtf/Vector.h headers. * Modules/webaudio/AudioWorkletProcessor.h: Add missing wtf/Ref.h header. * Modules/webaudio/AudioWorkletProcessorConstructor.h: Add missing JavaScriptCore/Strong.h header. * rendering/RenderTextLineBoxes.cpp: Add missing VisiblePosition.h header. 2020-10-05 Peng Liu <peng.liu6@apple.com> MobileSafari crashes at WebCore: -[WebAVPlayerViewControllerDelegate playerViewControllerWillStartPictureInPicture:] https://bugs.webkit.org/show_bug.cgi?id=217356 Reviewed by Alex Christensen. Since we replaced the RefPtr of VideoFullscreenInterfaceAVKit with a WeakPtr in WebAVPlayerViewControllerDelegate to fix a leak in r262185, self.fullscreenInterface could be NULL and we need to add NULL checks. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerViewControllerDelegate playerViewControllerWillStartPictureInPicture:]): (-[WebAVPlayerViewControllerDelegate playerViewControllerDidStartPictureInPicture:]): (-[WebAVPlayerViewControllerDelegate playerViewController:failedToStartPictureInPictureWithError:]): (-[WebAVPlayerViewControllerDelegate playerViewControllerWillStopPictureInPicture:]): (-[WebAVPlayerViewControllerDelegate playerViewControllerDidStopPictureInPicture:]): (-[WebAVPlayerViewControllerDelegate playerViewController:shouldExitFullScreenWithReason:]): (-[WebAVPlayerViewControllerDelegate playerViewController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:]): 2020-10-05 Simon Fraser <simon.fraser@apple.com> Remove Page::scheduleImmediateRenderingUpdate() https://bugs.webkit.org/show_bug.cgi?id=217361 Reviewed by Antti Koivisto. There was only one remaining caller of Page::scheduleImmediateRenderingUpdate(), which is RenderLayerCompositor::layerTreeAsText(). The immediate update here is necessary because we flush compositing layers in layerTreeAsText(), and that can trigger a Core Animation commit with painting, so we have to complete our rendering update first to ensure up-to-date layout. However, this is a testing-only codepath, so have the naming reflect that. * page/Page.cpp: (WebCore::Page::triggerRenderingUpdateForTesting): (WebCore::Page::scheduleImmediateRenderingUpdate): Deleted. * page/Page.h: * page/RenderingUpdateScheduler.cpp: (WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate): (WebCore::RenderingUpdateScheduler::displayRefreshFired): (WebCore::RenderingUpdateScheduler::triggerRenderingUpdateForTesting): (WebCore::RenderingUpdateScheduler::triggerRenderingUpdate): (WebCore::RenderingUpdateScheduler::scheduleImmediateRenderingUpdate): Deleted. * page/RenderingUpdateScheduler.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerTreeAsText): 2020-10-05 Alex Christensen <achristensen@webkit.org> Don't NFC normalize strings from blobs https://bugs.webkit.org/show_bug.cgi?id=217327 Reviewed by Sam Weinig. This matches Chrome and Firefox. Covered by newly passing web platform tests. * fileapi/BlobBuilder.cpp: (WebCore::BlobBuilder::append): 2020-10-05 Simon Fraser <simon.fraser@apple.com> Remove the unused Chrome::scheduleAnimation() https://bugs.webkit.org/show_bug.cgi?id=217359 Reviewed by Sam Weinig. Chrome::scheduleAnimation() and the tangentially related ScrollableArea::serviceScrollAnimations() which are unused. * page/Chrome.h: * page/FrameView.cpp: (WebCore::FrameView::scheduleAnimation): Deleted. * page/FrameView.h: * platform/HostWindow.h: * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::serviceScrollAnimations): Deleted. * platform/ScrollAnimator.h: * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::serviceScrollAnimations): Deleted. * platform/ScrollableArea.h: (WebCore::ScrollableArea::scheduleAnimation): Deleted. 2020-10-05 Simon Fraser <simon.fraser@apple.com> Use the "triggerRenderingUpdate" terminology in ChromeClient https://bugs.webkit.org/show_bug.cgi?id=217355 Reviewed by Tim Horton. ChromeClient confusingly had both scheduleRenderingUpdate() and scheduleTimedRenderingUpdate(). The former is for triggering an update soon, and the latter is a normal schedule, used by SVGImages because they have their own Page. Rename the one that the WebKits have to implement to triggerRenderingUpdate(). * loader/EmptyClients.h: * page/ChromeClient.h: * page/RenderingUpdateScheduler.cpp: (WebCore::RenderingUpdateScheduler::scheduleImmediateRenderingUpdate): 2020-10-05 Chris Dumez <cdumez@apple.com> Improvements to VectorMath API https://bugs.webkit.org/show_bug.cgi?id=217343 Reviewed by Alex Christensen. The following improvements were made to the VectorMath API: - Use clearer names for the functions, e.g. VectorMath::vmul() -> VectorMath::multiply() - Drop stride parameters as the call sites always pass 1. This helps simplify the code. - Stop using out-parameters and have the functions return a value when needed. - Pass input scalar as 'float' instead of 'const float*'. No new tests, no Web-facing behavior change. * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::calculateFinalValues): * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valuesForTimeRange): (WebCore::AudioParamTimeline::processLinearRamp): (WebCore::AudioParamTimeline::processSetTarget): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::calculateSampleAccuratePhaseIncrements): * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::createBandLimitedTables): * Modules/webaudio/RealtimeAnalyser.cpp: (WebCore::RealtimeAnalyser::getFloatFrequencyData): * platform/audio/AudioBus.cpp: (WebCore::AudioBus::speakersSumFromByDownMixing): (WebCore::AudioBus::copyWithGainFrom): (WebCore::AudioBus::copyWithSampleAccurateGainValuesFrom): * platform/audio/AudioChannel.cpp: (WebCore::AudioChannel::scale): (WebCore::AudioChannel::sumFrom): (WebCore::AudioChannel::maxAbsValue const): * platform/audio/DirectConvolver.cpp: * platform/audio/FFTConvolver.cpp: (WebCore::FFTConvolver::process): * platform/audio/FFTFrame.cpp: (WebCore::FFTFrame::scaleFFT): (WebCore::FFTFrame::multiply): * platform/audio/IIRFilter.cpp: (WebCore::IIRFilter::tailTime): * platform/audio/Reverb.cpp: (WebCore::calculateNormalizationScale): * platform/audio/ReverbAccumulationBuffer.cpp: (WebCore::ReverbAccumulationBuffer::accumulate): * platform/audio/ReverbConvolver.cpp: * platform/audio/ReverbConvolverStage.cpp: (WebCore::ReverbConvolverStage::ReverbConvolverStage): * platform/audio/VectorMath.cpp: (WebCore::VectorMath::multiplyByScalar): (WebCore::VectorMath::add): (WebCore::VectorMath::addScalar): (WebCore::VectorMath::multiply): (WebCore::VectorMath::multiplyComplex): (WebCore::VectorMath::multiplyThenAddScalar): (WebCore::VectorMath::maximumMagnitude): (WebCore::VectorMath::sumOfSquares): (WebCore::VectorMath::clamp): (WebCore::VectorMath::linearToDecibels): (WebCore::VectorMath::is16ByteAligned): * platform/audio/VectorMath.h: * platform/audio/gstreamer/FFTFrameGStreamer.cpp: (WebCore::FFTFrame::doInverseFFT): * platform/audio/mac/AudioDestinationMac.cpp: (WebCore::AudioDestinationCocoa::processBusAfterRender): * platform/audio/mac/AudioSampleBufferList.cpp: * platform/audio/mac/FFTFrameMac.cpp: (WebCore::FFTFrame::doFFT): (WebCore::FFTFrame::doInverseFFT): 2020-10-05 Simon Fraser <simon.fraser@apple.com> ChromeClient::needsImmediateRenderingUpdate() only existing to work around a WebKit1 bug https://bugs.webkit.org/show_bug.cgi?id=217338 Reviewed by Said Abou-Hallawa. WebViewLayerFlushScheduler has a bug where scheduling inside the callback would fail because the RunLoopObserver was always invalidated at the end of the callback. If we fix this, we can remove ChromeClient::needsImmediateRenderingUpdate() which I believe only existed to work around this bug. * page/ChromeClient.h: (WebCore::ChromeClient::scheduleTimedRenderingUpdate): (WebCore::ChromeClient::needsImmediateRenderingUpdate const): Deleted. * page/RenderingUpdateScheduler.cpp: (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate): 2020-10-05 Simon Fraser <simon.fraser@apple.com> Rename scheduleTimedRenderingUpdate() functions related to images https://bugs.webkit.org/show_bug.cgi?id=217352 Reviewed by Tim Horton. ImageObserver and CachedImageClient have scheduleTimedRenderingUpdate() so that an SVG image's Page and trigger rendering updates. Rename these to make it clearer they are image-related, and remove the "timed" terminology. * html/ImageBitmap.cpp: * loader/cache/CachedImage.cpp: (WebCore::CachedImage::CachedImageObserver::scheduleRenderingUpdate): (WebCore::CachedImage::scheduleRenderingUpdate): (WebCore::CachedImage::CachedImageObserver::scheduleTimedRenderingUpdate): Deleted. (WebCore::CachedImage::scheduleTimedRenderingUpdate): Deleted. * loader/cache/CachedImage.h: * loader/cache/CachedImageClient.h: (WebCore::CachedImageClient::scheduleRenderingUpdateForImage): (WebCore::CachedImageClient::scheduleTimedRenderingUpdate): Deleted. * platform/graphics/ImageObserver.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::scheduleRenderingUpdateForImage): (WebCore::RenderElement::scheduleTimedRenderingUpdate): Deleted. * rendering/RenderElement.h: * svg/graphics/SVGImageClients.h: 2020-10-05 Chris Dumez <cdumez@apple.com> Unreviewed assertion fix after r268006. * platform/audio/VectorMath.cpp: (WebCore::VectorMath::vsvesq): 2020-10-05 Chris Dumez <cdumez@apple.com> [Cocoa] Vectorize linear to decibels conversion in RealtimeAnalyser https://bugs.webkit.org/show_bug.cgi?id=217322 Reviewed by Darin Adler. Vectorize linear to decibels conversion in RealtimeAnalyser on Cocoa ports for performance. No new tests, no web-facing behavior change. * Modules/webaudio/RealtimeAnalyser.cpp: (WebCore::RealtimeAnalyser::getFloatFrequencyData): * platform/audio/VectorMath.cpp: (WebCore::VectorMath::linearToDecibels): * platform/audio/VectorMath.h: 2020-10-05 David Kilzer <ddkilzer@apple.com> Make NetscapePlugInStreamLoaderClient a weak pointer on NetscapePlugInStreamLoader <https://webkit.org/b/217237> <rdar://problem/69776714> Reviewed by Alex Christensen. Could not write a test since reproducing a crash requires rapidly reloading a URL to a PDF at random points during the previous load. Make NetscapePlugInStreamLoaderClient a WeakPtr on NetscapePlugInStreamLoader, and add nullptr checks for NetscapePlugInStreamLoader.m_client as needed. * loader/NetscapePlugInStreamLoader.cpp: (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader): (WebCore::NetscapePlugInStreamLoader::willSendRequest): (WebCore::NetscapePlugInStreamLoader::didReceiveResponse): (WebCore::NetscapePlugInStreamLoader::didReceiveDataOrBuffer): (WebCore::NetscapePlugInStreamLoader::didFinishLoading): (WebCore::NetscapePlugInStreamLoader::didFail): (WebCore::NetscapePlugInStreamLoader::willCancel): * loader/NetscapePlugInStreamLoader.h: 2020-10-05 Chris Dumez <cdumez@apple.com> Use memset to zero vectors in PeriodicWave::createBandLimitedTables() https://bugs.webkit.org/show_bug.cgi?id=217328 Reviewed by Darin Adler. Use memset to zero vectors in PeriodicWave::createBandLimitedTables() instead of a for loop, for performance reasons. No new tests, no Web-facing behavior change. * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::createBandLimitedTables): 2020-10-05 Chris Dumez <cdumez@apple.com> Use tryHoldLock() in WebAudio to simplify the code https://bugs.webkit.org/show_bug.cgi?id=217332 Reviewed by Darin Adler. Use tryHoldLock() in WebAudio to simplify the code a bit. No new tests, no Web-facing behavior change. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::process): (WebCore::AudioBufferSourceNode::setBuffer): (WebCore::AudioBufferSourceNode::startPlaying): (WebCore::AudioBufferSourceNode::adjustGrainParameters): * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::setValueAtTime): (WebCore::AudioParamTimeline::linearRampToValueAtTime): (WebCore::AudioParamTimeline::exponentialRampToValueAtTime): (WebCore::AudioParamTimeline::setTargetAtTime): (WebCore::AudioParamTimeline::setValueCurveAtTime): (WebCore::AudioParamTimeline::insertEvent): (WebCore::AudioParamTimeline::cancelScheduledValues): (WebCore::AudioParamTimeline::cancelAndHoldAtTime): (WebCore::AudioParamTimeline::valueForContextTime): (WebCore::AudioParamTimeline::valuesForTimeRange): * Modules/webaudio/AudioParamTimeline.h: * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::process): (WebCore::ConvolverNode::setBuffer): * Modules/webaudio/ConvolverNode.h: * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::process): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::setFormat): (WebCore::MediaStreamAudioSourceNode::process): * Modules/webaudio/MediaStreamAudioSourceNode.h: * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::process): (WebCore::OscillatorNode::setPeriodicWave): * Modules/webaudio/OscillatorNode.h: * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::process): (WebCore::PannerNode::setPanningModel): (WebCore::PannerNode::setPosition): (WebCore::PannerNode::setOrientation): (WebCore::PannerNode::setDistanceModel): (WebCore::PannerNode::setRefDistance): (WebCore::PannerNode::setMaxDistance): (WebCore::PannerNode::setRolloffFactor): (WebCore::PannerNode::setConeOuterGain): (WebCore::PannerNode::setConeOuterAngle): (WebCore::PannerNode::setConeInnerAngle): * Modules/webaudio/PannerNode.h: * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::process): * Modules/webaudio/WaveShaperProcessor.cpp: (WebCore::WaveShaperProcessor::setCurve): (WebCore::WaveShaperProcessor::setOversample): (WebCore::WaveShaperProcessor::process): * Modules/webaudio/WaveShaperProcessor.h: * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::process): (WebCore::WebKitAudioPannerNode::setPanningModel): * Modules/webaudio/WebKitAudioPannerNode.h: * platform/audio/ReverbConvolver.cpp: (WebCore::ReverbConvolver::~ReverbConvolver): (WebCore::ReverbConvolver::backgroundThreadEntry): (WebCore::ReverbConvolver::process): * platform/audio/ReverbConvolver.h: * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestinationCocoa::render): * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: (WebCore::AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC): (WebCore::AudioSourceProviderAVFObjC::provideInput): (WebCore::AudioSourceProviderAVFObjC::finalizeCallback): (WebCore::AudioSourceProviderAVFObjC::prepareCallback): (WebCore::AudioSourceProviderAVFObjC::unprepareCallback): (WebCore::AudioSourceProviderAVFObjC::processCallback): * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h: * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm: (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC): (WebCore::WebAudioSourceProviderAVFObjC::provideInput): (WebCore::WebAudioSourceProviderAVFObjC::prepare): (WebCore::WebAudioSourceProviderAVFObjC::unprepare): 2020-10-05 Enrique Ocaña González <eocanha@igalia.com> [GTK][X11] WebProcess crash in WebCore::GLContextGLX::createPbufferContext() with NVidia proprietary drivers https://bugs.webkit.org/show_bug.cgi?id=217323 Reviewed by Adrian Perez de Castro. The returnedElements variable might remain uninitialized if the glXChooseFBConfig() function call fails, leading to execution of the wrong code branch later. * platform/graphics/glx/GLContextGLX.cpp: (WebCore::GLContextGLX::createPbufferContext): Initialized the returnedElements variable. 2020-10-05 Carlos Garcia Campos <cgarcia@igalia.com> REGRESSION(r267763) [SOUP] Some tests flaky crashing in NetworkSessionSoup::soupSession() https://bugs.webkit.org/show_bug.cgi?id=217163 Reviewed by Alex Christensen. Stop using libsoup for DNS resolver. The libsoup APIs are actually using the GLib networking APIs, and the don't really use the SoupSession. Rename DNSResolveQueueSoup as DNSResolveQueueGLib and use the GLib API instead. * PlatformGTK.cmake: * PlatformWPE.cmake: * platform/Soup.cmake: * platform/SourcesGLib.txt: * platform/SourcesSoup.txt: * platform/network/DNSResolveQueue.cpp: * platform/network/glib/DNSResolveQueueGLib.cpp: Added. (WebCore::didResolveProxy): (WebCore::proxyResolvedForHttpUriCallback): (WebCore::proxyResolvedForHttpsUriCallback): (WebCore::DNSResolveQueueGLib::updateIsUsingProxy): (WebCore::DNSResolveQueueGLib::platformResolve): (WebCore::DNSResolveQueueGLib::resolve): (WebCore::DNSResolveQueueGLib::stopResolve): * platform/network/glib/DNSResolveQueueGLib.h: Renamed from Source/WebCore/platform/network/soup/DNSResolveQueueSoup.h. * platform/network/soup/DNSResolveQueueSoup.cpp: Removed. 2020-10-05 Rob Buis <rbuis@igalia.com> WebKit doesn't parse "#" as delimiter for fragment identifier in data URIs https://bugs.webkit.org/show_bug.cgi?id=68089 Reviewed by Alex Christensen, Ryosuke Niwa, and Darin Adler. To maintain compatibility with existing iOS and macOS apps, we only do this for apps linked with the SDK after the change. Covered by newly passing web platform tests (which Chrome and Firefox already passed). * loader/ResourceLoader.cpp: (WebCore::shouldStripFragmentIdentifier): (WebCore::ResourceLoader::loadDataURL): * platform/cocoa/VersionChecks.h: 2020-10-05 Aditya Keerthi <akeerthi@apple.com> [Contact Picker API] Introduce bindings for the Contact Picker API https://bugs.webkit.org/show_bug.cgi?id=216793 <rdar://problem/69317957> Reviewed by Wenson Hsieh. Added IDL for the Contact Picker API, with the exception of the address and icon contact properties (which will be added after an initial implemention is complete). See: https://wicg.github.io/contact-api/spec/ for more information. Test: contact-picker/contacts-interfaces.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/contact-picker/ContactInfo.h: Added. * Modules/contact-picker/ContactInfo.idl: Added. * Modules/contact-picker/ContactProperty.h: Added. * Modules/contact-picker/ContactProperty.idl: Added. * Modules/contact-picker/ContactsManager.cpp: Added. (WebCore::ContactsManager::create): (WebCore::ContactsManager::ContactsManager): (WebCore::ContactsManager::navigator): (WebCore::ContactsManager::getProperties): (WebCore::ContactsManager::select): Stub out these API calls for now by immediately rejecting the given promise. * Modules/contact-picker/ContactsManager.h: Added. * Modules/contact-picker/ContactsManager.idl: Added. * Modules/contact-picker/ContactsSelectOptions.h: Added. * Modules/contact-picker/ContactsSelectOptions.idl: Added. * Modules/contact-picker/NavigatorContacts.cpp: Added. (WebCore::NavigatorContacts::NavigatorContacts): (WebCore::NavigatorContacts::contacts): (WebCore::NavigatorContacts::from): (WebCore::NavigatorContacts::supplementName): * Modules/contact-picker/NavigatorContacts.h: Added. * Modules/contact-picker/Navigator+Contacts.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * page/Settings.yaml: 2020-10-05 Youenn Fablet <youenn@apple.com> MediaRecorder should respect enabled and muted tracks https://bugs.webkit.org/show_bug.cgi?id=217312 Reviewed by Eric Carlson. If track is muted, replace it by either silence (audio buffer filled with zeros) or black frames. MediaRecorderPrivate will keep track of whether the selected track should be muted. It is then the responsibility of the specialization to do the appropriate processing. Test: http/wpt/mediarecorder/mute-tracks.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::trackMutedChanged): (WebCore::MediaRecorder::trackEnabledChanged): * Modules/mediarecorder/MediaRecorder.h: * platform/audio/cocoa/WebAudioBufferList.cpp: (WebCore::WebAudioBufferList::zeroFlatBuffer): * platform/audio/cocoa/WebAudioBufferList.h: * platform/mediarecorder/MediaRecorderPrivate.cpp: (WebCore::MediaRecorderPrivate::selectTracks): (WebCore::MediaRecorderPrivate::checkTrackState): * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::trackMutedChanged): (WebCore::MediaRecorderPrivate::trackEnabledChanged): (WebCore::MediaRecorderPrivate::shouldMuteAudio const): (WebCore::MediaRecorderPrivate::shouldMuteVideo const): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): (WebCore::MediaRecorderPrivateAVFImpl::videoSampleAvailable): (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: 2020-10-05 Antoine Quint <graouts@webkit.org> Add non-animated support for the CSS rotate property https://bugs.webkit.org/show_bug.cgi?id=217320 <rdar://problem/69956248> Reviewed by Dean Jackson. We add non-animated support for the CSS "rotate" property as specifed in by the CSS Transforms Level 2 specification (https://drafts.csswg.org/css-transforms-2/#propdef-rotate). Tests: transforms/2d/rotate-and-scale-and-translate-order.html transforms/2d/rotate-and-transform-attribute-in-svg-expected.svg transforms/2d/rotate-and-transform-attribute-in-svg.svg transforms/2d/rotate-and-transform-css-property-in-svg-expected.svg transforms/2d/rotate-and-transform-css-property-in-svg.svg transforms/2d/rotate-and-translate-in-svg-expected.svg transforms/2d/rotate-and-translate-in-svg.svg transforms/2d/rotate-and-translate-order.html transforms/2d/rotate-in-svg-expected.svg transforms/2d/rotate-in-svg.svg transforms/2d/rotate-transform-order.html transforms/2d/rotate-transform-origin-order.html * Headers.cmake: * css/CSSComputedStyleDeclaration.cpp: (WebCore::computedRotate): Create a CSSValueList to print out the computed value for the "rotate" property. (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSProperties.json: Define the "rotate" property with the condition that the runtime setting for individual CSS transform properties is set. * css/CSSValueKeywords.in: Define the "z" value for the "rotate" property and ensure the "x" and "y" values are defined as well since -webkit-scroll-snap-type may not be enabled. * css/TransformFunctions.cpp: (WebCore::rotateForValue): Convert a CSSValue to a RotateTransformOperation when parsing a "rotate" property value. * css/TransformFunctions.h: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeRotate): Create a CSSValueList when parsing a "rotate" property value. (WebCore::CSSPropertyParser::parseSingleValue): * platform/graphics/transforms/RotateTransformOperation.h: * rendering/RenderObject.h: (WebCore::RenderObject::hasTransform const): Consider that having the "rotate" property is akin to having a "transform" property in the render tree. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::setRotate): (WebCore::RenderStyle::applyTransform const): Account for the RenderStyle::rotate() value in the right order, after applying the transform origin and translate, but before applying the scale and main transform. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::rotate const): (WebCore::RenderStyle::hasTransformRelatedProperty const): (WebCore::RenderStyle::initialRotate): * rendering/style/StyleRareNonInheritedData.h: * rendering/style/WillChangeData.cpp: (WebCore::WillChangeData::propertyCreatesStackingContext): * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertRotate): * svg/SVGGraphicsElement.cpp: (WebCore::SVGGraphicsElement::animatedLocalTransform const): Account for the RenderStyle::rotate() value when rendering SVG, ensuring that it is applied before the transform specified by either the "transform" CSS property or SVG attribute. 2020-10-05 Nitzan Uziely <nitzan@testim.io> WebDriver Input clear/value commands fails when target is inside shadow dom https://bugs.webkit.org/show_bug.cgi?id=209233 Reviewed by Brian Burg. Add support for nested shadow DOM in isDescendantOrShadowDescendantOf, * dom/Node.cpp: (WebCore::Node::isDescendantOrShadowDescendantOf const): * dom/Node.h: (WebCore::Node::isDescendantOrShadowDescendantOf const): 2020-10-05 John Wilander <wilander@apple.com> Storage Access API: Enable per-page storage access scope and align test cases https://bugs.webkit.org/show_bug.cgi?id=217077 <rdar://problem/69017878> Reviewed by Brent Fulgham. It was decided in https://github.com/privacycg/storage-access/issues/3 that browsers should grant storage access for all same-site resources on the whole page, not just the requesting iframe. No new tests. Existing tests aligned, including LayoutTests/http/tests/storageAccess/request-and-grant-access-with-per-page-scope-access-from-another-frame.html which no longer calls internals.settings.setStorageAccessAPIPerPageScopeEnabled(true) to opt in to the setting that is now the default. * dom/DocumentStorageAccess.cpp: (WebCore::DocumentStorageAccess::requestStorageAccess): Changed the settings check to do the reverse, i.e. assume per-page access by default and per-frame access as the exception. * dom/DocumentStorageAccess.h: Changed the default setting for m_storageAccessScope to per-page. * page/Settings.yaml: Changed the default to true for storageAccessAPIPerPageScopeEnabled. 2020-10-05 Sam Weinig <weinig@apple.com> Remove support for enabling subpixel CSSOM values, it's off by default everywhere and known to be not-compatible with the web https://bugs.webkit.org/show_bug.cgi?id=217300 Reviewed by Simon Fraser. Remove support for subpixel CSSOM values, and fixup Element interfaces that were only out of spec, returning doubles, due to the conditional support. * dom/Element+CSSOMView.idl: * dom/Element.cpp: (WebCore::adjustForLocalZoom): (WebCore::convertToNonSubpixelValue): (WebCore::adjustOffsetForZoomAndSubpixelLayout): (WebCore::Element::offsetLeftForBindings): (WebCore::Element::offsetLeft): (WebCore::Element::offsetTopForBindings): (WebCore::Element::offsetTop): (WebCore::Element::offsetWidth): (WebCore::Element::offsetHeight): (WebCore::Element::clientLeft): (WebCore::Element::clientTop): (WebCore::Element::clientWidth): (WebCore::Element::clientHeight): (WebCore::subpixelMetricsEnabled): Deleted. (WebCore::convertToNonSubpixelValueIfNeeded): Deleted. * dom/Element.h: * html/HTMLElement+CSSOMView.idl: * page/Settings.yaml: 2020-10-05 Antti Koivisto <antti@apple.com> [LFC][Integration] Move Display::InlineContent to LayoutIntegration namespace https://bugs.webkit.org/show_bug.cgi?id=217310 Reviewed by Zalan Bujtas. It is only used by the integration code Also move the related classes and rename the path independent iterator run to PathRun * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * display/DisplayView.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): * layout/displaytree/DisplayRect.h: Removed. * layout/flexformatting/FlexFormattingContext.cpp: (WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems): * layout/flexformatting/FlexFormattingState.h: (WebCore::Layout::FlexFormattingState::lines const): (WebCore::Layout::FlexFormattingState::addLine): * layout/integration/LayoutIntegrationInlineContent.cpp: Renamed from Source/WebCore/layout/displaytree/DisplayInlineContent.cpp. * layout/integration/LayoutIntegrationInlineContent.h: Renamed from Source/WebCore/layout/displaytree/DisplayInlineContent.h. * layout/integration/LayoutIntegrationLine.h: Renamed from Source/WebCore/layout/displaytree/DisplayLine.h. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::layout): (WebCore::LayoutIntegration::LineLayout::constructContent): (WebCore::LayoutIntegration::LineLayout::lineCount const): (WebCore::LayoutIntegration::LineLayout::adjustForPagination): (WebCore::LayoutIntegration::LineLayout::collectOverflow): (WebCore::LayoutIntegration::LineLayout::ensureInlineContent): (WebCore::LayoutIntegration::LineLayout::textRunsFor const): (WebCore::LayoutIntegration::LineLayout::runFor const): (WebCore::LayoutIntegration::LineLayout::paint): (WebCore::LayoutIntegration::LineLayout::hitTest): (WebCore::LayoutIntegration::LineLayout::constructDisplayContent): Deleted. (WebCore::LayoutIntegration::LineLayout::ensureDisplayInlineContent): Deleted. * layout/integration/LayoutIntegrationLineLayout.h: (WebCore::LayoutIntegration::LineLayout::inlineContent const): (WebCore::LayoutIntegration::LineLayout::displayInlineContent const): Deleted. * layout/integration/LayoutIntegrationPagination.cpp: (WebCore::LayoutIntegration::computeLineTopAndBottomWithOverflow): (WebCore::LayoutIntegration::updateMinimumPageHeight): (WebCore::LayoutIntegration::makeAdjustedContent): (WebCore::LayoutIntegration::adjustLinePositionsForPagination): * layout/integration/LayoutIntegrationPagination.h: * layout/integration/LayoutIntegrationRun.h: Renamed from Source/WebCore/layout/displaytree/DisplayRun.h. * layout/integration/LayoutIntegrationRunIterator.cpp: (WebCore::LayoutIntegration::RunIterator::RunIterator): (WebCore::LayoutIntegration::TextRunIterator::TextRunIterator): (WebCore::LayoutIntegration::LineRunIterator::LineRunIterator): (WebCore::LayoutIntegration::PathRun::modernPath): (WebCore::LayoutIntegration::PathRun::legacyPath): (WebCore::LayoutIntegration::Run::modernPath): Deleted. (WebCore::LayoutIntegration::Run::legacyPath): Deleted. * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::PathTextRun::legacyInlineBox const): (WebCore::LayoutIntegration::RunIterator::operator* const): (WebCore::LayoutIntegration::RunIterator::operator-> const): (WebCore::LayoutIntegration::TextRunIterator::operator* const): (WebCore::LayoutIntegration::TextRunIterator::operator-> const): (WebCore::LayoutIntegration::TextRunIterator::get const): (WebCore::LayoutIntegration::PathRun::PathRun): (WebCore::LayoutIntegration::PathRun::isText const): (WebCore::LayoutIntegration::PathRun::rect const): (WebCore::LayoutIntegration::PathRun::baseline const): (WebCore::LayoutIntegration::PathRun::isHorizontal const): (WebCore::LayoutIntegration::PathRun::dirOverride const): (WebCore::LayoutIntegration::PathRun::isLineBreak const): (WebCore::LayoutIntegration::PathRun::useLineBreakBoxRenderTreeDumpQuirk const): (WebCore::LayoutIntegration::PathRun::minimumCaretOffset const): (WebCore::LayoutIntegration::PathRun::maximumCaretOffset const): (WebCore::LayoutIntegration::PathRun::bidiLevel const): (WebCore::LayoutIntegration::PathRun::onSameLine const): (WebCore::LayoutIntegration::PathRun::legacyInlineBox const): (WebCore::LayoutIntegration::PathTextRun::hasHyphen const): (WebCore::LayoutIntegration::PathTextRun::PathTextRun): (WebCore::LayoutIntegration::PathTextRun::text const): (WebCore::LayoutIntegration::PathTextRun::localStartOffset const): (WebCore::LayoutIntegration::PathTextRun::localEndOffset const): (WebCore::LayoutIntegration::PathTextRun::length const): (WebCore::LayoutIntegration::PathTextRun::isLastTextRunOnLine const): (WebCore::LayoutIntegration::PathTextRun::isLastTextRun const): (isType): (WebCore::LayoutIntegration::Run::leftmostCaretOffset const): Deleted. (WebCore::LayoutIntegration::Run::rightmostCaretOffset const): Deleted. (WebCore::LayoutIntegration::Run::direction const): Deleted. (WebCore::LayoutIntegration::Run::isLeftToRightDirection const): Deleted. (WebCore::LayoutIntegration::TextRun::legacyInlineBox const): Deleted. (WebCore::LayoutIntegration::Run::Run): Deleted. (WebCore::LayoutIntegration::Run::isText const): Deleted. (WebCore::LayoutIntegration::Run::rect const): Deleted. (WebCore::LayoutIntegration::Run::baseline const): Deleted. (WebCore::LayoutIntegration::Run::isHorizontal const): Deleted. (WebCore::LayoutIntegration::Run::dirOverride const): Deleted. (WebCore::LayoutIntegration::Run::isLineBreak const): Deleted. (WebCore::LayoutIntegration::Run::useLineBreakBoxRenderTreeDumpQuirk const): Deleted. (WebCore::LayoutIntegration::Run::minimumCaretOffset const): Deleted. (WebCore::LayoutIntegration::Run::maximumCaretOffset const): Deleted. (WebCore::LayoutIntegration::Run::bidiLevel const): Deleted. (WebCore::LayoutIntegration::Run::onSameLine const): Deleted. (WebCore::LayoutIntegration::Run::legacyInlineBox const): Deleted. (WebCore::LayoutIntegration::TextRun::hasHyphen const): Deleted. (WebCore::LayoutIntegration::TextRun::TextRun): Deleted. (WebCore::LayoutIntegration::TextRun::text const): Deleted. (WebCore::LayoutIntegration::TextRun::localStartOffset const): Deleted. (WebCore::LayoutIntegration::TextRun::localEndOffset const): Deleted. (WebCore::LayoutIntegration::TextRun::length const): Deleted. (WebCore::LayoutIntegration::TextRun::isLastTextRunOnLine const): Deleted. (WebCore::LayoutIntegration::TextRun::isLastTextRun const): Deleted. * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::ModernPath::ModernPath): (WebCore::LayoutIntegration::ModernPath::runs const): (WebCore::LayoutIntegration::ModernPath::run const): (WebCore::LayoutIntegration::ModernPath::line const): * layout/layouttree/LayoutTreeBuilder.cpp: * rendering/RenderTreeAsText.cpp: (WebCore::write): (WebCore::writeTextRun): Deleted. * rendering/TextPainter.cpp: (WebCore::TextPainter::clearGlyphDisplayLists): 2020-10-05 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Enable non-uniform line height content with floats https://bugs.webkit.org/show_bug.cgi?id=217306 Reviewed by Antti Koivisto. Expand coverage now that we support non-uniform line heights. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForLineLayoutWithReason): 2020-10-05 Alex Christensen <achristensen@webkit.org> Unify linkedOnOrAfter duplicate code and use SPI/WebCoreTestSupport instead of NSUserDefaults https://bugs.webkit.org/show_bug.cgi?id=217239 Reviewed by Darin Adler. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/VersionChecks.h: Renamed from Source/WebKit/UIProcess/Cocoa/VersionChecks.h. * platform/cocoa/VersionChecks.mm: Renamed from Source/WebKit/UIProcess/Cocoa/VersionChecks.mm. (WebCore::linkedOnOrAfter): * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::setLinkedOnOrAfterEverythingForTesting): * testing/js/WebCoreTestSupport.h: 2020-10-05 Antti Koivisto <antti@apple.com> [LFC][Integration] Avoid ensureLineBoxes for some call sites of inlineBoxAndOffset https://bugs.webkit.org/show_bug.cgi?id=217225 Reviewed by Zalan Bujtas. Separate inlineRunAndOffset from inlineBoxAndOffset. The formet returns iterator while the later forces the legacy path. Use inlineRunAndOffset in a few places. * dom/Position.cpp: (WebCore::Position::rendersInDifferentPosition const): (WebCore::Position::inlineRunAndOffset const): (WebCore::Position::inlineBoxAndOffset const): (WebCore::Position::ensureLineBoxes const): (WebCore::InlineBoxAndOffset::InlineBoxAndOffset): Deleted. * dom/Position.h: (WebCore::InlineBoxAndOffset::InlineBoxAndOffset): * editing/FrameSelection.cpp: (WebCore::FrameSelection::directionOfSelection): * editing/VisiblePosition.h: (WebCore::VisiblePosition::inlineRunAndOffset const): * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForFontAndText): * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::Run::onSameLine const): * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: (WebCore::LayoutIntegration::LegacyPath::onSameLine const): (WebCore::LayoutIntegration::LegacyPath::atEnd const): * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::ModernPath::onSameLine const): (WebCore::LayoutIntegration::ModernPath::atEnd const): * platform/DragImage.cpp: * rendering/RenderTextLineBoxes.h: 2020-10-05 Rob Buis <rbuis@igalia.com> Make xhr.response more conforming to the specification https://bugs.webkit.org/show_bug.cgi?id=217296 Reviewed by Darin Adler. Make xhr.response more conforming to the specification when dealing with Blob type responses, the type for the Blob should be computed by the "get a final MIME type" algorithm [1, 2]. Behavior matches Firefox. Test: imported/w3c/web-platform-tests/xhr/overridemimetype-blob.html [1] https://xhr.spec.whatwg.org/#ref-for-final-mime-type③ [2] https://xhr.spec.whatwg.org/#final-mime-type * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createResponseBlob): (WebCore::XMLHttpRequest::responseMIMEType const): * xml/XMLHttpRequest.h: 2020-10-04 Antoine Quint <graouts@webkit.org> Add non-animated support for the CSS scale property https://bugs.webkit.org/show_bug.cgi?id=217291 <rdar://problem/69926254> Reviewed by Simon Fraser. We add non-animated support for the CSS "scale" property as specifed in by the CSS Transforms Level 2 specification (https://drafts.csswg.org/css-transforms-2/#propdef-scale). Tests: transforms/2d/scale-and-transform-attribute-in-svg-expected.svg transforms/2d/scale-and-transform-attribute-in-svg.svg transforms/2d/scale-and-transform-css-property-in-svg-expected.svg transforms/2d/scale-and-transform-css-property-in-svg.svg transforms/2d/scale-and-translate-in-svg-expected.svg transforms/2d/scale-and-translate-in-svg.svg transforms/2d/scale-and-translate-order.html transforms/2d/scale-in-svg-expected.svg transforms/2d/scale-in-svg.svg transforms/2d/scale-transform-order.html transforms/2d/scale-transform-origin-order.html * Headers.cmake: * css/CSSComputedStyleDeclaration.cpp: (WebCore::computedTranslate): Remove the extraneous is<RenderInline> check which is already covered by rendererCanBeTransformed(). (WebCore::computedScale): Create a CSSValueList to print out the computed value for the "scale" property. (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSProperties.json: Define the "scale" property with the condition that the runtime setting for individual CSS transform properties is set. * css/TransformFunctions.cpp: (WebCore::scaleForValue): Convert a CSSValue to a TranslateTransformOperation when parsing a "scale" property value. * css/TransformFunctions.h: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeScale): Create a CSSValueList when parsing a "scale" property value. (WebCore::CSSPropertyParser::parseSingleValue): * platform/graphics/transforms/ScaleTransformOperation.h: * rendering/RenderObject.h: (WebCore::RenderObject::hasTransform const): Consider that having the "scale" property is akin to having a "transform" property in the render tree. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::setScale): (WebCore::RenderStyle::applyTransform const): Account for the RenderStyle::scale() value in the right order, after applying the transform origin and translate, but before applying the main transform. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::scale const): (WebCore::RenderStyle::hasTransformRelatedProperty const): (WebCore::RenderStyle::initialScale): * rendering/style/StyleRareNonInheritedData.h: * rendering/style/WillChangeData.cpp: (WebCore::WillChangeData::propertyCreatesStackingContext): * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertScale): * svg/SVGGraphicsElement.cpp: (WebCore::SVGGraphicsElement::animatedLocalTransform const): Account for the RenderStyle::scale() value when rendering SVG, ensuring that it is applied before the transform specified by either the "transform" CSS property or SVG attribute. 2020-10-05 Rob Buis <rbuis@igalia.com> MIME type parser should skip trailing HTTP whitespace https://bugs.webkit.org/show_bug.cgi?id=217179 Reviewed by Darin Adler. MIME type parser should skip trailing HTTP whitespace in Mimesniff mode [1]. [1] https://mimesniff.spec.whatwg.org/#parse-a-mime-type (Steps 8 and 11.9.2) * platform/network/ParsedContentType.cpp: (WebCore::parseToken): 2020-10-04 Rob Buis <rbuis@igalia.com> DataTransfer.setDragImage takes a non nullable Element parameter https://bugs.webkit.org/show_bug.cgi?id=217283 Reviewed by Sam Weinig. DataTransfer.setDragImage takes a non nullable Element parameter [1]. Behavior matches Firefox and Chrome. Test: fast/events/setDragImage-element-non-nullable.html [1] https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-setdragimage * dom/DataTransfer.cpp: (WebCore::DataTransfer::setDragImage): * dom/DataTransfer.h: * dom/DataTransfer.idl: * page/EventHandler.cpp: (WebCore::EventHandler::handleDrag): 2020-10-04 Zalan Bujtas <zalan@apple.com> [LFC][Floats] Do not assert when right aligned float overflows the containing block on the left https://bugs.webkit.org/show_bug.cgi?id=217305 Reviewed by Antti Koivisto. It's okay for a float: right; to overflow the containing block on the left. In such cases let's just constrain the logical right value by the logical left edge. Test: fast/layoutformattingcontext/intrusive-floats-takes-entire-horizontal-space.html * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::constraintsForLine): 2020-10-04 Fujii Hironori <Hironori.Fujii@sony.com> [curl] WebSocket tests are failing since r267931 https://bugs.webkit.org/show_bug.cgi?id=217298 Reviewed by Darin Adler. "http:" is a invalid URL since r267931. Change the way how to construct a URL for libcurl. * platform/network/curl/CurlStream.cpp: (WebCore::CurlStream::CurlStream): Construct the URL just by replacing the scheme part. Removed a local variable urlForConnection. 2020-10-04 Sam Weinig <weinig@apple.com> [WebIDL] Address consistency around [SameObject] extended attributes https://bugs.webkit.org/show_bug.cgi?id=217303 Reviewed by Darin Adler. There isn't any real value in keeping comments around in the IDLs saying: // FIXME: Add [SameObject] once it is supported It's unclear what we would want the bindings generator to do with [SameObject], perhaps for wrapper types, assert if the implementation doesn't return the same object each time in a debug build, perhaps error out if a non-wrapper type doesn't also have CachedAttribute or maybe just have SameObject imply it. Regardless, in the mean time, there is no harm in just annotating the types with the attribute and letting the generator do nothing while we think. * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchResponse.idl: * Modules/mediastream/MediaStreamTrackEvent.idl: * css/DocumentOrShadowRoot+CSSOM.idl: * css/ElementCSSInlineStyle.idl: * dom/DOMQuad.idl: * dom/DataTransfer.idl: * dom/Document+HTML.idl: * dom/Document+HTMLObsolete.idl: * dom/Document.idl: * dom/Element.idl: * dom/MutationRecord.idl: * dom/Node.idl: * dom/NodeIterator.idl: * dom/ParentNode.idl: * dom/TreeWalker.idl: * html/HTMLOrForeignElement.idl: * html/HTMLSelectElement.idl: * page/Location.idl: * svg/SVGFitToViewBox.idl: 2020-10-04 Tyler Wilcock <twilco.o@protonmail.com> Presence of CSS variable causes a background url() to get resolved with a different base https://bugs.webkit.org/show_bug.cgi?id=198512 Reviewed by Darin Adler. Prior to this patch, `url()`s within `CSSPendingSubstitutionValue`s were resolved relative to the document root rather than the stylesheet they were created from, which is wrong. With this patch, when `CSSPendingSubstitutionValue`s are created, they now store the base URL that should be used when they are later resolved in `StyleBuilder`. Test: fast/css/variables/url-with-variable-is-sheet-relative.html * css/CSSPendingSubstitutionValue.h: Store `baseURL` for later resolution. (WebCore::CSSPendingSubstitutionValue::create): Add `baseURL` parameter. (WebCore::CSSPendingSubstitutionValue::baseURL const): Add `m_baseURL` getter. (WebCore::CSSPendingSubstitutionValue::CSSPendingSubstitutionValue): Add `baseURL` parameter. * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseValueStart): When creating a `CSSPendingSubstitutionValue`, also pass along the `baseURL` from this context for later resolution. * style/StyleBuilder.cpp: (WebCore::Style::Builder::resolvedVariableValue): If the value we are resolving is a `CSSPendingSubstitutionValue`, resolve it relative to the `baseURL` it has stored. 2020-10-04 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Enable soft hyphen https://bugs.webkit.org/show_bug.cgi?id=217293 Reviewed by Antti Koivisto. Let's expand IFC coverage with soft hyphen rendering. * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForText): 2020-10-04 Zalan Bujtas <zalan@apple.com> [LFC][IFC][Soft hyphen] Fix the case when the first content overflows with hyphen https://bugs.webkit.org/show_bug.cgi?id=217295 Reviewed by Antti Koivisto. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::rebuildLineForTrailingSoftHyphen): 2020-10-04 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Remove Line::appendPartialTrailingTextItem special case https://bugs.webkit.org/show_bug.cgi?id=217287 Reviewed by Antti Koivisto. Use the newly added Line::addTrailingHyphen to display hyphen for partial content. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::append): (WebCore::Layout::Line::appendTextContent): (WebCore::Layout::Line::Run::Run): (WebCore::Layout::Line::appendPartialTrailingTextItem): Deleted. (WebCore::Layout::Line::appendWith): Deleted. * layout/inlineformatting/InlineLine.h: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::commitPartialContent): * layout/inlineformatting/InlineLineRun.h: (WebCore::Layout::LineRun::Text::Text): 2020-10-04 Zalan Bujtas <zalan@apple.com> [LFC][IFC][Soft hyphen] Reset Line::m_trailingSoftHyphenWidth when the text content does not end with a soft hyphen https://bugs.webkit.org/show_bug.cgi?id=217292 Reviewed by Antti Koivisto. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::appendTextContent): 2020-10-04 Zalan Bujtas <zalan@apple.com> [LFC][IFC][Soft hyphen] endsWithSoftWrapOpportunity should check if hyphenation is disabled https://bugs.webkit.org/show_bug.cgi?id=217288 Reviewed by Antti Koivisto. This is very similar InlineTextItem::createAndAppendTextItems where we also construct a LazyLineBreakIterator to check for word wrap opportunities. * layout/inlineformatting/InlineContentBreaker.cpp: (WebCore::Layout::isTextContent): The trailing "only" is misleading since we can't have a mixture of text and non-text content within a continuous content (there's always a word wrap opportunity between a text and a non-text content). (WebCore::Layout::isVisuallyEmptyWhitespaceContent): (WebCore::Layout::InlineContentBreaker::processInlineContent): (WebCore::Layout::InlineContentBreaker::processOverflowingContent const): (WebCore::Layout::isTextContentOnly): Deleted. (WebCore::Layout::isVisuallyEmptyWhitespaceContentOnly): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::endsWithSoftWrapOpportunity): 2020-10-04 Youenn Fablet <youenn@apple.com> Make sure MediaRecorder does not call fetchData until the last fetchData is completed https://bugs.webkit.org/show_bug.cgi?id=217276 Reviewed by Darin Adler. When fetchData is called while an existing fetchData is inflight, enqueue the callback in a deque. When the inflight fetchData completes, call the enqueued callbacks in order with a null blob. Add ASSERT in MediaRecorderPrivateWriter to make sure we do not call requestMediaDataWhenReadyOnQueue too many times. Covered by updated http/wpt/mediarecorder/MediaRecorder-dataavailable.html. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::requestData): Do not enable the timer if MediaRecorder is not active as a small optimization. (WebCore::MediaRecorder::fetchData): * Modules/mediarecorder/MediaRecorder.h: * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::fetchData): * platform/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers): 2020-10-03 Oriol Brufau <obrufau@igalia.com> [css-lists] Implement list-style-type: <string> https://bugs.webkit.org/show_bug.cgi?id=167729 Reviewed by Darin Adler. This patch extends the syntax of the list-style-type property to accept arbitrary string values in order to customize the marker contents. When a string is specified for list-style-type, the patch sets it to a special ListStyleType::String, and the string value is stored in an extra field. It's a reland of r252076, which got reverted because in some platform the number of bitfields in GreaterThanOrSameSizeAsStyleRareInheritedData was actually smaller than in StyleRareInheritedData, due to padding differences. Hopefully this will no longer be an issue. Tests: imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001a.html imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-001b.html imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-002.html imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-003.html imported/w3c/web-platform-tests/css/css-lists/list-style-type-string-007.html imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-computed.html imported/w3c/web-platform-tests/css/css-lists/parsing/list-style-type-valid.html imported/w3c/web-platform-tests/css/css-pseudo/marker-hit-testing.html imported/w3c/web-platform-tests/css/css-pseudo/marker-intrinsic-contribution-001.html Some tests fail because mixed-bidi is not supported in markers (https://bugs.webkit.org/show_bug.cgi?id=202849). * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): * css/CSSProperties.json: * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isPartialKeywordPropertyID): * css/parser/CSSParserFastPaths.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): * rendering/RenderListMarker.cpp: (WebCore::effectiveListMarkerType): (WebCore::listMarkerSuffix): (WebCore::listMarkerText): (WebCore::RenderListMarker::styleDidChange): (WebCore::RenderListMarker::paint): (WebCore::RenderListMarker::updateContent): (WebCore::RenderListMarker::computePreferredLogicalWidths): (WebCore::RenderListMarker::updateMargins): (WebCore::RenderListMarker::suffix const): (WebCore::RenderListMarker::getRelativeMarkerRect): * rendering/style/CounterContent.h: (WebCore::CounterContent::CounterContent): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::listStyleStringValue const): (WebCore::RenderStyle::setListStyleStringValue): (WebCore::RenderStyle::initialListStyleStringValue): * rendering/style/RenderStyleConstants.cpp: (WebCore::operator<<): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator== const): * rendering/style/StyleRareInheritedData.h: * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyInheritListStyleType): (WebCore::Style::BuilderCustom::applyInitialListStyleType): (WebCore::Style::BuilderCustom::applyValueListStyleType): 2020-10-03 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Add onslotchange on ShadowRoot and GlobalEventHandlers https://bugs.webkit.org/show_bug.cgi?id=191310 Reviewed by Sam Weinig. `onslotchange` attribute has been added to `ShadowRoot` and `GlobalEventHandlers` by https://github.com/whatwg/html/issues/3487 - https://github.com/whatwg/dom/pull/78 - https://github.com/whatwg/html/pull/4129 This patch supports it. Tests: imported/w3c/web-platform-tests/dom/idlharness.window.html: imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-all-global-events.html imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-body-window.html imported/w3c/web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-windowless-body.html imported/w3c/web-platform-tests/mathml/relations/html5-tree/math-global-event-handlers.tentative.html * dom/GlobalEventHandlers.idl: * dom/ShadowRoot.idl: * html/HTMLAttributeNames.in: * html/HTMLElement.cpp: (WebCore::HTMLElement::createEventHandlerNameMap): 2020-10-03 Yusuke Suzuki <ysuzuki@apple.com> [JSC] Introduce JITOperationList to validate JIT-caged pointers https://bugs.webkit.org/show_bug.cgi?id=217261 Reviewed by Saam Barati. We should have WebCore::initialize(). It is filed in https://bugs.webkit.org/show_bug.cgi?id=217270. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMBuiltinConstructor.h: * bindings/js/JSDOMConstructor.h: * bindings/js/JSDOMLegacyFactoryFunction.h: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::initializeMainThread): * bindings/js/WebCoreJITOperations.cpp: Copied from Source/WebKit/Shared/WebKit2Initialize.cpp. (WebCore::populateJITOperations): * bindings/js/WebCoreJITOperations.h: Copied from Source/WebKit/Shared/WebKit2Initialize.cpp. * bindings/scripts/CodeGeneratorJS.pm: (GenerateConstructorDefinitions): * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: * bridge/objc/WebScriptObject.mm: (+[WebScriptObject initialize]): * domjit/JSDocumentDOMJIT.cpp: * platform/cocoa/SharedBufferCocoa.mm: (+[WebCoreSharedBufferData initialize]): * platform/ios/wak/WebCoreThread.mm: (RunWebThread): 2020-10-03 Antoine Quint <graouts@webkit.org> Add non-animated support for the CSS translate property https://bugs.webkit.org/show_bug.cgi?id=216997 <rdar://problem/69597083> Reviewed by Simon Fraser. We add non-animated support for the CSS "translate" property as specifed in by the CSS Transforms Level 2 specification (https://drafts.csswg.org/css-transforms-2/#propdef-translate). Tests: transforms/2d/translate-and-transform-attribute-in-svg-expected.svg transforms/2d/translate-and-transform-attribute-in-svg.svg transforms/2d/translate-and-transform-css-property-in-svg-expected.svg transforms/2d/translate-and-transform-css-property-in-svg.svg transforms/2d/translate-in-svg-expected.svg transforms/2d/translate-in-svg.svg transforms/2d/translate-transform-order.html transforms/2d/translate-transform-origin-order.html * Headers.cmake: * css/CSSComputedStyleDeclaration.cpp: (WebCore::rendererCanBeTransformed): (WebCore::computedTransform): (WebCore::computedTranslate): Create a CSSValueList to print out the computed value for the "translate" property. (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSProperties.json: Define the "translate" property with the condition that the runtime setting for individual CSS transform properties is set. * css/TransformFunctions.cpp: (WebCore::translateForValue): Convert a CSSValue to a TranslateTransformOperation when parsing a "translate" property value. * css/TransformFunctions.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): Add a new flag indicating whether the runtime setting for individual CSS transform properties is set. (WebCore::operator==): * css/parser/CSSParserContext.h: (WebCore::CSSParserContextHash::hash): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeTranslate): Create a CSSValueList when parsing a "translate" property value. (WebCore::CSSPropertyParser::parseSingleValue): * platform/graphics/transforms/TranslateTransformOperation.h: Promote the apply() method to be public so that it can be called from Style::ComputedStyleExtractor::valueForPropertyInStyle(). * rendering/RenderObject.h: (WebCore::RenderObject::hasTransform const): Consider that having the "translate" property is akin to having a "transform" property in the render tree. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::setTranslate): (WebCore::RenderStyle::applyTransform const): Account for the RenderStyle::translate() value in the right order, after applying the transform origin, but before applying the main transform. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::translate const): (WebCore::RenderStyle::hasTransformRelatedProperty const): (WebCore::RenderStyle::initialTranslate): * rendering/style/StyleRareNonInheritedData.h: * rendering/style/WillChangeData.cpp: (WebCore::WillChangeData::propertyCreatesStackingContext): * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertTranslate): * svg/SVGGraphicsElement.cpp: (WebCore::SVGGraphicsElement::animatedLocalTransform const): Account for the RenderStyle::translate() value when rendering SVG, ensuring that it is applied before the transform specified by either the "transform" CSS property or SVG attribute. 2020-10-03 Zalan Bujtas <zalan@apple.com> [LFC] showLayoutTree should group line runs under individual lines https://bugs.webkit.org/show_bug.cgi?id=217282 Reviewed by Simon Fraser. Let's improve inline run output by grouping runs: line at (0.00,0.00) size 0.00x18.00 baseline at (14.00) text run at (0.00,0.00) size 15.10x18.00 run(0, 2) text run at (15.10,0.00) size 0.00x18.00 run(0, 1) line at (0.00,18.00) size 0.00x18.00 baseline at (14.00) text run at (0.00,0.00) size 39.09x18.00 run(0, 5) instead of: line at (0.00,0.00) size 0.00x18.00 baseline at (14.00) line at (0.00,18.00) size 0.00x18.00 baseline at (14.00) text run at (0.00,0.00) size 15.10x18.00 run(0, 2) text run at (15.10,0.00) size 0.00x18.00 run(0, 1) text run at (0.00,0.00) size 39.09x18.00 run(0, 5) So that we can tell which run belongs to which line. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): 2020-10-03 Sam Weinig <weinig@apple.com> [WebIDL] Split more IDL files by spec https://bugs.webkit.org/show_bug.cgi?id=217279 Reviewed by Darin Adler. - Splits out more partial and mixin interfaces from Element, Range, HTMLBodyElement, HTMLImageElement and DOMWindow. - Renames HTMLMediaElementAudioOutput.idl to HTMLMediaElement+AudioOutput.idl for consistency with all other partial interfaces. - Replace GlobalCrypto and GlobalPerformance with WindowOrWorkerGlobalScope partials as currently speced. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Document.idl: * dom/Element+CSSOMView.idl: Added. * dom/Element+Fullscreen.idl: Added. * dom/Element+PointerEvents.idl: Added. * dom/Element+PointerLock.idl: Added. * dom/Element.idl: * dom/Range+CSSOMView.idl: Added. * dom/Range+DOMParsing.idl: Added. * dom/Range.idl: * html/HTMLBodyElement+Compat.idl: Added. * html/HTMLBodyElement.idl: * html/HTMLImageElement+CSSOMView.idl: Added. * html/HTMLImageElement.idl: * html/HTMLMediaElement+AudioOutput.idl: Added. * html/HTMLMediaElementAudioOutput.idl: Removed. * page/DOMWindow+CSSOM.idl: Added. * page/DOMWindow+CSSOMView.idl: Added. * page/DOMWindow+Compat.idl: Added. * page/DOMWindow+DeviceMotion.idl: Added. * page/DOMWindow+DeviceOrientation.idl: Added. * page/DOMWindow+RequestIdleCallback.idl: Added. * page/DOMWindow+Selection.idl: Added. * page/DOMWindow+VisualViewport.idl: Added. * page/DOMWindow.idl: * page/GlobalCrypto.idl: Removed. * page/GlobalPerformance.idl: Removed. * page/WindowEventHandlers.idl: * page/WindowLocalStorage.idl: Added. * page/WindowOrWorkerGlobalScope+Crypto.idl: Added. * page/WindowOrWorkerGlobalScope+Performance.idl: Added. * page/WindowSessionStorage.idl: Added. * workers/WorkerGlobalScope.idl: 2020-10-03 Adrian Perez de Castro <aperez@igalia.com> [GTK] Build broken with ENABLE_MEDIA_STREAM enabled and ENABLE_WEB_RTC_DISABLED https://bugs.webkit.org/show_bug.cgi?id=217128 Remove USE(LIBWEBRTC) guards from media stream code, as it does not actually depend on libwebrtc and can be built by itself. This allows using e.g. live audio recording inputs with WebAudio. Reviewed by Philippe Normand. No new tests needed. * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp: * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h: * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp: (WebCore::GStreamerAudioCapturer::GStreamerAudioCapturer): * platform/mediastream/gstreamer/GStreamerAudioCapturer.h: * platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h: * platform/mediastream/gstreamer/GStreamerCapturer.cpp: * platform/mediastream/gstreamer/GStreamerCapturer.h: * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: * platform/mediastream/gstreamer/GStreamerVideoCapturer.h: * platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp: * platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.h: * platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp: * platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.h: * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp: * platform/mock/MockRealtimeAudioSource.cpp: * platform/mock/MockRealtimeVideoSource.cpp: 2020-10-03 Zalan Bujtas <zalan@apple.com> [LFC][IFC][Soft hyphen] Mark the last run on the line when hyphenation is required. https://bugs.webkit.org/show_bug.cgi?id=217281 Reviewed by Antti Koivisto. In this patch we turn the trailing soft hyphen into an "real" hyphen when the content requires it. * layout/inlineformatting/InlineContentBreaker.cpp: (WebCore::Layout::InlineContentBreaker::processInlineContent): * layout/inlineformatting/InlineContentBreaker.h: * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::addTrailingHyphen): * layout/inlineformatting/InlineLine.h: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): (WebCore::Layout::LineBuilder::rebuildLineForTrailingSoftHyphen): 2020-10-03 Alex Christensen <achristensen@webkit.org> "http:" should not be a valid URL https://bugs.webkit.org/show_bug.cgi?id=217250 Reviewed by Brady Eidson. * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::topOriginURL): Fix strange code written in r226257 that relied on the ability to assemble URLs starting with the protocol only. 2020-10-03 Myles C. Maxfield <mmaxfield@apple.com> [GPU Process] Support drawing text in 2D canvas with font features https://bugs.webkit.org/show_bug.cgi?id=206118 Reviewed by Wenson Hsieh. This patch simply serializes all the non-derived data in Font and FontPlatformData. Serializing a CTFont involves serializing its font descriptor's attributes. However, there's an extra step for web fonts, since the font descriptor's attributes don't include the raw bytes of the font file. This was previously being saved in Font, but this patch moves that into FontPlatformData because of layering, and adds the SharedBuffer to the serialization routine for web fonts. Test: fast/canvas/fill-text-with-font-features.html * WebCore.xcodeproj/project.pbxproj: * css/CSSFontFace.cpp: (WebCore::CSSFontFace::font): Fonts and FontPlatformDatas are supposed to be immutable, so having a setter for the FontFaceData is incorrect. This object is moved into the constructor instead. * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::font): Deleting dead code. * platform/graphics/Font.cpp: (WebCore::Font::setFontFaceData): Deleted. * platform/graphics/Font.h: (WebCore::Font::fontFaceData const): Deleted. Moved to FontPlatformData * platform/graphics/FontPlatformData.cpp: (WebCore::FontPlatformData::FontPlatformData): * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::creationData const): Moved from Font. * platform/graphics/coretext/FontPlatformDataCoreText.cpp: (WebCore::FontPlatformData::FontPlatformData): * platform/graphics/mac/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): FontCustomPlatformData is a struct, so there's no need for the m_ prefixes. (WebCore::createFontCustomPlatformData): * platform/graphics/mac/FontCustomPlatformData.h: (WebCore::FontCustomPlatformData::FontCustomPlatformData): Ditto. 2020-10-03 Sam Weinig <weinig@apple.com> Simplify and harden idl_files.tmp generation https://bugs.webkit.org/show_bug.cgi?id=217247 Reviewed by Darin Adler. We sometimes see idl_files.tmp not getting deleted and on the next compile things failing. Instead of relying on the delete happening, we now just completely regenerate the file, now renamed to IDLFileNamesList.txt, each time in one shot. * DerivedSources.make: 2020-10-03 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Rename InlineContentBreaker::Result::Action::Push to Wrap https://bugs.webkit.org/show_bug.cgi?id=217273 Reviewed by Antti Koivisto. "Wrap" is a more suitable name in this context. * layout/inlineformatting/InlineContentBreaker.cpp: (WebCore::Layout::isWrappingAllowed): (WebCore::Layout::InlineContentBreaker::processInlineContent): (WebCore::Layout::InlineContentBreaker::processOverflowingContent const): * layout/inlineformatting/InlineContentBreaker.h: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): 2020-10-03 Zalan Bujtas <zalan@apple.com> [LFC][IFC][Soft hyphen] Rebuild the line when need to revert to a previous wrap opportunity due to soft hyphens https://bugs.webkit.org/show_bug.cgi?id=217272 Reviewed by Antti Koivisto. This patch reverts the line to a previous wrap opportunity where 1. the trailing soft hyphen fits or 2. no need for soft hyphen (we reverted back to a non-text inline content, where we don't need a hyphen) or 3. reverted all the way back to the beginning of the line. (We still don't paint hyphens at the soft hyphen locations.) * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): (WebCore::Layout::LineBuilder::rebuildLine): (WebCore::Layout::LineBuilder::rebuildLineForTrailingSoftHyphen): * layout/inlineformatting/InlineLineBuilder.h: 2020-10-03 Zalan Bujtas <zalan@apple.com> [LFC][IFC][Soft hyphen] InlineContentBreaker should return Action::Revert when the trailing soft hyphen does not fit https://bugs.webkit.org/show_bug.cgi?id=217269 Reviewed by Antti Koivisto. A trailing soft hyphen turns action "Push" to action "Revert" when the hyphen overflows. e.g <div>1­2­3­4</div> line has: 123­ and when '4' overflows InlineContentBreaker normally returns with Action::Push ('4' is pushed over to the next line). However Action::Push turns the trailing soft hyphen into a visible hyphen and now we need to check if 'Push' is actually a 'Revert' instead. * layout/inlineformatting/InlineContentBreaker.cpp: (WebCore::Layout::InlineContentBreaker::processInlineContent): (WebCore::Layout::InlineContentBreaker::processOverflowingContent const): (WebCore::Layout::InlineContentBreaker::tryBreakingTextRun const): * layout/inlineformatting/InlineContentBreaker.h: * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::initialize): (WebCore::Layout::Line::appendWith): (WebCore::Layout::Line::appendTextContent): (WebCore::Layout::Line::appendNonReplacedInlineBox): (WebCore::Layout::Line::appendLineBreak): * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::trailingSoftHyphenWidth const): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): 2020-10-03 Zalan Bujtas <zalan@apple.com> Floating-point math causes shrink-wrapped content to line wrap sometimes https://bugs.webkit.org/show_bug.cgi?id=217136 <rdar://problem/69801790> Reviewed by Antti Koivisto. Since the preferred width computation and the actual inline layout run though different codepaths, they may compute slightly different content width due to the limited floating point precision. Use WTF::areEssentiallyEqual when deciding if the content overflows the current line. * rendering/line/LineWidth.cpp: (WebCore::LineWidth::fitsOnLineIncludingExtraWidth const): (WebCore::LineWidth::fitsOnLineExcludingTrailingWhitespace const): (WebCore::LineWidth::fitsOnLineExcludingTrailingCollapsedWhitespace const): 2020-10-03 Zalan Bujtas <zalan@apple.com> [LFC][IFC][Soft hyphen] Do not split InlineItems at soft hyphens when hyphenations is disabled https://bugs.webkit.org/show_bug.cgi?id=217266 Reviewed by Antti Koivisto. -webkit-hyphens: none; disables hyphenation. Soft hyphens are not wrap opportunities anymore. <div>1­2­3­4</div> generates one InlineTextItem: [1­2­3­4]. * layout/inlineformatting/InlineTextItem.cpp: (WebCore::Layout::InlineTextItem::createAndAppendTextItems): 2020-10-03 Zalan Bujtas <zalan@apple.com> [LFC][IFC][Soft hyphen] LineBuilder should hold on to all the wrap opportunities https://bugs.webkit.org/show_bug.cgi?id=217265 Reviewed by Antti Koivisto. This is in preparation for adding support for reverting content when the soft hyphen overflows the line so as the last wrap opportunity InlineTextItem. In such cases we need to go further back(front) on the line and revert even more content. e.g <div>1­2­3­4</div> Depending on the horizontal constraint the first line may be: 1- 12- 123- 1234 If character '4' overflows the line, we would go with '123-' by reverting to the last wrap opportunity. However in case of a wide hyphen, '123-' may overflow the line as well and we have to revert the content further back to e.g. '12-' or even '1-'. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::initialize): (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): (WebCore::Layout::LineBuilder::rebuildLine): * layout/inlineformatting/InlineLineBuilder.h: 2020-10-03 Zalan Bujtas <zalan@apple.com> [LFC][IFC][Soft hyphen] Soft hyphen is always the trailing character https://bugs.webkit.org/show_bug.cgi?id=217264 Reviewed by Antti Koivisto. Soft hyphen is a word wrap opportunity. An InlineTextItem can only have one trailing soft hyphen. e.g <span>before­after</span> generates 2 separate InlineTextItems: [before-][after]. InlineTextItem should be able to tell if it ends with a soft hyphen. * layout/inlineformatting/InlineItem.cpp: * layout/inlineformatting/InlineItem.h: * layout/inlineformatting/InlineTextItem.cpp: (WebCore::Layout::InlineTextItem::createAndAppendTextItems): * layout/inlineformatting/InlineTextItem.h: (WebCore::Layout::InlineTextItem::hasTrailingSoftHyphen const): (WebCore::Layout::InlineTextItem::createWhitespaceItem): (WebCore::Layout::InlineTextItem::createNonWhitespaceItem): (WebCore::Layout::InlineTextItem::InlineTextItem): (WebCore::Layout::InlineTextItem::left const): (WebCore::Layout::InlineTextItem::right const): 2020-10-02 Yusuke Suzuki <ysuzuki@apple.com> std::once_flag must be allocated in static storage https://bugs.webkit.org/show_bug.cgi?id=217271 Reviewed by Mark Lam. If the std::once_flag is a non-static variable, it will not prevent us from calling it multiple times. * platform/text/TextCodecSingleByte.cpp: (WebCore::tableForEncoding): 2020-10-02 Wenson Hsieh <wenson_hsieh@apple.com> [ iOS ] ASSERTION FAILED: ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree https://bugs.webkit.org/show_bug.cgi?id=217203 <rdar://problem/69864747> Reviewed by Tim Horton. * page/DragController.cpp: (WebCore::DragController::finalizeDroppedImagePlaceholder): Instead of immediately removing dropped image placeholder attributes, schedule an async task to remove the placeholder and invoke the given completion handler. See WebKit/ChangeLog for more details. * page/DragController.h: 2020-10-02 Chris Dumez <cdumez@apple.com> Calling suspend() on audio context with no node does not prevent auto transition to running when first node is created https://bugs.webkit.org/show_bug.cgi?id=216972 <rdar://problem/69878834> Reviewed by Darin Adler. Add support for the [[suspended by user]] flag in the WebAudio specification: - https://www.w3.org/TR/webaudio/#dom-audiocontext-suspended-by-user-slot We set this flag when the script calls AudioContext.suspend(): - https://www.w3.org/TR/webaudio/#ref-for-dom-audiocontext-suspended-by-user-slot① We clear this flag when the script calls AudioContext.resume(): - https://www.w3.org/TR/webaudio/#ref-for-dom-audiocontext-suspended-by-user-slot We then prevent automated transition of the AudioContext to "rendering" when this flag is set: - https://www.w3.org/TR/webaudio/#ref-for-dom-audiocontext-suspended-by-user-slot② - https://www.w3.org/TR/webaudio/#ref-for-dom-audiocontext-suspended-by-user-slot③ Test: webaudio/suspend-context-before-first-node-creation.html * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::startRendering): (WebCore::BaseAudioContext::suspendRendering): (WebCore::BaseAudioContext::resumeRendering): * Modules/webaudio/BaseAudioContext.h: 2020-10-02 Truitt Savell <tsavell@apple.com> Unreviewed, reverting r267887. Broke two tests on iOS and Mac Reverted changeset: "Add non-animated support for the CSS translate property" https://bugs.webkit.org/show_bug.cgi?id=216997 https://trac.webkit.org/changeset/267887 2020-10-02 Truitt Savell <tsavell@apple.com> Unreviewed, reverting r267817. Broke two tests on Mac Reverted changeset: "Storage Access API: Enable per-page storage access scope and align test cases" https://bugs.webkit.org/show_bug.cgi?id=217077 https://trac.webkit.org/changeset/267817 2020-10-02 Sam Weinig <weinig@apple.com> Re-align HTMLElement with the HTML spec https://bugs.webkit.org/show_bug.cgi?id=217202 Reviewed by Darin Adler. - Stops including DocumentAndElementEventHandlers in Element, and instead matches spec and other browsers by having HTMLElement, SVGElement and MathMLElement include it. - Splits out ElementContentEditable from HTMLElement and has HTMLElement include it. - Splits CSSOM View parts of HTMLElement out into HTMLElement+CSSOMView.idl - Re-orders includes to more closely match spec'd order. Has no real effect but made me happy. Updates results to existing tests that are now passing, all due to the change to include DocumentAndElementEventHandlers in the Element subclasses, not Element itself. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * dom/Element.idl: * dom/ElementContentEditable.idl: Added. * html/HTMLBodyElement.idl: * html/HTMLElement+CSSOMView.idl: Added. * html/HTMLElement.idl: * html/HTMLFrameSetElement.idl: * html/HTMLMediaElement+AudioOutput.idl: Added. * html/HTMLMediaElementAudioOutput.idl: Removed. * mathml/MathMLElement.idl: * svg/SVGElement.idl: 2020-10-02 Chris Dumez <cdumez@apple.com> Add stubs for AudioWorkletProcessor and AudioWorkletGlobalScope https://bugs.webkit.org/show_bug.cgi?id=217194 Reviewed by Sam Weinig. Add stubs for AudioWorkletProcessor and AudioWorkletGlobalScope: - https://www.w3.org/TR/webaudio/#audioworkletprocessor - https://www.w3.org/TR/webaudio/#audioworkletglobalscope I had to make some changes to the generated bindings to avoid a naming conflict because there was already a class named JSAudioWorkletProcessorConstructor (the DOM constructor for JSAudioWorkletProcessor) before I introduced AudioWorkletProcessorConstructor.idl. We now use "DOMConstructor" suffix in the generated bindings instead of "Constructor" to avoid the naming conflict. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioWorkletGlobalScope.cpp: (WebCore::AudioWorkletGlobalScope::registerProcessor): * Modules/webaudio/AudioWorkletGlobalScope.h: (WebCore::AudioWorkletGlobalScope::currentFrame): (WebCore::AudioWorkletGlobalScope::currentTime const): (WebCore::AudioWorkletGlobalScope::sampleRate const): * Modules/webaudio/AudioWorkletGlobalScope.idl: * Modules/webaudio/AudioWorkletProcessor.cpp: Copied from Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.idl. (WebCore::AudioWorkletProcessor::AudioWorkletProcessor): * Modules/webaudio/AudioWorkletProcessor.h: Copied from Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.idl. (WebCore::AudioWorkletProcessor::create): (WebCore::AudioWorkletProcessor::port): * Modules/webaudio/AudioWorkletProcessor.idl: Copied from Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.idl. * Modules/webaudio/AudioWorkletProcessorConstructor.h: Copied from Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.cpp. * Modules/webaudio/AudioWorkletProcessorConstructor.idl: Copied from Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/scripts/CodeGeneratorJS.pm: (GenerateRuntimeEnableConditionalStringForExposed): (GenerateImplementation): (GenerateCallbackImplementationContent): (GenerateConstructorDeclaration): (GenerateConstructorDefinitions): (GenerateConstructorDefinition): (GenerateConstructorHelperMethods): 2020-09-30 Antoine Quint <graouts@webkit.org> Add non-animated support for the CSS translate property https://bugs.webkit.org/show_bug.cgi?id=216997 <rdar://problem/69597083> Reviewed by Simon Fraser. We add non-animated support for the CSS "translate" property as specifed in by the CSS Transforms Level 2 specification (https://drafts.csswg.org/css-transforms-2/#propdef-translate). Tests: transforms/2d/translate-and-transform-attribute-in-svg.svg transforms/2d/translate-and-transform-css-property-in-svg.svg transforms/2d/translate-in-svg.svg transforms/2d/translate-transform-order.html transforms/2d/translate-transform-origin-order.html * Headers.cmake: * css/CSSComputedStyleDeclaration.cpp: (WebCore::computedTranslate): Create a CSSValueList to print out the computed value for the "translate" property. (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSProperties.json: Define the "translate" property with the condition that the runtime setting for individual CSS transform properties is set. * css/TransformFunctions.cpp: (WebCore::translateForValue): Convert a CSSValue to a TranslateTransformOperation when parsing a "translate" property value. * css/TransformFunctions.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): Add a new flag indicating whether the runtime setting for individual CSS transform properties is set. (WebCore::operator==): * css/parser/CSSParserContext.h: (WebCore::CSSParserContextHash::hash): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeTranslate): Create a CSSValueList when parsing a "translate" property value. (WebCore::CSSPropertyParser::parseSingleValue): * platform/graphics/transforms/TranslateTransformOperation.h: Promote the apply() method to be public so that it can be called from Style::ComputedStyleExtractor::valueForPropertyInStyle(). * rendering/RenderObject.h: (WebCore::RenderObject::hasTransform const): Consider that having the "translate" property is akin to having a "transform" property in the render tree. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::setTranslate): (WebCore::RenderStyle::applyTransform const): Account for the RenderStyle::translate() value in the right order, after applying the transform origin, but before applying the main transform. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::translate const): (WebCore::RenderStyle::hasTransformRelatedProperty const): (WebCore::RenderStyle::initialTranslate): * rendering/style/StyleRareNonInheritedData.h: * rendering/style/WillChangeData.cpp: (WebCore::WillChangeData::propertyCreatesStackingContext): * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertTranslate): * svg/SVGGraphicsElement.cpp: (WebCore::SVGGraphicsElement::animatedLocalTransform const): Account for the RenderStyle::translate() value when rendering SVG, ensuring that it is applied before the transform specified by either the "transform" CSS property or SVG attribute. 2020-10-02 Sam Weinig <weinig@apple.com> Remove code behind ENABLE(MEDIA_SESSION), no ports enable it https://bugs.webkit.org/show_bug.cgi?id=216831 Reviewed by Alex Christensen. * CMakeLists.txt: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Remove media session related files. * Modules/airplay/PlaybackTargetClientContextIdentifier.h: Added. * Modules/airplay/WebMediaSessionManager.cpp: Added. * Modules/airplay/WebMediaSessionManager.h: Added. * Modules/airplay/WebMediaSessionManagerClient.h: Added. * Modules/mediasession: Removed. * platform/mediasession: Removed. Delete Modules/mediasession and platform/mediasession. Move files that were actually used for the WIRELESS_PLAYBACK_TARGET feature to Modules/airplay where other parts of that feature are implemented. * dom/Document.cpp: * dom/Document.h: * dom/EventTargetFactory.in: * html/HTMLMediaElement.cpp: * html/HTMLMediaElement.h: * page/ChromeClient.h: * page/Page.cpp: * page/Page.h: * testing/Internals.cpp: * testing/Internals.h: * testing/Internals.idl: Remove all code inside ENABLE(MEDIA_SESSION). 2020-10-02 Karl Rackler <rackler@apple.com> Unreviewed, reverting r267796. This change is breaking the build on AzulE debug bots. Reverted changeset: "Remove code behind ENABLE(MEDIA_SESSION), no ports enable it" https://bugs.webkit.org/show_bug.cgi?id=216831 https://trac.webkit.org/changeset/267796 2020-10-02 Adrian Perez de Castro <aperez@igalia.com> [GTK] Build broken with ENABLE_MEDIA_STREAM enabled and ENABLE_WEB_RTC_DISABLED https://bugs.webkit.org/show_bug.cgi?id=217128 Reviewed by Philippe Normand. No new tests needed. * platform/mediastream/gstreamer/GStreamerAudioData.h: Remove USE(LIBWEBRTC) guard, as there is nothing specific to WebRTC in this file, and it is needed when building with ENABLE_MEDIA_STREAM enabled. 2020-10-02 Megan Gardner <megan_gardner@apple.com> Rename repaint to repaintSelection in HighlightData for clarity https://bugs.webkit.org/show_bug.cgi?id=217205 Reviewed by Tim Horton. No behavior change, covered by existing tests. * editing/FrameSelection.cpp: (WebCore::FrameSelection::focusedOrActiveStateChanged): * rendering/HighlightData.cpp: (WebCore::HighlightData::repaintSelection const): (WebCore::HighlightData::repaint const): Deleted. * rendering/HighlightData.h: 2020-10-02 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Do not use simplified text measuring when soft hyphen is present https://bugs.webkit.org/show_bug.cgi?id=217224 Reviewed by Antti Koivisto. Specifically the monospaced fast codepath computes incorrect widht value when soft hyphens are present. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::canUseSimplifiedTextMeasuring): * rendering/RenderText.cpp: (WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const): 2020-10-02 Andres Gonzalez <andresg_22@apple.com> Layout Test accessibility/mac/html5-input-number.html is flaky. https://bugs.webkit.org/show_bug.cgi?id=180560 <rdar://problem/36029379> Reviewed by Chris Fleizach. Fix for this test in both isolated tree mode on and off. * accessibility/AccessibilitySpinButton.h: AccessibilitySpinButtonPart::roleValue now returns SpinButtonPart role as it should. * accessibility/mac/AccessibilityObjectMac.mm: (WebCore::Accessibility::createPlatformRoleMap): Appropriate platform role string for SpinButtonPart role. 2020-10-02 Antti Koivisto <antti@apple.com> [LFC][Integration] Convert rest of Position::inlineBoxAndOffset to use iterator https://bugs.webkit.org/show_bug.cgi?id=217214 Reviewed by Zalan Bujtas. Progress towards allowing Position construction in all cases without forcing legacy inline layout. * dom/Position.cpp: (WebCore::InlineBoxAndOffset::InlineBoxAndOffset): (WebCore::Position::inlineBoxAndOffset const): * dom/Position.h: * layout/integration/LayoutIntegrationRunIterator.cpp: (WebCore::LayoutIntegration::RunIterator::setAtEnd): (WebCore::LayoutIntegration::RunIterator::previousOnLine const): (WebCore::LayoutIntegration::RunIterator::nextOnLineIgnoringLineBreak const): (WebCore::LayoutIntegration::RunIterator::previousOnLineIgnoringLineBreak const): (WebCore::LayoutIntegration::LineRunIterator::traversePreviousOnLine): (WebCore::LayoutIntegration::LineRunIterator::traverseNextOnLineIgnoringLineBreak): (WebCore::LayoutIntegration::LineRunIterator::traversePreviousOnLineIgnoringLineBreak): * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::Run::leftmostCaretOffset const): (WebCore::LayoutIntegration::Run::rightmostCaretOffset const): (WebCore::LayoutIntegration::Run::direction const): (WebCore::LayoutIntegration::Run::isLeftToRightDirection const): (WebCore::LayoutIntegration::Run::bidiLevel const): * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: (WebCore::LayoutIntegration::LegacyPath::bidiLevel const): (WebCore::LayoutIntegration::LegacyPath::traversePreviousOnLine): (WebCore::LayoutIntegration::LegacyPath::setAtEnd): (WebCore::LayoutIntegration::LegacyPath::isLeftToRightDirection const): Deleted. * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::ModernPath::bidiLevel const): (WebCore::LayoutIntegration::ModernPath::traverseNextOnLine): (WebCore::LayoutIntegration::ModernPath::traversePreviousOnLine): (WebCore::LayoutIntegration::ModernPath::setAtEnd): (WebCore::LayoutIntegration::ModernPath::line const): (WebCore::LayoutIntegration::ModernPath::isLeftToRightDirection const): Deleted. 2020-10-02 Adrian Perez de Castro <aperez@igalia.com> Unreviewed non-unified build fix. No new tests needed. * Modules/webaudio/AudioWorkletMessagingProxy.cpp: Add missing AudioWorkletGlobalScope.h header. * worklets/WorkletPendingTasks.cpp: Add missing Worklet.h header. 2020-10-02 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r267864. https://bugs.webkit.org/show_bug.cgi?id=217220 Added broken tests Reverted changeset: "[GPU Process] Support drawing text in 2D canvas with font features" https://bugs.webkit.org/show_bug.cgi?id=206118 https://trac.webkit.org/changeset/267864 2020-10-02 Youenn Fablet <youenn@apple.com> Add AVAssetWriter SPI header https://bugs.webkit.org/show_bug.cgi?id=217169 <rdar://problem/69793050> Reviewed by Eric Carlson. No change of behavior, include SPI header instead of private SDK header. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: 2020-10-02 Kimmo Kinnunen <kkinnunen@apple.com> [iOS WK1] Crashes when using ANGLE WebGL from another thread https://bugs.webkit.org/show_bug.cgi?id=216106 <rdar://problem/68602452> Reviewed by Kenneth Russell. Source of the bug comes from following: - WK1 might run WebKit code in client main thread. - WK1 might run Webkit code in web thread. - WebKit code might run WebGL payload, notably access GraphicsContextGL classes. Client is able to modify EAGL/CGL current context. The change to ANGLE incurred two distinct behavior changes compared to raw EAGL / CGL: 1) Before: context was set current before any GL call After: context was set current only if EGL current context had been changed. (Explicit code as well as ANGLE implementation optimization.) 2) Before: context being used was able to be current in multiple threads at the same time. (EAGL/CGL feature) After: context cannot be current in multiple threads at the same time. (EGL feature) Change in behavior 1) caused ANGLE to sometimes use the EAGL/CGL context of the client instead of the real context that ANGLE created. Fix this by introducing EGL_ANGLE_platform_angle_device_context_volatile_eagl and EGL_ANGLE_platform_angle_device_context_volatile_cgl which make ANGLE sync the context on each eglMakeCurrent eglReleaseThread and eglTerminate. Change in behavior 2) caused ANGLE to use uninitialized context object from one thread, if the real context object was current in another thread. Fix this by considering "GraphicsContextGLOpenGL current context" as part of "data that is owned by WebCoreThread lock". The current context is set with lock held, implicitly. The current context is released when lock is released. When the lock is not held, GraphicsContextGLOpenGL current context is nullptr. Adds soft linking for EAGL for the purpose of testing this in TestWebKitAPI. The case of Apple Silicon Mac may sometimes use CGL and sometimes EAGL, and the test should test that client overriding both contexts will not cause problems. Fix ANGLE header include path: - Do not include ANGLE in the path, as files are included with ANGLE/ - Add WK_ALTERNATE_FRAMEWORKS_DIR so that SDK_VARIANT=iosmac e.g. maccatalyst builds work Previously the ANGLE was not included from ThirdParty/ANGLE, rather "WebKit SDK". * Configurations/WebCore.xcconfig: * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::makeContextCurrent): (WebCore::GraphicsContextGLOpenGL::releaseCurrentContext): (WebCore::GraphicsContextGLOpenGL::checkGPUStatus): (WebCore::GraphicsContextGLOpenGL::allowOfflineRenderers const): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/ios/wak/WebCoreThread.mm: (WebThreadUnlockFromAnyThread): (_WebThreadUnlock): 2020-10-01 Rob Buis <rbuis@igalia.com> update FormData to latest spec webidl https://bugs.webkit.org/show_bug.cgi?id=171589 Reviewed by Alex Christensen. Change FormData contructor to not take optional, nullable parameter. Test: imported/w3c/web-platform-tests/xhr/formdata.html * html/DOMFormData.cpp: (WebCore::DOMFormData::DOMFormData): * html/DOMFormData.h: (WebCore::DOMFormData::create): * html/DOMFormData.idl: 2020-10-01 Sam Weinig <weinig@apple.com> [WebIDL] Add support for non-nullable optional wrapper type arguments to operations https://bugs.webkit.org/show_bug.cgi?id=217162 Reviewed by Chris Dumez. The bindings currently treat both nullable and optional wrapper types as having type WrapperType* (or RefPtr<WrapperType> for callbacks), whereas non-nullable, non-optional wrapper types are treated as having type WrapperType& (or Ref<WrapperType> for callbacks). This parallels non wrapper types which use Optional<Type> for both nullable and optional vs Type for the non-nullable non-optional variant. In both these cases, there is possibility for ambiguity, should we ever need to disambiguate between nullable and optional, but thus far it hasn't come up. This change adds a missing case where we weren't supporting non-nullable optional wrapper type arguments to operations. We solve this by expecting the wrapped implementation to take the optional wrapper type argument the same way it would take an optional wrapper type argument, with a WrapperType*, (or RefPtr<WrapperType> for callbacks) that gets passed a nullptr if the parameter was ommited. Adopt this in Geolocation.idl, which has had a FIXME for this for a long time. * Modules/geolocation/Geolocation.idl: * bindings/scripts/CodeGeneratorJS.pm: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/TestObj.idl: 2020-10-01 Myles C. Maxfield <mmaxfield@apple.com> [GPU Process] Support drawing text in 2D canvas with font features https://bugs.webkit.org/show_bug.cgi?id=206118 Reviewed by Wenson Hsieh. This patch simply serializes all the non-derived data in Font and FontPlatformData. Serializing a CTFont involves serializing its font descriptor's attributes. However, there's an extra step for web fonts, since the font descriptor's attributes don't include the raw bytes of the font file. This was previously being saved in Font, but this patch moves that into FontPlatformData because of layering, and adds the SharedBuffer to the serialization routine for web fonts. Test: fast/canvas/fill-text-with-font-features.html * WebCore.xcodeproj/project.pbxproj: * css/CSSFontFace.cpp: (WebCore::CSSFontFace::font): Fonts and FontPlatformDatas are supposed to be immutable, so having a setter for the FontFaceData is incorrect. This object is moved into the constructor instead. * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::font): Deleting dead code. * platform/graphics/Font.cpp: (WebCore::Font::setFontFaceData): Deleted. * platform/graphics/Font.h: (WebCore::Font::fontFaceData const): Deleted. Moved to FontPlatformData * platform/graphics/FontPlatformData.cpp: (WebCore::FontPlatformData::FontPlatformData): * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::creationData const): Moved from Font. * platform/graphics/coretext/FontPlatformDataCoreText.cpp: (WebCore::FontPlatformData::FontPlatformData): * platform/graphics/mac/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): FontCustomPlatformData is a struct, so there's no need for the m_ prefixes. (WebCore::createFontCustomPlatformData): * platform/graphics/mac/FontCustomPlatformData.h: (WebCore::FontCustomPlatformData::FontCustomPlatformData): Ditto. 2020-10-01 Megan Gardner <megan_gardner@apple.com> Repaint as needed when adding and removing highlights https://bugs.webkit.org/show_bug.cgi?id=217116 <rdar://problem/59076190> Reviewed by Simon Fraser. When adding and removing psudo highlights, make sure that the right areas are repainted. Test: http/wpt/css/css-highlight-api/highlight-text-repaint.html * Modules/highlight/HighlightRangeGroup.cpp: (WebCore::repaintRange): (WebCore::HighlightRangeGroup::removeFromSetLike): (WebCore::HighlightRangeGroup::clearFromSetLike): (WebCore::HighlightRangeGroup::addToSetLike): 2020-10-01 Chris Dumez <cdumez@apple.com> Add basic infrastructure for AudioWorklet https://bugs.webkit.org/show_bug.cgi?id=217153 Reviewed by Sam Weinig. Add basic infrastructure for AudioWorklet: - https://www.w3.org/TR/webaudio/#audioworklet In particular, this adds a partial but spec-compliant implementation of Worklet.addModule(), as per: - https://drafts.css-houdini.org/worklets/#dom-worklet-addmodule When Worklet.addModule() is called, we create a AudioWorket thread and a AudioWorkletGlobalScope with its VM. We then ask the AudioWorkletGlobalScope to fetch and invoke the worklet script. Note that AudioWorkletGlobalScope does NOT fetch or invoke the worklet script yet to reduce patch size. Calling Worklet.addModule() activates the AudioWorklet and causes audio rendering to occur on the AudioWorkletThread. A few important things that are still missing in this patch: - Fetching & invoking worklet scripts - Pretty much all API exposed to AudioWorkletGlobalScopes - AudioWorkletProcessor support No new tests, no Web-facing behavior change yet. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add new files to projets. * Modules/webaudio/AudioWorklet.cpp: (WebCore::AudioWorklet::create): (WebCore::AudioWorklet::AudioWorklet): (WebCore::AudioWorklet::createGlobalScopes): (WebCore::AudioWorklet::proxy const): * Modules/webaudio/AudioWorklet.h: When the Worklet needs to create a GlobalScope, AudioWorklet takes care of creating a AudioWorkletMessagingProxy. The AudioWorkletMessagingProxy starts the AudioWorkletThread, which creates the AudioWorkletGlobalScope. AudioWorkletMessagingProxy takes care of posting tasks from the main thread to the AudioWorkletThread as well. * Modules/webaudio/AudioWorkletGlobalScope.cpp: Added. * Modules/webaudio/AudioWorkletGlobalScope.h: Added. * Modules/webaudio/AudioWorkletGlobalScope.idl: Added. Add basic implementation for AudioWorkletGlobalScope: - https://www.w3.org/TR/webaudio/#audioworkletglobalscope None of the Web API is exposed on the AudioWorkletGlobalScope yet. * Modules/webaudio/AudioWorkletMessagingProxy.cpp: Added. * Modules/webaudio/AudioWorkletMessagingProxy.h: Added. Add new AudioWorkletMessagingProxy class (Similar to WorkerMessagingProxy) which starts to AudioWorkletThread (which constructs the AudioWorkletGlobalScope on that thread) and takes care of posting tasks from the main thread to the AudioWorkletThread. * Modules/webaudio/AudioWorkletThread.cpp: Added. * Modules/webaudio/AudioWorkletThread.h: Added. Add new class which wraps the AudioThread used by AudioWorkets. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): Pass document when constructing the AudioWorklet since it is now an ActiveDOMObject. * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::enableInput): (WebCore::Function<void): (WebCore::DefaultAudioDestinationNode::startRendering): (WebCore::DefaultAudioDestinationNode::resume): (WebCore::DefaultAudioDestinationNode::setChannelCount): * Modules/webaudio/DefaultAudioDestinationNode.h: If AudioWorklet is active, pass a function to AudioDestination::start() that dispatches to the AudioWorkletThread, so that the AudioDestination can do rendering on the AudioWorkletThead instead of the device's rendering thread. * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::startRendering): If AudioWorklet is active, use the AudioWorklet's AudioWorkletThread instead of a new audio thread to do the offline rendering. * bindings/js/WebCoreBuiltinNames.h: Add AudioWorkletGlobalScope since it is exposed conditionally at runtime to AudioWorkets. * bindings/js/WebCoreJSClientData.cpp: (WebCore::JSVMClientData::JSVMClientData): * bindings/js/WebCoreJSClientData.h: Add code to support AudioWorkletGlobalScope as a GlobalScope in our JS bindings. * bindings/js/WorkerScriptController.h: We now subclass WorkerOrWorkletScriptController interface. This allows WorkletScriptController to reuse WorkerRunLoop. * bindings/scripts/CodeGeneratorJS.pm: (ShouldUseGlobalObjectPrototype): * bindings/scripts/preprocess-idls.pl: Add support for AudioWorkletGlobalScope as global scope in our JS bindings. * css/DOMCSSPaintWorklet.cpp: (WebCore::PaintWorklet::addModule): (WebCore::PaintWorklet::createGlobalScopes): * css/DOMCSSPaintWorklet.h: * dom/Document.cpp: (WebCore::Document::ensurePaintWorklet): Update PaintWorklet code so that it keeps building. * platform/MediaStrategy.h: * platform/audio/AudioDestination.h: Make AudioDestination ThreadSafeRefCounted so that it can keep itself alive when dispatching to the AudioWorkletThread for rendering. * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestination::create): (WebCore::AudioDestinationCocoa::start): (WebCore::AudioDestinationCocoa::stop): (WebCore::AudioDestinationCocoa::setIsPlaying): (WebCore::AudioDestinationCocoa::render): (WebCore::AudioDestinationCocoa::renderOnRenderingThead): * platform/audio/cocoa/AudioDestinationCocoa.h: When we get a request to render audio, we now use the function provided by the DefaultAudioDestinationNode to dispatch to the AudioWorkletThread when needed (AudioWorklet is active) before doing the rendering. * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::AudioDestinationGStreamer::start): * platform/audio/gstreamer/AudioDestinationGStreamer.h: * platform/mock/MockAudioDestinationCocoa.cpp: (WebCore::MockAudioDestinationCocoa::start): * platform/mock/MockAudioDestinationCocoa.h: Update code so that it keeps building. * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::underlyingThread const): * workers/WorkerGlobalScope.h: * workers/WorkerOrWorkletGlobalScope.h: Added. * workers/WorkerOrWorkletScriptController.h: Added. Add new interfaces that are subclassed by Worker and Worklet implementation classes in order to promote code sharing. * workers/WorkerRunLoop.cpp: * workers/WorkerRunLoop.h: Update WorkerRunLoop to use WorkerOrWorkletGlobalScope so that it can be reused by AudioWorkletThread. * worklets/Worklet.cpp: (WebCore::Worklet::Worklet): (WebCore::Worklet::document): (WebCore::Worklet::addModule): (WebCore::Worklet::finishPendingTasks): (WebCore::Worklet::activeDOMObjectName const): * worklets/Worklet.h: (WebCore::Worklet::proxies const): * worklets/Worklet.idl: Add initial implementation for addModule(): - https://drafts.css-houdini.org/worklets/#dom-worklet-addmodule Make Worklet an ActiveDOMObject since it needs to resolve a JS promise asynchronously. * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): (WebCore::WorkletGlobalScope::evaluate): (WebCore::WorkletGlobalScope::completeURL const): (WebCore::WorkletGlobalScope::fetchAndInvokeScript): * worklets/WorkletGlobalScope.h: (WebCore::WorkletGlobalScope::isAudioWorkletGlobalScope const): * worklets/WorkletGlobalScope.idl: Update WorkletGlobalScope so that it can be subclassed by AudioWorkletGlobalScope and not be PaintWorklet-specific. * worklets/WorkletGlobalScopeProxy.h: Added. Add WorkletGlobalScopeProxy interface to interact with the WorkletGlobalScope interface. The purpose of this class is to post tasks to the WorkletGlobalScope, abstracting away potential threading complexity. Note that AudioWorkets use threading while PaintWorklets do not. * worklets/WorkletPendingTasks.cpp: Added. (WebCore::WorkletPendingTasks::WorkletPendingTasks): (WebCore::WorkletPendingTasks::abort): (WebCore::WorkletPendingTasks::decrementCounter): * worklets/WorkletPendingTasks.h: Added. (WebCore::WorkletPendingTasks::create): Add implementation for: - https://drafts.css-houdini.org/worklets/#pending-tasks-struct While it is not strictly needed right for AudioWorklet (because there is always a single WorkletGlobalScope), it will be needed once we have proper support for PaintWorklets. PaintWorklets can have several WorkletGlobalScopes. In the mean time, it allows us to have code that matches the specification text more closely. * worklets/WorkletScriptController.cpp: (WebCore::WorkletScriptController::WorkletScriptController): (WebCore::WorkletScriptController::initScript): (WebCore::WorkletScriptController::releaseHeapAccess): (WebCore::WorkletScriptController::acquireHeapAccess): (WebCore::WorkletScriptController::addTimerSetNotification): (WebCore::WorkletScriptController::removeTimerSetNotification): (WebCore::WorkletScriptController::scheduleExecutionTermination): (WebCore::WorkletScriptController::isTerminatingExecution const): * worklets/WorkletScriptController.h: Update WorkletScriptController so that it can be used by AudioWorklets and not just PaintWorklets. 2020-10-01 Adrian Perez de Castro <aperez@igalia.com> and Don Olmstead <don.olmstead@sony.com> Non-unified build fixes, early October 2020 edition https://bugs.webkit.org/show_bug.cgi?id=217165 Reviewed by Yusuke Suzuki. * css/parser/CSSSelectorParser.cpp: * display/DisplayTreeBuilder.h: * display/DisplayView.cpp: * editing/TextManipulationController.cpp: * layout/flexformatting/FlexFormattingContext.cpp: * layout/flexformatting/FlexFormattingContextGeometry.cpp: * layout/inlineformatting/InlineLine.cpp: * layout/integration/LayoutIntegrationCoverage.cpp: * layout/integration/LayoutIntegrationCoverage.h: * platform/graphics/displaylists/DisplayListItems.cpp: * platform/graphics/displaylists/DisplayListRecorder.cpp: 2020-10-01 Don Olmstead <don.olmstead@sony.com> [PlayStation] Fix build break after r267753 https://bugs.webkit.org/show_bug.cgi?id=217188 Reviewed by Fujii Hironori. After r267753 the PlayStation builds started failing with an error around a structured binding declaration of a tuple type. No new tests. No change in behavior. * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::handleDuplicateIndexIDs): 2020-10-01 Peng Liu <peng.liu6@apple.com> Handle deprecation warnings from libwebrtc headers https://bugs.webkit.org/show_bug.cgi?id=217126 Reviewed by Tim Horton. (A follow-up patch) Disable deprecation warnings coming from libwebrtc headers. * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h: 2020-10-01 Truitt Savell <tsavell@apple.com> Unreviewed, reverting r267841. Broke Catalina Builds Reverted changeset: "Add AVAssetWriter SPI header" https://bugs.webkit.org/show_bug.cgi?id=217169 https://trac.webkit.org/changeset/267841 2020-10-01 Jer Noble <jer.noble@apple.com> REGRESSION(r267249): Crash in WebPage::updatePreferences() when libwebrtc is not available. https://bugs.webkit.org/show_bug.cgi?id=217186 <rdar://problem/69817170> Reviewed by Eric Carlson. Always check for the presence of libwebrtc before calling into it. * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProvider::setH264HardwareEncoderAllowed): (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): (WebCore::LibWebRTCProviderCocoa::setActive): 2020-10-01 Antti Koivisto <antti@apple.com> [LFC][Integration] Partially convert Position::inlineBoxAndOffset to use iterator https://bugs.webkit.org/show_bug.cgi?id=217180 Reviewed by Zalan Bujtas. This still forces the legacy path as the return type currently requires it. * dom/Position.cpp: (WebCore::searchAheadForBetterMatch): (WebCore::Position::inlineBoxAndOffset const): * layout/integration/LayoutIntegrationRunIterator.cpp: (WebCore::LayoutIntegration::RunIterator::nextOnLine const): (WebCore::LayoutIntegration::TextRunIterator::traverseNextTextRun): (WebCore::LayoutIntegration::lineLayoutSystemFlowForRenderer): (WebCore::LayoutIntegration::runFor): (WebCore::LayoutIntegration::TextRunIterator::traverseNextTextRunInVisualOrder): Deleted. * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::TextRunIterator::operator++): (WebCore::LayoutIntegration::TextRunIterator::nextTextRun const): (WebCore::LayoutIntegration::TextRunIterator::nextTextRunInTextOrder const): * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: (WebCore::LayoutIntegration::LegacyPath::traverseNextTextRun): (WebCore::LayoutIntegration::LegacyPath::traverseNextTextRunInVisualOrder): Deleted. * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::ModernPath::traverseNextTextRun): (WebCore::LayoutIntegration::ModernPath::traverseNextTextRunInTextOrder): (WebCore::LayoutIntegration::ModernPath::traverseNextTextRunInVisualOrder): Deleted. 2020-10-01 Simon Fraser <simon.fraser@apple.com> REGRESSION(r267781): ASSERTION FAILED: Optional.h(525) : T *WTF::Optional<WebCore::Layout::LineRun::Text>::operator->() on 16 fast/layoutformattingcontext/* tests https://bugs.webkit.org/show_bug.cgi?id=217143 Reviewed by Zalan Bujtas. Need to test the Optional<> text() in dumping code. * display/css/DisplayTextBox.cpp: (WebCore::Display::TextBox::debugDescription const): 2020-10-01 Youenn Fablet <youenn@apple.com> Add AVAssetWriter SPI header https://bugs.webkit.org/show_bug.cgi?id=217169 <rdar://problem/69793050> Reviewed by Eric Carlson. No change of behavior, include SPI header instead of private SDK header. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: 2020-10-01 Youenn Fablet <youenn@apple.com> RealtimeMediaSource should ignore ideal values outside the min/max range https://bugs.webkit.org/show_bug.cgi?id=217178 Reviewed by Eric Carlson. Make valueForDiscreteCapabilityValues returns an Optional in case no valid value can be selected from the constraint. This basically means the constraint will be ignored. Before the patch, in case of no valid value, 0 will be set, which is a bad value for sample rate. Test: fast/mediastream/audio-bad-sampleRate.html * platform/mediastream/MediaConstraints.h: (WebCore::NumericConstraint::valueForDiscreteCapabilityValues const): * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::applyNumericConstraint): 2020-10-01 Youenn Fablet <youenn@apple.com> getUserMedia with sampleRate constraints may fail https://bugs.webkit.org/show_bug.cgi?id=217147 <rdar://problem/69831144> Reviewed by Eric Carlson. In case of new capture, make sure to reset sample rate and volume to default values. This ensures that a sample rate that will fail the capture will not stick for other pages. Manually tested. * platform/mediastream/mac/BaseAudioSharedUnit.cpp: (WebCore::BaseAudioSharedUnit::prepareForNewCapture): 2020-10-01 Adrian Perez de Castro <aperez@igalia.com> Unreviewed. Add missing guard around ModernPath usage. No new tests needed. * layout/integration/LayoutIntegrationRunIterator.cpp: Add ENABLE(LAYOUT_FORMATTING_CONTEXT) guard around usage of the ModernPath type. * layout/integration/LayoutIntegrationRunIterator.h: Ditto. 2020-10-01 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Remove redundant "needs hyphen" flag from LineContent::PartialContent https://bugs.webkit.org/show_bug.cgi?id=217155 Reviewed by Antti Koivisto. The last run already had this information. This is also in preparation for adding support for soft-hyphen where the run with the hyphen is not partial at all. (This patch also changes Optional<size_t> partialContentLength to just size_t. Optional<> may suggest that 0 is a valid overflow length.) * display/css/DisplayTextBox.cpp: (WebCore::Display::TextBox::debugDescription const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::layoutInlineContent): (WebCore::Layout::LineBuilder::placeInlineContent): (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::nextContentForLine): (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): * layout/inlineformatting/InlineLineBuilder.h: 2020-10-01 Youenn Fablet <youenn@apple.com> MediaRecorder should support MediaRecorderOptions.mimeType https://bugs.webkit.org/show_bug.cgi?id=215018 <rdar://problem/66681508> Reviewed by Eric Carlson. Instead of setting mime type right away, set it just before firing start event as per spec. This will allow in the future to populate exact codec parameters if proven useful. Covered by rebased and updated tests. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::startRecording): * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::startRecording): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: 2020-10-01 Andres Gonzalez <andresg_22@apple.com> Make AXLoadingEvent notifications asynchronous. https://bugs.webkit.org/show_bug.cgi?id=217157 Reviewed by Chris Fleizach. Test: accessibility/loading-iframe-sends-notification-expected.html. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::frameLoadingEventNotification): Removed the isolated tree update from the frame loading notification handler. This avoids updating the isolated tree synchronously. * accessibility/AXObjectCache.h: Added AXNotification::AXFrameLoadComplete. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateChildren): * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXPostNotificationWithUserInfo): Do not ignore AXLoadCompleteNotifications during LayoutTest. (WebCore::AXObjectCache::postPlatformNotification): Handle AXFrameLoadComplete notification as a AXLoadComplete notification. (WebCore::AXObjectCache::frameLoadingEventPlatformNotification): Loading finished event is now mapped to either AXLoadComplete or AXFrameLoadComplete. 2020-10-01 Antti Koivisto <antti@apple.com> [LFC][Integration] Add LineRunIterator https://bugs.webkit.org/show_bug.cgi?id=217125 Reviewed by Zalan Bujtas. Add LineRunIterator iterating line content. Also remove end offset from modern path, instead set index to the content end position in traversal functions. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::textRunsFor const): (WebCore::LayoutIntegration::LineLayout::runFor const): * layout/integration/LayoutIntegrationRunIterator.cpp: (WebCore::LayoutIntegration::TextRunIterator::traverseNextTextRunInVisualOrder): (WebCore::LayoutIntegration::TextRunIterator::traverseNextTextRunInTextOrder): (WebCore::LayoutIntegration::LineRunIterator::LineRunIterator): (WebCore::LayoutIntegration::LineRunIterator::traverseNextOnLine): (WebCore::LayoutIntegration::lineRun): (WebCore::LayoutIntegration::RunIterator::traverseNextTextRunInVisualOrder): Deleted. (WebCore::LayoutIntegration::RunIterator::traverseNextTextRunInTextOrder): Deleted. * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::TextRun::legacyInlineBox const): (WebCore::LayoutIntegration::LineRunIterator::LineRunIterator): (WebCore::LayoutIntegration::LineRunIterator::operator++): (WebCore::LayoutIntegration::Run::legacyInlineBox const): * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: (WebCore::LayoutIntegration::LegacyPath::traverseNextOnLine): (WebCore::LayoutIntegration::LegacyPath::legacyInlineBox const): * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::ModernPath::ModernPath): (WebCore::LayoutIntegration::ModernPath::isLastTextRunOnLine const): (WebCore::LayoutIntegration::ModernPath::isLastTextRun const): (WebCore::LayoutIntegration::ModernPath::traverseNextTextRunInVisualOrder): (WebCore::LayoutIntegration::ModernPath::traverseNextTextRunInTextOrder): (WebCore::LayoutIntegration::ModernPath::traverseNextOnLine): (WebCore::LayoutIntegration::ModernPath::atEnd const): (WebCore::LayoutIntegration::ModernPath::legacyInlineBox const): (WebCore::LayoutIntegration::ModernPath::setAtEnd): 2020-09-21 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] Implement row-gap and column-gap for flex layout https://bugs.webkit.org/show_bug.cgi?id=206767 Reviewed by Manuel Rego Casasnovas. Implement row/column-gap for flexboxes which allow authors to define gutters between flex items and also between flex lines. Inspired by Blink's crrev.com/c/2162149 and crrev.com/c/2172758 by <dgrogan@chromium.org> * rendering/FlexibleBoxAlgorithm.cpp: (WebCore::FlexLayoutAlgorithm::FlexLayoutAlgorithm): Takes two new parameters with row/column gap lengths. (WebCore::FlexLayoutAlgorithm::computeNextFlexLine): Add gaps to hypothetical and flex base sizes in between items. * rendering/FlexibleBoxAlgorithm.h: Added two new attributes to store gaps. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths const): Add gaps to the intrinsic width. (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems): Take gap between lines as argument. (WebCore::RenderFlexibleBox::layoutFlexItems): Take gap between lines as argument. (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): Compute gaps to reduce the remaining free space. (WebCore::RenderFlexibleBox::alignFlexLines): Add gap between lines to the line offset. (WebCore::RenderFlexibleBox::computeGap const): Returns either the row-gap or the column-gap depending on the flex direction. * rendering/RenderFlexibleBox.h: 2020-10-01 Youenn Fablet <youenn@apple.com> [iOS] MediaRecorder incorrect screen orientation handling https://bugs.webkit.org/show_bug.cgi?id=198912 <rdar://problem/51802521> Reviewed by Eric Carlson. We were setting the transform to the writer input too soon. Buffer the transform when receiving the first frame and set it at creation of the writer input. Covered by http/wpt/mediarecorder/video-rotation.html now actually passing. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::startAssetWriter): (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): 2020-10-01 Youenn Fablet <youenn@apple.com> MediaRecorder should support isTypeSupported https://bugs.webkit.org/show_bug.cgi?id=216856 <rdar://problem/69767695> Reviewed by Darin Adler. Introduce MediaRecorder::isMimeTypeSupported whose result is exposed as MediaRecoder.isTypeSupported. Cocoa port allows mp4 audio and video mime types, with H264 and AAC codecs. Add a routine to get the mime type from the MediaRecorderPrivate. Store it in MediaRecorder and add a mimeType getter. Test: http/wpt/mediarecorder/mimeType.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::isTypeSupported): (WebCore::MediaRecorder::create): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediarecorder/MediaRecorderProvider.cpp: (WebCore::MediaRecorderProvider::isSupported): * Modules/mediarecorder/MediaRecorderProvider.h: * platform/mediarecorder/MediaRecorderPrivate.h: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::mimeType const): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::mimeType const): * platform/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::mimeType const): * platform/mediastream/MediaStreamPrivate.h: 2020-10-01 Sihui Liu <sihui_liu@apple.com> Drop some unnecessary code in SQLiteIDBBackingStore and IDBServer https://bugs.webkit.org/show_bug.cgi?id=214992 <rdar://problem/66648514> Reviewed by Brady Eidson. No behavior change. Paths of SQLiteIDBBackingStore and IDBServer are only accessed from one thread now, so we don't need to make isolated copy. * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::createBackingStore): (WebCore::IDBServer::IDBServer::getAllDatabaseNamesAndVersions): (WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion): (WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion): (WebCore::IDBServer::IDBServer::renameOrigin): (WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary): * Modules/indexeddb/server/IDBServer.h: (WebCore::IDBServer::IDBServer::databaseDirectoryPathIsolatedCopy const): Deleted. * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore): (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromEncodedFilename): Deleted. * Modules/indexeddb/server/SQLiteIDBBackingStore.h: 2020-10-01 Youenn Fablet <youenn@apple.com> MediaRecorder should allow setting low bit rates for audio https://bugs.webkit.org/show_bug.cgi?id=216688 <rdar://problem/69129142> Reviewed by Eric Carlson. When setting the bitrate provided by the web app fails, we now use default bit rate values that are expected to work properly. Covered by updated tests. * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: (WebCore::AudioSampleBufferCompressor::setBitsPerSecond): (WebCore::AudioSampleBufferCompressor::defaultOutputBitRate const): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): 2020-09-30 Rob Buis <rbuis@igalia.com> Remove responseIsXML https://bugs.webkit.org/show_bug.cgi?id=217133 Reviewed by Darin Adler. Remove responseIsXML method, it can be inlined and is still readable, also it in one case this avoids calling the non trivial responseMIMEType. No new tests. No change in behavior. * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createDecoder const): (WebCore::XMLHttpRequest::responseIsXML const): Deleted. * xml/XMLHttpRequest.h: 2020-09-30 John Wilander <wilander@apple.com> Storage Access API: Enable per-page storage access scope and align test cases https://bugs.webkit.org/show_bug.cgi?id=217077 <rdar://problem/69017878> Reviewed by Brent Fulgham. It was decided in https://github.com/privacycg/storage-access/issues/3 that browsers should grant storage access for all same-site resources on the whole page, not just the requesting iframe. No new tests. Existing tests aligned, including LayoutTests/http/tests/storageAccess/request-and-grant-access-with-per-page-scope-access-from-another-frame.html which no longer calls internals.settings.setStorageAccessAPIPerPageScopeEnabled(true) to opt in to the setting that is now the default. * dom/DocumentStorageAccess.cpp: (WebCore::DocumentStorageAccess::requestStorageAccess): Changed the settings check to do the reverse, i.e. assume per-page access by default and per-frame access as the exception. * dom/DocumentStorageAccess.h: Changed the default setting for m_storageAccessScope to per-page. * page/Settings.yaml: Changed the default to true for storageAccessAPIPerPageScopeEnabled. 2020-09-30 Sam Weinig <weinig@apple.com> [WebIDL] Make Exposed mandatory for IDL interfaces https://bugs.webkit.org/show_bug.cgi?id=217101 Reviewed by Darin Adler. Add [Exposed] to all IDL interfaces that were missing it and enforce its requirement. * bindings/scripts/CodeGeneratorJS.pm: * bindings/scripts/preprocess-idls.pl: Remove default "Window" exposed behavior and require it on all interfaces and callback interfaces with constants that don't specify LegacyNoInterfaceObject. * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl: * Modules/applepay/ApplePayError.idl: * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePaySetup.idl: * Modules/applepay/ApplePaySetupFeature.idl: * Modules/encryptedmedia/MediaKeyEncryptionScheme.idl: * Modules/encryptedmedia/MediaKeyMessageEvent.idl: * Modules/encryptedmedia/MediaKeySession.idl: * Modules/encryptedmedia/MediaKeySessionType.idl: * Modules/encryptedmedia/MediaKeyStatusMap.idl: * Modules/encryptedmedia/MediaKeySystemAccess.idl: * Modules/encryptedmedia/MediaKeys.idl: * Modules/encryptedmedia/MediaKeysRequirement.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: * Modules/entriesapi/DOMFileSystem.idl: * Modules/entriesapi/FileSystemDirectoryEntry.idl: * Modules/entriesapi/FileSystemDirectoryReader.idl: * Modules/entriesapi/FileSystemEntry.idl: * Modules/entriesapi/FileSystemFileEntry.idl: * Modules/gamepad/Gamepad.idl: * Modules/gamepad/GamepadButton.idl: * Modules/gamepad/GamepadEvent.idl: * Modules/geolocation/Geolocation.idl: * Modules/geolocation/GeolocationCoordinates.idl: * Modules/geolocation/GeolocationPosition.idl: * Modules/geolocation/GeolocationPositionError.idl: * Modules/geolocation/PositionOptions.idl: * Modules/highlight/HighlightMap.idl: * Modules/highlight/HighlightRangeGroup.idl: * Modules/mediacapabilities/AudioConfiguration.idl: * Modules/mediacapabilities/MediaCapabilities.idl: * Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl: * Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl: * Modules/mediacapabilities/MediaCapabilitiesInfo.idl: * Modules/mediacapabilities/MediaDecodingConfiguration.idl: * Modules/mediacapabilities/MediaEncodingConfiguration.idl: * Modules/mediacapabilities/VideoConfiguration.idl: * Modules/mediasource/MediaSource.idl: * Modules/mediasource/SourceBuffer.idl: * Modules/mediasource/SourceBufferList.idl: * Modules/mediastream/CanvasCaptureMediaStreamTrack.idl: * Modules/mediastream/MediaDeviceInfo.idl: * Modules/mediastream/MediaDevices.idl: * Modules/mediastream/MediaStream.idl: * Modules/mediastream/MediaStreamTrack.idl: * Modules/mediastream/MediaStreamTrackEvent.idl: * Modules/mediastream/OverconstrainedError.idl: * Modules/mediastream/OverconstrainedErrorEvent.idl: * Modules/mediastream/RTCCertificate.idl: * Modules/mediastream/RTCConfiguration.idl: * Modules/mediastream/RTCDTMFSender.idl: * Modules/mediastream/RTCDTMFToneChangeEvent.idl: * Modules/mediastream/RTCDataChannel.idl: * Modules/mediastream/RTCDataChannelEvent.idl: * Modules/mediastream/RTCIceCandidate.idl: * Modules/mediastream/RTCIceTransport.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCPeerConnectionIceEvent.idl: * Modules/mediastream/RTCRtpReceiver.idl: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpTransceiver.idl: * Modules/mediastream/RTCSessionDescription.idl: * Modules/mediastream/RTCStatsReport.idl: * Modules/mediastream/RTCTrackEvent.idl: * Modules/notifications/Notification.idl: * Modules/paymentrequest/PaymentRequest.idl: * Modules/remoteplayback/RemotePlayback.idl: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisEvent.idl: * Modules/speech/SpeechSynthesisUtterance.idl: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/webaudio/AnalyserNode.idl: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioDestinationNode.idl: * Modules/webaudio/AudioListener.idl: * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioParam.idl: * Modules/webaudio/AudioParamMap.idl: * Modules/webaudio/AudioProcessingEvent.idl: * Modules/webaudio/AudioScheduledSourceNode.idl: * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/BiquadFilterNode.idl: * Modules/webaudio/ChannelMergerNode.idl: * Modules/webaudio/ChannelSplitterNode.idl: * Modules/webaudio/ConstantSourceNode.idl: * Modules/webaudio/ConvolverNode.idl: * Modules/webaudio/DelayNode.idl: * Modules/webaudio/DynamicsCompressorNode.idl: * Modules/webaudio/GainNode.idl: * Modules/webaudio/IIRFilterNode.idl: * Modules/webaudio/MediaElementAudioSourceNode.idl: * Modules/webaudio/MediaStreamAudioDestinationNode.idl: * Modules/webaudio/MediaStreamAudioSourceNode.idl: * Modules/webaudio/OfflineAudioCompletionEvent.idl: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/PannerNode.idl: * Modules/webaudio/PeriodicWave.idl: * Modules/webaudio/ScriptProcessorNode.idl: * Modules/webaudio/StereoPannerNode.idl: * Modules/webaudio/WaveShaperNode.idl: * Modules/webaudio/WebKitAudioContext.idl: * Modules/webaudio/WebKitAudioPannerNode.idl: * Modules/webaudio/WebKitOfflineAudioContext.idl: * Modules/webdatabase/Database.idl: * Modules/webdatabase/SQLError.idl: * Modules/webdatabase/SQLResultSet.idl: * Modules/webdatabase/SQLResultSetRowList.idl: * Modules/webdatabase/SQLTransaction.idl: * Modules/webgpu/GPUBufferUsage.idl: * Modules/webgpu/GPUCanvasContext.idl: * Modules/webgpu/GPUColorWrite.idl: * Modules/webgpu/GPUOutOfMemoryError.idl: * Modules/webgpu/GPUShaderStage.idl: * Modules/webgpu/GPUTextureUsage.idl: * Modules/webgpu/GPUValidationError.idl: * Modules/webgpu/Navigator+GPU.idl: * Modules/webgpu/WebGPU.idl: * Modules/webgpu/WebGPUAdapter.idl: * Modules/webgpu/WebGPUBindGroup.idl: * Modules/webgpu/WebGPUBindGroupLayout.idl: * Modules/webgpu/WebGPUBuffer.idl: * Modules/webgpu/WebGPUCommandBuffer.idl: * Modules/webgpu/WebGPUCommandEncoder.idl: * Modules/webgpu/WebGPUComputePassEncoder.idl: * Modules/webgpu/WebGPUComputePipeline.idl: * Modules/webgpu/WebGPUDevice.idl: * Modules/webgpu/WebGPUPipelineLayout.idl: * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: * Modules/webgpu/WebGPUQueue.idl: * Modules/webgpu/WebGPURenderPassEncoder.idl: * Modules/webgpu/WebGPURenderPipeline.idl: * Modules/webgpu/WebGPUSampler.idl: * Modules/webgpu/WebGPUShaderModule.idl: * Modules/webgpu/WebGPUSwapChain.idl: * Modules/webgpu/WebGPUTexture.idl: * Modules/webgpu/WebGPUTextureView.idl: * Modules/webxr/XRInputSourceEvent.idl: * Modules/webxr/XRInputSourcesChangeEvent.idl: * Modules/webxr/XRReferenceSpaceEvent.idl: * Modules/webxr/XRSessionEvent.idl: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationPlaybackEvent.idl: * animation/AnimationTimeline.idl: * animation/DocumentTimeline.idl: * animation/WebAnimation.idl: * css/CSSConditionRule.idl: * css/CSSFontFaceRule.idl: * css/CSSGroupingRule.idl: * css/CSSImportRule.idl: * css/CSSKeyframeRule.idl: * css/CSSKeyframesRule.idl: * css/CSSMediaRule.idl: * css/CSSNamespaceRule.idl: * css/CSSPageRule.idl: * css/CSSRuleList.idl: * css/CSSStyleDeclaration.idl: * css/CSSStyleRule.idl: * css/CSSStyleSheet.idl: * css/CSSSupportsRule.idl: * css/DOMCSSNamespace.idl: * css/DeprecatedCSSOMCounter.idl: * css/DeprecatedCSSOMPrimitiveValue.idl: * css/DeprecatedCSSOMRGBColor.idl: * css/DeprecatedCSSOMRect.idl: * css/DeprecatedCSSOMValue.idl: * css/DeprecatedCSSOMValueList.idl: * css/FontFace.idl: * css/FontFaceSet.idl: * css/MediaQueryListEvent.idl: * css/typedom/StylePropertyMap.idl: * dom/AbortAlgorithm.idl: * dom/AnimationEvent.idl: * dom/Attr.idl: * dom/BeforeLoadEvent.idl: * dom/BeforeUnloadEvent.idl: * dom/CDATASection.idl: * dom/CharacterData.idl: * dom/ClipboardEvent.idl: * dom/Comment.idl: * dom/CompositionEvent.idl: * dom/CustomElementRegistry.idl: * dom/DOMImplementation.idl: * dom/DOMRectList.idl: * dom/DOMStringList.idl: * dom/DOMStringMap.idl: * dom/DataTransfer.idl: * dom/DataTransferItem.idl: * dom/DataTransferItemList.idl: * dom/DeviceMotionEvent.idl: * dom/DeviceOrientationEvent.idl: * dom/Document.idl: * dom/DocumentFragment.idl: * dom/DocumentType.idl: * dom/DragEvent.idl: * dom/Element.idl: * dom/FocusEvent.idl: * dom/HashChangeEvent.idl: * dom/IdleDeadline.idl: * dom/InputEvent.idl: * dom/KeyboardEvent.idl: * dom/MouseEvent.idl: * dom/MutationEvent.idl: * dom/MutationObserver.idl: * dom/MutationRecord.idl: * dom/NamedNodeMap.idl: * dom/Node.idl: * dom/NodeFilter.idl: * dom/NodeIterator.idl: * dom/NodeList.idl: * dom/OverflowEvent.idl: * dom/PageTransitionEvent.idl: * dom/PopStateEvent.idl: * dom/ProcessingInstruction.idl: * dom/Range.idl: * dom/SecurityPolicyViolationEvent.idl: * dom/ShadowRoot.idl: * dom/StaticRange.idl: * dom/Text.idl: * dom/TextEvent.idl: * dom/Touch.idl: * dom/TouchEvent.idl: * dom/TouchList.idl: * dom/TransitionEvent.idl: * dom/TreeWalker.idl: * dom/UIEvent.idl: * dom/WebKitAnimationEvent.idl: * dom/WebKitTransitionEvent.idl: * dom/WheelEvent.idl: * dom/XMLDocument.idl: * html/DOMTokenList.idl: * html/HTMLAllCollection.idl: * html/HTMLAnchorElement.idl: * html/HTMLAppletElement.idl: * html/HTMLAreaElement.idl: * html/HTMLAttachmentElement.idl: * html/HTMLAudioElement.idl: * html/HTMLBRElement.idl: * html/HTMLBaseElement.idl: * html/HTMLBodyElement.idl: * html/HTMLButtonElement.idl: * html/HTMLCanvasElement.idl: * html/HTMLCollection.idl: * html/HTMLDListElement.idl: * html/HTMLDataElement.idl: * html/HTMLDataListElement.idl: * html/HTMLDetailsElement.idl: * html/HTMLDirectoryElement.idl: * html/HTMLDivElement.idl: * html/HTMLDocument.idl: * html/HTMLElement.idl: * html/HTMLEmbedElement.idl: * html/HTMLFieldSetElement.idl: * html/HTMLFontElement.idl: * html/HTMLFormControlsCollection.idl: * html/HTMLFormElement.idl: * html/HTMLFrameElement.idl: * html/HTMLFrameSetElement.idl: * html/HTMLHRElement.idl: * html/HTMLHeadElement.idl: * html/HTMLHeadingElement.idl: * html/HTMLHtmlElement.idl: * html/HTMLIFrameElement.idl: * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLKeygenElement.idl: * html/HTMLLIElement.idl: * html/HTMLLabelElement.idl: * html/HTMLLegendElement.idl: * html/HTMLLinkElement.idl: * html/HTMLMapElement.idl: * html/HTMLMarqueeElement.idl: * html/HTMLMediaElement.idl: * html/HTMLMenuElement.idl: * html/HTMLMenuItemElement.idl: * html/HTMLMetaElement.idl: * html/HTMLMeterElement.idl: * html/HTMLModElement.idl: * html/HTMLOListElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOptGroupElement.idl: * html/HTMLOptionElement.idl: * html/HTMLOptionsCollection.idl: * html/HTMLOutputElement.idl: * html/HTMLParagraphElement.idl: * html/HTMLParamElement.idl: * html/HTMLPictureElement.idl: * html/HTMLPreElement.idl: * html/HTMLProgressElement.idl: * html/HTMLQuoteElement.idl: * html/HTMLScriptElement.idl: * html/HTMLSelectElement.idl: * html/HTMLSlotElement.idl: * html/HTMLSourceElement.idl: * html/HTMLSpanElement.idl: * html/HTMLStyleElement.idl: * html/HTMLTableCaptionElement.idl: * html/HTMLTableCellElement.idl: * html/HTMLTableColElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTableSectionElement.idl: * html/HTMLTemplateElement.idl: * html/HTMLTextAreaElement.idl: * html/HTMLTimeElement.idl: * html/HTMLTitleElement.idl: * html/HTMLTrackElement.idl: * html/HTMLUListElement.idl: * html/HTMLUnknownElement.idl: * html/HTMLVideoElement.idl: * html/MediaController.idl: * html/MediaEncryptedEvent.idl: * html/MediaError.idl: * html/RadioNodeList.idl: * html/TimeRanges.idl: * html/ValidityState.idl: * html/WebKitMediaKeyError.idl: * html/canvas/CanvasCompositing.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasDrawPath.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasFilters.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasImageSmoothing.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPathDrawingStyles.idl: * html/canvas/CanvasRect.idl: * html/canvas/CanvasRenderingContext2D.idl: * html/canvas/CanvasShadowStyles.idl: * html/canvas/CanvasState.idl: * html/canvas/CanvasText.idl: * html/canvas/CanvasTextDrawingStyles.idl: * html/canvas/CanvasTransform.idl: * html/canvas/CanvasUserInterface.idl: * html/canvas/PaintRenderingContext2D.idl: * html/canvas/WebGLActiveInfo.idl: * html/canvas/WebGLBuffer.idl: * html/canvas/WebGLContextEvent.idl: * html/canvas/WebGLFramebuffer.idl: * html/canvas/WebGLProgram.idl: * html/canvas/WebGLQuery.idl: * html/canvas/WebGLRenderbuffer.idl: * html/canvas/WebGLSampler.idl: * html/canvas/WebGLShader.idl: * html/canvas/WebGLShaderPrecisionFormat.idl: * html/canvas/WebGLSync.idl: * html/canvas/WebGLTexture.idl: * html/canvas/WebGLTransformFeedback.idl: * html/canvas/WebGLUniformLocation.idl: * html/canvas/WebGLVertexArrayObject.idl: * html/track/AudioTrack.idl: * html/track/AudioTrackList.idl: * html/track/DataCue.idl: * html/track/TextTrack.idl: * html/track/TextTrackCue.idl: * html/track/TextTrackCueGeneric.idl: * html/track/TextTrackCueList.idl: * html/track/TextTrackList.idl: * html/track/TrackEvent.idl: * html/track/VTTCue.idl: * html/track/VTTRegion.idl: * html/track/VTTRegionList.idl: * html/track/VideoTrack.idl: * html/track/VideoTrackList.idl: * loader/appcache/DOMApplicationCache.idl: * mathml/MathMLElement.idl: * mathml/MathMLMathElement.idl: * page/BarProp.idl: * page/Crypto.idl: * page/DOMSelection.idl: * page/DOMWindow.idl: * page/GlobalCrypto.idl: * page/GlobalPerformance.idl: * page/History.idl: * page/IntersectionObserver.idl: * page/IntersectionObserverEntry.idl: * page/Location.idl: * page/Navigator+IsLoggedIn.idl: * page/Navigator.idl: * page/PerformanceNavigation.idl: * page/PerformancePaintTiming.idl: * page/PerformanceTiming.idl: * page/RemoteDOMWindow.idl: * page/ResizeObserver.idl: * page/ResizeObserverEntry.idl: * page/Screen.idl: * page/UndoItem.idl: * page/UndoManager.idl: * page/UserMessageHandler.idl: * page/UserMessageHandlersNamespace.idl: * page/VisualViewport.idl: * page/WebKitNamespace.idl: * page/WebKitPoint.idl: * plugins/DOMMimeType.idl: * plugins/DOMMimeTypeArray.idl: * plugins/DOMPlugin.idl: * plugins/DOMPluginArray.idl: * storage/Storage.idl: * storage/StorageEvent.idl: * svg/SVGAElement.idl: * svg/SVGAltGlyphDefElement.idl: * svg/SVGAltGlyphElement.idl: * svg/SVGAltGlyphItemElement.idl: * svg/SVGAngle.idl: * svg/SVGAnimateColorElement.idl: * svg/SVGAnimateElement.idl: * svg/SVGAnimateMotionElement.idl: * svg/SVGAnimateTransformElement.idl: * svg/SVGAnimatedAngle.idl: * svg/SVGAnimatedBoolean.idl: * svg/SVGAnimatedEnumeration.idl: * svg/SVGAnimatedInteger.idl: * svg/SVGAnimatedLength.idl: * svg/SVGAnimatedLengthList.idl: * svg/SVGAnimatedNumber.idl: * svg/SVGAnimatedNumberList.idl: * svg/SVGAnimatedPreserveAspectRatio.idl: * svg/SVGAnimatedRect.idl: * svg/SVGAnimatedString.idl: * svg/SVGAnimatedTransformList.idl: * svg/SVGAnimationElement.idl: * svg/SVGCircleElement.idl: * svg/SVGClipPathElement.idl: * svg/SVGComponentTransferFunctionElement.idl: * svg/SVGCursorElement.idl: * svg/SVGDefsElement.idl: * svg/SVGDescElement.idl: * svg/SVGElement.idl: * svg/SVGEllipseElement.idl: * svg/SVGFEBlendElement.idl: * svg/SVGFEColorMatrixElement.idl: * svg/SVGFEComponentTransferElement.idl: * svg/SVGFECompositeElement.idl: * svg/SVGFEConvolveMatrixElement.idl: * svg/SVGFEDiffuseLightingElement.idl: * svg/SVGFEDisplacementMapElement.idl: * svg/SVGFEDistantLightElement.idl: * svg/SVGFEDropShadowElement.idl: * svg/SVGFEFloodElement.idl: * svg/SVGFEFuncAElement.idl: * svg/SVGFEFuncBElement.idl: * svg/SVGFEFuncGElement.idl: * svg/SVGFEFuncRElement.idl: * svg/SVGFEGaussianBlurElement.idl: * svg/SVGFEImageElement.idl: * svg/SVGFEMergeElement.idl: * svg/SVGFEMergeNodeElement.idl: * svg/SVGFEMorphologyElement.idl: * svg/SVGFEOffsetElement.idl: * svg/SVGFEPointLightElement.idl: * svg/SVGFESpecularLightingElement.idl: * svg/SVGFESpotLightElement.idl: * svg/SVGFETileElement.idl: * svg/SVGFETurbulenceElement.idl: * svg/SVGFilterElement.idl: * svg/SVGFontElement.idl: * svg/SVGFontFaceElement.idl: * svg/SVGFontFaceFormatElement.idl: * svg/SVGFontFaceNameElement.idl: * svg/SVGFontFaceSrcElement.idl: * svg/SVGFontFaceUriElement.idl: * svg/SVGForeignObjectElement.idl: * svg/SVGGElement.idl: * svg/SVGGeometryElement.idl: * svg/SVGGlyphElement.idl: * svg/SVGGlyphRefElement.idl: * svg/SVGGradientElement.idl: * svg/SVGGraphicsElement.idl: * svg/SVGHKernElement.idl: * svg/SVGImageElement.idl: * svg/SVGLength.idl: * svg/SVGLengthList.idl: * svg/SVGLineElement.idl: * svg/SVGLinearGradientElement.idl: * svg/SVGMPathElement.idl: * svg/SVGMarkerElement.idl: * svg/SVGMaskElement.idl: * svg/SVGMatrix.idl: * svg/SVGMetadataElement.idl: * svg/SVGMissingGlyphElement.idl: * svg/SVGNumber.idl: * svg/SVGNumberList.idl: * svg/SVGPathElement.idl: * svg/SVGPathSeg.idl: * svg/SVGPathSegArcAbs.idl: * svg/SVGPathSegArcRel.idl: * svg/SVGPathSegClosePath.idl: * svg/SVGPathSegCurvetoCubicAbs.idl: * svg/SVGPathSegCurvetoCubicRel.idl: * svg/SVGPathSegCurvetoCubicSmoothAbs.idl: * svg/SVGPathSegCurvetoCubicSmoothRel.idl: * svg/SVGPathSegCurvetoQuadraticAbs.idl: * svg/SVGPathSegCurvetoQuadraticRel.idl: * svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl: * svg/SVGPathSegCurvetoQuadraticSmoothRel.idl: * svg/SVGPathSegLinetoAbs.idl: * svg/SVGPathSegLinetoHorizontalAbs.idl: * svg/SVGPathSegLinetoHorizontalRel.idl: * svg/SVGPathSegLinetoRel.idl: * svg/SVGPathSegLinetoVerticalAbs.idl: * svg/SVGPathSegLinetoVerticalRel.idl: * svg/SVGPathSegList.idl: * svg/SVGPathSegMovetoAbs.idl: * svg/SVGPathSegMovetoRel.idl: * svg/SVGPatternElement.idl: * svg/SVGPoint.idl: * svg/SVGPointList.idl: * svg/SVGPolygonElement.idl: * svg/SVGPolylineElement.idl: * svg/SVGPreserveAspectRatio.idl: * svg/SVGRadialGradientElement.idl: * svg/SVGRect.idl: * svg/SVGRectElement.idl: * svg/SVGRenderingIntent.idl: * svg/SVGSVGElement.idl: * svg/SVGScriptElement.idl: * svg/SVGSetElement.idl: * svg/SVGStopElement.idl: * svg/SVGStringList.idl: * svg/SVGStyleElement.idl: * svg/SVGSwitchElement.idl: * svg/SVGSymbolElement.idl: * svg/SVGTRefElement.idl: * svg/SVGTSpanElement.idl: * svg/SVGTextContentElement.idl: * svg/SVGTextElement.idl: * svg/SVGTextPathElement.idl: * svg/SVGTextPositioningElement.idl: * svg/SVGTitleElement.idl: * svg/SVGTransform.idl: * svg/SVGTransformList.idl: * svg/SVGUnitTypes.idl: * svg/SVGUseElement.idl: * svg/SVGVKernElement.idl: * svg/SVGViewElement.idl: * svg/SVGViewSpec.idl: * svg/SVGZoomEvent.idl: * workers/Worker.idl: * workers/service/ExtendableEvent.idl: * workers/service/ExtendableEventInit.idl: * workers/service/FetchEvent.idl: * worklets/Worklet.idl: * xml/DOMParser.idl: * xml/XMLHttpRequestProgressEvent.idl: * xml/XMLSerializer.idl: * xml/XPathEvaluator.idl: * xml/XPathExpression.idl: * xml/XPathResult.idl: * xml/XSLTProcessor.idl: 2020-09-30 Keith Miller <keith_miller@apple.com> CSS Selector an-plus-b serialization is incorrect https://bugs.webkit.org/show_bug.cgi?id=217108 Reviewed by Darin Adler. Right now we don't differentiate our CSS serialization for an-plus-b expressions from any other CSS sytnax. This is incorrect, according to the CSS spec an-plus-b expressions have custom serialization rules. See: https://www.w3.org/TR/css-syntax-3/#serializing-anb One thing of note is for constant an-plus-b expressions (i.e. a is zero so the resulting string is just a number), we get the string from JSC::VM's numeric string cache. * css/parser/CSSSelectorParser.cpp: (WebCore::CSSSelectorParser::consumePseudo): (WebCore::serializeANPlusB): 2020-09-30 James Darpinian <jdarpinian@chromium.org> Expose pvrtc extension without vendor prefix and remove redundant WebGL 2 extensions https://bugs.webkit.org/show_bug.cgi?id=217110 Reviewed by Kenneth Russell. Extensions are tested in LayoutTests/webgl * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getExtension): (WebCore::WebGL2RenderingContext::getSupportedExtensions): * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::getExtension): (WebCore::WebGLRenderingContext::getSupportedExtensions): 2020-09-30 Simon Fraser <simon.fraser@apple.com> Adjuster::computeEventListenerRegionTypes() should use ENABLE(WHEEL_EVENT_REGIONS) not a platform #ifdef https://bugs.webkit.org/show_bug.cgi?id=217146 Reviewed by Tim Horton. Use ENABLE(WHEEL_EVENT_REGIONS) instead of !PLATFORM(IOS_FAMILY). * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::computeEventListenerRegionTypes): 2020-09-30 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Enable <wbr> content https://bugs.webkit.org/show_bug.cgi?id=217065 Reviewed by Antti Koivisto. Enable <wbr> content now that IFC fully supports it. Test: fast/text/wbr-simple.html * layout/integration/LayoutIntegrationCoverage.cpp: (WebCore::LayoutIntegration::canUseForLineLayoutWithReason): 2020-09-30 Youenn Fablet <youenn@apple.com> Handle deprecation warnings from libwebrtc headers https://bugs.webkit.org/show_bug.cgi?id=217126 <rdar://problem/69747375> Reviewed by Tim Horton. Disable deprecation warnings coming from libwebrtc headers. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCObservers.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * testing/MockLibWebRTCPeerConnection.h: 2020-09-30 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r267788. Broke internal builds. Reverted changeset: "MediaRecorder should support isTypeSupported" https://bugs.webkit.org/show_bug.cgi?id=216856 https://trac.webkit.org/changeset/267788 2020-09-30 Sam Weinig <weinig@apple.com> Remove code behind ENABLE(MEDIA_SESSION), no ports enable it https://bugs.webkit.org/show_bug.cgi?id=216831 Reviewed by Alex Christensen. * CMakeLists.txt: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Remove media session related files. * Modules/airplay/PlaybackTargetClientContextIdentifier.h: Added. * Modules/airplay/WebMediaSessionManager.cpp: Added. * Modules/airplay/WebMediaSessionManager.h: Added. * Modules/airplay/WebMediaSessionManagerClient.h: Added. * Modules/mediasession: Removed. * platform/mediasession: Removed. Delete Modules/mediasession and platform/mediasession. Move files that were actually used for the WIRELESS_PLAYBACK_TARGET feature to Modules/airplay where other parts of that feature are implemented. * dom/Document.cpp: * dom/Document.h: * dom/EventTargetFactory.in: * html/HTMLMediaElement.cpp: * html/HTMLMediaElement.h: * page/ChromeClient.h: * page/Page.cpp: * page/Page.h: * testing/Internals.cpp: * testing/Internals.h: * testing/Internals.idl: Remove all code inside ENABLE(MEDIA_SESSION). 2020-09-30 Andres Gonzalez <andresg_22@apple.com> Fix for multiple layout tests in accessibility isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=217093 Reviewed by Chris Fleizach and Darin Adler. Fix for the following layout tests in accessibility isolated tree mode: accessibility/aria-menubar-menuitems.html accessibility/aria-orientation.html accessibility/set-selected-editable.html accessibility/removed-continuation-element-causes-crash.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAttributeChange): Update the isolated tree when the id attribute is modified. This is needed for all tests that assign an id attribute to an element in JS, in order to retrieve its accessibility object via AccessibilityController::accessibleElementById. In addition, changed the handling of the lang attribute to just update the isolated tree instead of posting a notification which is not used. (WebCore::AXObjectCache::updateIsolatedTree): Update the AXIsolatedObject IdentifierAttribute property. Replaced the updateNodeCheckedState method with the more general updateNodeProperty. * accessibility/AXObjectCache.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): The ComputedRoleString property needs to be isolatedCopied. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::generateSubtree): Instead of having an out parameter in createSubtree to collect the NodeChanges that need to be added to the tree, we now add each individual pending append as the live tree is traversed. This solves the issue manifest in some tests where during the creation of the subtree, applyPendingChanges was called and node properties were not updated because the nodes were not added to the tree yet. (WebCore::AXIsolatedTree::createSubtree): See above comment for generateSubtree. (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updateNodeProperty): Replaces updateNodeCheckedState to allow update of any individual property. (WebCore::AXIsolatedTree::removeNode): Also remove the entry from m_nodeMap. (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::applyPendingChanges): (WebCore::AXIsolatedTree::NodeChange::NodeChange): Deleted, using aggregate initialization. (WebCore::AXIsolatedTree::updateNodeCheckedState): Became updateNodeProperty. (WebCore::AXIsolatedTree::appendNodeChanges): Deleted, not needed any longer. * accessibility/isolatedtree/AXIsolatedTree.h: 2020-09-30 Sam Weinig <weinig@apple.com> Re-align DocumentAndElementEventHandlers.idl, GlobalEventHandlers.idl and WindowEventHandlers.idl with the HTML spec https://bugs.webkit.org/show_bug.cgi?id=217088 Reviewed by Darin Adler. Re-align DocumentAndElementEventHandlers.idl, GlobalEventHandlers.idl and WindowEventHandlers.idl with the HTML spec, adding commented out variants of properties we don't yet support. The actual changes are: - onwebkitanimation* handlers moved from DocumentAndElementEventHandlers to GlobalEventHandlers (and were removed from DOMWindow as they are now redundant). - onrejectionhandled/onunhandledrejection handlers move from GlobalEventHandlers to WindowEventHandlers Updated results for more existing tests that now pass. * dom/DocumentAndElementEventHandlers.idl: * dom/GlobalEventHandlers.idl: * page/DOMWindow.idl: * page/WindowEventHandlers.idl: * workers/WorkerGlobalScope.idl: 2020-09-30 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Rename LineBreaker to InlineContentBreaker https://bugs.webkit.org/show_bug.cgi?id=217119 Reviewed by Antti Koivisto. This class is responsible for breaking inline content. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/inlineformatting/InlineContentBreaker.cpp: Renamed from Source/WebCore/layout/inlineformatting/InlineLineBreaker.cpp. (WebCore::Layout::isTextContentOnly): (WebCore::Layout::isVisuallyEmptyWhitespaceContentOnly): (WebCore::Layout::isNonContentRunsOnly): (WebCore::Layout::firstTextRunIndex): (WebCore::Layout::lastContentRunIndex): (WebCore::Layout::isWrappingAllowed): (WebCore::Layout::shouldKeepBeginningOfLineWhitespace): (WebCore::Layout::lastWrapOpportunityIndex): (WebCore::Layout::InlineContentBreaker::isContentWrappingAllowed const): (WebCore::Layout::InlineContentBreaker::shouldKeepEndOfLineWhitespace const): (WebCore::Layout::InlineContentBreaker::processInlineContent): (WebCore::Layout::InlineContentBreaker::processOverflowingContent const): (WebCore::Layout::InlineContentBreaker::processOverflowingTextContent const): (WebCore::Layout::InlineContentBreaker::wordBreakBehavior const): (WebCore::Layout::InlineContentBreaker::tryBreakingTextRun const): (WebCore::Layout::InlineContentBreaker::ContinuousContent::append): (WebCore::Layout::InlineContentBreaker::ContinuousContent::reset): * layout/inlineformatting/InlineContentBreaker.h: Renamed from Source/WebCore/layout/inlineformatting/InlineLineBreaker.h. (WebCore::Layout::InlineContentBreaker::ContinuousContent::logicalWidth const): (WebCore::Layout::InlineContentBreaker::ContinuousContent::logicalLeft const): (WebCore::Layout::InlineContentBreaker::ContinuousContent::collapsibleLogicalWidth const): (WebCore::Layout::InlineContentBreaker::ContinuousContent::nonCollapsibleLogicalWidth const): (WebCore::Layout::InlineContentBreaker::ContinuousContent::hasTrailingCollapsibleContent const): (WebCore::Layout::InlineContentBreaker::ContinuousContent::isFullyCollapsible const): (WebCore::Layout::InlineContentBreaker::ContinuousContent::runs const): (WebCore::Layout::InlineContentBreaker::setHyphenationDisabled): (WebCore::Layout::InlineContentBreaker::ContinuousContent::Run::Run): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineCandidate::InlineContent::continuousContent const): (WebCore::Layout::LineBuilder::placeInlineContent): (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): (WebCore::Layout::LineBuilder::commitPartialContent): * layout/inlineformatting/InlineLineBuilder.h: 2020-09-30 Youenn Fablet <youenn@apple.com> MediaRecorder should support isTypeSupported https://bugs.webkit.org/show_bug.cgi?id=216856 Reviewed by Darin Adler. Introduce MediaRecorder::isMimeTypeSupported whose result is exposed as MediaRecoder.isTypeSupported. Cocoa port allows mp4 audio and video mime types, with H264 and AAC codecs. Add a routine to get the mime type from the MediaRecorderPrivate. Store it in MediaRecorder and add a mimeType getter. Test: http/wpt/mediarecorder/mimeType.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::isTypeSupported): (WebCore::MediaRecorder::create): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediarecorder/MediaRecorderProvider.cpp: (WebCore::MediaRecorderProvider::isSupported): * Modules/mediarecorder/MediaRecorderProvider.h: * platform/mediarecorder/MediaRecorderPrivate.cpp: (WebCore::MediaRecorderPrivate::mimeType const): * platform/mediarecorder/MediaRecorderPrivate.h: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::fetchData): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::mimeType const): * platform/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediastream/MediaStreamPrivate.h: 2020-09-30 Philippe Normand <pnormand@igalia.com> [GStreamer] Internal audio rendering support https://bugs.webkit.org/show_bug.cgi?id=207634 Reviewed by Xabier Rodriguez-Calvar. This patch introduces two features regarding audio rendering: 1. Internal audio mixing enabled at runtime with the WEBKIT_GST_ENABLE_AUDIO_MIXER=1 environment variable. When this is enabled, the WebProcess will have its GStreamer backends render to dedicated WebKit audio sinks. Those will forward buffers to a singleton audio mixer. The resulting audio stream will then be rendered through the default audio sink (PulseAudio in most cases). Using this approach, applications will maintain a single connection to the audio daemon. 2. For WPE, external audio pass-through. To enable this, the application has to register an audio receiver using the WPEBackend-FDO wpe_audio_register_receiver() API. When this is enabled, the WebKit audio sinks running in the WebProcess will forward audio samples to the UIProcess, using a Wayland protocol defined in the WPEBackend-FDO backend and exposed through its audio extension. This client-side rendering support allows applications to have full control on the audio samples rendering. The Internal mode should be considered a technology preview and can't be enabled by default yet, because audiomixer lacks some features such as reverse playback support. External audio rendering policy is covered by a new WPE API test. * platform/GStreamer.cmake: * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer): Create sink depending on selected audio rendering policy and probe platform for a working audio output device only when the WebKit custom audio sink hasn't been selected. This is needed only for the autoaudiosink case. * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: (WebCore::AudioSourceProviderGStreamer::configureAudioBin): Instead of creating a new sink, embed the one provided by the player into the audio bin. The resulting bin becomes the player audio sink and it's able to render both to the WebAudio provider and the usual sink, as before. * platform/audio/gstreamer/AudioSourceProviderGStreamer.h: * platform/graphics/gstreamer/GStreamerAudioMixer.cpp: Added. (WebCore::GStreamerAudioMixer::isAllowed): The mixer requires a recent GStreamer version and the inter plugin (shipped in gst-plugins-bad until version 1.20 at least). (WebCore::GStreamerAudioMixer::singleton): Entry point for the mixer. This is where the singleton is created. (WebCore::GStreamerAudioMixer::GStreamerAudioMixer): Configure the standalone mixer pipeline. (WebCore::GStreamerAudioMixer::~GStreamerAudioMixer): (WebCore::GStreamerAudioMixer::ensureState): Lazily start/stop the mixer, depending on the number of incoming streams. The pipeline starts when the first incoming stream is connected, and stops when the last stream disappears. (WebCore::GStreamerAudioMixer::registerProducer): Client pipelines require an interaudiosink, they will render to that sink, which internally forwards data to a twin interaudiosrc element, connected to the audiomixer. (WebCore::GStreamerAudioMixer::unregisterProducer): Get rid of an interaudiosink and its interaudiosrc. This is called by the WebKit audio sink when the element is being disposed. * platform/graphics/gstreamer/GStreamerAudioMixer.h: Added. * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::initializeGStreamerAndRegisterWebKitElements): Register new audio sink element. (WebCore::createPlatformAudioSink): New utility function to create an audio sink based on the desired and implied runtime rendering policy. (WebCore::initializeGStreamerAndRegisterWebKitElements): * platform/graphics/gstreamer/GStreamerCommon.h: * platform/graphics/gstreamer/GUniquePtrGStreamer.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): (WebCore::MediaPlayerPrivateGStreamer::seek): Drive-by clean-up, no need to create the seek Mediatime before the early return checking this is a live stream. (WebCore::setSyncOnClock): Fixup code style in this method. (WebCore::MediaPlayerPrivateGStreamer::createAudioSink): (WebCore::MediaPlayerPrivateGStreamer::audioSink const): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp: Added. This sink can either forward incoming samples to the shared audiomixer running in its own pipeline, or forward samples to the UIProcess using the WPEBackend-FDO audio extension. (AudioPacketHolder::AudioPacketHolder): Wrapper around audio buffers, in charge of creating the corresponding memfd descriptor and also keeping track of the corresponding wpe_audio_packet_export. (AudioPacketHolder::~AudioPacketHolder): (AudioPacketHolder::map): Create the memfd descriptor and return it along with the buffer size. (webKitAudioSinkHandleSample): Forward incoming samples using the WPEBackend-FDO audio extension. The wpe_audio_source start is synchronized with the buffer flow. (webKitAudioSinkConfigure): When internal mixing has been requested, create an interaudiosink to which samples will be sent. Internally the interaudiosink will forward data to its interaudiosrc which is connected to the audiomixer. Otherwise, if external rendering has been requested, create an appsink in order to relay samples to the UIProcess. (webKitAudioSinkDispose): (getInternalVolumeObject): When internal mixing is enabled, volume and mute states are tracked within the audiomixer sink pads. Otherwise our audio sink manages this using a volume element. (webKitAudioSinkSetProperty): Proxy volume and mute properties from the internal volume proxy. (webKitAudioSinkGetProperty): Ditto. (webKitAudioSinkChangeState): Keep the WPE audio source state synchronized with the element state, in order to know when the pause/resume notifications should be sent to the UIProcess. This is also where maintain the relationship between the interaudiosink and the audiomixer, when it's enabled. (webkit_audio_sink_class_init): (webkitAudioSinkNew): * platform/graphics/gstreamer/WebKitAudioSinkGStreamer.h: Added. 2020-09-30 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Merge LineBreaker::CandidateContent and ContinuousContent https://bugs.webkit.org/show_bug.cgi?id=217113 Reviewed by Antti Koivisto. This patch simplifies the connection between the LineBuilder and the LineBreaker by using the same structure to track candidate runs. LineBreaker::CandidateContent is also a continuous content (it has to be) so we can just use this structure in LineCandidate::InlineContent (m_continuousContent) and pass it in to the LineBreaker when we hit a wrapping opportunity. * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::isTextContentOnly): (WebCore::Layout::isVisuallyEmptyWhitespaceContentOnly): (WebCore::Layout::isNonContentRunsOnly): (WebCore::Layout::firstTextRunIndex): (WebCore::Layout::lastContentRunIndex): (WebCore::Layout::lastWrapOpportunityIndex): (WebCore::Layout::LineBreaker::isContentWrappingAllowed const): (WebCore::Layout::LineBreaker::shouldKeepEndOfLineWhitespace const): (WebCore::Layout::LineBreaker::processInlineContent): (WebCore::Layout::LineBreaker::processOverflowingContent const): (WebCore::Layout::LineBreaker::tryBreakingTextRun const): (WebCore::Layout::LineBreaker::ContinuousContent::append): (WebCore::Layout::LineBreaker::ContinuousContent::reset): (WebCore::Layout::ContinuousContent::runs const): Deleted. (WebCore::Layout::ContinuousContent::isEmpty const): Deleted. (WebCore::Layout::ContinuousContent::logicalWidth const): Deleted. (WebCore::Layout::ContinuousContent::logicalLeft const): Deleted. (WebCore::Layout::ContinuousContent::hasTrailingCollapsibleContent const): Deleted. (WebCore::Layout::ContinuousContent::isFullyCollapsible const): Deleted. (WebCore::Layout::ContinuousContent::ContinuousContent): Deleted. (WebCore::Layout::ContinuousContent::nonCollapsibleLogicalWidth const): Deleted. (WebCore::Layout::ContinuousContent::hasTextContentOnly const): Deleted. (WebCore::Layout::ContinuousContent::isVisuallyEmptyWhitespaceContentOnly const): Deleted. (WebCore::Layout::ContinuousContent::firstTextRunIndex const): Deleted. (WebCore::Layout::ContinuousContent::lastContentRunIndex const): Deleted. (WebCore::Layout::ContinuousContent::hasNonContentRunsOnly const): Deleted. * layout/inlineformatting/InlineLineBreaker.h: (WebCore::Layout::LineBreaker::ContinuousContent::logicalWidth const): (WebCore::Layout::LineBreaker::ContinuousContent::logicalLeft const): (WebCore::Layout::LineBreaker::ContinuousContent::collapsibleLogicalWidth const): (WebCore::Layout::LineBreaker::ContinuousContent::nonCollapsibleLogicalWidth const): (WebCore::Layout::LineBreaker::ContinuousContent::hasTrailingCollapsibleContent const): (WebCore::Layout::LineBreaker::ContinuousContent::isFullyCollapsible const): (WebCore::Layout::LineBreaker::ContinuousContent::runs const): (WebCore::Layout::LineBreaker::ContinuousContent::Run::Run): (WebCore::Layout::LineBreaker::Run::Run): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineCandidate::InlineContent::continuousContent const): (WebCore::Layout::LineCandidate::InlineContent::appendInlineItem): (WebCore::Layout::LineCandidate::InlineContent::reset): (WebCore::Layout::LineCandidate::reset): (WebCore::Layout::LineBuilder::placeInlineContent): (WebCore::Layout::LineBuilder::nextContentForLine): (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): (WebCore::Layout::LineBuilder::commitPartialContent): (WebCore::Layout::LineCandidate::InlineContent::runs const): Deleted. (WebCore::Layout::LineCandidate::InlineContent::logicalWidth const): Deleted. (WebCore::Layout::LineCandidate::InlineContent::collapsibleTrailingWidth const): Deleted. * layout/inlineformatting/InlineLineBuilder.h: 2020-09-29 Yusuke Suzuki <ysuzuki@apple.com> Always use OperationPtrTag for all operations and annotate operations in CSS JIT https://bugs.webkit.org/show_bug.cgi?id=217117 Reviewed by Mark Lam. * css/SelectorChecker.cpp: (WebCore::isFrameFocused): Deleted. (WebCore::doesShadowTreeContainFocusedElement): Deleted. (WebCore::SelectorChecker::matchesFocusPseudoClass): Deleted. (WebCore::SelectorChecker::matchesDirectFocusPseudoClass): Deleted. * css/SelectorChecker.h: * css/SelectorCheckerTestFunctions.h: (WebCore::isFrameFocused): (WebCore::matchesDirectFocusPseudoClass): (WebCore::doesShadowTreeContainFocusedElement): (WebCore::matchesFocusPseudoClass): * cssjit/CSSPtrTag.h: * cssjit/FunctionCall.h: (WebCore::FunctionCall::FunctionCall): (WebCore::FunctionCall::setFunctionAddress): (WebCore::FunctionCall::prepareAndCall): * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::JSC_DEFINE_JIT_OPERATION): (WebCore::SelectorCompiler::addPseudoClassType): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation): (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSynchronizeStyleAttribute): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSynchronizeAllAnimatedSVGAttribute): (WebCore::SelectorCompiler::attributeValueSpaceSeparatedListContains): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementFunctionCallTest): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsActive): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsHovered): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsInLanguage): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPlaceholderShown): (WebCore::SelectorCompiler::SelectorFragment::appendUnoptimizedPseudoClassWithContext): Deleted. (WebCore::SelectorCompiler::addStyleRelationFunction): Deleted. (WebCore::SelectorCompiler::moduloHelper): Deleted. (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains): Deleted. (WebCore::SelectorCompiler::SelectorCodeGenerator::generateContextFunctionCallTest): Deleted. (WebCore::SelectorCompiler::elementIsActive): Deleted. (WebCore::SelectorCompiler::elementIsHovered): Deleted. (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown): Deleted. (WebCore::SelectorCompiler::isPlaceholderShown): Deleted. * dom/StyledElement.cpp: (WebCore::StyledElement::synchronizeStyleAttributeInternalImpl): (WebCore::StyledElement::synchronizeStyleAttributeInternal): Deleted. * dom/StyledElement.h: (WebCore::StyledElement::synchronizeStyleAttributeInternal const): * style/ElementRuleCollector.cpp: (WebCore::Style::ElementRuleCollector::collectMatchingRules): * svg/SVGElement.cpp: (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): Deleted. * svg/SVGElement.h: 2020-09-30 Myles C. Maxfield <mmaxfield@apple.com> [GPU Process] Remove FontHandle https://bugs.webkit.org/show_bug.cgi?id=217076 Reviewed by Wenson Hsieh. The only reason FontHandle exists is to be an internally-nullable wrapper around WebCore::Font. However, this codepath is only ever invoked with non-null fonts, so there's no point in having this wrapper. This patch replaces it with just Ref<Font>. No new tests because there is no behavior change. * WebCore.xcodeproj/project.pbxproj: * loader/cache/CachedFont.h: * platform/graphics/Font.cpp: (WebCore::FontHandle::FontHandle): Deleted. * platform/graphics/Font.h: * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::DrawGlyphs::encode const): (WebCore::DisplayList::DrawGlyphs::decode): * platform/graphics/mac/FontCustomPlatformData.h: 2020-09-29 Simon Fraser <simon.fraser@apple.com> [LFC Display] Basic text display https://bugs.webkit.org/show_bug.cgi?id=217120 Reviewed by Zalan Bujtas. Add basic text painting to LFC display. Display::TextBox() represents a run of text. Display::TreeBuilder gains code to build the inline tree by traversing runs, and CSSPainter gets the ability to paint text boxes. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * display/DisplayTreeBuilder.cpp: (WebCore::Display::TreeBuilder::buildInlineDisplayTree const): (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const): (WebCore::Display::outputDisplayBox): * display/DisplayTreeBuilder.h: * display/css/DisplayBox.h: (WebCore::Display::Box::isTextBox const): * display/css/DisplayCSSPainter.cpp: (WebCore::Display::CSSPainter::paintBoxContent): * display/css/DisplayStyle.cpp: (WebCore::Display::Style::Style): (WebCore::Display::Style::autoWrap const): (WebCore::Display::Style::preserveNewline const): (WebCore::Display::Style::collapseWhiteSpace const): * display/css/DisplayStyle.h: (WebCore::Display::Style::color const): (WebCore::Display::Style::fontCascade const): (WebCore::Display::Style::fontMetrics const): (WebCore::Display::Style::whiteSpace const): (WebCore::Display::Style::tabSize const): * display/css/DisplayTextBox.cpp: Copied from Source/WebCore/display/DisplayTreeBuilder.h. (WebCore::Display::TextBox::TextBox): (WebCore::Display::m_text): (WebCore::Display::TextBox::debugDescription const): * display/css/DisplayTextBox.h: Copied from Source/WebCore/display/DisplayTreeBuilder.h. (WebCore::Display::TextBox::expansion const): (WebCore::Display::TextBox::text const): 2020-09-29 Wenson Hsieh <wenson_hsieh@apple.com> We should avoid making connections to the GPU Process during garbage collection https://bugs.webkit.org/show_bug.cgi?id=217112 Reviewed by Tim Horton. Currently, it's possible to establish a connection to the GPU process from the web content process in the middle of garbage collection. This may occur if GC occurs after a canvas element and its image buffer has been created, but before the image buffer has initialized its backend (which, in the case of using the GPU process for rendering, is a RemoteRenderingBackend). While estimating memory cost for the canvas element, if a remote rendering backend has not been created yet, we end up creating it underneath `ensureBackendCreated()`, and subsequently block the web process until the GPU process is finished creating the proxy rendering backend. When running layout tests in `fast/canvas`, this causes some layout tests to occasionally hit assertions under `RemoteImageBufferMessageHandler::waitForCreateImageBufferBackend`, due to accessing `m_remoteRenderingBackend` (a weak pointer). To fix this, in the case where the image buffer does not yet have a rendering backend, we should simply return 0 instead of telling the GPU process to allocate the actual image buffer and then returning a non-zero cost. * platform/graphics/ConcreteImageBuffer.h: 2020-09-29 Ryosuke Niwa <rniwa@webkit.org> Crash while loading a confluence page https://bugs.webkit.org/show_bug.cgi?id=217111 Reviewed by Wenson Hsieh. The crash was caused by MutationObserver::disconnect attempting to unregister a MutationObserverRegistration from a Node after it had already been removed once. This happens when MutationObserverRegistration remains in MutationObserver when there is an ongoing transient mutation observation. Fixed the bug by setting a boolean MutationObserverRegistration when we've stopped the observation in MutationObserverRegistration::stopObserving and not unregistering it in subsequent calls to MutationObserver::disconnect. Test: fast/dom/MutationObserver/disconnect-twice.html * dom/MutationObserver.cpp: (WebCore::MutationObserver::disconnect): * dom/MutationObserverRegistration.cpp: (WebCore::MutationObserverRegistration::stopObserving): Added. * dom/MutationObserverRegistration.h: 2020-09-29 Don Olmstead <don.olmstead@sony.com> [WebGPU] Add platform guards https://bugs.webkit.org/show_bug.cgi?id=217095 Reviewed by Darin Adler. Add platform guards around Apple specific implementations. The WebGPU implementation on Apple platforms is guarded by USE(METAL). Additionally guard uses of the WHLSL compiler. No new tests. No change in behavior. * Modules/webgpu/GPUCanvasContext.cpp: (WebCore::GPUCanvasContext::platformLayer const): * platform/graphics/gpu/GPUBindGroup.h: * platform/graphics/gpu/GPUBindGroupAllocator.h: * platform/graphics/gpu/GPUBindGroupLayout.h: * platform/graphics/gpu/GPUBuffer.h: * platform/graphics/gpu/GPUCommandBuffer.h: * platform/graphics/gpu/GPUComputePassEncoder.h: * platform/graphics/gpu/GPUComputePipeline.h: * platform/graphics/gpu/GPUDevice.h: * platform/graphics/gpu/GPUProgrammablePassEncoder.h: * platform/graphics/gpu/GPUQueue.h: * platform/graphics/gpu/GPURenderPassEncoder.h: * platform/graphics/gpu/GPURenderPipeline.h: * platform/graphics/gpu/GPUSampler.h: * platform/graphics/gpu/GPUShaderModule.h: * platform/graphics/gpu/GPUSwapChain.h: * platform/graphics/gpu/GPUTexture.h: 2020-09-29 Jer Noble <jer.noble@apple.com> Fullscreen mode on mlb.com shows white letterboxing when video aspect ratio does not match screen https://bugs.webkit.org/show_bug.cgi?id=217060 <rdar://problem/68936043> Reviewed by Darin Adler. Add a Quirk which sets the background color of fullscreen elements on mlb.com to black. * page/Quirks.cpp: (WebCore::Quirks::needsBlackFullscreenBackgroundQuirk const): * page/Quirks.h: * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement): 2020-09-29 Peng Liu <peng.liu6@apple.com> [Media in GPU Process] Use VideoLayerManager to manage layers of MediaPlayerPrivateRemote https://bugs.webkit.org/show_bug.cgi?id=216995 Reviewed by Wenson Hsieh. A follow-up patch to remove WEBCORE_EXPORT of the VideoLayerManagerObjC constructor. The constructor is inline, so it does not require WEBCORE_EXPORT. * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h: (WebCore::VideoLayerManagerObjC::VideoLayerManagerObjC): 2020-09-29 Keith Miller <keith_miller@apple.com> CSS serialization expects comments between certain tokens https://bugs.webkit.org/show_bug.cgi?id=216947 Reviewed by Darin Adler. This patch brings us up to spec on inserting comments while serializing CSS tokens. The spec says that we should always be able to round trip a serialized output. Weirdly, for reasons I don't understand, the spec requires a comment rather than whitespace so that's what this patch does. Since there are 32 token types building a table for every combination would have been massive. Instead, this patch uses a constexpr function to generate the table for the set of next (non-delimiter) tokens that require a separating comment. This makes it a bit more readable while, hopefully, not sacrificing too much performance. For delimiters requiring separating comments, we check for those in a helper lambda after checking the token table. * css/parser/CSSParserToken.cpp: (WebCore::buildNextTokenNeedsCommentTable): (WebCore::CSSParserToken::serialize const): * css/parser/CSSParserToken.h: * css/parser/CSSParserTokenRange.cpp: (WebCore::CSSParserTokenRange::serialize const): 2020-09-29 Aditya Keerthi <akeerthi@apple.com> [macCatalyst] Focus rings are not painted https://bugs.webkit.org/show_bug.cgi?id=217073 <rdar://problem/46794111> Reviewed by Darin Adler. The logic which paints focus rings on Cocoa platforms is incorrectly guarded by the ENABLE(FULL_KEYBOARD_ACCESS) flag. This flag is only enabled on macOS and iOS, resulting in an empty implementation for GraphicsContext::drawFocusRing on macCatalyst. To fix, remove the incorrect usage of ENABLE(FULL_KEYBOARD_ACCESS). * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::GraphicsContext::drawFocusRing): * rendering/RenderImage.cpp: (WebCore::RenderImage::paintAreaElementFocusRing): * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::platformFocusRingColor const): 2020-09-29 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Make sure <wbr> gets an inline box too. https://bugs.webkit.org/show_bug.cgi?id=217100 Reviewed by Antti Koivisto. <wbr> behaves similarly to <br> when it comes to line breaking. They are not committed to LineBreaker but instead we post-process them. In this patch the <wbr> content is added to the LineCandidate list as a special item (same as with <br>) and later submitted to the current line as a zero width run. This behavior matches the spec (and FF) but does not match current trunk/rendering. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineCandidate::InlineContent::trailingWordBreakOpportunity const): (WebCore::Layout::LineCandidate::InlineContent::appendTrailingLineBreak): (WebCore::Layout::LineCandidate::InlineContent::appendtrailingWordBreakOpportunity): (WebCore::Layout::LineCandidate::InlineContent::appendInlineItem): (WebCore::Layout::LineCandidate::InlineContent::reset): (WebCore::Layout::LineBuilder::placeInlineContent): (WebCore::Layout::LineBuilder::nextContentForLine): (WebCore::Layout::LineCandidate::InlineContent::appendLineBreak): Deleted. (WebCore::Layout::LineCandidate::InlineContent::setTrailingLineBreak): Deleted. 2020-09-29 Sam Weinig <weinig@apple.com> Remove IndexedDBWorkers runtime setting now since it is always true https://bugs.webkit.org/show_bug.cgi?id=217090 Reviewed by Darin Adler. Removes IndexedDBWorkers runtime setting, allowing us to remove a bunch of special cases for WorkerGlobalScope constructors. Now instead of explicitly adding the IndexedDB constructors to WorkerGlobalScope, we use the Exposed mechanism to have the generators do this for us. While going through each of the IndexedDB IDLs, I also re-alligned with the current spec, adding comments for missing functionality as necessary. * Modules/indexeddb/IDBCursor.idl: * Modules/indexeddb/IDBCursorWithValue.idl: * Modules/indexeddb/IDBDatabase.idl: * Modules/indexeddb/IDBFactory.idl: * Modules/indexeddb/IDBIndex.idl: * Modules/indexeddb/IDBKeyRange.idl: * Modules/indexeddb/IDBObjectStore.idl: * Modules/indexeddb/IDBOpenDBRequest.idl: * Modules/indexeddb/IDBRequest.idl: * Modules/indexeddb/IDBTransaction.idl: * Modules/indexeddb/IDBVersionChangeEvent.idl: * Modules/indexeddb/WorkerGlobalScope+IndexedDatabase.idl: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setIndexedDBWorkersEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::indexedDBWorkersEnabled const): Deleted. * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::setIndexedDBWorkersEnabled): Deleted. * testing/InternalSettings.h: * testing/InternalSettings.idl: * workers/WorkerGlobalScope.idl: 2020-09-29 Sihui Liu <sihui_liu@apple.com> IndexedDB Index Corruption after upgrade from iOS 13 to iOS 14 https://bugs.webkit.org/show_bug.cgi?id=216962 <rdar://problem/69587004> Reviewed by Brady Eidson. There is an implementation error in r255318, which updated index ID in database IndexInfo and IndexRecords tables: it made changes to original table while iterating records of it. This means modified records can be modified again, which leads to that two indices have the same index ID. As index ID is supposed to be unique, some indices and index records cannot be populated and clients will find some indices are missing. To fix this, we need to change the implementation of ID update and deal with already corrupted tables. For index ID update, now we create a temporary table for storing the updated records, and replace the original table with temporary table at the end of iteration. For the corruption issue, we check if IndexInfo table has duplicate index IDs. If it has, we try recovering IndexInfo and IndexRecords table by removing records with duplicate index IDs, assigning new IDs to duplicate indices, and adding records with updated index IDs. API tests: IndexedDB.IndexUpgradeToV2WithMultipleIndices IndexedDB.IndexUpgradeToV2WithMultipleIndicesHaveSameID * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::indexInfoTableSchema): (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo): (WebCore::IDBServer::SQLiteIDBBackingStore::migrateIndexInfoTableForIDUpdate): (WebCore::IDBServer::SQLiteIDBBackingStore::migrateIndexRecordsTableForIDUpdate): (WebCore::IDBServer::SQLiteIDBBackingStore::removeExistingIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::addExistingIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::handleDuplicateIndexIDs): (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo): (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord): * Modules/indexeddb/server/SQLiteIDBBackingStore.h: * Modules/indexeddb/shared/IDBIndexInfo.h: (WebCore::IDBIndexInfo::setIdentifier): * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp: (WebCore::IDBObjectStoreInfo::addExistingIndex): 2020-09-29 Alex Christensen <achristensen@webkit.org> Remove plist-based ResourceLoadStatistics storage, which has been replaced by database-based storage https://bugs.webkit.org/show_bug.cgi?id=217063 Reviewed by John Wilander. ResourceLoadStatistics was initially implemented using plists to store the persistent data on disk. This caused some performance issues, so a sqlite database backend was implemented and transitioned to. Now that the transition is complete, let's remove the old plist backend. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setIsITPDatabaseEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::isITPDatabaseEnabled const): Deleted. 2020-09-29 Chris Dumez <cdumez@apple.com> Add stubs for AudioWorklet https://bugs.webkit.org/show_bug.cgi?id=217059 Reviewed by Eric Carlson. Add stubs for AudioWorklet, AudioWorkletNode and AudioParamMap: - https://www.w3.org/TR/webaudio/#audioworklet - https://www.w3.org/TR/webaudio/#audioworkletnode - https://www.w3.org/TR/webaudio/#audioparammap No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioNode.cpp: (WebCore::convertEnumerationToString): * Modules/webaudio/AudioNode.h: * Modules/webaudio/AudioParamMap.cpp: Added. (WebCore::AudioParamMap::initializeMapLike): (WebCore::AudioParamMap::add): * Modules/webaudio/AudioParamMap.h: Added. (WebCore::AudioParamMap::create): (WebCore::AudioParamMap::map const): * Modules/webaudio/AudioParamMap.idl: Added. * Modules/webaudio/AudioWorklet.cpp: Added. (WebCore::AudioWorklet::create): (WebCore::AudioWorklet::AudioWorklet): * Modules/webaudio/AudioWorklet.h: Added. * Modules/webaudio/AudioWorklet.idl: Added. * Modules/webaudio/AudioWorkletNode.cpp: Added. (WebCore::AudioWorkletNode::create): (WebCore::AudioWorkletNode::AudioWorkletNode): (WebCore::AudioWorkletNode::~AudioWorkletNode): (WebCore::AudioWorkletNode::process): * Modules/webaudio/AudioWorkletNode.h: Added. (WebCore::AudioWorkletNode::parameters): (WebCore::AudioWorkletNode::port): * Modules/webaudio/AudioWorkletNode.idl: Added. * Modules/webaudio/AudioWorkletNodeOptions.h: Added. * Modules/webaudio/AudioWorkletNodeOptions.idl: Added. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::audioWorklet): * Modules/webaudio/BaseAudioContext.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * css/DOMCSSPaintWorklet.cpp: (WebCore::DOMCSSPaintWorklet::ensurePaintWorklet): (WebCore::PaintWorklet::addModule): * css/DOMCSSPaintWorklet.h: * dom/Document.cpp: (WebCore::Document::ensurePaintWorklet): * dom/Document.h: * dom/EventNames.h: * page/Settings.yaml: * worklets/Worklet.cpp: (WebCore::Worklet::addModule): * worklets/Worklet.h: * worklets/Worklet.idl: * worklets/WorkletOptions.h: Copied from Source/WebCore/worklets/Worklet.idl. * worklets/WorkletOptions.idl: Copied from Source/WebCore/worklets/Worklet.idl. 2020-09-29 Wenson Hsieh <wenson_hsieh@apple.com> [GPU Process] Several layout tests in fast/canvas crash under GraphicsContext::clipToImageBuffer https://bugs.webkit.org/show_bug.cgi?id=217026 <rdar://problem/69663834> Reviewed by Simon Fraser. When using the GPU Process for rendering, calling `GraphicsContext::clipToImageBuffer` currently results in a crash, due to the platform `CGContextRef` being null. This causes the following 4 canvas-related tests to fail: - fast/canvas/2d.fillText.gradient.html - fast/canvas/2d.text.draw.fill.maxWidth.gradient.html - fast/canvas/canvas-text-alignment.html - fast/canvas/gradient-text-with-shadow.html In all four of these tests, the `clipToImageBuffer` call comes from `CanvasRenderingContext2D::drawTextInternal` method, while creating the image used to provide the mask when there is a gradient or pattern fill. This is tricky to support when using the GPU process with display list items, since `ImageBuffer`s cannot be generally sent to the GPU process through IPC. Instead of painting an `ImageBuffer` and sending it over IPC, we can introduce a new `GraphicsContext` method that clips to an image that is painted via a `WTF::Function` that is passed in, and receives a `GraphicsContext&`. When using a display-list-backed `GraphicsContext`, we can create a new `DisplayList` recording context and use the given `Function` to populate the display list with items, which can then be sent to the GPU process through IPC. When using a platform `CGContextRef`-backed `GraphicsContext`, we instead create a new `ImageBuffer` compatible with the current context, and then use this `ImageBuffer` to call `clipToImageBuffer`. We then refactor `drawTextInternal` so that it uses this new `GraphicsContext` method. See below for more details. * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::drawTextInternal): Refactor this to use `clipToDrawingCommands` instead of `clipToImageBuffer`. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::clipToDrawingCommands): Introduce a new `GraphicsContext` method that takes a function which draws into a given `GraphicsContext`. When there is no `GraphicsContextImpl` present, we create a new `ImageBuffer` compatible with this `GraphicsContext`, paint into it using the given `Function`, and lastly pass this painted `ImageBuffer` into `clipToImageBuffer`. * platform/graphics/GraphicsContext.h: * platform/graphics/GraphicsContextImpl.h: * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::clipToDrawingCommands): Add an unimplemented method stub. Since the only call site of `GraphicsContext::clipToDrawingCommands` is behind a `USE(CG)` guard, leaving this unimplemented for the time being won't result in any regression in behavior. * platform/graphics/cairo/GraphicsContextImplCairo.h: * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::clipToImageBuffer): It's not strictly necessary to fix these layout tests, but we should still add a check for `clipToImageBuffer` here with a call to `GraphicsContextImpl::clipToImageBuffer` even though `clipToImageBuffer` is unimplemented, to ensure that we at least avoid crashing if anything calls into this codepath. * platform/graphics/displaylists/DisplayList.h: * platform/graphics/displaylists/DisplayListDrawingContext.h: (WebCore::DisplayList::DrawingContext::takeDisplayList): Add a helper function to extract the `DisplayList` out of a `DisplayList::DrawingContext`. * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::ClipToDrawingCommands::ClipToDrawingCommands): (WebCore::DisplayList::ClipToDrawingCommands::apply const): Apply the `ClipToDrawingCommands` item by using `DisplayList::Replayer` to replay the given display list items back in a new platform CG-backed image buffer in the GPU process. (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::ClipToDrawingCommands::create): (WebCore::DisplayList::ClipToDrawingCommands::destination const): (WebCore::DisplayList::ClipToDrawingCommands::colorSpace const): (WebCore::DisplayList::ClipToDrawingCommands::drawingCommands const): (WebCore::DisplayList::ClipToDrawingCommands::encode const): (WebCore::DisplayList::ClipToDrawingCommands::decode): (WebCore::DisplayList::Item::encode const): (WebCore::DisplayList::Item::decode): Add a new `ClipToDrawingCommands` display list item, with support for IPC encoding and decoding. * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::clipToDrawingCommands): Implement the display-list-backed `clipToDrawingCommands` method by creating a new `DisplayList::DrawingContext` and playing the given drawing function back into the `DrawingContext`. This populates the recording context with a display list, which we can use to create a serializable display list item. * platform/graphics/displaylists/DisplayListRecorder.h: * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: (Nicosia::CairoOperationRecorder::clipToDrawingCommands): Add another unimplemented method stub. * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: * platform/graphics/win/GraphicsContextImplDirect2D.cpp: (WebCore::GraphicsContextImplDirect2D::clipToDrawingCommands): Add another unimplemented method stub. * platform/graphics/win/GraphicsContextImplDirect2D.h: 2020-09-29 Peng Liu <peng.liu6@apple.com> [Media in GPU Process] Use VideoLayerManager to manage layers of MediaPlayerPrivateRemote https://bugs.webkit.org/show_bug.cgi?id=216995 Reviewed by Zalan Bujtas. A follow-up patch to fix a build failure. * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h: * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm: (WebCore::VideoLayerManagerObjC::~VideoLayerManagerObjC): 2020-09-29 Chris Lord <clord@igalia.com> Implement asynchronous OffscreenCanvas placeholder updates for TextureMapperGL-based compositor https://bugs.webkit.org/show_bug.cgi?id=202798 Reviewed by Simon Fraser. Implement asynchronous updates for users of the Nicosia compositor (i.e. GTK, WPE). This allows OffscreenCanvas-controlled canvases to update visually while the main thread is blocked. No new tests. Covered by existing tests. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::transferControlToOffscreen): * html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::create): (WebCore::OffscreenCanvas::setPlaceholderCanvas): (WebCore::OffscreenCanvas::pushBufferToPlaceholder): (WebCore::OffscreenCanvas::commitToPlaceholderCanvas): * html/OffscreenCanvas.h: * html/canvas/PlaceholderRenderingContext.cpp: (WebCore::PlaceholderRenderingContext::PlaceholderRenderingContext): (WebCore::PlaceholderRenderingContext::platformLayer const): * html/canvas/PlaceholderRenderingContext.h: * platform/TextureMapper.cmake: * platform/graphics/ImageBufferPipe.cpp: Added. (WebCore::ImageBufferPipe::create): * platform/graphics/ImageBufferPipe.h: Added. * platform/graphics/nicosia/NicosiaImageBufferPipe.cpp: Added. (Nicosia::NicosiaImageBufferPipeSource::NicosiaImageBufferPipeSource): (Nicosia::NicosiaImageBufferPipeSource::handle): (Nicosia::NicosiaImageBufferPipeSource::platformLayer const): (Nicosia::NicosiaImageBufferPipeSource::swapBuffersIfNeeded): (Nicosia::NicosiaImageBufferPipe::NicosiaImageBufferPipe): (Nicosia::NicosiaImageBufferPipe::source const): (Nicosia::NicosiaImageBufferPipe::platformLayer const): (WebCore::ImageBufferPipe::create): * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread): (WebCore::TextureMapperPlatformLayerProxy::scheduleUpdateOnCompositorThread): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::containsPaintedContent const): (WebCore::RenderLayerBacking::contentChanged): 2020-09-29 Antti Koivisto <antti@apple.com> [LFC][Integration] Generalize run iterator for non-text runs https://bugs.webkit.org/show_bug.cgi?id=217083 Reviewed by Zalan Bujtas. Add RunIterator base for TextRunIterator. Add type traits. Naming improvements. * dom/Position.cpp: (WebCore::Position::upstream const): (WebCore::Position::downstream const): * editing/TextIterator.cpp: (WebCore::TextIterator::handleTextRun): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::textRunsFor const): (WebCore::LayoutIntegration::LineLayout::runFor const): (WebCore::LayoutIntegration::LineLayout::elementRunFor const): Deleted. * layout/integration/LayoutIntegrationLineLayout.h: * layout/integration/LayoutIntegrationRunIterator.cpp: (WebCore::LayoutIntegration::RunIterator::RunIterator): (WebCore::LayoutIntegration::RunIterator::traverseNextTextRunInVisualOrder): (WebCore::LayoutIntegration::RunIterator::traverseNextTextRunInTextOrder): (WebCore::LayoutIntegration::RunIterator::operator== const): (WebCore::LayoutIntegration::RunIterator::atEnd const): (WebCore::LayoutIntegration::TextRunIterator::TextRunIterator): (WebCore::LayoutIntegration::runFor): (WebCore::LayoutIntegration::TextRunIterator::traverseNextInVisualOrder): Deleted. (WebCore::LayoutIntegration::TextRunIterator::traverseNextInTextOrder): Deleted. (WebCore::LayoutIntegration::TextRunIterator::operator== const): Deleted. (WebCore::LayoutIntegration::TextRunIterator::atEnd const): Deleted. (WebCore::LayoutIntegration::ElementRunIterator::ElementRunIterator): Deleted. (WebCore::LayoutIntegration::ElementRunIterator::atEnd const): Deleted. (WebCore::LayoutIntegration::elementRunFor): Deleted. * layout/integration/LayoutIntegrationRunIterator.h: (WebCore::LayoutIntegration::RunIterator::RunIterator): (WebCore::LayoutIntegration::RunIterator::operator!= const): (WebCore::LayoutIntegration::RunIterator::operator* const): (WebCore::LayoutIntegration::RunIterator::operator-> const): (WebCore::LayoutIntegration::TextRunIterator::TextRunIterator): (WebCore::LayoutIntegration::TextRunIterator::operator++): (WebCore::LayoutIntegration::TextRunIterator::operator* const): (WebCore::LayoutIntegration::TextRunIterator::operator-> const): (WebCore::LayoutIntegration::TextRunIterator::get const): (WebCore::LayoutIntegration::Run::isText const): (WebCore::LayoutIntegration::Run::minimumCaretOffset const): (WebCore::LayoutIntegration::Run::maximumCaretOffset const): (WebCore::LayoutIntegration::TextRun::isLastTextRunOnLine const): (WebCore::LayoutIntegration::TextRun::isLastTextRun const): (isType): (WebCore::LayoutIntegration::TextRunIterator::operator bool const): Deleted. (WebCore::LayoutIntegration::TextRunIterator::operator!= const): Deleted. (WebCore::LayoutIntegration::TextRunIterator::operator== const): Deleted. (WebCore::LayoutIntegration::ElementRunIterator::ElementRunIterator): Deleted. (WebCore::LayoutIntegration::ElementRunIterator::operator bool const): Deleted. (WebCore::LayoutIntegration::ElementRunIterator::operator* const): Deleted. (WebCore::LayoutIntegration::ElementRunIterator::operator-> const): Deleted. (WebCore::LayoutIntegration::TextRun::isLastOnLine const): Deleted. (WebCore::LayoutIntegration::TextRun::isLast const): Deleted. * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: (WebCore::LayoutIntegration::LegacyPath::isText const): (WebCore::LayoutIntegration::LegacyPath::minimumCaretOffset const): (WebCore::LayoutIntegration::LegacyPath::maximumCaretOffset const): (WebCore::LayoutIntegration::LegacyPath::isLastTextRunOnLine const): (WebCore::LayoutIntegration::LegacyPath::isLastTextRun const): (WebCore::LayoutIntegration::LegacyPath::isLastOnLine const): Deleted. (WebCore::LayoutIntegration::LegacyPath::isLast const): Deleted. * layout/integration/LayoutIntegrationRunIteratorModernPath.h: (WebCore::LayoutIntegration::ModernPath::isText const): (WebCore::LayoutIntegration::ModernPath::minimumCaretOffset const): (WebCore::LayoutIntegration::ModernPath::maximumCaretOffset const): (WebCore::LayoutIntegration::ModernPath::isLastTextRunOnLine const): (WebCore::LayoutIntegration::ModernPath::isLastTextRun const): (WebCore::LayoutIntegration::ModernPath::isLastOnLine const): Deleted. (WebCore::LayoutIntegration::ModernPath::isLast const): Deleted. * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::linesBoundingBox const): (WebCore::RenderLineBreak::boundingBoxForRenderTreeDump const): (WebCore::RenderLineBreak::absoluteRects const): (WebCore::RenderLineBreak::absoluteQuads const): * rendering/RenderText.cpp: (WebCore::containsOffset): 2020-09-29 Zalan Bujtas <zalan@apple.com> [LFC][IFC] LineBreaker renames https://bugs.webkit.org/show_bug.cgi?id=217067 Reviewed by Antti Koivisto. The following functions and structures have evolved over time. Let's sync up their names. LineBreaker::shouldWrapInlineContent -> processInlineContent -> it's not just a "should wrap now" function anymore. LineBreaker::tryWrappingInlineContent -> processOverflowingContent -> It does both wrapping and breaking. LineBreaker::wrapTextContent -> processOverflowingTextContent ^^ same as above struct WrappedTextContent -> TrailingTextContent -> it holds information about the trailing content after wrapping/breaking. LineBreaker::Result::Action::Split -> Break -> closer to spec term. (This patch also changes some unsigned to size_t.) * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::LineBreaker::processInlineContent): (WebCore::Layout::LineBreaker::processOverflowingContent const): (WebCore::Layout::LineBreaker::processOverflowingTextContent const): (WebCore::Layout::LineBreaker::tryBreakingTextRun const): (WebCore::Layout::LineBreaker::shouldWrapInlineContent): Deleted. (WebCore::Layout::LineBreaker::tryWrappingInlineContent const): Deleted. (WebCore::Layout::LineBreaker::wrapTextContent const): Deleted. * layout/inlineformatting/InlineLineBreaker.h: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::layoutInlineContent): (WebCore::Layout::LineBuilder::placeInlineContent): (WebCore::Layout::LineBuilder::nextContentForLine): (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): * layout/inlineformatting/InlineLineBuilder.h: 2020-09-29 Said Abou-Hallawa <sabouhallawa@apple.com> Data URL image is not rendered if there is whitespace between the mime type and and "base64" string https://bugs.webkit.org/show_bug.cgi?id=216900 Reviewed by Darin Adler. According to https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs, spaces are allowed in the data URL to allow better formatting. This means spaces may appear before and after the comma and the semicolon (if it exits in the Data URL). Test: fast/images/image-data-url-with-spaces.html * platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::DecodeTask::process): 2020-09-28 Yusuke Suzuki <ysuzuki@apple.com> Use JSC_DECLARE_JIT_OPERATION / JSC_DECLARE_CUSTOM_GETTER / JSC_DECLARE_CUSTOM_SETTER https://bugs.webkit.org/show_bug.cgi?id=217071 Reviewed by Keith Miller. No behavior change. 2020-09-28 Peng Liu <peng.liu6@apple.com> [Media in GPU Process] Use VideoLayerManager to manage layers of MediaPlayerPrivateRemote https://bugs.webkit.org/show_bug.cgi?id=216995 Reviewed by Eric Carlson. No new tests since no functional changes. * Headers.cmake: Export TextTrackRepresentation and VideoLayerManager. * WebCore.xcodeproj/project.pbxproj: Add VideoLayerManager.h. Export TextTrackRepresentation, WebVideoContainerLayer and VideoLayerManager. * platform/graphics/TextTrackRepresentation.cpp: * platform/graphics/TextTrackRepresentation.h: Minor clean-up. * platform/graphics/VideoLayerManager.h: Added. Add this interface so that we can use VideoLayerManager in the C++ code. * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h: * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm: (WebCore::VideoLayerManagerObjC::videoInlineLayer const): (WebCore::VideoLayerManagerObjC::videoFullscreenLayer const): (WebCore::VideoLayerManagerObjC::videoFullscreenFrame const): (WebCore::VideoLayerManagerObjC::updateVideoFullscreenInlineImage): Fix the issue when RELEASE_LOG_DISABLED is defined and add WEBCORE_EXPORT to some functions. 2020-09-28 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> webkitfullscreenchange does not fire for shadow DOM elements https://bugs.webkit.org/show_bug.cgi?id=216607 Reviewed by Ryosuke Niwa. This bug was caused by the `webkitfullscreenchange` event being fired but without _composed_ flag set. This patch fixed the bug by making it composed as defined as the step 3-2 of https://fullscreen.spec.whatwg.org/#run-the-fullscreen-steps. so that event listeners outside shadow tree could observe it. Test: fast/shadow-dom/fullscreen-in-shadow-event-should-propagate.html * dom/FullscreenManager.cpp: (WebCore::FullscreenManager::dispatchFullscreenChangeOrErrorEvent): 2020-09-28 Eric Carlson <eric.carlson@apple.com> [GPUP] Out-of-band TextTracks https://bugs.webkit.org/show_bug.cgi?id=217062 <rdar://problem/68739969> Reviewed by Jer Noble. Add support for passing out-of-band TextTracks to a media engine running in the GPU process. No new tests, this can only be tested with a specific hardware setup. * html/HTMLMediaElement.cpp: (WebCore::toPlatform): * platform/graphics/PlatformTextTrack.h: Put instance variables into a struct so state can be encoded and decoded. (WebCore::PlatformTextTrackData::PlatformTextTrackData): (WebCore::PlatformTextTrackData::decode): (WebCore::PlatformTextTrackData::encode const): (WebCore::PlatformTextTrackClient::privateTrack): (WebCore::PlatformTextTrack::create): (WebCore::PlatformTextTrack::createOutOfBand): (WebCore::PlatformTextTrack::type const): (WebCore::PlatformTextTrack::kind const): (WebCore::PlatformTextTrack::mode const): (WebCore::PlatformTextTrack::label const): (WebCore::PlatformTextTrack::language const): (WebCore::PlatformTextTrack::url const): (WebCore::PlatformTextTrack::uniqueId const): (WebCore::PlatformTextTrack::isDefault const): (WebCore::PlatformTextTrack::client const): (WebCore::PlatformTextTrack::data const): (WebCore::PlatformTextTrack::PlatformTextTrack): (WebCore::PlatformTextTrack::captionMenuOffItem): Deleted. (WebCore::PlatformTextTrack::captionMenuAutomaticItem): Deleted. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::mediaDescriptionForKind): (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState): 2020-09-28 Fujii Hironori <Hironori.Fujii@sony.com> [TextureMapper] Enable a depth buffer for preserve-3d https://bugs.webkit.org/show_bug.cgi?id=90078 Reviewed by Don Olmstead. Test: transforms/3d/general/preserve-3d.html * platform/graphics/egl/GLContextEGL.cpp: (WebCore::GLContextEGL::getEGLConfig): * platform/graphics/texmap/TextureMapper.h: (WebCore::TextureMapper::beginPreserves3D): Added a new virtual method. (WebCore::TextureMapper::endPreserves3D): Ditto. * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::beginPainting): (WebCore::createProjectionMatrix): Swapped nearValue and farValue so that the depth buffer works as expected. (WebCore::TextureMapperGL::beginPreserves3D): Added. (WebCore::TextureMapperGL::endPreserves3D): Ditto. * platform/graphics/texmap/TextureMapperGL.h: * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintSelfAndChildren): Call beginPreserves3D() and endPreserves3D() if m_state.preserves3D. 2020-09-28 Devin Rousso <drousso@apple.com> [iOS] unable to airplay directly loaded fullscreen video https://bugs.webkit.org/show_bug.cgi?id=216858 <rdar://problem/68746321> Reviewed by Eric Carlson. It's possible that `MediaPlayerPrivate::wirelessVideoPlaybackDisabled` is queried before a "real" `MediaPlayerPrivate` (i.e. not `NullMediaPlayerPrivate`) is initialized through one of the registered `MediaPlayerFactory` "engine"s. It's further possible that the value returned by `MediaPlayerPrivate::wirelessVideoPlaybackDisabled` will change as the new "real" `MediaPlayerPrivate` may have different logic. In this case, the `MediaPlayer` doesn't update its client (and therefore nothing "up" the tree, including the client's clients) with the new `MediaPlayerPrivate::wirelessVideoPlaybackDisabled` value, meaning that the old value will still be used. Add piping such that when the `MediaPlayerFactory` "engine" changes, the `MediaPlayer` notifies its client (which is further piped "up" the tree to the client's clients) which eventually causes `MediaPlayerPrivate::wirelessVideoPlaybackDisabled` to be re-evaluated. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaEngineWasUpdated): * page/Page.h: * page/Page.cpp: (WebCore::Page::playbackControlsMediaEngineChanged): Added. * page/ChromeClient.h: (WebCore::ChromeClient::playbackControlsMediaEngineChanged): Added. * platform/cocoa/PlaybackSessionModelMediaElement.h: * platform/cocoa/PlaybackSessionModelMediaElement.mm: (WebCore::PlaybackSessionModelMediaElement::mediaEngineChanged): Added. 2020-09-28 Darin Adler <darin@apple.com> REGRESSION (r267329): Crash due to null-dereference of frame pointer in DOMSelection::rangeCount https://bugs.webkit.org/show_bug.cgi?id=217053 Reviewed by Sam Weinig. Later as a follow-up it would be nice to add a test case, but not obvious how to make a simple one quickly. * page/DOMSelection.cpp: (WebCore::DOMSelection::rangeCount const): Fixed the null check. 2020-09-28 Aditya Keerthi <akeerthi@apple.com> [macOS] Update the appearance of editable date/time controls to match the system https://bugs.webkit.org/show_bug.cgi?id=216616 <rdar://problem/69004603> Reviewed by Devin Rousso. The default appearance of editable components within the date/time control should closely match NSDatePicker. 1. Focused components should have rounded corners This is achieved by adding the border-radius property to the datetime-edit fields. 2. Use a raised colon separator for time inputs The colon should be raised as it is surrounded two numbers. However, since the colon is rendered in its own <div>, it remains lowered. To raise the colon, the "ss03" font-feature-setting is enabled. Note that this can cause issues with fonts that use "ss03" for a different purpose. However, since we do not have support for the @font-feature-values rule in CSS, there is currently no way to workaround this problem. Instead, the issue should be fixed once we gain CSS support. 3. Components should have a fixed width, and the width of the control should match the content Since the control is not guaranteed to use a monospace font, the current design results in editable components being resized each time the value changes. To fix this issue, the display type was changed to inline-block and the min-width of a component is computed at runtime. See below for more details. * css/html.css: Added UA stylesheet code that was removed from RenderTheme. (input::-webkit-datetime-edit): (input::-webkit-datetime-edit-year-field,): Display inline-block allows us to set a fixed width for individual components. The text is center-aligned so that changes are not jarring. Finally, the font property is now "inherit !important", as it does not make sense for the font used in a component to differ from the control's font. (input::-webkit-datetime-edit-year-field:focus,): Add rounded corners on focus. * html/shadow/DateTimeFieldElement.cpp: (WebCore::DateTimeFieldElement::DateTimeFieldElement): * html/shadow/DateTimeFieldElements.cpp: Call setHasCustomStyleResolveCallbacks() to compute min-width. (WebCore::DateTimeMillisecondFieldElement::DateTimeMillisecondFieldElement): Drive-by fix - milliseconds component has 3 digits. * html/shadow/DateTimeNumericFieldElement.cpp: (WebCore::DateTimeNumericFieldElement::resolveCustomStyle): The min-width of a numeric field should be the largest possible width depending on the font, the largest digit character in the font and the length of the field. Ten possible values are tested (0-9). * html/shadow/DateTimeNumericFieldElement.h: * html/shadow/DateTimeSymbolicFieldElement.cpp: (WebCore::DateTimeSymbolicFieldElement::resolveCustomStyle): The min-width of a symbolic field should be the largest symbol given a font. Two (meridiem) to twelve (month) values may be tested. * html/shadow/DateTimeSymbolicFieldElement.h: * rendering/RenderTheme.cpp: * rendering/RenderTheme.h: Moved code to html.css. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: Moved code to html.css. * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement): Moved code to html.css. * style/UserAgentStyle.h: 2020-09-28 Zalan Bujtas <zalan@apple.com> [LFC][Floats] Add support for clear on float box https://bugs.webkit.org/show_bug.cgi?id=217045 Reviewed by Antti Koivisto. When the float box also has to clear other floats, we need to adjust the initial vertical position from where we start searching for available space. (This patch also fixes a previous find&replace renaming and addresses a post-landing comment.) Test: fast/layoutformattingcontext/float-with-clear-simple.html * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): (WebCore::Layout::FloatingContext::absoluteCoordinates const): (WebCore::Layout::FloatingContext::absoluteBoxGeometryCoordinates const): Deleted. * layout/floats/FloatingContext.h: 2020-09-28 Aditya Keerthi <akeerthi@apple.com> Crash under DateTimeEditElement::blurFromField https://bugs.webkit.org/show_bug.cgi?id=216930 <rdar://problem/69308322> Reviewed by Ryosuke Niwa. DateTimeEditElement::blurFromField incorrectly invoked HTMLElement::dispatchBlurEvent, as it was not the element being blurred. Accessing member variables after this call is unsafe, as there is nothing protecting the DateTimeEditElement. To fix, the problematic methods were removed entirely, and replaced with a new approach to responding to blur events within a DateTimeEditElement. The blur event's relatedTarget is now compared to the fields within the DateTimeEditElement, in order to determine when to close the calendar. This approach is safe, since the relatedTarget is protected by Document::setFocusedElement. * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::elementDidBlur): Remove unnecessary call. If the input has editable fields, closing the calendar is handled by the new codepath. Running this code unconditionally will result in a flash of the calendar when clicking on a part of the input type that doesn't contain an editable field. * html/shadow/DateTimeEditElement.cpp: (WebCore::DateTimeEditElement::didBlurFromField): Check if the event's relatedTarget is another field within the same DateTimeEditElement. If yes, the calendar should remain open. * html/shadow/DateTimeEditElement.h: * html/shadow/DateTimeFieldElement.cpp: (WebCore::DateTimeFieldElement::defaultEventHandler): Call handleBlurEvent() if a blur event occurs. This was previously done by the now-removed dispatchBlurEvent override. (WebCore::DateTimeFieldElement::handleBlurEvent): * html/shadow/DateTimeFieldElement.h: * html/shadow/DateTimeNumericFieldElement.cpp: (WebCore::DateTimeNumericFieldElement::handleBlurEvent): * html/shadow/DateTimeNumericFieldElement.h: 2020-09-28 Antti Koivisto <antti@apple.com> [LFC][Integration] Move run iterator to LayoutIntegration namespace https://bugs.webkit.org/show_bug.cgi?id=217046 Reviewed by Zalan Bujtas. Also use name 'Modern' for LFC and 'Legacy' for the old inline tree path. Also rename box->run for more consistent terminology. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Position.cpp: (WebCore::Position::upstream const): (WebCore::Position::downstream const): * editing/TextIterator.cpp: (WebCore::TextIterator::advance): (WebCore::TextIterator::handleTextNode): (WebCore::TextIterator::handleTextRun): (WebCore::TextIterator::handleTextNodeFirstLetter): (WebCore::TextIterator::handleTextBox): Deleted. * editing/TextIterator.h: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::textRunsFor const): (WebCore::LayoutIntegration::LineLayout::elementRunFor const): (WebCore::LayoutIntegration::LineLayout::paint): (WebCore::LayoutIntegration::LineLayout::textBoxesFor const): Deleted. (WebCore::LayoutIntegration::LineLayout::elementBoxFor const): Deleted. * layout/integration/LayoutIntegrationLineLayout.h: * layout/integration/LayoutIntegrationRunIterator.cpp: Renamed from Source/WebCore/rendering/line/LineLayoutTraversal.cpp. (WebCore::LayoutIntegration::TextRunIterator::TextRunIterator): (WebCore::LayoutIntegration::TextRunIterator::traverseNextInVisualOrder): (WebCore::LayoutIntegration::TextRunIterator::traverseNextInTextOrder): (WebCore::LayoutIntegration::TextRunIterator::operator== const): (WebCore::LayoutIntegration::TextRunIterator::atEnd const): (WebCore::LayoutIntegration::firstTextRunFor): (WebCore::LayoutIntegration::firstTextRunInTextOrderFor): (WebCore::LayoutIntegration::textRunsFor): (WebCore::LayoutIntegration::ElementRunIterator::ElementRunIterator): (WebCore::LayoutIntegration::ElementRunIterator::atEnd const): (WebCore::LayoutIntegration::elementRunFor): * layout/integration/LayoutIntegrationRunIterator.h: Renamed from Source/WebCore/rendering/line/LineLayoutTraversal.h. (WebCore::LayoutIntegration::TextRunIterator::TextRunIterator): (WebCore::LayoutIntegration::TextRunIterator::operator++): (WebCore::LayoutIntegration::TextRunIterator::operator!= const): (WebCore::LayoutIntegration::TextRunIterator::operator* const): (WebCore::LayoutIntegration::TextRunIterator::operator-> const): (WebCore::LayoutIntegration::ElementRunIterator::ElementRunIterator): (WebCore::LayoutIntegration::ElementRunIterator::operator* const): (WebCore::LayoutIntegration::ElementRunIterator::operator-> const): (WebCore::LayoutIntegration::TextRunRange::TextRunRange): (WebCore::LayoutIntegration::TextRunRange::begin const): (WebCore::LayoutIntegration::Run::Run): (WebCore::LayoutIntegration::Run::rect const): (WebCore::LayoutIntegration::Run::baseline const): (WebCore::LayoutIntegration::Run::isLeftToRightDirection const): (WebCore::LayoutIntegration::Run::isHorizontal const): (WebCore::LayoutIntegration::Run::dirOverride const): (WebCore::LayoutIntegration::Run::isLineBreak const): (WebCore::LayoutIntegration::Run::useLineBreakBoxRenderTreeDumpQuirk const): (WebCore::LayoutIntegration::TextRun::hasHyphen const): (WebCore::LayoutIntegration::TextRun::TextRun): (WebCore::LayoutIntegration::TextRun::text const): (WebCore::LayoutIntegration::TextRun::localStartOffset const): (WebCore::LayoutIntegration::TextRun::localEndOffset const): (WebCore::LayoutIntegration::TextRun::length const): (WebCore::LayoutIntegration::TextRun::isLastOnLine const): (WebCore::LayoutIntegration::TextRun::isLast const): * layout/integration/LayoutIntegrationRunIteratorLegacyPath.h: Renamed from Source/WebCore/rendering/line/LineLayoutTraversalComplexPath.h. (WebCore::LayoutIntegration::LegacyPath::LegacyPath): (WebCore::LayoutIntegration::LegacyPath::operator== const): (WebCore::LayoutIntegration::LegacyPath::nextInlineTextBoxInTextOrder const): * layout/integration/LayoutIntegrationRunIteratorModernPath.h: Renamed from Source/WebCore/rendering/line/LineLayoutTraversalDisplayRunPath.h. (WebCore::LayoutIntegration::ModernPath::ModernPath): (WebCore::LayoutIntegration::ModernPath::operator== const): (WebCore::LayoutIntegration::ModernPath::rect const): * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::linesBoundingBox const): (WebCore::RenderLineBreak::boundingBoxForRenderTreeDump const): (WebCore::RenderLineBreak::absoluteRects const): (WebCore::RenderLineBreak::absoluteQuads const): * rendering/RenderText.cpp: (WebCore::RenderText::absoluteRects const): (WebCore::collectAbsoluteQuadsForNonComplexPaths): (WebCore::RenderText::firstRunLocation const): (WebCore::RenderText::linesBoundingBox const): (WebCore::RenderText::caretMinOffset const): (WebCore::RenderText::caretMaxOffset const): (WebCore::RenderText::countRenderedCharacterOffsetsUntil const): (WebCore::containsOffset): (WebCore::RenderText::hasRenderedText const): * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): (WebCore::writeTextRun): (WebCore::write): (WebCore::writeTextBox): Deleted. 2020-09-24 Simon Fraser <simon.fraser@apple.com> WebKitLegacy should call Page::finalizeRenderingUpdate() https://bugs.webkit.org/show_bug.cgi?id=216958 Reviewed by Tim Horton. Convert Page::m_inUpdateRendering to an enum which tracks the phase, which will be used in a later patch to prevent extra update scheduling (webkit.org/b/216726). Page has to track RenderingUpdatePhase as a stack to handle the re-entrancy when layout tests call notifyDone() inside of the JS callbacks; the stack only has one entry outside of testing. Add isolatedUpdateRendering(), which is for callers who aren't going to call finalizeRenderingUpdate(), and use it for SVGImage updates. * page/Page.cpp: (WebCore::Page::updateRendering): (WebCore::Page::isolatedUpdateRendering): (WebCore::Page::doAfterUpdateRendering): (WebCore::Page::finalizeRenderingUpdate): * page/Page.h: 2020-09-27 Zalan Bujtas <zalan@apple.com> Unreviewed. Call showLayoutTree only when trees are mismatching. * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): 2020-09-27 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Create inline boxes for hard line breaks(<br>) and word wrap opportunities (<wbr>) https://bugs.webkit.org/show_bug.cgi?id=217023 Reviewed by Antti Koivisto. Both hard <br> and the word break opportunity layout boxes generate inline boxes and get computed box geometries. It enables us to answer questions like element.offsetTop/offsetLeft. Test: fast/layoutformattingcontext/br-and-wbr-simple.html * layout/FormattingState.cpp: (WebCore::Layout::FormattingState::boxGeometry): * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints): (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineBoxes): * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::Run::isLineBreak const): (WebCore::Layout::Line::Run::isSoftLineBreak const): (WebCore::Layout::Line::Run::isHardLineBreak const): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): 2020-09-27 Rob Buis <rbuis@igalia.com> Alias WebKitCSSMatrix to DOMMatrix https://bugs.webkit.org/show_bug.cgi?id=153675 Reviewed by Chris Dumez. Alias WebKitCSSMatrix to DOMMatrix and remove the generated JSWebKitCSSMatrix as well as WebKitCSSMatrix itself since it is no longer needed. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/DOMMatrix.idl: * css/WebKitCSSMatrix.cpp: Removed. * css/WebKitCSSMatrix.h: Removed. * css/WebKitCSSMatrix.idl: Removed. 2020-09-27 Rob Buis <rbuis@igalia.com> Clean up type parameter for Event idl https://bugs.webkit.org/show_bug.cgi?id=217013 Reviewed by Chris Dumez. Clean up type parameter for Event idl files, there is no need to pass "undefined" default value. * dom/CompositionEvent.idl: * dom/HashChangeEvent.idl: * dom/KeyboardEvent.idl: * dom/MouseEvent.idl: * dom/MutationEvent.idl: * dom/TextEvent.idl: * dom/TouchEvent.idl: * dom/UIEvent.idl: * storage/StorageEvent.idl: 2020-09-26 Zalan Bujtas <zalan@apple.com> [LFC] Add <wbr> to showLayoutTree https://bugs.webkit.org/show_bug.cgi?id=217025 Reviewed by Darin Adler. This patch also tweaks the inline tree output (one line geometry output per line, different output format). <div style="width: 100px;">first_line<wbr>second_line</div> block box at (0,10) size 100x20 line at (0.00,0.00) size 100.00x10.00 baseline at (8.00) line at (0.00,10.00) size 100.00x10.00 baseline at (8.00) text run at (0.00,0.00) size 100.00x10.00 run(0, 10) text run at (0.00,0.00) size 110.00x10.00 run(0, 11) anonymous inline box (0x495583d20) length->(10) "first_line" word break opportunity at (100,8) size 0x0 (0x4967c0680) anonymous inline box (0x495591e00) length->(11) "second_line" * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): (WebCore::Layout::outputLayoutBox): 2020-09-26 Wenson Hsieh <wenson_hsieh@apple.com> Remove support for setting CMYKA fill and stroke colors in 2D canvas https://bugs.webkit.org/show_bug.cgi?id=217002 Reviewed by Darin Adler. Remove support for `setFillColor(c, m, y, k, a)` and `setStrokeColor(c, m, y, k, a)` on `CanvasRenderingContext2D`, which was initially introduced in 2004 with <https://trac.webkit.org/r6730>. Setting colors from CMYKA components is non-standard and unsupported in both Firefox and Chrome; importantly, this is implemented in `CanvasStyle::applyStrokeColor` by calling directly into CoreGraphics API using the platform `CGContextRef`, which is null when using the GPU Process; this subsequently causes the web process to crash. In lieu of adding new DisplayList items to support setting fill and stroke colors with CMYKA components, we can take this opportunity to just drop support for this canvas API entirely. Fixes the following tests when using the GPU Process to render canvas: - fast/canvas/canvas-color-serialization.html - fast/canvas/canvas-overloads-setFillColor.html - fast/canvas/canvas-overloads-setStrokeColor.html * html/canvas/CanvasRenderingContext2D.idl: * html/canvas/CanvasRenderingContext2DBase.cpp: * html/canvas/CanvasStyle.cpp: (WebCore::CanvasStyle::isEquivalentColor const): (WebCore::CanvasStyle::applyStrokeColor const): (WebCore::CanvasStyle::applyFillColor const): * html/canvas/CanvasStyle.h: (WebCore::CanvasStyle::color const): 2020-09-26 Chris Dumez <cdumez@apple.com> Constructing an AudioNode for a closed context should not throw an exception https://bugs.webkit.org/show_bug.cgi?id=216994 Reviewed by Darin Adler. Constructing an AudioNode for a closed context should not throw an exception. This behavior is not as per specification and does not match the behavior of Chrome & Firefox either. Test: webaudio/construct-node-with-closed-context.html * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::create): * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::create): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::lazyInitialize): (WebCore::BaseAudioContext::sampleRate const): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::create): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): * Modules/webaudio/ConstantSourceNode.cpp: (WebCore::ConstantSourceNode::create): * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::create): * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::create): * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::create): * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::create): * Modules/webaudio/IIRFilterNode.cpp: (WebCore::IIRFilterNode::create): * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::create): * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: (WebCore::MediaStreamAudioDestinationNode::create): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::create): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::create): * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::create): * Modules/webaudio/StereoPannerNode.cpp: (WebCore::StereoPannerNode::create): * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::create): 2020-09-26 Chris Dumez <cdumez@apple.com> Drop AudioNode::lazyInitialize() https://bugs.webkit.org/show_bug.cgi?id=217004 Reviewed by Darin Adler. Drop AudioNode::lazyInitialize(), this is dead code. * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::lazyInitialize): Deleted. * Modules/webaudio/AudioNode.h: (WebCore::AudioNode::isInitialized const): 2020-09-26 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for <wbr> https://bugs.webkit.org/show_bug.cgi?id=217014 Reviewed by Antti Koivisto. Introduce the WordBreakOpportunity type of InlineItem and take it into account while searching for word break opportunities. It generates an empty line run but it does not yet have geometry information. Test: fast/layoutformattingcontext/wbr-simple.html * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentIfNeeded): * layout/inlineformatting/InlineItem.h: (WebCore::Layout::InlineItem::isWordBreakOpportunity const): * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::appendWith): (WebCore::Layout::Line::appendTextContent): (WebCore::Layout::Line::appendWordBreakOpportunity): * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::Run::isWordBreakOpportunity const): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::nextWrapOpportunity): (WebCore::Layout::LineCandidate::InlineContent::appendInlineItem): (WebCore::Layout::LineBuilder::inlineItemWidth const): (WebCore::Layout::LineBuilder::nextContentForLine): 2020-09-26 Alex Christensen <achristensen@webkit.org> Fix Big Sur clean build after r267613 https://bugs.webkit.org/show_bug.cgi?id=217003 * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: 2020-09-26 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Line content logical width expands with run expansions (text-align: justify) https://bugs.webkit.org/show_bug.cgi?id=217011 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/run-expansion-extends-line-content-width.html * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::applyRunExpansion): 2020-09-26 Carlos Garcia Campos <cgarcia@igalia.com> [SOUP] Do not set site for cookies twice in case of redirection https://bugs.webkit.org/show_bug.cgi?id=217010 Reviewed by Michael Catanzaro. Only set is-toplevel-navigation on SoupMessage when same site info is present. * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateSoupMessageMembers const): 2020-09-26 Carlos Garcia Campos <cgarcia@igalia.com> [SOUP] Slack.com is not working, new messages do not load due to WebSocket authentication failure issue https://bugs.webkit.org/show_bug.cgi?id=149551 Reviewed by Michael Catanzaro. The problem is that we are not including all the cookies in the web socket request. There are two cookies with the Lax same-site policy set, that are not included for the websocket request. * Modules/websockets/ThreadableWebSocketChannel.cpp: (WebCore::ThreadableWebSocketChannel::webSocketConnectRequest): Add same site information to WebSocket requests. 2020-09-25 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Incorrect breaking position when inline box content fits the line but the inline content itself does not. https://bugs.webkit.org/show_bug.cgi?id=217007 Reviewed by Simon Fraser. When the inline box does not fit the line but its text content does, the last breaking opportunity (in case of arbitrary breaking position) is not the end of the text. e.g <div style="width: 200px; word-break: break-word;"><span style="border-right: 100px;">text_content_fits</span></div> in this case the border right overflows the containing block and should be wrapped to the next available vertical position. However the last breaking opportunity is not between 's' and the </span> but between 't' and 's'. Test: fast/layoutformattingcontext/inlin-box-content-fits-but-the-box-does-not.html * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::LineBreaker::tryBreakingTextRun const): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineCandidate::InlineContent::appendInlineItem): [container start](<span>) and [container end](</span>) runs are not collapsible. 2020-09-25 Wenson Hsieh <wenson_hsieh@apple.com> [GPU Process] fast/canvas/canvas-composite-canvas.html and fast/canvas/canvas-composite-image.html fail https://bugs.webkit.org/show_bug.cgi?id=216982 Reviewed by Simon Fraser. When painting into display-list-backed image buffers with remote `IOSurface`-backed image buffers in the GPU process, the display-list-backed image buffer has an initial CTM of the identity matrix, while the `IOSurface`- backed image buffer's initial CTM is flipped about the x-axis. This is because image buffer backends based on CoreGraphics always flip their context about the x-axis upon creation, in `ImageBufferCGBackend::setupContext()`. This causes the CTM of the DisplayList context in the web process to fall out of sync with the CTM of the platform context in the GPU process, so any canvas rendering codepaths that attempt to consult the current CTM in the web process (e.g. `CanvasRenderingContext2DBase::fullCanvasCompositedDrawImage`) will get an incorrect value. To fix this, we give the display-list-backed image buffer in the web process an initial CTM that matches the CTM of the native image buffer in the GPU process; see below for more details. Tests: fast/canvas/canvas-composite-canvas.html and fast/canvas/canvas-composite-image.html * platform/graphics/ImageBufferBackend.h: * platform/graphics/cg/ImageBufferCGBitmapBackend.h: Add a flag indicating whether the origin (0, 0) is intended to be at the top left corner of the image, in which case we set up the image buffer's graphics context by flipping it vertically about the x-axis. This is true on CoreGraphics-backed image buffers. * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: * platform/graphics/displaylists/DisplayListDrawingContext.cpp: (WebCore::DisplayList::DrawingContext::DrawingContext): * platform/graphics/displaylists/DisplayListDrawingContext.h: (WebCore::DisplayList::DrawingContext::DrawingContext): Add an additional argument to the constructor of `DrawingContext`, so that it now takes an initial affine CTM. By default, this is the identity matrix. * platform/graphics/displaylists/DisplayListImageBuffer.h: (WebCore::DisplayList::ImageBuffer::ImageBuffer): (WebCore::DisplayList::ImageBuffer::initialDrawingContextCTM): Add a helper to compute the initial CTM of the drawing context. This was previously only the identity matrix, but if we're using an image buffer backend that will flip the context vertically, then we need to start the CTM of the display-list-backed image buffer in the same state. * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::Recorder): Rename the `baseCTM` argument to `initialCTM`. This is because this argument determines the CTM of the initial graphics context state in the state stack, rather than the value of the base CTM. See above for more details. * platform/graphics/transforms/AffineTransform.h: 2020-09-25 Said Abou-Hallawa <sabouhallawa@apple.com> Move SerializationState from ImageBuffer to ImageBitmap https://bugs.webkit.org/show_bug.cgi?id=216565 Reviewed by Kenneth Russell. Introduce ImageBitmapBacking and make it a member of ImageBitmap. It represents the backing store of an ImageBitmap. Currently it encapsulates an ImageBuffer and the new enum SerializationState. In the future, it can be extended to encapsulate either a texture or an ImageBuffer. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpImageBitmap): (WebCore::CloneDeserializer::deserialize): (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::CloneDeserializer::readTransferredImageBitmap): (WebCore::CloneDeserializer::readImageBitmap): (WebCore::SerializedScriptValue::SerializedScriptValue): (WebCore::SerializedScriptValue::computeMemoryCost const): (WebCore::SerializedScriptValue::create): (WebCore::SerializedScriptValue::deserialize): * bindings/js/SerializedScriptValue.h: (WebCore::SerializedScriptValue::SerializedScriptValue): * html/ImageBitmap.cpp: (WebCore::ImageBitmap::create): (WebCore::ImageBitmap::detachBitmaps): (WebCore::ImageBitmap::resolveWithBlankImageBuffer): (WebCore::ImageBitmap::createPromise): (WebCore::ImageBitmap::createFromBuffer): (WebCore::ImageBitmap::ImageBitmap): (WebCore::ImageBitmap::takeImageBitmapBacking): (WebCore::ImageBitmap::takeImageBuffer): (WebCore::ImageBitmap::width const): Deleted. (WebCore::ImageBitmap::height const): Deleted. (WebCore::ImageBitmap::close): Deleted. (WebCore::ImageBitmap::transferOwnershipAndClose): Deleted. * html/ImageBitmap.h: * html/ImageBitmapBacking.cpp: Added. (WebCore::ImageBitmapBacking::ImageBitmapBacking): (WebCore::ImageBitmapBacking::buffer const): (WebCore::ImageBitmapBacking::takeImageBuffer): (WebCore::ImageBitmapBacking::width const): (WebCore::ImageBitmapBacking::height const): * html/ImageBitmapBacking.h: Added. (WebCore::ImageBitmapBacking::originClean const): (WebCore::ImageBitmapBacking::premultiplyAlpha const): (WebCore::ImageBitmapBacking::forciblyPremultiplyAlpha const): (WebCore::ImageBitmapBacking::serializationState const): * html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::transferToImageBitmap): * html/canvas/ImageBitmapRenderingContext.cpp: (WebCore::ImageBitmapRenderingContext::setOutputBitmap): * platform/graphics/ImageBuffer.h: (): Deleted. 2020-09-25 Chris Dumez <cdumez@apple.com> visibilitychange:hidden doesn't fire during page navigations https://bugs.webkit.org/show_bug.cgi?id=151234 <rdar://problem/23688763> Reviewed by Ryosuke Niwa. Fire a visibilitychange during document unload, as per the specification: - https://www.w3.org/TR/page-visibility/#reacting-to-visibilitychange-changes - https://html.spec.whatwg.org/multipage/browsing-the-web.html#unloading-document-visibility-change-steps Note that the specification currently says to fire the visibilitychange event before the pagehide event. However, Both Chrome and Firefox fire the pagehide event then the visibilitychange event. This change aligns our behavior with both Chrome and Firefox. The following bug has been filed against the specification: - https://github.com/w3c/page-visibility/issues/67 We also fire a visibilitychange event when coming out of the back/forward cache. This makes sense given that we fire one when the document enters the back/forward cache. This is also Firefox's behavior. I have verified that the new fast/history/back-forward-cache-visibility-state.html layout test is passing in Firefox. Tests: fast/history/back-forward-cache-visibility-state.html imported/w3c/web-platform-tests/page-visibility/idlharness.window.html imported/w3c/web-platform-tests/page-visibility/iframe-unload.html imported/w3c/web-platform-tests/page-visibility/onvisibilitychange.html imported/w3c/web-platform-tests/page-visibility/test_attributes_exist.html imported/w3c/web-platform-tests/page-visibility/test_child_document.html imported/w3c/web-platform-tests/page-visibility/test_default_view.html imported/w3c/web-platform-tests/page-visibility/test_read_only.html imported/w3c/web-platform-tests/page-visibility/unload-bubbles.html imported/w3c/web-platform-tests/page-visibility/unload.html * dom/Document.cpp: (WebCore::Document::visibilityState const): (WebCore::Document::setHiddenDueToDismissal): * dom/Document.h: * history/CachedPage.cpp: (WebCore::firePageShowAndPopStateEvents): * loader/FrameLoader.cpp: (WebCore::FrameLoader::dispatchUnloadEvents): 2020-09-25 James Darpinian <jdarpinian@chromium.org> Support OES_fbo_render_mipmap https://bugs.webkit.org/show_bug.cgi?id=217003 Reviewed by Kenneth Russell. Test: webgl/conformance/extensions/oes-fbo-render-mipmap.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMConvertWebGL.cpp: (WebCore::convertToJSValue): * html/canvas/OESFBORenderMipmap.cpp: Added. (WebCore::OESFBORenderMipmap::OESFBORenderMipmap): (WebCore::OESFBORenderMipmap::getName const): (WebCore::OESFBORenderMipmap::supported): * html/canvas/OESFBORenderMipmap.h: Added. * html/canvas/OESFBORenderMipmap.idl: Added. * html/canvas/WebGLExtension.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::getExtension): (WebCore::WebGLRenderingContext::getSupportedExtensions): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::framebufferTexture2D): (WebCore::WebGLRenderingContextBase::extensionIsEnabled): (WebCore::WebGLRenderingContextBase::loseExtensions): * html/canvas/WebGLRenderingContextBase.h: 2020-09-25 Tim Horton <timothy_horton@apple.com> Crunchyroll playback controls do not work on iPad with trackpad https://bugs.webkit.org/show_bug.cgi?id=217000 <rdar://problem/66362029> Reviewed by Wenson Hsieh. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isCrunchyroll): 2020-09-25 Simon Fraser <simon.fraser@apple.com> Make renderingUpdateScheduler() internal to Page https://bugs.webkit.org/show_bug.cgi?id=216993 Reviewed by Said Abou-Hallawa. renderingUpdateScheduler() should be an implementation detail of Page. Also add some explanatory comments. * dom/Document.cpp: (WebCore::Document::scheduleTimedRenderingUpdate): * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::scheduleAnimation): * page/Page.cpp: (WebCore::Page::scheduleImmediateRenderingUpdate): * page/Page.h: * page/PageOverlayController.cpp: (WebCore::PageOverlayController::didChangeViewExposedRect): (WebCore::PageOverlayController::notifyFlushRequired): * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerTreeAsText): 2020-09-25 Chris Dumez <cdumez@apple.com> Unreviewed, update xcfilelist files. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: 2020-09-25 Chris Dumez <cdumez@apple.com> Avoid having to call context.lazyInitialize() in every AudioNode factory function https://bugs.webkit.org/show_bug.cgi?id=216989 Reviewed by Darin Adler. Avoid having to call context.lazyInitialize() in every AudioNode factory function. Replace all these calls with a single one inside the AudioNode constructor. No new tests, no Web facing behavior change. * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::create): * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::create): * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::AudioNode): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::lazyInitialize): * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::create): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): * Modules/webaudio/ConstantSourceNode.cpp: (WebCore::ConstantSourceNode::create): * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::create): * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::create): * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::create): * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::create): * Modules/webaudio/IIRFilterNode.cpp: (WebCore::IIRFilterNode::create): * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::create): * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: (WebCore::MediaStreamAudioDestinationNode::create): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::create): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::create): * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::create): * Modules/webaudio/StereoPannerNode.cpp: (WebCore::StereoPannerNode::create): * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::create): 2020-09-25 Lauro Moura <lmoura@igalia.com> Use CMake 3.10 compatible list functions https://bugs.webkit.org/show_bug.cgi?id=216996 Reviewed by Fujii Hironori. POP_FRONT and PREPEND were added in CMake 3.15. * WebCoreMacros.cmake: Use GET and REMOVE_AT instead of POP_FRONT. 2020-09-25 Chris Dumez <cdumez@apple.com> Drop AudioNode::setNodeType() https://bugs.webkit.org/show_bug.cgi?id=216988 Reviewed by Eric Carlson. Drop AudioNode::setNodeType() in favor of passing the NodeType to the AudioNode constructor. This makes sure we never forget to set the type. * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::AnalyserNode): * Modules/webaudio/AudioBasicInspectorNode.cpp: (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode): * Modules/webaudio/AudioBasicInspectorNode.h: * Modules/webaudio/AudioBasicProcessorNode.cpp: (WebCore::AudioBasicProcessorNode::AudioBasicProcessorNode): * Modules/webaudio/AudioBasicProcessorNode.h: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::AudioDestinationNode): * Modules/webaudio/AudioNode.cpp: (WebCore::convertEnumerationToString): (WebCore::AudioNode::AudioNode): (WebCore::AudioNode::printNodeCounts): * Modules/webaudio/AudioNode.h: (WebCore::AudioNode::context): (WebCore::AudioNode::context const): (WebCore::AudioNode::nodeType const): * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode): * Modules/webaudio/AudioScheduledSourceNode.h: * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::BiquadFilterNode): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::ChannelMergerNode): * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::ChannelSplitterNode): * Modules/webaudio/ConstantSourceNode.cpp: (WebCore::ConstantSourceNode::ConstantSourceNode): * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::ConvolverNode): * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::DelayNode): * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::GainNode): * Modules/webaudio/IIRFilterNode.cpp: (WebCore::IIRFilterNode::IIRFilterNode): * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode): * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::OscillatorNode): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNodeBase::PannerNodeBase): (WebCore::PannerNode::PannerNode): * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::ScriptProcessorNode): * Modules/webaudio/StereoPannerNode.cpp: (WebCore::StereoPannerNode::StereoPannerNode): * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::WaveShaperNode): * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode): 2020-09-24 Dean Jackson <dino@apple.com> WebGL should use GLES in iOS apps running on Apple Silicon https://bugs.webkit.org/show_bug.cgi?id=216722 <rdar://problem/68976337> Reviewed by Tim Horton. * Configurations/WebCore.xcconfig: Remove all OpenGL/OpenGLES linking. * WebCore.xcodeproj/project.pbxproj: * platform/graphics/GraphicsContextGL.h: Change the ANGLE IOSurface texture binding enums into functions, because they have to be calculated at run-time. * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: Use the new soft-linked functions from PAL. Also implement the IOSurface texture binding helpers that were previously enums. * platform/mac/PlatformScreenMac.mm: * platform/mac/WebGLBlocklist.mm: 2020-09-25 James Darpinian <jdarpinian@chromium.org> Support EXT_float_blend https://bugs.webkit.org/show_bug.cgi?id=216949 Reviewed by Kenneth Russell. Test: webgl/conformance/extensions/ext-float-blend.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMConvertWebGL.cpp: (WebCore::convertToJSValue): * html/canvas/EXTFloatBlend.cpp: Added. (WebCore::EXTFloatBlend::EXTFloatBlend): (WebCore::EXTFloatBlend::getName const): (WebCore::EXTFloatBlend::supported): * html/canvas/EXTFloatBlend.h: Added. * html/canvas/EXTFloatBlend.idl: Added. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getExtension): (WebCore::WebGL2RenderingContext::getSupportedExtensions): * html/canvas/WebGLExtension.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::getExtension): (WebCore::WebGLRenderingContext::getSupportedExtensions): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::extensionIsEnabled): (WebCore::WebGLRenderingContextBase::loseExtensions): * html/canvas/WebGLRenderingContextBase.h: 2020-09-25 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Incorrect width value is set for partially collapsible trailing space https://bugs.webkit.org/show_bug.cgi?id=216990 Reviewed by Simon Fraser. Use the letter-spacing value as the collapsible space. Test: fast/layoutformattingcontext/horizontal-sizing-with-trailing-letter-spacing.html * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::appendTextContent): 2020-09-25 James Darpinian <jdarpinian@chromium.org> Fix WEBGL_compressed_texture_s3tc_srgb in WebGL 2 https://bugs.webkit.org/show_bug.cgi?id=216951 Reviewed by Kenneth Russell. Tested by webgl/2.0.0/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getExtension): (WebCore::WebGL2RenderingContext::getSupportedExtensions): 2020-09-25 Yusuke Suzuki <ysuzuki@apple.com> [JSC] Introduce JSC_DECLARE_HOST_FUNCTION / JSC_DEFINE_HOST_FUNCTION to make host function definition easy-to-scanned for JIT-caging https://bugs.webkit.org/show_bug.cgi?id=216966 Reviewed by Saam Barati. No behavior change. We also annotate custom getters / setters with JIT_OPERATION since they can be invoked from JIT code. * bindings/js/JSDOMBuiltinConstructor.h: (WebCore::JSDOMBuiltinConstructor<JSClass>::construct): * bindings/js/JSDOMConstructor.h: * bindings/js/JSDOMConstructorBase.cpp: (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::callThrowTypeError): Deleted. * bindings/js/JSDOMConstructorBase.h: * bindings/js/JSDOMConstructorNotConstructable.h: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::makeThisTypeErrorForBuiltins): Deleted. (WebCore::makeGetterTypeErrorForBuiltins): Deleted. (WebCore::makeDOMExceptionForBuiltins): Deleted. (WebCore::isReadableByteStreamAPIEnabled): Deleted. (WebCore::isWritableStreamAPIEnabled): Deleted. (WebCore::whenSignalAborted): Deleted. * bindings/js/JSDOMIterator.h: (WebCore::IteratorTraits>::next): * bindings/js/JSDOMLegacyFactoryFunction.h: * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowWebKit): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsDOMWindowInstanceFunctionOpenDatabase): Deleted. * bindings/js/JSPluginElementFunctions.cpp: (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::callPlugin): Deleted. * bindings/js/StructuredClone.cpp: (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::cloneArrayBuffer): Deleted. (WebCore::structuredCloneArrayBuffer): Deleted. (WebCore::structuredCloneArrayBufferView): Deleted. * bindings/js/StructuredClone.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GenerateImplementation): (GenerateAttributeGetterTrampolineDefinition): (GenerateAttributeSetterTrampolineDefinition): (GenerateOperationTrampolineDefinition): (GenerateDefaultToJSONOperationDefinition): (GenerateLegacyCallerDefinitions): (GenerateLegacyCallerDefinition): (GenerateIterableDefinition): (GenerateConstructorDefinitions): (GenerateConstructorDefinition): * bindings/scripts/test/JS/JSDOMWindow.cpp: (WebCore::jsDOMWindowConstructor): (WebCore::setJSDOMWindowConstructor): (WebCore::jsDOMWindowExposedToWorkerAndWindowConstructor): (WebCore::setJSDOMWindowExposedToWorkerAndWindowConstructor): (WebCore::jsDOMWindowTestConditionallyReadWriteConstructor): (WebCore::setJSDOMWindowTestConditionallyReadWriteConstructor): (WebCore::jsDOMWindowTestDefaultToJSONFilteredByExposedConstructor): (WebCore::setJSDOMWindowTestDefaultToJSONFilteredByExposedConstructor): (WebCore::jsDOMWindowTestNodeConstructor): (WebCore::setJSDOMWindowTestNodeConstructor): (WebCore::jsDOMWindowTestObjectConstructor): (WebCore::setJSDOMWindowTestObjectConstructor): (WebCore::jsDOMWindowTestPromiseRejectionEventConstructor): (WebCore::setJSDOMWindowTestPromiseRejectionEventConstructor): * bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.cpp: (WebCore::jsDedicatedWorkerGlobalScopeConstructor): (WebCore::setJSDedicatedWorkerGlobalScopeConstructor): * bindings/scripts/test/JS/JSExposedToWorkerAndWindow.cpp: (WebCore::JSExposedToWorkerAndWindowConstructor::construct): (WebCore::jsExposedToWorkerAndWindowConstructor): (WebCore::setJSExposedToWorkerAndWindowConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsExposedToWorkerAndWindowPrototypeFunctionDoSomething): Deleted. * bindings/scripts/test/JS/JSMapLike.cpp: (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsMapLikePrototypeFunctionGet): Deleted. (WebCore::jsMapLikePrototypeFunctionHas): Deleted. (WebCore::jsMapLikePrototypeFunctionEntries): Deleted. (WebCore::jsMapLikePrototypeFunctionKeys): Deleted. (WebCore::jsMapLikePrototypeFunctionValues): Deleted. (WebCore::jsMapLikePrototypeFunctionForEach): Deleted. (WebCore::jsMapLikePrototypeFunctionSet): Deleted. (WebCore::jsMapLikePrototypeFunctionClear): Deleted. (WebCore::jsMapLikePrototypeFunctionDelete): Deleted. * bindings/scripts/test/JS/JSPaintWorkletGlobalScope.cpp: (WebCore::jsPaintWorkletGlobalScopeConstructor): (WebCore::setJSPaintWorkletGlobalScopeConstructor): * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsReadOnlyMapLikePrototypeFunctionGet): Deleted. (WebCore::jsReadOnlyMapLikePrototypeFunctionHas): Deleted. (WebCore::jsReadOnlyMapLikePrototypeFunctionEntries): Deleted. (WebCore::jsReadOnlyMapLikePrototypeFunctionKeys): Deleted. (WebCore::jsReadOnlyMapLikePrototypeFunctionValues): Deleted. (WebCore::jsReadOnlyMapLikePrototypeFunctionForEach): Deleted. * bindings/scripts/test/JS/JSReadOnlySetLike.cpp: (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsReadOnlySetLikePrototypeFunctionHas): Deleted. (WebCore::jsReadOnlySetLikePrototypeFunctionEntries): Deleted. (WebCore::jsReadOnlySetLikePrototypeFunctionKeys): Deleted. (WebCore::jsReadOnlySetLikePrototypeFunctionValues): Deleted. (WebCore::jsReadOnlySetLikePrototypeFunctionForEach): Deleted. * bindings/scripts/test/JS/JSServiceWorkerGlobalScope.cpp: (WebCore::jsServiceWorkerGlobalScopeConstructor): (WebCore::setJSServiceWorkerGlobalScopeConstructor): * bindings/scripts/test/JS/JSSetLike.cpp: (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsSetLikePrototypeFunctionHas): Deleted. (WebCore::jsSetLikePrototypeFunctionEntries): Deleted. (WebCore::jsSetLikePrototypeFunctionKeys): Deleted. (WebCore::jsSetLikePrototypeFunctionValues): Deleted. (WebCore::jsSetLikePrototypeFunctionForEach): Deleted. (WebCore::jsSetLikePrototypeFunctionAdd): Deleted. (WebCore::jsSetLikePrototypeFunctionClear): Deleted. (WebCore::jsSetLikePrototypeFunctionDelete): Deleted. * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::JSTestActiveDOMObjectConstructor::prototypeForStructure): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction): Deleted. (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage): Deleted. (WebCore::jsTestActiveDOMObjectPrototypeFunctionOverloadedMethod): Deleted. * bindings/scripts/test/JS/JSTestCEReactions.cpp: (WebCore::jsTestCEReactionsConstructor): (WebCore::setJSTestCEReactionsConstructor): (WebCore::jsTestCEReactionsAttributeWithCEReactions): (WebCore::setJSTestCEReactionsAttributeWithCEReactions): (WebCore::jsTestCEReactionsReflectAttributeWithCEReactions): (WebCore::setJSTestCEReactionsReflectAttributeWithCEReactions): (WebCore::jsTestCEReactionsStringifierAttribute): (WebCore::setJSTestCEReactionsStringifierAttribute): (WebCore::jsTestCEReactionsAttributeWithCEReactionsNotNeeded): (WebCore::setJSTestCEReactionsAttributeWithCEReactionsNotNeeded): (WebCore::jsTestCEReactionsReflectAttributeWithCEReactionsNotNeeded): (WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsNotNeeded): (WebCore::jsTestCEReactionsStringifierAttributeNotNeeded): (WebCore::setJSTestCEReactionsStringifierAttributeNotNeeded): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactions): Deleted. (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsNotNeeded): Deleted. * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: (WebCore::jsTestCEReactionsStringifierConstructor): (WebCore::setJSTestCEReactionsStringifierConstructor): (WebCore::jsTestCEReactionsStringifierValue): (WebCore::setJSTestCEReactionsStringifierValue): (WebCore::jsTestCEReactionsStringifierValueWithoutReactions): (WebCore::setJSTestCEReactionsStringifierValueWithoutReactions): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestCEReactionsStringifierPrototypeFunctionToString): Deleted. * bindings/scripts/test/JS/JSTestCallTracer.cpp: (WebCore::JSTestCallTracerConstructor::prototypeForStructure): (WebCore::jsTestCallTracerConstructor): (WebCore::setJSTestCallTracerConstructor): (WebCore::jsTestCallTracerTestAttributeInterface): (WebCore::setJSTestCallTracerTestAttributeInterface): (WebCore::jsTestCallTracerTestAttributeSpecified): (WebCore::setJSTestCallTracerTestAttributeSpecified): (WebCore::jsTestCallTracerTestAttributeWithVariant): (WebCore::setJSTestCallTracerTestAttributeWithVariant): (WebCore::jsTestCallTracerTestReadonlyAttribute): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterface): Deleted. (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecified): Deleted. (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArguments): Deleted. (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgument): Deleted. (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgument): Deleted. (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgument): Deleted. (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgument): Deleted. (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgument): Deleted. * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: (WebCore::jsTestClassWithJSBuiltinConstructorConstructor): (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor): * bindings/scripts/test/JS/JSTestConditionalIncludes.cpp: (WebCore::JSTestConditionalIncludesConstructor::prototypeForStructure): (WebCore::jsTestConditionalIncludesConstructor): (WebCore::setJSTestConditionalIncludesConstructor): (WebCore::jsTestConditionalIncludesTestAttr): (WebCore::jsTestConditionalIncludesMixinReadOnlyAttribute): (WebCore::jsTestConditionalIncludesMixinAttribute): (WebCore::setJSTestConditionalIncludesMixinAttribute): (WebCore::jsTestConditionalIncludesMixinCustomAttribute): (WebCore::setJSTestConditionalIncludesMixinCustomAttribute): (WebCore::jsTestConditionalIncludesMixinNodeAttribute): (WebCore::setJSTestConditionalIncludesMixinNodeAttribute): (WebCore::jsTestConditionalIncludesPartialMixinAttributeFromPartial): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestConditionalIncludesPrototypeFunctionMixinOperation): Deleted. (WebCore::jsTestConditionalIncludesPrototypeFunctionMixinComplexOperation): Deleted. (WebCore::jsTestConditionalIncludesPrototypeFunctionMixinCustomOperation): Deleted. (WebCore::jsTestConditionalIncludesPrototypeFunctionMixinConditionalOperation): Deleted. (WebCore::jsTestConditionalIncludesPrototypeFunctionMixinSettingsConditionalOperation): Deleted. (WebCore::jsTestConditionalIncludesPrototypeFunctionMixinResultFieldOperation): Deleted. (WebCore::jsTestConditionalIncludesPrototypeFunctionPartialMixinOperationFromPartial): Deleted. * bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp: (WebCore::JSTestConditionallyReadWriteConstructor::prototypeForStructure): (WebCore::jsTestConditionallyReadWriteConstructor): (WebCore::setJSTestConditionallyReadWriteConstructor): (WebCore::jsTestConditionallyReadWriteConditionallyReadWriteAttribute): (WebCore::setJSTestConditionallyReadWriteConditionallyReadWriteAttribute): (WebCore::jsTestConditionallyReadWriteConditionalAndConditionallyReadWriteAttribute): (WebCore::setJSTestConditionallyReadWriteConditionalAndConditionallyReadWriteAttribute): (WebCore::jsTestConditionallyReadWriteRuntimeConditionallyReadWriteAttribute): (WebCore::setJSTestConditionallyReadWriteRuntimeConditionallyReadWriteAttribute): (WebCore::jsTestConditionallyReadWriteRuntimeConditionallyReadWriteAttributeUnforgeable): (WebCore::setJSTestConditionallyReadWriteRuntimeConditionallyReadWriteAttributeUnforgeable): (WebCore::jsTestConditionallyReadWriteRuntimeConditionallyReadWriteAttributeUnforgeablePrivate): (WebCore::setJSTestConditionallyReadWriteRuntimeConditionallyReadWriteAttributeUnforgeablePrivate): (WebCore::jsTestConditionallyReadWriteRuntimeConditionallyReadWriteAttributePromise): (WebCore::setJSTestConditionallyReadWriteRuntimeConditionallyReadWriteAttributePromise): (WebCore::jsTestConditionallyReadWriteSettingsConditionallyReadWriteAttribute): (WebCore::setJSTestConditionallyReadWriteSettingsConditionallyReadWriteAttribute): (WebCore::jsTestConditionallyReadWriteSettingsConditionallyReadWriteAttributeUnforgeable): (WebCore::setJSTestConditionallyReadWriteSettingsConditionallyReadWriteAttributeUnforgeable): (WebCore::jsTestConditionallyReadWriteSettingsConditionallyReadWriteAttributeUnforgeablePrivate): (WebCore::setJSTestConditionallyReadWriteSettingsConditionallyReadWriteAttributeUnforgeablePrivate): (WebCore::jsTestConditionallyReadWriteSettingsConditionallyReadWriteAttributePromise): (WebCore::setJSTestConditionallyReadWriteSettingsConditionallyReadWriteAttributePromise): * bindings/scripts/test/JS/JSTestDOMJIT.cpp: (WebCore::jsTestDOMJITConstructor): (WebCore::setJSTestDOMJITConstructor): (WebCore::jsTestDOMJITAnyAttr): (WebCore::jsTestDOMJITBooleanAttr): (WebCore::jsTestDOMJITByteAttr): (WebCore::jsTestDOMJITOctetAttr): (WebCore::jsTestDOMJITShortAttr): (WebCore::jsTestDOMJITUnsignedShortAttr): (WebCore::jsTestDOMJITLongAttr): (WebCore::jsTestDOMJITUnsignedLongAttr): (WebCore::jsTestDOMJITLongLongAttr): (WebCore::jsTestDOMJITUnsignedLongLongAttr): (WebCore::jsTestDOMJITFloatAttr): (WebCore::jsTestDOMJITUnrestrictedFloatAttr): (WebCore::jsTestDOMJITDoubleAttr): (WebCore::jsTestDOMJITUnrestrictedDoubleAttr): (WebCore::jsTestDOMJITDomStringAttr): (WebCore::jsTestDOMJITByteStringAttr): (WebCore::jsTestDOMJITUsvStringAttr): (WebCore::jsTestDOMJITNodeAttr): (WebCore::jsTestDOMJITBooleanNullableAttr): (WebCore::jsTestDOMJITByteNullableAttr): (WebCore::jsTestDOMJITOctetNullableAttr): (WebCore::jsTestDOMJITShortNullableAttr): (WebCore::jsTestDOMJITUnsignedShortNullableAttr): (WebCore::jsTestDOMJITLongNullableAttr): (WebCore::jsTestDOMJITUnsignedLongNullableAttr): (WebCore::jsTestDOMJITLongLongNullableAttr): (WebCore::jsTestDOMJITUnsignedLongLongNullableAttr): (WebCore::jsTestDOMJITFloatNullableAttr): (WebCore::jsTestDOMJITUnrestrictedFloatNullableAttr): (WebCore::jsTestDOMJITDoubleNullableAttr): (WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttr): (WebCore::jsTestDOMJITDomStringNullableAttr): (WebCore::jsTestDOMJITByteStringNullableAttr): (WebCore::jsTestDOMJITUsvStringNullableAttr): (WebCore::jsTestDOMJITNodeNullableAttr): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestDOMJITPrototypeFunctionGetAttribute): Deleted. (WebCore::jsTestDOMJITPrototypeFunctionItem): Deleted. (WebCore::jsTestDOMJITPrototypeFunctionHasAttribute): Deleted. (WebCore::jsTestDOMJITPrototypeFunctionGetElementById): Deleted. (WebCore::jsTestDOMJITPrototypeFunctionGetElementsByName): Deleted. * bindings/scripts/test/JS/JSTestDefaultToJSON.cpp: (WebCore::jsTestDefaultToJSONConstructor): (WebCore::setJSTestDefaultToJSONConstructor): (WebCore::jsTestDefaultToJSONLongAttribute): (WebCore::jsTestDefaultToJSONEnabledBySettingsAttribute): (WebCore::jsTestDefaultToJSONEnabledByConditionalAttribute): (WebCore::jsTestDefaultToJSONEventHandlerAttribute): (WebCore::setJSTestDefaultToJSONEventHandlerAttribute): (WebCore::jsTestDefaultToJSONFirstStringAttribute): (WebCore::setJSTestDefaultToJSONFirstStringAttribute): (WebCore::jsTestDefaultToJSONSecondLongAttribute): (WebCore::setJSTestDefaultToJSONSecondLongAttribute): (WebCore::jsTestDefaultToJSONThirdUnJSONableAttribute): (WebCore::setJSTestDefaultToJSONThirdUnJSONableAttribute): (WebCore::jsTestDefaultToJSONFourthUnrestrictedDoubleAttribute): (WebCore::setJSTestDefaultToJSONFourthUnrestrictedDoubleAttribute): (WebCore::jsTestDefaultToJSONFifthLongClampedAttribute): (WebCore::setJSTestDefaultToJSONFifthLongClampedAttribute): (WebCore::jsTestDefaultToJSONSixthTypedefAttribute): (WebCore::setJSTestDefaultToJSONSixthTypedefAttribute): (WebCore::jsTestDefaultToJSONSeventhDirectlyToJSONableAttribute): (WebCore::setJSTestDefaultToJSONSeventhDirectlyToJSONableAttribute): (WebCore::jsTestDefaultToJSONEighthIndirectlyAttribute): (WebCore::setJSTestDefaultToJSONEighthIndirectlyAttribute): (WebCore::jsTestDefaultToJSONNinthOptionalDirectlyToJSONableAttribute): (WebCore::setJSTestDefaultToJSONNinthOptionalDirectlyToJSONableAttribute): (WebCore::jsTestDefaultToJSONTenthFrozenArrayAttribute): (WebCore::setJSTestDefaultToJSONTenthFrozenArrayAttribute): (WebCore::jsTestDefaultToJSONEleventhSequenceAttribute): (WebCore::setJSTestDefaultToJSONEleventhSequenceAttribute): (WebCore::jsTestDefaultToJSONTwelfthInterfaceSequenceAttribute): (WebCore::setJSTestDefaultToJSONTwelfthInterfaceSequenceAttribute): (WebCore::jsTestDefaultToJSONThirteenthRecordAttribute): (WebCore::setJSTestDefaultToJSONThirteenthRecordAttribute): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestDefaultToJSONPrototypeFunctionToJSON): Deleted. * bindings/scripts/test/JS/JSTestDefaultToJSONFilteredByExposed.cpp: (WebCore::jsTestDefaultToJSONFilteredByExposedConstructor): (WebCore::setJSTestDefaultToJSONFilteredByExposedConstructor): (WebCore::jsTestDefaultToJSONFilteredByExposedNormalAttribute): (WebCore::jsTestDefaultToJSONFilteredByExposedFilteredByExposedWindowAttribute): (WebCore::jsTestDefaultToJSONFilteredByExposedFilteredByExposedWorkerAttribute): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestDefaultToJSONFilteredByExposedPrototypeFunctionToJSON): Deleted. * bindings/scripts/test/JS/JSTestDefaultToJSONIndirectInheritance.cpp: (WebCore::jsTestDefaultToJSONIndirectInheritanceConstructor): (WebCore::setJSTestDefaultToJSONIndirectInheritanceConstructor): * bindings/scripts/test/JS/JSTestDefaultToJSONInherit.cpp: (WebCore::jsTestDefaultToJSONInheritConstructor): (WebCore::setJSTestDefaultToJSONInheritConstructor): (WebCore::jsTestDefaultToJSONInheritInheritLongAttribute): (WebCore::setJSTestDefaultToJSONInheritInheritLongAttribute): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestDefaultToJSONInheritPrototypeFunctionToJSON): Deleted. * bindings/scripts/test/JS/JSTestDefaultToJSONInheritFinal.cpp: (WebCore::jsTestDefaultToJSONInheritFinalConstructor): (WebCore::setJSTestDefaultToJSONInheritFinalConstructor): (WebCore::jsTestDefaultToJSONInheritFinalFinalLongAttributeFoo): (WebCore::setJSTestDefaultToJSONInheritFinalFinalLongAttributeFoo): (WebCore::jsTestDefaultToJSONInheritFinalFinalLongAttributeBar): (WebCore::setJSTestDefaultToJSONInheritFinalFinalLongAttributeBar): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestDefaultToJSONInheritFinalPrototypeFunctionToJSON): Deleted. * bindings/scripts/test/JS/JSTestDomainSecurity.cpp: (WebCore::JSTestDomainSecurityConstructor::prototypeForStructure): (WebCore::jsTestDomainSecurityConstructor): (WebCore::setJSTestDomainSecurityConstructor): (WebCore::jsTestDomainSecurityExcitingAttr): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestDomainSecurityPrototypeFunctionExcitingFunction): Deleted. (WebCore::jsTestDomainSecurityPrototypeFunctionPostMessage): Deleted. (WebCore::jsTestDomainSecurityPrototypeFunctionOverloadedMethod): Deleted. * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::JSTestEnabledBySettingConstructor::prototypeForStructure): (WebCore::jsTestEnabledBySettingConstructor): (WebCore::setJSTestEnabledBySettingConstructor): (WebCore::jsTestEnabledBySettingTestSubObjEnabledBySettingConstructor): (WebCore::setJSTestEnabledBySettingTestSubObjEnabledBySettingConstructor): (WebCore::jsTestEnabledBySettingEnabledBySettingAttribute): (WebCore::setJSTestEnabledBySettingEnabledBySettingAttribute): (WebCore::jsTestEnabledBySettingEnabledByTwoSettingsAttribute): (WebCore::setJSTestEnabledBySettingEnabledByTwoSettingsAttribute): (WebCore::jsTestEnabledBySettingSupplementalAttribute): (WebCore::setJSTestEnabledBySettingSupplementalAttribute): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestEnabledBySettingPrototypeFunctionEnabledBySettingOperation): Deleted. * bindings/scripts/test/JS/JSTestEnabledForContext.cpp: (WebCore::jsTestEnabledForContextConstructor): (WebCore::setJSTestEnabledForContextConstructor): (WebCore::jsTestEnabledForContextTestSubObjEnabledForContextConstructor): (WebCore::setJSTestEnabledForContextTestSubObjEnabledForContextConstructor): * bindings/scripts/test/JS/JSTestEventConstructor.cpp: (WebCore::JSTestEventConstructorConstructor::construct): (WebCore::jsTestEventConstructorConstructor): (WebCore::setJSTestEventConstructorConstructor): (WebCore::jsTestEventConstructorAttr1): (WebCore::jsTestEventConstructorAttr2): (WebCore::jsTestEventConstructorAttr3): * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::jsTestEventTargetConstructor): (WebCore::setJSTestEventTargetConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestEventTargetPrototypeFunctionItem): Deleted. * bindings/scripts/test/JS/JSTestException.cpp: (WebCore::jsTestExceptionConstructor): (WebCore::setJSTestExceptionConstructor): (WebCore::jsTestExceptionName): * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: (WebCore::jsTestGenerateIsReachableConstructor): (WebCore::setJSTestGenerateIsReachableConstructor): (WebCore::jsTestGenerateIsReachableASecretAttribute): * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::jsTestGlobalObjectConstructor): (WebCore::setJSTestGlobalObjectConstructor): (WebCore::jsTestGlobalObjectRegularAttribute): (WebCore::setJSTestGlobalObjectRegularAttribute): (WebCore::jsTestGlobalObjectPublicAndPrivateAttribute): (WebCore::setJSTestGlobalObjectPublicAndPrivateAttribute): (WebCore::jsTestGlobalObjectPublicAndPrivateConditionalAttribute): (WebCore::setJSTestGlobalObjectPublicAndPrivateConditionalAttribute): (WebCore::jsTestGlobalObjectEnabledAtRuntimeAttribute): (WebCore::setJSTestGlobalObjectEnabledAtRuntimeAttribute): (WebCore::jsTestGlobalObjectDOMWindowConstructor): (WebCore::setJSTestGlobalObjectDOMWindowConstructor): (WebCore::jsTestGlobalObjectDedicatedWorkerGlobalScopeConstructor): (WebCore::setJSTestGlobalObjectDedicatedWorkerGlobalScopeConstructor): (WebCore::jsTestGlobalObjectPaintWorkletGlobalScopeConstructor): (WebCore::setJSTestGlobalObjectPaintWorkletGlobalScopeConstructor): (WebCore::jsTestGlobalObjectServiceWorkerGlobalScopeConstructor): (WebCore::setJSTestGlobalObjectServiceWorkerGlobalScopeConstructor): (WebCore::jsTestGlobalObjectTestCEReactionsConstructor): (WebCore::setJSTestGlobalObjectTestCEReactionsConstructor): (WebCore::jsTestGlobalObjectTestCEReactionsStringifierConstructor): (WebCore::setJSTestGlobalObjectTestCEReactionsStringifierConstructor): (WebCore::jsTestGlobalObjectTestCallTracerConstructor): (WebCore::setJSTestGlobalObjectTestCallTracerConstructor): (WebCore::jsTestGlobalObjectTestCallbackInterfaceConstructor): (WebCore::setJSTestGlobalObjectTestCallbackInterfaceConstructor): (WebCore::jsTestGlobalObjectTestClassWithJSBuiltinConstructorConstructor): (WebCore::setJSTestGlobalObjectTestClassWithJSBuiltinConstructorConstructor): (WebCore::jsTestGlobalObjectTestConditionalIncludesConstructor): (WebCore::setJSTestGlobalObjectTestConditionalIncludesConstructor): (WebCore::jsTestGlobalObjectTestDOMJITConstructor): (WebCore::setJSTestGlobalObjectTestDOMJITConstructor): (WebCore::jsTestGlobalObjectTestDefaultToJSONConstructor): (WebCore::setJSTestGlobalObjectTestDefaultToJSONConstructor): (WebCore::jsTestGlobalObjectTestDefaultToJSONIndirectInheritanceConstructor): (WebCore::setJSTestGlobalObjectTestDefaultToJSONIndirectInheritanceConstructor): (WebCore::jsTestGlobalObjectTestDefaultToJSONInheritConstructor): (WebCore::setJSTestGlobalObjectTestDefaultToJSONInheritConstructor): (WebCore::jsTestGlobalObjectTestDefaultToJSONInheritFinalConstructor): (WebCore::setJSTestGlobalObjectTestDefaultToJSONInheritFinalConstructor): (WebCore::jsTestGlobalObjectTestDomainSecurityConstructor): (WebCore::setJSTestGlobalObjectTestDomainSecurityConstructor): (WebCore::jsTestGlobalObjectTestEnabledBySettingConstructor): (WebCore::setJSTestGlobalObjectTestEnabledBySettingConstructor): (WebCore::jsTestGlobalObjectTestEnabledForContextConstructor): (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructor): (WebCore::jsTestGlobalObjectTestEventConstructorConstructor): (WebCore::setJSTestGlobalObjectTestEventConstructorConstructor): (WebCore::jsTestGlobalObjectTestEventTargetConstructor): (WebCore::setJSTestGlobalObjectTestEventTargetConstructor): (WebCore::jsTestGlobalObjectTestExceptionConstructor): (WebCore::setJSTestGlobalObjectTestExceptionConstructor): (WebCore::jsTestGlobalObjectTestGenerateIsReachableConstructor): (WebCore::setJSTestGlobalObjectTestGenerateIsReachableConstructor): (WebCore::jsTestGlobalObjectTestGlobalObjectConstructor): (WebCore::setJSTestGlobalObjectTestGlobalObjectConstructor): (WebCore::jsTestGlobalObjectTestIndexedSetterNoIdentifierConstructor): (WebCore::setJSTestGlobalObjectTestIndexedSetterNoIdentifierConstructor): (WebCore::jsTestGlobalObjectTestIndexedSetterThrowingExceptionConstructor): (WebCore::setJSTestGlobalObjectTestIndexedSetterThrowingExceptionConstructor): (WebCore::jsTestGlobalObjectTestIndexedSetterWithIdentifierConstructor): (WebCore::setJSTestGlobalObjectTestIndexedSetterWithIdentifierConstructor): (WebCore::jsTestGlobalObjectTestInterfaceConstructor): (WebCore::setJSTestGlobalObjectTestInterfaceConstructor): (WebCore::jsTestGlobalObjectTestInterfaceLeadingUnderscoreConstructor): (WebCore::setJSTestGlobalObjectTestInterfaceLeadingUnderscoreConstructor): (WebCore::jsTestGlobalObjectTestIterableConstructor): (WebCore::setJSTestGlobalObjectTestIterableConstructor): (WebCore::jsTestGlobalObjectTestJSBuiltinConstructorConstructor): (WebCore::setJSTestGlobalObjectTestJSBuiltinConstructorConstructor): (WebCore::jsTestGlobalObjectTestLegacyFactoryFunctionConstructor): (WebCore::setJSTestGlobalObjectTestLegacyFactoryFunctionConstructor): (WebCore::jsTestGlobalObjectAudioConstructor): (WebCore::setJSTestGlobalObjectAudioConstructor): (WebCore::jsTestGlobalObjectTestLegacyOverrideBuiltInsConstructor): (WebCore::setJSTestGlobalObjectTestLegacyOverrideBuiltInsConstructor): (WebCore::jsTestGlobalObjectTestMapLikeConstructor): (WebCore::setJSTestGlobalObjectTestMapLikeConstructor): (WebCore::jsTestGlobalObjectTestMapLikeWithOverriddenOperationsConstructor): (WebCore::setJSTestGlobalObjectTestMapLikeWithOverriddenOperationsConstructor): (WebCore::jsTestGlobalObjectTestNamedAndIndexedSetterNoIdentifierConstructor): (WebCore::setJSTestGlobalObjectTestNamedAndIndexedSetterNoIdentifierConstructor): (WebCore::jsTestGlobalObjectTestNamedAndIndexedSetterThrowingExceptionConstructor): (WebCore::setJSTestGlobalObjectTestNamedAndIndexedSetterThrowingExceptionConstructor): (WebCore::jsTestGlobalObjectTestNamedAndIndexedSetterWithIdentifierConstructor): (WebCore::setJSTestGlobalObjectTestNamedAndIndexedSetterWithIdentifierConstructor): (WebCore::jsTestGlobalObjectTestNamedDeleterNoIdentifierConstructor): (WebCore::setJSTestGlobalObjectTestNamedDeleterNoIdentifierConstructor): (WebCore::jsTestGlobalObjectTestNamedDeleterThrowingExceptionConstructor): (WebCore::setJSTestGlobalObjectTestNamedDeleterThrowingExceptionConstructor): (WebCore::jsTestGlobalObjectTestNamedDeleterWithIdentifierConstructor): (WebCore::setJSTestGlobalObjectTestNamedDeleterWithIdentifierConstructor): (WebCore::jsTestGlobalObjectTestNamedDeleterWithIndexedGetterConstructor): (WebCore::setJSTestGlobalObjectTestNamedDeleterWithIndexedGetterConstructor): (WebCore::jsTestGlobalObjectTestNamedGetterCallWithConstructor): (WebCore::setJSTestGlobalObjectTestNamedGetterCallWithConstructor): (WebCore::jsTestGlobalObjectTestNamedGetterNoIdentifierConstructor): (WebCore::setJSTestGlobalObjectTestNamedGetterNoIdentifierConstructor): (WebCore::jsTestGlobalObjectTestNamedGetterWithIdentifierConstructor): (WebCore::setJSTestGlobalObjectTestNamedGetterWithIdentifierConstructor): (WebCore::jsTestGlobalObjectTestNamedSetterNoIdentifierConstructor): (WebCore::setJSTestGlobalObjectTestNamedSetterNoIdentifierConstructor): (WebCore::jsTestGlobalObjectTestNamedSetterThrowingExceptionConstructor): (WebCore::setJSTestGlobalObjectTestNamedSetterThrowingExceptionConstructor): (WebCore::jsTestGlobalObjectTestNamedSetterWithIdentifierConstructor): (WebCore::setJSTestGlobalObjectTestNamedSetterWithIdentifierConstructor): (WebCore::jsTestGlobalObjectTestNamedSetterWithIndexedGetterConstructor): (WebCore::setJSTestGlobalObjectTestNamedSetterWithIndexedGetterConstructor): (WebCore::jsTestGlobalObjectTestNamedSetterWithIndexedGetterAndSetterConstructor): (WebCore::setJSTestGlobalObjectTestNamedSetterWithIndexedGetterAndSetterConstructor): (WebCore::jsTestGlobalObjectTestNamedSetterWithLegacyOverrideBuiltInsConstructor): (WebCore::setJSTestGlobalObjectTestNamedSetterWithLegacyOverrideBuiltInsConstructor): (WebCore::jsTestGlobalObjectTestNamedSetterWithLegacyUnforgeablePropertiesConstructor): (WebCore::setJSTestGlobalObjectTestNamedSetterWithLegacyUnforgeablePropertiesConstructor): (WebCore::jsTestGlobalObjectTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltInsConstructor): (WebCore::setJSTestGlobalObjectTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltInsConstructor): (WebCore::jsTestGlobalObjectTestOperationConditionalConstructor): (WebCore::setJSTestGlobalObjectTestOperationConditionalConstructor): (WebCore::jsTestGlobalObjectTestOverloadedConstructorsWithSequenceConstructor): (WebCore::setJSTestGlobalObjectTestOverloadedConstructorsWithSequenceConstructor): (WebCore::jsTestGlobalObjectTestPluginInterfaceConstructor): (WebCore::setJSTestGlobalObjectTestPluginInterfaceConstructor): (WebCore::jsTestGlobalObjectTestReadOnlyMapLikeConstructor): (WebCore::setJSTestGlobalObjectTestReadOnlyMapLikeConstructor): (WebCore::jsTestGlobalObjectTestReadOnlySetLikeConstructor): (WebCore::setJSTestGlobalObjectTestReadOnlySetLikeConstructor): (WebCore::jsTestGlobalObjectTestReportExtraMemoryCostConstructor): (WebCore::setJSTestGlobalObjectTestReportExtraMemoryCostConstructor): (WebCore::jsTestGlobalObjectTestSerializedScriptValueInterfaceConstructor): (WebCore::setJSTestGlobalObjectTestSerializedScriptValueInterfaceConstructor): (WebCore::jsTestGlobalObjectTestSetLikeConstructor): (WebCore::setJSTestGlobalObjectTestSetLikeConstructor): (WebCore::jsTestGlobalObjectTestSetLikeWithOverriddenOperationsConstructor): (WebCore::setJSTestGlobalObjectTestSetLikeWithOverriddenOperationsConstructor): (WebCore::jsTestGlobalObjectTestStringifierConstructor): (WebCore::setJSTestGlobalObjectTestStringifierConstructor): (WebCore::jsTestGlobalObjectTestStringifierAnonymousOperationConstructor): (WebCore::setJSTestGlobalObjectTestStringifierAnonymousOperationConstructor): (WebCore::jsTestGlobalObjectTestStringifierNamedOperationConstructor): (WebCore::setJSTestGlobalObjectTestStringifierNamedOperationConstructor): (WebCore::jsTestGlobalObjectTestStringifierOperationImplementedAsConstructor): (WebCore::setJSTestGlobalObjectTestStringifierOperationImplementedAsConstructor): (WebCore::jsTestGlobalObjectTestStringifierOperationNamedToStringConstructor): (WebCore::setJSTestGlobalObjectTestStringifierOperationNamedToStringConstructor): (WebCore::jsTestGlobalObjectTestStringifierReadOnlyAttributeConstructor): (WebCore::setJSTestGlobalObjectTestStringifierReadOnlyAttributeConstructor): (WebCore::jsTestGlobalObjectTestStringifierReadWriteAttributeConstructor): (WebCore::setJSTestGlobalObjectTestStringifierReadWriteAttributeConstructor): (WebCore::jsTestGlobalObjectTestTypedefsConstructor): (WebCore::setJSTestGlobalObjectTestTypedefsConstructor): (WebCore::jsTestGlobalObjectWorkerGlobalScopeConstructor): (WebCore::setJSTestGlobalObjectWorkerGlobalScopeConstructor): (WebCore::jsTestGlobalObjectWorkletGlobalScopeConstructor): (WebCore::setJSTestGlobalObjectWorkletGlobalScopeConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation): Deleted. (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation): Deleted. (WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStatic): Deleted. (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorld): Deleted. (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabled): Deleted. (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeaturesEnabled): Deleted. (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunction): Deleted. (WebCore::jsTestGlobalObjectInstanceFunctionCalculateSecretResult): Deleted. (WebCore::jsTestGlobalObjectInstanceFunctionGetSecretBoolean): Deleted. (WebCore::jsTestGlobalObjectInstanceFunctionTestFeatureGetSecretBoolean): Deleted. * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: (WebCore::jsTestIndexedSetterNoIdentifierConstructor): (WebCore::setJSTestIndexedSetterNoIdentifierConstructor): * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: (WebCore::jsTestIndexedSetterThrowingExceptionConstructor): (WebCore::setJSTestIndexedSetterThrowingExceptionConstructor): * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: (WebCore::jsTestIndexedSetterWithIdentifierConstructor): (WebCore::setJSTestIndexedSetterWithIdentifierConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter): Deleted. * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::construct): (WebCore::jsTestInterfaceConstructor): (WebCore::setJSTestInterfaceConstructor): (WebCore::jsTestInterfaceMixinReadOnlyAttribute): (WebCore::jsTestInterfaceMixinAttribute): (WebCore::setJSTestInterfaceMixinAttribute): (WebCore::jsTestInterfaceMixinCustomAttribute): (WebCore::setJSTestInterfaceMixinCustomAttribute): (WebCore::jsTestInterfaceMixinNodeAttribute): (WebCore::setJSTestInterfaceMixinNodeAttribute): (WebCore::jsTestInterfacePartialMixinAttributeFromPartial): (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr): (WebCore::jsTestInterfaceConstructorSupplementalStaticAttr): (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr): (WebCore::jsTestInterfaceSupplementalStr1): (WebCore::jsTestInterfaceSupplementalStr2): (WebCore::setJSTestInterfaceSupplementalStr2): (WebCore::jsTestInterfaceSupplementalStr3): (WebCore::setJSTestInterfaceSupplementalStr3): (WebCore::jsTestInterfaceSupplementalNode): (WebCore::setJSTestInterfaceSupplementalNode): (WebCore::jsTestInterfaceReflectAttribute): (WebCore::setJSTestInterfaceReflectAttribute): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestInterfacePrototypeFunctionEntriesCaller): (WebCore::jsTestInterfacePrototypeFunctionMixinOperation): Deleted. (WebCore::jsTestInterfacePrototypeFunctionMixinComplexOperation): Deleted. (WebCore::jsTestInterfacePrototypeFunctionMixinCustomOperation): Deleted. (WebCore::jsTestInterfacePrototypeFunctionMixinConditionalOperation): Deleted. (WebCore::jsTestInterfacePrototypeFunctionMixinSettingsConditionalOperation): Deleted. (WebCore::jsTestInterfacePrototypeFunctionMixinResultFieldOperation): Deleted. (WebCore::jsTestInterfacePrototypeFunctionPartialMixinOperationFromPartial): Deleted. (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1): Deleted. (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2): Deleted. (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod3): Deleted. (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4): Deleted. (WebCore::jsTestInterfacePrototypeFunctionEntries): Deleted. (WebCore::jsTestInterfacePrototypeFunctionKeys): Deleted. (WebCore::jsTestInterfacePrototypeFunctionValues): Deleted. (WebCore::jsTestInterfacePrototypeFunctionForEach): Deleted. * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: (WebCore::jsTestInterfaceLeadingUnderscoreConstructor): (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor): (WebCore::jsTestInterfaceLeadingUnderscoreReadonly): * bindings/scripts/test/JS/JSTestIterable.cpp: (WebCore::jsTestIterableConstructor): (WebCore::setJSTestIterableConstructor): (WebCore::jsTestIterablePrototypeFunctionEntriesCaller): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestIterablePrototypeFunctionEntries): Deleted. (WebCore::jsTestIterablePrototypeFunctionKeys): Deleted. (WebCore::jsTestIterablePrototypeFunctionValues): Deleted. (WebCore::jsTestIterablePrototypeFunctionForEach): Deleted. * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: (WebCore::jsTestJSBuiltinConstructorConstructor): (WebCore::setJSTestJSBuiltinConstructorConstructor): (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom): (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom): (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestJSBuiltinConstructorPrototypeFunctionTestCustomFunction): Deleted. * bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp: (WebCore::JSTestLegacyFactoryFunctionLegacyFactoryFunction::construct): (WebCore::jsTestLegacyFactoryFunctionConstructor): (WebCore::setJSTestLegacyFactoryFunctionConstructor): * bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.cpp: (WebCore::JSTestLegacyNoInterfaceObjectPrototype::finishCreation): (WebCore::jsTestLegacyNoInterfaceObjectReadonlyStringAttribute): (WebCore::jsTestLegacyNoInterfaceObjectReadWriteStringAttribute): (WebCore::setJSTestLegacyNoInterfaceObjectReadWriteStringAttribute): (WebCore::jsTestLegacyNoInterfaceObjectCustomGetterSetterStringAttribute): (WebCore::setJSTestLegacyNoInterfaceObjectCustomGetterSetterStringAttribute): (WebCore::jsTestLegacyNoInterfaceObjectNodeAttribute): (WebCore::setJSTestLegacyNoInterfaceObjectNodeAttribute): (WebCore::jsTestLegacyNoInterfaceObjectConstructorStaticStringAttribute): (WebCore::setJSTestLegacyNoInterfaceObjectConstructorStaticStringAttribute): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestLegacyNoInterfaceObjectPrototypeFunctionVoidOperation): Deleted. (WebCore::jsTestLegacyNoInterfaceObjectPrototypeFunctionThrowingOperation): Deleted. (WebCore::jsTestLegacyNoInterfaceObjectPrototypeFunctionCustomOperation): Deleted. (WebCore::jsTestLegacyNoInterfaceObjectConstructorFunctionStaticOperation): Deleted. * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.cpp: (WebCore::jsTestLegacyOverrideBuiltInsConstructor): (WebCore::setJSTestLegacyOverrideBuiltInsConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestLegacyOverrideBuiltInsPrototypeFunctionNamedItem): Deleted. * bindings/scripts/test/JS/JSTestMapLike.cpp: (WebCore::jsTestMapLikeConstructor): (WebCore::setJSTestMapLikeConstructor): (WebCore::jsTestMapLikeSize): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestMapLikePrototypeFunctionGet): Deleted. (WebCore::jsTestMapLikePrototypeFunctionHas): Deleted. (WebCore::jsTestMapLikePrototypeFunctionEntries): Deleted. (WebCore::jsTestMapLikePrototypeFunctionKeys): Deleted. (WebCore::jsTestMapLikePrototypeFunctionValues): Deleted. (WebCore::jsTestMapLikePrototypeFunctionForEach): Deleted. (WebCore::jsTestMapLikePrototypeFunctionSet): Deleted. (WebCore::jsTestMapLikePrototypeFunctionClear): Deleted. (WebCore::jsTestMapLikePrototypeFunctionDelete): Deleted. * bindings/scripts/test/JS/JSTestMapLikeWithOverriddenOperations.cpp: (WebCore::jsTestMapLikeWithOverriddenOperationsConstructor): (WebCore::setJSTestMapLikeWithOverriddenOperationsConstructor): (WebCore::jsTestMapLikeWithOverriddenOperationsSet): (WebCore::setJSTestMapLikeWithOverriddenOperationsSet): (WebCore::jsTestMapLikeWithOverriddenOperationsSize): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestMapLikeWithOverriddenOperationsPrototypeFunctionClear): Deleted. (WebCore::jsTestMapLikeWithOverriddenOperationsPrototypeFunctionGet): Deleted. (WebCore::jsTestMapLikeWithOverriddenOperationsPrototypeFunctionHas): Deleted. (WebCore::jsTestMapLikeWithOverriddenOperationsPrototypeFunctionEntries): Deleted. (WebCore::jsTestMapLikeWithOverriddenOperationsPrototypeFunctionKeys): Deleted. (WebCore::jsTestMapLikeWithOverriddenOperationsPrototypeFunctionValues): Deleted. (WebCore::jsTestMapLikeWithOverriddenOperationsPrototypeFunctionForEach): Deleted. (WebCore::jsTestMapLikeWithOverriddenOperationsPrototypeFunctionDelete): Deleted. * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: (WebCore::jsTestNamedAndIndexedSetterNoIdentifierConstructor): (WebCore::setJSTestNamedAndIndexedSetterNoIdentifierConstructor): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: (WebCore::jsTestNamedAndIndexedSetterThrowingExceptionConstructor): (WebCore::setJSTestNamedAndIndexedSetterThrowingExceptionConstructor): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: (WebCore::jsTestNamedAndIndexedSetterWithIdentifierConstructor): (WebCore::setJSTestNamedAndIndexedSetterWithIdentifierConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetter): Deleted. (WebCore::jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter): Deleted. * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: (WebCore::jsTestNamedDeleterNoIdentifierConstructor): (WebCore::setJSTestNamedDeleterNoIdentifierConstructor): * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: (WebCore::jsTestNamedDeleterThrowingExceptionConstructor): (WebCore::setJSTestNamedDeleterThrowingExceptionConstructor): * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: (WebCore::jsTestNamedDeleterWithIdentifierConstructor): (WebCore::setJSTestNamedDeleterWithIdentifierConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestNamedDeleterWithIdentifierPrototypeFunctionNamedDeleter): Deleted. * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: (WebCore::jsTestNamedDeleterWithIndexedGetterConstructor): (WebCore::setJSTestNamedDeleterWithIndexedGetterConstructor): * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: (WebCore::jsTestNamedGetterCallWithConstructor): (WebCore::setJSTestNamedGetterCallWithConstructor): * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: (WebCore::jsTestNamedGetterNoIdentifierConstructor): (WebCore::setJSTestNamedGetterNoIdentifierConstructor): * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: (WebCore::jsTestNamedGetterWithIdentifierConstructor): (WebCore::setJSTestNamedGetterWithIdentifierConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestNamedGetterWithIdentifierPrototypeFunctionGetterName): Deleted. * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: (WebCore::jsTestNamedSetterNoIdentifierConstructor): (WebCore::setJSTestNamedSetterNoIdentifierConstructor): * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: (WebCore::jsTestNamedSetterThrowingExceptionConstructor): (WebCore::setJSTestNamedSetterThrowingExceptionConstructor): * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: (WebCore::jsTestNamedSetterWithIdentifierConstructor): (WebCore::setJSTestNamedSetterWithIdentifierConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestNamedSetterWithIdentifierPrototypeFunctionNamedSetter): Deleted. * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: (WebCore::jsTestNamedSetterWithIndexedGetterConstructor): (WebCore::setJSTestNamedSetterWithIndexedGetterConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestNamedSetterWithIndexedGetterPrototypeFunctionNamedSetter): Deleted. (WebCore::jsTestNamedSetterWithIndexedGetterPrototypeFunctionIndexedSetter): Deleted. * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterConstructor): (WebCore::setJSTestNamedSetterWithIndexedGetterAndSetterConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionNamedSetter): Deleted. (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionIndexedSetter): Deleted. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyOverrideBuiltIns.cpp: (WebCore::jsTestNamedSetterWithLegacyOverrideBuiltInsConstructor): (WebCore::setJSTestNamedSetterWithLegacyOverrideBuiltInsConstructor): * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp: (WebCore::JSTestNamedSetterWithLegacyUnforgeablePropertiesConstructor::prototypeForStructure): (WebCore::jsTestNamedSetterWithLegacyUnforgeablePropertiesConstructor): (WebCore::setJSTestNamedSetterWithLegacyUnforgeablePropertiesConstructor): (WebCore::jsTestNamedSetterWithLegacyUnforgeablePropertiesUnforgeableAttribute): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestNamedSetterWithLegacyUnforgeablePropertiesInstanceFunctionUnforgeableOperation): Deleted. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp: (WebCore::JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltInsConstructor::prototypeForStructure): (WebCore::jsTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltInsConstructor): (WebCore::setJSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltInsConstructor): (WebCore::jsTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltInsUnforgeableAttribute): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltInsInstanceFunctionUnforgeableOperation): Deleted. * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::JSTestNodeConstructor::construct): (WebCore::jsTestNodeConstructor): (WebCore::setJSTestNodeConstructor): (WebCore::jsTestNodeName): (WebCore::setJSTestNodeName): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestNodePrototypeFunctionEntriesCaller): (WebCore::jsTestNodePrototypeFunctionTestWorkerPromise): Deleted. (WebCore::jsTestNodePrototypeFunctionCalculateSecretResult): Deleted. (WebCore::jsTestNodePrototypeFunctionGetSecretBoolean): Deleted. (WebCore::jsTestNodePrototypeFunctionTestFeatureGetSecretBoolean): Deleted. (WebCore::jsTestNodePrototypeFunctionToJSON): Deleted. (WebCore::jsTestNodePrototypeFunctionEntries): Deleted. (WebCore::jsTestNodePrototypeFunctionKeys): Deleted. (WebCore::jsTestNodePrototypeFunctionValues): Deleted. (WebCore::jsTestNodePrototypeFunctionForEach): Deleted. * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::construct): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestObjConstructor): (WebCore::setJSTestObjConstructor): (WebCore::jsTestObjReadOnlyLongAttr): (WebCore::jsTestObjReadOnlyStringAttr): (WebCore::jsTestObjReadOnlyTestObjAttr): (WebCore::jsTestObjConstructorStaticReadOnlyLongAttr): (WebCore::jsTestObjConstructorStaticStringAttr): (WebCore::setJSTestObjConstructorStaticStringAttr): (WebCore::jsTestObjConstructorTestSubObj): (WebCore::jsTestObjConstructorTestStaticReadonlyObj): (WebCore::jsTestObjEnumAttr): (WebCore::setJSTestObjEnumAttr): (WebCore::jsTestObjByteAttr): (WebCore::setJSTestObjByteAttr): (WebCore::jsTestObjOctetAttr): (WebCore::setJSTestObjOctetAttr): (WebCore::jsTestObjShortAttr): (WebCore::setJSTestObjShortAttr): (WebCore::jsTestObjClampedShortAttr): (WebCore::setJSTestObjClampedShortAttr): (WebCore::jsTestObjEnforceRangeShortAttr): (WebCore::setJSTestObjEnforceRangeShortAttr): (WebCore::jsTestObjUnsignedShortAttr): (WebCore::setJSTestObjUnsignedShortAttr): (WebCore::jsTestObjLongAttr): (WebCore::setJSTestObjLongAttr): (WebCore::jsTestObjLongLongAttr): (WebCore::setJSTestObjLongLongAttr): (WebCore::jsTestObjUnsignedLongLongAttr): (WebCore::setJSTestObjUnsignedLongLongAttr): (WebCore::jsTestObjStringAttr): (WebCore::setJSTestObjStringAttr): (WebCore::jsTestObjUsvstringAttr): (WebCore::setJSTestObjUsvstringAttr): (WebCore::jsTestObjTestObjAttr): (WebCore::setJSTestObjTestObjAttr): (WebCore::jsTestObjTestNullableObjAttr): (WebCore::setJSTestObjTestNullableObjAttr): (WebCore::jsTestObjLenientTestObjAttr): (WebCore::setJSTestObjLenientTestObjAttr): (WebCore::jsTestObjUnforgeableAttr): (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString): (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString): (WebCore::setJSTestObjUsvstringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjByteStringAttrTreatingNullAsEmptyString): (WebCore::setJSTestObjByteStringAttrTreatingNullAsEmptyString): (WebCore::jsTestObjStringLongRecordAttr): (WebCore::setJSTestObjStringLongRecordAttr): (WebCore::jsTestObjUsvstringLongRecordAttr): (WebCore::setJSTestObjUsvstringLongRecordAttr): (WebCore::jsTestObjStringObjRecordAttr): (WebCore::setJSTestObjStringObjRecordAttr): (WebCore::jsTestObjStringNullableObjRecordAttr): (WebCore::setJSTestObjStringNullableObjRecordAttr): (WebCore::jsTestObjStringVoidCallbackRecordAttr): (WebCore::setJSTestObjStringVoidCallbackRecordAttr): (WebCore::jsTestObjDictionaryAttr): (WebCore::setJSTestObjDictionaryAttr): (WebCore::jsTestObjNullableDictionaryAttr): (WebCore::setJSTestObjNullableDictionaryAttr): (WebCore::jsTestObjAnnotatedTypeInUnionAttr): (WebCore::setJSTestObjAnnotatedTypeInUnionAttr): (WebCore::jsTestObjAnnotatedTypeInSequenceAttr): (WebCore::setJSTestObjAnnotatedTypeInSequenceAttr): (WebCore::jsTestObjImplementationEnumAttr): (WebCore::setJSTestObjImplementationEnumAttr): (WebCore::jsTestObjMediaDevices): (WebCore::jsTestObjXMLObjAttr): (WebCore::setJSTestObjXMLObjAttr): (WebCore::jsTestObjCreate): (WebCore::setJSTestObjCreate): (WebCore::jsTestObjReflectedStringAttr): (WebCore::setJSTestObjReflectedStringAttr): (WebCore::jsTestObjReflectedUSVStringAttr): (WebCore::setJSTestObjReflectedUSVStringAttr): (WebCore::jsTestObjReflectedIntegralAttr): (WebCore::setJSTestObjReflectedIntegralAttr): (WebCore::jsTestObjReflectedUnsignedIntegralAttr): (WebCore::setJSTestObjReflectedUnsignedIntegralAttr): (WebCore::jsTestObjReflectedBooleanAttr): (WebCore::setJSTestObjReflectedBooleanAttr): (WebCore::jsTestObjReflectedURLAttr): (WebCore::setJSTestObjReflectedURLAttr): (WebCore::jsTestObjReflectedUSVURLAttr): (WebCore::setJSTestObjReflectedUSVURLAttr): (WebCore::jsTestObjReflectedCustomIntegralAttr): (WebCore::setJSTestObjReflectedCustomIntegralAttr): (WebCore::jsTestObjReflectedCustomBooleanAttr): (WebCore::setJSTestObjReflectedCustomBooleanAttr): (WebCore::jsTestObjReflectedCustomURLAttr): (WebCore::setJSTestObjReflectedCustomURLAttr): (WebCore::jsTestObjEnabledAtRuntimeAttribute): (WebCore::setJSTestObjEnabledAtRuntimeAttribute): (WebCore::jsTestObjConstructorEnabledAtRuntimeAttributeStatic): (WebCore::setJSTestObjConstructorEnabledAtRuntimeAttributeStatic): (WebCore::jsTestObjTypedArrayAttr): (WebCore::setJSTestObjTypedArrayAttr): (WebCore::jsTestObjCustomAttr): (WebCore::setJSTestObjCustomAttr): (WebCore::jsTestObjOnfoo): (WebCore::setJSTestObjOnfoo): (WebCore::jsTestObjOnwebkitfoo): (WebCore::setJSTestObjOnwebkitfoo): (WebCore::jsTestObjWithExecStateAttribute): (WebCore::setJSTestObjWithExecStateAttribute): (WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute): (WebCore::setJSTestObjWithCallWithAndSetterCallWithAttribute): (WebCore::jsTestObjWithScriptExecutionContextAttribute): (WebCore::setJSTestObjWithScriptExecutionContextAttribute): (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttribute): (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttribute): (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute): (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute): (WebCore::jsTestObjConditionalAttr1): (WebCore::setJSTestObjConditionalAttr1): (WebCore::jsTestObjConditionalAttr2): (WebCore::setJSTestObjConditionalAttr2): (WebCore::jsTestObjConditionalAttr3): (WebCore::setJSTestObjConditionalAttr3): (WebCore::jsTestObjConditionalAttr4Constructor): (WebCore::setJSTestObjConditionalAttr4Constructor): (WebCore::jsTestObjConditionalAttr5Constructor): (WebCore::setJSTestObjConditionalAttr5Constructor): (WebCore::jsTestObjConditionalAttr6Constructor): (WebCore::setJSTestObjConditionalAttr6Constructor): (WebCore::jsTestObjCachedAttribute1): (WebCore::jsTestObjCachedAttribute2): (WebCore::jsTestObjCachedAttribute3): (WebCore::jsTestObjAnyAttribute): (WebCore::setJSTestObjAnyAttribute): (WebCore::jsTestObjObjectAttribute): (WebCore::setJSTestObjObjectAttribute): (WebCore::jsTestObjContentDocument): (WebCore::jsTestObjMutablePoint): (WebCore::setJSTestObjMutablePoint): (WebCore::jsTestObjStrawberry): (WebCore::setJSTestObjStrawberry): (WebCore::jsTestObjDescription): (WebCore::jsTestObjId): (WebCore::setJSTestObjId): (WebCore::jsTestObjHash): (WebCore::jsTestObjReplaceableAttribute): (WebCore::setJSTestObjReplaceableAttribute): (WebCore::jsTestObjNullableDoubleAttribute): (WebCore::jsTestObjNullableLongAttribute): (WebCore::jsTestObjNullableBooleanAttribute): (WebCore::jsTestObjNullableStringAttribute): (WebCore::jsTestObjNullableLongSettableAttribute): (WebCore::setJSTestObjNullableLongSettableAttribute): (WebCore::jsTestObjNullableStringSettableAttribute): (WebCore::setJSTestObjNullableStringSettableAttribute): (WebCore::jsTestObjNullableUSVStringSettableAttribute): (WebCore::setJSTestObjNullableUSVStringSettableAttribute): (WebCore::jsTestObjNullableByteStringSettableAttribute): (WebCore::setJSTestObjNullableByteStringSettableAttribute): (WebCore::jsTestObjAttribute): (WebCore::jsTestObjAttributeWithReservedEnumType): (WebCore::setJSTestObjAttributeWithReservedEnumType): (WebCore::jsTestObjTestReadOnlyVoidPromiseAttribute): (WebCore::jsTestObjTestReadOnlyPromiseAttribute): (WebCore::jsTestObjPutForwardsAttribute): (WebCore::setJSTestObjPutForwardsAttribute): (WebCore::jsTestObjPutForwardsNullableAttribute): (WebCore::setJSTestObjPutForwardsNullableAttribute): (WebCore::jsTestObjStringifierAttribute): (WebCore::setJSTestObjStringifierAttribute): (WebCore::jsTestObjConditionallyExposedToWindowAttribute): (WebCore::setJSTestObjConditionallyExposedToWindowAttribute): (WebCore::jsTestObjConditionallyExposedToWorkerAttribute): (WebCore::setJSTestObjConditionallyExposedToWorkerAttribute): (WebCore::jsTestObjConditionallyExposedToWindowAndWorkerAttribute): (WebCore::setJSTestObjConditionallyExposedToWindowAndWorkerAttribute): (WebCore::callJSTestObj): Deleted. (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation): Deleted. (WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStatic): Deleted. (WebCore::jsTestObjPrototypeFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabled): Deleted. (WebCore::jsTestObjPrototypeFunctionWorldSpecificMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionCalculateSecretResult): Deleted. (WebCore::jsTestObjPrototypeFunctionGetSecretBoolean): Deleted. (WebCore::jsTestObjPrototypeFunctionTestFeatureGetSecretBoolean): Deleted. (WebCore::jsTestObjPrototypeFunctionUndefinedMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionUndefinedMethodWithArgs): Deleted. (WebCore::jsTestObjPrototypeFunctionByteMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs): Deleted. (WebCore::jsTestObjPrototypeFunctionOctetMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs): Deleted. (WebCore::jsTestObjPrototypeFunctionLongMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs): Deleted. (WebCore::jsTestObjPrototypeFunctionObjMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs): Deleted. (WebCore::jsTestObjInstanceFunctionUnforgeableMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter): Deleted. (WebCore::jsTestObjPrototypeFunctionNullableStringMethod): Deleted. (WebCore::jsTestObjConstructorFunctionNullableStringStaticMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArg): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArg): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithByteStringArg): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithNullableByteStringArg): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithByteStringArgTreatingNullAsEmptyString): Deleted. (WebCore::jsTestObjPrototypeFunctionSerializedValue): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithRecord): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithException): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionReturningLong): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionReturningObject): Deleted. (WebCore::jsTestObjPrototypeFunctionCustomMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionCustomMethodWithArgs): Deleted. (WebCore::jsTestObjPrototypeFunctionPrivateMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionAddEventListener): Deleted. (WebCore::jsTestObjPrototypeFunctionRemoveEventListener): Deleted. (WebCore::jsTestObjPrototypeFunctionWithExecStateVoid): Deleted. (WebCore::jsTestObjPrototypeFunctionWithExecStateObj): Deleted. (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidException): Deleted. (WebCore::jsTestObjPrototypeFunctionWithExecStateObjException): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecState): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjException): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpaces): Deleted. (WebCore::jsTestObjPrototypeFunctionWithDocumentArgument): Deleted. (WebCore::jsTestObjPrototypeFunctionWithCallerDocumentArgument): Deleted. (WebCore::jsTestObjPrototypeFunctionWithCallerWindowArgument): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVString): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomString): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringAndDefaultValue): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNull): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringIsNull): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyString): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyString): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringIsEmptyString): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLong): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZero): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLong): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZero): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAny): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalObject): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapper): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperIsNull): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalRecord): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromise): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArg): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionAndOptionalArg): Deleted. (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArg): Deleted. (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg): Deleted. (WebCore::jsTestObjPrototypeFunctionConditionalMethod1): Deleted. (WebCore::jsTestObjPrototypeFunctionConditionalMethod2): Deleted. (WebCore::jsTestObjPrototypeFunctionConditionalMethod3): Deleted. (WebCore::jsTestObjPrototypeFunctionOverloadedMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter): Deleted. (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnion): Deleted. (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnions): Deleted. (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnion): Deleted. (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion): Deleted. (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion): Deleted. (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter): Deleted. (WebCore::jsTestObjConstructorFunctionClassMethod): Deleted. (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional): Deleted. (WebCore::jsTestObjConstructorFunctionClassMethod2): Deleted. (WebCore::jsTestObjConstructorFunctionOverloadedMethod1): Deleted. (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp): Deleted. (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampOnOptional): Deleted. (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange): Deleted. (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeOnOptional): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence): Deleted. (WebCore::jsTestObjPrototypeFunctionStringArrayFunction): Deleted. (WebCore::jsTestObjPrototypeFunctionDomStringListFunction): Deleted. (WebCore::jsTestObjPrototypeFunctionOperationWithOptionalUnionParameter): Deleted. (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence): Deleted. (WebCore::jsTestObjPrototypeFunctionGetElementById): Deleted. (WebCore::jsTestObjPrototypeFunctionGetSVGDocument): Deleted. (WebCore::jsTestObjPrototypeFunctionConvert1): Deleted. (WebCore::jsTestObjPrototypeFunctionConvert2): Deleted. (WebCore::jsTestObjPrototypeFunctionConvert3): Deleted. (WebCore::jsTestObjPrototypeFunctionConvert4): Deleted. (WebCore::jsTestObjPrototypeFunctionMutablePointFunction): Deleted. (WebCore::jsTestObjPrototypeFunctionOrange): Deleted. (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionVariadicUnionMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionAny): Deleted. (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction): Deleted. (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument): Deleted. (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException): Deleted. (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument): Deleted. (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction): Deleted. (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunction): Deleted. (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException): Deleted. (WebCore::jsTestObjPrototypeFunctionTestCustomPromiseFunction): Deleted. (WebCore::jsTestObjConstructorFunctionTestStaticCustomPromiseFunction): Deleted. (WebCore::jsTestObjPrototypeFunctionTestCustomReturnsOwnPromiseFunction): Deleted. (WebCore::jsTestObjPrototypeFunctionTestReturnsOwnPromiseAndPromiseProxyFunction): Deleted. (WebCore::jsTestObjPrototypeFunctionConditionalOverload): Deleted. (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload): Deleted. (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot): Deleted. (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameter): Deleted. (WebCore::jsTestObjPrototypeFunctionBufferSourceParameter): Deleted. (WebCore::jsTestObjPrototypeFunctionLegacyCallerNamed): Deleted. (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimization): Deleted. (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithException): Deleted. (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWindowFunction): Deleted. (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWorkerFunction): Deleted. (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWindowAndWorkerFunction): Deleted. (WebCore::jsTestObjPrototypeFunctionToString): Deleted. * bindings/scripts/test/JS/JSTestOperationConditional.cpp: (WebCore::jsTestOperationConditionalConstructor): (WebCore::setJSTestOperationConditionalConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestOperationConditionalPrototypeFunctionNonConditionalOperation): Deleted. (WebCore::jsTestOperationConditionalPrototypeFunctionConditionalOperation): Deleted. * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: (WebCore::JSTestOverloadedConstructorsConstructor::construct): (WebCore::jsTestOverloadedConstructorsConstructor): (WebCore::setJSTestOverloadedConstructorsConstructor): * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: (WebCore::JSTestOverloadedConstructorsWithSequenceConstructor::construct): (WebCore::jsTestOverloadedConstructorsWithSequenceConstructor): (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor): * bindings/scripts/test/JS/JSTestPluginInterface.cpp: (WebCore::jsTestPluginInterfaceConstructor): (WebCore::setJSTestPluginInterfaceConstructor): * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: (WebCore::JSTestPromiseRejectionEventConstructor::construct): (WebCore::jsTestPromiseRejectionEventConstructor): (WebCore::setJSTestPromiseRejectionEventConstructor): (WebCore::jsTestPromiseRejectionEventPromise): (WebCore::jsTestPromiseRejectionEventReason): * bindings/scripts/test/JS/JSTestReadOnlyMapLike.cpp: (WebCore::jsTestReadOnlyMapLikeConstructor): (WebCore::setJSTestReadOnlyMapLikeConstructor): (WebCore::jsTestReadOnlyMapLikeSize): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestReadOnlyMapLikePrototypeFunctionGet): Deleted. (WebCore::jsTestReadOnlyMapLikePrototypeFunctionHas): Deleted. (WebCore::jsTestReadOnlyMapLikePrototypeFunctionEntries): Deleted. (WebCore::jsTestReadOnlyMapLikePrototypeFunctionKeys): Deleted. (WebCore::jsTestReadOnlyMapLikePrototypeFunctionValues): Deleted. (WebCore::jsTestReadOnlyMapLikePrototypeFunctionForEach): Deleted. * bindings/scripts/test/JS/JSTestReadOnlySetLike.cpp: (WebCore::jsTestReadOnlySetLikeConstructor): (WebCore::setJSTestReadOnlySetLikeConstructor): (WebCore::jsTestReadOnlySetLikeSize): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestReadOnlySetLikePrototypeFunctionHas): Deleted. (WebCore::jsTestReadOnlySetLikePrototypeFunctionEntries): Deleted. (WebCore::jsTestReadOnlySetLikePrototypeFunctionKeys): Deleted. (WebCore::jsTestReadOnlySetLikePrototypeFunctionValues): Deleted. (WebCore::jsTestReadOnlySetLikePrototypeFunctionForEach): Deleted. * bindings/scripts/test/JS/JSTestReportExtraMemoryCost.cpp: (WebCore::jsTestReportExtraMemoryCostConstructor): (WebCore::setJSTestReportExtraMemoryCostConstructor): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::jsTestSerializedScriptValueInterfaceConstructor): (WebCore::setJSTestSerializedScriptValueInterfaceConstructor): (WebCore::jsTestSerializedScriptValueInterfaceValue): (WebCore::setJSTestSerializedScriptValueInterfaceValue): (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue): (WebCore::jsTestSerializedScriptValueInterfaceCachedValue): (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue): (WebCore::jsTestSerializedScriptValueInterfacePorts): (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionFunction): Deleted. (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturning): Deleted. * bindings/scripts/test/JS/JSTestSetLike.cpp: (WebCore::jsTestSetLikeConstructor): (WebCore::setJSTestSetLikeConstructor): (WebCore::jsTestSetLikeSize): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestSetLikePrototypeFunctionHas): Deleted. (WebCore::jsTestSetLikePrototypeFunctionEntries): Deleted. (WebCore::jsTestSetLikePrototypeFunctionKeys): Deleted. (WebCore::jsTestSetLikePrototypeFunctionValues): Deleted. (WebCore::jsTestSetLikePrototypeFunctionForEach): Deleted. (WebCore::jsTestSetLikePrototypeFunctionAdd): Deleted. (WebCore::jsTestSetLikePrototypeFunctionClear): Deleted. (WebCore::jsTestSetLikePrototypeFunctionDelete): Deleted. * bindings/scripts/test/JS/JSTestSetLikeWithOverriddenOperations.cpp: (WebCore::jsTestSetLikeWithOverriddenOperationsConstructor): (WebCore::setJSTestSetLikeWithOverriddenOperationsConstructor): (WebCore::jsTestSetLikeWithOverriddenOperationsAdd): (WebCore::setJSTestSetLikeWithOverriddenOperationsAdd): (WebCore::jsTestSetLikeWithOverriddenOperationsSize): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestSetLikeWithOverriddenOperationsPrototypeFunctionDelete): Deleted. (WebCore::jsTestSetLikeWithOverriddenOperationsPrototypeFunctionHas): Deleted. (WebCore::jsTestSetLikeWithOverriddenOperationsPrototypeFunctionEntries): Deleted. (WebCore::jsTestSetLikeWithOverriddenOperationsPrototypeFunctionKeys): Deleted. (WebCore::jsTestSetLikeWithOverriddenOperationsPrototypeFunctionValues): Deleted. (WebCore::jsTestSetLikeWithOverriddenOperationsPrototypeFunctionForEach): Deleted. (WebCore::jsTestSetLikeWithOverriddenOperationsPrototypeFunctionClear): Deleted. * bindings/scripts/test/JS/JSTestStringifier.cpp: (WebCore::jsTestStringifierConstructor): (WebCore::setJSTestStringifierConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestStringifierPrototypeFunctionToString): Deleted. * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: (WebCore::jsTestStringifierAnonymousOperationConstructor): (WebCore::setJSTestStringifierAnonymousOperationConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestStringifierAnonymousOperationPrototypeFunctionToString): Deleted. * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: (WebCore::jsTestStringifierNamedOperationConstructor): (WebCore::setJSTestStringifierNamedOperationConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestStringifierNamedOperationPrototypeFunctionIdentifier): Deleted. (WebCore::jsTestStringifierNamedOperationPrototypeFunctionToString): Deleted. * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: (WebCore::jsTestStringifierOperationImplementedAsConstructor): (WebCore::setJSTestStringifierOperationImplementedAsConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestStringifierOperationImplementedAsPrototypeFunctionIdentifier): Deleted. (WebCore::jsTestStringifierOperationImplementedAsPrototypeFunctionToString): Deleted. * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: (WebCore::jsTestStringifierOperationNamedToStringConstructor): (WebCore::setJSTestStringifierOperationNamedToStringConstructor): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestStringifierOperationNamedToStringPrototypeFunctionToString): Deleted. * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: (WebCore::jsTestStringifierReadOnlyAttributeConstructor): (WebCore::setJSTestStringifierReadOnlyAttributeConstructor): (WebCore::jsTestStringifierReadOnlyAttributeIdentifier): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestStringifierReadOnlyAttributePrototypeFunctionToString): Deleted. * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: (WebCore::jsTestStringifierReadWriteAttributeConstructor): (WebCore::setJSTestStringifierReadWriteAttributeConstructor): (WebCore::jsTestStringifierReadWriteAttributeIdentifier): (WebCore::setJSTestStringifierReadWriteAttributeIdentifier): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestStringifierReadWriteAttributePrototypeFunctionToString): Deleted. * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::JSTestTypedefsConstructor::construct): (WebCore::jsTestTypedefsConstructor): (WebCore::setJSTestTypedefsConstructor): (WebCore::jsTestTypedefsUnsignedLongLongAttr): (WebCore::setJSTestTypedefsUnsignedLongLongAttr): (WebCore::jsTestTypedefsSerializedScriptValue): (WebCore::setJSTestTypedefsSerializedScriptValue): (WebCore::jsTestTypedefsConstructorTestSubObj): (WebCore::jsTestTypedefsAttributeWithClamp): (WebCore::setJSTestTypedefsAttributeWithClamp): (WebCore::jsTestTypedefsAttributeWithClampInTypedef): (WebCore::setJSTestTypedefsAttributeWithClampInTypedef): (WebCore::jsTestTypedefsBufferSourceAttr): (WebCore::setJSTestTypedefsBufferSourceAttr): (WebCore::jsTestTypedefsDomTimeStampAttr): (WebCore::setJSTestTypedefsDomTimeStampAttr): (WebCore::JSC_DEFINE_HOST_FUNCTION): (WebCore::jsTestTypedefsPrototypeFunctionFunc): Deleted. (WebCore::jsTestTypedefsPrototypeFunctionSetShadow): Deleted. (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg): Deleted. (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg): Deleted. (WebCore::jsTestTypedefsPrototypeFunctionSequenceOfNullablesArg): Deleted. (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArg): Deleted. (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArg): Deleted. (WebCore::jsTestTypedefsPrototypeFunctionUnionArg): Deleted. (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp): Deleted. (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampInTypedef): Deleted. (WebCore::jsTestTypedefsPrototypeFunctionPointFunction): Deleted. (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction): Deleted. (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2): Deleted. (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude): Deleted. (WebCore::jsTestTypedefsPrototypeFunctionMethodWithException): Deleted. * bindings/scripts/test/JS/JSWorkerGlobalScope.cpp: (WebCore::jsWorkerGlobalScopeConstructor): (WebCore::setJSWorkerGlobalScopeConstructor): (WebCore::jsWorkerGlobalScopeExposedToWorkerAndWindowConstructor): (WebCore::setJSWorkerGlobalScopeExposedToWorkerAndWindowConstructor): (WebCore::jsWorkerGlobalScopeTestDefaultToJSONFilteredByExposedConstructor): (WebCore::setJSWorkerGlobalScopeTestDefaultToJSONFilteredByExposedConstructor): (WebCore::jsWorkerGlobalScopeTestNodeConstructor): (WebCore::setJSWorkerGlobalScopeTestNodeConstructor): (WebCore::jsWorkerGlobalScopeTestObjectConstructor): (WebCore::setJSWorkerGlobalScopeTestObjectConstructor): (WebCore::jsWorkerGlobalScopeTestPromiseRejectionEventConstructor): (WebCore::setJSWorkerGlobalScopeTestPromiseRejectionEventConstructor): * bindings/scripts/test/JS/JSWorkletGlobalScope.cpp: (WebCore::jsWorkletGlobalScopeConstructor): (WebCore::setJSWorkletGlobalScopeConstructor): * bridge/objc/objc_runtime.mm: (JSC::Bindings::JSC_DEFINE_HOST_FUNCTION): (JSC::Bindings::callObjCFallbackObject): Deleted. * bridge/runtime_array.cpp: (JSC::arrayLengthGetter): (JSC::RuntimeArray::getOwnPropertySlot): (JSC::RuntimeArray::lengthGetter): Deleted. * bridge/runtime_array.h: * bridge/runtime_method.cpp: (JSC::methodLengthGetter): (JSC::RuntimeMethod::getOwnPropertySlot): (JSC::JSC_DEFINE_HOST_FUNCTION): (JSC::RuntimeMethod::lengthGetter): Deleted. (JSC::callRuntimeMethod): Deleted. * bridge/runtime_method.h: * bridge/runtime_object.cpp: (JSC::Bindings::fallbackObjectGetter): (JSC::Bindings::fieldGetter): (JSC::Bindings::methodGetter): (JSC::Bindings::RuntimeObject::getOwnPropertySlot): (JSC::Bindings::RuntimeObject::put): (JSC::Bindings::RuntimeObject::defaultValue): (JSC::Bindings::JSC_DEFINE_HOST_FUNCTION): (JSC::Bindings::RuntimeObject::getOwnPropertyNames): (JSC::Bindings::throwRuntimeObjectInvalidAccessError): (JSC::Bindings::RuntimeObject::fallbackObjectGetter): Deleted. (JSC::Bindings::RuntimeObject::fieldGetter): Deleted. (JSC::Bindings::RuntimeObject::methodGetter): Deleted. (JSC::Bindings::callRuntimeObject): Deleted. (JSC::Bindings::callRuntimeConstructor): Deleted. (JSC::Bindings::RuntimeObject::throwInvalidAccessError): Deleted. * bridge/runtime_object.h: 2020-09-25 Chris Dumez <cdumez@apple.com> Unreviewed, reverting r267589. Broke document.visibilityState when coming out of back/forward cache Reverted changeset: "visibilitychange:hidden doesn't fire during page navigations" https://bugs.webkit.org/show_bug.cgi?id=151234 https://trac.webkit.org/changeset/267589 2020-09-25 Antoine Quint <graouts@webkit.org> Add an experimental feature flag for CSS individual transform properties https://bugs.webkit.org/show_bug.cgi?id=216271 <rdar://problem/68914539> Reviewed by Dean Jackson. * page/Settings.yaml: 2020-09-25 Chris Dumez <cdumez@apple.com> Get rid of AudioNode::RefType https://bugs.webkit.org/show_bug.cgi?id=216945 Reviewed by Darin Adler. Previously, the node had ref()/deref() function taking a RefType parameter. The RefType would be used to determine which counter should be incremented or decremented: either m_normalRefCount or m_connectionRefCount. In a previous patch, I have already ported code that was calling ref() / deref() explicitly with RefTypeNormal to use RefPtr<> instead. This patch goes further by: 1. Dropping the RefType parameter to ref() / deref(). ref() / deref() now increment or decrement m_normalRefCount only. Clients are expected to use RefPtr to handle ref counting. 2. Introduce new incrementConnectionCount() / decrementConnectionCount() to increment or decrement m_connectionRefCount. To reduce the chance of leakage, clients should not call these functions directly anymore. Instead, they use use the new AudioConnectionRefPtr<> pointer type to handle the connection ref counting for them. AudioConnectionRefPtr<> is a RefPtr<> which special traits causing incrementConnectionCount() and decrementConnectionCount() to get called on the AudioNode instead of ref() and deref(). I believe this new design is a bit simpler to reason about and less prone to leaks. There is no longer any code explicitly ref'ing or deref'ing the AudioNodes. Instead, RefPtr<> or AudioConnectionRefPtr<> is used to increment/decrement the right internal count. No new tests, no Web-facing behavior change. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::setPannerNode): (WebCore::AudioBufferSourceNode::clearPannerNode): * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::disableOutputsIfNecessary): (WebCore::AudioNode::incrementConnectionCount): (WebCore::AudioNode::decrementConnectionCount): (WebCore::AudioNode::decrementConnectionCountWithLock): (WebCore::AudioNode::markNodeForDeletionIfNecessary): (WebCore::AudioNode::ref): (WebCore::AudioNode::deref): (WebCore::AudioNode::derefWithLock): * Modules/webaudio/AudioNode.h: (WebCore::AudioNodeConnectionRefDerefTraits::refIfNotNull): (WebCore::AudioNodeConnectionRefDerefTraits::derefIfNotNull): * Modules/webaudio/AudioNodeInput.cpp: (WebCore::AudioNodeInput::connect): (WebCore::AudioNodeInput::disconnect): * Modules/webaudio/AudioNodeOutput.cpp: (WebCore::AudioNodeOutput::propagateChannelCount): (WebCore::AudioNodeOutput::addInput): (WebCore::AudioNodeOutput::disconnectAllInputs): (WebCore::AudioNodeOutput::disable): (WebCore::AudioNodeOutput::enable): * Modules/webaudio/AudioNodeOutput.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::~BaseAudioContext): (WebCore::BaseAudioContext::refNode): (WebCore::BaseAudioContext::derefNode): (WebCore::BaseAudioContext::derefUnfinishedSourceNodes): (WebCore::BaseAudioContext::addDeferredDecrementConnectionCount): (WebCore::BaseAudioContext::handlePostRenderTasks): (WebCore::BaseAudioContext::handleDeferredDecrementConnectionCounts): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::process): 2020-09-25 Rob Buis <rbuis@igalia.com> Simplify SVGTests.hasExtension idl https://bugs.webkit.org/show_bug.cgi?id=216984 Reviewed by Sam Weinig. Simplify SVGTests.hasExtension idl by removing optional and default parameter. Skipping the parameter will now result in the parameter being a null string, which gives the same behaviour as before as the method just checks against non null namespaces. [1] https://www.w3.org/TR/SVG11/types.html#__svg__SVGTests__hasExtension * page/DOMWindow.idl: * svg/SVGTests.idl: 2020-09-25 Chris Dumez <cdumez@apple.com> visibilitychange:hidden doesn't fire during page navigations https://bugs.webkit.org/show_bug.cgi?id=151234 <rdar://problem/23688763> Reviewed by Darin Adler and Ryosuke Niwa. Fire a visibilitychange during document unload, as per the specification: - https://www.w3.org/TR/page-visibility/#reacting-to-visibilitychange-changes - https://html.spec.whatwg.org/multipage/browsing-the-web.html#unloading-document-visibility-change-steps Tests: imported/w3c/web-platform-tests/page-visibility/idlharness.window.html imported/w3c/web-platform-tests/page-visibility/iframe-unload.html imported/w3c/web-platform-tests/page-visibility/onvisibilitychange.html imported/w3c/web-platform-tests/page-visibility/test_attributes_exist.html imported/w3c/web-platform-tests/page-visibility/test_child_document.html imported/w3c/web-platform-tests/page-visibility/test_default_view.html imported/w3c/web-platform-tests/page-visibility/test_read_only.html imported/w3c/web-platform-tests/page-visibility/unload-bubbles.html imported/w3c/web-platform-tests/page-visibility/unload.html * dom/Document.cpp: (WebCore::Document::visibilityState const): * dom/Document.h: (WebCore::Document::setIsUnloadingOrUnloaded): * loader/FrameLoader.cpp: (WebCore::FrameLoader::dispatchUnloadEvents): 2020-09-25 Fujii Hironori <Hironori.Fujii@sony.com> make_names.pl no longer needs C preprocessor https://bugs.webkit.org/show_bug.cgi?id=216953 Reviewed by Sam Weinig. * CMakeLists.txt: * DerivedSources.make: * WebCoreMacros.cmake: Changed GENERATE_DOM_NAMES from a macro to a function so that list(POP_FRONT ARGN var) works as exepected. * dom/make_names.pl: Removed --preprocessor and --extraDefines options. (readNames): (readAttrs): (readTags): (buildConstructorMap): (printConstructorSignature): (printConstructorInterior): (printConstructors): (printFunctionTable): (printJSElementIncludes): (printElementIncludes): (printConditionalElementIncludes): (usesDefaultJSWrapper): (printWrapperFunctions): (printWrapperFactoryCppFile): (preprocessorCommand): Deleted. 2020-09-25 Zalan Bujtas <zalan@apple.com> [LFC][MarginCollapsing] Only inflow boxes collapse their quirk margins with their parents https://bugs.webkit.org/show_bug.cgi?id=216981 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/quirk-margin-not-collapse-when-floating.html * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::shouldCollapseMarginBeforeWithParentMarginBefore const): 2020-09-25 Frederic Wang <fwang@igalia.com> Bug 216702 - Implement the CSS math-style property https://bugs.webkit.org/show_bug.cgi?id=216702 Reviewed by Rob Buis. This patch implements the math-style property [1][2] and uses it to map MathML's displaystyle attribute to style, instead of using an internal inheritance mechanism. In addition, four changes are made to improve the MathML implementation: - Support for the displaystyle attribute on all the MathML elements. - Better handling of dynamic update of displaystyle. - RenderMathMLUnderOver uses its own displaystyle (rather than the one of the core operator at its base in order) to determine whether to move its under/over scripts. - display/displaystyle are made case-insensitive. [1] https://mathml-refresh.github.io/mathml-core/#the-math-style-property [2] https://github.com/w3c/csswg-drafts/issues/5387 No new tests, already covered by existing tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator MathStyle const): * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/mathml.css: Implement displaystyle rules using math-style. * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): (WebCore::CSSParserFastPaths::isKeywordPropertyID): * mathml/MathMLElement.cpp: (WebCore::MathMLElement::isPresentationAttribute const): (WebCore::MathMLElement::collectStyleForPresentationAttribute): * mathml/MathMLElement.h: * mathml/MathMLMathElement.cpp: (WebCore::MathMLMathElement::parseAttribute): * mathml/MathMLMathElement.h: * mathml/MathMLPresentationElement.cpp: (WebCore::MathMLPresentationElement::parseAttribute): * mathml/MathMLPresentationElement.h: * mathml/MathMLRowElement.cpp: * mathml/MathMLRowElement.h: * mathml/MathMLSpaceElement.h: * mathml/MathMLTokenElement.h: * rendering/mathml/MathMLStyle.cpp: (WebCore::MathMLStyle::updateStyleIfNeeded): (WebCore::MathMLStyle::resolveMathMLStyle): * rendering/mathml/MathMLStyle.h: * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::styleDidChange): * rendering/mathml/RenderMathMLBlock.h: * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::fractionParameters const): (WebCore::RenderMathMLFraction::stackParameters const): * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::styleDidChange): * rendering/mathml/RenderMathMLOperator.h: (WebCore::RenderMathMLOperator::isLargeOperatorInDisplayStyle const): (WebCore::RenderMathMLOperator::shouldMoveLimits const): * rendering/mathml/RenderMathMLRoot.cpp: (WebCore::RenderMathMLRoot::verticalParameters): * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::shouldMoveLimits): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::mathStyle const): (WebCore::RenderStyle::setMathStyle): (WebCore::RenderStyle::initialMathStyle): * rendering/style/RenderStyleConstants.cpp: (WebCore::operator<<): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator== const): * rendering/style/StyleRareInheritedData.h: 2020-09-24 Darin Adler <darin@apple.com> Add CSSConditionRule and CSSGroupingRule https://bugs.webkit.org/show_bug.cgi?id=216855 Reviewed by Sam Weinig. * CMakeLists.txt: Added CSSConditionRule.idl and CSSGroupingRule.idl. * DerivedSources-input.xcfilelist: Updated. * DerivedSources-output.xcfilelist: Updated. * DerivedSources.make: Added CSSConditionRule.idl and CSSGroupingRule.idl. * Headers.cmake: Added CSSConditionRule.h. * Sources.txt: Add CSSConditionRule.cpp, JSCSSConditioRule.cpp, and JSCSSGroupingRule.cpp. * WebCore.xcodeproj/project.pbxproj: Added all the files. * css/CSSConditionRule.cpp: Added. * css/CSSConditionRule.h: Added. * css/CSSConditionRule.idl: Added. * css/CSSGroupingRule.cpp: (WebCore::CSSGroupingRule::~CSSGroupingRule): Use a range-based for loop and nullptr. (WebCore::CSSGroupingRule::appendCSSTextForItems const): Use variadic append to clean this up a bit. (WebCore::CSSGroupingRule::item const): Use auto. * css/CSSGroupingRule.h: Made m_groupRule private instead of protected. Did some other tweaks. * css/CSSGroupingRule.idl: Added. * css/CSSImportRule.idl: Added [Exposed=Window], changed href to be a USVString, added [SameObject, PutForwards=mediaText] to media and [SameObject] to styleSheet. * css/CSSMediaRule.cpp: (WebCore::CSSMediaRule::CSSMediaRule): Derive from CSSConditionRule. (WebCore::CSSMediaRule::mediaQueries const): Return a reference. (WebCore::CSSMediaRule::cssText const): Streamline since we don't need a null check. (WebCore::CSSMediaRule::conditionText const): Added. (WebCore::CSSMediaRule::setConditionText): Added. (WebCore::CSSMediaRule::media const): Streamline since we don't need a null check. (WebCore::CSSMediaRule::reattach): Ditto. * css/CSSMediaRule.h: Derive from CSSConditionRule. * css/CSSMediaRule.idl: Derive from CSSConditionRule. Added [Exposed=Window]. Added [SameObject, PutForwards=mediaText] to media. Removed insertRule and deleteRule since they are now inherited from CSSGroupingRule. * css/CSSRule.h: Added MARGIN_RULE constant even though we don't have that rule type. Moved inline functions out of the class body to help clarity a bit. * css/CSSRule.idl: Added [Exposed=Window], changed a few things to match the specification. * css/CSSStyleRule.idl: Added [Exposed=Window]. Added [SameObject] to style. * css/CSSStyleSheet.idl: Added [Exposed=Window]. * css/CSSSupportsRule.cpp: (WebCore::CSSSupportsRule::CSSSupportsRule): Derive from CSSConditionRule. (WebCore::CSSSupportsRule::create): Added. (WebCore::CSSSupportsRule::cssText const): Use variadic append. (WebCore::CSSSupportsRule::conditionText const): Updated to use groupRule. (WebCore::CSSSupportsRule::setConditionText): Added. Not implemented yet. * css/CSSSupportsRule.h: Derive from CSSConditionRule. * css/CSSSupportsRule.idl: Derive from CSSConditionRule. Added [Exposed=Window]. * css/MediaList.cpp: (WebCore::MediaQuerySet::set): Use move instead of swap. * css/MediaList.idl: Added [Exposed=Window] and marked mediaText as the stringifier. * css/StyleRule.cpp: (WebCore::StyleRule::create): Moved here from the header. (WebCore::StyleRule::copy const): Ditto. (WebCore::StyleRulePage::create): Ditto. (WebCore::StyleRuleGroup::StyleRuleGroup): Use move instead of swap. (WebCore::StyleRuleMedia::create): Use move instead of swap. (WebCore::StyleRuleMedia::copy const): Moved out of the header. (WebCore::StyleRuleSupports::StyleRuleSupports): Ditto. (WebCore::StyleRuleSupports::create): Ditto. (WebCore::StyleRuleNamespace::StyleRuleNamespace): Ditto. (WebCore::StyleRuleNamespace::create): Ditto. * css/StyleRule.h: Moved function bodies out of the class defintiion for clarity. * css/StyleSheet.idl: Added [Exposed=Window] and [SameObject, PutForwards=mediaText] for media. * css/StyleSheetContents.cpp: (WebCore::StyleSheetContents::parserAppendRule): Updated since mediaQueries returns a reference. * css/StyleSheetList.idl: Added [Exposed=Window]. * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::consumeMediaRule): Use WTFMove since the create function now takes an rvalue reference. (WebCore::CSSParserImpl::consumeSupportsRule): Ditto. * style/RuleSet.cpp: (WebCore::Style::RuleSet::addChildRules): Updated since mediaQueries returns a reference. * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::addToDefaultStyle): Ditto. 2020-09-25 Peng Liu <peng.liu6@apple.com> Clean up VideoLayerManagerObjC https://bugs.webkit.org/show_bug.cgi?id=216946 Reviewed by Eric Carlson. Remove m_videoInlineFrame. Also, change the order of some variables and functions to put related things together. No new tests since no functional changes. * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h: * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm: (WebCore::VideoLayerManagerObjC::setVideoLayer): (WebCore::VideoLayerManagerObjC::didDestroyVideoLayer): (WebCore::VideoLayerManagerObjC::setVideoFullscreenLayer): 2020-09-25 Zalan Bujtas <zalan@apple.com> [LFC][Out-of-flow] ASSERTION FAILED: !layoutBox.isOutOfFlowPositioned() in WebCore::Layout::FormattingContext::Geometry::computedHeightValue https://bugs.webkit.org/show_bug.cgi?id=216976 Reviewed by Antti Koivisto. Geometry::computedHeightValue is a simple resolver function. It should not really care about whether the box's containing block has valid vertical geometry. The callsite (where this assert is important) is already testing this condition. Test: fast/layoutformattingcontext/out-of-flow-with-non-fixed-height-simple.html * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const): (WebCore::Layout::FormattingContext::Geometry::constraintsForInFlowContent): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutInFlowContent): 2020-09-25 Antoine Quint <graouts@webkit.org> Reduce the reliance on PseudoElement in the animation code https://bugs.webkit.org/show_bug.cgi?id=216931 <rdar://problem/69511682> Reviewed by Antti Koivisto. We have so far relied on PseudoElement as a foundation for supporting animations of pseudo-elements. This is not a great choice since PseudoElement is currently limited to ::before and ::after pseudo-elements only. This patch refactors animation-related code to rely on PseudoElement as little as possible without making changes outside of the animation code, as a first step towards supporting animation of more pseudo-elements. This patch introduces a new struct Styleable which combines an Element& and PseudoId. We use this struct instead of Element objects wherever necessary in the animation code. On top of that, we add a PseudoId parameter to all the Element methods wrapping access to ElementAnimationRareData and use a HashMap<PseudoId, std::unique_ptr<ElementAnimationRareData>> to be able to separate animation data per pseudo-element. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::removeAnimation): (WebCore::AnimationTimeline::animationWasAddedToStyleable): (WebCore::AnimationTimeline::animationWasRemovedFromStyleable): (WebCore::AnimationTimeline::removeDeclarativeAnimationFromListsForOwningElement): (WebCore::AnimationTimeline::removeCSSAnimationCreatedByMarkup): (WebCore::AnimationTimeline::elementWasRemoved): (WebCore::AnimationTimeline::willChangeRendererForStyleable): (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForStyleable): (WebCore::shouldConsiderAnimation): (WebCore::AnimationTimeline::updateCSSAnimationsForStyleable): (WebCore::keyframeEffectForElementAndProperty): (WebCore::AnimationTimeline::updateCSSTransitionsForStyleableAndProperty): (WebCore::AnimationTimeline::updateCSSTransitionsForStyleable): (WebCore::AnimationTimeline::animationWasAddedToElement): Deleted. (WebCore::AnimationTimeline::animationWasRemovedFromElement): Deleted. (WebCore::AnimationTimeline::willChangeRendererForElement): Deleted. (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement): Deleted. (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Deleted. (WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty): Deleted. (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Deleted. * animation/AnimationTimeline.h: * animation/CSSAnimation.cpp: (WebCore::CSSAnimation::create): (WebCore::CSSAnimation::CSSAnimation): * animation/CSSAnimation.h: * animation/CSSTransition.cpp: (WebCore::CSSTransition::create): (WebCore::CSSTransition::CSSTransition): * animation/CSSTransition.h: * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::DeclarativeAnimation): (WebCore::DeclarativeAnimation::owningElement const): (WebCore::DeclarativeAnimation::disassociateFromOwningElement): (WebCore::DeclarativeAnimation::initialize): (WebCore::DeclarativeAnimation::enqueueDOMEvent): * animation/DeclarativeAnimation.h: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::animationCanBeRemoved): (WebCore::DocumentTimeline::transitionDidComplete): (WebCore::DocumentTimeline::computeExtentOfAnimation const): (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): (WebCore::DocumentTimeline::animatedStyleForRenderer): (WebCore::DocumentTimeline::runningAnimationsForRendererAreAllAccelerated const): (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const): Deleted. * animation/DocumentTimeline.h: * animation/ElementAnimationRareData.cpp: (WebCore::ElementAnimationRareData::ElementAnimationRareData): * animation/ElementAnimationRareData.h: (WebCore::ElementAnimationRareData::pseudoId const): * animation/KeyframeEffect.cpp: (WebCore::elementOrPseudoElementForStyleable): (WebCore::invalidateElement): (WebCore::KeyframeEffect::animationTimelineDidChange): (WebCore::KeyframeEffect::updateEffectStackMembership): (WebCore::KeyframeEffect::targetStyleable const): (WebCore::KeyframeEffect::setTarget): (WebCore::KeyframeEffect::setPseudoElement): (WebCore::KeyframeEffect::didChangeTargetStyleable): (WebCore::KeyframeEffect::invalidate): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): (WebCore::KeyframeEffect::didChangeTargetElementOrPseudoElement): Deleted. * animation/KeyframeEffect.h: * animation/KeyframeEffectStack.cpp: (WebCore::KeyframeEffectStack::addEffect): * animation/WebAnimation.cpp: (WebCore::WebAnimation::setEffectInternal): (WebCore::WebAnimation::setTimeline): (WebCore::WebAnimation::effectTargetDidChange): (WebCore::WebAnimation::persist): (WebCore::WebAnimation::commitStyles): * animation/WebAnimation.h: * animation/WebAnimationUtilities.cpp: (WebCore::compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder): (WebCore::compareCSSTransitions): (WebCore::compareCSSAnimations): * dom/Element.cpp: (WebCore::Element::removedFromAncestor): (WebCore::Element::animationRareData const): (WebCore::Element::ensureAnimationRareData): (WebCore::Element::keyframeEffectStack const): (WebCore::Element::ensureKeyframeEffectStack): (WebCore::Element::hasKeyframeEffects const): (WebCore::Element::applyKeyframeEffects): (WebCore::Element::animations const): (WebCore::Element::hasCompletedTransitionsForProperty const): (WebCore::Element::hasRunningTransitionsForProperty const): (WebCore::Element::hasRunningTransitions const): (WebCore::Element::ensureAnimations): (WebCore::Element::animationsCreatedByMarkup): (WebCore::Element::setAnimationsCreatedByMarkup): (WebCore::Element::ensureCompletedTransitionsByProperty): (WebCore::Element::ensureRunningTransitionsByProperty): (WebCore::Element::lastStyleChangeEventStyle const): (WebCore::Element::setLastStyleChangeEventStyle): (WebCore::Element::getAnimations): * dom/Element.h: * dom/ElementRareData.cpp: * dom/ElementRareData.h: (WebCore::ElementRareData::useTypes const): (WebCore::ElementRareData::animationRareData const): (WebCore::ElementRareData::ensureAnimationRareData): (WebCore::ElementRareData::elementAnimationRareData): Deleted. * dom/PseudoElement.cpp: (WebCore::PseudoElement::clearHostElement): (WebCore::PseudoElement::isTargetedByKeyframeEffectRequiringPseudoElement): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::hasRunningAcceleratedAnimations const): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): (WebCore::RenderLayerCompositor::isRunningTransformAnimation const): * rendering/style/RenderStyleConstants.cpp: (WebCore::operator<<): * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::tearDownRenderers): * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveElement): (WebCore::Style::TreeResolver::resolvePseudoStyle): (WebCore::Style::TreeResolver::createAnimatedElementUpdate): * style/StyleTreeResolver.h: * style/Styleable.h: Added. (WebCore::Styleable::Styleable): (WebCore::Styleable::fromElement): (WebCore::Styleable::fromRenderer): (WebCore::Styleable::operator== const): (WebCore::Styleable::operator!= const): (WebCore::Styleable::keyframeEffectStack const): (WebCore::Styleable::ensureKeyframeEffectStack const): (WebCore::Styleable::hasKeyframeEffects const): (WebCore::Styleable::applyKeyframeEffects const): (WebCore::Styleable::animations const): (WebCore::Styleable::hasCompletedTransitionsForProperty const): (WebCore::Styleable::hasRunningTransitionsForProperty const): (WebCore::Styleable::hasRunningTransitions const): (WebCore::Styleable::ensureAnimations const): (WebCore::Styleable::ensureCompletedTransitionsByProperty const): (WebCore::Styleable::ensureRunningTransitionsByProperty const): (WebCore::Styleable::animationsCreatedByMarkup const): (WebCore::Styleable::setAnimationsCreatedByMarkup const): (WebCore::Styleable::lastStyleChangeEventStyle const): (WebCore::Styleable::setLastStyleChangeEventStyle const): 2020-09-25 Youenn Fablet <youenn@apple.com> Fix LibWebRTCRtpReceiverBackend for internal build https://bugs.webkit.org/show_bug.cgi?id=216965 Reviewed by Eric Carlson. Move some includes to cpp file and add macros to disable deprecated warnings. No change of behavior. * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp: (WebCore::LibWebRTCRtpReceiverBackend::LibWebRTCRtpReceiverBackend): * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h: 2020-09-25 Antti Koivisto <antti@apple.com> Remove Simple Line Layout https://bugs.webkit.org/show_bug.cgi?id=216914 Reviewed by Sam Weinig. It is already fully covered by LFC and so unused. Remove the code. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXLogger.cpp: * accessibility/AccessibilityObjectInterface.h: * editing/TextIterator.cpp: * layout/Verification.cpp: (WebCore::Layout::verifyAndOutputSubtree): (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded): Deleted. * layout/integration/LayoutIntegrationLineLayout.cpp: * layout/integration/LayoutIntegrationPagination.cpp: * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::layoutLineBoxes): (WebCore::ComplexLineLayout::addOverflowFromInlineChildren): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutInlineChildren): (WebCore::RenderBlockFlow::styleDidChange): (WebCore::RenderBlockFlow::hitTestInlineChildren): (WebCore::RenderBlockFlow::addOverflowFromInlineChildren): (WebCore::RenderBlockFlow::markLinesDirtyInBlockRange): (WebCore::RenderBlockFlow::firstLineBaseline const): (WebCore::RenderBlockFlow::inlineBlockBaseline const): (WebCore::RenderBlockFlow::inlineSelectionGaps): (WebCore::RenderBlockFlow::lineCount const): (WebCore::RenderBlockFlow::positionForPoint): (WebCore::RenderBlockFlow::paintInlineChildren): (WebCore::RenderBlockFlow::hasLines const): (WebCore::RenderBlockFlow::invalidateLineLayoutPath): (WebCore::RenderBlockFlow::ensureLineBoxes): (WebCore::RenderBlockFlow::outputLineTreeAndMark const): (WebCore::RenderBlockFlow::layoutSimpleLines): Deleted. * rendering/RenderBlockFlow.h: (WebCore::RenderBlockFlow::hasSimpleLineLayout const): Deleted. (WebCore::RenderBlockFlow::simpleLineLayout const): Deleted. (WebCore::RenderBlockFlow::simpleLineLayout): Deleted. * rendering/RenderFragmentedFlow.cpp: (WebCore::RenderFragmentedFlow::removeLineFragmentInfo): * rendering/RenderText.cpp: (WebCore::RenderText::absoluteQuadsForRange const): (WebCore::RenderText::positionForPoint): (WebCore::RenderText::setTextWithOffset): (WebCore::RenderText::usesComplexLineLayoutPath const): (WebCore::RenderText::linesVisualOverflowBoundingBox const): (WebCore::RenderText::collectSelectionRectsForLineBoxes): (WebCore::RenderText::simpleLineLayout const): Deleted. * rendering/RenderText.h: * rendering/SimpleLineLayout.cpp: Removed. * rendering/SimpleLineLayout.h: Removed. * rendering/SimpleLineLayoutCoverage.cpp: Removed. * rendering/SimpleLineLayoutCoverage.h: Removed. * rendering/SimpleLineLayoutFlowContents.cpp: Removed. * rendering/SimpleLineLayoutFlowContents.h: Removed. * rendering/SimpleLineLayoutFunctions.cpp: Removed. * rendering/SimpleLineLayoutFunctions.h: Removed. * rendering/SimpleLineLayoutPagination.cpp: Removed. * rendering/SimpleLineLayoutPagination.h: Removed. * rendering/SimpleLineLayoutResolver.cpp: Removed. * rendering/SimpleLineLayoutResolver.h: Removed. * rendering/SimpleLineLayoutTextFragmentIterator.cpp: Removed. * rendering/SimpleLineLayoutTextFragmentIterator.h: Removed. * rendering/TextPainter.cpp: (WebCore::TextPainter::clearGlyphDisplayLists): * rendering/line/LineLayoutTraversal.cpp: (WebCore::LineLayoutTraversal::firstTextBoxFor): (WebCore::LineLayoutTraversal::elementBoxFor): * rendering/line/LineLayoutTraversal.h: * rendering/line/LineLayoutTraversalSimplePath.h: Removed. 2020-09-25 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes, late September 2020 edition https://bugs.webkit.org/show_bug.cgi?id=216950 Unreviewed build fix. No new tests needed. * Modules/webaudio/AudioNodeInput.cpp: Add missing AudioUtilities.h include. * Modules/webaudio/AudioNodeOutput.cpp: Ditto. * Modules/webaudio/BiquadProcessor.cpp: Ditto. * Modules/webaudio/GainNode.cpp: Ditto. * Modules/webaudio/PannerNode.cpp: Ditto. * page/PerformanceUserTiming.cpp: Add missing JavaScriptCore/JSCJSValueInlines.h include. * platform/audio/AudioUtilities.h: Add missing <cmath> include. 2020-09-24 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add helper functions to create LineBox::InlineBox objects for inline level boxes. https://bugs.webkit.org/show_bug.cgi?id=216957 Reviewed by Simon Fraser. The overloaded LineBox::InlineBox constructors were representing different types of inline level boxes. These new helper functions make it easier to figure out how to initiate LineBox::InlineBox objects depending on the type of the inline level box. This patch also removes an incorrect ASSERT on the inline box's height. It is okay to have a zero height inline box. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineBoxes): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::InlineBox::InlineBox): (WebCore::Layout::m_baseline): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineBox::createBoxForRootInlineBox): (WebCore::Layout::LineBox::InlineBox::createBoxForAtomicInlineLevelBox): (WebCore::Layout::LineBox::InlineBox::createBoxForInlineBox): 2020-09-24 Keith Miller <keith_miller@apple.com> CSS angle unit conversions should consistently use the same associativity https://bugs.webkit.org/show_bug.cgi?id=216906 Reviewed by Simon Fraser. Right now we inconsistently associate our floating point math for angle unit conversions. In particular, conversionToCanonicalUnitsScaleFactor expects there to be a single fixed constant we can multiply by to change units. However, the various conversion functions in WTF are not associated in this way. e.g. rad2deg does ((radian * 180) / pi) rather than (radian * (180 / pi)). Since FP math is NOT associative these produce different results. For example, 1.57 radians is 89.954373835539258 degrees in the first case but 89.954373835539243 in the second. This patch changes the WTF functions to operate on a single scale factor when converting to/from the canonical unit. Conversions between non-canonical units first convert to the canonical unit (degree). Also, conversionToCanonicalUnitsScaleFactor now gets the scale factor from WTF to ensure we get the same associativity everywhere. * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor): 2020-09-24 Fujii Hironori <Hironori.Fujii@sony.com> [SVG2] Remove color-profile tag https://bugs.webkit.org/show_bug.cgi?id=216910 Reviewed by Darin Adler. SVG2 removed color-profile element. * dom/Document.cpp: (WebCore::Document::validateCustomElementName): * svg/svgtags.in: 2020-09-24 Chris Dumez <cdumez@apple.com> Use more inline initialization and constexpr in WebAudio code https://bugs.webkit.org/show_bug.cgi?id=216939 Reviewed by Darin Adler. Use more inline initialization and constexpr in WebAudio code. * Modules/webaudio/AudioBufferSourceNode.cpp: * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::AudioDestinationNode): * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/AudioNodeOutput.cpp: (WebCore::AudioNodeOutput::AudioNodeOutput): * Modules/webaudio/AudioNodeOutput.h: * Modules/webaudio/AudioParamTimeline.h: * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode): (WebCore::AudioScheduledSourceNode::updateSchedulingInfo): * Modules/webaudio/AudioScheduledSourceNode.h: * Modules/webaudio/AudioSummingJunction.cpp: (WebCore::AudioSummingJunction::AudioSummingJunction): * Modules/webaudio/AudioSummingJunction.h: * Modules/webaudio/BiquadDSPKernel.cpp: * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::BiquadProcessor): * Modules/webaudio/BiquadProcessor.h: * Modules/webaudio/ConvolverNode.cpp: * Modules/webaudio/DefaultAudioDestinationNode.cpp: * Modules/webaudio/DelayNode.cpp: * Modules/webaudio/DynamicsCompressorNode.cpp: * Modules/webaudio/MediaElementAudioSourceNode.cpp: * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::PeriodicWave): (WebCore::PeriodicWave::waveDataForFundamentalFrequency): (WebCore::PeriodicWave::numberOfPartialsForRange const): * Modules/webaudio/PeriodicWave.h: * Modules/webaudio/RealtimeAnalyser.cpp: (WebCore::RealtimeAnalyser::RealtimeAnalyser): * Modules/webaudio/RealtimeAnalyser.h: * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::ScriptProcessorNode): * Modules/webaudio/ScriptProcessorNode.h: * Modules/webaudio/WaveShaperProcessor.cpp: (WebCore::WaveShaperProcessor::WaveShaperProcessor): * Modules/webaudio/WaveShaperProcessor.h: * Modules/webaudio/WebKitAudioContext.cpp: * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode): * Modules/webaudio/WebKitAudioPannerNode.h: * platform/audio/AudioBus.cpp: (WebCore::AudioBus::AudioBus): * platform/audio/AudioBus.h: * platform/audio/AudioChannel.h: * platform/audio/AudioDSPKernelProcessor.cpp: (WebCore::AudioDSPKernelProcessor::AudioDSPKernelProcessor): * platform/audio/AudioDSPKernelProcessor.h: * platform/audio/AudioHardwareListener.cpp: (WebCore::AudioHardwareListener::AudioHardwareListener): * platform/audio/AudioHardwareListener.h: * platform/audio/AudioResampler.cpp: (WebCore::AudioResampler::AudioResampler): * platform/audio/AudioResampler.h: * platform/audio/AudioResamplerKernel.cpp: (WebCore::AudioResamplerKernel::AudioResamplerKernel): * platform/audio/AudioResamplerKernel.h: * platform/audio/Biquad.cpp: * platform/audio/Cone.cpp: * platform/audio/Cone.h: * platform/audio/Distance.cpp: * platform/audio/Distance.h: * platform/audio/DownSampler.cpp: (WebCore::DownSampler::DownSampler): * platform/audio/DownSampler.h: * platform/audio/DynamicsCompressorKernel.cpp: (WebCore::DynamicsCompressorKernel::DynamicsCompressorKernel): * platform/audio/DynamicsCompressorKernel.h: * platform/audio/EqualPowerPanner.cpp: (WebCore::EqualPowerPanner::EqualPowerPanner): * platform/audio/EqualPowerPanner.h: * platform/audio/FFTConvolver.cpp: (WebCore::FFTConvolver::FFTConvolver): * platform/audio/FFTConvolver.h: * platform/audio/HRTFDatabase.cpp: (WebCore::HRTFDatabase::HRTFDatabase): * platform/audio/HRTFDatabase.h: * platform/audio/HRTFElevation.cpp: * platform/audio/HRTFElevation.h: * platform/audio/HRTFKernel.cpp: (WebCore::HRTFKernel::HRTFKernel): * platform/audio/HRTFKernel.h: * platform/audio/HRTFPanner.cpp: (WebCore::HRTFPanner::HRTFPanner): * platform/audio/HRTFPanner.h: * platform/audio/PlatformMediaSession.cpp: (WebCore::PlatformMediaSession::PlatformMediaSession): * platform/audio/PlatformMediaSession.h: * platform/audio/PushPullFIFO.cpp: (WebCore::PushPullFIFO::PushPullFIFO): * platform/audio/PushPullFIFO.h: * platform/audio/Reverb.cpp: * platform/audio/ReverbAccumulationBuffer.cpp: (WebCore::ReverbAccumulationBuffer::ReverbAccumulationBuffer): * platform/audio/ReverbAccumulationBuffer.h: * platform/audio/ReverbConvolver.cpp: * platform/audio/ReverbConvolverStage.cpp: (WebCore::ReverbConvolverStage::ReverbConvolverStage): * platform/audio/ReverbConvolverStage.h: * platform/audio/ReverbInputBuffer.cpp: (WebCore::ReverbInputBuffer::ReverbInputBuffer): * platform/audio/ReverbInputBuffer.h: 2020-09-24 Chris Dumez <cdumez@apple.com> Simplify AudioNode::addInput() / addOutput() call sites https://bugs.webkit.org/show_bug.cgi?id=216941 Reviewed by Darin Adler. Simplify AudioNode::addInput() / addOutput() call sites by moving the input / output node construction from the call site to the function implementation. * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::AnalyserNode): * Modules/webaudio/AudioBasicInspectorNode.cpp: (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode): * Modules/webaudio/AudioBasicProcessorNode.cpp: (WebCore::AudioBasicProcessorNode::AudioBasicProcessorNode): * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::AudioDestinationNode): * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::addInput): (WebCore::AudioNode::addOutput): * Modules/webaudio/AudioNode.h: * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::ChannelMergerNode): * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::ChannelSplitterNode): * Modules/webaudio/ConstantSourceNode.cpp: (WebCore::ConstantSourceNode::ConstantSourceNode): * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::ConvolverNode): * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::GainNode): * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::OscillatorNode): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::PannerNode): * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::ScriptProcessorNode): * Modules/webaudio/StereoPannerNode.cpp: (WebCore::StereoPannerNode::StereoPannerNode): * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode): 2020-09-24 Chris Dumez <cdumez@apple.com> Declare render quantum size constant in AudioUtilities.h https://bugs.webkit.org/show_bug.cgi?id=216935 Reviewed by Eric Carlson. Declare render quantum size [1] constant in AudioUtilities.h so that it can be used in both platform/ and Modules/webaudio/. Also update the code so that we have a single constant instead of many. [1] https://www.w3.org/TR/webaudio/#render-quantum-size * Modules/webaudio/AudioListener.cpp: (WebCore::AudioListener::AudioListener): * Modules/webaudio/AudioNode.h: * Modules/webaudio/AudioNodeInput.cpp: (WebCore::AudioNodeInput::AudioNodeInput): (WebCore::AudioNodeInput::updateInternalBus): * Modules/webaudio/AudioNodeOutput.cpp: (WebCore::AudioNodeOutput::AudioNodeOutput): (WebCore::AudioNodeOutput::updateInternalBus): * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::calculateFinalValues): (WebCore::AudioParam::calculateTimelineValues): * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valueForContextTime): * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::updateSchedulingInfo): * Modules/webaudio/BiquadDSPKernel.cpp: (WebCore::BiquadDSPKernel::updateCoefficientsIfNecessary): * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::processOnlyAudioParams): * Modules/webaudio/ConstantSourceNode.cpp: (WebCore::ConstantSourceNode::ConstantSourceNode): * Modules/webaudio/ConstantSourceNode.h: * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::setBuffer): * Modules/webaudio/DelayDSPKernel.cpp: (WebCore::DelayDSPKernel::DelayDSPKernel): (WebCore::DelayDSPKernel::processOnlyAudioParams): * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::processOnlyAudioParams): * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::GainNode): (WebCore::GainNode::processOnlyAudioParams): * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::suspendOfflineRendering): * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode): (WebCore::OfflineAudioDestinationNode::offlineRender): * Modules/webaudio/OfflineAudioDestinationNode.h: * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::OscillatorNode): * Modules/webaudio/OscillatorNode.h: * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::processOnlyAudioParams): (WebCore::PannerNode::processSampleAccurateValues): * Modules/webaudio/RealtimeAnalyser.cpp: (WebCore::RealtimeAnalyser::RealtimeAnalyser): * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::ScriptProcessorNode): * Modules/webaudio/StereoPannerNode.cpp: (WebCore::StereoPannerNode::StereoPannerNode): (WebCore::StereoPannerNode::processOnlyAudioParams): * Modules/webaudio/StereoPannerNode.h: * Modules/webaudio/WaveShaperDSPKernel.cpp: (WebCore::WaveShaperDSPKernel::lazyInitializeOversampling): (WebCore::WaveShaperDSPKernel::processCurve2x): (WebCore::WaveShaperDSPKernel::processCurve4x): * platform/audio/AudioResamplerKernel.cpp: (WebCore::AudioResamplerKernel::AudioResamplerKernel): (WebCore::AudioResamplerKernel::getSourcePointer): (WebCore::AudioResamplerKernel::process): * platform/audio/AudioResamplerKernel.h: * platform/audio/AudioUtilities.h: * platform/audio/Biquad.cpp: (WebCore::Biquad::Biquad): * platform/audio/Biquad.h: * platform/audio/HRTFPanner.cpp: (WebCore::HRTFPanner::HRTFPanner): (WebCore::HRTFPanner::pan): * platform/audio/IIRFilter.cpp: (WebCore::IIRFilter::tailTime): * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestinationCocoa::AudioDestinationCocoa): (WebCore::AudioDestinationCocoa::render): (WebCore::AudioDestinationCocoa::provideInput): * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::updateSessionState): * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer): (WebCore::AudioDestinationGStreamer::framesPerBuffer const): * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webkit_web_audio_src_class_init): 2020-09-24 Youenn Fablet <youenn@apple.com> Add libwebrtc.dylib version check https://bugs.webkit.org/show_bug.cgi?id=216884 <rdar://problem/69441354> Reviewed by Eric Carlson. Use webrtc::isMatchingBundleVersion to check for libwebrtc.dylib presence and for version matching. If version does not match, crash the web process. No change of behavior. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProvider::webRTCAvailable): * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.mm: 2020-09-24 Chris Dumez <cdumez@apple.com> Drop AudioNode::reset() and all its overrides https://bugs.webkit.org/show_bug.cgi?id=216932 Reviewed by Eric Carlson. Drop AudioNode::reset() and all its overrides. This is dead code. * Modules/webaudio/AnalyserNode.cpp: * Modules/webaudio/AnalyserNode.h: * Modules/webaudio/AudioBasicProcessorNode.cpp: * Modules/webaudio/AudioBasicProcessorNode.h: * Modules/webaudio/AudioBufferSourceNode.cpp: * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/AudioNode.h: * Modules/webaudio/ChannelMergerNode.cpp: * Modules/webaudio/ChannelMergerNode.h: * Modules/webaudio/ChannelSplitterNode.cpp: * Modules/webaudio/ChannelSplitterNode.h: * Modules/webaudio/ConstantSourceNode.h: * Modules/webaudio/ConvolverNode.cpp: * Modules/webaudio/ConvolverNode.h: * Modules/webaudio/DynamicsCompressorNode.cpp: * Modules/webaudio/DynamicsCompressorNode.h: * Modules/webaudio/GainNode.cpp: * Modules/webaudio/GainNode.h: * Modules/webaudio/MediaElementAudioSourceNode.cpp: * Modules/webaudio/MediaElementAudioSourceNode.h: * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: * Modules/webaudio/MediaStreamAudioDestinationNode.h: * Modules/webaudio/MediaStreamAudioSourceNode.h: * Modules/webaudio/OscillatorNode.cpp: * Modules/webaudio/OscillatorNode.h: * Modules/webaudio/PannerNode.cpp: * Modules/webaudio/PannerNode.h: * Modules/webaudio/RealtimeAnalyser.cpp: * Modules/webaudio/RealtimeAnalyser.h: * Modules/webaudio/ScriptProcessorNode.cpp: * Modules/webaudio/ScriptProcessorNode.h: * Modules/webaudio/StereoPannerNode.h: * Modules/webaudio/WebKitAudioPannerNode.cpp: * Modules/webaudio/WebKitAudioPannerNode.h: 2020-09-24 Carlos Garcia Campos <cgarcia@igalia.com> [GTK][WPE] Move proxy settings from WebKitContext to WebKitWebsiteDataManager https://bugs.webkit.org/show_bug.cgi?id=216927 Reviewed by Alex Christensen. Make proxySettings a member of SoupNetworkSession, instead of being global. * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::SoupNetworkSession): (WebCore::SoupNetworkSession::setProxySettings): (WebCore::proxySettings): Deleted. (WebCore::SoupNetworkSession::setupProxy): Deleted. * platform/network/soup/SoupNetworkSession.h: 2020-09-24 Chris Dumez <cdumez@apple.com> web audio api outputs silence for 302 redirected resource in safari https://bugs.webkit.org/show_bug.cgi?id=214932 <rdar://problem/66300050> Reviewed by Darin Adler. If the resource is redirected to another origin, treat it as tainted only if the crossorigin attribute is not set. This is done for consistency with Blink: - https://github.com/chromium/chromium/blob/master/media/blink/webmediaplayer_impl.cc (see WouldTaintOrigin()) The new behavior also seems to match Firefox. Tests: http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin-redirect.html * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin): 2020-09-24 Youenn Fablet <youenn@apple.com> Regression(r265280) Web Audio sources malfunction when disconnected from the audio graph https://bugs.webkit.org/show_bug.cgi?id=216703 <rdar://problem/69158436> Reviewed by Eric Carlson. In case of an audio source that stops producing data, but does not end or mute the track, we would continuously try to read the data until getting to the end of the data. When reaching the end of the data, we would return silence and go back in time a little bit to restart playing with some margin. This allows to read just one chunk of audio until we are back to the end of data. We fix this by storing the end of the data counter when reaching it. When trying to pull some more data, we will go back in time a little bit only if some more data was added in the meantime. Otherwise, we just output silence. Covered by manual test. * platform/audio/mac/AudioSampleDataSource.h: * platform/audio/mac/AudioSampleDataSource.mm: (WebCore::AudioSampleDataSource::pullSamplesInternal): 2020-09-24 Antti Koivisto <antti@apple.com> currentColor isn't recalculated when a text node doesn't exist https://bugs.webkit.org/show_bug.cgi?id=216780 <rdar://problem/69320933> Reviewed by Antoine Quint. We fail to repaint with the new background color when 'background-color' property has value 'currentColor' and the current color changes. Test case by Cory LaViska. Test: fast/css/currentColor-background-paint.html * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresRepaint const): * rendering/style/StyleBackgroundData.cpp: (WebCore::StyleBackgroundData::isEquivalentForPainting const): * rendering/style/StyleBackgroundData.h: 2020-09-24 Cathie Chen <cathiechen@igalia.com> Root node with stateless wheel event isn't always scrollable https://bugs.webkit.org/show_bug.cgi?id=216875 Reviewed by Simon Fraser. Root nodes are not always capable of handling wheel event. When it is a stateless wheel event which does not trigger rubber-band, we should check the scroll content of the root node. * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::canHandleWheelEvent const): Stateless wheel event doesn't trigger rubber-band, should check the scroll content. 2020-09-24 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r267495 and r267512. https://bugs.webkit.org/show_bug.cgi?id=216924 Broke transform-stream.html test Reverted changesets: "Missing scope release in JSDOMBuiltinConstructorBase" https://bugs.webkit.org/show_bug.cgi?id=216851 https://trac.webkit.org/changeset/267495 "Unreviewed, we should put it under js/dom since it is not usable in JSC shell" https://bugs.webkit.org/show_bug.cgi?id=216851 https://trac.webkit.org/changeset/267512 2020-09-24 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r267507. https://bugs.webkit.org/show_bug.cgi?id=216923 Broke two layout tests on windows Reverted changeset: "web audio api outputs silence for 302 redirected resource in safari" https://bugs.webkit.org/show_bug.cgi?id=214932 https://trac.webkit.org/changeset/267507 2020-09-24 Youenn Fablet <youenn@apple.com> REGRESSION (iOS/Safari 14): MediaRecorder produces invalid video files https://bugs.webkit.org/show_bug.cgi?id=216832 <rdar://problem/69377550> Reviewed by Eric Carlson. Start the audio and video timestamps at zero. Compute the audio timestamp based on the sample count and the video timestamp based on the time at which the video sample is received. Covered by manually testing Safari generated videos on VLC, Chrome and Firefox. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::initialize): (WebCore::MediaRecorderPrivateWriter::startAssetWriter): (WebCore::copySampleBufferWithCurrentTimeStamp): (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): (WebCore::createAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): 2020-09-23 Peng Liu <peng.liu6@apple.com> Add feature flags for GPU Process features https://bugs.webkit.org/show_bug.cgi?id=216901 Reviewed by Tim Horton. Rename useGPUProcessForMedia to useGPUProcessForMediaEnabled. No new tests since no functional changes. * page/Settings.yaml: 2020-09-23 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Line layout logic should consult LayoutState whether remove trailing letter spacing. https://bugs.webkit.org/show_bug.cgi?id=216905 Reviewed by Sam Weinig. This is in preparation for completely moving away from the RuntimeEnabledFeatures check. * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::shouldIgnoreTrailingLetterSpacing const): * layout/LayoutState.h: * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::Line): (WebCore::Layout::Line::appendTextContent): * layout/inlineformatting/InlineLine.h: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineCandidate::InlineContent::appendInlineItem): 2020-09-20 Simon Fraser <simon.fraser@apple.com> [LFC Display] Add the beginnings of a CSS display box hierarchy and CSS painter https://bugs.webkit.org/show_bug.cgi?id=216752 Reviewed by Zalan Bujtas. Add some Display::Box subclasses to display/css, a Display::Tree class to own the display tree, and a DisplayTreeBuilder. Also add css/DisplayCSSPainter which is the beginnings of a class that knows how to paint a CSS stacking context. This code other than DisplayCSSPainter is deliberately vague about how much is CSS specific. It's likely that some box classes will be shared with SVG painting. * CMakeLists.txt: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * display/DisplayLayerController.cpp: (WebCore::Display::LayerController::RootLayerClient::paintContents): (WebCore::Display::LayerController::RootLayerClient::deviceScaleFactor const): (WebCore::Display::LayerController::prepareForDisplay): (WebCore::Display::LayerController::ensureRootLayer): (WebCore::Display::LayerController::updateRootLayerGeometry): * display/DisplayLayerController.h: * display/DisplayTree.cpp: Copied from Source/WebCore/display/DisplayView.h. (WebCore::Display::Tree::Tree): * display/DisplayTree.h: Copied from Source/WebCore/display/DisplayView.h. (WebCore::Display::Tree::rootBox const): * display/DisplayTreeBuilder.cpp: Added. (WebCore::Display::TreeBuilder::TreeBuilder): (WebCore::Display::TreeBuilder::build const): (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const): (WebCore::Display::TreeBuilder::displayBoxForRootBox const): (WebCore::Display::TreeBuilder::displayBoxForLayoutBox const): (WebCore::Display::outputDisplayBox): (WebCore::Display::outputDisplayTree): (WebCore::Display::showDisplayTree): * display/DisplayTreeBuilder.h: Copied from Source/WebCore/display/DisplayView.h. * display/DisplayView.cpp: (WebCore::Display::View::prepareForDisplay): (WebCore::Display::View::deviceScaleFactor const): * display/DisplayView.h: * display/css/DisplayBox.cpp: Copied from Source/WebCore/display/DisplayView.h. (WebCore::Display::Box::Box): (WebCore::Display::Box::setNextSibling): (WebCore::Display::Box::debugDescription const): * display/css/DisplayBox.h: Copied from Source/WebCore/display/DisplayView.h. (WebCore::Display::Box::Box): (WebCore::Display::Box::style const): (WebCore::Display::Box::borderBoxFrame const): (WebCore::Display::Box::isContainerBox const): (WebCore::Display::Box::isImageBox const): (WebCore::Display::Box::isReplacedBox const): (WebCore::Display::Box::nextSibling const): * display/css/DisplayCSSPainter.cpp: Added. (WebCore::Display::CSSPainter::paintBoxDecorations): (WebCore::Display::CSSPainter::paintBoxContent): (WebCore::Display::CSSPainter::paintBox): (WebCore::Display::CSSPainter::recursivePaintDescendants): (WebCore::Display::CSSPainter::paintStackingContext): (WebCore::Display::CSSPainter::isStackingContextPaintingBoundary): (WebCore::Display::CSSPainter::recursiveCollectLayers): (WebCore::Display::CSSPainter::paintTree): * display/css/DisplayCSSPainter.h: Copied from Source/WebCore/display/DisplayView.h. * display/css/DisplayContainerBox.cpp: Copied from Source/WebCore/display/DisplayView.h. (WebCore::Display::ContainerBox::ContainerBox): (WebCore::Display::ContainerBox::setFirstChild): (WebCore::Display::ContainerBox::debugDescription const): * display/css/DisplayContainerBox.h: Copied from Source/WebCore/display/DisplayView.h. (WebCore::Display::ContainerBox::firstChild const): * display/css/DisplayImageBox.cpp: Copied from Source/WebCore/display/DisplayView.h. (WebCore::Display::ImageBox::ImageBox): (WebCore::Display::ImageBox::setImage): (WebCore::Display::ImageBox::debugDescription const): * display/css/DisplayImageBox.h: Copied from Source/WebCore/display/DisplayView.h. (WebCore::Display::ImageBox::image const): * display/css/DisplayReplacedBox.cpp: Copied from Source/WebCore/display/DisplayView.h. (WebCore::Display::ReplacedBox::ReplacedBox): * display/css/DisplayReplacedBox.h: Copied from Source/WebCore/display/DisplayView.h. (WebCore::Display::ReplacedBox::replacedContentRect const): * display/css/DisplayStyle.cpp: Copied from Source/WebCore/display/DisplayView.cpp. (WebCore::Display::Style::Style): (WebCore::Display::Style::hasBackground const): (WebCore::Display::Style::hasVisibleBorder const): * display/css/DisplayStyle.h: Added. (WebCore::Display::Style::backgroundColor const): (WebCore::Display::Style::hasBackgroundImage const): (WebCore::Display::Style::borderLeft const): (WebCore::Display::Style::borderRight const): (WebCore::Display::Style::borderTop const): (WebCore::Display::Style::borderBottom const): (WebCore::Display::Style::zIndex const): (WebCore::Display::Style::isStackingContext const): (WebCore::Display::Style::isPositioned const): (WebCore::Display::Style::isFloating const): (WebCore::Display::Style::participatesInZOrderSorting const): (WebCore::Display::Style::setIsPositioned): (WebCore::Display::Style::setIsFloating): * layout/displaytree/DisplayBox.cpp: Removed. * layout/displaytree/DisplayBox.h: Removed. * layout/layouttree/LayoutIterator.h: Unified sources build fix. 2020-09-23 Chris Dumez <cdumez@apple.com> web audio api outputs silence for 302 redirected resource in safari https://bugs.webkit.org/show_bug.cgi?id=214932 <rdar://problem/66300050> Reviewed by Darin Adler. If the resource is redirected to another origin, treat it as tainted only if the crossorigin attribute is not set. This is done for consistency with Blink: - https://github.com/chromium/chromium/blob/master/media/blink/webmediaplayer_impl.cc (see WouldTaintOrigin()) The new behavior also seems to match Firefox. Tests: http/tests/security/webaudio-render-remote-audio-allowed-crossorigin-redirect.html http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin-redirect.html * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin): 2020-09-23 Chris Dumez <cdumez@apple.com> Use less explicit ref() / deref() calls in WebAudio code https://bugs.webkit.org/show_bug.cgi?id=216894 Reviewed by Darin Adler. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::clearPendingActivity): (WebCore::BaseAudioContext::makePendingActivity): * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::setFormat): (WebCore::MediaElementAudioSourceNode::process): * Modules/webaudio/MediaElementAudioSourceNode.h: * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::startRendering): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaEngineWasUpdated): (WebCore::HTMLMediaElement::createMediaPlayer): 2020-09-23 Chris Dumez <cdumez@apple.com> Turn off the legacy prefixed WebAudio API https://bugs.webkit.org/show_bug.cgi?id=216886 Reviewed by Sam Weinig. Turn off the legacy prefixed WebAudio API, now that the modern unprefixed API has been enabled in r267488. No new tests, rebaselined existing tests. * Modules/webaudio/AudioBufferSourceNode.idl: Make sure legacy constants get unexposed if the PrefixedWebAudio setting is disabled. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GetRuntimeEnabledStaticProperties): * bindings/scripts/test/JS/JSTestConditionalIncludes.cpp: (WebCore::JSTestConditionalIncludesConstructor::initializeProperties): (WebCore::JSTestConditionalIncludesPrototype::finishCreation): * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::JSTestEnabledBySettingConstructor::prototypeForStructure): (WebCore::JSTestEnabledBySettingConstructor::initializeProperties): (WebCore::JSTestEnabledBySettingPrototype::finishCreation): * bindings/scripts/test/TestEnabledBySetting.idl: Add support for using [EnabledBySetting=X] on constants. 2020-09-23 obrufau@igalia.com <obrufau@igalia.com> [css-grid] Clear the override width for computing percent margins https://bugs.webkit.org/show_bug.cgi?id=209461 Reviewed by Manuel Rego Casasnovas. When calculating the min-content contribution of a grid item of an auto sized grid track we must consider the grid item's margin. When the grid item's area is indefinite, a percent margin is resolved to zero. However, when performing a relayout, the percent margin may be solved against the previously computed grid area, since the grid item has already an OverrideContainingBlockLogicalWidth value. In order to re-compute the percent margin properly, we need to clear the previously override value. It's important to be careful of not clearing the override value set during intrinsic size, since we need it for the actual layout phase. Hence, we only reset the 'override' value when we are executing a definite strategy. This is a reland of r261841, which was reverted because it broke spotify. This problem is now avoided thanks to bug 210089. Tests: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-minimum-contribution-with-percentages.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-dynamic-min-contribution-001.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-003.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-004.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-005.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-006.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-007.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-008.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-009.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-010.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-005.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-006.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-009.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-010.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-lr-002.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-vertical-rl-002.html * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::hasRelativeMarginOrPaddingForChild): (WebCore::hasRelativeOrIntrinsicSizeForChild): (WebCore::shouldClearOverrideContainingBlockContentSizeForChild): (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const): (WebCore::GridTrackSizingAlgorithmStrategy::minLogicalSizeForChild const): (WebCore::DefiniteSizeStrategy::minLogicalSizeForChild const): (WebCore::DefiniteSizeStrategy::minContentForChild const): * rendering/GridTrackSizingAlgorithm.h: 2020-09-23 Carlos Garcia Campos <cgarcia@igalia.com> [GTK][WPE] Move TLS errors API from WebKitContext to WebKitWebsiteDataManager https://bugs.webkit.org/show_bug.cgi?id=216822 Reviewed by Alex Christensen. Make ignoreTLSErrors a member of SoupNetworkSession, instead of being global. * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::setIgnoreTLSErrors): (WebCore::SoupNetworkSession::checkTLSErrors): (WebCore::SoupNetworkSession::setShouldIgnoreTLSErrors): Deleted. * platform/network/soup/SoupNetworkSession.h: * testing/InternalSettings.cpp: (WebCore::InternalSettings::setAllowsAnySSLCertificate): Do not use SoupNetworkSession in the web process. 2020-09-23 Tim Horton <timothy_horton@apple.com> Fix some typo'd wheel event listener logging https://bugs.webkit.org/show_bug.cgi?id=216892 Reviewed by Wenson Hsieh. * rendering/EventRegion.cpp: (WebCore::EventRegion::uniteEventListeners): Wheel is passive, NonPassiveWheel is active. 2020-09-23 Fujii Hironori <Hironori.Fujii@sony.com> Remove ENABLE_SVG_FONTS macro https://bugs.webkit.org/show_bug.cgi?id=216850 Reviewed by Don Olmstead. * CMakeLists.txt: * css/CSSFontFace.cpp: (WebCore::CSSFontFace::appendSources): (WebCore::CSSFontFace::hasSVGFontFaceSource const): * css/CSSFontFace.h: * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::CSSFontFaceSource): (WebCore::CSSFontFaceSource::load): (WebCore::CSSFontFaceSource::font): (WebCore::CSSFontFaceSource::isSVGFontFaceSource const): * css/CSSFontFaceSource.h: * css/CSSFontFaceSrcValue.cpp: (WebCore::CSSFontFaceSrcValue::isSVGFontTarget const): (WebCore::CSSFontFaceSrcValue::isSupportedFormat const): * css/CSSFontFaceSrcValue.h: * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::inspectorResourceType): * loader/LinkLoader.cpp: (WebCore::createLinkPreloadResourceClient): * loader/ResourceLoadInfo.cpp: (WebCore::ContentExtensions::toResourceType): * loader/SubresourceLoader.cpp: (WebCore::logResourceLoaded): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::defaultPriorityForResourceType): (WebCore::CachedResource::isCORSSameOrigin const): * loader/cache/CachedResource.h: * loader/cache/CachedResourceLoader.cpp: (WebCore::createResource): (WebCore::CachedResourceLoader::requestFont): (WebCore::contentTypeFromResourceType): (WebCore::CachedResourceLoader::checkInsecureContent const): (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const): (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest): (WebCore::destinationForType): * loader/cache/CachedSVGFont.cpp: * loader/cache/CachedSVGFont.h: * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::getStatistics): * rendering/svg/SVGTextLayoutEngineSpacing.cpp: * style/StyleResolver.cpp: (WebCore::Style::Resolver::addCurrentSVGFontFaceRules): * svg/SVGAltGlyphDefElement.cpp: * svg/SVGAltGlyphDefElement.h: * svg/SVGAltGlyphDefElement.idl: * svg/SVGAltGlyphElement.cpp: * svg/SVGAltGlyphElement.h: * svg/SVGAltGlyphElement.idl: * svg/SVGAltGlyphItemElement.cpp: * svg/SVGAltGlyphItemElement.h: * svg/SVGAltGlyphItemElement.idl: * svg/SVGDocumentExtensions.cpp: * svg/SVGDocumentExtensions.h: * svg/SVGElement.cpp: (WebCore::SVGElement::childShouldCreateRenderer const): * svg/SVGFontElement.cpp: * svg/SVGFontElement.h: * svg/SVGFontElement.idl: * svg/SVGFontFaceElement.cpp: * svg/SVGFontFaceElement.h: * svg/SVGFontFaceElement.idl: * svg/SVGFontFaceFormatElement.cpp: * svg/SVGFontFaceFormatElement.h: * svg/SVGFontFaceFormatElement.idl: * svg/SVGFontFaceNameElement.cpp: * svg/SVGFontFaceNameElement.h: * svg/SVGFontFaceNameElement.idl: * svg/SVGFontFaceSrcElement.cpp: * svg/SVGFontFaceSrcElement.h: * svg/SVGFontFaceSrcElement.idl: * svg/SVGFontFaceUriElement.cpp: * svg/SVGFontFaceUriElement.h: * svg/SVGFontFaceUriElement.idl: * svg/SVGGlyphElement.cpp: * svg/SVGGlyphElement.h: * svg/SVGGlyphElement.idl: * svg/SVGGlyphRefElement.cpp: * svg/SVGGlyphRefElement.h: * svg/SVGGlyphRefElement.idl: * svg/SVGHKernElement.cpp: * svg/SVGHKernElement.h: * svg/SVGHKernElement.idl: * svg/SVGMissingGlyphElement.cpp: * svg/SVGMissingGlyphElement.h: * svg/SVGMissingGlyphElement.idl: * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::rendererIsNeeded): * svg/SVGTSpanElement.cpp: (WebCore::SVGTSpanElement::childShouldCreateRenderer const): (WebCore::SVGTSpanElement::rendererIsNeeded): * svg/SVGTests.cpp: (WebCore::supportedSVGFeatures): * svg/SVGTextElement.cpp: (WebCore::SVGTextElement::childShouldCreateRenderer const): * svg/SVGTextPositioningElement.cpp: (WebCore::SVGTextPositioningElement::elementFromRenderer): * svg/SVGToOTFFontConversion.cpp: * svg/SVGVKernElement.cpp: * svg/SVGVKernElement.h: * svg/SVGVKernElement.idl: * svg/svgtags.in: 2020-09-23 Tadeu Zagallo <tzagallo@apple.com> Missing scope release in JSDOMBuiltinConstructorBase https://bugs.webkit.org/show_bug.cgi?id=216851 <rdar://problem/69144642> Reviewed by Yusuke Suzuki. In JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments, we should release the ThrowScope before calling into JavaScript since we don't intend to handle the exception. Test: js/transform-stream.html * bindings/js/JSDOMBuiltinConstructorBase.cpp: (WebCore::JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments): 2020-09-23 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Precompute the collapsible trailing width for LineBreaker https://bugs.webkit.org/show_bug.cgi?id=216881 Reviewed by Antti Koivisto. Let's just compute the collapsible trailing width while adding inline content to LineCandidate instead of reverse looping through the runs in LineBreaker. This is also in preparation for reducing the number of RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled calls. * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::ContinuousContent::hasTrailingCollapsibleContent const): (WebCore::Layout::ContinuousContent::isFullyCollapsible const): (WebCore::Layout::LineBreaker::shouldKeepEndOfLineWhitespace const): (WebCore::Layout::LineBreaker::shouldWrapInlineContent): (WebCore::Layout::LineBreaker::tryWrappingInlineContent const): (WebCore::Layout::ContinuousContent::ContinuousContent): (WebCore::Layout::ContinuousContent::nonCollapsibleLogicalWidth const): (WebCore::Layout::ContinuousContent::isTrailingContentFullyCollapsible const): Deleted. (WebCore::Layout::ContinuousContent::TrailingCollapsibleContent::reset): Deleted. * layout/inlineformatting/InlineLineBreaker.h: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineCandidate::InlineContent::collapsibleTrailingWidth const): (WebCore::Layout::LineCandidate::InlineContent::appendInlineItem): (WebCore::Layout::LineCandidate::InlineContent::reset): (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): 2020-09-23 Peng Liu <peng.liu6@apple.com> [Media in GPU Process] Implement caption support in video fullscreen and PiP https://bugs.webkit.org/show_bug.cgi?id=208752 Reviewed by Eric Carlson. Export TextTrackRepresentation so that WebKit can use it. Also, update the interface of VideoLayerManagerObjC related to text track representation to use PlatformLayer* instead of TextTrackRepresentation*. Manually tested. * WebCore.xcodeproj/project.pbxproj: Change target membership of TextTrackRepresentation.h. * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h: * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm: (WebCore::VideoLayerManagerObjC::setTextTrackRepresentationLayer): (WebCore::VideoLayerManagerObjC::setTextTrackRepresentation): Deleted. Replace setTextTrackRepresentation() with setTextTrackRepresentationLayer(). * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation): Use VideoLayerManagerObjC::setTextTrackRepresentationLayer() instead of VideoLayerManagerObjC::setTextTrackRepresentation(). * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setTextTrackRepresentation): Ditto. 2020-09-23 Chris Dumez <cdumez@apple.com> webaudio/AudioBufferSource/audiobuffersource-playbackrate.html is crashing https://bugs.webkit.org/show_bug.cgi?id=216827 Reviewed by Darin Adler. AudioBufferSourceNode::renderSilenceAndFinishIfNotLooping() would hit an assertion inside finish() because finish() was already called earlier when calling updateSchedulingInfo(). updateSchedulingInfo() already takes care of calling finish() when we're done playing. Address the issue by only calling finish() if hasFinished() returns false. No new tests, unskipped existing test. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::renderSilenceAndFinishIfNotLooping): 2020-09-23 Andres Gonzalez <andresg_22@apple.com> Fix for accessibility/aria-combobox-control-owns-elements.html in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=216878 Reviewed by Chris Fleizach. Test: accessibility/aria-combobox-control-owns-elements.html. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::updateIsolatedTree): Update the isolated tree node for ActiveDescendant and SelectedChildren notifications. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): Only cache selectedChildren for those AXObjects that canHaveSelectedChildren. 2020-09-23 Philippe Normand <pnormand@igalia.com> media/can-play-av1.html is not spec compliant https://bugs.webkit.org/show_bug.cgi?id=216873 Reviewed by Eric Carlson. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::initialize): Add the "av1" codec in the codecs mapping. 2020-09-23 Youenn Fablet <youenn@apple.com> Add support for HTMLMediaElement.setSinkId https://bugs.webkit.org/show_bug.cgi?id=216696 Reviewed by Eric Carlson. Implement setSinkId and sinkId as per https://w3c.github.io/mediacapture-output/#htmlmediaelement-extensions. Introduce a setting to expose these methods and to enable/disable user gesture requirement. Add interfaces to change device output for specific media players. Add support for HLS, MSE and MediaStreamTrack renderers on MacOS. In case of setting the empty string, the default output device is used Tests: http/wpt/audio-output/setSinkId.https.html imported/w3c/web-platform-tests/audio-output/idlharness.https.window.html imported/w3c/web-platform-tests/audio-output/setSinkId.https.html * CMakeLists.txt: * DerivedSources.make: * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::exposeDevices): * Modules/mediastream/MediaDevices.h: * WebCore.xcodeproj/project.pbxproj: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::audioOutputDevice const): (WebCore::HTMLMediaElement::setAudioOutputDevice): (WebCore::HTMLMediaElement::audioOutputDeviceId const): * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::audioOutputHashedDeviceId const): * html/HTMLMediaElementAudioOutput.idl: Added. * page/Settings.yaml: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::audioOutputDeviceChanged): * platform/graphics/MediaPlayer.h: (WebCore::MediaPlayerClient::audioOutputDeviceId const): (WebCore::MediaPlayerClient::audioOutputDeviceIdOverride const): (WebCore::MediaPlayer::audioOutputDeviceId const): (WebCore::MediaPlayer::audioOutputDeviceIdOverride const): * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::audioOutputDeviceChanged): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::audioOutputDeviceChanged): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::audioOutputDeviceChanged): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::audioOutputDeviceChanged): * platform/mediastream/AudioMediaStreamTrackRenderer.h: (WebCore::AudioMediaStreamTrackRenderer::setAudioOutputDevice): * platform/mediastream/AudioTrackPrivateMediaStream.cpp: (WebCore::AudioTrackPrivateMediaStream::setAudioOutputDevice): * platform/mediastream/AudioTrackPrivateMediaStream.h: * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp: (WebCore::AudioMediaStreamTrackRendererCocoa::setAudioOutputDevice): (WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples): * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h: * platform/mediastream/mac/AudioMediaStreamTrackRendererUnit.cpp: (WebCore::AudioMediaStreamTrackRendererUnit::setAudioOutputDevice): (WebCore::AudioMediaStreamTrackRendererUnit::createAudioUnitIfNeeded): * platform/mediastream/mac/AudioMediaStreamTrackRendererUnit.h: 2020-09-23 Philippe Normand <pnormand@igalia.com> REGRESSION(r267383): fast/mediastream/getUserMedia-webaudio.html is failing https://bugs.webkit.org/show_bug.cgi?id=216813 Reviewed by Adrian Perez de Castro. Revert r267428 and fixup the GStreamer FFT implementation which broke in r267383. * platform/audio/FFTFrame.cpp: (WebCore::FFTFrame::multiply): * platform/audio/FFTFrameStub.cpp: (WebCore::FFTFrame::multiply): Deleted. * platform/audio/gstreamer/FFTFrameGStreamer.cpp: (WebCore::FFTFrame::doFFT): Update the real and imaginary arrays after applying the FFT. (WebCore::FFTFrame::multiply): Deleted. * platform/audio/mac/FFTFrameMac.cpp: (WebCore::FFTFrame::multiply): Deleted. 2020-09-23 Philippe Normand <pnormand@igalia.com> Unreviewed, prospective GTK build fix after r267449. * svg/SVGPathBlender.cpp: Include <functional>, needed for std::invoke(). 2020-09-23 Cathie Chen <cathiechen@igalia.com> Wheel event phases of FrameView are not handled correctly https://bugs.webkit.org/show_bug.cgi?id=216870 Reviewed by Simon Fraser. In AsyncScrollingCoordinator::handleWheelEventPhase, the scrollAnimator of a FrameView should be from FrameView itself, not ScrollableArea. It doesn't call nodeDidHandleEvent to handle wheel event phases when !asyncFrameOrOverflowScrollingEnabled. Should call it after handleWheelEvent. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::handleWheelEventPhase): When nodeID is FrameView, we should use the scrollAnimator of FrameView instead. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::handleWheelEvent): If wheelEvent is handled, we should call nodeDidHandleEvent to handle the phases. 2020-09-23 Antti Koivisto <antti@apple.com> [LFC][Integration] Add canUseFor functions https://bugs.webkit.org/show_bug.cgi?id=216869 Reviewed by Zalan Bujtas. Copy the SLL canUseFor code. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/integration/LayoutIntegrationCoverage.cpp: Added. (WebCore::LayoutIntegration::canUseForCharacter): (WebCore::LayoutIntegration::canUseForText): (WebCore::LayoutIntegration::canUseForFontAndText): (WebCore::LayoutIntegration::canUseForStyle): (WebCore::LayoutIntegration::canUseForLineLayoutWithReason): (WebCore::LayoutIntegration::canUseForLineLayout): (WebCore::LayoutIntegration::canUseForLineLayoutAfterStyleChange): * layout/integration/LayoutIntegrationCoverage.h: Added. Also switch to OptionSet. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::isEnabled): (WebCore::LayoutIntegration::LineLayout::canUseFor): (WebCore::LayoutIntegration::LineLayout::canUseForAfterStyleChange): * layout/integration/LayoutIntegrationLineLayout.h: (WebCore::LayoutIntegration::LineLayout::canUseFor): Deleted. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutInlineChildren): 2020-09-23 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Remove redundant RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled from Line::Run::hasTrailingLetterSpacing https://bugs.webkit.org/show_bug.cgi?id=216867 Reviewed by Simon Fraser. This codepath is only triggered when Line::TrimmableTrailingContent has a partially trimmable run. However we don't add such runs unless m_shouldIgnoreTrailingLetterSpacing is false (which is already based on the RuntimeEnabledFeatures flag). * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::Run::hasTrailingLetterSpacing const): (WebCore::Layout::Line::Run::trailingLetterSpacing const): 2020-09-22 Patrick Angle <pangle@apple.com> Web Inspector: Change `InspectorAnimationAgent->startTracking` to not error on repeated calls https://bugs.webkit.org/show_bug.cgi?id=216385 Reviewed by Devin Rousso. InpsectorAnimationAgent now mirrors the behavior of other timeline agents by no longer returning an error on a repeated invocation of `startTracking`. * inspector/agents/InspectorAnimationAgent.cpp: (WebCore::InspectorAnimationAgent::startTracking): 2020-09-22 Antti Koivisto <antti@apple.com> [LFC][Integration] Basic pagination support https://bugs.webkit.org/show_bug.cgi?id=215451 <rdar://problem/67482721> Reviewed by Zalan Bujtas. Port the Simple Line Layout pagination code to LFC integration layer. Pagination is the last remaining use of SLL so this patch turns it into dead code. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/displaytree/DisplayInlineContent.h: (WebCore::Display::InlineContent::create): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::canUseFor): This now the same as SLL test, covering all cases. (WebCore::LayoutIntegration::LineLayout::contentLogicalHeight const): (WebCore::LayoutIntegration::LineLayout::adjustForPagination): (WebCore::LayoutIntegration::LineLayout::ensureDisplayInlineContent): This is fairly direct copy of the SLL code. It is not future proof or otherwise great but it serves the job for now. * layout/integration/LayoutIntegrationLineLayout.h: (WebCore::LayoutIntegration::LineLayout::isPaginated const): * layout/integration/LayoutIntegrationPagination.cpp: Added. (WebCore::LayoutIntegration::computeLineTopAndBottomWithOverflow): (WebCore::LayoutIntegration::computeLineBreakIndex): (WebCore::LayoutIntegration::computeOffsetAfterLineBreak): (WebCore::LayoutIntegration::setPageBreakForLine): (WebCore::LayoutIntegration::updateMinimumPageHeight): (WebCore::LayoutIntegration::makeAdjustedContent): (WebCore::LayoutIntegration::adjustLinePositionsForPagination): * layout/integration/LayoutIntegrationPagination.h: Copied from Source/WebCore/layout/displaytree/DisplayInlineContent.h. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutLFCLines): (WebCore::RenderBlockFlow::ensureLineBoxes): 2020-09-22 Zalan Bujtas <zalan@apple.com> [LFC][Integration] Move RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled() check out from LineBuilder::constraintsForLine https://bugs.webkit.org/show_bug.cgi?id=216862 Reviewed by Simon Fraser. * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::setIsIntegratedRootBoxFirstChild): * layout/LayoutState.h: (WebCore::Layout::LayoutState::isIntegratedRootBoxFirstChild const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::constraintsForLine): 2020-09-22 Zalan Bujtas <zalan@apple.com> [LFC][Floats] Remove the redundant RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled() check from FloatingState::append https://bugs.webkit.org/show_bug.cgi?id=216866 Reviewed by Simon Fraser. The no-layout-box-for-the-FloatItem codepath is reserved for the IFC integration. This is temporary anyway. * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::append): 2020-09-22 Lauro Moura <lmoura@igalia.com> [GTK] REGRESSION(r267329): imported/blink/editing/undo/crash-redo-with-iframes.html is crashing https://bugs.webkit.org/show_bug.cgi?id=216778 Reviewed by Darin Adler. Covered by existing tests. * editing/markup.cpp: (WebCore::serializePreservingVisualAppearanceInternal): Return early also for "negative" ranges to avoid hitting an assertion inside serializeNodes, as suggested by Darin. 2020-09-22 Chris Dumez <cdumez@apple.com> Slightly improve AudioBufferSourceNode resampling https://bugs.webkit.org/show_bug.cgi?id=216859 Reviewed by Eric Carlson. Slightly improve AudioBufferSourceNode resampling. Use simple linear extrapolation to resample the data when we reach the end of the buffer. Previously, the last sample would just be repeated enough times. This is a merge of the following Blink change by Raymond Toy: - https://chromium-review.googlesource.com/c/chromium/src/+/1211910/ No new tests, rebaselined existing tests. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::renderFromBuffer): 2020-09-22 Sam Weinig <weinig@apple.com> [WebIDL] Switch to new file name convention for partial interfaces https://bugs.webkit.org/show_bug.cgi?id=216843 Reviewed by Tim Horton. Updates all 'partial interface' IDLs to use the new naming convention adopted in https://webkit.org/b/216729, where they are name as the construction of the base interface '+' the supplementing spec. So, additions to Document from the Web Animations spec becomes Document+WebAnimations.idl. * accessibility/AccessibilityRenderObject.cpp: * bindings/js/JSDocumentCustom.cpp: * bindings/js/JSXMLDocumentCustom.cpp: * html/HTMLFrameOwnerElement.h: * loader/FrameLoader.cpp: * page/FrameView.cpp: * svg/DocumentSVG.cpp: Added. * svg/DocumentSVG.h: Added. * svg/SVGDocument.cpp: * svg/SVGDocument.h: * svg/SVGTRefElement.cpp: * svg/graphics/SVGImage.cpp: * style/StyleAdjuster.cpp: * svg/Document+SVG.idl: Added. * svg/SVGDocument.idl: Removed. Fix weirdness around SVGDocument. Previously, additions to the Document interface were in a class that was also a document subclass. Now the two are split, so the additions are in DocumentSVG.h/cpp, matching convention, and the subclass remains SVGDocument.h/cpp, also matching convention. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Update for renames. * Modules/async-clipboard/Navigator+Clipboard.idl: Added. * Modules/async-clipboard/NavigatorClipboard.idl: Removed. * Modules/beacon/Navigator+Beacon.idl: Added. * Modules/beacon/NavigatorBeacon.idl: Removed. * Modules/cache/DOMWindow+Caches.idl: Added. * Modules/cache/DOMWindowCaches.idl: Removed. * Modules/cache/WorkerGlobalScope+Caches.idl: Added. * Modules/cache/WorkerGlobalScopeCaches.idl: Removed. * Modules/credentialmanagement/Navigator+Credentials.idl: Added. * Modules/credentialmanagement/NavigatorCredentials.idl: Removed. * Modules/encryptedmedia/Navigator+EME.idl: Added. * Modules/encryptedmedia/NavigatorEME.idl: Removed. * Modules/entriesapi/HTMLInputElement+EntriesAPI.idl: Added. * Modules/entriesapi/HTMLInputElementEntriesAPI.idl: Removed. * Modules/fetch/WindowOrWorkerGlobalScope+Fetch.idl: Added. * Modules/fetch/WindowOrWorkerGlobalScopeFetch.idl: Removed. * Modules/gamepad/Navigator+Gamepad.idl: Added. * Modules/gamepad/NavigatorGamepad.idl: Removed. * Modules/geolocation/Navigator+Geolocation.idl: Added. * Modules/geolocation/NavigatorGeolocation.idl: Removed. * Modules/indexeddb/DOMWindow+IndexedDatabase.idl: Added. * Modules/indexeddb/DOMWindowIndexedDatabase.idl: Removed. * Modules/indexeddb/WorkerGlobalScope+IndexedDatabase.idl: Added. * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl: Removed. * Modules/mediacapabilities/Navigator+MediaCapabilities.idl: Added. * Modules/mediacapabilities/NavigatorMediaCapabilities.idl: Removed. * Modules/mediasession/HTMLMediaElement+MediaSession.idl: Added. * Modules/mediasession/HTMLMediaElementMediaSession.idl: Removed. * Modules/mediasource/AudioTrack+MediaSource.idl: Added. * Modules/mediasource/AudioTrackMediaSource.idl: Removed. * Modules/mediasource/DOMURL+MediaSource.idl: Added. * Modules/mediasource/DOMURLMediaSource.idl: Removed. * Modules/mediasource/TextTrack+MediaSource.idl: Added. * Modules/mediasource/TextTrackMediaSource.idl: Removed. * Modules/mediasource/VideoTrack+MediaSource.idl: Added. * Modules/mediasource/VideoTrackMediaSource.idl: Removed. * Modules/mediastream/Navigator+MediaDevices.idl: Added. * Modules/mediastream/NavigatorMediaDevices.idl: Removed. * Modules/pictureinpicture/Document+PictureInPicture.idl: Added. * Modules/pictureinpicture/DocumentOrShadowRoot+PictureInPicture.idl: Added. * Modules/pictureinpicture/DocumentOrShadowRootPictureInPicture.idl: Removed. * Modules/pictureinpicture/DocumentPictureInPicture.idl: Removed. * Modules/pictureinpicture/HTMLVideoElement+PictureInPicture.idl: Added. * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.idl: Removed. * Modules/quota/DOMWindow+Quota.idl: Added. * Modules/quota/DOMWindowQuota.idl: Removed. * Modules/quota/Navigator+StorageQuota.idl: Added. * Modules/quota/NavigatorStorageQuota.idl: Removed. * Modules/quota/WorkerNavigator+StorageQuota.idl: Added. * Modules/quota/WorkerNavigatorStorageQuota.idl: Removed. * Modules/remoteplayback/HTMLMediaElement+RemotePlayback.idl: Added. * Modules/remoteplayback/HTMLMediaElementRemotePlayback.idl: Removed. * Modules/speech/DOMWindow+SpeechSynthesis.idl: Added. * Modules/speech/DOMWindowSpeechSynthesis.idl: Removed. * Modules/webdatabase/DOMWindow+WebDatabase.idl: Added. * Modules/webdatabase/DOMWindowWebDatabase.idl: Removed. * Modules/webdriver/Navigator+WebDriver.idl: Added. * Modules/webdriver/NavigatorWebDriver.idl: Removed. * Modules/webgpu/Navigator+GPU.idl: Added. * Modules/webgpu/NavigatorGPU.idl: Removed. * Modules/webgpu/WorkerNavigator+GPU.idl: Added. * Modules/webgpu/WorkerNavigatorGPU.idl: Removed. * Modules/webxr/Navigator+WebXR.idl: Added. * Modules/webxr/NavigatorWebXR.idl: Removed. * animation/Document+WebAnimations.idl: Added. * animation/DocumentAnimations.idl: Removed. * animation/DocumentOrShadowRoot+WebAnimations.idl: Added. * animation/DocumentOrShadowRootAnimations.idl: Removed. * animation/GlobalEventHandlers+CSSAnimations.idl: Added. * animation/GlobalEventHandlers+CSSTransitions.idl: Added. * animation/GlobalEventHandlersCSSAnimations.idl: Removed. * animation/GlobalEventHandlersCSSTransitions.idl: Removed. * css/DOMCSSNamespace+CSSPainting.idl: Added. * css/DOMCSSNamespace+CSSPropertiesandValues.idl: Added. * css/DOMCSSPaintWorklet.idl: Removed. * css/DOMCSSRegisterCustomProperty.idl: Removed. * css/DocumentOrShadowRoot+CSSOM.idl: Added. * css/DocumentOrShadowRootStyleSheets.idl: Removed. * dom/Document+CSSOMView.idl: Added. * dom/Document+Fullscreen.idl: Added. * dom/Document+HTML.idl: Added. * dom/Document+HTMLObsolete.idl: Added. * dom/Document+PageVisibility.idl: Added. * dom/Document+PointerLock.idl: Added. * dom/Document+Selection.idl: Added. * dom/Document+StorageAccess.idl: Added. * dom/Document+Touch.idl: Added. * dom/Document+UndoMananger.idl: Added. * dom/DocumentFullscreen.idl: Removed. * dom/DocumentHTML.idl: Removed. * dom/DocumentHTMLObsolete.idl: Removed. * dom/DocumentOrShadowRoot+PointerLock.idl: Added. * dom/DocumentOrShadowRootPointerLock.idl: Removed. * dom/DocumentPageVisibility.idl: Removed. * dom/DocumentPointerLock.idl: Removed. * dom/DocumentScrolling.idl: Removed. * dom/DocumentSelection.idl: Removed. * dom/DocumentStorageAccess.idl: Removed. * dom/DocumentTouch.idl: Removed. * dom/DocumentUndoMananger.idl: Removed. * dom/Element+DOMParsing.idl: Added. * dom/ElementDOMParsing.idl: Removed. * dom/GlobalEventHandlers+PointerEvents.idl: Added. * dom/GlobalEventHandlersPointerEvents.idl: Removed. * page/Navigator+IsLoggedIn.idl: Added. * page/NavigatorIsLoggedIn.idl: Removed. Rename IDLs. 2020-09-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Used geometry for inline level boxes should be in the coordinate system of the formatting context root https://bugs.webkit.org/show_bug.cgi?id=216854 Reviewed by Simon Fraser. Convert inline level box geometry from relative to the line box to relative to the formatting context root. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): 2020-09-22 Chris Dumez <cdumez@apple.com> Fix BiquadFilterNode's lowpass & highpass filters https://bugs.webkit.org/show_bug.cgi?id=216852 Reviewed by Eric Carlson. Fix BiquadFilterNode's lowpass & highpass filters. They incorrectly clamp the resonance to make it positive. Formulas for the filters are specified here: - https://www.w3.org/TR/webaudio/#filters-characteristics No new tests, rebaselined existing tests. * platform/audio/Biquad.cpp: (WebCore::pow10): (WebCore::Biquad::setLowpassParams): (WebCore::Biquad::setHighpassParams): 2020-09-22 Chris Dumez <cdumez@apple.com> Merge AudioBufferSourceNode loop fixes from Blink https://bugs.webkit.org/show_bug.cgi?id=216849 Reviewed by Eric Carlson. Merge AudioBufferSourceNode loop fixes from Blink, the following one in particular: - https://codereview.chromium.org/723823002 This allows us to pass all the checks in: webaudio/AudioBufferSource/audiobuffersource-loop-comprehensive.html. No new tests, rebaselined existing test. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::renderFromBuffer): (WebCore::AudioBufferSourceNode::adjustGrainParameters): Merge loop fixes from Blink. * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::stopLater): Stop throwing when m_endTime is already set. Our behavior did not match Chrome and Firefox here. This was causing some existing tests to start failing now that providing a grain duration when calling start() would set m_endTime if loop() returns true. 2020-09-22 Sihui Liu <sihui_liu@apple.com> REGRESSION(r266075): WebContent process crashes at TextManipulationController::getPath https://bugs.webkit.org/show_bug.cgi?id=216846 Reviewed by Wenson Hsieh. TextIterator does not visit node that has no renderer, so if node has become hidden, TextManipulationController will not find content node in paragraph range during replacement. API Test: TextManipulation.CompleteTextManipulationParagraphBecomesHidden * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::replace): 2020-09-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Atomic inline-level box with margin is mispositioned https://bugs.webkit.org/show_bug.cgi?id=216842 Reviewed by Antti Koivisto. The inline box that an atomic inline-level box generates has the height of the margin box. Therefore the inline box's logical top position is the position of the top edge of the margin box. When converting the inline box geometry back to the layout box, we need to offset the top position (border box top edge) with the value of the used margin before. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): 2020-09-22 Chris Dumez <cdumez@apple.com> AudioParam.setValueCurveAtTime() should have an implicit call to setValueAtTime() at the end https://bugs.webkit.org/show_bug.cgi?id=216839 Reviewed by Eric Carlson. AudioParam.setValueCurveAtTime() should have an implicit call to setValueAtTime() at the end, as specified here: - https://www.w3.org/TR/webaudio/#dom-audioparam-setvaluecurveattime """ An implicit call to setValueAtTime() is made at time 𝑇0+𝑇𝐷 with value 𝑉[𝑁−1] so that following automations will start from the end of the setValueCurveAtTime() event. """ No new tests, rebaselined existing test. * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::setValueCurveAtTime): 2020-09-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for multiline inline box geometry. https://bugs.webkit.org/show_bug.cgi?id=216835 Reviewed by Antti Koivisto. This patch computes the geometry for inline boxes spanning multiple lines (e.g. <span>first line<br>next line</span). However this is not the getBoundingClientRect() type of geometry where we provide geometry for each fragments. This is more like the element.offset* geometry where we compute the enclosing rectangle for all the fragments. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): Decouple the run construction and inline box geometry update logic, where we loop through the runs and create "line runs" when needed and then we loop through the inline boxes on the current line and update the box geometries. (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::lineBoxes const): (WebCore::Layout::InlineFormattingState::addLineBox): (WebCore::Layout::InlineFormattingState::clearLineAndRuns): (WebCore::Layout::InlineFormattingState::shrinkToFit): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::containsInlineLevelBox const): 2020-09-22 Chris Dumez <cdumez@apple.com> AudioParams with automations must process timelines https://bugs.webkit.org/show_bug.cgi?id=216837 Reviewed by Darin Adler. Currently, if an AudioNode has no inputs connected, any automations (or connections) to an AudioParam of the node is not processed. Thus, time never advances on the AudioParam, and any upstream graph connected to the AudioParam never gets pulled for data. AudioParam should get processed so that time progresses. Normal processing of the node causes AudioParams to be processed, so we were only missing the case where the node has silent inputs (silent or no inputs). Then we just need to update the AudioParams, without having to do the full processing associated with the node. See https://webaudio.github.io/web-audio-api/#rendering-loop, step 8.1.1 in particular that says any inputs connected to an AudioParam are processed. There are no conditions on when this happens. This is a merge of the following Blink change by Raymond Toy: - https://codereview.chromium.org/2420983002 No new tests, rebaselined existing test. * Modules/webaudio/AudioBasicProcessorNode.cpp: (WebCore::AudioBasicProcessorNode::processOnlyAudioParams): * Modules/webaudio/AudioBasicProcessorNode.h: * Modules/webaudio/AudioListener.h: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::processIfNecessary): * Modules/webaudio/AudioNode.h: (WebCore::AudioNode::processOnlyAudioParams): * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::BiquadFilterNode): * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::processOnlyAudioParams): * Modules/webaudio/BiquadProcessor.h: * Modules/webaudio/DelayDSPKernel.cpp: (WebCore::DelayDSPKernel::processOnlyAudioParams): * Modules/webaudio/DelayDSPKernel.h: * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::DelayNode): * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::processOnlyAudioParams): * Modules/webaudio/DynamicsCompressorNode.h: * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::processOnlyAudioParams): * Modules/webaudio/GainNode.h: * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::processOnlyAudioParams): * Modules/webaudio/PannerNode.h: * Modules/webaudio/StereoPannerNode.cpp: (WebCore::StereoPannerNode::processOnlyAudioParams): * Modules/webaudio/StereoPannerNode.h: * platform/audio/AudioDSPKernel.h: (WebCore::AudioDSPKernel::processOnlyAudioParams): * platform/audio/AudioDSPKernelProcessor.cpp: (WebCore::AudioDSPKernelProcessor::processOnlyAudioParams): * platform/audio/AudioDSPKernelProcessor.h: * platform/audio/AudioProcessor.h: (WebCore::AudioProcessor::processOnlyAudioParams): 2020-09-22 Chris Dumez <cdumez@apple.com> Unreviewed, partial revert of r267383. Restore GStreamer-specific implementation of FFTFrame::multiply() since it appears r267383 introduced test failures on GTK port. * platform/audio/FFTFrame.cpp: (WebCore::FFTFrame::multiply): Deleted. * platform/audio/FFTFrameStub.cpp: (WebCore::FFTFrame::multiply): * platform/audio/gstreamer/FFTFrameGStreamer.cpp: (WebCore::FFTFrame::multiply): * platform/audio/mac/FFTFrameMac.cpp: (WebCore::FFTFrame::multiply): 2020-09-22 Zalan Bujtas <zalan@apple.com> [LFC] FormattingState should never be copied. https://bugs.webkit.org/show_bug.cgi?id=216833 Reviewed by Antti Koivisto. Even when running a throw-away layout, we should not copy the state object but instead generate a new one for the subtree. These objects should never be copied in general. * layout/FormattingState.h: * layout/LayoutState.h: * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell): 2020-09-22 Youenn Fablet <youenn@apple.com> Implement a default prompt for getUserMedia https://bugs.webkit.org/show_bug.cgi?id=216821 Reviewed by Eric Carlson. Manually tested by running Minibrowser. * en.lproj/Localizable.strings: 2020-09-22 Chris Dumez <cdumez@apple.com> webaudio/AudioParam/audioparam-setTarget-timeConstant-0.html is crashing https://bugs.webkit.org/show_bug.cgi?id=216824 Reviewed by Darin Adler. If the time constant pass to AudioParam.setTargetAtTime() is 0, then insert a SetValue event in the timeline instead of a SetTarget one, causing us to instantly jump to the target value. This matches the Blink behavior. No new tests, unskipped existing test. * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::setTargetAtTime): 2020-09-22 Brian Burg <bburg@apple.com> [Cocoa] _WKInspectorDelegate should handle showing external resources https://bugs.webkit.org/show_bug.cgi?id=216334 Reviewed by Devin Rousso. Adapt to the rename of InspectorFrontendHost.{openInNewTab => openURLExternally}. * inspector/InspectorFrontendClient.h: * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::openURLExternally): (WebCore::InspectorFrontendClientLocal::openInNewTab): Deleted. * inspector/InspectorFrontendClientLocal.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::openURLExternally): (WebCore::InspectorFrontendHost::openInNewTab): Deleted. * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.idl: 2020-09-22 Sam Weinig <weinig@apple.com> [WebIDL] Split up Performance.idl into component partials https://bugs.webkit.org/show_bug.cgi?id=216729 Reviewed by Darin Adler. Split additions to the Peformance interface from the Navagation Timing, Resource Timing, User Timing and Performance Timeline specs into their own IDL files. Trying something new with the naming (using Performance '+' name of the spec supplying the addition) for these partials to test the waters. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * page/Performance+NavigationTiming.idl: Added. * page/Performance+PerformanceTimeline.idl: Added. * page/Performance+ResourceTiming.idl: Added. * page/Performance+UserTiming.idl: Added. * page/Performance.idl: 2020-09-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] TextUtil::split needs logical left https://bugs.webkit.org/show_bug.cgi?id=216798 Reviewed by Antti Koivisto. Measuring text content requires logical left offset (e.g. tab size depends on the logical position). Let's pass in the current logical left position to TextUtil::split. * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::ContinuousContent::runs const): (WebCore::Layout::ContinuousContent::isEmpty const): (WebCore::Layout::ContinuousContent::logicalWidth const): (WebCore::Layout::ContinuousContent::logicalLeft const): (WebCore::Layout::ContinuousContent::nonCollapsibleLogicalWidth const): (WebCore::Layout::LineBreaker::isContentWrappingAllowed const): (WebCore::Layout::LineBreaker::shouldKeepEndOfLineWhitespace const): (WebCore::Layout::LineBreaker::shouldWrapInlineContent): (WebCore::Layout::LineBreaker::tryWrappingInlineContent const): (WebCore::Layout::LineBreaker::wrapTextContent const): (WebCore::Layout::LineBreaker::tryBreakingTextRun const): (WebCore::Layout::ContinuousContent::ContinuousContent): (WebCore::Layout::ContinuousContent::hasTextContentOnly const): (WebCore::Layout::ContinuousContent::isVisuallyEmptyWhitespaceContentOnly const): (WebCore::Layout::ContinuousContent::firstTextRunIndex const): (WebCore::Layout::ContinuousContent::lastContentRunIndex const): (WebCore::Layout::ContinuousContent::hasNonContentRunsOnly const): (WebCore::Layout::ContinuousContent::size const): Deleted. (WebCore::Layout::ContinuousContent::width const): Deleted. (WebCore::Layout::ContinuousContent::nonCollapsibleWidth const): Deleted. * layout/inlineformatting/InlineLineBreaker.h: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): 2020-09-22 Sam Weinig <weinig@apple.com> Update User Timing interfaces to User Timing Level 3 https://bugs.webkit.org/show_bug.cgi?id=216787 Reviewed by Alex Christensen. Adds support for User Timing Level 3 which adds more flexibility in how PerformanceMarks and PerformanceMeasures are created via synthetic start/end times and associate 'details' values serialized with events themselves. Updates results to existing WPT and standalone tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add new files. * page/Performance.cpp: (WebCore::Performance::mark): (WebCore::Performance::clearMarks): (WebCore::Performance::measure): (WebCore::Performance::clearMeasures): * page/Performance.h: * page/Performance.idl: Update for new signatures for mark and measure, and rename of UserTiming to PerformanceUserTiming. * page/PerformanceMark.cpp: Added. (WebCore::peformanceNow): (WebCore::PerformanceMark::create): (WebCore::PerformanceMark::PerformanceMark): (WebCore::PerformanceMark::detail): * page/PerformanceMark.h: * page/PerformanceMark.idl: Add support for PerformanceMark's constructor `detail` getter. While the spec says to serialize and the deserialize in the constructor, we only serialize, and delay deserialization until the first access, which is a non-observable difference. We also utilize [CachedAttribute] to only ever deserialize once per wrapper world (and also greatly simplify the GC shenanigans). * page/PerformanceMarkOptions.h: Added. * page/PerformanceMarkOptions.idl: Added. Import and bind PerformanceMarkOptions dictionary to a new struct. * page/PerformanceMeasure.cpp: Added. (WebCore::PerformanceMeasure::create): (WebCore::PerformanceMeasure::PerformanceMeasure): (WebCore::PerformanceMeasure::detail): * page/PerformanceMeasure.h: * page/PerformanceMeasure.idl: Like with PerformanceMark, but there is no constructor here, so we only need to handle adding support for the detail getter. * page/PerformanceMeasureOptions.h: Added. * page/PerformanceMeasureOptions.idl: Added. Import and bind PerformanceMeasureOptions dictionary to a new struct. * page/PerformanceUserTiming.cpp: (WebCore::restrictedMarkNamesToNavigationTimingFunctionMap): (WebCore::restrictedMarkFunction): (WebCore::isRestrictedMarkNameNonMainThread): (WebCore::PerformanceUserTiming::isRestrictedMarkName): Split up existing map to enable accessing it safely from a worker using conservative callOnMainThreadAndWait approach, though since the map is immutable after initialization, we can probably optimize this to allow concurrent querying in the future. (WebCore::addPerformanceEntry): Add helper, mirroring clearPerformanceEntries, to add entries. (WebCore::PerformanceUserTiming::mark): Matching the spec language, utilize the new PerformanceMark constructor to create the mark. (WebCore::PerformanceUserTiming::convertMarkToTimestamp const): (WebCore::isNonEmptyDictionary): (WebCore::PerformanceUserTiming::measure): Implement measure support by dispatching various combinations of arguments to overloads manually by inspecting the Variant. * page/PerformanceUserTiming.h: Renames class from UserTiming to PerformanceUserTiming to match file names. 2020-09-22 Youenn Fablet <youenn@apple.com> toRTCIceProtocol should handle ssltcp candidates https://bugs.webkit.org/show_bug.cgi?id=216762 Reviewed by Darin Adler. Covered by mock WebRTC backend pushing ssltcp candidates. * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::toRTCIceProtocol): * testing/MockLibWebRTCPeerConnection.cpp: 2020-09-21 Adrian Perez de Castro <aperez@igalia.com> [GTK] Bump cairo version to support HiDPI https://bugs.webkit.org/show_bug.cgi?id=133378 Reviewed by Carlos Garcia Campos. Remove conditional compilation around cairo_{g,s}et_device_scale() as there is no need to support older versions of Cairo which lack the functions. The minimum version of Cairo being required by CMake is 1.14.0, which already includes them. No new tests needed. * platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp: (WebCore::createCairoImageSurfaceWithFastMalloc): Use cairo_surface_set_device_scale() directly. (WebCore::BackingStoreBackendCairoImpl::scroll): Use cairo_surface_get_device_scale() directly. * platform/graphics/cairo/BackingStoreBackendCairoX11.cpp: (WebCore::BackingStoreBackendCairoX11::BackingStoreBackendCairoX11): Use cairo_surface_set_device_scale() directly. (WebCore::BackingStoreBackendCairoX11::scroll): Use cairo_surface_get_device_scale() directly. * platform/graphics/cairo/CairoUtilities.cpp: Remove helper functions cairoSurfaceSetDeviceScale() and cairoSurfaceGetDeviceScale(). * platform/graphics/cairo/CairoUtilities.h: Ditto. 2020-09-21 Tim Horton <timothy_horton@apple.com> paper.io ad close buttons cannot be iteracted with via trackpad on iPad https://bugs.webkit.org/show_bug.cgi?id=216812 <rdar://problem/68738585> Reviewed by Wenson Hsieh. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isPaperIO): 2020-09-21 Chris Dumez <cdumez@apple.com> Value returned by AudioParamTimeline::valuesForTimeRange() is sometimes incorrect for exponential ramps https://bugs.webkit.org/show_bug.cgi?id=216811 Reviewed by Darin Adler. AudioParamTimeline::valuesForTimeRangeImpl() always need to return the *last* value since this is what will be used to update AudioParam::m_value to its latest value. We had a bug in our exponential ramp processing causing value to be multiplied one extra time. No new tests, rebaselined existing test. * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valuesForTimeRangeImpl): 2020-09-21 Chris Dumez <cdumez@apple.com> AudioBufferSourceNode should update grain parameters when buffer is set after rendering has started https://bugs.webkit.org/show_bug.cgi?id=216808 Reviewed by Eric Carlson. AudioBufferSourceNode should update grain parameters when buffer is set after rendering has started. The grain parameters need to be adjusted so that they make sense given the buffer length. Previously, we would only update grain parameters in AudioBufferSourceNode::startPlaying(), when a buffer is set. We would fail to update those grain parameters when the buffer is set, in setBuffer(), if startPlaying() has already been called. No new tests, rebaselined existing test. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::setBuffer): (WebCore::AudioBufferSourceNode::startLater): (WebCore::AudioBufferSourceNode::startPlaying): (WebCore::AudioBufferSourceNode::updateGrainParameters): * Modules/webaudio/AudioBufferSourceNode.h: 2020-09-21 Chris Dumez <cdumez@apple.com> Values returned by FFTFrame::doFFT() are twice as large as they should be https://bugs.webkit.org/show_bug.cgi?id=216781 Reviewed by Darin Adler. To provide the best possible execution speeds, the vDSP library's functions don't always adhere strictly to textbook formulas for Fourier transforms, and must be scaled accordingly [1]. In the case of a Real forward Transform like in FFTFrame::doFFT(): RFimp = RFmath * 2 so we need to divide the output by 2 to get the correct value. We were failing to do this scaling and this was causing AnalyserNode tests to fail. [1] See https://developer.apple.com/library/archive/documentation/Performance/Conceptual/vDSP_Programming_Guide/UsingFourierTransforms/UsingFourierTransforms.html#//apple_ref/doc/uid/TP40005147-CH3-SW5 No new tests, rebaselined existing tests. * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::createBandLimitedTables): Update normalization factor now that FFTFrame::doInverseFFT() has been fixed. The new normalization factor matches the value used by blink at: - https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/modules/webaudio/periodic_wave.cc * platform/audio/FFTFrame.cpp: (WebCore::FFTFrame::multiply): We were applying a 0.5 scaling factor to the output of vDSP_zvmul(). However, the documentation for vDSP_zvmul() does not indicate that its output is twice as large as expected. Odds are that this was done because we used to have a bug in FFTFrame::doFFT() that was returning values twice as large as expected. SInce this function relies on VectorMath, there is no need for its implementation to be platform-specific. * platform/audio/FFTFrameStub.cpp: * platform/audio/gstreamer/FFTFrameGStreamer.cpp: (WebCore::FFTFrame::doFFT): (WebCore::FFTFrame::doInverseFFT): Drop 2 factor in the GStreamer implementation that was added to try and be consistent with the incorrect Mac implementation. * platform/audio/mac/FFTFrameMac.cpp: (WebCore::FFTFrame::doFFT): Fix issue where the values returned by doFFT() were twice as large as expected due to the odd behavior of vDSP_fft_zrip(). (WebCore::FFTFrame::doInverseFFT): Drop 2 factor in doInverseFFT that was added because the output of doFFT() was twice as large as expected and we wanted x == InverseFFT(FFT(x)). 2020-09-21 Wenson Hsieh <wenson_hsieh@apple.com> [GPU Process] Several tests in canvas/philip/tests are failing with text diffs https://bugs.webkit.org/show_bug.cgi?id=216800 Reviewed by Darin Adler. When using the GPU process to render canvas elements, we currently fail the 7 tests in `canvas/philip/tests` below, due to gradient and pattern fill/stroke styles lingering on the 2D graphics context state after a fill or stroke color is set, respectively. This happens when: 1. The fill color is set to a color `C`. 2. A fill pattern or gradient is applied. 3. The fill color is set to the color `C` again. In this case, after step (2), we propagate a graphics context state change indicating that the fill pattern has changed, but we leave the fill color unchanged (i.e., it remains equal to `C`). In step (3), we then set the fill color to `C` again, which doesn't propagate a state change to the GPU process, since the fill color is the same (`C`). As such, the state in the GPU process keeps its fill gradient, and we end up filling with this old gradient instead of the fill color `C`. To fix this, we simply revert `fillColor` and `strokeColor` to the invalid color when setting a gradient or pattern in the same way that we currently clear out the fill/stroke gradient and pattern when setting a fill/ stroke color, which ensures that a state change will be sent to the GPU process during step (3). Fixes the following canvas-related layout tests when using the GPU process: - canvas/philip/tests/2d.gradient.radial.cone.shape2.html - canvas/philip/tests/2d.pattern.basic.nocontext.html - canvas/philip/tests/2d.pattern.paint.norepeat.coord3.html - canvas/philip/tests/2d.pattern.paint.repeatx.coord1.html - canvas/philip/tests/2d.pattern.paint.repeatx.outside.html - canvas/philip/tests/2d.pattern.paint.repeaty.coord1.html - canvas/philip/tests/2d.pattern.paint.repeaty.outside.html The entire canvas/ directory is currently skipped when enabling the GPU process for canvas rendering, but once we're down to a smaller number of failures, I intend to unskip these directories for GPU process, and individually track any remaining test failures. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::setStrokePattern): (WebCore::GraphicsContext::setFillPattern): (WebCore::GraphicsContext::setStrokeGradient): (WebCore::GraphicsContext::setFillGradient): 2020-09-21 Chris Dumez <cdumez@apple.com> Properly handle AudioParam.setTargetAtTime() followed by a ramp https://bugs.webkit.org/show_bug.cgi?id=216804 Reviewed by Darin Adler. Properly handle AudioParam.setTargetAtTime() followed by a ramp: - https://www.w3.org/TR/webaudio/#dom-audioparam-settargetattime - https://www.w3.org/TR/webaudio/#dom-audioparam-linearramptovalueattime - https://www.w3.org/TR/webaudio/#dom-audioparam-exponentialramptovalueattime This is a merge of the following Blink change: - https://codereview.chromium.org/1485003002 No new tests, rebaselined existing test. * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valuesForTimeRangeImpl): (WebCore::AudioParamTimeline::processSetTargetFollowedByRamp): * Modules/webaudio/AudioParamTimeline.h: 2020-09-21 Antoine Quint <graouts@webkit.org> Remove unused NodeFlag::HasCSSAnimation https://bugs.webkit.org/show_bug.cgi?id=216785 Reviewed by Antti Koivisto. * dom/Element.h: (WebCore::Element::hasCSSAnimation const): Deleted. (WebCore::Element::setHasCSSAnimation): Deleted. (WebCore::Element::clearHasCSSAnimation): Deleted. * dom/Node.h: 2020-09-21 Chris Dumez <cdumez@apple.com> Throw when AudioConnect::connect() is called for an output that has no channels https://bugs.webkit.org/show_bug.cgi?id=216802 Reviewed by Darin Adler. Throw when AudioConnect::connect() is called for an output that has no channels, for consistency with Blink. The ScriptProcessorNode cannot have an output node that has zero channels. No new tests, rebaselined existing tests. * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::connect): 2020-09-21 Yusuke Suzuki <ysuzuki@apple.com> [JSC] BigInt should work with Map / Set https://bugs.webkit.org/show_bug.cgi?id=216667 <rdar://problem/69107221> Reviewed by Robin Morisset. Strongly ensure that BigInt32 is always selected since Map / Set could use it as a key. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readBigInt): 2020-09-21 Peng Liu <peng.liu6@apple.com> Tapping to zoom in and out causes video to become very small on some iPhone models https://bugs.webkit.org/show_bug.cgi?id=216635 Reviewed by Jer Noble. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerLayer resolveBounds]): On some iPhone models, AVKit does not change "bounds" of WebAVPlayerLayer after changing its video gravity. Therefore, in this function, "modelVideoLayerFrame" and "bounds" might be the same. But we still need to update the video layer frame in the Web process. (-[WebAVPlayerLayer setVideoGravity:]): On some iPhone models, AVKit does not call -[WebAVPlayerLayer:layoutSublayers] immediately after changing the video gravity. Forcing a layout can fix that. 2020-09-21 Jiewen Tan <jiewen_tan@apple.com> [WebAuthn] Don't set the UV option if the authenticator doesn't support it https://bugs.webkit.org/show_bug.cgi?id=215836 <rdar://problem/67817359> Reviewed by Darin Adler. Covered by new API tests. UV in the the CTAP 2.0 spec only means internal UV: https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorGetInfo If an authenticator supports ClientPin, it can set the uv bit in the responses to true but it will not advertise itself supporting internal UV, which is the uv in the options. https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorMakeCredential Hence, setting it to true could result in error if the authenticator doesn't support internal UV even if it supports ClientPin. It's not a way to ask the authenticator to set the uv bit in the response. * Modules/webauthn/fido/DeviceRequestConverter.cpp: (fido::encodeMakeCredenitalRequestAsCBOR): (fido::encodeGetAssertionRequestAsCBOR): 2020-09-21 Chris Dumez <cdumez@apple.com> AudioParam.exponentialRampToValueAtTime() does not properly deal with negative values https://bugs.webkit.org/show_bug.cgi?id=216790 Reviewed by Eric Carlson. AudioParam.exponentialRampToValueAtTime() does not properly deal with negative values. The specification [1] says: "If V0 and V1 have opposite signs or if V0 is zero, then v(t) = V0 for T0 <= t < T1." Our implementation did not match the specification and would just special-case if either V0 or V1 was negative. [1] https://www.w3.org/TR/webaudio/#dom-audioparam-exponentialramptovalueattime No new tests, rebaselined existing test. * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valuesForTimeRangeImpl): 2020-09-21 Youenn Fablet <youenn@apple.com> [iOS] MediaRecorder incorrect screen orientation handling https://bugs.webkit.org/show_bug.cgi?id=198912 <rdar://problem/51802521> Reviewed by Eric Carlson. Update MediaRecorderPrivateWriterCocoa to pass a MediaSample down to handle rotation. Set AVAssetWriterInput transform according the first MediaSample rotation value. Test: http/wpt/mediarecorder/video-rotation.html * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::videoSampleAvailable): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): 2020-09-21 Keith Miller <keith_miller@apple.com> Functions should consistently enumerate length before name https://bugs.webkit.org/show_bug.cgi?id=216789 Reviewed by Yusuke Suzuki. RuntimeMethod inherits from InternalFunction which now sets length by default. RuntimeMethod intercepts length in getOwnPropertySlot so the value we pick doesn't actually matter. Technically, this uses a little extra memory but that's not too big of a deal because RuntimeMethod's are rare (and I believe deprecated). * bridge/runtime_method.cpp: (JSC::RuntimeMethod::finishCreation): 2020-09-20 Darin Adler <darin@apple.com> Next step towards eliminating deprecated legacy positions https://bugs.webkit.org/show_bug.cgi?id=216751 Reviewed by Sam Weinig. Eliminating our old deprecated legacy editing positions is probably a relatively long road. This next step starts using the makeContainerOffsetPosition function in more places, requesting that we not use any of the deprecated legacy position logic. Also renames createLegacyEditingPosition to makeDeprecatedLegacyPosition. The hard part of this project will be removing code that is not inside Position that depends on the old style of position/offset pairs. For this patch, tried to stick to converting cases where it seems clear we don't depend on the legacy behavior. Flaw in that is that we might still depend on legacy behavior where it's unconditionally implemented, without checking the flag on the m_isLegacyEditingPosition Position class; that will be a problem long term, should not be in this patch. * dom/Position.h: (WebCore::createLegacyEditingPosition): Deleted. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::visiblePositionForTextMarkerData): (WebCore::AXObjectCache::rangeMatchesTextNearRange): (WebCore::AXObjectCache::visiblePositionFromCharacterOffset): (WebCore::AXObjectCache::localCaretRectForCharacterOffset): (WebCore::AXObjectCache::indexForCharacterOffset): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::stringForRange const): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::linkClickPoint): (WebCore::AccessibilityRenderObject::setSelectedTextRange): (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange const): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]): * dom/Position.cpp: (WebCore::Position::previous const): (WebCore::Position::next const): (WebCore::Position::downstream const): * dom/PositionIterator.cpp: (WebCore::PositionIterator::operator Position const): * dom/Range.cpp: (WebCore::Range::expand): * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::applyAutocorrectionBeforeTypingIfAppropriate): (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult): (WebCore::AlternativeTextController::applyAlternativeTextToRange): * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyBlockStyle): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::handleGeneralDelete): * editing/Editing.cpp: (WebCore::visiblePositionForIndex): (WebCore::visiblePositionForIndexUsingCharacterIterator): (WebCore::isNodeVisiblyContainedWithin): * editing/Editor.cpp: (WebCore::Editor::canDeleteRange const): (WebCore::Editor::selectComposition): (WebCore::Editor::advanceToNextMisspelling): (WebCore::Editor::markAndReplaceFor): (WebCore::Editor::firstRectForRange const): (WebCore::extendSelection): (WebCore::Editor::adjustedSelectionRange): * editing/FrameSelection.cpp: (WebCore::FrameSelection::elementRangeContainingCaretSelection const): * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::doApplyForSingleParagraph): * editing/RenderedPosition.cpp: (WebCore::RenderedPosition::positionAtLeftBoundaryOfBiDiRun const): (WebCore::RenderedPosition::positionAtRightBoundaryOfBiDiRun const): * editing/TextCheckingHelper.cpp: (WebCore::expandToParagraphBoundary): (WebCore::TextCheckingParagraph::expandRangeToNextEnd): (WebCore::TextCheckingHelper::findFirstMisspelledWordOrUngrammaticalPhrase const): * editing/TextIterator.cpp: (WebCore::resolveCharacterRange): * editing/VisiblePosition.cpp: (WebCore::VisiblePosition::leftVisuallyDistinctCandidate const): (WebCore::VisiblePosition::rightVisuallyDistinctCandidate const): * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::appendTrailingWhitespace): * editing/VisibleUnits.cpp: (WebCore::previousRootInlineBoxCandidatePosition): (WebCore::nextRootInlineBoxCandidatePosition): (WebCore::previousBoundary): (WebCore::nextBoundary): (WebCore::startOfDocument): (WebCore::endOfDocument): (WebCore::closestWordBoundaryForPosition): (WebCore::wordBoundaryForPositionWithoutCrossingLine): * editing/cocoa/HTMLConverter.mm: (HTMLConverter::HTMLConverter): * editing/ios/EditorIOS.mm: (WebCore::Editor::setTextAsChildOfElement): * editing/markup.cpp: (WebCore::serializePreservingVisualAppearance): (WebCore::contextPreservesNewline): (WebCore::createFragmentFromText): * page/DragController.cpp: (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret): * page/Page.cpp: (WebCore::Page::replaceRangesWithText): * page/ios/FrameIOS.mm: (WebCore::Frame::interpretationsForCurrentRoot const): * platform/DragImage.cpp: (WebCore::createDragImageForRange): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::positionForBox const): * rendering/RenderObject.cpp: (WebCore::RenderObject::createVisiblePosition const): (WebCore::RenderObject::collectSelectionRectsInternal): * testing/Internals.cpp: (WebCore::Internals::setSelectionWithoutValidation): Replaced calls to createLegacyEditingPosition with calls to makeDeprecatedLegacyPosition or makeContainerOffsetPosition. 2020-09-20 Darin Adler <darin@apple.com> Selection API: A few more refinements to DOMSelection and VisibleSelection to pass all WPT tests https://bugs.webkit.org/show_bug.cgi?id=216756 Reviewed by Ryosuke Niwa. After these changes, we pass all the tests in imported/w3c/web-platform-tests/selection with no failures except for one due to the rules about absorbing newlines at the start and end <style> and <script> elements. However, that's with the live selection range feature enabled, and there are likely issues with other tests in that mode, so that testing still needs to be done. Then we also have to decide how we are going to deal with the compatibility risk of changing the behavior to match the standard. * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::VisibleSelection): Updated to rename m_baseIsFirst to m_anchorIsFirst. Not required for the fix, but helpful for clarity. (WebCore::VisibleSelection::uncanonicalizedStart const): Ditto. (WebCore::VisibleSelection::uncanonicalizedEnd const): Ditto. (WebCore::VisibleSelection::setBaseAndExtentToDeepEquivalents): Compute whether the anchor is first *before* canonicalization, otherwise we will reverse the two if their canonical values are equal. Canonicalization is not allowed to change the ordering other than making two values equal. (WebCore::VisibleSelection::validate): Updated for name. (WebCore::VisibleSelection::setWithoutValidation): Ditto, also tweaked other names in the function and removed an if statement. (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries): Ditto. (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries): Ditto. * editing/VisibleSelection.h: Renamed m_baseIsFirst to m_anchorIsFirst and improved the comment about m_isDirectional. * page/DOMSelection.cpp: (WebCore::DOMSelection::anchorPosition const): Removed use of parentAnchoredEquivalent. The name makes it sound like it would be useful, but really it just triggers some editing behaviors that don't belong in Position code. (WebCore::DOMSelection::focusPosition const): Ditto. (WebCore::DOMSelection::basePosition const): Ditto. (WebCore::DOMSelection::extentPosition const): Ditto. (WebCore::DOMSelection::collapse): Reversed the order of the document check and the check for invalid nodes and offsets. There are some inconsistencies between the specification and WPT but for now matching WPT seems like the way to go. (WebCore::DOMSelection::setBaseAndExtent): Ditto. (WebCore::DOMSelection::extend): Use VisibleSelection::setExtent, which does exactly what we want, rather than FrameSelection::setExtent, which does not. In the future we may want to cut down on the number of subtly-different selection functions, like these two, but for now this fixes this DOM method to work as specified. 2020-09-21 Chris Dumez <cdumez@apple.com> Remove emphasis/de-emphasis filters from DynamicsCompressor https://bugs.webkit.org/show_bug.cgi?id=216796 Reviewed by Darin Adler. Remove emphasis/de-emphasis filters from DynamicsCompressor as these have been removed from the specification. This is a merge of the following Blink change: - https://codereview.chromium.org/152333003 No new tests, rebaselined existing tests. * platform/audio/DynamicsCompressor.cpp: (WebCore::DynamicsCompressor::DynamicsCompressor): (WebCore::DynamicsCompressor::process): (WebCore::DynamicsCompressor::reset): (WebCore::DynamicsCompressor::setNumberOfChannels): * platform/audio/DynamicsCompressor.h: * platform/audio/DynamicsCompressorKernel.cpp: (WebCore::DynamicsCompressorKernel::process): (WebCore::DynamicsCompressorKernel::tailTime const): * platform/audio/DynamicsCompressorKernel.h: 2020-09-21 Chris Dumez <cdumez@apple.com> Vectorize linearRampToValueAtTime processing in AudioParamTimeline https://bugs.webkit.org/show_bug.cgi?id=216788 Reviewed by Darin Adler. Vectorize linearRampToValueAtTime processing in AudioParamTimeline. This patch is based on the Blink implementation at [1] but updated to use VectorMath to work on more platforms. We were failing some tests due to precision issues in our linearRampToValueAtTime implementation. Those tests are now passing since our implementation matches Blink's more closely. [1] https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc No new tests, rebaselined existing tests. * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valuesForTimeRangeImpl): (WebCore::AudioParamTimeline::processLinearRamp): * Modules/webaudio/AudioParamTimeline.h: 2020-09-21 Chris Dumez <cdumez@apple.com> AnalyserNode's getByteFrequencyData() / getFloatFrequencyData() should only do FFT analysis once per render quantum https://bugs.webkit.org/show_bug.cgi?id=216735 Reviewed by Darin Adler. AnalyserNode's getByteFrequencyData() / getFloatFrequencyData() should only do FFT analysis once per render quantum: - https://www.w3.org/TR/webaudio/#dom-analysernode-getbytefrequencydata """ If another call to getByteFrequencyData() or getFloatFrequencyData() occurs within the same render quantum as a previous call, the current frequency data is not updated with the same data. Instead, the previously computed data is returned. """ No new tests, rebaselined existing test. * Modules/webaudio/RealtimeAnalyser.cpp: (WebCore::RealtimeAnalyser::writeInput): (WebCore::RealtimeAnalyser::doFFTAnalysisIfNecessary): (WebCore::RealtimeAnalyser::getFloatFrequencyData): (WebCore::RealtimeAnalyser::getByteFrequencyData): * Modules/webaudio/RealtimeAnalyser.h: 2020-09-21 Antoine Quint <graouts@webkit.org> Remove dedicated HashSet<Element*> for DocumentTimeline::runningAnimationsForElementAreAllAccelerated() https://bugs.webkit.org/show_bug.cgi?id=216775 Reviewed by Antti Koivisto. * animation/AnimationTimeline.h: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::detachFromDocument): (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange): (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const): (WebCore::DocumentTimeline::animationWasAddedToElement): Deleted. (WebCore::DocumentTimeline::animationWasRemovedFromElement): Deleted. (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Deleted. * animation/DocumentTimeline.h: 2020-09-21 Chris Dumez <cdumez@apple.com> AnalyserNode should downmix input audio to mono https://bugs.webkit.org/show_bug.cgi?id=216736 Reviewed by Sam Weinig. AnalyserNode should downmix input audio to mono: - https://www.w3.org/TR/webaudio/#current-time-domain-data This patch is based on the following Blink change: - https://codereview.chromium.org/1803233002 No new tests, rebaselined existing test. * Modules/webaudio/RealtimeAnalyser.cpp: (WebCore::RealtimeAnalyser::RealtimeAnalyser): (WebCore::RealtimeAnalyser::writeInput): * Modules/webaudio/RealtimeAnalyser.h: 2020-09-21 Wenson Hsieh <wenson_hsieh@apple.com> REGRESSION (r257839): Can't add a memo when transferring funds in First Tech Credit Union App https://bugs.webkit.org/show_bug.cgi?id=216754 <rdar://problem/67045862> Reviewed by Antti Koivisto. After r257839, attempting to add a memo by tapping on a text box in the First Tech Credit Union app on iOS fails to cause the text box (a `textarea` element) to be focused. This is because the `textarea` is initially hidden away in a `display: none;` parent container, which becomes `display: block;` immediately before `focus()` is called from the page's script. Augment the mechanism added in r266887, so that we avoid consulting stale computed styles when checking for hidden ancestors in `Element::isVisibleWithoutResolvingFullStyle()`. To do this, we pull logic to get or compute the `RenderStyle` for the current element or one of its composed ancestors (which respects `IsComputedStyleInvalidFlag`) into a lambda function, and use this lambda function below, when we walk up the ancestor chain in search of a hidden element. Note that in Speedometer 2.0, this change does not have any significant impact on the number of partial (i.e. `RenderedOnly`) style resolutions we attempt to perform underneath `Element::resolveComputedStyle` (a little over 3000 before and after this change). Test: fast/forms/programmatic-focus-after-displaying-parent.html * dom/Element.cpp: (WebCore::Element::isVisibleWithoutResolvingFullStyle const): 2020-09-21 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Move hasClearance out of BoxGeometry https://bugs.webkit.org/show_bug.cgi?id=216757 Reviewed by Antti Koivisto. Do not cache the hasClearance state in BoxGeometry. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear): (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const): * layout/blockformatting/BlockFormattingState.h: (WebCore::Layout::BlockFormattingState::setHasClearance): (WebCore::Layout::BlockFormattingState::clearClearance): (WebCore::Layout::BlockFormattingState::hasClearance const): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const): * layout/layouttree/LayoutBoxGeometry.cpp: (WebCore::Layout::BoxGeometry::BoxGeometry): * layout/layouttree/LayoutBoxGeometry.h: (WebCore::Layout::BoxGeometry::hasClearance const): Deleted. (WebCore::Layout::BoxGeometry::setHasClearance): Deleted. 2020-09-21 Zalan Bujtas <zalan@apple.com> [LFC] Remove unused EscapeReason::StrokeOverflowNeedsViewportGeometry https://bugs.webkit.org/show_bug.cgi?id=216759 Reviewed by Antti Koivisto. This escape reason was used to read ICB geometry to compute ink overflow (prior to r267325). * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::geometryForBox const): * layout/FormattingContext.h: 2020-09-21 Zalan Bujtas <zalan@apple.com> [LFC][MarginCollapse] The block level box passed in to MarginCollapse::positiveNegativeValues is in the current formatting context https://bugs.webkit.org/show_bug.cgi?id=216758 Reviewed by Antti Koivisto. Let's use the current formatting state when grabbing vertical margin values. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const): 2020-09-21 Philippe Normand <pnormand@igalia.com> [GStreamer] media/media-can-play-mp3.html fails https://bugs.webkit.org/show_bug.cgi?id=216692 Reviewed by Darin Adler. Add mp3 to supported codecs map when a valid decoder has been found by the GStreamer registry scanner. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::initialize): 2020-09-20 Sam Weinig <weinig@apple.com> Performance.navigation and Performance.timing are incorrectly exposed to workers https://bugs.webkit.org/show_bug.cgi?id=216732 Reviewed by Simon Fraser. * page/Performance.idl: Only expose Performance.navigation and Performance.timing to the Window. 2020-09-20 Sam Weinig <weinig@apple.com> Using [Exposed=Window] with [Default] object toJSON() doesn't work https://bugs.webkit.org/show_bug.cgi?id=216731 Reviewed by Simon Fraser. Fixes filtering an attribute out of [Default] toJSON operation based on which which global objects it is exposed to by ensuring we always pass a global object pointer accessor function to GenerateRuntimeEnableConditionalStringForExposed. For good measure, we now always pass the global object object pointer to GenerateRuntimeEnableConditionalString as well so that it is always explicit. This is needed to support filtering out Performance.navigation and Performance.timing from the Performance interface's toJSON implementation which will be addressed in a separate change. * bindings/scripts/CodeGeneratorJS.pm: (GenerateRuntimeEnableConditionalStringForExposed): (GenerateRuntimeEnableConditionalString): Remove implicit global object accessor string construction by always requiring it to be passed. * bindings/scripts/test/DOMWindowConstructors.idl: * bindings/scripts/test/JS/JSDOMWindow.cpp: * bindings/scripts/test/JS/JSTestDefaultToJSONFilteredByExposed.cpp: Added. * bindings/scripts/test/JS/JSTestDefaultToJSONFilteredByExposed.h: Added. * bindings/scripts/test/JS/JSWorkerGlobalScope.cpp: * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestDefaultToJSONFilteredByExposed.idl: Added. * bindings/scripts/test/WorkerGlobalScopeConstructors.idl: Add new test for updated behavior. I couldn't add it to the existing TestDefaultToJSON.idl test as that test requires the interface only be exposed to Window to support testing EnabledBySetting. 2020-09-20 Darin Adler <darin@apple.com> Selection API: Further improvements to VisibleSelection, FrameSelection, and DOMSelection to preserve anchor and focus https://bugs.webkit.org/show_bug.cgi?id=216739 Reviewed by Ryosuke Niwa. If done correctly, these changes should have almost no effect unless live range selection is enabled. This adds a feature where VisibleSelection tracks the original points, before the VisiblePosition-style canonicalization. It also starts a transition from the base/extent terminology to the slightly-easier-to-understand anchor/focus terminology that is used in the selection specification. New functions name them anchor and focus, even though we still have some old ones that call them base and extent. In addition, made some other small related improvements to live range selection mode, without changing behavior when not in that mode. Have been testing these locally by turning on that mode and running various tests. * editing/FrameSelection.cpp: (WebCore::FrameSelection::isInDocumentTree const): Added. Used by DOMSelection to correctly handle cases where the selection is in a shadow tree without requiring it actually create the associated live range just to query. (WebCore::FrameSelection::associatedLiveRange): Use the new VisibleSelection::range, which gives us non-canonicalized points, rather than the deprecated VisibleSelection::firstRange, which we will eventually be renaming or deleting. (WebCore::FrameSelection::updateFromAssociatedLiveRange): Use makeContainerOffsetPosition instead of implicitly using makeDeprecatedLegacyPosition. Also removed the FIXME about normalization of endpoints, which is what this patch mostly addresses; no need to track with a comment now. (WebCore::FrameSelection::updateAssociatedLiveRange): Use VisibleSelection::range for the same reason as above. * editing/FrameSelection.h: Added isInDocumentTree. * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::VisibleSelection): Updated the primary constructor to set m_anchor/focus and let the validate function set m_base/extent/start/end/baseIsFirst. Changed most other constructors to call that primary one. (WebCore::VisibleSelection::anchor const): Added. This is a non-canonicalized position. (WebCore::VisibleSelection::focus const): Ditto. (WebCore::VisibleSelection::uncanonicalizedStart const): Added. This non-canonicalized version of start is used by new DOMSelection code, but eventually should be used elsewhere as well, and we may eventually eliminate the canonicalized version. (WebCore::VisibleSelection::uncanonicalizedEnd const): Ditto. (WebCore::VisibleSelection::range const): Added. This non-canonicalized version of firstRange has many of the same considerations as the other four functions above. (WebCore::VisibleSelection::setBase): Set m_anchor instead of m_base. Eventually we will want to rename this function, too, but there is no need to do that now. (WebCore::VisibleSelection::setExtent): Ditto. (WebCore::VisibleSelection::setBaseAndExtentToDeepEquivalents): Rewrote to take m_anchor and m_focus as inputs and now m_base and m_extent are pure outputs. May want to rename this later, because "deep equivalents" is a funny way to say that this function sets base and extent to canonicalized values. (WebCore::VisibleSelection::adjustSelectionRespectingGranularity): Renamed from setStartAndEndFromBaseAndExtentRespectingGranularity. This now takes m_start/end as input as well as output, because the validate function needs to check if the function changes m_start/end so it can update m_anchor/focus. Also did a tiny bit of refactoring to use std::swap. (WebCore::VisibleSelection::validate): Refined the code to handle canonicalization differently from expanding due to granularity. Canonicalization is done preserving the original m_anchor/focus as it mostly always has been. But expansion due to granularity now changes m_anchor/focus/base/extent rather than just m_start/end. This makes sense because granularity changes actually affect what is selected, while canonicalization just changes how the selection is expressed and tracked. (WebCore::VisibleSelection::setWithoutValidation): Set m_anchor/focus. In the future, we can probably get rid of this eventually, because the "validation" talked about here is the unwanted canonicalization. But that's a refinement for the future. (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries): Update m_focus, not just m_extent, if we have to adjust. Also removed an unnnecessary null check from the start of the function. (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries): Ditto. Also removed the assertions because these situations can indeed arise and it's not necessarily an indication of a bug in editing code. * editing/VisibleSelection.h: Rearranged constructors to make it slightly more clear which is the main one and that the others are simply convenience shorthands. Might want to come back later and remove some unused ones. Added uncanonicalizedStart, uncanonicalizedEnd, anchor, focus, and range. Renamed the private function called setStartAndEndFromBaseAndExtentRespectingGranularity to the new name adjustSelectionRespectingGranularity. Added m_anchor and m_focus and refined the comments about the position data members. We should eventually be able to cut down on the number of these again, but it's fine to have two more for now. * page/DOMSelection.cpp: (WebCore::DOMSelection::range const): Use range rather than firstRange when live range selection is enabled, for proper round-tripping of selection endpoints, unaffected by canonicalization. The other changes below are for the same reason. (WebCore::DOMSelection::anchorPosition const): Use anchor. (WebCore::DOMSelection::focusPosition const): Use focus. (WebCore::DOMSelection::basePosition const): Use anchor. (WebCore::DOMSelection::extentPosition const): Use focus. (WebCore::DOMSelection::type const): Use isInDocumentTree and range rather than isNone/isCaret/isRange when live range selection is enabled, because this needs to report "Caret" when the range is not collapsed, even if the canonicalized range is collapsed and "None" when the selection is in a shadow tree. (WebCore::DOMSelection::rangeCount const): Use isInDocumentTree to check if there is a selection rather than isNone to correctly handle the shadow tree case. (WebCore::DOMSelection::collapseToEnd): Use uncanonicalizedEnd. (WebCore::DOMSelection::collapseToStart): Use uncanonicalizedStart. (WebCore::DOMSelection::containsNode const): Updated the comment for clarity. 2020-09-20 Simon Fraser <simon.fraser@apple.com> [LFC Display] Move LFC Display infrastructure files into a new 'display' directory https://bugs.webkit.org/show_bug.cgi?id=216747 Reviewed by Zalan Bujtas. WebCore/Source/display will become the home for all the LFC painting code; move DisplayView and DisplayLayerController into it. Also fix some unified build include issues. * CMakeLists.txt: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * display/DisplayLayerController.cpp: Renamed from Source/WebCore/layout/display/DisplayLayerController.cpp. * display/DisplayLayerController.h: Renamed from Source/WebCore/layout/display/DisplayLayerController.h. * display/DisplayView.cpp: Renamed from Source/WebCore/layout/display/DisplayView.cpp. * display/DisplayView.h: Renamed from Source/WebCore/layout/display/DisplayView.h. * layout/flexformatting/FlexFormattingContext.cpp: * layout/inlineformatting/InlineLineBox.cpp: 2020-09-20 Darin Adler <darin@apple.com> Selection API: Fix selectAllChilden to return InvalidNodeTypeError when passed a DocumentType node https://bugs.webkit.org/show_bug.cgi?id=216741 Reviewed by Ryosuke Niwa. This is covered by tests, but the fix itself is only testable when live range selection is enabled. So for now the other tests are simply checking that no regression or behavior change was introduced by accident. * page/DOMSelection.cpp: (WebCore::DOMSelection::selectAllChildren): Return the value returned by setBaseAndExtent so we don't discard any exception it might throw. In practice, that's only this one. * page/DOMSelection.h: Updated return type so we can throw an exception. * page/DOMSelection.idl: Added MayThrowException. 2020-09-20 Zalan Bujtas <zalan@apple.com> [LFC][IFC] InlineFormattingState should not store display lines and runs https://bugs.webkit.org/show_bug.cgi?id=216742 Reviewed by Antti Koivisto. In this patch, 1. Display related structures are completely moved out from Layout namespace - InlineFormattingContext does not generate display structures. - InlineFormattingState only stores layout data. - Layout tree verification works on layout geometry. - Layout structures do not embed Display types. 2. LayoutIntegration creates and maintains the required Display structures for painting and hittesting. 3. Display::Run does not use Layout types (InlineLayoutRect, InlineLayoutUnit). FIXME: We need to start constructing display content for the Display::Painter. * WebCore.xcodeproj/project.pbxproj: * layout/Verification.cpp: (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded): (WebCore::Layout::checkForMatchingNonTextRuns): (WebCore::Layout::checkForMatchingTextRuns): (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): * layout/displaytree/DisplayInlineContent.h: (WebCore::Display::InlineContent::shrinkToFit): * layout/displaytree/DisplayLine.h: (WebCore::Display::Line::horizontalAlignmentOffset const): (WebCore::Display::Line::Line): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintInlineContent): * layout/displaytree/DisplayRun.h: (WebCore::Display::Run::TextContent::start const): (WebCore::Display::Run::TextContent::end const): (WebCore::Display::Run::TextContent::length const): (WebCore::Display::Run::TextContent::content const): (WebCore::Display::Run::TextContent::needsHyphen const): (WebCore::Display::Run::rect const): (WebCore::Display::Run::inkOverflow const): (WebCore::Display::Run::Run): (WebCore::Display::Run::TextContent::TextContent): (WebCore::Display::Run::TextContent::setNeedsHyphen): Deleted. (WebCore::Display::Run::TextContent::expand): Deleted. (WebCore::Display::Run::TextContent::shrink): Deleted. (WebCore::Display::Run::topLeft const): Deleted. (WebCore::Display::Run::left const): Deleted. (WebCore::Display::Run::right const): Deleted. (WebCore::Display::Run::top const): Deleted. (WebCore::Display::Run::bottom const): Deleted. (WebCore::Display::Run::width const): Deleted. (WebCore::Display::Run::height const): Deleted. (WebCore::Display::Run::moveVertically): Deleted. * layout/flexformatting/FlexFormattingContext.cpp: (WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::lineRuns const): (WebCore::Layout::InlineFormattingState::lineRuns): (WebCore::Layout::InlineFormattingState::addLineRun): (WebCore::Layout::InlineFormattingState::clearLineAndRuns): (WebCore::Layout::InlineFormattingState::shrinkToFit): (WebCore::Layout::InlineFormattingState::displayInlineContent const): Deleted. (WebCore::Layout::InlineFormattingState::ensureDisplayInlineContent): Deleted. (WebCore::Layout::InlineFormattingState::shrinkDisplayInlineContent): Deleted. * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::Run::textContent const): (WebCore::Layout::Line::Run::expansion const): * layout/inlineformatting/InlineLineGeometry.h: (WebCore::Layout::InlineLineGeometry::horizontalAlignmentOffset const): (WebCore::Layout::InlineLineGeometry::InlineLineGeometry): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::layout): (WebCore::LayoutIntegration::LineLayout::constructDisplayContent): (WebCore::LayoutIntegration::LineLayout::ensureDisplayInlineContent): (WebCore::LayoutIntegration::LineLayout::paint): (WebCore::LayoutIntegration::LineLayout::displayInlineContent const): Deleted. * layout/integration/LayoutIntegrationLineLayout.h: (WebCore::LayoutIntegration::LineLayout::displayInlineContent const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): * rendering/line/LineLayoutTraversalDisplayRunPath.h: (WebCore::LineLayoutTraversal::DisplayRunPath::rect const): 2020-09-19 Andres Gonzalez <andresg_22@apple.com> Implementation for AXIsolatedObject::nextSibling and previousSibling. https://bugs.webkit.org/show_bug.cgi?id=216710 Reviewed by Chris Fleizach. Implementation for AXIsolatedObject::previousSibling and nextSibling which are invoked by VoiceOver in Safari Reader mode. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::previousSibling const): - Fixed crash caused by dereferencing m_renderer->parent() which can be null. - Added check for the AXObjectCache that can become null. (WebCore::AccessibilityRenderObject::nextSibling const): - Code style cleanup. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): - Added caching of next/previousSiblling objects. (WebCore::AXIsolatedObject::previousSibling const): Inlined in header.. (WebCore::AXIsolatedObject::nextSibling const): Inlined in header. * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.h: 2020-09-19 Sam Weinig <weinig@apple.com> Performance and PerformanceNavigation interfaces are missing toJSON operations https://bugs.webkit.org/show_bug.cgi?id=216728 Reviewed by Darin Adler. Add missing toJSON operations to Performance and PerformanceNavigation and update comments in related IDLs. Updates results for existing tests, more of which now pass. * page/Performance.idl: * page/PerformanceMark.idl: * page/PerformanceMeasure.idl: * page/PerformanceNavigation.idl: * page/PerformanceTiming.idl: 2020-09-19 Zalan Bujtas <zalan@apple.com> [LFC][IFC] InlineFormattingContext::computeGeometryForLineContent should not construct Display::Lines https://bugs.webkit.org/show_bug.cgi?id=216723 Reviewed by Antti Koivisto. Display::Lines construction should live in the display builder. However currently we don't yet have a real builder, so let's just use the integration layer. This is also in preparation for removing all the Display::InlineContent code from the Layout namespace. * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintInlineContent): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::layout): (WebCore::LayoutIntegration::LineLayout::constructDisplayContent): * layout/integration/LayoutIntegrationLineLayout.h: 2020-09-18 Darin Adler <darin@apple.com> Selection API: Extend lifetime of selection live range to preserve expando properties https://bugs.webkit.org/show_bug.cgi?id=216721 Reviewed by Ryosuke Niwa. Test: editing/selection/expando.html * dom/Range.cpp: (WebCore::Range::window): Added. Returns window if range is associated with selection. * dom/Range.h: Added window. * dom/Range.idl: Added GenerateIsReachable=ReachableFromDOMWindow. * editing/FrameSelection.cpp: (WebCore::FrameSelection::disassociateLiveRange): Removed a FIXME comment about the need for this fix. (WebCore::FrameSelection::updateAssociatedLiveRange): Added a comment explaining why an associated live range might not be contained in the document. 2020-09-19 Sam Weinig <weinig@apple.com> Add support for Settings equivilent of RuntimeConditionallyReadWrite https://bugs.webkit.org/show_bug.cgi?id=216697 Reviewed by Darin Adler. Adds a new extended attribute, [SettingsConditionallyReadWrite] to allow users of [RuntimeConditionallyReadWrite] to convert from RuntimeEnabledFeatures to Settings. * bindings/scripts/CodeGeneratorJS.pm: (NeedsRuntimeReadWriteCheck): (GeneratePropertiesHashTable): (GenerateRuntimeEnableConditionalString): (GenerateImplementation): * bindings/scripts/IDLAttributes.json: Adds new extended attribute. * bindings/scripts/test/DOMWindowConstructors.idl: * bindings/scripts/test/JS/JSDOMWindow.cpp: * bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp: Added. * bindings/scripts/test/JS/JSTestConditionallyReadWrite.h: Added. * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestConditionallyReadWrite.idl: Added. * bindings/scripts/test/TestObj.idl: Move conditionally read-write tests to a new test, TestConditionallyReadWrite.idl and update results. 2020-09-19 Sam Weinig <weinig@apple.com> Remove runtime setting for enabling/disabling the CrossOriginResourcePolicy API https://bugs.webkit.org/show_bug.cgi?id=216561 Reviewed by Darin Adler. Remove runtime setting for enabling/disabling CrossOriginResourcePolicy. It has been enabled by default for a while and there are no known reasons one would need to disable it. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setCrossOriginResourcePolicyEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::crossOriginResourcePolicyEnabled const): Deleted. 2020-09-19 Simon Fraser <simon.fraser@apple.com> ASSERTION FAILED: &formattingContextRoot == m_rootContainer.get() in WebCore::Layout::LayoutState::establishedInlineFormattingState https://bugs.webkit.org/show_bug.cgi?id=216668 Reviewed by Zalan Bujtas. Display::View didn't unparent the GraphicsLayers when Document::documentWillBecomeInactive() was called, so a layer pointing to an old LayoutState would try to paint. Fix by plumbing setIsInWindow() through to Display::View and using it to detach the root layer. * dom/Document.cpp: (WebCore::Document::documentWillBecomeInactive): The ASSERT_IMPLIES() is there to ensure that this isn't a behavior change; we used to go to RenderView directly, and now go via FrameView. * layout/display/DisplayLayerController.cpp: (WebCore::Display::LayerController::detachRootLayer): (WebCore::Display::LayerController::setIsInWindow): * layout/display/DisplayLayerController.h: * layout/display/DisplayView.cpp: (WebCore::Display::View::setIsInWindow): * layout/display/DisplayView.h: * page/FrameView.cpp: (WebCore::FrameView::setIsInWindow): 2020-09-18 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Do not use Display::Line geometry in layout https://bugs.webkit.org/show_bug.cgi?id=216711 Reviewed by Simon Fraser. This patch introduces Layout::LineGeometry. LineGeometry is used to hold the logical geometry of line and it is input to subsequent layouts. This patch is also in preparation for moving out the "displayInlineItem" construction from Layout::InlineFormattingContext. * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): * layout/Verification.cpp: (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const): * layout/displaytree/DisplayLine.h: (WebCore::Display::Line::rect const): (WebCore::Display::Line::scrollableOverflow const): (WebCore::Display::Line::inkOverflow const): (WebCore::Display::Line::baseline const): (WebCore::Display::Line::Line): (WebCore::Display::Line::left const): Deleted. (WebCore::Display::Line::right const): Deleted. (WebCore::Display::Line::top const): Deleted. (WebCore::Display::Line::bottom const): Deleted. (WebCore::Display::Line::width const): Deleted. (WebCore::Display::Line::height const): Deleted. (WebCore::Display::Line::moveVertically): Deleted. * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintInlineContent): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): (WebCore::Layout::InlineFormattingContext::invalidateFormattingState): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::constructInlineBoxes): * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::lines const): (WebCore::Layout::InlineFormattingState::lines): (WebCore::Layout::InlineFormattingState::addLine): (WebCore::Layout::InlineFormattingState::clearLineAndRuns): (WebCore::Layout::InlineFormattingState::shrinkDisplayInlineContent): (WebCore::Layout::InlineFormattingState::clearDisplayInlineContent): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: * layout/inlineformatting/InlineLineBuilder.h: * layout/inlineformatting/InlineLineGeometry.h: Added. (WebCore::Layout::InlineLineGeometry::logicalLeft const): (WebCore::Layout::InlineLineGeometry::logicalRight const): (WebCore::Layout::InlineLineGeometry::logicalTop const): (WebCore::Layout::InlineLineGeometry::logicalBottom const): (WebCore::Layout::InlineLineGeometry::logicalWidth const): (WebCore::Layout::InlineLineGeometry::logicalHeight const): (WebCore::Layout::InlineLineGeometry::logicalRect const): (WebCore::Layout::InlineLineGeometry::lineBoxLogicalRect const): (WebCore::Layout::InlineLineGeometry::baseline const): (WebCore::Layout::InlineLineGeometry::moveVertically): (WebCore::Layout::InlineLineGeometry::InlineLineGeometry): * layout/inlineformatting/InlineTextItem.h: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::contentLogicalHeight const): (WebCore::LayoutIntegration::LineLayout::lineCount const): (WebCore::LayoutIntegration::LineLayout::firstLineBaseline const): (WebCore::LayoutIntegration::LineLayout::lastLineBaseline const): (WebCore::LayoutIntegration::LineLayout::paint): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell): 2020-09-18 Zalan Bujtas <zalan@apple.com> [LFC][FFC] Add flex box/item to showLayoutTree https://bugs.webkit.org/show_bug.cgi?id=216694 Reviewed by Sam Weinig. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutBox): 'Table principal' -> 'Table wrapper box' for consistency sake. 2020-09-18 Saam Barati <sbarati@apple.com> console APIs shouldn't crash making a string that's too long for a console warning when using user provided labels https://bugs.webkit.org/show_bug.cgi?id=216709 <rdar://problem/68275357> Reviewed by Mark Lam and Devin Rousso. Test: inspector/console/console-oom.html * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::startFromConsole): (WebCore::InspectorTimelineAgent::stopFromConsole): * inspector/agents/WebConsoleAgent.cpp: (WebCore::WebConsoleAgent::didReceiveResponse): 2020-09-18 Don Olmstead <don.olmstead@sony.com> [WebGPU] Add ENABLE(WHLSL_COMPILER) guard https://bugs.webkit.org/show_bug.cgi?id=216713 Reviewed by Myles C. Maxfield. Replaces the ENABLE(WEBGPU) guards in the Modules/webgpu/WHLSL with ENABLE(WHLSL_COMPILER) since not all ports need a WHLSL compiler to support WebGPU. * Modules/webgpu/WHLSL/AST/WHLSLAST.h: * Modules/webgpu/WHLSL/AST/WHLSLAddressEscapeMode.h: * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h: * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h: * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h: * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h: * Modules/webgpu/WHLSL/AST/WHLSLBlock.h: * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h: * Modules/webgpu/WHLSL/AST/WHLSLBreak.h: * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp: * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h: * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLContinue.h: * Modules/webgpu/WHLSL/AST/WHLSLDefaultDelete.h: * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h: * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h: * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h: * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h: * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h: * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h: * Modules/webgpu/WHLSL/AST/WHLSLExpression.cpp: * Modules/webgpu/WHLSL/AST/WHLSLExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h: * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h: * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp: * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h: * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h: * Modules/webgpu/WHLSL/AST/WHLSLFunctionAttribute.h: * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h: * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h: * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h: * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h: * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.cpp: * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h: * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp: * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h: * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLNameSpace.h: * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h: * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h: * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h: * Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h: * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h: * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLQualifier.h: * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h: * Modules/webgpu/WHLSL/AST/WHLSLReplaceWith.h: * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h: * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp: * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h: * Modules/webgpu/WHLSL/AST/WHLSLReturn.h: * Modules/webgpu/WHLSL/AST/WHLSLSemantic.h: * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h: * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp: * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h: * Modules/webgpu/WHLSL/AST/WHLSLStatement.cpp: * Modules/webgpu/WHLSL/AST/WHLSLStatement.h: * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h: * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h: * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h: * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h: * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h: * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h: * Modules/webgpu/WHLSL/AST/WHLSLType.cpp: * Modules/webgpu/WHLSL/AST/WHLSLType.h: * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.cpp: * Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h: * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h: * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp: * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h: * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.cpp: * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h: * Modules/webgpu/WHLSL/AST/WHLSLUnnamedTypeHash.h: * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.cpp: * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h: * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp: * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h: * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h: * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h: * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h: * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h: * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h: * Modules/webgpu/WHLSL/Metal/WHLSLMangledNames.h: * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp: * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h: * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h: * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp: * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.h: * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h: * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp: * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h: * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: * Modules/webgpu/WHLSL/WHLSLASTDumper.h: * Modules/webgpu/WHLSL/WHLSLBuildStandardLibraryFunctionMap.py: * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp: * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.h: * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp: * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.h: * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp: * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.h: * Modules/webgpu/WHLSL/WHLSLChecker.cpp: * Modules/webgpu/WHLSL/WHLSLChecker.h: * Modules/webgpu/WHLSL/WHLSLCodeLocation.h: * Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp: * Modules/webgpu/WHLSL/WHLSLComputeDimensions.h: * Modules/webgpu/WHLSL/WHLSLError.h: * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp: * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h: * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp: * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h: * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h: * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: * Modules/webgpu/WHLSL/WHLSLInferTypes.h: * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp: * Modules/webgpu/WHLSL/WHLSLIntrinsics.h: * Modules/webgpu/WHLSL/WHLSLLexer.cpp: * Modules/webgpu/WHLSL/WHLSLLexer.h: * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.h: * Modules/webgpu/WHLSL/WHLSLNameContext.cpp: * Modules/webgpu/WHLSL/WHLSLNameContext.h: * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: * Modules/webgpu/WHLSL/WHLSLNameResolver.h: * Modules/webgpu/WHLSL/WHLSLParser.cpp: * Modules/webgpu/WHLSL/WHLSLParser.h: * Modules/webgpu/WHLSL/WHLSLParsingMode.h: * Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h: * Modules/webgpu/WHLSL/WHLSLPrepare.cpp: * Modules/webgpu/WHLSL/WHLSLPrepare.h: * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp: * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.h: * Modules/webgpu/WHLSL/WHLSLProgram.cpp: * Modules/webgpu/WHLSL/WHLSLProgram.h: * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp: * Modules/webgpu/WHLSL/WHLSLPropertyResolver.h: * Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp: * Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.h: * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: * Modules/webgpu/WHLSL/WHLSLRecursionChecker.h: * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp: * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.h: * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp: * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h: * Modules/webgpu/WHLSL/WHLSLResolvingType.h: * Modules/webgpu/WHLSL/WHLSLScopedSetAdder.h: * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.h: * Modules/webgpu/WHLSL/WHLSLStandardLibraryFunctionMap.h: * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp: * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.h: * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h: * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h: * Modules/webgpu/WHLSL/WHLSLVisitor.cpp: * Modules/webgpu/WHLSL/WHLSLVisitor.h: 2020-09-18 Chris Dumez <cdumez@apple.com> Crash under WebCore::shouldResetFocusNavigationStartingNode() https://bugs.webkit.org/show_bug.cgi?id=216714 <rdar://problem/68132047> Reviewed by Darin Adler. Protect anchorElement in FrameView::scrollToFragmentInternal() to make sure it stays alive until the time we pass it to setFocusNavigationStartingNode(). * page/FrameView.cpp: (WebCore::FrameView::scrollToFragmentInternal): 2020-09-18 Aditya Keerthi <akeerthi@apple.com> Date/time inputs should not use user-specified formats https://bugs.webkit.org/show_bug.cgi?id=216484 <rdar://problem/68864815> Reviewed by Wenson Hsieh. On macOS, users can specify custom date and time formats through System Preferences. These formats can be different from the default for the user’s current locale. Using these formats when rendering date and time inputs is a potential fingerprinting vector, as sites can apply CSS to components of the input, and measure the size of the input. To fix, we create a new NSLocale even if the identifier matches [NSLocale currentLocale]. This ensures that m_locale does not contain the user's changes to the locale. * platform/text/cocoa/LocaleCocoa.h: * platform/text/cocoa/LocaleCocoa.mm: (WebCore::Locale::create): (WebCore::LocaleCocoa::LocaleCocoa): 2020-09-18 Aditya Keerthi <akeerthi@apple.com> [macOS] Date/time inputs should focus the next editable component when entering a separator key https://bugs.webkit.org/show_bug.cgi?id=216661 <rdar://problem/69091856> Reviewed by Wenson Hsieh. NSDatePicker focuses the next editable field when entering a separator key. We should match this behavior to be consistent with the rest of the system. * html/shadow/DateTimeFieldElement.cpp: (WebCore::DateTimeFieldElement::defaultKeyboardEventHandler): 2020-09-18 Said Abou-Hallawa <sabouhallawa@apple.com> REGRESSION(r267137): PaintFrequencyTracker needs to track all the painting https://bugs.webkit.org/show_bug.cgi?id=216677 Reviewed by Simon Fraser. r267137 removed all the optimizations which the Design test got from r230544 because it resets the renderingUpdateTimestamp to zero when it exists. This makes RenderLayer always retrieves this timestamp with value equal to zero. There is no direct call from Page::updateRendering() to RenderLayer::paintLayerContents(). Painting has to be scheduled to the next run-loop. Because SinglePaintFrequencyTracking tracks only the painting whose timestamp is not zero, SinglePaintFrequencyTracking has not been tracking any painting. The solution is to track all the painting. When renderingUpdateTimestamp() is zero, SinglePaintFrequencyTracking will use MonotonicTime::now() instead. This will happen in cases like calling updateControlTints() before calling Page::updateRendering(). * page/Page.cpp: (WebCore::Page::updateRendering): * page/Page.h: (WebCore::Page::lastRenderingUpdateTimestamp const): (WebCore::Page::renderingUpdateTimestamp const): Deleted. * rendering/PaintFrequencyTracker.h: (WebCore::SinglePaintFrequencyTracking::SinglePaintFrequencyTracking): (WebCore::SinglePaintFrequencyTracking::~SinglePaintFrequencyTracking): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::calculateClipRects const): 2020-09-18 Chris Dumez <cdumez@apple.com> webaudio/Analyser/handle-silent-inputs.html test is failing https://bugs.webkit.org/show_bug.cgi?id=216708 Reviewed by Geoffrey Garen. Merge the following fix to AnalyserNode from Blink so that webaudio/Analyser/handle-silent-inputs.html layout test starts passing: - https://codereview.chromium.org/2666063003 No new tests, rebaselined existing test. * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::process): (WebCore::AnalyserNode::updatePullStatus): (WebCore::AnalyserNode::tailTime const): * Modules/webaudio/AnalyserNode.h: * Modules/webaudio/AudioBasicInspectorNode.h: 2020-09-18 Youenn Fablet <youenn@apple.com> Add internal flag to enable/disable H264 hardware encoder https://bugs.webkit.org/show_bug.cgi?id=216534 Reviewed by Eric Carlson. Update process-wide hardware H264 boolean flag based on internal feature flag. No change of behavior. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::LibWebRTCProvider::setH264HardwareEncoderAllowed): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProvider::setH264HardwareEncoderAllowed): (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa): (WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed): Deleted. * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setH264HardwareEncoderAllowed): 2020-09-18 Youenn Fablet <youenn@apple.com> Hash deviceIds in WebProcess instead of UIProcess to allow audio output device IDs in WebProcess https://bugs.webkit.org/show_bug.cgi?id=216693 Reviewed by Eric Carlson. Make sure to create new MediaDeviceInfo objects everytime enumerateDevices is called. Covered by updated tests. * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::MediaDevices): (WebCore::MediaDevices::stop): (WebCore::MediaDevices::computeDevices): (WebCore::MediaDevices::enumerateDevices): (WebCore::MediaDevices::refreshDevices): Deleted. * Modules/mediastream/MediaDevices.h: 2020-09-18 Jer Noble <jer.noble@apple.com> REGRESSION(r254031): Captions fail to load on jw.org https://bugs.webkit.org/show_bug.cgi?id=216672 <rdar://problem/69016059> Reviewed by Eric Carlson. Revert r254031. * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::load): 2020-09-18 Chris Dumez <cdumez@apple.com> [macOS Big Sur] ASSERTION FAILED: !m_gamepadMap.get(device)./platform/gamepad/mac/HIDGamepadProvider.mm(233) under WebCore::HIDGamepadProvider::deviceAdded https://bugs.webkit.org/show_bug.cgi?id=216665 <rdar://problem/68641574> Reviewed by Alex Christensen. On macOS Big Sur, it appears we get notified multiple times that the Shenzhen Longshengwei Technology Gamepad is getting added during Gamepad.GCFVersusHID API test. This was causing an assertion to be hit under HIDGamepadProvider::deviceAdded() where we expected the device not not already be in the map. In this patch, we work around this HID quirk on Big Sur by ignoring the notification if we already know about the device. No new tests, fixes existing API test. * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::HIDGamepadProvider::deviceAdded): 2020-09-18 Chris Dumez <cdumez@apple.com> Vectorize SetTargetAtTime processing in AudioParamTimeline https://bugs.webkit.org/show_bug.cgi?id=216673 <rdar://problem/69111432> Reviewed by Sam Weinig. Fix the SSE implementation of VectorMath::vsadd() to properly deal with source and destination alignment, similarly to what is done in other VectorMath functions. No new tests, fixes existing crash on GTK bots. * platform/audio/VectorMath.cpp: (WebCore::VectorMath::vsadd): 2020-09-18 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Move computedLineLogicalRect to InlineFormattingContext::Geometry https://bugs.webkit.org/show_bug.cgi?id=216680 Reviewed by Simon Fraser. This function computes line geometry. It belongs in InlineFormattingContext::Geometry. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): (WebCore::Layout::InlineFormattingContext::computedLineLogicalRect const): Deleted. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::computedLineLogicalRect const): 2020-09-18 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Move inline box constructing and alignment logic to LineBoxBuilder https://bugs.webkit.org/show_bug.cgi?id=216678 Reviewed by Simon Fraser. Move the LineBox related logic out of the LineBox class to InlineFormattingContext::Geometry::LineBoxBuilder. This makes the LineBox class a light, box like class that we can cache in the InlineFormattingState. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computedLineLogicalRect const): (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::LineBoxBuilder::formattingContext const): (WebCore::Layout::LineBoxBuilder::root const): (WebCore::Layout::LineBoxBuilder::layoutState const): (WebCore::Layout::HangingContent::width const): (WebCore::Layout::HangingContent::isConditional const): (WebCore::Layout::HangingContent::setIsConditional): (WebCore::Layout::HangingContent::expand): (WebCore::Layout::HangingContent::reset): (WebCore::Layout::collectHangingContent): (WebCore::Layout::horizontalAlignmentOffset): (WebCore::Layout::LineBoxBuilder::LineBoxBuilder): (WebCore::Layout::LineBoxBuilder::build): (WebCore::Layout::LineBoxBuilder::constructInlineBoxes): (WebCore::Layout::LineBoxBuilder::computeInlineBoxesLogicalHeight): (WebCore::Layout::LineBoxBuilder::alignInlineBoxesVerticallyAndComputeLineBoxHeight): (WebCore::Layout::InlineFormattingContext::Geometry::lineBoxForLineContent): * layout/inlineformatting/InlineLine.cpp: * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::InlineBox::InlineBox): (WebCore::Layout::LineBox::LineBox): (WebCore::Layout::m_isLineVisuallyEmpty): (WebCore::Layout::LineBox::addRootInlineBox): (WebCore::Layout::LineBox::addInlineBox): (WebCore::Layout::HangingContent::width const): Deleted. (WebCore::Layout::HangingContent::isConditional const): Deleted. (WebCore::Layout::HangingContent::setIsConditional): Deleted. (WebCore::Layout::HangingContent::expand): Deleted. (WebCore::Layout::HangingContent::reset): Deleted. (WebCore::Layout::collectHangingContent): Deleted. (WebCore::Layout::horizontalAlignmentOffset): Deleted. (WebCore::Layout::m_inlineFormattingContext): Deleted. (WebCore::Layout::LineBox::constructInlineBoxes): Deleted. (WebCore::Layout::LineBox::computeInlineBoxesLogicalHeight): Deleted. (WebCore::Layout::LineBox::alignInlineBoxesVerticallyAndComputeLineBoxHeight): Deleted. (WebCore::Layout::LineBox::formattingContext const): Deleted. (WebCore::Layout::LineBox::root const): Deleted. (WebCore::Layout::LineBox::layoutState const): Deleted. * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::alignmentBaseline const): (WebCore::Layout::LineBox::setLogicalHeight): (WebCore::Layout::LineBox::setHorizontalAlignmentOffset): (WebCore::Layout::LineBox::rootInlineBox): (WebCore::Layout::LineBox::nonRootInlineBoxes const): (WebCore::Layout::LineBox::inlineBoxForLayoutBox): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::layoutInlineContent): * layout/inlineformatting/InlineLineBuilder.h: 2020-09-18 Youenn Fablet <youenn@apple.com> XHR.timeout is affected by long tasks https://bugs.webkit.org/show_bug.cgi?id=216266 <rdar://problem/68908150> Reviewed by Alex Christensen. Long tasks may block the main thread, which may block IPC processing of load messages. In that case, even though the load is finished, WebProcess did not know that yet and will cancel the load. To prevent that, in case of XHR timeout, do an explicit check to compute the done flag. https://fetch.spec.whatwg.org/#done-flag Tests: imported/w3c/web-platform-tests/xhr/xhr-timeout-longtask.any.html imported/w3c/web-platform-tests/xhr/xhr-timeout-longtask.any.worker.html * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::computeIsDone): * loader/DocumentThreadableLoader.h: * loader/LoaderStrategy.h: * loader/ThreadableLoader.h: * loader/ThreadableLoaderClient.h: (WebCore::ThreadableLoaderClient::notifyIsDone): * loader/ThreadableLoaderClientWrapper.h: (WebCore::ThreadableLoaderClientWrapper::notifyIsDone): * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::computeIsDone): (WebCore::WorkerThreadableLoader::MainThreadBridge::computeIsDone): (WebCore::WorkerThreadableLoader::MainThreadBridge::notifyIsDone): * loader/WorkerThreadableLoader.h: (WebCore::WorkerThreadableLoader::MainThreadBridge::loaderProxy): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::didReachTimeout): (WebCore::XMLHttpRequest::notifyIsDone): * xml/XMLHttpRequest.h: 2020-09-17 Sam Weinig <weinig@apple.com> Remove runtime setting for enabling/disabling the UserTiming and ResourceTiming APIs https://bugs.webkit.org/show_bug.cgi?id=216556 Reviewed by Darin Adler. Remove runtime setting for enabling/disabling UserTiming and ResourceTiming APIs. They have both been on for a while in WebKit2 and there aren't any known uses cases for disabling them. In addition to removing the setting, they are now enabled in LegacyWebKit as well. In addition to removing UserTiming and ResourceTiming, we can also remove the checks for PerformanceTimelineEnabled, as that was defined entirely in terms of the former. * loader/CrossOriginPreflightChecker.cpp: (WebCore::CrossOriginPreflightChecker::startPreflight): * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): * loader/ResourceTimingInformation.cpp: (WebCore::ResourceTimingInformation::addResourceTiming): (WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::reportResourceTiming): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::revalidateResource): (WebCore::CachedResourceLoader::loadResource): * page/Performance.idl: * page/PerformanceEntry.cpp: (WebCore::PerformanceEntry::parseEntryTypeString): * page/PerformanceEntry.idl: * page/PerformanceObserver.idl: * page/PerformanceObserverEntryList.idl: * page/PerformanceResourceTiming.idl: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setResourceTimingEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::resourceTimingEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setUserTimingEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::userTimingEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::performanceTimelineEnabled const): Deleted. 2020-09-16 Darin Adler <darin@apple.com> Selection API: Introduce LiveRangeSelectionEnabled, off by default https://bugs.webkit.org/show_bug.cgi?id=216656 Reviewed by Sam Weinig. For interoperability, the Selection API requires behavior that is quite different from how our Selection object has behaves historically. Specifically, the range returned is a live range that update as the selection updates and the selection, in turn, is updated if the returned range is modified. This significant change will have compatibility impact on websites and other content that assumes the legacy WebKit behavior, so we are developing it behind a feature flag, LiveRangeSelectionEnabled. This patch introduces the live range selection behind the flag, but leaves one significant area unresolved, changing selection to keep track of the original endpoints rather than only canonicalized endpoints, and a couple of loose ends, lifetime of ride-along properties on the live range object, and updating test expectations for the new behavior. * dom/CharacterData.cpp: (WebCore::CharacterData::setData): Fixed timing of call to Document::textRemoved by letting setDataAndUpdate do it; otherwise it can be called after the selection has been updated, and the range gets updated twice. (WebCore::CharacterData::appendData): Pass UpdateLiveRanges::No to setDataAndUpdate, to preserve the existing "don't update ranges" behavior for now at least. (WebCore::CharacterData::insertData): Fixed timing of call to Document::textInserted by letting setDataAndUpdate do it, for the same reason as above. (WebCore::CharacterData::deleteData): Ditto, for textRemoved. (WebCore::CharacterData::replaceData): Ditto, for textRemoved and textInserted. (WebCore::CharacterData::setDataAndUpdate): Added UpdateLiveRanges argument and calls to textRemoved and textInserted, after setting data, but before other updates. * dom/CharacterData.h: Made setDataAndUpdate protected and added UpdateLiveRanges. * dom/Document.h: Added optimized version of the Node::contains function. When the node in question is the document we can just check treeScope and isConnected rather than walking up the tree. * dom/Node.cpp: (WebCore::Node::isDescendantOf const): Moved special case for document to the top of the function; seems a more important special case than disconnected nodes and nodes with no children. (WebCore::Node::isDescendantOrShadowDescendantOf const): Reworded the FIXME for clarity. (WebCore::Node::contains const): Changed this to toke a reference instead of a pointer. The pointer flavor is now inlined in the header. * dom/Node.h: Added an overload of contains that takes a reference, analogous to what we already have for isDescendantOf. * dom/Position.cpp: (WebCore::Position::Position): Removed too-strict assertions. When we start using positions to represent arbitrary DOM positions for things outside editing we won't want these assertions any more, and we hit them when we use Position in a more straightforward way, like some cases in this patch. (WebCore::Position::primaryDirection const): Added a missing null check. This case is hit in some test cases in the new mode. * dom/Range.cpp: Removed some, but probably not all, of the unneeded headers. (WebCore::Range::~Range): Added an assertion. (WebCore::Range::updateAssociatedSelection): Added. Tells FrameSelection to update the selection when this is the live range associated with the selection. (WebCore::Range::updateDocument): Added an assertion. (WebCore::Range::setStart): Call updateAssociatedSelection. (WebCore::Range::setEnd): Ditto. (WebCore::Range::collapse): Ditto. (WebCore::Range::processContents): Call collapse here to share slightly more code so we don't have to call updateAssociatedSelection here. (WebCore::Range::checkNodeOffsetPair): Made this a static function so it can be used outside the Range class. Also fixed indentation of the switch statement. (WebCore::Range::selectNodeContents): Call updateAssociatedSelection and updateDocument. (WebCore::setBothEndpoints): Added. (WebCore::Range::updateFromSelection): Added. Uses setBothEndpoints. (WebCore::createLiveRange): Refactored to call setBothEndpoints. * dom/Range.h: Added didAssociateWithSelection, didDisassociateFromSelection, updateFromSelection, updateAssociatedSelection, and m_isAssociatedWithSelection. Also made checkNodeOffsetPair a public static member function instead of a private non-static member function. * dom/Text.cpp: (WebCore::Text::setDataAndUpdate): Update to pass along UpdateLiveRanges argument. * dom/Text.h: Ditto. Also made the override of setDataAndUpdate private. * editing/FrameSelection.cpp: (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance): Call updateAssociatedLiveRange after updating the selection. (WebCore::containsEndpoints): Added. Used to check if a live range still has the document as its root node so it can remain associated this with the selection. (WebCore::FrameSelection::associatedLiveRange): Added. (WebCore::FrameSelection::disassociateLiveRange): Added. (WebCore::FrameSelection::associateLiveRange): Added. (WebCore::FrameSelection::updateFromAssociatedLiveRange): Added. (WebCore::FrameSelection::updateAssociatedLiveRange): Added. * editing/FrameSelection.h: Added associatedLiveRange, associateLiveRange, disassociateLiveRange, updateFromAssociatedLiveRange, updateAssociatedLiveRange, and m_associatedLiveRange. Also change m_document to a WeakPtr and do some tidying up. * page/DOMSelection.cpp: (WebCore::selectionShadowAncestor): Assert the live range setting is false, since this code is not used in that case. Changed the return type to RefPtr. Address the FIXME here by getting the document in a simpler way. (WebCore::DOMSelection::create): Moved here from the header. (WebCore::DOMSelection::frame const): Added. Returns a RefPtr. This gets rid of the need for various instances of the "protector" pattern in this file. (WebCore::DOMSelection::range const): Added. Returns the selected range, but checks for the shadow tree case and returns null in that case. (WebCore::DOMSelection::anchorPosition const): Redid as a member function. (WebCore::DOMSelection::focusPosition const): Ditto. (WebCore::DOMSelection::basePosition const): Ditto. (WebCore::DOMSelection::extentPosition const): Ditto. (WebCore::DOMSelection::anchorNode const): Rewrote to be simpler using the functions above. (WebCore::DOMSelection::anchorOffset const): Ditto. (WebCore::DOMSelection::focusNode const): Ditto. (WebCore::DOMSelection::focusOffset const): Ditto. (WebCore::DOMSelection::baseNode const): Ditto. (WebCore::DOMSelection::baseOffset const): Ditto. (WebCore::DOMSelection::extentNode const): Ditto. (WebCore::DOMSelection::extentOffset const): Ditto. (WebCore::DOMSelection::isCollapsed const): Rewrote using DOMSelection::range and SimpleRange::collapsed. (WebCore::DOMSelection::type const): Updated since frame returns RefPtr. (WebCore::DOMSelection::rangeCount const): Ditto. (WebCore::DOMSelection::collapse): Added new corrected checking for special cases, guarded by the setting. (WebCore::DOMSelection::collapseToEnd): Updated since frame returns RefPtr. way to do protection. Added a call to disassociateLiveRange. No need to put under a setting guard since it does nothing if feature is not enabled. (WebCore::DOMSelection::collapseToStart): Ditto. (WebCore::DOMSelection::empty): Call removeAllRanges so we don't have two copies of the same function to maintain. (WebCore::DOMSelection::setBaseAndExtent): Use makeRefPtr, added corrected checking for special cases guarded by the setting. (WebCore::DOMSelection::setPosition): Call collapse so we don't have two copies of the same function to maintain. (WebCore::DOMSelection::modify): Updated since frame returns RefPtr. (WebCore::DOMSelection::extend): Ditto. Also added corrected checking for special cases guarded by the setting. (WebCore::DOMSelection::getRangeAt): Added a version of this function that simply returns the associated live range, creating one if needed, guarded by the setting. (WebCore::DOMSelection::removeAllRanges): Updated since frame returns RefPtr. (WebCore::DOMSelection::addRange): Added a version of this function that matches the specification, guarded by the setting. (WebCore::DOMSelection::removeRange): Added. (WebCore::DOMSelection::deleteFromDocument): Added a version of this function that simply calls deleteContents on the associated live range, guarded by the setting. (WebCore::DOMSelection::containsNode const): Put the text node workaround inside a setting check. I also figured out why workaround was added: it works around unwanted range canonicalization in various tests, but also introduces incorrect behavior. Also rewrote to use DOMSelection::range. (WebCore::DOMSelection::toString): Use DOMSelection::range, guarded by the setting, so we return empty string when selection is in the shadow tree. (WebCore::DOMSelection::shadowAdjustedNode const): When the live range setting is enabled, adjust by changing the node to nullptr, not finding an ancestor in the document. (WebCore::DOMSelection::shadowAdjustedOffset const): Ditto, but offset 0. (WebCore::DOMSelection::isValidForPosition const): Assert that the live range selection setting is disabled, because this incorrect check should only be used to preserve legacy behavior until we are ready to turn it on. * page/DOMSelection.h: Updated since setBaseAndExtent, setPosition, and collapse can raise exceptions, although they only do so when the live range selection setting is on. Added removeRange. Moved the create function out of the class definition into the .cpp file. Made return values of baseNode, extentNode, anchorNode, focusNode, and shadowAdjustedNode RefPtr. Made toString const. Added frame, range, anchorPosition, focusPosition, basePosition, and extentPosition private functions. Removed visibleSelection. * page/DOMSelection.idl: Updated file to match a recent draft of the Selection standard, reordering things to match the order they appear there. Added removeRange, guarded by the setting. Also got rid of the unncecessary "undefined" string defaults for the arguments to the modify method since they have no effect on observed behavior anyway. * page/Settings.yaml: Added liveRangeSelectionEnabled. 2020-09-17 Chris Dumez <cdumez@apple.com> Vectorize SetTargetAtTime processing in AudioParamTimeline https://bugs.webkit.org/show_bug.cgi?id=216673 Reviewed by Sam Weinig. Vectorize SetTargetAtTime processing in AudioParamTimeline. The patch is based on the Blink implementation at: - https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc I have however added the USE(ACCELERATE) and HAVE(ARM_NEON_INTRINSICS) implementations for DARWIN and non-SSE platforms. This allows us to pass some more tests that we were failing merely due to precision issues. Now that our implemention matches Blink's, our results are consistent with Blink. No new tests, rebaselined existing tests. * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valuesForTimeRangeImpl): (WebCore::AudioParamTimeline::processSetTarget): * Modules/webaudio/AudioParamTimeline.h: * platform/audio/VectorMath.cpp: (WebCore::VectorMath::vsadd): (WebCore::VectorMath::vsmul): * platform/audio/VectorMath.h: 2020-09-17 Eric Carlson <eric.carlson@apple.com> [Cocoa] canPlayType('audio/mpeg; codecs="mp3"') returns "" https://bugs.webkit.org/show_bug.cgi?id=147309 Reviewed by Darin Adler. 'audio/mpeg; codecs="mp3"' is not an RFC 3003 compliant MIME type but some big web sites use it. AVFoundation says the type is not supported, but MediaPlayerPrivateMediaSourceAVFObjC previously returned "maybe" for all extended types where the container type is supported. This bug was fixed when we moved the MIME type logic from MediaPlayerPrivateMediaSourceAVFObjC to MIMETypeCache, so add a mechanism to override extended types and use it to support 'audio/mpeg; codecs="mp3"'. Test: media/media-can-play-mp3.html * platform/graphics/MIMETypeCache.cpp: (WebCore::MIMETypeCache::canDecodeType): (WebCore::MIMETypeCache::overrideExtendedType): * platform/graphics/MIMETypeCache.h: 2020-09-17 Michael Saboff <msaboff@apple.com> Segfault in WebCore::IDBKey::createBinary https://bugs.webkit.org/show_bug.cgi?id=216501 Reviewed by Youenn Fablet. If we can't get a copy of the JSBufferView, return an invalid IDBKey. This can happen if we are low on memory. The existing calling code already handles the case where we might produce an invalid IDBKey. Test: storage/indexeddb/IDBKey-create-array-buffer-view-oom.html * Modules/indexeddb/IDBKey.cpp: (WebCore::IDBKey::createBinary): 2020-09-17 Antoine Quint <graouts@webkit.org> Remove AnimationTimeline::animationsForElement() and the CSS Transitions and CSS Animations accessors on ElementAnimationRareData https://bugs.webkit.org/show_bug.cgi?id=216654 Reviewed by Simon Fraser. Before we implemented the correct way to sort animations using KeyframeEffectStack, we relied on distinct animation collections for CSS Transtions and CSS Animations and remaining Web Animations on ElementAnimationRareData. We don't need those anymore and we can use a single collection which we can now name animations() for all animations. Additionally, the AnimationTimeline::animationsForElement() method where these collections were used when requesting unsorted animations was unnecessary and an incorrect design. Animations do not belong to a given timeline, so we now use the accessors on ElementAnimationRareData directly to get the sorted list of effects or the single animations collection. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::animationWasAddedToElement): (WebCore::AnimationTimeline::animationWasRemovedFromElement): (WebCore::AnimationTimeline::willChangeRendererForElement): (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement): (WebCore::AnimationTimeline::animationsForElement const): Deleted. * animation/AnimationTimeline.h: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::animationCanBeRemoved): (WebCore::DocumentTimeline::computeExtentOfAnimation const): (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): (WebCore::DocumentTimeline::animatedStyleForRenderer): (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): * animation/ElementAnimationRareData.h: (WebCore::ElementAnimationRareData::animations): (WebCore::ElementAnimationRareData::webAnimations): Deleted. (WebCore::ElementAnimationRareData::cssAnimations): Deleted. (WebCore::ElementAnimationRareData::transitions): Deleted. * dom/Element.cpp: (WebCore::Element::animations const): (WebCore::Element::ensureAnimations): (WebCore::Element::getAnimations): (WebCore::Element::webAnimations const): Deleted. (WebCore::Element::cssAnimations const): Deleted. (WebCore::Element::transitions const): Deleted. (WebCore::Element::ensureWebAnimations): Deleted. (WebCore::Element::ensureCSSAnimations): Deleted. (WebCore::Element::ensureTransitions): Deleted. * dom/Element.h: 2020-09-17 Hoa Dinh <dvh@apple.com> Rename ShouldAllowExternalSchemes to ShouldAllowExternalSchemesButNotAppLinks to clarify what this enum value is for. https://bugs.webkit.org/show_bug.cgi?id=216651 Reviewed by Alex Christensen. Rename ShouldAllowExternalSchemes to ShouldAllowExternalSchemesButNotAppLinks and reflects the change where it's used. Source/WebCore: * loader/FrameLoaderTypes.h: * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): 2020-09-17 Chris Dumez <cdumez@apple.com> AnalyserNode.getFloatFrequencyData() should fill array with -Infinity when input is silent https://bugs.webkit.org/show_bug.cgi?id=216629 Reviewed by Youenn Fablet. AnalyserNode.getFloatFrequencyData() should fill array with -Infinity when input is silent. This behavior is consistent with Gecko and Blink. Previously, we'd use AnalyserNode.minDecibels instead. No new tests, rebaselined existing test. * Modules/webaudio/RealtimeAnalyser.cpp: (WebCore::RealtimeAnalyser::getFloatFrequencyData): * platform/audio/AudioUtilities.cpp: (WebCore::AudioUtilities::linearToDecibels): 2020-09-17 Jer Noble <jer.noble@apple.com> [iOS] YouTube does not route video to AirPlay the first time https://bugs.webkit.org/show_bug.cgi?id=216626 <rdar://problem/62222846> Reviewed by Eric Carlson. Difficult to test this, since it requires an live AppleTV device. During a refactor, the order of a couple calls changed. A MediaPlaybackTarget needs to be in place before the MediaPlayer can be told to start playing to that target. Once the target is in-place, subsequent requests to start playing to that target succeed, which explains the "only initial AirPlay fails" behavior. * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::activeVideoRouteDidChange): 2020-09-17 Antti Koivisto <antti@apple.com> Style::Change should be enum class https://bugs.webkit.org/show_bug.cgi?id=216644 Reviewed by Sam Weinig. Also improve the names of the values. * dom/Document.cpp: (WebCore::Document::resolveStyle): * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::willRecalcStyle): * rendering/updating/RenderTreeBuilderFirstLetter.cpp: (WebCore::RenderTreeBuilder::FirstLetter::updateStyle): * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::updateRenderTree): (WebCore::RenderTreeUpdater::updateAfterDescendants): (WebCore::RenderTreeUpdater::updateElementRenderer): * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp: (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement): * style/StyleChange.cpp: (WebCore::Style::determineChange): * style/StyleChange.h: (): Deleted. * style/StyleTreeResolver.cpp: (WebCore::Style::computeDescendantsToResolve): (WebCore::Style::TreeResolver::resolveElement): (WebCore::Style::TreeResolver::createAnimatedElementUpdate): (WebCore::Style::TreeResolver::resolveComposedTree): * style/StyleTreeResolver.h: * style/StyleUpdate.h: * svg/SVGElement.cpp: (WebCore::SVGElement::willRecalcStyle): 2020-09-17 Antoine Quint <graouts@webkit.org> Remove the legacy animation code https://bugs.webkit.org/show_bug.cgi?id=216608 Reviewed by Dean Jackson. We remove the legacy animation code found in Source/WebCore/page/animation/, save for CSSPropertyAnimation which is also used by the new Web Animations engine and now moved to Source/WebCore/animation/. Since we now have a single animation engine, the runtime flags to optionally enable the Web Animations engine are not needed anymore and removed as well. We also remove some testing utilities and some RenderLayerBacking methods specific to accelerated transitions which the new animation engine does not use. * CMakeLists.txt: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/Animatable.idl: * animation/AnimationEffect.idl: * animation/AnimationPlaybackEvent.idl: * animation/AnimationPlaybackEventInit.idl: * animation/AnimationTimeline.idl: * animation/CSSAnimation.idl: * animation/CSSPropertyAnimation.cpp: Renamed from Source/WebCore/page/animation/CSSPropertyAnimation.cpp. (WebCore::PropertyWrapperVisitedAffectedColor::PropertyWrapperVisitedAffectedColor): * animation/CSSPropertyAnimation.h: Renamed from Source/WebCore/page/animation/CSSPropertyAnimation.h. * animation/CSSTransition.idl: * animation/DocumentAnimations.idl: * animation/DocumentOrShadowRootAnimations.idl: * animation/DocumentTimeline.idl: * animation/KeyframeEffect.idl: * animation/WebAnimation.idl: * animation/WebAnimationTypes.h: * css/CSSComputedStyleDeclaration.cpp: (WebCore::computeRenderStyleForProperty): * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::Document::didBecomeCurrentDocumentInFrame): (WebCore::Document::willBeRemovedFromFrame): (WebCore::Document::implicitClose): (WebCore::Document::resume): * dom/Element.cpp: (WebCore::Element::removedFromAncestor): * dom/PseudoElement.cpp: (WebCore::PseudoElement::clearHostElement): * history/CachedFrame.cpp: (WebCore::CachedFrame::destroy): * page/Frame.cpp: (WebCore::Frame::Frame): (WebCore::Frame::clearTimers): (WebCore::Frame::resumeActiveDOMObjectsAndAnimations): * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::didDestroyRenderTree): (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layout): * page/Page.cpp: (WebCore::Page::handleLowModePowerChange): (WebCore::Page::setIsVisibleInternal): (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebAnimationsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webAnimationsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebAnimationsCSSIntegrationEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webAnimationsCSSIntegrationEnabled const): Deleted. * page/animation/AnimationBase.cpp: Removed. * page/animation/AnimationBase.h: Removed. * page/animation/CSSAnimationController.cpp: Removed. * page/animation/CSSAnimationController.h: Removed. * page/animation/CSSAnimationControllerPrivate.h: Removed. * page/animation/CompositeAnimation.cpp: Removed. * page/animation/CompositeAnimation.h: Removed. * page/animation/ImplicitAnimation.cpp: Removed. * page/animation/ImplicitAnimation.h: Removed. * page/animation/KeyframeAnimation.cpp: Removed. * page/animation/KeyframeAnimation.h: Removed. * platform/graphics/GraphicsLayer.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::isKeyframe): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * rendering/RenderElement.cpp: (WebCore::RenderElement::animatedStyle): * rendering/RenderElement.h: (WebCore::RenderElement::startTransition): Deleted. (WebCore::RenderElement::transitionPaused): Deleted. (WebCore::RenderElement::transitionFinished): Deleted. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::currentTransform const): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): (WebCore::RenderLayerBacking::notifyAnimationStarted): (WebCore::RenderLayerBacking::startTransition): Deleted. (WebCore::RenderLayerBacking::transitionPaused): Deleted. (WebCore::RenderLayerBacking::transitionFinished): Deleted. * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::flushPendingLayerChanges): (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): (WebCore::RenderLayerCompositor::isRunningTransformAnimation const): * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::startTransition): Deleted. (WebCore::RenderLayerModelObject::transitionPaused): Deleted. (WebCore::RenderLayerModelObject::transitionFinished): Deleted. * rendering/RenderLayerModelObject.h: * rendering/RenderObject.h: (WebCore::RenderObject::legacyAnimation const): Deleted. * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::tearDownRenderers): * style/StyleAdjuster.cpp: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): * testing/InternalSettings.cpp: (WebCore::InternalSettings::webAnimationsCSSIntegrationEnabled): Deleted. * testing/InternalSettings.h: * testing/InternalSettings.idl: * testing/Internals.cpp: (WebCore::Internals::numberOfActiveAnimations const): (WebCore::Internals::animationsAreSuspended const): (WebCore::Internals::animationsInterval const): (WebCore::Internals::suspendAnimations const): (WebCore::Internals::resumeAnimations const): (WebCore::Internals::acceleratedAnimationsForElement): (WebCore::Internals::numberOfAnimationTimelineInvalidations const): (WebCore::Internals::pauseAnimationAtTimeOnElement): Deleted. (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Deleted. (WebCore::Internals::pauseTransitionAtTimeOnElement): Deleted. (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Deleted. * testing/Internals.h: * testing/Internals.idl: 2020-09-17 Jer Noble <jer.noble@apple.com> Unified build fix for "redefinition of 'kCMVideoCodecType_VP9" https://bugs.webkit.org/show_bug.cgi?id=216205 Reviewed by Youenn Fablet. kCMVideoCodecType_VP9 is present in the macOS Big Sur SDK, so the redeclaration can be removed. To protect builds using prior OS SDKs, wrap the entire VP9 implementation in ENABLE(VP9) checks. * platform/graphics/VP9Utilities.cpp: * platform/graphics/VP9Utilities.h: * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: (WebCore::videoCodecTypeFromRFC4281Type): (WebCore::createMediaPlayerDecodingConfigurationCocoa): (): Deleted. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::isContentTypeSupported): * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::parseVPCodecParameters): (WebCore::Internals::setHardwareVP9DecoderDisabledForTesting): (WebCore::Internals::setVP9ScreenSizeAndScaleForTesting): 2020-09-15 Sergio Villar Senin <svillar@igalia.com> [css-flex] Remove flexbox's specific computePreferredLogicalWidths() https://bugs.webkit.org/show_bug.cgi?id=216577 Reviewed by Darin Adler. Remove the flexbox override of computePreferredLogicalWidths() because it's essentially the same as RenderBlock's but worst because it was missing some cases that were properly handled in the superclass. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computePreferredLogicalWidths): Deleted. * rendering/RenderFlexibleBox.h: Ditto. 2020-09-16 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Move InlineRect from Display to Layout namespace https://bugs.webkit.org/show_bug.cgi?id=216633 Reviewed by Simon Fraser. Let's move the Display type over to Layout namespace. Display tree needs a different set of data types. * WebCore.xcodeproj/project.pbxproj: * layout/displaytree/DisplayLine.h: (WebCore::Display::Line::rect const): (WebCore::Display::Line::scrollableOverflow const): (WebCore::Display::Line::inkOverflow const): (WebCore::Display::Line::Line): * layout/displaytree/DisplayRun.h: (WebCore::Display::Run::rect const): (WebCore::Display::Run::inkOverflow const): (WebCore::Display::Run::Run): * layout/flexformatting/FlexFormattingContext.cpp: (WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computedLineLogicalRect const): (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::InlineBox::InlineBox): (WebCore::Layout::LineBox::logicalRectForTextRun const): (WebCore::Layout::LineBox::constructInlineBoxes): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineBox::logicalRect const): * layout/inlineformatting/InlineRect.h: Renamed from Source/WebCore/layout/displaytree/DisplayInlineRect.h. (WebCore::Layout::InlineRect::expandHorizontally): (WebCore::Layout::InlineRect::expandVertically): (WebCore::Layout::InlineRect::invalidateTop): (WebCore::Layout::InlineRect::invalidateLeft): (WebCore::Layout::InlineRect::invalidateWidth): (WebCore::Layout::InlineRect::invalidateHeight): (WebCore::Layout::InlineRect::hasValidPosition const): (WebCore::Layout::InlineRect::hasValidSize const): (WebCore::Layout::InlineRect::hasValidGeometry const): (WebCore::Layout::InlineRect::InlineRect): (WebCore::Layout::InlineRect::invalidatePosition): (WebCore::Layout::InlineRect::setHasValidPosition): (WebCore::Layout::InlineRect::setHasValidSize): (WebCore::Layout::InlineRect::top const): (WebCore::Layout::InlineRect::left const): (WebCore::Layout::InlineRect::bottom const): (WebCore::Layout::InlineRect::right const): (WebCore::Layout::InlineRect::topLeft const): (WebCore::Layout::InlineRect::size const): (WebCore::Layout::InlineRect::width const): (WebCore::Layout::InlineRect::height const): (WebCore::Layout::InlineRect::setTopLeft): (WebCore::Layout::InlineRect::setTop): (WebCore::Layout::InlineRect::setBottom): (WebCore::Layout::InlineRect::setLeft): (WebCore::Layout::InlineRect::setWidth): (WebCore::Layout::InlineRect::setHeight): (WebCore::Layout::InlineRect::moveHorizontally): (WebCore::Layout::InlineRect::moveVertically): (WebCore::Layout::InlineRect::moveBy): (WebCore::Layout::InlineRect::expand): (WebCore::Layout::InlineRect::expandToContain): (WebCore::Layout::InlineRect::expandVerticallyToContain): (WebCore::Layout::InlineRect::inflate): (WebCore::Layout::InlineRect::operator InlineLayoutRect const): 2020-09-16 Zalan Bujtas <zalan@apple.com> [LFC] Remove partial invalidation https://bugs.webkit.org/show_bug.cgi?id=216631 Reviewed by Simon Fraser. Invalidation fails when the LayoutTree does not match the RenderTree structures (e.g. table wrapper box). Since incremental layouts are not supported yet, it has a very little value. Let's remove it for now. * layout/display/DisplayView.h: * layout/integration/LayoutIntegrationLineLayout.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::LayoutTree::LayoutTree): (WebCore::Layout::TreeBuilder::buildLayoutTree): (WebCore::Layout::TreeBuilder::TreeBuilder): (WebCore::Layout::TreeBuilder::createReplacedBox): (WebCore::Layout::TreeBuilder::createTextBox): (WebCore::Layout::TreeBuilder::createLineBreakBox): (WebCore::Layout::TreeBuilder::createContainer): (WebCore::Layout::TreeBuilder::createLayoutBox): (WebCore::Layout::printLayoutTreeForLiveDocuments): (WebCore::Layout::LayoutTreeContent::LayoutTreeContent): Deleted. (WebCore::Layout::LayoutTreeContent::addLayoutBoxForRenderer): Deleted. (WebCore::Layout::TreeBuilder::buildTree): Deleted. * layout/layouttree/LayoutTreeBuilder.h: (WebCore::Layout::LayoutTree::root const): (WebCore::Layout::LayoutTree::append): (WebCore::Layout::LayoutTreeContent::rootLayoutBox const): Deleted. (WebCore::Layout::LayoutTreeContent::rootLayoutBox): Deleted. (WebCore::Layout::LayoutTreeContent::rootRenderer const): Deleted. (WebCore::Layout::LayoutTreeContent::addBox): Deleted. (WebCore::Layout::LayoutTreeContent::addContainer): Deleted. (WebCore::Layout::LayoutTreeContent::layoutBoxForRenderer): Deleted. (WebCore::Layout::LayoutTreeContent::layoutBoxForRenderer const): Deleted. (WebCore::Layout::LayoutTreeContent::rendererForLayoutBox const): Deleted. * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext): (WebCore::FrameViewLayoutContext::invalidateLayoutTreeContent): Deleted. (WebCore::FrameViewLayoutContext::invalidateLayoutState): Deleted. * page/FrameViewLayoutContext.h: (WebCore::FrameViewLayoutContext::layoutFormattingState const): (WebCore::FrameViewLayoutContext::layoutTreeContent const): Deleted. * rendering/RenderImage.cpp: (WebCore::RenderImage::imageChanged): * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::attachToRenderElementInternal): (WebCore::RenderTreeBuilder::detachFromRenderElement): * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::updateRendererStyle): 2020-09-16 Ryosuke Niwa <rniwa@webkit.org> MutationObserverRegistration should be ref counted https://bugs.webkit.org/show_bug.cgi?id=216528 Reviewed by Darin Adler. This patch makes MutationObserverRegistration ref counted so that the transient registry can store Ref<MutationObserverRegistration> instead of a raw pointer. It also merges NodeMutationObserverData into NodeRareData now that NodeRareData is actually rare after r266714 and r266769. Before this patch, MutationObserverRegistration had to be kept alive by the originally observed node using m_nodeKeptAlive whenever a transient observation occurs (i.e. observation of a node which used to be a part of the subtree of the observed node). With this patch, this complexity is eliminated. No new tests since there should be no behavioral difference. * dom/MutationObserver.cpp: (WebCore::MutationObserver::disconnect): Skip any node for which the observed node had been deleted. This means that the registration is alive for transient nodes (i.e. a node which used to be a part of the subtree of the observed node). (WebCore::MutationObserver::observationStarted): Converted debug assert to a release assert. (WebCore::MutationObserver::observationEnded): Ditto. (WebCore::MutationObserver::deliver): Simplified logic a bit using WTF::map. * dom/MutationObserverRegistration.cpp: (WebCore::MutationObserverRegistration::create): Added. (WebCore::MutationObserverRegistration::MutationObserverRegistration): Create a WeakPtr for m_node. (WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach): Deleted the code for m_nodeKeptAlive since the observed node is no longer responsible for keeping this MutationObserverRegistration alive while transient observarion takes place. (WebCore::MutationObserverRegistration::takeTransientRegistrations): Ditto. (WebCore::MutationObserverRegistration::shouldReceiveMutationFrom const): (WebCore::MutationObserverRegistration::addRegistrationNodesToSet const): Skip m_node if it has been deleted. This is possible during transient observations. * dom/MutationObserverRegistration.h: (WebCore::MutationObserverRegistration): This class is now ref counted. Also made m_node WeakPtr. (WebCore::MutationObserverRegistration::node): * dom/Node.cpp: (WebCore::Node::clearRareData): (WebCore::Node::moveNodeToNewDocument): (WebCore::Node::mutationObserverRegistry): Deleted. (WebCore::Node::transientMutationObserverRegistry): Deleted. (WebCore::collectMatchingObserversForMutation): Now takes a reference to registry. (WebCore::Node::registeredMutationObservers): (WebCore::Node::registerMutationObserver): (WebCore::Node::unregisterMutationObserver): Converted debug assertions to release assertions. With script execution forbidden during tree mutations, this should never happen now. (WebCore::Node::registerTransientMutationObserver): (WebCore::Node::unregisterTransientMutationObserver): Ditto. (WebCore::Node::notifyMutationObserversNodeWillDetach): * dom/Node.h: * dom/NodeRareData.cpp: * dom/NodeRareData.h: (WebCore::NodeMutationObserverData): Merged into NodeRareData. (WebCore::NodeRareData::mutationObserverData): Deleted. (WebCore::NodeRareData::ensureMutationObserverData): Deleted. (WebCore::NodeRareData::mutationObserverRegistry): Added. (WebCore::NodeRareData::mutationObserverRegistryIfExists): Added. (WebCore::NodeRareData::transientMutationObserverRegistry): Added. (WebCore::NodeRareData::useTypes const): 2020-09-16 Sam Weinig <weinig@apple.com> Remove runtime setting for enabling/disabling CSS shadow parts https://bugs.webkit.org/show_bug.cgi?id=216567 Reviewed by Tim Horton. Remove runtime setting for enabling/disabling CSS shadow parts. It is on by default and there is no known reason one would need to disable it. * css/CSSSelector.cpp: (WebCore::CSSSelector::parsePseudoElementType): * dom/Element.cpp: (WebCore::Element::partAttributeChanged): * dom/Element.idl: * dom/ShadowRoot.cpp: (WebCore::parsePartMappingsList): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setCSSShadowPartsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::cssShadowPartsEnabled const): Deleted. * style/StyleInvalidator.cpp: (WebCore::Style::Invalidator::invalidateShadowParts): 2020-09-16 Chris Dumez <cdumez@apple.com> AudioBufferSourceNode.start() ignores 'when' parameter when pitch rate is 0 https://bugs.webkit.org/show_bug.cgi?id=216623 Reviewed by Eric Carlson. AudioBufferSourceNode::renderFromBuffer() has special logic when pitch rate is 0 since the output value is constant. However, that logic was wrongly always writing to the begining of the destination buffer, ignoring the computed writeIndex. As a result, instead of having silence at the beginning of the destination buffer, we would have it at the end. No new tests, rebaselined existing test. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::renderFromBuffer): 2020-09-16 Chris Dumez <cdumez@apple.com> AudioBufferSourceNode.start() behavior is incorrect when offset is past the end of the buffer https://bugs.webkit.org/show_bug.cgi?id=216622 Reviewed by Geoffrey Garen. AudioBufferSourceNode.start() behavior is incorrect when offset is past the end of the buffer. We are supposed to output silence. However, in order implementation, we were just resetting the offset to 0, playing the buffer from the beginning. To address the issue, I have dropped the logic that would reset the read offset if past the end of the buffer. No new tests, rebaselined existing test. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::renderFromBuffer): (WebCore::AudioBufferSourceNode::startPlaying): Drop dead code since m_isGrain is always true in this function. 2020-09-16 Stephan Szabo <stephan.szabo@sony.com> Remove ENABLE_METER_ELEMENT https://bugs.webkit.org/show_bug.cgi?id=216582 Reviewed by Fujii Hironori. With PlayStation finally planning to turn this on, no ports had this disabled, so remove the enable flag. * DerivedSources.make: * accessibility/AXObjectCache.cpp: * accessibility/AccessibilityObject.cpp: * accessibility/AccessibilityProgressIndicator.cpp: * accessibility/AccessibilityProgressIndicator.h: * accessibility/AccessibilityRenderObject.cpp: * css/html.css: * html/HTMLMeterElement.cpp: * html/HTMLMeterElement.h: * html/HTMLMeterElement.idl: * html/HTMLTagNames.in: * platform/LocalizedStrings.h: * platform/cocoa/LocalizedStringsCocoa.mm: * rendering/RenderMeter.cpp: * rendering/RenderMeter.h: * rendering/RenderObject.h: * rendering/RenderTheme.cpp: * rendering/RenderTheme.h: * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: * rendering/RenderThemeWin.cpp: * rendering/RenderThemeWin.h: 2020-09-16 Sam Weinig <weinig@apple.com> Remove runtime setting for enabling/disabling the isSecureContext API? https://bugs.webkit.org/show_bug.cgi?id=216562 Reviewed by Darin Adler. Remove runtime setting for enabling/disabling the the isSecureContext attribute. on window and the worker global scope. There is no known reason one would need to disable it. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setIsSecureContextAttributeEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::isSecureContextAttributeEnabled const): Deleted. * page/WindowOrWorkerGlobalScope.idl: 2020-09-16 Zalan Bujtas <zalan@apple.com> [LFC] Box geometry is all logical https://bugs.webkit.org/show_bug.cgi?id=216614 Reviewed by Simon Fraser. Rename top/left/bottom/right/width/height to logical*. These coordinates are in the Layout namespace, therefore they are all logical. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const): (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider): (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition): (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition const): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/display/DisplayLayerController.cpp: (WebCore::Display::LayerController::prepareForDisplay): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintBoxDecoration): (WebCore::Display::Painter::absoluteBoxGeometry): (WebCore::Display::paintSubtree): (WebCore::Display::collectPaintRootsAndContentRect): * layout/flexformatting/FlexFormattingContext.cpp: (WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): (WebCore::Layout::FloatingContext::append): (WebCore::Layout::FloatingContext::mapTopLeftToFloatingStateRoot const): (WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const): (WebCore::Layout::FloatingState::FloatItem::bottom const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::inlineItemWidth const): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::prepareFloatingState): * layout/layouttree/LayoutBoxGeometry.cpp: (WebCore::Layout::BoxGeometry::borderBox const): * layout/layouttree/LayoutBoxGeometry.h: (WebCore::Layout::BoxGeometry::logicalBottom const): (WebCore::Layout::BoxGeometry::logicalRight const): (WebCore::Layout::BoxGeometry::logicalBottomRight const): (WebCore::Layout::BoxGeometry::logicalSize const): (WebCore::Layout::BoxGeometry::logicalWidth const): (WebCore::Layout::BoxGeometry::logicalHeight const): (WebCore::Layout::BoxGeometry::isEmpty const): (WebCore::Layout::BoxGeometry::logicalRect const): (WebCore::Layout::BoxGeometry::logicalRectWithMargin const): (WebCore::Layout::BoxGeometry::logicalTop const): (WebCore::Layout::BoxGeometry::logicalLeft const): (WebCore::Layout::BoxGeometry::logicalTopLeft const): (WebCore::Layout::BoxGeometry::setLogicalTopLeft): (WebCore::Layout::BoxGeometry::setLogicalTop): (WebCore::Layout::BoxGeometry::setLogicalLeft): (WebCore::Layout::BoxGeometry::bottom const): Deleted. (WebCore::Layout::BoxGeometry::right const): Deleted. (WebCore::Layout::BoxGeometry::bottomRight const): Deleted. (WebCore::Layout::BoxGeometry::size const): Deleted. (WebCore::Layout::BoxGeometry::width const): Deleted. (WebCore::Layout::BoxGeometry::height const): Deleted. (WebCore::Layout::BoxGeometry::rect const): Deleted. (WebCore::Layout::BoxGeometry::rectWithMargin const): Deleted. (WebCore::Layout::BoxGeometry::top const): Deleted. (WebCore::Layout::BoxGeometry::left const): Deleted. (WebCore::Layout::BoxGeometry::topLeft const): Deleted. (WebCore::Layout::BoxGeometry::setTopLeft): Deleted. (WebCore::Layout::BoxGeometry::setTop): Deleted. (WebCore::Layout::BoxGeometry::setLeft): Deleted. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutBox): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const): * layout/tableformatting/TableLayout.cpp: (WebCore::Layout::TableFormattingContext::TableLayout::distributedVerticalSpace): * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext): 2020-09-16 Zalan Bujtas <zalan@apple.com> [LFC][FFC] Add basic flex item sizing and positioning https://bugs.webkit.org/show_bug.cgi?id=216613 Reviewed by Antti Koivisto. This patch adds support for single line (no-wrap), row based flex item layout with default spacing. Test: fast/layoutformattingcontext/flex-box-simple.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/flexformatting/FlexFormattingContext.cpp: (WebCore::Layout::FlexFormattingContext::layoutInFlowContent): (WebCore::Layout::FlexFormattingContext::sizeAndPlaceFlexItems): (WebCore::Layout::FlexFormattingContext::computeIntrinsicWidthConstraintsForFlexItems): * layout/flexformatting/FlexFormattingContext.h: (WebCore::Layout::FlexFormattingContext::Geometry::Geometry): * layout/flexformatting/FlexFormattingContextGeometry.cpp: Added. (WebCore::Layout::FlexFormattingContext::Geometry::intrinsicWidthConstraints): * layout/flexformatting/FlexFormattingState.h: (WebCore::Layout::FlexFormattingState::lines const): Flex layout has the concept of lines where flex wrap may trigger multi-line layout. (WebCore::Layout::FlexFormattingState::addLine): 2020-09-16 Chris Lord <clord@igalia.com> Enable full CSS color parsing within a worker for OffscreenCanvas https://bugs.webkit.org/show_bug.cgi?id=204575 Reviewed by Darin Adler. Enable full CSS color parsing in OffscreenCanvas by removing the unnecessary use of CSSValuePool::singleton in color-parsing code in CSSPropertyParserHelpers and adding a new helper function to return a Color instead of a CSSPrimitiveValue when parsing a color. Rebaselined existing layout tests. * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::computeDegrees const): * css/CSSPrimitiveValue.h: (WebCore::CSSPrimitiveValue::computeDegrees): * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseColorWorkerSafe): * css/parser/CSSParser.h: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::CalcParser::consumePercentRaw): (WebCore::CSSPropertyParserHelpers::CalcParser::consumeAngleRaw): (WebCore::CSSPropertyParserHelpers::consumePercentRaw): (WebCore::CSSPropertyParserHelpers::consumePercent): (WebCore::CSSPropertyParserHelpers::consumeAngleRaw): (WebCore::CSSPropertyParserHelpers::consumeAngle): (WebCore::CSSPropertyParserHelpers::clampRGBComponent): (WebCore::CSSPropertyParserHelpers::parseRGBParameters): (WebCore::CSSPropertyParserHelpers::parseHSLParameters): (WebCore::CSSPropertyParserHelpers::consumeColorWorkerSafe): * css/parser/CSSPropertyParserHelpers.h: 2020-09-16 Chris Dumez <cdumez@apple.com> Merge PeriodicWave improvements from Blink https://bugs.webkit.org/show_bug.cgi?id=216576 Reviewed by Darin Adler. Merge PeriodicWave improvements from Blink: - https://codereview.chromium.org/1180613007 - https://codereview.chromium.org/66393004 These fixes allow us to pass some of the tests imported from Blink. No new tests, rebaselined existing tests. * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::PeriodicWave): (WebCore::PeriodicWave::maxNumberOfPartials const): (WebCore::PeriodicWave::createBandLimitedTables): (WebCore::PeriodicWave::generateBasicWaveform): (WebCore::PeriodicWave::periodicWaveSize const): * Modules/webaudio/PeriodicWave.h: 2020-09-16 Chris Dumez <cdumez@apple.com> OfflineAudioContext should support up to 32 channels https://bugs.webkit.org/show_bug.cgi?id=216587 Reviewed by Darin Adler. OfflineAudioContext should support up to 32 channels. It previously had an artificial limit of 10. No new tests, updated existing test. * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::create): 2020-09-16 Brent Fulgham <bfulgham@apple.com> [macOS] Limit reported macOS release to 10.15 series https://bugs.webkit.org/show_bug.cgi?id=216593 <rdar://problem/68937905> Reviewed by Maciej Stachowiak. If the reported system OS is 11.0 (or beyond) report the last stable release of macOS. * platform/mac/UserAgentMac.mm: (WebCore::standardUserAgentWithApplicationName): 2020-09-16 Chris Dumez <cdumez@apple.com> OfflineAudioContext constructor should not throw when given a bad buffer length https://bugs.webkit.org/show_bug.cgi?id=216584 Reviewed by Youenn Fablet. OfflineAudioContext constructor should not throw when given a bad buffer length. We should instead throw later on when trying to start rendering. No new tests, rebaselined existing test. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::OfflineAudioContext): (WebCore::OfflineAudioContext::create): (WebCore::OfflineAudioContext::startOfflineRendering): * Modules/webaudio/OfflineAudioContext.h: * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode): (WebCore::OfflineAudioDestinationNode::maxChannelCount const): 2020-09-16 Sam Weinig <weinig@apple.com> [WebIDL] Move navigator.cookieEnabled to its own interface mixin, matching the spec https://bugs.webkit.org/show_bug.cgi?id=216590 Reviewed by Youenn Fablet. Adds NavigatorCookies interface mixin and includes it in Navigator. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * page/Navigator.idl: * page/NavigatorCookies.idl: Added. 2020-09-16 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes, early September 2020 edition https://bugs.webkit.org/show_bug.cgi?id=216599 Unreviewed build fix. Largely based on a patch by Lauro Moura <lmoura@igalia.com> * Modules/async-clipboard/ClipboardImageReader.cpp: Add missing Document.h include. * Modules/async-clipboard/ClipboardImageReader.h: Add missing forward declaration for Document. * Modules/fetch/FetchBodyConsumer.cpp: Add missing includes for DOMFormData.h, HTTPParsers.h, and JSDOMFormData.h. * css/parser/CSSSelectorParser.cpp: Move CSSSelectorParser declaration to header. * css/parser/CSSSelectorParser.h: Ditto. * css/parser/CSSSupportsParser.cpp: Add missing CSSSelectorParser.h include. * dom/DataTransferItemList.cpp: Add missing includes for ContextDestructionObserver.h and Document.h. * html/HTMLMetaElement.cpp: Add missing includes for Settings.h and wtf/IsoMallocInlines.h. * html/canvas/EXTBlendMinMax.cpp: Add missing wtf/IsoMallocInlines.h include. * html/canvas/EXTColorBufferFloat.cpp: Ditto. * html/canvas/OESElementIndexUint.cpp: Ditto. * html/canvas/WebGLCompressedTextureASTC.cpp: Ditto. * html/canvas/WebGLCompressedTextureATC.cpp: Ditto. * html/canvas/WebGLCompressedTextureETC.cpp: Ditto. * inspector/InspectorFrontendHost.cpp: Add missing Settings.h include. * layout/display/DisplayLayerController.cpp: Add missing LayoutState.h include. * layout/displaytree/DisplayPainter.h: Add missing LayoutBox.h include. * layout/inlineformatting/InlineLineBox.cpp: Add missing InlineFormattingContext.h include. * platform/audio/FFTFrame.cpp: Add missing VectorMath.h include. * platform/audio/SincResampler.h: Add missing wtf/Optional.h include. * rendering/SimpleLineLayout.h: Add missing RenderStyleConstants.h include. 2020-09-16 Zalan Bujtas <zalan@apple.com> [LFC][FFC] Create a Layout::ContainerBox for flex container https://bugs.webkit.org/show_bug.cgi?id=216598 Reviewed by Antti Koivisto. A flex container establishes a flex formatting context. * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::createFormattingContext): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createLayoutBox): 2020-09-16 Aditya Keerthi <akeerthi@apple.com> [Cocoa] Use OTF font features instead of AAT font features when possible https://bugs.webkit.org/show_bug.cgi?id=182845 <rdar://problem/33046942> Reviewed by Myles C. Maxfield. Using OTF font features instead of AAT font features allows WebKit to leverage CoreText's mapping between OTF and AAT features. This prevents us from having to maintain our own mapping, and adds support for previously missing features (for AAT fonts), such as stylistic alternatives. Note that the hlig and hist features are not mapped by CoreText for AAT fonts, in which case we handle the mapping to an AAT font feature ourselves. Test: css3/font-feature-settings-stylistic-set.html * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::appendTrueTypeFeature): (WebCore::preparePlatformFont): 2020-09-16 Philippe Normand <pnormand@igalia.com> [GStreamer][1.18] Regressions https://bugs.webkit.org/show_bug.cgi?id=216558 Reviewed by Xabier Rodriguez-Calvar. The most significant change here is the added support for video rendering stats caching. This was caught by imported/w3c/web-platform-tests/media-source/mediasource-getvideoplaybackquality.html * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp: (webKitGLVideoSinkGetProperty): Fix 1.18 version runtime check. 1.17 was the development version of 1.18. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::isAVC1CodecSupported const): Ditto. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::createVideoSink): Ditto. (WebCore::MediaPlayerPrivateGStreamer::videoPlaybackQualityMetrics): Cache or reuse cached statistics. Caching is required so that metrics queries performed after EOS still return valid values. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 2020-09-15 Said Abou-Hallawa <sabouhallawa@apple.com> REGRESSION(r266677): ASSERTION FAILED in PaintFrequencyTracker::end() https://bugs.webkit.org/show_bug.cgi?id=216591 <rdar://problem/68635418> Reviewed by Simon Fraser. Make RenderLayer track the painting which is scheduled through RenderingUpdateScheduler only. We can do this by (1) reseting Page:: m_renderingUpdateTimestamp at the end of Page::updateRendering() and (2) making SinglePaintFrequencyTracking track the painting only if the timestamp is not zero. * page/ChromeClient.h: (WebCore::ChromeClient::timestampForPaintFrequencyTracking const): Deleted. * page/Page.cpp: (WebCore::Page::updateRendering): * page/Page.h: (WebCore::Page::renderingUpdateTimestamp const): (WebCore::Page::lastRenderingUpdateTimestamp const): Deleted. * rendering/PaintFrequencyTracker.h: (WebCore::SinglePaintFrequencyTracking::SinglePaintFrequencyTracking): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::calculateClipRects const): 2020-09-15 Rob Buis <rbuis@igalia.com> Fix lazy image load painting https://bugs.webkit.org/show_bug.cgi?id=216554 Reviewed by Darin Adler. Fix lazy image load painting, when LoadImmediately was introduced, it correctly triggered the immediate load but after finishing the load there was no transition to the finished lazy load state, causing the logic in RenderImage::paint to not paint the finished load. This was not detected before since most lazy load WPT tests are not pixel tests but rather test correct load events etc. (image-loading-subpixel-clip.html is an exception since it is a reftest). Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-subpixel-clip.html * loader/ImageLoader.cpp: (WebCore::ImageLoader::notifyFinished): 2020-09-15 Zalan Bujtas <zalan@apple.com> [LFC][FFC] 'display: flex' generates a flex container box that is block-level when placed in flow layout https://bugs.webkit.org/show_bug.cgi?id=216596 Reviewed by Simon Fraser. See https://www.w3.org/TR/css-flexbox-1/#flex-containers. * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::isBlockLevelBox const): 2020-09-15 Zalan Bujtas <zalan@apple.com> [LFC] Use isBlockBox() in Box::establishesBlockFormattingContext https://bugs.webkit.org/show_bug.cgi?id=216595 Reviewed by Simon Fraser. Let's use the Box::isBlockBox() function (now that we have it) to check if a box establishes a new BFC (this matches spec language now). * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::establishesBlockFormattingContext const): 2020-09-15 Aditya Keerthi <akeerthi@apple.com> [macOS] Date pickers should respect the document's color scheme https://bugs.webkit.org/show_bug.cgi?id=216514 <rdar://problem/68889548> Reviewed by Tim Horton. Added the useDarkAppearance property to DateTimeChooserParameters, which is based on Document::useDarkAppearance and the associated element's computed style. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setupDateTimeChooserParameters): * platform/DateTimeChooserParameters.h: (WebCore::DateTimeChooserParameters::encode const): (WebCore::DateTimeChooserParameters::decode): 2020-09-15 Yusuke Suzuki <ysuzuki@apple.com> Delete LocaleToScriptMappingICU.cpp since it is no longer used https://bugs.webkit.org/show_bug.cgi?id=216592 Reviewed by Myles C. Maxfield. All ports are using LocaleToScriptMappingDefault.cpp and nobody is using / building LocaleToScriptMappingICU.cpp. Let's remove it and rename LocaleToScriptMappingDefault.cpp to LocaleToScriptMapping.cpp * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/text/LocaleToScriptMapping.cpp: Renamed from Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp. * platform/text/LocaleToScriptMappingICU.cpp: Removed. 2020-09-15 Myles C. Maxfield <mmaxfield@apple.com> [macOS Big Sur] CGFontRenderingGetFontSmoothingDisabled() is no longer useful https://bugs.webkit.org/show_bug.cgi?id=216588 <rdar://problem/68657748> Reviewed by Simon Fraser. No new tests because there is no behavior change. * platform/graphics/coretext/FontCascadeCoreText.cpp: (WebCore::FontCascade::isSubpixelAntialiasingAvailable): 2020-09-15 Myles C. Maxfield <mmaxfield@apple.com> [Apple Win] Migrate the first part of SimpleFontData{CG}Win.cpp to FontCoreText.cpp https://bugs.webkit.org/show_bug.cgi?id=216525 Reviewed by Dean Jackson. This migrates: - Font::isProbablyOnlyUsedToRenderIcons() - Font::platformSupportsCodePoint() - Font::determinePitch() - Font::platformBoundsForGlyph() - Font::platformPathForGlyph() - Font::applyTransforms() from the old Windows CG codepath to the Core Text codepath. This patch unifies these functions between the Apple Windows port and the macOS / iOS ports. Covered by existing tests. * platform/graphics/Font.cpp: (WebCore::Font::variantCapsSupportsCharacterForSynthesis const): (WebCore::Font::platformSupportsCodePoint const): Deleted. * platform/graphics/coretext/FontCoreText.cpp: (WebCore::Font::platformWidthForGlyph const): Move this up into the #if !PLATFORM(WIN) section. We don't want to migrate this one just yet because it causes a significant number of test failures, which require more investigation. (WebCore::Font::determinePitch): (WebCore::Font::isProbablyOnlyUsedToRenderIcons const): * platform/graphics/win/SimpleFontDataCGWin.cpp: (WebCore::Font::platformBoundsForGlyph const): Deleted. (WebCore::Font::platformPathForGlyph const): Deleted. * platform/graphics/win/SimpleFontDataCairoWin.cpp: (WebCore::Font::determinePitch): The WinCairo port is the only port still using the non-CG Windows implementation of this function, so we can just move it directly into the CairoWin-specific file. * platform/graphics/win/SimpleFontDataWin.cpp: (WebCore::Font::determinePitch): Deleted. 2020-09-15 Chris Dumez <cdumez@apple.com> ScriptProcessorNode should throw when trying to change its channel count or channel count mode https://bugs.webkit.org/show_bug.cgi?id=216583 Reviewed by Geoffrey Garen. ScriptProcessorNode should throw when trying to change its channel count or channel count mode: - https://www.w3.org/TR/webaudio/#audionode-channelcount-constraints - https://www.w3.org/TR/webaudio/#audionode-channelcountmode-constraints No new tests, rebaselined existing test. * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::setChannelCount): (WebCore::ScriptProcessorNode::setChannelCountMode): * Modules/webaudio/ScriptProcessorNode.h: 2020-09-15 Jer Noble <jer.noble@apple.com> CRASH: Exception thrown from -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:] https://bugs.webkit.org/show_bug.cgi?id=216580 <rdar://problem/68866834> Reviewed by Eric Carlson. Protect against undocumented exceptions thrown from AVContentKeySession (and related) APIs by wrapping in @try/@catch blocks and firing the correct failure callbacks if an exception is encountered. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest): 2020-09-15 Fujii Hironori <Hironori.Fujii@sony.com> preprocessor.pm: Use Cygwin::win_to_posix_path and Cygwin::posix_to_win_path instead of cygpath command https://bugs.webkit.org/show_bug.cgi?id=216527 Reviewed by Darin Adler. * bindings/scripts/preprocessor.pm: (applyPreprocessor): Use shellwords() to split the $preprocessor. Use Cygwin Perl's builtin functions instead of spawning process. 2020-09-15 Sam Weinig <weinig@apple.com> Remove runtime setting for enabling/disabling the fetch API https://bugs.webkit.org/show_bug.cgi?id=216519 Reviewed by Alex Christensen. Remove runtime setting for enabling/disabling the fetch API. There is no reason one needs to disable it now and it has been on by default for a long enough time. * Modules/fetch/FetchBody.idl: * Modules/fetch/FetchHeaders.idl: * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchResponse.idl: * Modules/fetch/WindowOrWorkerGlobalScopeFetch.idl: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setFetchAPIEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::fetchAPIEnabled const): Deleted. 2020-09-15 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, fix the build with recent SDKs. rdar://68939059 * platform/graphics/coretext/FontCascadeCoreText.cpp: (WebCore::FontCascade::isSubpixelAntialiasingAvailable): 2020-09-15 Sam Weinig <weinig@apple.com> Remove runtime setting for enabling/disabling custom elements https://bugs.webkit.org/show_bug.cgi?id=216518 Reviewed by Tim Horton. Remove runtime setting for enabling/disabling custom elements. There is no reason one need to disable it now, and it has been on by default for a long enough time. * dom/CustomElementRegistry.idl: * dom/Document.cpp: (WebCore::createUpgradeCandidateElement): * page/DOMWindow.idl: * page/Settings.yaml: 2020-09-15 Chris Dumez <cdumez@apple.com> Improve thread-safety in ScriptProcessorNode implementation https://bugs.webkit.org/show_bug.cgi?id=216555 Reviewed by Geoffrey Garen. Improve thread-safety in ScriptProcessorNode implementation: - Use a Lock instead of a volatile bool to determine if the main thread is still busy firing the event. - Pass the doubleBufferIndex to the main thread by capturing it in the lambda instead of relying on a data member. * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::ScriptProcessorNode): (WebCore::ScriptProcessorNode::process): (WebCore::ScriptProcessorNode::fireProcessEvent): * Modules/webaudio/ScriptProcessorNode.h: 2020-09-15 Alex Christensen <achristensen@webkit.org> Remove unused plumbing for setting whether the storage access API is enabled https://bugs.webkit.org/show_bug.cgi?id=216516 Reviewed by Youenn Fablet. Sending a boolean from the process pool to the network process has been superceded by a preference in WebPreferences.yaml. The boolean sent to the network process was not even used any more. * platform/network/NetworkStorageSession.h: * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::NetworkStorageSession::setStorageAccessAPIEnabled): Deleted. 2020-09-15 Sam Weinig <weinig@apple.com> [WebIDL] Update Fetch IDLs to use WindowOrWorkerGlobalScope partial mixin https://bugs.webkit.org/show_bug.cgi?id=216524 Reviewed by Darin Adler. Move global fetch() function definition from DOMWindowFetch.idl & WorkerGlobalScopeFetch.idl to single WindowOrWorkerGlobalScopeFetch.idl, matching the spec. Also cleanup some comments in other Fetch related IDLs. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/fetch/DOMWindowFetch.cpp: Removed. * Modules/fetch/DOMWindowFetch.h: Removed. * Modules/fetch/DOMWindowFetch.idl: Removed. * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchRequestInit.idl: * Modules/fetch/FetchResponse.idl: * Modules/fetch/WindowOrWorkerGlobalScopeFetch.cpp: Added. (WebCore::WindowOrWorkerGlobalScopeFetch::fetch): * Modules/fetch/WindowOrWorkerGlobalScopeFetch.h: Added. * Modules/fetch/WindowOrWorkerGlobalScopeFetch.idl: Added. * Modules/fetch/WorkerGlobalScopeFetch.cpp: Removed. * Modules/fetch/WorkerGlobalScopeFetch.h: Removed. * Modules/fetch/WorkerGlobalScopeFetch.idl: Removed. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-09-15 Zalan Bujtas <zalan@apple.com> [LFC] Move Layout::Rect to a dedicated file https://bugs.webkit.org/show_bug.cgi?id=216553 Reviewed by Antti Koivisto. * WebCore.xcodeproj/project.pbxproj: * layout/layouttree/LayoutBoxGeometry.h: (WebCore::Layout::Rect::expandHorizontally): Deleted. (WebCore::Layout::Rect::expandVertically): Deleted. (WebCore::Layout::Rect::intersects const): Deleted. (WebCore::Layout::Rect::invalidateTop): Deleted. (WebCore::Layout::Rect::invalidateLeft): Deleted. (WebCore::Layout::Rect::invalidateWidth): Deleted. (WebCore::Layout::Rect::invalidateHeight): Deleted. (WebCore::Layout::Rect::hasValidPosition const): Deleted. (WebCore::Layout::Rect::hasValidSize const): Deleted. (WebCore::Layout::Rect::hasValidGeometry const): Deleted. (WebCore::Layout::Rect::Rect): Deleted. (WebCore::Layout::Rect::invalidatePosition): Deleted. (WebCore::Layout::Rect::setHasValidPosition): Deleted. (WebCore::Layout::Rect::setHasValidSize): Deleted. (WebCore::Layout::Rect::top const): Deleted. (WebCore::Layout::Rect::left const): Deleted. (WebCore::Layout::Rect::bottom const): Deleted. (WebCore::Layout::Rect::right const): Deleted. (WebCore::Layout::Rect::topLeft const): Deleted. (WebCore::Layout::Rect::bottomRight const): Deleted. (WebCore::Layout::Rect::size const): Deleted. (WebCore::Layout::Rect::width const): Deleted. (WebCore::Layout::Rect::height const): Deleted. (WebCore::Layout::Rect::setTopLeft): Deleted. (WebCore::Layout::Rect::setTop): Deleted. (WebCore::Layout::Rect::setLeft): Deleted. (WebCore::Layout::Rect::setWidth): Deleted. (WebCore::Layout::Rect::setHeight): Deleted. (WebCore::Layout::Rect::setSize): Deleted. (WebCore::Layout::Rect::shiftLeftTo): Deleted. (WebCore::Layout::Rect::shiftRightTo): Deleted. (WebCore::Layout::Rect::shiftTopTo): Deleted. (WebCore::Layout::Rect::shiftBottomTo): Deleted. (WebCore::Layout::Rect::moveHorizontally): Deleted. (WebCore::Layout::Rect::moveVertically): Deleted. (WebCore::Layout::Rect::expand): Deleted. (WebCore::Layout::Rect::clone const): Deleted. (WebCore::Layout::Rect::operator LayoutRect const): Deleted. * layout/layouttree/LayoutGeometryRect.h: Added. (WebCore::Layout::Rect::expandHorizontally): (WebCore::Layout::Rect::expandVertically): (WebCore::Layout::Rect::intersects const): (WebCore::Layout::Rect::invalidateTop): (WebCore::Layout::Rect::invalidateLeft): (WebCore::Layout::Rect::invalidateWidth): (WebCore::Layout::Rect::invalidateHeight): (WebCore::Layout::Rect::hasValidPosition const): (WebCore::Layout::Rect::hasValidSize const): (WebCore::Layout::Rect::hasValidGeometry const): (WebCore::Layout::Rect::Rect): (WebCore::Layout::Rect::invalidatePosition): (WebCore::Layout::Rect::setHasValidPosition): (WebCore::Layout::Rect::setHasValidSize): (WebCore::Layout::Rect::top const): (WebCore::Layout::Rect::left const): (WebCore::Layout::Rect::bottom const): (WebCore::Layout::Rect::right const): (WebCore::Layout::Rect::topLeft const): (WebCore::Layout::Rect::bottomRight const): (WebCore::Layout::Rect::size const): (WebCore::Layout::Rect::width const): (WebCore::Layout::Rect::height const): (WebCore::Layout::Rect::setTopLeft): (WebCore::Layout::Rect::setTop): (WebCore::Layout::Rect::setLeft): (WebCore::Layout::Rect::setWidth): (WebCore::Layout::Rect::setHeight): (WebCore::Layout::Rect::setSize): (WebCore::Layout::Rect::shiftLeftTo): (WebCore::Layout::Rect::shiftRightTo): (WebCore::Layout::Rect::shiftTopTo): (WebCore::Layout::Rect::shiftBottomTo): (WebCore::Layout::Rect::moveHorizontally): (WebCore::Layout::Rect::moveVertically): (WebCore::Layout::Rect::expand): (WebCore::Layout::Rect::clone const): (WebCore::Layout::Rect::operator LayoutRect const): 2020-09-14 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] Indefinite flex-basis percentage should cause height to be ignored https://bugs.webkit.org/show_bug.cgi?id=210077 Reviewed by Darin Adler. If flex-basis is a percentage of an indefinite height we should ignore what height specifies and treat it and as height:auto. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::cacheChildMainSize): Cache the intrinsic height of the child when flex-basis is a percentage of an indefinite length. 2020-09-15 Rob Buis <rbuis@igalia.com> Convert runtime flag to setting for lazy image loading https://bugs.webkit.org/show_bug.cgi?id=215610 Reviewed by Youenn Fablet. Convert runtime flag to setting for lazy image loading. Settings are preferred over RuntimeEnabledFeatures as they are not global singletons and are automatically accessible in layout tests via InternalSettingsGenerated. * loader/ImageLoader.cpp: 2020-09-15 Youenn Fablet <youenn@apple.com> End of media capture should not be reported before 3 seconds of the start of capture https://bugs.webkit.org/show_bug.cgi?id=216415 Reviewed by Eric Carlson. Add a timer that allows taking a function and a delay as parameter. Covered by added API test. * platform/Timer.h: (WebCore::DeferrableTaskTimer::fired): (WebCore::DeferrableTaskTimer::doTask): (WebCore::DeferrableTaskTimer::cancel): 2020-09-14 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] Unreviewed debug build fix after r267073 https://bugs.webkit.org/show_bug.cgi?id=216448 * platform/graphics/win/FontPlatformDataCairoWin.cpp: (WebCore::FontPlatformData::description const): Added. 2020-09-14 Zalan Bujtas <zalan@apple.com> [LFC] Layout::BoxGeometry rename, part II. https://bugs.webkit.org/show_bug.cgi?id=216523 Reviewed by Simon Fraser. Rename Layout::Geometry to Layout::BoxGeometry (so that later we can introduce Layout::LineGeometry and Layout::RunGeometry) and make sure we don't use displayBox as a variable name in Layout namespace. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::computeBorderAndPadding): (WebCore::Layout::FormattingContext::geometryForBox const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const): (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const): * layout/FormattingContextQuirks.cpp: * layout/FormattingState.cpp: (WebCore::Layout::FormattingState::boxGeometry): (WebCore::Layout::FormattingState::displayBox): Deleted. * layout/FormattingState.h: * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::geometryForRootBox): (WebCore::Layout::LayoutState::ensureGeometryForBoxSlow): (WebCore::Layout::LayoutState::geometryForRootLayoutBox): Deleted. (WebCore::Layout::LayoutState::ensureDisplayBoxForLayoutBoxSlow): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasBoxGeometry const): (WebCore::Layout::LayoutState::ensureGeometryForBox): (WebCore::Layout::LayoutState::geometryForBox const): (WebCore::Layout::Box::cachedGeometryForLayoutState const): (WebCore::Layout::LayoutState::hasDisplayBox const): Deleted. (WebCore::Layout::LayoutState::ensureGeometryForLayoutBox): Deleted. (WebCore::Layout::LayoutState::geometryForLayoutBox const): Deleted. (WebCore::Layout::Box::cachedDisplayBoxForLayoutState const): Deleted. * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren): (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition): (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear): (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/display/DisplayLayerController.cpp: (WebCore::Display::LayerController::prepareForDisplay): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintBoxDecoration): (WebCore::Display::Painter::absoluteBoxGeometry): (WebCore::Display::paintSubtree): (WebCore::Display::collectPaintRootsAndContentRect): (WebCore::Display::Painter::absoluteDisplayBox): Deleted. * layout/displaytree/DisplayPainter.h: * layout/floats/FloatAvoider.h: * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): (WebCore::Layout::FloatingContext::append): (WebCore::Layout::FloatingContext::absoluteBoxGeometryCoordinates const): (WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const): Deleted. * layout/floats/FloatingContext.h: * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::FloatItem::FloatItem): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const): (WebCore::Layout::FloatingState::FloatItem::horizontalMargin const): (WebCore::Layout::FloatingState::FloatItem::bottom const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints): (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin): (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin): (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin): (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent): (WebCore::Layout::InlineFormattingContext::createDisplayBoxesForLineContent): Deleted. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineLineBox.h: * layout/inlineformatting/InlineLineBuilder.cpp: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::prepareFloatingState): * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::setcachedGeometryForLayoutState const): (WebCore::Layout::Box::setCachedDisplayBoxForLayoutState const): Deleted. * layout/layouttree/LayoutBox.h: * layout/layouttree/LayoutBoxGeometry.cpp: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.cpp. (WebCore::Layout::BoxGeometry::BoxGeometry): (WebCore::Layout::BoxGeometry::~BoxGeometry): (WebCore::Layout::BoxGeometry::marginBox const): (WebCore::Layout::BoxGeometry::borderBox const): (WebCore::Layout::BoxGeometry::paddingBox const): (WebCore::Layout::BoxGeometry::contentBox const): * layout/layouttree/LayoutBoxGeometry.h: Renamed from Source/WebCore/layout/layouttree/LayoutGeometry.h. (WebCore::Layout::Rect::expandHorizontally): (WebCore::Layout::Rect::expandVertically): (WebCore::Layout::Rect::intersects const): (WebCore::Layout::Rect::invalidateTop): (WebCore::Layout::Rect::invalidateLeft): (WebCore::Layout::Rect::invalidateWidth): (WebCore::Layout::Rect::invalidateHeight): (WebCore::Layout::Rect::hasValidPosition const): (WebCore::Layout::Rect::hasValidSize const): (WebCore::Layout::Rect::hasValidGeometry const): (WebCore::Layout::Rect::Rect): (WebCore::Layout::Rect::invalidatePosition): (WebCore::Layout::Rect::setHasValidPosition): (WebCore::Layout::Rect::setHasValidSize): (WebCore::Layout::Rect::top const): (WebCore::Layout::Rect::left const): (WebCore::Layout::Rect::bottom const): (WebCore::Layout::Rect::right const): (WebCore::Layout::Rect::topLeft const): (WebCore::Layout::Rect::bottomRight const): (WebCore::Layout::Rect::size const): (WebCore::Layout::Rect::width const): (WebCore::Layout::Rect::height const): (WebCore::Layout::Rect::setTopLeft): (WebCore::Layout::Rect::setTop): (WebCore::Layout::Rect::setLeft): (WebCore::Layout::Rect::setWidth): (WebCore::Layout::Rect::setHeight): (WebCore::Layout::Rect::setSize): (WebCore::Layout::Rect::shiftLeftTo): (WebCore::Layout::Rect::shiftRightTo): (WebCore::Layout::Rect::shiftTopTo): (WebCore::Layout::Rect::shiftBottomTo): (WebCore::Layout::Rect::moveHorizontally): (WebCore::Layout::Rect::moveVertically): (WebCore::Layout::Rect::expand): (WebCore::Layout::Rect::clone const): (WebCore::Layout::Rect::operator LayoutRect const): (WebCore::Layout::BoxGeometry::bottom const): (WebCore::Layout::BoxGeometry::right const): (WebCore::Layout::BoxGeometry::bottomRight const): (WebCore::Layout::BoxGeometry::size const): (WebCore::Layout::BoxGeometry::width const): (WebCore::Layout::BoxGeometry::height const): (WebCore::Layout::BoxGeometry::isEmpty const): (WebCore::Layout::BoxGeometry::rect const): (WebCore::Layout::BoxGeometry::rectWithMargin const): (WebCore::Layout::BoxGeometry::hasClearance const): (WebCore::Layout::BoxGeometry::verticalBorder const): (WebCore::Layout::BoxGeometry::horizontalBorder const): (WebCore::Layout::BoxGeometry::contentBoxTop const): (WebCore::Layout::BoxGeometry::contentBoxLeft const): (WebCore::Layout::BoxGeometry::contentBoxBottom const): (WebCore::Layout::BoxGeometry::contentBoxRight const): (WebCore::Layout::BoxGeometry::paddingBoxTop const): (WebCore::Layout::BoxGeometry::paddingBoxLeft const): (WebCore::Layout::BoxGeometry::paddingBoxBottom const): (WebCore::Layout::BoxGeometry::paddingBoxRight const): (WebCore::Layout::BoxGeometry::paddingBoxHeight const): (WebCore::Layout::BoxGeometry::paddingBoxWidth const): (WebCore::Layout::BoxGeometry::borderBoxHeight const): (WebCore::Layout::BoxGeometry::borderBoxWidth const): (WebCore::Layout::BoxGeometry::marginBoxHeight const): (WebCore::Layout::BoxGeometry::marginBoxWidth const): (WebCore::Layout::BoxGeometry::verticalMarginBorderAndPadding const): (WebCore::Layout::BoxGeometry::horizontalMarginBorderAndPadding const): (WebCore::Layout::BoxGeometry::setHasPrecomputedMarginBefore): (WebCore::Layout::BoxGeometry::moveHorizontally): (WebCore::Layout::BoxGeometry::moveVertically): (WebCore::Layout::BoxGeometry::move): (WebCore::Layout::BoxGeometry::moveBy): (WebCore::Layout::BoxGeometry::setHasClearance): (WebCore::Layout::BoxGeometry::invalidateBorder): (WebCore::Layout::BoxGeometry::invalidatePadding): (WebCore::Layout::BoxGeometry::invalidatePrecomputedMarginBefore): (WebCore::Layout::BoxGeometry::setHasValidTop): (WebCore::Layout::BoxGeometry::setHasValidLeft): (WebCore::Layout::BoxGeometry::setHasValidVerticalMargin): (WebCore::Layout::BoxGeometry::setHasValidHorizontalMargin): (WebCore::Layout::BoxGeometry::setHasValidBorder): (WebCore::Layout::BoxGeometry::setHasValidPadding): (WebCore::Layout::BoxGeometry::setHasValidContentHeight): (WebCore::Layout::BoxGeometry::setHasValidContentWidth): (WebCore::Layout::BoxGeometry::invalidateMargin): (WebCore::Layout::BoxGeometry::top const): (WebCore::Layout::BoxGeometry::left const): (WebCore::Layout::BoxGeometry::topLeft const): (WebCore::Layout::BoxGeometry::setTopLeft): (WebCore::Layout::BoxGeometry::setTop): (WebCore::Layout::BoxGeometry::setLeft): (WebCore::Layout::BoxGeometry::setContentBoxHeight): (WebCore::Layout::BoxGeometry::setContentBoxWidth): (WebCore::Layout::BoxGeometry::contentBoxHeight const): (WebCore::Layout::BoxGeometry::contentBoxWidth const): (WebCore::Layout::BoxGeometry::setHorizontalMargin): (WebCore::Layout::BoxGeometry::setVerticalMargin): (WebCore::Layout::BoxGeometry::setBorder): (WebCore::Layout::BoxGeometry::setPadding): (WebCore::Layout::BoxGeometry::setVerticalPadding): (WebCore::Layout::BoxGeometry::verticalMargin const): (WebCore::Layout::BoxGeometry::horizontalMargin const): (WebCore::Layout::BoxGeometry::marginBefore const): (WebCore::Layout::BoxGeometry::marginStart const): (WebCore::Layout::BoxGeometry::marginAfter const): (WebCore::Layout::BoxGeometry::marginEnd const): (WebCore::Layout::BoxGeometry::paddingTop const): (WebCore::Layout::BoxGeometry::paddingLeft const): (WebCore::Layout::BoxGeometry::paddingBottom const): (WebCore::Layout::BoxGeometry::paddingRight const): (WebCore::Layout::BoxGeometry::verticalPadding const): (WebCore::Layout::BoxGeometry::horizontalPadding const): (WebCore::Layout::BoxGeometry::borderTop const): (WebCore::Layout::BoxGeometry::borderLeft const): (WebCore::Layout::BoxGeometry::borderBottom const): (WebCore::Layout::BoxGeometry::borderRight const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutBox): (WebCore::Layout::outputLayoutTree): (WebCore::Layout::showLayoutTree): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): (WebCore::Layout::TableFormattingContext::layoutCell): * layout/tableformatting/TableFormattingContextGeometry.cpp: * layout/tableformatting/TableLayout.cpp: * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext): 2020-09-14 Ryosuke Niwa <rniwa@webkit.org> Element should not set an attribute inside its constructor https://bugs.webkit.org/show_bug.cgi?id=216507 Reviewed by Wenson Hsieh. Moved the code to add attributes from element constructors to respective ::create functions since setting attributes could run code in parseAttribute some of which may try to store "this" in Ref / RefPtr, which would not be safe before adoptRef is called. No new tests since there should be no observable behavioral change. * dom/Element.cpp: (WebCore::Element::setAttributeInternal): Added an assertion. * html/FileInputType.cpp: (WebCore::UploadButtonElement::create): (WebCore::UploadButtonElement::createForMultiple): (WebCore::UploadButtonElement::createInternal): Extracted. (WebCore::UploadButtonElement::UploadButtonElement): * html/HTMLKeygenElement.cpp: * html/shadow/DateTimeEditElement.cpp: (WebCore::DateTimeEditElement::DateTimeEditElement): (WebCore::DateTimeEditElement::create): * html/shadow/DateTimeFieldElements.cpp: (WebCore::DateTimeDayFieldElement::DateTimeDayFieldElement): (WebCore::DateTimeDayFieldElement::create): (WebCore::DateTimeHourFieldElement::DateTimeHourFieldElement): (WebCore::DateTimeHourFieldElement::create): (WebCore::DateTimeMeridiemFieldElement::DateTimeMeridiemFieldElement): (WebCore::DateTimeMeridiemFieldElement::create): (WebCore::DateTimeMillisecondFieldElement::DateTimeMillisecondFieldElement): (WebCore::DateTimeMillisecondFieldElement::create): (WebCore::DateTimeMinuteFieldElement::DateTimeMinuteFieldElement): (WebCore::DateTimeMinuteFieldElement::create): (WebCore::DateTimeMonthFieldElement::DateTimeMonthFieldElement): (WebCore::DateTimeMonthFieldElement::create): (WebCore::DateTimeSecondFieldElement::DateTimeSecondFieldElement): (WebCore::DateTimeSecondFieldElement::create): (WebCore::DateTimeSymbolicMonthFieldElement::DateTimeSymbolicMonthFieldElement): (WebCore::DateTimeSymbolicMonthFieldElement::create): (WebCore::DateTimeYearFieldElement::DateTimeYearFieldElement): (WebCore::DateTimeYearFieldElement::create): * html/shadow/DetailsMarkerControl.cpp: (WebCore::DetailsMarkerControl::create): (WebCore::DetailsMarkerControl::DetailsMarkerControl): * html/shadow/MediaControlTextTrackContainerElement.cpp: (WebCore::MediaControlTextTrackContainerElement::create): (WebCore::MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement): * html/shadow/SpinButtonElement.cpp: (WebCore::SpinButtonElement::SpinButtonElement): (WebCore::SpinButtonElement::create): * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement): (WebCore::TextControlPlaceholderElement::create): (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement): (WebCore::SearchFieldCancelButtonElement::create): * html/shadow/YouTubeEmbedShadowElement.cpp: (WebCore::YouTubeEmbedShadowElement::create): (WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCueBox::create): Moved from .h. (WebCore::TextTrackCueBox::TextTrackCueBox): (WebCore::TextTrackCueBox::initilaize): Added. * html/track/TextTrackCue.h: (WebCore::TextTrackCueBox::create): Moved to cpp. * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGenericBoxElement::create): Now calls initialize(). * html/track/VTTCue.cpp: (WebCore::VTTCueBox::create): Moved from .h. Now calls initialize(). * html/track/VTTCue.h: (WebCore::VTTCueBox::create): Moved to cpp. 2020-09-14 Myles C. Maxfield <mmaxfield@apple.com> [Apple Win] Migrate from FontPlatformDataWin.cpp to FontPlatformDataCoreText.cpp https://bugs.webkit.org/show_bug.cgi?id=216448 Reviewed by Darin Adler. This is one of the steps toward migrating the Apple Win port off of CGFont and on to CTFont. This patch removes the #if !PLATFORM(WIN) guard in FontPlatformDataCoreText.cpp and deletes the old functions it used to be using. It fixes up the Core Text functions to use ctFont() instead of font(), because font() returns the HFONT on Windows. It also adds a new helper, platformOpenTypeTable(), because it looks like CTFontCopyTable() sometimes fails, so we can use this function to fall back to using the HFONT and the win32 API instead. Covered by existing tests. * platform/graphics/FontPlatformData.cpp: * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::ctFont const): (WebCore::FontPlatformData::font const): * platform/graphics/cocoa/FontPlatformDataCocoa.mm: (WebCore::FontPlatformData::platformOpenTypeTable const): * platform/graphics/coretext/FontPlatformDataCoreText.cpp: (WebCore::FontPlatformData::FontPlatformData): (WebCore::FontPlatformData::registeredFont const): (WebCore::FontPlatformData::ctFont const): (WebCore::FontPlatformData::openTypeTable const): (WebCore::FontPlatformData::description const): (WebCore::FontPlatformData::familyName const): * platform/graphics/win/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::~FontCustomPlatformData): (WebCore::FontCustomPlatformData::fontPlatformData): (WebCore::createFontCustomPlatformData): * platform/graphics/win/FontCustomPlatformData.h: (WebCore::FontCustomPlatformData::FontCustomPlatformData): * platform/graphics/win/FontCustomPlatformDataCairo.cpp: (WebCore::FontCustomPlatformData::~FontCustomPlatformData): (WebCore::FontCustomPlatformData::fontPlatformData): * platform/graphics/win/FontPlatformDataCGWin.cpp: (WebCore::FontPlatformData::FontPlatformData): * platform/graphics/win/FontPlatformDataCairoWin.cpp: (WebCore::FontPlatformData::openTypeTable const): * platform/graphics/win/FontPlatformDataWin.cpp: (WebCore::FontPlatformData::platformOpenTypeTable const): (WebCore::FontPlatformData::openTypeTable const): Deleted. (WebCore::FontPlatformData::description const): Deleted. 2020-09-14 Chris Dumez <cdumez@apple.com> Types of Panner.setPosition() / setOrientation() parameters should not be unrestricted float https://bugs.webkit.org/show_bug.cgi?id=216508 Reviewed by Darin Adler. Types of Panner.setPosition() / setOrientation() parameters should not be unrestricted float: - https://www.w3.org/TR/webaudio/#pannernode They should use float type so that we throw when passing values that are non-finite or not a number. Test: webaudio/panner-node-exceptions.html * Modules/webaudio/PannerNode.idl: 2020-09-14 Sam Weinig <weinig@apple.com> Remove runtime setting for enabling/disabling ShadowDOM https://bugs.webkit.org/show_bug.cgi?id=216511 Reviewed by Ryosuke Niwa. Remove runtime setting for enabling/disabling ShadowDOM. There is no reason one need to disable it now, and it has been on by default for a long enough time. * dom/Element.idl: * dom/Event.idl: * dom/Node.idl: * dom/ShadowRoot.idl: * dom/Slotable.idl: * html/HTMLSlotElement.idl: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setShadowDOMEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::shadowDOMEnabled const): Deleted. 2020-09-14 Simon Fraser <simon.fraser@apple.com> REGRESSION (Async overflow scroll): Code snippets on getkirby.com appear and disappear as content is scrolled https://bugs.webkit.org/show_bug.cgi?id=216490 <rdar://problem/67018073> Reviewed by Zalan Bujtas. The content in question had a z-order layer tree like this: A (0,0) width=997 height=829 (layerID 20) {sc 2} RenderView + B (0,0) width=997 height=8 RenderBlock HTML class='no-js' + C (0,0) width=997 height=829 RenderFlexibleBox MAIN n D (0,0) width=256 height=829 RenderFlexibleBox NAV class='left panel' n E (0,0) width=256 height=829 (layerID 25) {sc 3} RenderBlock DIV class='scroller' n F (256,0) width=741 height=829 RenderFlexibleBox ARTICLE class='main panel' n G (0,0) width=741 height=829 (layerID 26) {sc 4} RenderBlock DIV class='scroller' n H (0,-816) width=741 height=2810 RenderBlock DIV class='article-content' + I (0,0) width=256 height=1000 (layerID 27) overlap RenderBlock (relative positioned) DIV class='content' + J (10,300) width=721 height=202 (layerID 28) overlap RenderBlock (relative positioned) DIV class='relative-box' + K (10,802) width=721 height=202 (layerID 29) overlap RenderBlock (relative positioned) DIV class='relative-box' + L (10,1304) width=721 height=202 (layerID 30) overlap RenderBlock (relative positioned) DIV class='relative-box' + M (10,1806) width=721 height=202 (layerID 31) overlap RenderBlock (relative positioned) DIV class='relative-box' + M (10,2308) width=721 height=202 (layerID 32) overlap RenderBlock (relative positioned) DIV class='relative-box' When layer 'G' is scrolled, the code would find the paint-order parent, F, which is normal-flow because it has overflow:hidden, and would call setDescendantsNeedUpdateBackingAndHierarchyTraversal() on it. However, that doesn't go high enough, because we need to update J-M since their ancestor clipping stacks have geometry that relies on the scroll position of G. If we don't update that geometry, GraphicsLayers have an incorrect notion of what's visible, and we don't attach backing store. The fix is to climb up to the stacking context B and call setDescendantsNeedUpdateBackingAndHierarchyTraversal() on it. Test: compositing/scrolling/async-overflow-scrolling/nested-scrollers-backing-attachment.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollTo): 2020-09-14 Chris Dumez <cdumez@apple.com> Type of AnalyserNode's attributes should not be unrestricted double https://bugs.webkit.org/show_bug.cgi?id=216505 Reviewed by Darin Adler. Type of AnalyserNode's attributes should not be unrestricted double. They should use double type so that we throw when trying to set them to NaN or infinity values. No new tests, updated existing test. * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::setSmoothingTimeConstant): * Modules/webaudio/AnalyserNode.idl: 2020-09-14 Chris Dumez <cdumez@apple.com> Drop non-standard AudioBuffer.gain https://bugs.webkit.org/show_bug.cgi?id=216510 Reviewed by Darin Adler. Drop non-standard AudioBuffer.gain: - https://www.w3.org/TR/webaudio/#AudioBuffer Blink does not expose this attribute either. No new tests, updated existing test. * Modules/webaudio/AudioBuffer.h: (WebCore::AudioBuffer::gain const): Deleted. (WebCore::AudioBuffer::setGain): Deleted. (): Deleted. * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::process): 2020-09-14 Chris Dumez <cdumez@apple.com> Drop smoothing logic from DelayDSPKernel::process() https://bugs.webkit.org/show_bug.cgi?id=216504 Reviewed by Eric Carlson. Drop smoothing logic from DelayDSPKernel::process(). This is not as per specification and does not match the behavior of Chromium. This is causing us to fail a WPT test. No new tests, rebaselined existing test. * Modules/webaudio/DelayDSPKernel.cpp: (WebCore::DelayDSPKernel::DelayDSPKernel): (WebCore::DelayDSPKernel::process): (WebCore::DelayDSPKernel::reset): * Modules/webaudio/DelayDSPKernel.h: 2020-09-14 Zalan Bujtas <zalan@apple.com> [LFC][FFC] Block box flex items establish block formatting contexts https://bugs.webkit.org/show_bug.cgi?id=216502 Reviewed by Simon Fraser. 1. The display value of a flex item is blockified: if the specified display of an in-flow child of an element generating a flex container is an inline-level value, it computes to its block-level equivalent. 2. A block box that establishes an independent formatting context establishes a new block formatting context for its contents. * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::establishesBlockFormattingContext const): (WebCore::Layout::Box::isBlockBox const): * layout/layouttree/LayoutBox.h: 2020-09-14 Jer Noble <jer.noble@apple.com> [Cocoa,HDR] HLS streams with HDR variants will not select HDR. https://bugs.webkit.org/show_bug.cgi?id=216203 <rdar://problem/67438626> Reviewed by Darin Adler. Test: http/tests/media/hls/hls-hdr-switch.html In r264710, we adopted a new API to set the preferred HDR mode for every AVPlayer created by an HTMLMediaElement. The MediaPlayerPrivateAVFoundationObjC object will query its parent when it creates an AVPlayer, or the MediaPlayer will tell the MediaPlayerPrivate... that the HDR mode changes if the AVPlayer is already created. However, in r264710, we neglected to cache the new value of the preferred HDR mode, so subsequent queries will just return "Standard". This means HDR mode will correctly be applied if it changes after the AVPlayer has been created, but not initially. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::setPreferredDynamicRangeMode): 2020-09-14 Simon Fraser <simon.fraser@apple.com> [LFC] The result of layout should be Layout::Geometry, not Display::Box https://bugs.webkit.org/show_bug.cgi?id=216497 Reviewed by Zalan Bujtas. We should reserve things in the Display namespace for painting, so layout should emit Layout::Geometry rather than Display::Boxes. So clone Display::Box to Layout::Geometry and use Layout::Geometry everywhere that Display::Box was used. Future patches will move painting ot use Display objects. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::geometryForBox const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const): (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const): * layout/FormattingContextQuirks.cpp: * layout/FormattingState.cpp: (WebCore::Layout::FormattingState::displayBox): * layout/FormattingState.h: * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::geometryForRootLayoutBox): (WebCore::Layout::LayoutState::ensureDisplayBoxForLayoutBoxSlow): (WebCore::Layout::LayoutState::displayBoxForRootLayoutBox): Deleted. * layout/LayoutState.h: (WebCore::Layout::LayoutState::ensureGeometryForLayoutBox): (WebCore::Layout::LayoutState::geometryForLayoutBox const): (WebCore::Layout::Box::cachedDisplayBoxForLayoutState const): (WebCore::Layout::LayoutState::ensureDisplayBoxForLayoutBox): Deleted. (WebCore::Layout::LayoutState::displayBoxForLayoutBox const): Deleted. * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContextGeometry.cpp: * layout/blockformatting/BlockFormattingContextQuirks.cpp: * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: * layout/display/DisplayLayerController.cpp: (WebCore::Display::LayerController::prepareForDisplay): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintBoxDecoration): (WebCore::Display::Painter::absoluteDisplayBox): (WebCore::Display::collectPaintRootsAndContentRect): * layout/displaytree/DisplayPainter.h: * layout/floats/FloatAvoider.h: * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::append): * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::FloatItem::FloatItem): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const): (WebCore::Layout::FloatingState::FloatItem::horizontalMargin const): * layout/inlineformatting/InlineLineBox.h: * layout/inlineformatting/InlineLineBuilder.cpp: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::prepareFloatingState): * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::setCachedDisplayBoxForLayoutState const): * layout/layouttree/LayoutBox.h: * layout/layouttree/LayoutGeometry.cpp: Added. (WebCore::Layout::Geometry::Geometry): (WebCore::Layout::Geometry::~Geometry): (WebCore::Layout::Geometry::marginBox const): (WebCore::Layout::Geometry::borderBox const): (WebCore::Layout::Geometry::paddingBox const): (WebCore::Layout::Geometry::contentBox const): * layout/layouttree/LayoutGeometry.h: Added. (WebCore::Layout::Rect::expandHorizontally): (WebCore::Layout::Rect::expandVertically): (WebCore::Layout::Rect::intersects const): (WebCore::Layout::Rect::invalidateTop): (WebCore::Layout::Rect::invalidateLeft): (WebCore::Layout::Rect::invalidateWidth): (WebCore::Layout::Rect::invalidateHeight): (WebCore::Layout::Rect::hasValidPosition const): (WebCore::Layout::Rect::hasValidSize const): (WebCore::Layout::Rect::hasValidGeometry const): (WebCore::Layout::Rect::Rect): (WebCore::Layout::Rect::invalidatePosition): (WebCore::Layout::Rect::setHasValidPosition): (WebCore::Layout::Rect::setHasValidSize): (WebCore::Layout::Rect::top const): (WebCore::Layout::Rect::left const): (WebCore::Layout::Rect::bottom const): (WebCore::Layout::Rect::right const): (WebCore::Layout::Rect::topLeft const): (WebCore::Layout::Rect::bottomRight const): (WebCore::Layout::Rect::size const): (WebCore::Layout::Rect::width const): (WebCore::Layout::Rect::height const): (WebCore::Layout::Rect::setTopLeft): (WebCore::Layout::Rect::setTop): (WebCore::Layout::Rect::setLeft): (WebCore::Layout::Rect::setWidth): (WebCore::Layout::Rect::setHeight): (WebCore::Layout::Rect::setSize): (WebCore::Layout::Rect::shiftLeftTo): (WebCore::Layout::Rect::shiftRightTo): (WebCore::Layout::Rect::shiftTopTo): (WebCore::Layout::Rect::shiftBottomTo): (WebCore::Layout::Rect::moveHorizontally): (WebCore::Layout::Rect::moveVertically): (WebCore::Layout::Rect::expand): (WebCore::Layout::Rect::clone const): (WebCore::Layout::Rect::operator LayoutRect const): (WebCore::Layout::Geometry::bottom const): (WebCore::Layout::Geometry::right const): (WebCore::Layout::Geometry::bottomRight const): (WebCore::Layout::Geometry::size const): (WebCore::Layout::Geometry::width const): (WebCore::Layout::Geometry::height const): (WebCore::Layout::Geometry::isEmpty const): (WebCore::Layout::Geometry::rect const): (WebCore::Layout::Geometry::rectWithMargin const): (WebCore::Layout::Geometry::hasClearance const): (WebCore::Layout::Geometry::verticalBorder const): (WebCore::Layout::Geometry::horizontalBorder const): (WebCore::Layout::Geometry::contentBoxTop const): (WebCore::Layout::Geometry::contentBoxLeft const): (WebCore::Layout::Geometry::contentBoxBottom const): (WebCore::Layout::Geometry::contentBoxRight const): (WebCore::Layout::Geometry::paddingBoxTop const): (WebCore::Layout::Geometry::paddingBoxLeft const): (WebCore::Layout::Geometry::paddingBoxBottom const): (WebCore::Layout::Geometry::paddingBoxRight const): (WebCore::Layout::Geometry::paddingBoxHeight const): (WebCore::Layout::Geometry::paddingBoxWidth const): (WebCore::Layout::Geometry::borderBoxHeight const): (WebCore::Layout::Geometry::borderBoxWidth const): (WebCore::Layout::Geometry::marginBoxHeight const): (WebCore::Layout::Geometry::marginBoxWidth const): (WebCore::Layout::Geometry::verticalMarginBorderAndPadding const): (WebCore::Layout::Geometry::horizontalMarginBorderAndPadding const): (WebCore::Layout::Geometry::setHasPrecomputedMarginBefore): (WebCore::Layout::Geometry::moveHorizontally): (WebCore::Layout::Geometry::moveVertically): (WebCore::Layout::Geometry::move): (WebCore::Layout::Geometry::moveBy): (WebCore::Layout::Geometry::setHasClearance): (WebCore::Layout::Geometry::invalidateBorder): (WebCore::Layout::Geometry::invalidatePadding): (WebCore::Layout::Geometry::invalidatePrecomputedMarginBefore): (WebCore::Layout::Geometry::setHasValidTop): (WebCore::Layout::Geometry::setHasValidLeft): (WebCore::Layout::Geometry::setHasValidVerticalMargin): (WebCore::Layout::Geometry::setHasValidHorizontalMargin): (WebCore::Layout::Geometry::setHasValidBorder): (WebCore::Layout::Geometry::setHasValidPadding): (WebCore::Layout::Geometry::setHasValidContentHeight): (WebCore::Layout::Geometry::setHasValidContentWidth): (WebCore::Layout::Geometry::invalidateMargin): (WebCore::Layout::Geometry::top const): (WebCore::Layout::Geometry::left const): (WebCore::Layout::Geometry::topLeft const): (WebCore::Layout::Geometry::setTopLeft): (WebCore::Layout::Geometry::setTop): (WebCore::Layout::Geometry::setLeft): (WebCore::Layout::Geometry::setContentBoxHeight): (WebCore::Layout::Geometry::setContentBoxWidth): (WebCore::Layout::Geometry::contentBoxHeight const): (WebCore::Layout::Geometry::contentBoxWidth const): (WebCore::Layout::Geometry::setHorizontalMargin): (WebCore::Layout::Geometry::setVerticalMargin): (WebCore::Layout::Geometry::setBorder): (WebCore::Layout::Geometry::setPadding): (WebCore::Layout::Geometry::setVerticalPadding): (WebCore::Layout::Geometry::verticalMargin const): (WebCore::Layout::Geometry::horizontalMargin const): (WebCore::Layout::Geometry::marginBefore const): (WebCore::Layout::Geometry::marginStart const): (WebCore::Layout::Geometry::marginAfter const): (WebCore::Layout::Geometry::marginEnd const): (WebCore::Layout::Geometry::paddingTop const): (WebCore::Layout::Geometry::paddingLeft const): (WebCore::Layout::Geometry::paddingBottom const): (WebCore::Layout::Geometry::paddingRight const): (WebCore::Layout::Geometry::verticalPadding const): (WebCore::Layout::Geometry::horizontalPadding const): (WebCore::Layout::Geometry::borderTop const): (WebCore::Layout::Geometry::borderLeft const): (WebCore::Layout::Geometry::borderBottom const): (WebCore::Layout::Geometry::borderRight const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutBox): (WebCore::Layout::outputLayoutTree): (WebCore::Layout::showLayoutTree): * layout/tableformatting/TableFormattingContext.cpp: * layout/tableformatting/TableFormattingContextGeometry.cpp: * layout/tableformatting/TableLayout.cpp: * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext): 2020-09-14 Peng Liu <peng.liu6@apple.com> Returning to element fullscreen from PiP is not stable under stress tests https://bugs.webkit.org/show_bug.cgi?id=216287 Reviewed by Jer Noble. * platform/cocoa/VideoFullscreenChangeObserver.h: Delete prepareToExitFullscreen(). * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit): (VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStop): (VideoFullscreenInterfaceAVKit::didStopPictureInPicture): (VideoFullscreenInterfaceAVKit::stopPictureInPictureTimerFired): (VideoFullscreenInterfaceAVKit::setReadyToStopPictureInPicture): VideoFullscreenInterfaceAVKit expects an element enters fullscreen and figure out the location and size of the video element after that, which will be used by AVKit for the exiting picture-in-picture animation. However, the entering fullscreen may take a long time and AVKit will start exiting picture-in-picture before the entering fullscreen transition is done. We need to add protection for such a scenario. This patch adds a timer (m_stopPictureInPictureTimer) for this purpose. This patch also makes sure VideoFullscreenInterfaceAVKit will call didExitPictureInPicture() properly. * platform/ios/WebVideoFullscreenControllerAVKit.mm: Delete prepareToExitFullscreen(). * platform/mac/VideoFullscreenInterfaceMac.mm: (WebCore::VideoFullscreenInterfaceMac::preparedToReturnToInline): This function is not used on Mac. 2020-09-14 Sam Weinig <weinig@apple.com> [WebIDL] Move synthetic operation creation from IDLParser to CodeGeneratorJS https://bugs.webkit.org/show_bug.cgi?id=216468 Reviewed by Chris Dumez. Address FIXMEs in IDLParser by moving synthetic operation creation out of IDLParser and into CodeGeneratorJS. Replace use of isIterable/isMapLike/isSetLike predicates on IDLOperation and IDLAttribute with extended attributes, FromIterable, ForwardToMapLike and ForwardToSetLike. While this change completely removes all notion of operations/attributes from IDLMapLike and IDLSetLike, IDLIterable retains an operations array, now only used by CodeGeneratorJS, to avoid a larger refactoring of the code generation. Eventually, it would be good to stop using AST level operations and attributes to model these synthetic operations, and instead have the code generation maintain a model that more closely resembles the ECMAScript output directly. While here, also fix the issue that maplike and setlike were always overriding set/clear/delete and add/clear/delete (respectively) where as WebIDL says they should only add those if the interface doesn't already have members with those names. Adds new tests for this behavior. * bindings/scripts/CodeGeneratorJS.pm: * bindings/scripts/IDLParser.pm: * bindings/scripts/test/BindingTestGlobalConstructors.idl: * bindings/scripts/test/JS/JSTestMapLikeWithOverriddenOperations.cpp: Added. * bindings/scripts/test/JS/JSTestMapLikeWithOverriddenOperations.h: Added. * bindings/scripts/test/JS/JSTestSetLikeWithOverriddenOperations.cpp: Added. * bindings/scripts/test/JS/JSTestSetLikeWithOverriddenOperations.h: Added. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestMapLikeWithOverriddenOperations.idl: Added. * bindings/scripts/test/TestSetLikeWithOverriddenOperations.idl: Added. 2020-09-14 Zalan Bujtas <zalan@apple.com> [LFC][FFC] Each in-flow child of a flex container becomes a flex item. https://bugs.webkit.org/show_bug.cgi?id=216494 Reviewed by Simon Fraser. ...and flex items form independent formatting contexts for their content. * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::establishesIndependentFormattingContext const): (WebCore::Layout::Box::isFlexItem const): * layout/layouttree/LayoutBox.h: 2020-09-14 Chris Dumez <cdumez@apple.com> AudioDestinationCocoa should stop hardcoding the number of output channels to 2 https://bugs.webkit.org/show_bug.cgi?id=216491 Reviewed by Darin Adler. Stop hardcoding the number of output channels in AudioDestinationCocoa and instead use the AudioDestinationNode's number of output channels. * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestination::create): (WebCore::AudioDestinationCocoa::AudioDestinationCocoa): (WebCore::AudioDestinationCocoa::numberOfOutputChannels const): (WebCore::AudioDestinationCocoa::setAudioStreamBasicDescription): (): Deleted. * platform/audio/cocoa/AudioDestinationCocoa.h: * platform/mock/MockAudioDestinationCocoa.cpp: (WebCore::MockAudioDestinationCocoa::MockAudioDestinationCocoa): 2020-09-14 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo][MediaFoundation] r264188 introduced linker warning: LNK4199: /DELAYLOAD:mf.dll ignored; no imports found from mf.dll https://bugs.webkit.org/show_bug.cgi?id=214170 Reviewed by Alex Christensen. r264188 added the linker flag /DELAYLOAD:mf.dll to WebCore. It introduced a lot of linker warnings for modules not using MediaFoundation, for example WebKitWebProcess.exe, MiniBrowserLib.dll, etc. The linker option should be applied only to direct WebCore consumers, namely WebKit.dll, WebKit2.dll and TestWebCore.exe. Define a INTERFACE library, and link it explicitly with the direct WebCore consumers. * PlatformWinCairo.cmake: 2020-09-14 Dean Jackson <dino@apple.com> Enable WebGL2 by default https://bugs.webkit.org/show_bug.cgi?id=216464 <rdar://problem/68811378> Reviewed by Sam Weinig. Our WebGL2 implementation is in good enough shape that we should enable it by default for broader testing. * page/RuntimeEnabledFeatures.h: 2020-09-14 Zalan Bujtas <zalan@apple.com> [LFC][FFC] Introduce flex formatting context https://bugs.webkit.org/show_bug.cgi?id=216483 Reviewed by Antti Koivisto. Add the basic class structure for the flex formatting context. https://www.w3.org/TR/css-flexbox-1/ * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.h: (WebCore::Layout::FormattingContext::isFlexFormattingContext const): * layout/FormattingState.h: (WebCore::Layout::FormattingState::isFlexFormattingState const): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::establishedFormattingState const): (WebCore::Layout::LayoutState::establishedFlexFormattingState const): (WebCore::Layout::LayoutState::ensureFormattingState): (WebCore::Layout::LayoutState::ensureFlexFormattingState): * layout/LayoutState.h: * layout/flexformatting/FlexFormattingContext.cpp: Added. (WebCore::Layout::FlexFormattingContext::FlexFormattingContext): (WebCore::Layout::FlexFormattingContext::layoutInFlowContent): (WebCore::Layout::FlexFormattingContext::computedIntrinsicWidthConstraints): * layout/flexformatting/FlexFormattingContext.h: Added. * layout/flexformatting/FlexFormattingState.cpp: Added. (WebCore::Layout::FlexFormattingState::FlexFormattingState): (WebCore::Layout::FlexFormattingState::~FlexFormattingState): * layout/flexformatting/FlexFormattingState.h: Added. * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::establishesFormattingContext const): (WebCore::Layout::Box::establishesFlexFormattingContext const): * layout/layouttree/LayoutBox.h: (WebCore::Layout::Box::isFlexBox const): 2020-09-14 Simon Fraser <simon.fraser@apple.com> First steps towards LFC painting in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=216466 Address post-landing comments: make two constructors explicit. * layout/display/DisplayLayerController.h: * layout/display/DisplayView.h: 2020-09-14 Simon Fraser <simon.fraser@apple.com> First steps towards LFC painting in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=216466 Reviewed by Zalan Bujtas. Get LFC painting in WebKit2. Display::LayerController() is intended to be a controller object that makes layerization decisions; for now, it just creates some root layers and hooks them up via attachRootGraphicsLayer(). It also creates a GraphicsLayerClient that paints by calling LayoutContext::paint(). Display::View is responsible for the display of an LFC-rendered document. FrameView has one, and the Display::View has a Display::LayerController(). The minimal hookup points are: 1. Page::doAfterUpdateRendering() tells each Display::View to prepareForDisplay(). This is where we'll do once-per-rendering layer updating. 2. FrameView::flushCompositingStateForThisFrame() tells the Display::View() to flush layers, which just passes through to Display::LayerController(). For now we just rely on the fact that Display::LayerController() calls attachRootGraphicsLayer() after RenderLayerCompositor, replacing the root layer created by existing RenderLayerCompositor code. * CMakeLists.txt: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/LayoutState.h: (WebCore::Layout::LayoutState::hasRoot const): * layout/display/DisplayLayerController.cpp: Added. (WebCore::Display::LayerController::RootLayerClient::RootLayerClient): (WebCore::Display::LayerController::RootLayerClient::notifyFlushRequired): (WebCore::Display::LayerController::RootLayerClient::paintContents): (WebCore::Display::LayerController::LayerController): (WebCore::Display::LayerController::prepareForDisplay): (WebCore::Display::LayerController::flushLayers): (WebCore::Display::LayerController::visibleRectForLayerFlushing const): (WebCore::Display::LayerController::scheduleRenderingUpdate): (WebCore::Display::LayerController::ensureRootLayer): (WebCore::Display::LayerController::setupRootLayerHierarchy): (WebCore::Display::LayerController::updateRootLayerGeometry): (WebCore::Display::LayerController::attachRootLayer): (WebCore::Display::LayerController::graphicsLayerFactory const): * layout/display/DisplayLayerController.h: Added. (WebCore::Display::LayerController::view const): (WebCore::Display::LayerController::rootGraphicsLayer const): (WebCore::Display::LayerController::contentLayer const): * layout/display/DisplayView.cpp: Copied from Source/WebCore/layout/displaytree/DisplayPainter.h. (WebCore::Display::View::View): (WebCore::Display::View::~View): (WebCore::Display::View::frame const): (WebCore::Display::View::page const): (WebCore::Display::View::layoutState const): (WebCore::Display::View::prepareForDisplay): (WebCore::Display::View::flushLayers): * layout/display/DisplayView.h: Copied from Source/WebCore/layout/displaytree/DisplayPainter.h. (WebCore::Display::View::frameView const): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::Painter::absoluteDisplayBox): (WebCore::Display::paintSubtree): (WebCore::Display::collectPaintRootsAndContentRect): (WebCore::Display::absoluteDisplayBox): Deleted. * layout/displaytree/DisplayPainter.h: * layout/inlineformatting/InlineLineBuilder.cpp: * page/FrameView.cpp: (WebCore::FrameView::flushCompositingStateForThisFrame): (WebCore::FrameView::existingDisplayView const): (WebCore::FrameView::displayView): * page/FrameView.h: * page/Page.cpp: (WebCore::Page::doAfterUpdateRendering): * platform/graphics/x11/PlatformDisplayX11.h: Denote Display as being in the global namespace. * platform/graphics/x11/XErrorTrapper.h: (WebCore::XErrorTrapper::XErrorTrapper): * platform/graphics/x11/XUniquePtr.h: 2020-09-14 Sam Weinig <weinig@apple.com> [WebIDL] Replace 'serializable' with '[Default] object toJSON()' https://bugs.webkit.org/show_bug.cgi?id=216148 Reviewed by Eric Carlson. Replace the 'serializable' keyword, which has been removed from WebIDL, with its replacement, '[Default] object toJSON()'. The new version is pretty similar, but has much less room for customization in that you can no longer specify which attributes are included in the JSON result. Rather, all attributes that qualify as having a 'JSON type' are included for the interface itself and all ancestor interfaces. Interfaces that need more control can provide their own toJSON operation with the [Default] extended attribute. This updates all the IDLs that used serializer to use the new [Default] except RTCIceCandidate.idl, which is specified to have a custom toJSON that returns a RTCIceCandidateInit, so that was implemented instead. * css/DOMMatrixReadOnly.idl: * dom/DOMPointReadOnly.idl: * dom/DOMQuad.idl: * dom/DOMRectReadOnly.idl: * page/PerformanceEntry.idl: * page/PerformanceResourceTiming.h: * page/PerformanceResourceTiming.idl: * page/PerformanceServerTiming.idl: * page/PerformanceTiming.idl: * Modules/mediastream/MediaDeviceInfo.idl: * Modules/mediastream/RTCIceCandidate.cpp: * Modules/mediastream/RTCIceCandidate.h: * Modules/mediastream/RTCIceCandidate.idl: * Modules/mediastream/RTCSessionDescription.idl: * Modules/paymentrequest/PaymentAddress.idl: * Modules/paymentrequest/PaymentResponse.idl: Update IDLs replacing all use of serializer. * bindings/scripts/CodeGenerator.pm: (InterfaceHasRegularToJSONOperation): (IsJSONType): (InheritsSerializable): Deleted. (IsSerializableType): Deleted. (IsSerializableAttribute): Deleted. * bindings/scripts/CodeGeneratorJS.pm: (PrototypeOperationCount): (GenerateHeader): (GeneratePropertiesHashTable): (GenerateImplementation): (GenerateOperationDefinition): (GenerateDefaultOperationDefinition): (GenerateDefaultToJSONOperationDefinition): (GetRuntimeEnabledStaticProperties): (GenerateSerializerDefinition): Deleted. * bindings/scripts/IDLParser.pm: (cloneOperation): (parsePartialInterfaceMember): (applyMemberList): (parseSerializer): Deleted. (parseSerializerRest): Deleted. (parseSerializationPattern): Deleted. (parseSerializationAttributes): Deleted. * bindings/scripts/IDLAttributes.json: Add support for [Default] toJSON and remove support for serializer. * bindings/scripts/test/BindingTestGlobalConstructors.idl: * bindings/scripts/test/JS/JSTestDefaultToJSON.cpp: Added. * bindings/scripts/test/JS/JSTestDefaultToJSON.h: Added. * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestNode.cpp: * bindings/scripts/test/JS/JSTestNode.h: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestSerialization.cpp: Removed. * bindings/scripts/test/JS/JSTestSerialization.h: Removed. * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: Removed. * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h: Removed. * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: Removed. * bindings/scripts/test/JS/JSTestSerializationInherit.h: Removed. * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: Removed. * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h: Removed. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestDefaultToJSON.idl: Added. * bindings/scripts/test/TestDefaultToJSONIndirectInheritance.idl: Added. * bindings/scripts/test/TestDefaultToJSONInherit.idl: Added. * bindings/scripts/test/TestDefaultToJSONInheritFinal.idl: Added. * bindings/scripts/test/TestNode.idl: * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestSerialization.idl: Removed. * bindings/scripts/test/TestSerializationIndirectInheritance.idl: Removed. * bindings/scripts/test/TestSerializationInherit.idl: Removed. * bindings/scripts/test/TestSerializationInheritFinal.idl: Removed. Update tests. 2020-09-14 Chris Dumez <cdumez@apple.com> Some WebAudio tests give different output on different machines https://bugs.webkit.org/show_bug.cgi?id=216371 <rdar://problem/68653909> Reviewed by Alex Christensen. Hardcode default sample rate for AudioContext to 44100 for WPT tests instead of using the hardware sample rate. This allows some tests to output consistent results on different machines. No new tests, unskipped existing test. * Modules/webaudio/AudioContext.cpp: (WebCore::defaultSampleRateForTesting): (WebCore::AudioContext::setDefaultSampleRateForTesting): (WebCore::AudioContext::create): * Modules/webaudio/AudioContext.h: (WebCore::AudioContext::create): * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::setDefaultAudioContextSampleRate): * testing/InternalSettings.h: * testing/InternalSettings.idl: 2020-09-14 Said Abou-Hallawa <sabouhallawa@apple.com> [CG] Cache the last status of the image encoded data https://bugs.webkit.org/show_bug.cgi?id=216104 Reviewed by Youenn Fablet. Cache the last status of the image encoded data such that early decisions can be made without calling system functions. * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoderCG::encodedDataStatus const): * platform/graphics/cg/ImageDecoderCG.h: 2020-09-14 Chris Dumez <cdumez@apple.com> Add proper support for AudioContextOptions.sampleRate https://bugs.webkit.org/show_bug.cgi?id=216425 Reviewed by Eric Carlson. Add proper support for AudioContextOptions.sampleRate. Previously, our AudioContext always ran at the hardware's sampleRate, no matter what value was set for AudioContextOptions.sampleRate. This patch is based on the following Chromium changes: - https://chromium-review.googlesource.com/c/chromium/src/+/1482957 - https://codereview.chromium.org/2549093009 - https://codereview.chromium.org/14189035 * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::createDestination): When creating an AudioDestination, pass the requested AudioContext sample rate instead of the hardware sample rate. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/AudioFIFO.cpp: Removed. * platform/audio/AudioFIFO.h: Removed. * platform/audio/AudioPullFIFO.cpp: Removed. * platform/audio/AudioPullFIFO.h: Removed. * platform/audio/PushPullFIFO.cpp: Added. * platform/audio/PushPullFIFO.h: Added. Replace AudioFIFO and AudioPullFIFO with a new PushPullFIFO replacement, similarly to what was done in Chromium in: - https://codereview.chromium.org/2549093009 * platform/audio/MultiChannelResampler.cpp: (WebCore::MultiChannelResampler::MultiChannelResampler): * platform/audio/MultiChannelResampler.h: * platform/audio/SincResampler.cpp: (WebCore::SincResampler::SincResampler): (WebCore::SincResampler::updateRegions): (WebCore::SincResampler::initializeKernel): (WebCore::SincResampler::process): * platform/audio/SincResampler.h: Add parameter to MultiChannelResampler & SincResampler to allow the client to specify the size of the buffer in frames when the resampler calls AudioSourceProvider::provideInput() to get input data. This is necessary because our WebAudio implementation uses a static buffer size of 128 frames. This is similar to what was done in Chromium in: - https://codereview.chromium.org/14189035 * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestinationCocoa::AudioDestinationCocoa): (WebCore::AudioDestinationCocoa::setAudioStreamBasicDescription): (WebCore::AudioDestinationCocoa::render): (WebCore::AudioDestinationCocoa::provideInput): * platform/audio/cocoa/AudioDestinationCocoa.h: - Adopt PushPullFIFO to resolve the buffer size mismatch between the WebAudio engine and the callback function from the actual audio device, similarly to what was done in Chromium. - When the context's sample rate differs from the hardware sample rate, instantiate a MultiChannelResampler and use it in render() to do the resampling. * platform/audio/ios/AudioDestinationIOS.cpp: (WebCore::AudioDestinationCocoa::configure): * platform/audio/mac/AudioDestinationMac.cpp: (WebCore::AudioDestinationCocoa::configure): Drop sampleRate parameter as it is no longer needed. * platform/mock/MockAudioDestinationCocoa.cpp: (WebCore::MockAudioDestinationCocoa::tick): 2020-09-14 Sam Weinig <weinig@apple.com> [WebIDL] Split DOM Parsing related functions out of Element and ShadowRoot and into their own IDL files to match specs https://bugs.webkit.org/show_bug.cgi?id=216461 Reviewed by Darin Adler. No behavior change, just cleaning up which IDL files DOM Parsing related operations live to match specs. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * dom/Element.idl: * dom/ElementDOMParsing.idl: Added. * dom/InnerHTML.idl: Added. * dom/ShadowRoot.idl: 2020-09-14 Chris Lord <clord@igalia.com> CSS parsing-related singletons should only be used on the main thread https://bugs.webkit.org/show_bug.cgi?id=216370 Reviewed by Darin Adler. Mark some singletons that aren't safe to use off the main thread as MainThreadNeverDestroyed instead of just NeverDestroyed. No new tests because there is no behavior change. * css/CSSValuePool.cpp: (WebCore::CSSValuePool::singleton): * css/parser/CSSParserContext.cpp: (WebCore::strictCSSParserContext): * rendering/RenderThemeAdwaita.cpp: (WebCore::RenderTheme::singleton): * rendering/RenderThemeGtk.cpp: (WebCore::RenderTheme::singleton): 2020-09-14 Myles C. Maxfield <mmaxfield@apple.com> [Apple Win] Migrate from CGFontGetGlyphsForUnichars() to CTFontGetGlyphsForCharacters() https://bugs.webkit.org/show_bug.cgi?id=216446 Reviewed by Darin Adler. This patch is one of the steps to moving the Apple Win port from CGFont to CTFont. This patch removes the #if !PLATFORM(WIN) guard from GlyphPageCoreText.cpp and deletes the old functions it used to be using. Covered by existing tests. * PlatformAppleWin.cmake: * platform/graphics/coretext/GlyphPageCoreText.cpp: * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp: Removed. There's nothing left in the file. 2020-09-13 Sam Weinig <weinig@apple.com> [WebIDL] Remove need for [MayThrowException] on constructors and legacy factory functions https://bugs.webkit.org/show_bug.cgi?id=216442 Reviewed by Darin Adler. Deduce implementation potentially throwing by using the existing overload of toJSNewlyCreated that conditionally checks for exceptions based on the return type. constexpr IsExceptionOr to maintain existing optimizations around conditional calls to RETURN_IF_EXCEPTION. * bindings/scripts/CodeGeneratorJS.pm: (GenerateConstructorDefinition): Update code generation to output code that can handle constructors that return either ExceptionOr or not. Maintain existing static assertion that the underlying return type is a Ref<> using std::conditional_t predicated on IsExceptionOr and maintain the existing optimization to not check for an exception after toJSNewlyCreated if one could not have been made by again utilizing IsExceptionOr. * bindings/scripts/IDLAttributes.json: Remove [LegacyFactoryFunctionMayThrowException] now that it is not needed. * Modules/applepay/ApplePaySession.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: * Modules/fetch/FetchHeaders.idl: * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchResponse.idl: * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediastream/RTCIceCandidate.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/paymentrequest/MerchantValidationEvent.idl: * Modules/paymentrequest/PaymentRequest.idl: * Modules/webaudio/AnalyserNode.idl: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/BiquadFilterNode.idl: * Modules/webaudio/ChannelMergerNode.idl: * Modules/webaudio/ChannelSplitterNode.idl: * Modules/webaudio/ConstantSourceNode.idl: * Modules/webaudio/ConvolverNode.idl: * Modules/webaudio/DelayNode.idl: * Modules/webaudio/DynamicsCompressorNode.idl: * Modules/webaudio/GainNode.idl: * Modules/webaudio/IIRFilterNode.idl: * Modules/webaudio/MediaElementAudioSourceNode.idl: * Modules/webaudio/MediaStreamAudioDestinationNode.idl: * Modules/webaudio/MediaStreamAudioSourceNode.idl: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/PannerNode.idl: * Modules/webaudio/PeriodicWave.idl: * Modules/webaudio/StereoPannerNode.idl: * Modules/webaudio/WaveShaperNode.idl: * Modules/webaudio/WebKitAudioContext.idl: * Modules/webaudio/WebKitOfflineAudioContext.idl: * Modules/websockets/WebSocket.idl: * Modules/webxr/WebXRRigidTransform.idl: * Modules/webxr/WebXRWebGLLayer.idl: * animation/KeyframeEffect.idl: * css/DOMMatrix.idl: * css/DOMMatrixReadOnly.idl: * css/WebKitCSSMatrix.idl: * dom/StaticRange.idl: * dom/TextDecoder.idl: * dom/TextDecoderStreamDecoder.idl: * html/DOMURL.idl: * html/HTMLOptionElement.h: * html/HTMLOptionElement.idl: * html/ImageData.idl: * html/URLSearchParams.idl: * html/track/TextTrackCue.idl: * page/EventSource.idl: * page/IntersectionObserver.idl: * workers/Worker.idl: Remove all uses of [LegacyFactoryFunctionMayThrowException] and [MayThrowException] on constructors. * html/HTMLAudioElement.cpp: (WebCore::HTMLAudioElement::createForLegacyFactoryFunction): (WebCore::HTMLAudioElement::createForJSConstructor): Deleted. * html/HTMLAudioElement.h: * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::createForLegacyFactoryFunction): (WebCore::HTMLImageElement::createForJSConstructor): Deleted. * html/HTMLImageElement.h: * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::createForLegacyFactoryFunction): (WebCore::HTMLOptionElement::createForJSConstructor): Deleted. Renamed createForJSConstructor to createForLegacyFactoryFunction to better match current WebIDL terminology. * bindings/scripts/test/JS/JSExposedToWorkerAndWindow.cpp: (WebCore::JSExposedToWorkerAndWindowConstructor::construct): * bindings/scripts/test/JS/JSTestEventConstructor.cpp: (WebCore::JSTestEventConstructorConstructor::construct): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::construct): * bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp: (WebCore::JSTestLegacyFactoryFunctionLegacyFactoryFunction::construct): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::JSTestNodeConstructor::construct): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::construct): * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: (WebCore::constructJSTestOverloadedConstructors1): (WebCore::constructJSTestOverloadedConstructors2): (WebCore::constructJSTestOverloadedConstructors3): (WebCore::constructJSTestOverloadedConstructors4): (WebCore::constructJSTestOverloadedConstructors5): * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: (WebCore::constructJSTestOverloadedConstructorsWithSequence1): (WebCore::constructJSTestOverloadedConstructorsWithSequence2): * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: (WebCore::JSTestPromiseRejectionEventConstructor::construct): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::JSTestTypedefsConstructor::construct): * bindings/scripts/test/TestLegacyFactoryFunction.idl: Update tests/expectations. 2020-09-13 Sam Weinig <weinig@apple.com> FIXME in MediaDevices.idl is incorrect https://bugs.webkit.org/show_bug.cgi?id=216459 Reviewed by Anders Carlsson. * Modules/mediastream/MediaDevices.idl: Remove FIXME about making MediaDevices an EventTarget subclass as it is a subclass EventTarget. 2020-09-13 Sam Weinig <weinig@apple.com> FIXME in MouseEventInit.idl is incorrect (we do support unsigned short buttons = 0) https://bugs.webkit.org/show_bug.cgi?id=216460 Reviewed by Darin Adler. * dom/MouseEventInit.idl: Removes incorrect FIXME, adds spec link, and updates formatting to match spec. 2020-09-13 Aditya Keerthi <akeerthi@apple.com> Consolidate BaseDateAndTimeInputType and BaseChooserOnlyDateAndTimeInputType https://bugs.webkit.org/show_bug.cgi?id=216414 Reviewed by Devin Rousso. BaseChooserOnlyDateAndTimeInputType is the only derived class of BaseDateAndTimeInputType. Furthermore, with the introduction of editable components, "ChooserOnly" no longer makes sense as a name for the derived class. Consequently, all logic in BaseChooserOnlyDateAndTimeInputType was moved into BaseDateAndTimeInputType, and the derived classes of the "ChooserOnly" type now inherit BaseDateAndTimeInputType. Also changed some methods from override to final, and made some protected methods private, where possible. No new tests, as there is no change in behavior. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * html/BaseChooserOnlyDateAndTimeInputType.cpp: Removed. * html/BaseChooserOnlyDateAndTimeInputType.h: Removed. * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::DateTimeFormatValidator::visitField): (WebCore::BaseDateAndTimeInputType::DateTimeFormatValidator::validateFormat): (WebCore::BaseDateAndTimeInputType::~BaseDateAndTimeInputType): (WebCore::BaseDateAndTimeInputType::isMouseFocusable const): (WebCore::BaseDateAndTimeInputType::shouldHaveSecondField const): (WebCore::BaseDateAndTimeInputType::shouldHaveMillisecondField const): (WebCore::BaseDateAndTimeInputType::setValue): (WebCore::BaseDateAndTimeInputType::handleDOMActivateEvent): (WebCore::BaseDateAndTimeInputType::createShadowSubtree): (WebCore::BaseDateAndTimeInputType::destroyShadowSubtree): (WebCore::BaseDateAndTimeInputType::updateInnerTextValue): (WebCore::BaseDateAndTimeInputType::hasCustomFocusLogic const): (WebCore::BaseDateAndTimeInputType::attributeChanged): (WebCore::BaseDateAndTimeInputType::elementDidBlur): (WebCore::BaseDateAndTimeInputType::detach): (WebCore::BaseDateAndTimeInputType::isPresentingAttachedView const): (WebCore::BaseDateAndTimeInputType::handleKeydownEvent): (WebCore::BaseDateAndTimeInputType::handleKeypressEvent): (WebCore::BaseDateAndTimeInputType::handleKeyupEvent): (WebCore::BaseDateAndTimeInputType::handleFocusEvent): (WebCore::BaseDateAndTimeInputType::accessKeyAction): (WebCore::BaseDateAndTimeInputType::didBlurFromControl): (WebCore::BaseDateAndTimeInputType::didChangeValueFromControl): (WebCore::BaseDateAndTimeInputType::isEditControlOwnerDisabled const): (WebCore::BaseDateAndTimeInputType::isEditControlOwnerReadOnly const): (WebCore::BaseDateAndTimeInputType::localeIdentifier const): (WebCore::BaseDateAndTimeInputType::didChooseValue): (WebCore::BaseDateAndTimeInputType::didEndChooser): (WebCore::BaseDateAndTimeInputType::closeDateTimeChooser): * html/BaseDateAndTimeInputType.h: * html/DateInputType.cpp: (WebCore::DateInputType::DateInputType): * html/DateInputType.h: * html/DateTimeLocalInputType.cpp: * html/DateTimeLocalInputType.h: * html/MonthInputType.h: * html/TimeInputType.cpp: (WebCore::TimeInputType::TimeInputType): * html/TimeInputType.h: * html/WeekInputType.h: 2020-09-13 Simon Fraser <simon.fraser@apple.com> Overflow:scroll rubberbanding is interrupted by post-layout scrolling https://bugs.webkit.org/show_bug.cgi?id=216463 <rdar://problem/67095741> Reviewed by Darin Adler. When rubberbanding overflow:scroll RenderLayer has an overscrolled scroll offset. If RenderLayer::updateScrollInfoAfterLayout() happens when in this state, it can clamp the scroll offset, causing the rubberband to collapse which interferes with the user interaction. This happend on Gmail when composing a reply. Fix by tracking the rubberbanding state in the scrolling tree, and having RenderLayer query this state via the ScrollingCoordinator. RenderLayer::updateScrollInfoAfterLayout() already tested isRubberBandInProgress(). This is similar to how isUserScrollInProgress() and isScrollSnapInProgress() work. This patch also fixes the tracking of rubberbanding state. Previously setMainFrameIsRubberBanding() was just based on when the timer was started and stopped, which did not match the implementation of ScrollController::isRubberBandInProgress(). Now ScrollController correctly notifies its clients when the rubberbanding state changes by updating that state whenever any of the conditions consulted in isRubberBandInProgressInternal() change. I tried to make tests for this, but the timing of wheel and scroll event delivery makes reliable detection of interrupted rubberbands impossible in WebKitTestRunner. * page/FrameView.cpp: (WebCore::FrameView::isRubberBandInProgress const): * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::isRubberBandInProgress const): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::isRubberBandInProgress const): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::isRubberBandInProgressForNode): (WebCore::ScrollingTree::setRubberBandingInProgressForNode): (WebCore::ScrollingTree::isRubberBandInProgress): Deleted. (WebCore::ScrollingTree::setMainFrameIsRubberBanding): Deleted. * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren): * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged): (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinAndRubberbandState): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::currentScrollPositionChanged): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::currentScrollPositionChanged): (WebCore::ScrollingTreeScrollingNodeDelegateMac::isRubberBandInProgress const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::didStopRubberbandSnapAnimation): (WebCore::ScrollingTreeScrollingNodeDelegateMac::rubberBandingStateChanged): * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::notifyPositionChanged): * platform/cocoa/ScrollController.h: (WebCore::ScrollControllerClient::rubberBandingStateChanged): * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): (WebCore::ScrollController::snapRubberBandTimerFired): (WebCore::ScrollController::scrollPositionChanged): (WebCore::ScrollController::isRubberBandInProgress const): (WebCore::ScrollController::stopSnapRubberbandTimer): (WebCore::ScrollController::isRubberBandInProgressInternal const): (WebCore::ScrollController::updateRubberBandingState): (WebCore::ScrollController::updateGestureInProgressState): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::isRubberBandInProgress const): (WebCore::RenderLayer::updateScrollInfoAfterLayout): 2020-09-13 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Create LineBox::InlineBox for [ContainerEnd] runs forced to the next line. https://bugs.webkit.org/show_bug.cgi?id=216462 Reviewed by Antti Koivisto. Normally the [container end] run forms a continous content with the runs in front of it (there's no breaking opportunity between e.g the last text run and the [container end] run). However in certain cases the [container end] run may be forced over to the next line. e.g. <span>the [container end] run is forced over to the next line<br></span>over here runs: [container start][text run][line break run]<-new line->[container end][text run] * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::constructInlineBoxes): 2020-09-13 Rob Buis <rbuis@igalia.com> Make CanvasRenderingContext2D functions parameters not default to undefined https://bugs.webkit.org/show_bug.cgi?id=216438 Reviewed by Sam Weinig. Some string parameters default to "undefined", however the code path is the same when no default is given and implicitly a null string is passed, so remove the default values. * html/canvas/CanvasRenderingContext2D.idl: 2020-09-13 Sam Weinig <weinig@apple.com> [WebIDL] Remove need for [MayThrowException] on indexed and named setters https://bugs.webkit.org/show_bug.cgi?id=216441 Reviewed by Darin Adler. Deduce implementation potentially throwing by introspecting the return type of the setters implementation in a new helper, invokeFunctorPropagatingExceptionIfNecessary. This allows us to remove another set of uses of [MayThrowException]. * bindings/js/JSDOMConvertBase.h: * dom/ExceptionOr.h: Move IsExceptionOr to ExceptionOr.h so it can be used more widely. * bindings/js/JSDOMExceptionHandling.h: (WebCore::invokeFunctorPropagatingExceptionIfNecessary): Add helper that invokes the passed in functor and calls propagateException if the return type was an ExceptionOr<>. If the return type is not an ExceptionOr<>, it just invokes the functor and returns. * bindings/scripts/CodeGeneratorJS.pm: (GenerateInvokeIndexedPropertySetter): (GenerateInvokeNamedPropertySetter): Update to call invokeFunctorPropagatingExceptionIfNecessary. * css/CSSStyleDeclaration.idl: * dom/DOMStringMap.idl: * storage/Storage.idl: * svg/SVGLengthList.idl: * svg/SVGNumberList.idl: * svg/SVGPathSegList.idl: * svg/SVGPointList.idl: * svg/SVGStringList.idl: * svg/SVGTransformList.idl: Remove now unneeded [MayThrowException]. * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.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/JSTestNamedSetterWithLegacyOverrideBuiltIns.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp: * bindings/scripts/test/TestIndexedSetterThrowingException.idl: * bindings/scripts/test/TestNamedAndIndexedSetterThrowingException.idl: * bindings/scripts/test/TestNamedSetterThrowingException.idl: Update tests/expectations. 2020-09-13 Sam Weinig <weinig@apple.com> Fix FIXME in XPathEvaluatorBase about using [NewObject] https://bugs.webkit.org/show_bug.cgi?id=216458 Reviewed by Anders Carlsson. * xml/XPathEvaluatorBase.idl: Address FIXME by applying [NewObject] to createExpression. The implementation already matches this. 2020-09-13 Zalan Bujtas <zalan@apple.com> [LFC][Tree building] Table rows may not have any children. https://bugs.webkit.org/show_bug.cgi?id=216456 Reviewed by Antti Koivisto. Cover the case when the table row has no children at all (call numberOfCellsPerRow.append() on evey row when needed). * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::buildTableStructure): 2020-09-13 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Text run is at incorrect vertical position when parent inline box is stretched https://bugs.webkit.org/show_bug.cgi?id=216453 Reviewed by Antti Koivisto. Text runs don't necessarily start at the top of the parent inline box. When the inline box is stretched by some other content (nested inline box or atomic inline-level box) the run is pushed down. This patch computes the correct vertical position by using the inline box's baseline (text always sits on the baseline). * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::logicalRectForTextRun const): 2020-09-13 Zalan Bujtas <zalan@apple.com> [LFC] Fix showLayoutTree to show anonymous inline boxes https://bugs.webkit.org/show_bug.cgi?id=215437 Reviewed by Antti Koivisto. This patch also adds baseline and run content logging. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutBox): (WebCore::Layout::outputLayoutTree): 2020-09-13 Wenson Hsieh <wenson_hsieh@apple.com> Add a key to the text manipulation userInfo dictionary indicating whether the translated item is on-screen https://bugs.webkit.org/show_bug.cgi?id=216452 <rdar://problem/68785397> Reviewed by Darin Adler. For debugging purposes, and also to provide a hint as to what text should be prioritized when translating web pages, WebKit clients have requested a new field in the userInfo metadata dictionary associated with each token that indicates whether or not a translation (i.e. text manipulation) token represents an element that is currently on-screen. See below for more details. Test: TextManipulation.StartTextManipulationExtractsUserInfo * editing/TextManipulationController.cpp: (WebCore::tokenInfo): Set the flag by checking whether or not the absolute bounding rect intersects with the visible content rect of the enclosing frame. Note that since subframe content is currently never extracted for translation, we don't need logic yet to recursively check that parent iframe elements are visible. * editing/TextManipulationController.h: Add a new `bool` flag in `ManipulationTokenInfo`. (WebCore::TextManipulationController::ManipulationTokenInfo::encode const): (WebCore::TextManipulationController::ManipulationTokenInfo::decode): 2020-09-13 Philippe Normand <pnormand@igalia.com> Unreviewed, GTK/WPE EME build fixes after r266721 The Thunder decryptor changes were not tested before landing, this code path is not enabled on any bot currently, hence requires manual testing. * platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp: (protectionSystemId): (cdmProxyAttached): (decrypt): * platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.h: 2020-09-13 Rob Buis <rbuis@igalia.com> Clean up LazyLoadImageObserver https://bugs.webkit.org/show_bug.cgi?id=216435 Reviewed by Darin Adler. Clean up LazyLoadImageObserver to match LazyLoadFrameObserver, inspired by the review of bug 215442. Specifically remove the friend declaration and create function, rename m_lazyLoadImageObserver to make its use more clear and therefore remove the comment about it. * dom/Document.cpp: (WebCore::Document::lazyLoadImageObserver): * html/HTMLIFrameElement.cpp: * html/LazyLoadFrameObserver.cpp: (WebCore::LazyLoadFrameObserver::observe): (WebCore::LazyLoadFrameObserver::unobserve): (WebCore::LazyLoadFrameObserver::intersectionObserver): (WebCore::LazyLoadFrameObserver::isObserved const): * html/LazyLoadFrameObserver.h: * html/LazyLoadImageObserver.cpp: (WebCore::LazyLoadImageObserver::unobserve): (WebCore::LazyLoadImageObserver::intersectionObserver): (WebCore::LazyLoadImageObserver::isObserved const): * html/LazyLoadImageObserver.h: (WebCore::LazyLoadImageObserver::create): Deleted. 2020-09-12 Tyler Wilcock <twilco.o@protonmail.com> Safely handle overly-long CSS variable values https://bugs.webkit.org/show_bug.cgi?id=216407 Reviewed by Darin Adler. Per spec, treat overly long CSS variable values as invalid. https://drafts.csswg.org/css-variables/#long-variables Test: fast/css/variables/invalidate-overly-long-variable-values.html * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): Return false for any variable values greater than `maxSubstitutionTokens` long. * css/CSSVariableReferenceValue.h: Add `maxSubstitutionTokens`. 2020-09-12 Darin Adler <darin@apple.com> Fix root cause of problem with text replacements at the beginnings of sentences so we can remove the workaround https://bugs.webkit.org/show_bug.cgi?id=216450 Reviewed by Tim Horton. * dom/SimpleRange.cpp: (WebCore::compareByDocumentOrder): Added so we can use std::min/max. (WebCore::unionRange): Refactored to use std::min/max. (WebCore::intersection): Added. * dom/SimpleRange.h: Added intersection. * editing/Editor.cpp: (WebCore::Editor::markMisspellingsAfterTypingToWord): Intersect with the sentence range, since we don't have a guarantee that moving to the start of a word and end of a word stays within the sentence since the word and sentence algorithms are not wholly consistent. In such cases we would like to restrict our checking to the sentence. Another way to fix this would be to change the behavior of the word and sentence boundary functions. (WebCore::Editor::markAndReplaceFor): Remove the boolean "true" flags that we used to trigger our workaround for the above. * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingParagraph::automaticReplacementStart const): Removed the boolean argument and the workaround code that runs when it's true. (WebCore::TextCheckingParagraph::automaticReplacementLength const): Ditto. * editing/TextCheckingHelper.h: Removed the boolean arguments. 2020-09-12 Simon Fraser <simon.fraser@apple.com> Replace formatForDebugger() which uses raw char* with debugDescription() https://bugs.webkit.org/show_bug.cgi?id=216447 Reviewed by Darin Adler. formatForDebugger() relied on raw char* and buffer lengths. Replace with debugDescription() which returns a String, and is already a convention used in various classes. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper debugDescriptionForTextMarker:]): (formatForDebugger): * dom/Element.cpp: (WebCore::Element::formatForDebugger const): Deleted. * dom/Element.h: * dom/Node.cpp: (WebCore::Node::debugDescription const): (WebCore::Node::formatForDebugger const): Deleted. * dom/Node.h: * dom/Position.cpp: (WebCore::Position::debugDescription const): (WebCore::Position::formatForDebugger const): Deleted. * dom/Position.h: * dom/Range.cpp: (WebCore::Range::debugDescription const): (WebCore::Range::formatForDebugger const): Deleted. * dom/Range.h: * dom/Text.cpp: (WebCore::Text::formatForDebugger const): Deleted. * dom/Text.h: * editing/FrameSelection.cpp: (WebCore::FrameSelection::debugDescription const): (WebCore::FrameSelection::formatForDebugger const): Deleted. * editing/FrameSelection.h: * editing/VisiblePosition.cpp: (WebCore::VisiblePosition::debugDescription const): (WebCore::VisiblePosition::formatForDebugger const): Deleted. * editing/VisiblePosition.h: * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::debugDescription const): (WebCore::VisibleSelection::formatForDebugger const): Deleted. * editing/VisibleSelection.h: 2020-09-12 Simon Fraser <simon.fraser@apple.com> Use an OptionSet<> for LayoutBox::BaseTypeFlags https://bugs.webkit.org/show_bug.cgi?id=216445 Reviewed by Darin Adler. Use an OptionSet<> for LayoutBox::BaseTypeFlags. * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::Box): * layout/layouttree/LayoutBox.h: (WebCore::Layout::Box::isInitialContainingBlock const): (WebCore::Layout::Box::isContainerBox const): (WebCore::Layout::Box::isInlineTextBox const): (WebCore::Layout::Box::isLineBreakBox const): (WebCore::Layout::Box::isReplacedBox const): * layout/layouttree/LayoutContainerBox.cpp: (WebCore::Layout::ContainerBox::ContainerBox): * layout/layouttree/LayoutContainerBox.h: (WebCore::Layout::ContainerBox::ContainerBox): 2020-09-12 Sam Weinig <weinig@apple.com> [WebIDL] Remove need for [MayThrowException] on named deleters https://bugs.webkit.org/show_bug.cgi?id=216429 Reviewed by Darin Adler. Deduce implementation potentially thowing by introspecting the return type of the deleters implementation. This allows us to remove another use of [MayThrowException]. * bindings/js/JSDOMAbstractOperations.h: (WebCore::performLegacyPlatformObjectDeleteOperation): Add helper function to house shared implementation of the various combinations of return types allowed. * bindings/scripts/CodeGeneratorJS.pm: (GenerateDeletePropertyCommon): Convert the commented expectation that unnamed deleters return bool or ExceptionOr<bool> into a static assertion and use the new helper function to simplify code generation. * storage/Storage.idl: Remove now unneeded [MayThrowException]. * 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/TestNamedDeleterThrowingException.idl: Update tests/expectations. 2020-09-12 Myles C. Maxfield <mmaxfield@apple.com> [Apple Win] Add a CTFont member to FontPlatformData https://bugs.webkit.org/show_bug.cgi?id=216432 Reviewed by Darin Adler. This is the second step on the path to replacing the Apple Win port's use of CGFont with CTFont. This patch adds m_ctFont to FontPlatformData, and makes FontPlatformData's constructors create this object from their existing arguments. It also enables the USE(CORE_TEXT) flag on the Apple Win port, but manually disables each of the USE(CORE_TEXT) sites on Windows, so there isn't any behavior change just yet. The new member, m_ctFont, is therefore still unused in this patch. The next steps will be replacing our current Apple Win font functions with their USE(CORE_TEXT) counterparts, one-by-one. (Replacing them one-by-one is better than doing them all at once in a giant mondo-patch.) No new tests because there is no behavior change yet. * PlatformAppleWin.cmake: * platform/graphics/Font.cpp: * platform/graphics/FontCascade.cpp: * platform/graphics/FontPlatformData.cpp: * platform/graphics/FontPlatformData.h: The #defines are temporarily getting worse before they'll be getting better. When this project is done, there will be fewer #defines, and this file will be cleaner than it was when I started. (WebCore::FontPlatformData::cgFont const): (WebCore::FontPlatformData::ctFont const): * platform/graphics/coretext/FontCascadeCoreText.cpp: * platform/graphics/coretext/FontCoreText.cpp: * platform/graphics/coretext/FontPlatformDataCoreText.cpp: * platform/graphics/coretext/GlyphPageCoreText.cpp: * platform/graphics/win/FontPlatformDataCGWin.cpp: (WebCore::FontPlatformData::platformDataInit): (WebCore::FontPlatformData::FontPlatformData): (WebCore::FontPlatformData::hash const): (WebCore::FontPlatformData::platformIsEqual const): 2020-09-12 Myles C. Maxfield <mmaxfield@apple.com> Remove dead code FontCascadeCGWin.cpp https://bugs.webkit.org/show_bug.cgi?id=216444 Reviewed by Darin Adler. This file isn't actually referenced by any port's build system. The Apple Win port uses FontCGWin.cpp instead, which defines the same symbols as this file. No new tests because there is no behavior change. * platform/graphics/win/FontCascadeCGWin.cpp: Removed. 2020-09-12 Simon Fraser <simon.fraser@apple.com> Convert TextStream::FormattingFlags to an OptionSet<> https://bugs.webkit.org/show_bug.cgi?id=216443 Reviewed by Darin Adler. Use an OptionSet<> for FormattingFlags. * rendering/RenderTreeAsText.cpp: (WebCore::externalRepresentation): (WebCore::counterValueForElement): 2020-09-12 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Simplify LineBox offset computation https://bugs.webkit.org/show_bug.cgi?id=216434 Reviewed by Antti Koivisto. This is still inline with the half leading logic where the ascent + descent (LineBox height) and the line spacing are used to position the inline content. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computedLineLogicalRect const): 2020-09-12 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for non-root-inline-box line spacing https://bugs.webkit.org/show_bug.cgi?id=216433 Reviewed by Antti Koivisto. While the LineBox vertically contains all the LineBox::InlineBoxes, its height value does not include any line spacing (FontMetrics::lineSpacing). Each LineBox::InlineBox may have a different line spacing value (this value is zero in many cases). This patch collects line spacing values from the LineBox::InlineBoxes on the line and adjusts the final line height value accordingly. Test: fast/layoutformattingcontext/inline-box-with-line-spacing-simple.html * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computedLineLogicalRect const): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::constructInlineBoxes): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineBox::lineSpacing const): (WebCore::Layout::LineBox::InlineBox::setLineSpacing): (WebCore::Layout::LineBox::inlineBoxList const): 2020-09-12 Myles C. Maxfield <mmaxfield@apple.com> Addressing feedback on r266936 https://bugs.webkit.org/show_bug.cgi?id=216431 Unreviewed. I didn't follow the reviewer's advice thoroughly. No new tests because there is no behavior change. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/coretext/FontCascadeCoreText.cpp: Renamed from Source/WebCore/platform/graphics/ct/FontCascadeCoreText.cpp. * platform/graphics/coretext/FontCoreText.cpp: Renamed from Source/WebCore/platform/graphics/ct/FontCoreText.cpp. * platform/graphics/coretext/FontPlatformDataCoreText.cpp: Renamed from Source/WebCore/platform/graphics/ct/FontPlatformDataCoreText.cpp. * platform/graphics/coretext/GlyphPageCoreText.cpp: Renamed from Source/WebCore/platform/graphics/ct/GlyphPageCoreText.cpp. 2020-09-12 Rob Buis <rbuis@igalia.com> Implement lazy iframe loading https://bugs.webkit.org/show_bug.cgi?id=215442 Reviewed by Darin Adler. Implement lazy iframe loading as specified [1, 2]. Lazy iframe loading is controlled by the loading attribute on <iframe>. When the loading attribute is not specified, the behavior is like before this patch, i.e. loading is eager. This changes the way iframe attribute processing is handled as specified here [2]. This implementation relies on Intersection Observer and hence works on WK2 only. [1] https://html.spec.whatwg.org/#attr-iframe-loading [2] https://html.spec.whatwg.org/#process-the-iframe-attributes Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-base-url-2.tentative.html imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-base-url.tentative.html imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-load-event.tentative.html imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-multiple-times.tentative.html imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-referrerpolicy-change.sub.tentative.html imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-to-eager.tentative.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::openURL): * html/HTMLFrameElementBase.h: (WebCore::HTMLFrameElementBase::frameURL const): (WebCore::HTMLFrameElementBase::setFrameURL): * html/HTMLFrameOwnerElement.h: (WebCore::HTMLFrameOwnerElement::shouldLoadFrameLazily): (WebCore::HTMLFrameOwnerElement::isLazyLoadObserverActive const): * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::parseAttribute): (WebCore::HTMLIFrameElement::referrerPolicy const): (WebCore::HTMLIFrameElement::loadingForBindings const): (WebCore::HTMLIFrameElement::setLoadingForBindings): (WebCore::isFrameLazyLoadable): (WebCore::HTMLIFrameElement::shouldLoadFrameLazily): (WebCore::HTMLIFrameElement::isLazyLoadObserverActive const): (WebCore::HTMLIFrameElement::loadDeferredFrame): (WebCore::HTMLIFrameElement::lazyLoadFrameObserver): * html/HTMLIFrameElement.h: * html/HTMLIFrameElement.idl: * html/LazyLoadFrameObserver.cpp: Added. (WebCore::LazyLoadFrameObserver::LazyLoadFrameObserver): (WebCore::LazyLoadFrameObserver::observe): (WebCore::LazyLoadFrameObserver::unobserve): (WebCore::LazyLoadFrameObserver::intersectionObserver): (WebCore::LazyLoadFrameObserver::isObserved const): * html/LazyLoadFrameObserver.h: Copied from Source/WebCore/html/canvas/WebGLCompressedTextureETC1.cpp. (WebCore::LazyLoadFrameObserver::frameURL const): (WebCore::LazyLoadFrameObserver::referrerPolicy const): * html/canvas/WebGLCompressedTextureETC1.cpp: * html/shadow/DateTimeFieldElement.cpp: * loader/FrameLoader.cpp: (WebCore::FrameLoader::preventsParentFromBeingComplete const): (WebCore::FrameLoader::allChildrenAreComplete const): * loader/FrameLoader.h: 2020-09-11 Antoine Quint <graouts@webkit.org> REGRESSION (r255383): Transition from email to password field on login.live.com stutters after going back and forth https://bugs.webkit.org/show_bug.cgi?id=216368 <rdar://problem/67019460> Reviewed by Simon Fraser. Ensure we repaint before disconnecting from the backing provider layer. Test: compositing/animation/repaint-after-clearing-shared-backing.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBacking): 2020-09-11 Yusuke Suzuki <ysuzuki@apple.com> Serialization should have exception checks https://bugs.webkit.org/show_bug.cgi?id=216399 <rdar://problem/68633776> Reviewed by Ryosuke Niwa. Test: js/dom/serialization-should-have-exception-check.html IDL CodeGenerator missed appropriate exception checks in serialization code. This patch adds it. In serialization we cannot throw an error currently. So we should ensure it with assertNoException(). * bindings/scripts/CodeGeneratorJS.pm: (GenerateSerializerDefinition): * bindings/scripts/test/JS/JSTestSerialization.cpp: (WebCore::JSTestSerialization::serialize): * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: (WebCore::JSTestSerializationInherit::serialize): * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: (WebCore::JSTestSerializationInheritFinal::serialize): 2020-09-11 James Darpinian <jdarpinian@chromium.org> [WebGL2] Support EXT_color_buffer_half_float on WebGL 2.0 contexts https://bugs.webkit.org/show_bug.cgi?id=216010 Reviewed by Kenneth Russell. Added test webgl/2.0.0/conformance2/extensions/ext-color-buffer-half-float.html * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getExtension): (WebCore::WebGL2RenderingContext::getSupportedExtensions): (WebCore::WebGL2RenderingContext::renderbufferStorageImpl): 2020-09-11 Alex Christensen <achristensen@webkit.org> Move _setCookieAcceptPolicy to WKHTTPCookieStore https://bugs.webkit.org/show_bug.cgi?id=216375 Reviewed by Geoffrey Garen. * platform/network/cocoa/HTTPCookieAcceptPolicyCocoa.h: 2020-09-11 Myles C. Maxfield <mmaxfield@apple.com> [Cocoa] Migrate CoreText-specific code from ***Cocoa.mm to ***CoreText.cpp https://bugs.webkit.org/show_bug.cgi?id=216400 Reviewed by Tim Horton. This is in preparation for sharing the CoreText code with the Apple Windows port. This patch doesn't actually cause Windows to use this code yet. That will happen in a series of subsequent patches. This patch is just the first stage. There isn't any actual behavior change here - it's just moving code around between files. This patch also adds a new USE() flag: USE(CORE_TEXT). It migrates CoreText-specific code from #if PLATFORM(COCOA) to #if USE(CORE_TEXT). No new tests because there is no behavior change. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/Font.cpp: * platform/graphics/Font.h: * platform/graphics/FontCascade.cpp: * platform/graphics/FontCascade.h: * platform/graphics/FontPlatformData.cpp: * platform/graphics/FontPlatformData.h: * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::showLetterpressedGlyphsWithAdvances): (WebCore::FontCascade::isSubpixelAntialiasingAvailable): Deleted. (WebCore::fillVectorWithHorizontalGlyphPositions): Deleted. (WebCore::shouldUseLetterpressEffect): Deleted. (WebCore::showGlyphsWithAdvances): Deleted. (WebCore::setCGFontRenderingMode): Deleted. (WebCore::FontCascade::drawGlyphs): Deleted. (WebCore::FontCascade::primaryFontIsSystemFont const): Deleted. (WebCore::FontCascade::fontForCombiningCharacterSequence const): Deleted. * platform/graphics/cocoa/FontCocoa.cpp: Added. (WebCore::Font::platformDestroy): * platform/graphics/cocoa/FontPlatformDataCocoa.mm: (WebCore::FontPlatformData::hash const): (WebCore::isSystemFont): Deleted. (): Deleted. (WebCore::FontPlatformData::FontPlatformData): Deleted. (WebCore::FontPlatformData::registeredFont const): Deleted. (WebCore::mapFontWidthVariantToCTFeatureSelector): Deleted. (WebCore::cascadeToLastResortAttributesDictionary): Deleted. (WebCore::cascadeToLastResortAndVariationsFontDescriptor): Deleted. (WebCore::FontPlatformData::ctFont const): Deleted. (WebCore::FontPlatformData::objectForEqualityCheck): Deleted. (WebCore::FontPlatformData::objectForEqualityCheck const): Deleted. (WebCore::FontPlatformData::openTypeTable const): Deleted. (WebCore::FontPlatformData::description const): Deleted. (WebCore::FontPlatformData::familyName const): Deleted. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: * platform/graphics/ct/FontCascadeCoreText.cpp: Copied from Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm. (WebCore::FontCascade::isSubpixelAntialiasingAvailable): (WebCore::fillVectorWithHorizontalGlyphPositions): (WebCore::shouldUseLetterpressEffect): (WebCore::showGlyphsWithAdvances): (WebCore::setCGFontRenderingMode): (WebCore::FontCascade::drawGlyphs): (WebCore::FontCascade::primaryFontIsSystemFont const): (WebCore::FontCascade::fontForCombiningCharacterSequence const): * platform/graphics/ct/FontCoreText.cpp: Renamed from Source/WebCore/platform/graphics/cocoa/FontCocoa.mm. (WebCore::Font::platformInit): (WebCore::Font::platformCharWidthInit): (WebCore::Font::platformCreateScaledFont const): (WebCore::Font::applyTransforms const): * platform/graphics/ct/FontPlatformDataCoreText.cpp: Copied from Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm. (WebCore::FontPlatformData::FontPlatformData): (WebCore::isSystemFont): (WebCore::FontPlatformData::registeredFont const): (WebCore::mapFontWidthVariantToCTFeatureSelector): (WebCore::cascadeToLastResortAttributesDictionary): (WebCore::cascadeToLastResortAndVariationsFontDescriptor): (WebCore::FontPlatformData::ctFont const): (WebCore::FontPlatformData::objectForEqualityCheck): (WebCore::FontPlatformData::objectForEqualityCheck const): (WebCore::FontPlatformData::openTypeTable const): (WebCore::FontPlatformData::description const): (WebCore::FontPlatformData::familyName const): * platform/graphics/ct/GlyphPageCoreText.cpp: Renamed from Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp. * platform/graphics/win/FontCascadeCGWin.cpp: Added. (WebCore::FontCascade::setFontSmoothingLevel): (WebCore::setCGFontSmoothingStyle): (WebCore::FontCascade::setFontSmoothingStyle): (WebCore::FontCascade::setFontSmoothingContrast): (WebCore::clearTypeContrast): (WebCore::FontCascade::systemFontSmoothingChanged): (WebCore::FontCascade::setCGContextFontRenderingStyle): (WebCore::renderingStyleForFont): (WebCore::FontCascade::getPlatformGlyphAdvances): 2020-09-11 Devin Rousso <drousso@apple.com> REGRESSION(r266885): ASSERTION FAILED: Inspector::CSSBackendDispatcher::getInlineStylesForNode(long, RefPtr<JSON::Object> &&) !result.error().isEmpty() https://bugs.webkit.org/show_bug.cgi?id=216409 <rdar://problem/68715815> Reviewed by Brian Burg. Test: inspector/css/pseudo-element-matches-for-pseudo-element-node.html * inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::getInlineStylesForNode): 2020-09-11 Jer Noble <jer.noble@apple.com> [iOS] Add Experimental setting to disable calling PID Inheritance API. https://bugs.webkit.org/show_bug.cgi?id=216387 <rdar://problem/66286777> Reviewed by Eric Carlson. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setDisableMediaExperiencePIDInheritance): (WebCore::RuntimeEnabledFeatures::disableMediaExperiencePIDInheritance const): * page/Settings.yaml: * platform/audio/ios/MediaSessionHelperIOS.mm: (MediaSessionHelperiOS::providePresentingApplicationPID): 2020-09-11 Zalan Bujtas <zalan@apple.com> styleDidChange functions should all check for nullptr oldStyle https://bugs.webkit.org/show_bug.cgi?id=216410 Reviewed by Simon Fraser. While some of these calls are protected by the StyleDifference value check (!StyleDifference::NewStyle), an unsafe code refactoring could result in null deref. * rendering/RenderElement.cpp: (WebCore::RenderElement::styleDidChange): * rendering/RenderImage.cpp: (WebCore::RenderImage::styleDidChange): * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::styleDidChange): * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::styleDidChange): * rendering/RenderTableCol.cpp: (WebCore::RenderTableCol::styleDidChange): 2020-09-11 Kate Cheney <katherine_cheney@apple.com> Followup to Bug 215027: address comments to improve APP_BOUND_DOMAINS macro use https://bugs.webkit.org/show_bug.cgi?id=216373 <rdar://problem/68645704> Reviewed by Darin Adler. Separate out App-Bound Domain functions to avoid nested #if ENABLE() macros, which are hard to read. No new tests. Behavior confirmed by existing tests. * platform/network/NetworkStorageSession.h: 2020-09-11 Sam Weinig <weinig@apple.com> [WebIDL] Split supplemental interfaces out of Document https://bugs.webkit.org/show_bug.cgi?id=216336 Reviewed by Darin Adler. Split supplemental interfaces out of Document, adding/updating comments. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * animation/DocumentAnimations.idl: Added. * css/FontFaceSource.idl: Added. * dom/Document.idl: * dom/DocumentHTML.idl: Added. * dom/DocumentHTMLObsolete.idl: Added. * dom/DocumentPageVisibility.idl: Added. * dom/DocumentPointerLock.idl: Added. * dom/DocumentScrolling.idl: Added. * dom/DocumentSelection.idl: Added. * dom/DocumentUndoMananger.idl: Added. * xml/XPathEvaluator.idl: * xml/XPathEvaluatorBase.idl: Added. 2020-09-11 Simon Fraser <simon.fraser@apple.com> REGRESSION (Async overflow scroll): Mouse wheel scrolling over an "always-on" overflow scrollbar doesn't work https://bugs.webkit.org/show_bug.cgi?id=216381 <rdar://problem/68593743> Reviewed by Antti Koivisto. The scrollbar and scroll corner layers need event regions and scrollingNodeIDs so that we hit-test them via CA layers and find the right scrolling node. Test: fast/scrolling/mac/mousewheel-over-scrollbar.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateAfterDescendants): (WebCore::RenderLayerBacking::updateEventRegion): (WebCore::RenderLayerBacking::detachFromScrollingCoordinator): (WebCore::RenderLayerBacking::setScrollingNodeIDForRole): 2020-09-11 Chris Dumez <cdumez@apple.com> AudioContext does not start rendering until an AudioNode is constructed https://bugs.webkit.org/show_bug.cgi?id=216393 Reviewed by Eric Carlson. AudioContext does not start rendering until an AudioNode is constructed. This is not as per specification and does not match Chrome's behavior. Specification section is here: - https://www.w3.org/TR/webaudio/#dom-audiocontext-audiocontext and says "If the context is allowed to start, send a control message to start processing." No new tests, rebaselined existing test. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): * dom/Document.cpp: (WebCore::Document::addMediaCanStartListener): 2020-09-11 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Make InlineBoxes grow vertically as they gain content https://bugs.webkit.org/show_bug.cgi?id=216405 Reviewed by Antti Koivisto. Construct InlineBoxes with zero height (even the root inline box starts empty in quirks mode) and make them grow as they gain text runs. (This initial vertical geometry adjustment is different from the sizing in computeInlineBoxesLogicalHeight(). It is based on the font metrics (triggered by text runs), while in computeInlineBoxesLogicalHeight inline boxes stretch their parent inline boxes.) This will also turn into a more dynamic sizing when we start handling fallback fonts. * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::InlineBox::InlineBox): (WebCore::Layout::LineBox::constructInlineBoxes): (WebCore::Layout::LineBox::computeInlineBoxesLogicalHeight): (WebCore::Layout::LineBox::alignInlineBoxesVerticallyAndComputeLineBoxHeight): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineBox::fontMetrics const): (WebCore::Layout::LineBox::InlineBox::setDescent): 2020-09-11 Rob Buis <rbuis@igalia.com> Rename m_URL to m_frameURL https://bugs.webkit.org/show_bug.cgi?id=216401 Reviewed by Frédéric Wang. Rename m_URL to m_frameURL since m_URL violates the style checker and any patches that touch m_URL would have to deal with this style check violation. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::canLoad const): (WebCore::HTMLFrameElementBase::openURL): (WebCore::HTMLFrameElementBase::setLocation): * html/HTMLFrameElementBase.h: 2020-09-10 Fujii Hironori <Hironori.Fujii@sony.com> Protect this object in ValidationMessage::buildBubbleTree https://bugs.webkit.org/show_bug.cgi?id=211832 Reviewed by Ryosuke Niwa. ValidationMessage::buildBubbleTree is doing layout which can run a script detaching the owner form element, and this ValidationMessage object can be destroyed. Don't do layout in buildBubbleTree. Call adjustBubblePosition by using queuePostLayoutCallback and a weak pointer of ValidationMessage. ValidationMessage::deleteBubbleTree was causing ASSERT_WITH_SECURITY_IMPLICATION failures in ContainerNode::removeNodeWithScriptAssertion due to re-entrant of removeNodeWithScriptAssertion. UA shadow roots are never exposed to author scripts so this is safe. Use ScriptDisallowedScope::EventAllowedScope in it. Test: fast/forms/validation-bubble-disappears-during-layout.html * html/ValidationMessage.cpp: (WebCore::ValidationMessage::adjustBubblePosition): (WebCore::ValidationMessage::buildBubbleTree): (WebCore::ValidationMessage::deleteBubbleTree): Use ScriptDisallowedScope::EventAllowedScope. (WebCore::adjustBubblePosition): Changed to a member function. * html/ValidationMessage.h: Inherit CanMakeWeakPtr. 2020-09-10 Yusuke Suzuki <ysuzuki@apple.com> JSDOMConvertSequences should have exception checks appropriately https://bugs.webkit.org/show_bug.cgi?id=216390 <rdar://problem/68631333> Reviewed by Mark Lam. Test: js/dom/frozen-array-exception-check.html Add appropriate exception checks to JSDOMConvertSequences. * bindings/js/JSDOMConvertSequences.h: (WebCore::Detail::NumericSequenceConverter::convert): (WebCore::JSConverter<IDLSequence<T>>::convert): (WebCore::JSConverter<IDLFrozenArray<T>>::convert): 2020-09-10 Megan Gardner <megan_gardner@apple.com> Text replacements at the beginning of a second line are replaced too early https://bugs.webkit.org/show_bug.cgi?id=216327 <rdar://problem/68170353> Reviewed by Darin Adler. In the changes in r258871, using SimpleRanges instead of Range causing some side effects when the replacements at the beginning of lines. The ranges that we are counting are backwards and the return characters are being counted instead of being ignored. There is almost certainly a better fix than this, but this patch restores the original logic that was present when Range was being used, until a better fix can be worked out. Test: editing/spelling/text-replacement-first-word-second-line.html * editing/Editor.cpp: (WebCore::Editor::markAndReplaceFor): * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingParagraph::automaticReplacementStart const): (WebCore::TextCheckingParagraph::automaticReplacementLength const): * editing/TextCheckingHelper.h: 2020-09-10 Myles C. Maxfield <mmaxfield@apple.com> Small cleanup in RenderTheme https://bugs.webkit.org/show_bug.cgi?id=216293 Reviewed by Darin Adler. See the discussion in https://bugs.webkit.org/show_bug.cgi?id=213332 for background. More comments below. No new tests because there is no behavior change. * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::platformCreateScaledFont const): Use auto instead of RetainPtr. * platform/graphics/cocoa/FontDescriptionCocoa.cpp: (WebCore::matchSystemFontUse): Use std::binary_search instead of std::find, because it's faster and we expect this function to be called very often. * platform/graphics/mac/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): Use auto instead of RetainPtr. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::cachedSystemFontDescription const): Move the local variables into an array. * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::cachedSystemFontDescription const): Ditto. (WebCore::cssWeightOfSystemFont): (WebCore::RenderThemeCocoa::updateCachedSystemFontDescription const): Use auto instead of RetainPtr. * rendering/RenderThemeIOS.mm: (WebCore::attachmentTitleFont): Ditto. * rendering/RenderThemeMac.mm: (WebCore::AttachmentLayout::layOutTitle): Ditto. (WebCore::AttachmentLayout::layOutSubtitle): Ditto. 2020-09-10 Joonghun Park <jh718.park@samsung.com> Unreviewed. Remove the build warning below since r266885. warning: redundant move in return statement [-Wredundant-move] Because return statement already returns rvalue reference, we don't need WTFMove at return. No new tests, no new behaviors. * inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::getAllStyleSheets): (WebCore::InspectorCSSAgent::getSupportedCSSProperties): (WebCore::InspectorCSSAgent::getSupportedSystemFontFamilyNames): * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::requestClientNodes): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::getDocument): (WebCore::InspectorDOMAgent::querySelectorAll): (WebCore::InspectorDOMAgent::getSupportedEventNames): (WebCore::InspectorDOMAgent::getEventListenersForNode): (WebCore::InspectorDOMAgent::getSearchResults): * inspector/agents/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::getDOMStorageItems): * inspector/agents/InspectorDatabaseAgent.cpp: (WebCore::InspectorDatabaseAgent::getDatabaseTableNames): * inspector/agents/InspectorLayerTreeAgent.cpp: (WebCore::InspectorLayerTreeAgent::layersForNode): (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer): * inspector/agents/page/PageConsoleAgent.cpp: (WebCore::PageConsoleAgent::getLoggingChannels): 2020-09-10 Zalan Bujtas <zalan@apple.com> [Repaint] RenderLayerModelObject::styleWillChange may issue redundant repaint https://bugs.webkit.org/show_bug.cgi?id=216374 <rdar://problem/68657490> Reviewed by Simon Fraser. Move the repaintIncludingDescendants() calls to repaintBeforeStyleChange() to avoid redundant repaints on the same renderer. * rendering/RenderElement.cpp: (WebCore::RenderElement::repaintBeforeStyleChange): * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::styleWillChange): 2020-09-10 Wenson Hsieh <wenson_hsieh@apple.com> Address a post-commit review comment after r266887 https://bugs.webkit.org/show_bug.cgi?id=216257 Reviewed by Darin Adler. Remove a check that currently makes us conditionally set `IsComputedStyleInvalidFlag` if there is a computed style in rare data. There should be no change in behavior; this just makes the code a bit simpler. * dom/Element.cpp: (WebCore::Element::invalidateStyle): (WebCore::Element::storeDisplayContentsStyle): 2020-09-10 Chris Dumez <cdumez@apple.com> Unreviewed, reverting r266842 and r266883. Causes some assertions to be hit in debug builds Reverted changesets: "Some WebAudio tests give different output on different machines" https://bugs.webkit.org/show_bug.cgi?id=216371 https://trac.webkit.org/changeset/266842 "Unreviewed Windows build fix after r266842." https://trac.webkit.org/changeset/266883 2020-09-10 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Construct LineBox::InlineBoxes for nested inline level boxes when they overlap multiple lines https://bugs.webkit.org/show_bug.cgi?id=216369 Reviewed by Antti Koivisto. An inline box may not necessarily start on the current line: <span id=outer>line break <br> this content's parent inline box('outer') <span id=inner>starts on the previous line</span> </span> We need to make sure that there's an LineBox::InlineBox for every inline box that's present on the current line. (both 'outer' and 'inner' inline boxes have to have a corresponding LineBox::InlineBox here to be able to compute their geometry) They normally get constructed when when we see a [container start] run, but when the nesting level > 1 at the start of the line, we will not see those [container start] runs. In such cases we need to create LineBox::InlineBoxes for the inline box ancestors. We only have to do it on the first run as any subsequent inline content is either at the same/higher nesting level or nested with a [container start] run. Test: fast/layoutformattingcontext/inline-box-overlaps-multiple-lines.html * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::constructInlineBoxes): 2020-09-10 Wenson Hsieh <wenson_hsieh@apple.com> REGRESSION (r257839): clickpay.com - password placeholder text cannot be replaced https://bugs.webkit.org/show_bug.cgi?id=216257 <rdar://problem/68150686> Reviewed by Antti Koivisto. On clickpay.com, the field in the login form that contains the text "Password" is actually a plain text input, referred to by the site's script as the "null text input". The page adds a focus event listener to this null text input, and inside of this focus event listener, it reveals a hidden password field by removing an inline `display: none;` style rule on the real password input element, programmatically focuses it, and then hides the null text input by setting it to `display: none;` via inline style. However, after the changes in r257839, we no longer attempt to do a style update upon programmatic focus in the case where the programmatically focused element does not have a renderer yet (this applies to the password field in this scenario, because it previously had `display: none;`). When we determine whether the newly displayed password field is focusable using `Element::isVisibleWithoutResolvingFullStyle`, we then attempt to use either the existing computed `RenderStyle` on the element, or perform a partial computed style resolution using the `ResolveComputedStyleMode::RenderedOnly` flag. But in the case where `ElementRareData`'s computed style exists, it is not guaranteed to be up to date if the inline style changed since the computed style was last set. In the context of this bug, it's actually Safari's AutoFill logic (embedded in the injected bundle) that ends up asking for the computed style of the password input, forcing it to be created and set (though, as demonstrated in the layout test, simply grabbing the computed style is sufficient to replicate the bug outside of Safari). The end result is that we'll use this stale computed style, which still believes that the password input is not displayed, and we end up not focusing the element due to believing that the password input is hidden. To fix this, we would need to either check whether the element has an invalid style (i.e. `needsStyleRecalc()`) before attempting to use the existing computed style, or clear out the `ElementRareData` computed style anytime the element's style is invalidated. However, both of these approaches will cause us to perform partial style resolution much more aggressively, leading to a 2-3% regression in Speedometer. To address the bug without hampering our performance wins from r257839, we add a new node flag so that we can remember when computed styles are no longer valid due to style invalidation, and consult this flag in `Element::isVisibleWithoutResolvingFullStyle` to avoid using the existing computed style. Test: fast/forms/programmatic-focus-after-display.html * dom/Element.cpp: (WebCore::Element::invalidateStyle): (WebCore::Element::resolveComputedStyle): (WebCore::Element::isVisibleWithoutResolvingFullStyle const): * dom/Node.h: (WebCore::Node::setHasValidStyle): 2020-09-10 Devin Rousso <drousso@apple.com> Web Inspector: modernize generated backend protocol code https://bugs.webkit.org/show_bug.cgi?id=216302 <rdar://problem/68547649> Reviewed by Brian Burg. Previously, the inspector protocol was expressed in code in a somewhat confusing way: - the error string was the first argument - required parameters were `T` or `const T&` - optional parameters were `const T*` - enum parameters were the underlying type requiring the backend dispatcher handler to process it instead of it being preprocessed - required returns were `T&` - optional returns were `T*` This doesn't really make for easy/obvious reading of code since the order of arguments is not weird (e.g. error string first), and that there are references/pointers to primitive types. This patch cleans up the generated inspector protocol code to be: - required parameters are `T` or `Ref<T>&&` - optional parameters are `Optional<T>&&` or `RefPtr<T>&&` - enum parameters are preprocessed and passed to the backend dispatcher handler if valid - synchronous commands return `Expected<X, ErrorString>` using the same types/rules above where `X` is either a single return or a `std::tuple` of multiple returns The one exception to the above is `String`, which is already a tri-state of `nullString()`, `emptyString()`, and something set, so there's no need to use `Optional<String>`. Also use `Protocol` objects/`typedefs` wherever possible to further relate the protocol JSON and the actual backend dispatcher handler implementation. * inspector/InspectorAuditResourcesObject.cpp: * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: * inspector/InspectorController.cpp: * inspector/InspectorStyleSheet.h: * inspector/InspectorStyleSheet.cpp: * inspector/agents/InspectorAnimationAgent.h: * inspector/agents/InspectorAnimationAgent.cpp: * inspector/agents/InspectorApplicationCacheAgent.h: * inspector/agents/InspectorApplicationCacheAgent.cpp: * inspector/agents/InspectorCPUProfilerAgent.h: * inspector/agents/InspectorCPUProfilerAgent.cpp: * inspector/agents/InspectorCSSAgent.h: * inspector/agents/InspectorCSSAgent.cpp: * inspector/agents/InspectorCanvasAgent.h: * inspector/agents/InspectorCanvasAgent.cpp: * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: * inspector/agents/InspectorDOMDebuggerAgent.h: * inspector/agents/InspectorDOMDebuggerAgent.cpp: * inspector/agents/InspectorDOMStorageAgent.h: * inspector/agents/InspectorDOMStorageAgent.cpp: * inspector/agents/InspectorDatabaseAgent.h: * inspector/agents/InspectorDatabaseAgent.cpp: * inspector/agents/InspectorIndexedDBAgent.h: * inspector/agents/InspectorIndexedDBAgent.cpp: * inspector/agents/InspectorLayerTreeAgent.h: * inspector/agents/InspectorLayerTreeAgent.cpp: * inspector/agents/InspectorMemoryAgent.h: * inspector/agents/InspectorMemoryAgent.cpp: * inspector/agents/InspectorNetworkAgent.h: * inspector/agents/InspectorNetworkAgent.cpp: * inspector/agents/InspectorPageAgent.h: * inspector/agents/InspectorPageAgent.cpp: * inspector/agents/InspectorTimelineAgent.h: * inspector/agents/InspectorTimelineAgent.cpp: * inspector/agents/InspectorWorkerAgent.h: * inspector/agents/InspectorWorkerAgent.cpp: * inspector/agents/WebConsoleAgent.h: * inspector/agents/WebDebuggerAgent.h: * inspector/agents/WebDebuggerAgent.cpp: * inspector/agents/WebHeapAgent.h: * inspector/agents/WebHeapAgent.cpp: * inspector/agents/page/PageAuditAgent.h: * inspector/agents/page/PageAuditAgent.cpp: * inspector/agents/page/PageConsoleAgent.h: * inspector/agents/page/PageConsoleAgent.cpp: * inspector/agents/page/PageDOMDebuggerAgent.h: * inspector/agents/page/PageDOMDebuggerAgent.cpp: * inspector/agents/page/PageDebuggerAgent.h: * inspector/agents/page/PageDebuggerAgent.cpp: * inspector/agents/page/PageHeapAgent.h: * inspector/agents/page/PageHeapAgent.cpp: * inspector/agents/page/PageNetworkAgent.h: * inspector/agents/page/PageNetworkAgent.cpp: * inspector/agents/page/PageRuntimeAgent.h: * inspector/agents/page/PageRuntimeAgent.cpp: * inspector/agents/worker/ServiceWorkerAgent.h: * inspector/agents/worker/ServiceWorkerAgent.cpp: * inspector/agents/worker/WorkerAuditAgent.h: * inspector/agents/worker/WorkerConsoleAgent.h: * inspector/agents/worker/WorkerAuditAgent.cpp: * inspector/agents/worker/WorkerDOMDebuggerAgent.h: * inspector/agents/worker/WorkerDOMDebuggerAgent.cpp: * inspector/agents/worker/WorkerDebuggerAgent.h: * inspector/agents/worker/WorkerDebuggerAgent.cpp: * inspector/agents/worker/WorkerNetworkAgent.h: * inspector/agents/worker/WorkerNetworkAgent.cpp: * inspector/agents/worker/WorkerRuntimeAgent.h: * inspector/agents/worker/WorkerRuntimeAgent.cpp: Elided backend dispatcher handler changes describe above. * inspector/CommandLineAPIHost.cpp: (WebCore::CommandLineAPIHost::inspect): (WebCore::CommandLineAPIHost::clearConsoleMessages): * inspector/InspectorFrontendHost.cpp: (WebCore::valuePayloadFromJSONValue): (WebCore::InspectorFrontendHost::logDiagnosticEvent): * inspector/TimelineRecordFactory.h: * inspector/TimelineRecordFactory.cpp: (WebCore::TimelineRecordFactory::appendLayoutRoot): * Modules/applicationmanifest/ApplicationManifestParser.cpp: (WebCore::ApplicationManifestParser::parseManifest): (WebCore::ApplicationManifestParser::parseStartURL): (WebCore::ApplicationManifestParser::parseDisplay): (WebCore::ApplicationManifestParser::parseScope): (WebCore::ApplicationManifestParser::parseGenericString): * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::extractKeyIDsKeyids): * platform/encryptedmedia/CDMUtilities.cpp: (WebCore::CDMUtilities::parseJSONObject): * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::parseLicenseFormat): (WebCore::parseLicenseReleaseAcknowledgementFormat): * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp: (WebCore::extractSinfData): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::parseJSONValue): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense): `JSON` classes now use `Ref&&` wherever possible and `Optional` instead of an out parameter for `get*`/`as*` so that values can be more easily manipulated and can be confidently known to exist. 2020-09-10 Simon Fraser <simon.fraser@apple.com> Revert accidental hard-coding of compositing logging from r266825. * platform/Logging.cpp: (WebCore::initializeLogChannelsIfNecessary): 2020-09-10 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Share code when constructing LineBox::InlineBox for the atomic inline-level box https://bugs.webkit.org/show_bug.cgi?id=216338 Reviewed by Antti Koivisto. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::createDisplayBoxesForLineContent): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::logicalRectForTextRun const): (WebCore::Layout::LineBox::constructInlineBoxes): (WebCore::Layout::LineBox::inlineRectForTextRun const): Deleted. * layout/inlineformatting/InlineLineBox.h: 2020-09-10 Antti Koivisto <antti@apple.com> Don't create event regions when the page has no subscrollers https://bugs.webkit.org/show_bug.cgi?id=216355 <rdar://problem/67900642> Reviewed by Simon Fraser. Tests: fast/scrolling/mac/event-region-subscroller-frame.html fast/scrolling/mac/event-region-subscroller-overflow.html Unless the page uses features like touch-action we don't need event regions for plain main frame scrolling. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::hasSubscrollers const): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::hasSubscrollers const): * page/scrolling/ScrollingStateScrollingNode.cpp: (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): (WebCore::ScrollingStateScrollingNode::~ScrollingStateScrollingNode): * page/scrolling/ScrollingStateTree.h: (WebCore::ScrollingStateTree::scrollingNodeCount const): (WebCore::ScrollingStateTree::scrollingNodeAdded): (WebCore::ScrollingStateTree::scrollingNodeRemoved): Count scrolling nodes in the state tree. It is updated during updateCompositingLayers, before event region generation. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::maintainsEventRegion const): Don't maintain event region if there are no subscrollers and none of the other reasons were hit. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingLayers): Invalidate event regions if a subscroller appears. (WebCore::RenderLayerCompositor::invalidateEventRegionForAllFrames): * rendering/RenderLayerCompositor.h: 2020-09-10 Jer Noble <jer.noble@apple.com> [Cocoa] PERF: Don't instantiate AVPlayer-based audio decoders or renderers if an element is initially muted. https://bugs.webkit.org/show_bug.cgi?id=216299 Reviewed by Eric Carlson. When an AVPlayer is created, even if muted, it will still instantiate an audio decoder and renderer if the AVAsset in the current player item has an audio track. Ostensibly, this is so that an unmute operation is instantaneous, as it's merely applying a zero gain to the decoded audio. However for web content, there's many autoplaying, muted <video> elements which may never be un-muted before being destroyed. Implement a policy where, if an AVPlayer is initially muted, we adopt AVFoundation SPI to forcibly prevent audio decoding and rendering until the first time the AVPlayer is unmuted. This means the first un-mute may not be instantaneous, as an audio decoder will have to be created and fed before any audio is rendered. There's some incorrect caching of mute state at the MediaPlayer level; so MediaPlayer and MPPAVFoundationObjC can get their respective m_muted states out of sync. Make sure that HTMLMediaElement always sets muted state after creating a MediaPlayer and that, respectively, MPPAVFoundationObjC always queries it's parent MediaPlayer's mute state when it in turn is created. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::createMediaPlayer): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted): 2020-09-10 Chris Dumez <cdumez@apple.com> Some WebAudio tests give different output on different machines https://bugs.webkit.org/show_bug.cgi?id=216371 Reviewed by Alex Christensen. Add function to override the value returned by AudioDestination::hardwareSampleRate(). * DerivedSources-output.xcfilelist: * platform/audio/AudioDestination.h: * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::hardwareSampleRateOverride): (WebCore::AudioDestination::hardwareSampleRate): (WebCore::AudioDestination::setHardwareSampleRateOverride): * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::hardwareSampleRateOverride): (WebCore::AudioDestination::hardwareSampleRate): (WebCore::AudioDestination::setHardwareSampleRateOverride): 2020-09-10 Don Olmstead <don.olmstead@sony.com> WebGL2RenderingContext should use Graphics Context types https://bugs.webkit.org/show_bug.cgi?id=216310 Reviewed by Kenneth Russell. A number of declarations were using OpenGL types instead of the GCGL types. All instances of GL types were replaced with the equivalent GCGL ones. Any GL constants were replaced with the listing in GraphicsContext. Renamed GraphcsContext::WAIT_FAILED to WAIT_FAILED_WEBGL to remove PLATFORM(WIN) defining its own variant WAIT_FAILED_WIN. WAIT_FAILED conflicts with a Windows definition. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::validateTexFuncLayer): (WebCore::WebGL2RenderingContext::compressedTexSubImage2D): (WebCore::WebGL2RenderingContext::clientWaitSync): (WebCore::ValidateTransformFeedbackPrimitiveMode): (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter): (WebCore::WebGL2RenderingContext::getParameter): (WebCore::WebGL2RenderingContext::validateClearBuffer): (WebCore::WebGL2RenderingContext::uniform1fv): (WebCore::WebGL2RenderingContext::uniform2fv): (WebCore::WebGL2RenderingContext::uniform3fv): (WebCore::WebGL2RenderingContext::uniform4fv): (WebCore::WebGL2RenderingContext::uniform1iv): (WebCore::WebGL2RenderingContext::uniform2iv): (WebCore::WebGL2RenderingContext::uniform3iv): (WebCore::WebGL2RenderingContext::uniform4iv): (WebCore::WebGL2RenderingContext::uniformMatrix2fv): (WebCore::WebGL2RenderingContext::uniformMatrix3fv): (WebCore::WebGL2RenderingContext::uniformMatrix4fv): (WebCore::WebGL2RenderingContext::readPixels): * html/canvas/WebGL2RenderingContext.h: * platform/graphics/GraphicsContextGL.h: 2020-09-10 Chris Dumez <cdumez@apple.com> Port BaseAudioContext to the HTML event loop https://bugs.webkit.org/show_bug.cgi?id=216331 Reviewed by Sam Weinig. Stop using legacy GenericEventQueue class and port BaseAudioContext to the modern HTML event loop instead. * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::finish): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): (WebCore::BaseAudioContext::setState): (WebCore::BaseAudioContext::finishedRendering): (WebCore::BaseAudioContext::postTask): * Modules/webaudio/BaseAudioContext.h: 2020-09-10 Antoine Quint <graouts@webkit.org> REGRESSION (r260360): Ionic modal dialog doesn't animate correctly when dragged and released https://bugs.webkit.org/show_bug.cgi?id=216308 <rdar://problem/68567444> Reviewed by Simon Fraser. We fixed seeking for animations with a reversed playback rate in r261637, the fix for bug 204717, but only looked at the animation's playback rate. However, an animation can also play in reverse using the "direction" property of the timing object passed to updateTiming(), so we should also check that it's playing forwards in order to be seeked. Test: webanimations/accelerated-animation-easing-and-direction-update.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::animationCanBeAccelerated const): 2020-09-10 Adrian Perez de Castro <aperez@igalia.com> [CMake] Use imported targets in find module for libseccomp https://bugs.webkit.org/show_bug.cgi?id=216329 Reviewed by Don Olmstead. No new tests needed. * PlatformGTK.cmake: Take the Libseccomp::Libseccomp imported target into use. 2020-09-10 Youenn Fablet <youenn@apple.com> Run captureCanvas-webrtc-software-encoder.html tests on all platforms https://bugs.webkit.org/show_bug.cgi?id=216352 Reviewed by Eric Carlson. Remove no longer needed internals API. Tests: webrtc/captureCanvas-webrtc-software-encoder.html webrtc/captureCanvas-webrtc-software-h264-baseline.html webrtc/captureCanvas-webrtc-software-h264-high.html * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): * testing/Internals.h: * testing/Internals.idl: 2020-09-10 Aditya Keerthi <akeerthi@apple.com> [macOS] Add editability to input type=datetime-local https://bugs.webkit.org/show_bug.cgi?id=216311 Reviewed by Devin Rousso. This patch adds editability to input type=datetime-local by leveraging existing logic to add editable components to date/time inputs. Tests: fast/forms/datetimelocal/datetimelocal-editable-components/* * html/BaseChooserOnlyDateAndTimeInputType.cpp: Add shouldHaveSecondField and shouldHaveMillisecondField methods so that the logic can be shared by TimeInputType and DateTimeLocalInputType. (WebCore::BaseChooserOnlyDateAndTimeInputType::shouldHaveSecondField const): (WebCore::BaseChooserOnlyDateAndTimeInputType::shouldHaveMillisecondField const): * html/BaseChooserOnlyDateAndTimeInputType.h: * html/DateTimeFieldsState.h: Add method to compute the 23-hour value to avoid duplication in TimeInputType and DateTimeLocalInputType. (WebCore::DateTimeFieldsState::hour23 const): * html/DateTimeLocalInputType.cpp: (WebCore::DateTimeLocalInputType::isValidFormat const): (WebCore::DateTimeLocalInputType::formatDateTimeFieldsState const): (WebCore::DateTimeLocalInputType::setupLayoutParameters const): * html/TimeInputType.cpp: (WebCore::TimeInputType::formatDateTimeFieldsState const): (WebCore::TimeInputType::setupLayoutParameters const): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::dateTimeLocalInputStyleSheet const): Increase width to reflect the fact that this input contains more fields than the other date/time inputs. 2020-09-10 Kate Cheney <katherine_cheney@apple.com> Clean up App-Bound Domains code to only compile for iOS with its own macro https://bugs.webkit.org/show_bug.cgi?id=215027 <rdar://problem/63688232> Reviewed by Darin Adler. App-Bound Domains code should only be compiled and run on iOS. This patch wraps any App-Bound Domains code in #if ENABLE(APP_BOUND_DOMAINS), which is equal to IOS_FAMILY, making sure we don't execute or compile the code unnecessarily on macOS. No new tests, behavior should not change so testing is covered by all existing App-Bound Domains layout and API tests. * bindings/js/ScriptController.cpp: (WebCore::ScriptController::executeScriptInWorld): * loader/FrameLoaderClient.h: * page/Frame.cpp: (WebCore::Frame::injectUserScriptImmediately): * page/Page.cpp: (WebCore::Page::injectUserStyleSheet): * page/WebKitNamespace.cpp: (WebCore::WebKitNamespace::messageHandlers): * platform/network/NetworkStorageSession.cpp: * platform/network/NetworkStorageSession.h: * style/StyleScopeRuleSets.cpp: (WebCore::Style::ScopeRuleSets::initializeUserStyle): 2020-09-10 Said Abou-Hallawa <sabouhallawa@apple.com> [CG] REGRESSION (Big Sur): A GIF image with a finite loopCount loops an extra cycle https://bugs.webkit.org/show_bug.cgi?id=216018 <rdar://problem/68304035> Reviewed by Tim Horton. Remove the extra 'one' we used to add to the GIF loopCount since it is now added by the underlying frameworks. But make sure we are compatible with the older versions of macOS and iOS. * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoderCG::repetitionCount const): 2020-09-10 Simon Fraser <simon.fraser@apple.com> REGRESSION (Async overflow scroll): Truncated scrollbars in facebook chat https://bugs.webkit.org/show_bug.cgi?id=216294 <rdar://problem/61918702> Reviewed by Antti Koivisto. When both async overflow scroll and overlay scrollbars are enabled, it's possible for composited layers that are later in z-order than the overflow to overlap the scrollbars (overflow does not create stacking context, so they are later siblings to the overflow). To fix this we have to hoist the layer that hosts the overflow controls above all later layers which belong to contents scrolled by this overflow. We know which layers these are; they have ancestor clippings stacks that reference the overflow layer. This overflow controls layer hoisting happens in the context of the enclosing composited layer. So to fix this RenderLayerCompositor::updateBackingAndHierarchy() tracks these layers that belong to an overflow scroll. RenderLayerCompositor::adjustOverflowScrollbarContainerLayers() uses them to find the overflow scroll layers whose controls need hoisting, and where to insert those overflow controls hosting layers in the sublayers list of the enclosing composited layer. An additional source of complexity occurs with overflow scroll nested inside another scroller or overflow:hidden (in the same composited stacking context): the overflow controls reparenting is hoisting that layer up, so that layer itself needs additional layers to clip it (essentially the overflow control layer behaves like a later sibling that needs its own ancestor clipping stack). When this occurs, RenderLayerBacking creates an additional "ancestor clipping stack" in m_overflowControlsHostLayerAncestorClippingStack which is a parallel stack to m_ancestorClippingStack, but with its own set of clipping layers. At some point this will also need scrolling tree nodes created for it. Some minor refactoring helps share code for the two LayerAncestorClippingStacks. This new code all runs late in the compositing update for a given layer, which is not ideal; we replicate some code from updateGeometry() and updateInternalHierarchy(). Ideally we'd be able to know at computeCompositingRequirements() time if we need to do layer hoisting and ancestor clipping stack duplication, but that proves hard because of ordering dependencies. Tests: compositing/scrolling/async-overflow-scrolling/overlapped-overlay-scrollbar-dynamic.html compositing/scrolling/async-overflow-scrolling/overlapped-overlay-scrollbar-inside-hidden.html compositing/scrolling/async-overflow-scrolling/overlapped-overlay-scrollbar-nested.html compositing/scrolling/async-overflow-scrolling/overlapped-overlay-scrollbar.html compositing/scrolling/async-overflow-scrolling/transform-change-scrollbar-position.html * rendering/LayerAncestorClippingStack.cpp: (WebCore::LayerAncestorClippingStack::compositedClipData const): * rendering/LayerAncestorClippingStack.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::updateGeometry): (WebCore::RenderLayerBacking::adjustOverflowControlsPositionRelativeToAncestor): (WebCore::RenderLayerBacking::updateInternalHierarchy): (WebCore::RenderLayerBacking::updateAncestorClippingStack): (WebCore::RenderLayerBacking::ensureOverflowControlsHostLayerAncestorClippingStack): (WebCore::RenderLayerBacking::ensureClippingStackLayers): (WebCore::RenderLayerBacking::removeClippingStackLayers): (WebCore::RenderLayerBacking::connectClippingStackLayers): (WebCore::RenderLayerBacking::updateClippingStackLayerGeometry): (WebCore::RenderLayerBacking::updateAncestorClipping): (WebCore::RenderLayerBacking::offsetRelativeToRendererOriginForDescendantLayers const): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::UpdateBackingTraversalState::UpdateBackingTraversalState): (WebCore::RenderLayerCompositor::UpdateBackingTraversalState::stateForDescendants const): (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): (WebCore::RenderLayerCompositor::adjustOverflowScrollbarContainerLayers): (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingProxyRole): * rendering/RenderLayerCompositor.h: 2020-09-10 Aditya Keerthi <akeerthi@apple.com> Small cleanup in DateTimeFieldElements https://bugs.webkit.org/show_bug.cgi?id=216339 Reviewed by Darin Adler. Address some post-review comments after r266779. * html/shadow/DateTimeFieldElements.h: Removed virtual from overridden methods, reordered declarations for consistency, and added final keyword to all overridden methods. 2020-09-10 Enrique Ocaña González <eocanha@igalia.com> [MSE][GStreamer] Support Google Dynamic Ad Insertion (DAI) https://bugs.webkit.org/show_bug.cgi?id=216039 Reviewed by Philippe Normand. What happens on the DAI transitions between regular and advertisement videos (and back) on MP4 is that each track has a different stream id, so qtdemux doesn't reuse streams and created a new pad/stream/track for the new piece of video. Our current code only supports a single simultaneous track per SourceBuffer, so it "disables" the second (new) one by attaching a blackk hole probe which drops all the buffers. Right after the new pad is created, the old pad/stream/track is removed, so in the end only a single "disabled" track remains. This patch detects that situation and reattaches the single remaining pad to the existing downstream elements of the AppendPipeline (an optional parser and the appsink) as long as the old and new caps are compatible. For appsink to keep working after the EOS caused by the old pad removal, it must be reset by changing its state to NULL and then to PLAYING again. For more info and test cases about Google DAI, have a look at: https://developers.google.com/interactive-media-ads/docs/sdks/html5/dai https://github.com/googleads/googleads-ima-html5-dai * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::AppendPipeline): Ignore EOS when there are multiple demuxer src pads. It likely means that one of the pads is going to be removed (EOS legitimally happens right before that). (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread): Reconnect the remaining demuxer pad when it's the last one remaining after some other has been removed. 2020-09-10 Carlos Garcia Campos <cgarcia@igalia.com> [GTK][WPE] Support NTLM authentication https://bugs.webkit.org/show_bug.cgi?id=122952 Reviewed by Adrian Perez de Castro. Add SoupAuthNTLM feature to the session. * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::SoupNetworkSession): 2020-09-10 Zalan Bujtas <zalan@apple.com> [Repaint] RenderElement::setStyle may issue redundant repaint https://bugs.webkit.org/show_bug.cgi?id=216324 <rdar://problem/68595896> Reviewed by Simon Fraser. If we issue a repaint in ::styleWillChange, we should not need to re-issue it again in RenderElement::setStyle (see r266803 for details). * rendering/RenderElement.cpp: (WebCore::RenderElement::repaintBeforeStyleChange): (WebCore::RenderElement::setStyle): * rendering/RenderElement.h: 2020-09-10 Darin Adler <darin@apple.com> webkit-test-runner: Add support for the reftest-wait class name https://bugs.webkit.org/show_bug.cgi?id=186045 Reviewed by Antti Koivisto. * html/LazyLoadImageObserver.cpp: (WebCore::LazyLoadImageObserver::unobserve): Removed an incorrect assertion that was firing when running regression tests. The code this calls correctly handles the case this was asserting about and from examining the ImageLoader call that invokes this it's clear that the invariant is not guaranteed by that code. The assertion can be re-added if needed later after fixing how ImageLoader calls this function. 2020-09-09 Wenson Hsieh <wenson_hsieh@apple.com> Unreviewed, update DerivedSources-output.xcfilelist after r266801 Sort the contents of the xcfilelist, and add missing entries for new wrapper objects. * DerivedSources-output.xcfilelist: 2020-09-09 Dean Jackson <dino@apple.com> CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::WebGLRenderingContext::getExtension https://bugs.webkit.org/show_bug.cgi?id=216337 <rdar://problem/68421590> Reviewed by Sam Weinig. Bug 215599 added IsoHeap storage to WebGLExtension, but didn't add it to any of the subclasses. This causes a crash in ::getExtension because allocation of the new instance fails. Add WTF_MAKE_ISO_ALLOCATED_IMPL to the .cpp files, and WTF_MAKE_ISO_ALLOCATED to the .h files. This should have been detected by on-device testing, since a debug build would have asserted because the size passed into the constructor was different from the actual size of the class. * html/canvas/ANGLEInstancedArrays.cpp: * html/canvas/ANGLEInstancedArrays.h: * html/canvas/EXTBlendMinMax.cpp: * html/canvas/EXTBlendMinMax.h: * html/canvas/EXTColorBufferFloat.cpp: * html/canvas/EXTColorBufferFloat.h: * html/canvas/EXTColorBufferHalfFloat.cpp: * html/canvas/EXTColorBufferHalfFloat.h: * html/canvas/EXTFragDepth.cpp: * html/canvas/EXTFragDepth.h: * html/canvas/EXTShaderTextureLOD.cpp: * html/canvas/EXTShaderTextureLOD.h: * html/canvas/EXTTextureFilterAnisotropic.cpp: * html/canvas/EXTTextureFilterAnisotropic.h: * html/canvas/EXTsRGB.cpp: * html/canvas/EXTsRGB.h: * html/canvas/OESElementIndexUint.cpp: * html/canvas/OESElementIndexUint.h: * html/canvas/OESStandardDerivatives.cpp: * html/canvas/OESStandardDerivatives.h: * html/canvas/OESTextureFloat.cpp: * html/canvas/OESTextureFloat.h: * html/canvas/OESTextureFloatLinear.cpp: * html/canvas/OESTextureFloatLinear.h: * html/canvas/OESTextureHalfFloat.cpp: * html/canvas/OESTextureHalfFloat.h: * html/canvas/OESTextureHalfFloatLinear.cpp: * html/canvas/OESTextureHalfFloatLinear.h: * html/canvas/OESVertexArrayObject.cpp: * html/canvas/OESVertexArrayObject.h: * html/canvas/WebGLColorBufferFloat.cpp: * html/canvas/WebGLColorBufferFloat.h: * html/canvas/WebGLCompressedTextureASTC.cpp: * html/canvas/WebGLCompressedTextureASTC.h: * html/canvas/WebGLCompressedTextureATC.cpp: * html/canvas/WebGLCompressedTextureATC.h: * html/canvas/WebGLCompressedTextureETC.cpp: * html/canvas/WebGLCompressedTextureETC.h: * html/canvas/WebGLCompressedTextureETC1.cpp: * html/canvas/WebGLCompressedTextureETC1.h: * html/canvas/WebGLCompressedTexturePVRTC.cpp: * html/canvas/WebGLCompressedTexturePVRTC.h: * html/canvas/WebGLCompressedTextureS3TC.cpp: * html/canvas/WebGLCompressedTextureS3TC.h: * html/canvas/WebGLCompressedTextureS3TCsRGB.cpp: * html/canvas/WebGLCompressedTextureS3TCsRGB.h: * html/canvas/WebGLDebugRendererInfo.cpp: * html/canvas/WebGLDebugRendererInfo.h: * html/canvas/WebGLDebugShaders.cpp: * html/canvas/WebGLDebugShaders.h: * html/canvas/WebGLDepthTexture.cpp: * html/canvas/WebGLDepthTexture.h: * html/canvas/WebGLDrawBuffers.cpp: * html/canvas/WebGLDrawBuffers.h: * html/canvas/WebGLLoseContext.cpp: * html/canvas/WebGLLoseContext.h: 2020-09-09 Andres Gonzalez <andresg_22@apple.com> Remove unused enum PostType. https://bugs.webkit.org/show_bug.cgi?id=216320 Reviewed by Chris Fleizach. No functionality change. - Removed the unused enum PostType, since all AX notifications are now posted asynchronously. - PostTarget is now an enum class. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::postNotification): (WebCore::AXObjectCache::selectedChildrenChanged): (WebCore::AXObjectCache::postTextStateChangeNotification): * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::postNotification): * accessibility/AccessibilityMenuList.cpp: (WebCore::AccessibilityMenuList::didUpdateActiveOption): * accessibility/AccessibilityMenuListPopup.cpp: (WebCore::AccessibilityMenuListPopup::didUpdateActiveOption): * accessibility/ios/AXObjectCacheIOS.mm: (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged): * editing/Editor.cpp: (WebCore::Editor::respondToChangedContents): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): 2020-09-09 Zalan Bujtas <zalan@apple.com> [Repaint] styleWillChange may call repaint on the same renderer multiple times. https://bugs.webkit.org/show_bug.cgi?id=216295 <rdar://problem/68538666> Reviewed by Simon Fraser. RenderElement::styleWillChange is a virtual function. This function is called whenever the associated RenderStyle changes. The subclass implementation (e.g. RenderBox::styleWillChange) calls the parent class to make sure the style change is covered properly. Now in certain cases, 1. this may trigger multiple calls to repaint() (e.g one in each ::styleWillChange implementation) 2. paint invalidation requires absolute coordinates 3. geometry does not change during styleWillChange it could end up being redundant/unnecessarily expensive. This patch moves all the style-will-change-requires-repaint logic to one single function so that we can limit the number of repaints. * rendering/RenderBox.cpp: (WebCore::RenderBox::styleWillChange): * rendering/RenderElement.cpp: (WebCore::RenderElement::issueRepaintBeforeStyleChange): (WebCore::RenderElement::initializeStyle): (WebCore::RenderElement::setStyle): (WebCore::RenderElement::styleWillChange): * rendering/RenderElement.h: * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::styleWillChange): 2020-09-09 Sam Weinig <weinig@apple.com> [WebIDL] Split GlobalEventHandlers partial interface mixins out of base mixin https://bugs.webkit.org/show_bug.cgi?id=216316 Reviewed by Darin Adler. Split GlobalEventHandlersCSSAnimations.idl, GlobalEventHandlersCSSTransitions.idl and GlobalEventHandlersPointerEvents.idl out of GlobalEventHandlers.idl to match how they are specified more closely. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/GlobalEventHandlersCSSAnimations.idl: Added. * animation/GlobalEventHandlersCSSTransitions.idl: Added. * dom/GlobalEventHandlers.idl: * dom/GlobalEventHandlersPointerEvents.idl: Added. 2020-09-09 Sam Weinig <weinig@apple.com> [WebIDL] Stop automatically applying the ImplementedBy extended attribute to all partial interfaces/dictionaries https://bugs.webkit.org/show_bug.cgi?id=216322 Reviewed by Darin Adler. When partial interfaces were originally introduced, there were grand ambitions to modularize and isolate parts of interfaces completely, mostly using the Supplemental<> pattern. As time has passed, more and more specs have usedd partial just to group things together, and having it implicitly mean using a class named after the IDL file with some static functions is not always the right choice. With this change, partial interfaces that want the supplemental style behavior must opt in, using the extended attribute "ImplementedBy", which is what the code generators already called this concept internally. * bindings/scripts/CodeGenerator.pm: (ProcessInterfaceSupplementalDependencies): (ProcessDictionarySupplementalDependencies): * bindings/scripts/CodeGeneratorJS.pm: (GetFullyQualifiedImplementationCallName): (AddAdditionalArgumentsForImplementationCall): * bindings/scripts/IDLAttributes.json: Remove special casing of partial interfaces / dictionaries automatically getting "ImplementedBy" applied to all members. Maintain the behavior that "ImplementedBy" is silently ignored when an attribute has been marked as "Reflect". * Modules/async-clipboard/NavigatorClipboard.idl: * Modules/beacon/NavigatorBeacon.idl: * Modules/cache/DOMWindowCaches.idl: * Modules/cache/WorkerGlobalScopeCaches.idl: * Modules/credentialmanagement/NavigatorCredentials.idl: * Modules/encryptedmedia/NavigatorEME.idl: * Modules/entriesapi/HTMLInputElementEntriesAPI.idl: * Modules/fetch/DOMWindowFetch.idl: * Modules/fetch/WorkerGlobalScopeFetch.idl: * Modules/gamepad/NavigatorGamepad.idl: * Modules/geolocation/NavigatorGeolocation.idl: * Modules/indexeddb/DOMWindowIndexedDatabase.idl: * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl: * Modules/mediacapabilities/NavigatorMediaCapabilities.idl: * Modules/mediasession/HTMLMediaElementMediaSession.idl: * Modules/mediasource/AudioTrackMediaSource.idl: * Modules/mediasource/DOMURLMediaSource.idl: * Modules/mediasource/TextTrackMediaSource.idl: * Modules/mediasource/VideoTrackMediaSource.idl: * Modules/mediastream/NavigatorMediaDevices.idl: * Modules/pictureinpicture/DocumentPictureInPicture.idl: * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.idl: * Modules/quota/DOMWindowQuota.idl: * Modules/quota/NavigatorStorageQuota.idl: * Modules/quota/WorkerNavigatorStorageQuota.idl: * Modules/remoteplayback/HTMLMediaElementRemotePlayback.idl: * Modules/speech/DOMWindowSpeechSynthesis.idl: * Modules/webdatabase/DOMWindowWebDatabase.idl: * Modules/webdriver/NavigatorWebDriver.idl: * Modules/webgpu/NavigatorGPU.idl: * Modules/webgpu/WebGPUDeviceErrorScopes.idl: * Modules/webgpu/WebGPUDeviceEventHandler.idl: * Modules/webgpu/WorkerNavigatorGPU.idl: * Modules/webxr/NavigatorWebXR.idl: * css/DOMCSSPaintWorklet.idl: * css/DOMCSSRegisterCustomProperty.idl: * dom/DocumentFullscreen.idl: * dom/DocumentStorageAccess.idl: * dom/DocumentTouch.idl: * page/NavigatorIsLoggedIn.idl: * svg/SVGDocument.idl: Update existing partials to opt into "ImplementedBy" bevahior. A future pass will go through these and see which ones can be simplified by removing the indirection without introducing unnecessary modularization changes. 2020-09-09 Chris Dumez <cdumez@apple.com> Move lazy DisplayLink tear down logic from the WebProcess to the UIProcess https://bugs.webkit.org/show_bug.cgi?id=216195 Reviewed by Simon Fraser. Move lazy DisplayLink tear down logic from the WebProcess to the UIProcess, now that the DisplayLink has been moved to the UIProcess due to sandboxing. After a DisplayLink no longer has any clients, we keep it firing up to 20 times without any clients in case a new client gets added shortly after. The idea was to avoid killing and respawning too many threads when adding and removing clients in quick succession. However, now that the DisplayLink lives in the UIProcess side and sends IPC to the WebProcesses every time it fires, it makes a lot more sense to implement this logic in the UIProcess side, to avoid sending unnecessary IPC to processes that do not care about it. * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitor::displayDidRefresh): * platform/graphics/DisplayRefreshMonitor.h: (WebCore::DisplayRefreshMonitor::shouldBeTerminated const): 2020-09-09 Chris Dumez <cdumez@apple.com> Stop performing "de-zippering" when applying gain https://bugs.webkit.org/show_bug.cgi?id=216288 Reviewed by Darin Adler. Stop performing "de-zippering" when applying gain. The latest specification does not indicate we should perform de-zippering and Blink does not either. This is causing us to fail a WPT test. No new tests, rebaselined existing test. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::process): (WebCore::AudioBufferSourceNode::reset): * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::process): (WebCore::GainNode::reset): * Modules/webaudio/GainNode.h: * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::process): (WebCore::PannerNode::reset): * Modules/webaudio/PannerNode.h: * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode): (WebCore::WebKitAudioPannerNode::process): (WebCore::WebKitAudioPannerNode::reset): * Modules/webaudio/WebKitAudioPannerNode.h: * platform/audio/AudioBus.cpp: (WebCore::AudioBus::copyWithGainFrom): * platform/audio/AudioBus.h: 2020-09-09 Chris Dumez <cdumez@apple.com> ASSERTION FAILED: m_finishedNodes.isEmpty() in AudioContext destructor https://bugs.webkit.org/show_bug.cgi?id=105870 Reviewed by Darin Adler. This assertion indicates that BaseAudioContext::derefFinishedSourceNodes() was not called before the BaseAudioContext destructor. Normally, derefFinishedSourceNodes() gets called from BaseAudioContext::handlePostRenderTasks() at the end of rending. However, BaseAudioContext::handlePostRenderTasks() only calls derefFinishedSourceNodes() if tryLock() succeeds. Therefore, in case of lock contention, it was possible we would end up destroying the BaseAudioContext without derefFinishedSourceNodes() having been called at the end of the rendering. To address the issue, we now call derefFinishedSourceNodes() after the audio thread is gone and before the BaseAudioContext gets destroyed, in BaseAudioContext::uninitialize(). No new tests, covered by existing tests that are flaky crashing. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::uninitialize): 2020-09-09 Antoine Quint <graouts@webkit.org> REGRESSION (r264856): updating easing on accelerated animation results in incorrect playback https://bugs.webkit.org/show_bug.cgi?id=215853 <rdar://problem/67815853> Reviewed by Simon Fraser. Stop accelerated animations if the timing function has changed in a way that makes it so that it should no longer play accelerated, but otherwise simply update their timing properties such that may keep playing. Test: webanimations/accelerated-animation-easing-update-after-pause.html webanimations/accelerated-animation-easing-update-steps-after-pause.html * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::canBeAccelerated const): (WebCore::KeyframeEffect::updateAcceleratedActions): (WebCore::KeyframeEffect::animationDidChangeTimingProperties): * animation/KeyframeEffect.h: 2020-09-09 Chris Dumez <cdumez@apple.com> AudioParam.linearRampToValueAtTime() / exponentialRampToValueAtTime() have no effect when there is no preceding event https://bugs.webkit.org/show_bug.cgi?id=216284 Reviewed by Darin Adler. AudioParam.linearRampToValueAtTime() / exponentialRampToValueAtTime() have no effect when there is no preceding event in the timeline. This is incorrect. We should insert an implicit SetValue event in the timeline if the ramp event is the first one. No new tests, rebaselined existing test. * Modules/webaudio/AudioParam.cpp: * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::linearRampToValueAtTime): (WebCore::AudioParamTimeline::exponentialRampToValueAtTime): * Modules/webaudio/AudioParamTimeline.h: 2020-09-09 Andres Gonzalez <andresg_22@apple.com> AccessibilityMenuList and MenuListPopup notifications need to be posted asynchronously. https://bugs.webkit.org/show_bug.cgi?id=216309 <rdar://problem/68108824> Reviewed by Chris Fleizach. MenuList notifications were posted synchronously which triggers a DOM layout and style update in the middle of an ongoing DOM mutation update. This is unnecessary and, furthermore, causes crashes since the DOM layout update cannot be re-entrant. This change makes these notifications asynchronous. * accessibility/AccessibilityMenuList.cpp: (WebCore::AccessibilityMenuList::didUpdateActiveOption): * accessibility/AccessibilityMenuListPopup.cpp: (WebCore::AccessibilityMenuListPopup::didUpdateActiveOption): 2020-09-09 Zalan Bujtas <zalan@apple.com> [LFC][IFC] LineBuilder::rebuildLine should just re-initialize the current line https://bugs.webkit.org/show_bug.cgi?id=216260 Reviewed by Antti Koivisto. Now that LineBuilder manages the Line, it can properly reset it when we need it clean for the "rebuild" case. This patch also makes "line closing" more explicit by calling collapse trailing content + apply run expansion separately. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::open): (WebCore::Layout::Line::moveLogicalLeft): (WebCore::Layout::Line::moveLogicalRight): (WebCore::Layout::Line::clearContent): Deleted. (WebCore::Layout::Line::availableWidth const): (WebCore::Layout::Line::lineLogicalWidth const): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::layoutInlineContent): (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): (WebCore::Layout::LineBuilder::rebuildLine): * layout/inlineformatting/InlineLineBuilder.h: 2020-09-04 Sergio Villar Senin <svillar@igalia.com> [WebXR] Implement XRSession end event https://bugs.webkit.org/show_bug.cgi?id=216181 Reviewed by Darin Adler. Implemented the end event dispatched by the XRSession whenever the shutdown process is executed. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::shutdown): Added end event dispatch. * Modules/webxr/XRSessionEvent.cpp: (WebCore::XRSessionEvent::create): New method receiving a XRSession. (WebCore::XRSessionEvent::XRSessionEvent): New constructor receiving a XRSession. (WebCore::XRSessionEvent::eventInterface const): New. Overrides the Event method. * Modules/webxr/XRSessionEvent.h: Ditto. 2020-09-09 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Line should not know about floats https://bugs.webkit.org/show_bug.cgi?id=216278 Reviewed by Antti Koivisto. Floats are not part of the line (they only constrain the horizontal space). * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::setHasIntrusiveFloat): Deleted. (WebCore::Layout::Line::hasIntrusiveFloat const): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::layoutInlineContent): (WebCore::Layout::LineBuilder::initialize): (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::commitFloats): (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): * layout/inlineformatting/InlineLineBuilder.h: 2020-09-09 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Line::lineLogicalWidth is really the horizontal constraint value https://bugs.webkit.org/show_bug.cgi?id=216277 Reviewed by Antti Koivisto. * layout/inlineformatting/InlineLine.cpp: (WebCore::Layout::Line::open): (WebCore::Layout::Line::moveLogicalLeft): (WebCore::Layout::Line::moveLogicalRight): * layout/inlineformatting/InlineLine.h: (WebCore::Layout::Line::horizontalConstraint const): (WebCore::Layout::Line::availableWidth const): (WebCore::Layout::Line::lineLogicalWidth const): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::layoutInlineContent): 2020-09-09 Aditya Keerthi <akeerthi@apple.com> [macOS] Add editability to input type=time https://bugs.webkit.org/show_bug.cgi?id=216188 Reviewed by Devin Rousso. This patch adds editability to input type=time by leveraging existing logic to add editable components to date/time inputs. DateTime{Hour|Minute|Second|Millisecond|Meridiem}FieldElements were created to represent the new editable fields. By default, only the hour and minute fields are displayed. However, the millisecond and second fields may be added depending on the initial value of the element, or the value of the step attribute. Tests: fast/forms/time/time-editable-components/time-editable-components-focus-and-blur-events.html fast/forms/time/time-editable-components/time-editable-components-keyboard-events.html fast/forms/time/time-editable-components/time-editable-components-mouse-events.html fast/forms/time/time-editable-components/time-editable-components-second-and-millisecond-field.html * css/html.css: Update stylesheet to handle hour, minute, second, millisecond and meridiem fields. (input::-webkit-datetime-edit-fields-wrapper): (input::-webkit-datetime-edit-year-field,): (input::-webkit-datetime-edit-year-field:focus,): (input[disabled]::-webkit-datetime-edit-year-field,): * html/BaseChooserOnlyDateAndTimeInputType.cpp: (WebCore::DateTimeFormatValidator::visitField): (WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue): (WebCore::BaseChooserOnlyDateAndTimeInputType::attributeChanged): The step attribute can determine whether the second and/or millisecond fields are displayed. Consequently, we should update the fields in m_dateTimeEditElement when the step attribute is changed. * html/BaseChooserOnlyDateAndTimeInputType.h: setupLayoutParameters() now takes an additional DateComponents argument. This argument is needed to determine whether the second and/or millisecond field is displayed. * html/BaseDateAndTimeInputType.h: * html/DateInputType.cpp: (WebCore::DateInputType::setupLayoutParameters const): * html/DateInputType.h: * html/DateTimeFieldsState.h: * html/DateTimeLocalInputType.cpp: (WebCore::DateTimeLocalInputType::setupLayoutParameters const): * html/DateTimeLocalInputType.h: * html/MonthInputType.cpp: (WebCore::MonthInputType::setupLayoutParameters const): * html/MonthInputType.h: * html/TimeInputType.cpp: (WebCore::TimeInputType::isValidFormat const): (WebCore::TimeInputType::formatDateTimeFieldsState const): (WebCore::TimeInputType::setupLayoutParameters const): The millisecond field is displayed if the date has a non-zero value for milliseconds, or if the step attribute has sub-second precision. The second field is displayed if the millisecond field is displayed, if the date has a non-zero value for seconds, or if the step attribute has sub-minute precision. * html/TimeInputType.h: * html/WeekInputType.cpp: (WebCore::WeekInputType::setupLayoutParameters const): * html/WeekInputType.h: * html/shadow/DateTimeEditElement.cpp: (WebCore::DateTimeEditBuilder::visitField): Updated to add new field types to the element. * html/shadow/DateTimeEditElement.h: * html/shadow/DateTimeFieldElements.cpp: (WebCore::DateTimeHourFieldElement::DateTimeHourFieldElement): (WebCore::DateTimeHourFieldElement::create): (WebCore::DateTimeHourFieldElement::populateDateTimeFieldsState): (WebCore::DateTimeHourFieldElement::setValueAsDate): (WebCore::DateTimeMeridiemFieldElement::DateTimeMeridiemFieldElement): (WebCore::DateTimeMeridiemFieldElement::create): (WebCore::DateTimeMeridiemFieldElement::populateDateTimeFieldsState): (WebCore::DateTimeMeridiemFieldElement::setValueAsDate): (WebCore::DateTimeMillisecondFieldElement::DateTimeMillisecondFieldElement): (WebCore::DateTimeMillisecondFieldElement::create): (WebCore::DateTimeMillisecondFieldElement::populateDateTimeFieldsState): (WebCore::DateTimeMillisecondFieldElement::setValueAsDate): (WebCore::DateTimeMinuteFieldElement::DateTimeMinuteFieldElement): (WebCore::DateTimeMinuteFieldElement::create): (WebCore::DateTimeMinuteFieldElement::populateDateTimeFieldsState): (WebCore::DateTimeMinuteFieldElement::setValueAsDate): (WebCore::DateTimeSecondFieldElement::DateTimeSecondFieldElement): (WebCore::DateTimeSecondFieldElement::create): (WebCore::DateTimeSecondFieldElement::populateDateTimeFieldsState): (WebCore::DateTimeSecondFieldElement::setValueAsDate): * html/shadow/DateTimeFieldElements.h: * html/shadow/DateTimeNumericFieldElement.cpp: (WebCore::DateTimeNumericFieldElement::maximum const): * html/shadow/DateTimeNumericFieldElement.h: * html/shadow/DateTimeSymbolicFieldElement.cpp: (WebCore::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement): (WebCore::DateTimeSymbolicFieldElement::handleKeyboardEvent): Implement editing using the same typeahead behavior as <select> elements. (WebCore::DateTimeSymbolicFieldElement::indexOfSelectedOption const): (WebCore::DateTimeSymbolicFieldElement::optionCount const): (WebCore::DateTimeSymbolicFieldElement::optionAtIndex const): * html/shadow/DateTimeSymbolicFieldElement.h: * platform/text/PlatformLocale.cpp: (WebCore::Locale::localizedDecimalSeparator): Added method to ensure the correct decimal separator is displayed depending on the user's locale. This separator is used when the millisecond field is present. * platform/text/PlatformLocale.h: 2020-09-08 Ryosuke Niwa <rniwa@webkit.org> Node flags should be an OptionSet https://bugs.webkit.org/show_bug.cgi?id=216305 Reviewed by Antti Koivisto. This patch renames NodeFlags to NodeFlag and turns into an enum class and changes the type of m_nodeFlags from uint32_t to OptionSet<NodeFlag> as there is no state stored there after r266769. This patch also introduces two new NodeFlag for identifying CharacterData and DocumentFragment to simplify the type check conditions for these nodes now that we have plenty of free bits. No new tests since there should be no behavioral change. * dom/CharacterData.h: (WebCore::CharacterData::CharacterData): Sets NodeFlag::IsContainerNode via CreateCharacterData. (WebCore::CharacterData::virtualIsCharacterData): Deleted. * dom/Comment.cpp: (WebCore::Comment::Comment): Ditto. * dom/Element.cpp: (WebCore::Element::setHasFocusWithin): (WebCore::Element::removedFromAncestor): (WebCore::Element::setContainsFullScreenElement): (WebCore::Element::createElementIdentifier): * dom/Element.h: (WebCore::Element::hasFocusWithin const): (WebCore::Element::hasPendingResources const): (WebCore::Element::setHasPendingResources): (WebCore::Element::clearHasPendingResources): (WebCore::Element::hasCSSAnimation const): (WebCore::Element::setHasCSSAnimation): (WebCore::Element::clearHasCSSAnimation): (WebCore::Element::containsFullScreenElement const): * dom/Node.cpp: (WebCore::Node::insertedIntoAncestor): (WebCore::Node::removedFromAncestor): * dom/Node.h: (WebCore::Node::isElementNode const): (WebCore::Node::isContainerNode const): (WebCore::Node::isTextNode const): (WebCore::Node::isHTMLElement const): (WebCore::Node::isSVGElement const): (WebCore::Node::isMathMLElement const): (WebCore::Node::isStyledElement const): (WebCore::Node::isCharacterDataNode const): Check the newly added NodeFlag::IsContainerNode. (WebCore::Node::isDocumentNode const): (WebCore::Node::isTreeScope const): (WebCore::Node::isDocumentFragment const):: Check the newly added NodeFlag::IsDocumentFragment. (WebCore::Node::isShadowRoot const): (WebCore::Node::hasCustomStyleResolveCallbacks const): (WebCore::Node::hasSyntheticAttrChildNodes const): (WebCore::Node::setHasSyntheticAttrChildNodes): (WebCore::Node::selfOrAncestorHasDirAutoAttribute const): (WebCore::Node::setSelfOrAncestorHasDirAutoAttribute): (WebCore::Node::isUserActionElement const): (WebCore::Node::setUserActionElement): (WebCore::Node::isEditingText const): Removed the check for IsTextFlag since this is no longer needed after r266769 as no longer share the bit for IsEditingText with an unknown custom element. (WebCore::Node::isLink const): (WebCore::Node::setIsLink): (WebCore::Node::hasEventTargetData const): (WebCore::Node::setHasEventTargetData): (WebCore::Node::isConnected const): (WebCore::Node::isInShadowTree const): (WebCore::Node::isInTreeScope const): (WebCore::Node::flagIsText): (WebCore::Node::flagIsContainer): (WebCore::Node::flagIsElement): (WebCore::Node::flagIsShadowRoot): (WebCore::Node::flagIsHTML): (WebCore::Node::flagIsLink): (WebCore::Node::flagHasFocusWithin): (WebCore::Node::flagIsParsingChildrenFinished): (WebCore::Node::NodeFlag): Renamed from NodeFlags and made it an enum class, and introduced IsCharacterData and IsDocumentFragment and removed "Flag" suffix from various flags. (WebCore::Node::hasNodeFlag const): Renamed from getFlag for clarity. (WebCore::Node::setNodeFlag const): Ditto from setFlag. Also merge the two versions of setFlag one of which took a boolean arugment as the first argument by making this a second optional argument. (WebCore::Node::clearNodeFlag const): Ditto. (WebCore::Node::isParsingChildrenFinished const): (WebCore::Node::setIsParsingChildrenFinished): (WebCore::Node::clearIsParsingChildrenFinished): (WebCore::Node::ConstructionType): This is now an alias to OptionSet<NodeFlag> instead of a separate enum. (WebCore::Node::setHasCustomStyleResolveCallbacks): (WebCore::Node::virtualIsCharacterData const): Deleted. * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::ProcessingInstruction): Sets NodeFlag::IsContainerNode via CharacterData's constructor's default argument value. 2020-09-08 Ryosuke Niwa <rniwa@webkit.org> Having an iframe as a descendent node shouldn't require ElementRareData https://bugs.webkit.org/show_bug.cgi?id=216264 Reviewed by Darin Adler. Store the number of connected frames in the descendent nodes directly in Node using CompactUniquePtrTuple in the same space as where we store the NodeRareData pointer. This avoids creating ElementRareData on every ancestor element and shadow host / document of an iframe. Also moved TabIndexState there to simply NodeFlags, and created CustomElementState to replace the existing flags in NodeFlags to match the latest terminology used in the specification: https://dom.spec.whatwg.org/#concept-element-custom-element-state CustomElementState has four states: "uncustomized" (default; builtin elements), "undefined" (i.e. element has a valid custom element but it hasn't been defined or upgraded yet), "custom" (a valid custom element instance), and "failed" (upgrading has resulted in an error). Before this patch, "uncustomized" meant that neither IsCustomElement nor IsEditingTextOrUndefinedCustomElementFlag is set, "undefined" had IsCustomElement and IsEditingTextOrUndefinedCustomElementFlag set, and "custom" had IsCustomElement set but IsEditingTextOrUndefinedCustomElementFlag unset whereas "failed" had the opposite. No new tests since there should be no observable behavioral change. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild): Mask out the bits stored in the pointer in the 64-bit architecture. In the 32-bit architecture, the pointer is the first component without any extra bits stored in it. * dom/Element.cpp: (WebCore::Node::setTabIndexState): Moved from Node.h. Updated to use the newly introduced bitfields. (WebCore::Node::setCustomElementState): Added. (WebCore::Element::setIsDefinedCustomElement): Now updates CustomElementState in the newly added bitfields. (WebCore::Element::setIsFailedCustomElementWithoutClearingReactionQueue): Ditto. (WebCore::Element::setIsCustomElementUpgradeCandidate): Ditto. * dom/ElementRareData.cpp: * dom/ElementRareData.h: (WebCore::ElementRareData): Moved m_unusualTabIndex and m_childIndex to NodeRareData for better packing. * dom/Node.cpp: (WebCore::Node::materializeRareData): (WebCore::Node::clearRareData): (WebCore::Node::connectedSubframeCount const): Moved to the header file. (WebCore::Node::incrementConnectedSubframeCount): Now updates the newly added bitfields. (WebCore::Node::decrementConnectedSubframeCount): Ditto. * dom/Node.h: (WebCore::Node::isUndefinedCustomElement const): Now uses CustomElementState in the newly added bitfields. (WebCore::Node::isCustomElementUpgradeCandidate const): Ditto. (WebCore::Node::isDefinedCustomElement const): Ditto. (WebCore::Node::isFailedCustomElement const): Ditto. (WebCore::Node::isEditingText const): (WebCore::Node::connectedSubframeCount const): Moved here from cpp file. (WebCore::Node::rareDataMemoryOffset): (WebCore::Node::rareDataPointerMask): Added. (WebCore::Node::CustomElementState): Added. (WebCore::Node::RareDataBitFields): Added. (WebCore::Node::rareDataBitfields const): Added. (WebCore::Node::setRareDataBitfields): Added. (WebCore::Node::tabIndexState const): Updated to use rareDataBitfields. (WebCore::Node::setTabIndexState): Moved to Element.cpp. (WebCore::Node::customElementState const): Added. (WebCore::Node::hasRareData const): (WebCore::Node::rareData const): * dom/NodeRareData.cpp: * dom/NodeRareData.h: (WebCore::NodeRareData::UseType): Removed ConnectedFrameCount. (WebCore::NodeRareData::NodeRareData): (WebCore::NodeRareData::useTypes const): (WebCore::NodeRareData::connectedSubframeCount const): Deleted. (WebCore::NodeRareData::incrementConnectedSubframeCount): Deleted. (WebCore::NodeRareData::decrementConnectedSubframeCount): Deleted. (WebCore::NodeRareData): Moved m_unusualTabIndex and m_childIndex here for better packing in 64-bit architecture. 2020-09-08 Tim Horton <timothy_horton@apple.com> WebCore UnifiedSource81 builds for upwards of 10 minutes https://bugs.webkit.org/show_bug.cgi?id=216297 Reviewed by Simon Fraser. * bindings/js/WebCoreBuiltinNames.h: (WebCore::WebCoreBuiltinNames::WebCoreBuiltinNames): Work around an LLVM regression by disabling debugging in the WebCoreBuiltinNames constructor. This is tracked by <rdar://68246686>. This drops the WebCore release build time on my iMac Pro from 14 minutes to 6. 2020-09-08 Chris Dumez <cdumez@apple.com> Drop non-standard name / units attributes from AudioParam https://bugs.webkit.org/show_bug.cgi?id=216290 Reviewed by Geoffrey Garen. Drop non-standard name / units attributes from AudioParam: - https://www.w3.org/TR/webaudio/#AudioParam Blink does not have them either. Test: webaudio/audioparam-obsolete-api.html * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParam.idl: 2020-09-08 Chris Dumez <cdumez@apple.com> Drop unnecessary AudioParam::m_smoothingConstant data member https://bugs.webkit.org/show_bug.cgi?id=216291 Reviewed by Geoffrey Garen. Drop unnecessary AudioParam::m_smoothingConstant data member. This constant is never changed. No new tests, no web-facing behavior change. * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::AudioParam): (WebCore::AudioParam::smooth): * Modules/webaudio/AudioParam.h: 2020-09-08 Sam Weinig <weinig@apple.com> [WebIDL] Add support for partial interface mixins https://bugs.webkit.org/show_bug.cgi?id=216255 Reviewed by Darin Adler. Add support for WebIDL 'partial interface mixins' and adopt them for a few supplements of the DocumentOrShadowRoot mixin. * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * dom/DocumentOrShadowRoot.idl: * css/DocumentOrShadowRootStyleSheets.idl: Added. * dom/DocumentOrShadowRootPointerLock.idl: Added. * Modules/pictureinpicture/DocumentOrShadowRootPictureInPicture.idl: Added. * animation/DocumentOrShadowRootAnimations.idl: Added. Add new split-out IDLs. * bindings/scripts/CodeGenerator.pm: (GenerateEmptyHeaderAndCpp): Move empty file generation here (from generate-bindings.pl), allowing for a simplified compilation model, where all IDLs given to generate-bindings.pl now instantiate the CodeGenerator and it is the CodeGenerators job to figure out if the file needs anything generated. This allows the dependencies file to get out of the business of indicating that an IDL doesn't need generation, and stick to just listing dependencies. This is important now that dependencies like interface mixins can now have depencies of their own, partial interface mixins. (ProcessInterfaces): (ProcessDictionaries): Move logic to avoid generation of mixins and partials here. (ProcessInterfaceSupplementalDependencies): Support recursively processing supplemental dependencies for partial interface mixins. Ensure that we don't evaluate exposure when doing this, as that should only happen on the final interface. (shouldPropertyBeExposed): Move all logic for exposure here, rather than splitting it up between here and ProcessInterfaceSupplementalDependencies/ProcessDictionarySupplementalDependencies * bindings/scripts/generate-bindings.pl: (generateBindings): (generateEmptyHeaderAndCpp): Deleted. Remove support for unused additionalIdlFiles option and simplify things by having CodeGenerator work out whether it should generate an empty set of files based on the files themselves rather than inferring it from the dependency information. * bindings/scripts/preprocess-idls.pl: (getPartialNamesFromIDL): Add support for properly parsing partial interface mixins and stop disallowing dependencies, like a mixin interface, from having its own dependences. * bindings/scripts/test/JS/JSTestConditionalIncludes.cpp: * bindings/scripts/test/JS/JSTestConditionalIncludes.h: * bindings/scripts/test/JS/JSTestIncludes.cpp: Removed. * bindings/scripts/test/JS/JSTestIncludes.h: Removed. * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestInterface.h: * bindings/scripts/test/JS/JSTestMixinInterface.cpp: Added. * bindings/scripts/test/JS/JSTestMixinInterface.h: Added. * bindings/scripts/test/JS/JSTestPartialMixinInterface.cpp: Added. * bindings/scripts/test/JS/JSTestPartialMixinInterface.h: Added. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestConditionalIncludes.idl: * bindings/scripts/test/TestIncludes.idl: Removed. * bindings/scripts/test/TestInterface.idl: * bindings/scripts/test/TestMixinInterface.idl: Added. * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestPartialMixinInterface.idl: Added. Rename TestIncludes to TestMixinInterface (since that is what it is testing) and add TestPartialMixinInterface to test partial interface mixins. 2020-09-08 Peng Liu <peng.liu6@apple.com> Web process crashes at WebCore::HTMLMediaElement::prepareForVideoFullscreenStandby https://bugs.webkit.org/show_bug.cgi?id=216283 Reviewed by Alex Christensen. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::prepareForVideoFullscreenStandby): 2020-09-08 Lauro Moura <lmoura@igalia.com> REGRESSION(r266681) [GTK] constexpr build failure in LTS/Debian with GCC 8 https://bugs.webkit.org/show_bug.cgi?id=216280 Reviewed by Darin Adler and Alex Christensen. * platform/text/TextCodecSingleByte.cpp: (WebCore::tableForDecoding): 2020-09-08 Alex Christensen <achristensen@webkit.org> new URL("#") should throw an error https://bugs.webkit.org/show_bug.cgi?id=216115 Reviewed by Yusuke Suzuki and Darin Adler. This aligns the DOM URL object with the specification and Firefox. Covered by adding to fast/dom/DOMURL/url-constructor.html. * html/DOMURL.cpp: (WebCore::DOMURL::create): * html/DOMURL.h: 2020-09-08 Chris Dumez <cdumez@apple.com> Fix precision issues in AudioParamTimeline when event times are very close https://bugs.webkit.org/show_bug.cgi?id=216279 Reviewed by Darin Adler. Fix precision issues in AudioParamTimeline when event times are very close. To achieve this, AudioParamTimeline::valuesForTimeRange() now uses frames for the range instead of time. frames have the benefit of being more exact. This change is based on audio_param_timeline.cc from Blink: - https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc No new tests, rebaselined existing test. * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::calculateTimelineValues): * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valueForContextTime): (WebCore::AudioParamTimeline::valuesForTimeRange): (WebCore::AudioParamTimeline::valuesForTimeRangeImpl): (WebCore::AudioParamTimeline::isEventCurrent const): * Modules/webaudio/AudioParamTimeline.h: 2020-09-08 Youenn Fablet <youenn@apple.com> Tighten checks when creating an audio buffer list https://bugs.webkit.org/show_bug.cgi?id=216237 <rdar://problem/68271376> Reviewed by Geoffrey Garen. Add a routine to check there is no multiplication integer overflow. * platform/audio/cocoa/WebAudioBufferList.cpp: (WebCore::computeBufferSize): (WebCore::WebAudioBufferList::isSupportedDescription): (WebCore::WebAudioBufferList::setSampleCount): * platform/audio/cocoa/WebAudioBufferList.h: 2020-09-08 Tim Horton <timothy_horton@apple.com> iOS: <attachment>'s QuickLook thumbnails can appear squished https://bugs.webkit.org/show_bug.cgi?id=216209 <rdar://problem/67817706> Reviewed by Wenson Hsieh. Test: fast/attachment/attachment-thumbnail-preserves-aspect-ratio.html * html/HTMLAttachmentElement.idl: * testing/Internals.cpp: (WebCore::Internals::attachmentThumbnailInfo): * testing/Internals.h: * testing/Internals.idl: Expose the attachment thumbnail size via Internals. * rendering/RenderThemeIOS.mm: (WebCore::RenderAttachmentInfo::RenderAttachmentInfo): Allow the thumbnail aspect ratio to vary, instead of assuming it is always square. 2020-09-08 Sihui Liu <sihui_liu@apple.com> Remove storage WorkQueue in NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=216199 Reviewed by Youenn Fablet. Move origin fetching code from NetworkProcess to IDBServer. * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::collectOriginsForVersion const): (WebCore::IDBServer::IDBServer::getOrigins const): * Modules/indexeddb/server/IDBServer.h: 2020-09-08 Frank Yang <guowei_yang@apple.com> CoreImage Implementation of CSS Filters invert(), opacity(), brightness(), contrast() https://bugs.webkit.org/show_bug.cgi?id=215956 Reviewed by Darin Adler. Adding CoreImage support for 4 more CSS filters, invert, opacity, brightness, contrast, which all uses FEComponentTransfer and the linear transfer function. Partially implemented FEComponentTransfer to support linear function type so that the 4 CSS filters work properly Tests: css3/filters/effect-brightness-square.html css3/filters/effect-contrast-square.html css3/filters/effect-invert-square.html css3/filters/effect-opacity-square.html * platform/graphics/coreimage/FilterEffectRendererCoreImage.h: * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm: (WebCore::FilterEffectRendererCoreImage::isNullOrLinearComponentTransferFunction): currently CoreImage can only render FEComponentTransfer filters if the transfer funtion is only linear. A FEComponentTransfer filter using only linear function would have it's red, green, blue, alpha functions types either be linear or null. (WebCore::FilterEffectRendererCoreImage::supportsCoreImageRendering): currently CoreImage can only render FEComponentTransfer filters if the transfer funtion is only linear. (WebCore::FilterEffectRendererCoreImage::connectCIFilters): now returns image for FEComponentTransfer (WebCore::FilterEffectRendererCoreImage::imageForFEComponentTransfer): function that uses CIFilters to render FEComponentTransfer. * platform/graphics/filters/FEComponentTransfer.h: (isType): added SPECIALIZE_TYPE_TRAITS so that we can downcast to FEComponentTransfer 2020-09-08 Aditya Keerthi <akeerthi@apple.com> [macOS] Date/time inputs should preserve focus on value change https://bugs.webkit.org/show_bug.cgi?id=216272 Reviewed by Wenson Hsieh. When the value of a date/time input is changed programmatically, the inner elements of the input are rebuilt. Removing an inner element that is focused results in the document's activeElement being nulled out, and the date/time input loses focus. To fix this issue, check to see whether the input has a focused field prior to rebuilding. If there is a focused field, make an attempt to focus the new field with the matching pseudo identifier. This ensures that the focused field is preserved. If no matching identifier is found, focus the first field to ensure the date/time input retains focus. The second case can occur when the new value has different fields than the old value, for example the presence/lack of a millisecond field in a time input. Test: fast/forms/date/date-preserve-focus-value-change.html * html/shadow/DateTimeEditElement.cpp: (WebCore::DateTimeEditElement::focusedFieldElement const): (WebCore::DateTimeEditElement::layout): * html/shadow/DateTimeEditElement.h: 2020-09-08 Megan Gardner <megan_gardner@apple.com> Switch from deprecated secondarySelectedControlColor to unemphasizedSelectedContentBackgroundColor. https://bugs.webkit.org/show_bug.cgi?id=216207 Reviewed by Darin Adler. No behavior change. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const): (WebCore::RenderThemeMac::systemColor const): 2020-09-08 Alex Christensen <achristensen@webkit.org> Derive big5, jis0208 and jis0212 tables from ICU https://bugs.webkit.org/show_bug.cgi?id=216253 Reviewed by Darin Adler. This substantially reduces the size of WebCore's binary data without changing behavior. The EUC-KR table has so many differences from ICU it isn't worth the extraction. Verified by many assertions and web platform tests. * platform/text/EncodingTables.cpp: (WebCore::jis0208): (WebCore::jis0212): (WebCore::big5): (WebCore::eucKR): (WebCore::checkEncodingTableInvariants): * platform/text/EncodingTables.h: (WebCore::stableSortByFirst): (WebCore::findLastInSortedPairs): Deleted. * platform/text/TextCodecCJK.cpp: (WebCore::jis0208EncodeIndex): (WebCore::codePointJIS0208): (WebCore::codePointJIS0212): (WebCore::eucJPEncode): (WebCore::iso2022JPEncode): (WebCore::shiftJISEncode): (WebCore::eucKREncodingIndex): (WebCore::TextCodecCJK::eucKRDecode): (WebCore::big5EncodeIndex): (WebCore::big5Encode): (WebCore::TextCodecCJK::big5Decode): (WebCore::jis0208DecodeIndex): Deleted. (WebCore::big5DecodeIndex): Deleted. 2020-09-08 Peng Liu <peng.liu6@apple.com> Clean up functions and state variables related to the picture-in-picture implementation https://bugs.webkit.org/show_bug.cgi?id=215972 Reviewed by Jer Noble. This patch cleans up variables and functions related to changing video presentation mode in HTMLVideoElement and HTMLMediaElement. It cleans up some event-related code as well. This patch also simplifies the process of entering the picture-in-picture mode. The XPC message VideoFullscreenManagerProxy::DidEnterFullscreen from the UI process will provide the picture-in-picture window size if the video is entering picture-in-picture, so that we can get rid of the intermediate state (waiting for the initial picture-in-picture window frame). With this patch, all presentation mode change requests need to go through the HTMLVideoElement. Normally, video presentation mode change requests come from the web process where a page calls the fullscreen/picture-in-picture API or a user interacts with the modern media controls. However, through gestures, the UI process may request to change the presentation mode (e.g., from fullscreen to picture-in-picture). The web process side will be like a dry run because the tasks in the UI process are mostly completed before the web process receives the request. The motivation to do that is to guarantee correct events are fired. All scenarios sharing the same code path also help us avoid regressions because we don't have a good way to create regression tests for the scenarios where presentation mode change requests come from the UI process. Covered by existing tests. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::dispatchEvent): (WebCore::HTMLMediaElement::enterFullscreen): (WebCore::HTMLMediaElement::exitFullscreen): (WebCore::HTMLMediaElement::setVideoFullscreenStandby): (WebCore::HTMLMediaElement::willBecomeFullscreenElement): Simplify the implementation. (WebCore::HTMLMediaElement::willStopBeingFullscreenElement): (WebCore::HTMLMediaElement::isVideoLayerInline): (WebCore::HTMLMediaElement::setVideoFullscreenFrame): (WebCore::HTMLMediaElement::setFullscreenMode): Delete function HTMLVideoElement::fullscreenModeChanged() and move its code to this function. (WebCore::HTMLMediaElement::fullscreenModeChanged): Deleted. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::fullscreenMode const): Replace fullscreenModeChanged() with a private function setFullscreenMode(). Change "void setVideoFullscreenFrame(FloatRect)" to "void setVideoFullscreenFrame(const FloatRect&)". * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): (WebCore::HTMLVideoElement::toPresentationMode): (WebCore::HTMLVideoElement::webkitSetPresentationMode): (WebCore::HTMLVideoElement::setPresentationMode): (WebCore::HTMLVideoElement::didEnterFullscreenOrPictureInPicture): (WebCore::HTMLVideoElement::didExitFullscreenOrPictureInPicture): (WebCore::HTMLVideoElement::didBecomeFullscreenElement): (WebCore::HTMLVideoElement::setVideoFullscreenFrame): (WebCore::toPresentationMode): Deleted. (WebCore::HTMLVideoElement::setFullscreenMode): Deleted. (WebCore::HTMLVideoElement::fullscreenModeChanged): Deleted. (WebCore::HTMLVideoElement::didStopBeingFullscreenElement): Deleted. * html/HTMLVideoElement.h: Only HTMLVIdeoElement::setPresentationMode() can be used by other modules (PlaybackSessionManager or VideoFullscreenManager) to change the video presentation mode. This patch defines different callbacks regarding the fullscreen mode change transition for FullscreenManager and VideoFullscreenManager. - didBecomeFullscreenElement for FullscreenManager. - didEnterFullscreenOrPictureInPicture and didExitFullscreenOrPictureInPicture for VideoFullscreenManager. This patch removes m_isWaitingForPictureInPictureWindowFrame and renames m_isChangingPresentationMode to m_isChangingVideoFullscreenMode. * platform/cocoa/PlaybackSessionModelMediaElement.mm: (WebCore::PlaybackSessionModelMediaElement::togglePictureInPicture): * platform/cocoa/VideoFullscreenChangeObserver.h: * platform/cocoa/VideoFullscreenModelVideoElement.mm: (WebCore::VideoFullscreenModelVideoElement::requestFullscreenMode): (WebCore::VideoFullscreenModelVideoElement::fullscreenModeChanged): (WebCore::VideoFullscreenModelVideoElement::setHasVideo): (WebCore::VideoFullscreenModelVideoElement::setVideoDimensions): (WebCore::VideoFullscreenModelVideoElement::willEnterPictureInPicture): (WebCore::VideoFullscreenModelVideoElement::didEnterPictureInPicture): (WebCore::VideoFullscreenModelVideoElement::failedToEnterPictureInPicture): (WebCore::VideoFullscreenModelVideoElement::willExitPictureInPicture): (WebCore::VideoFullscreenModelVideoElement::didExitPictureInPicture): Iterate a copy of the HashSet of VideoFullscreenModelClient pointers because a callback may remove the client itself during the iteration. * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerLayer calculateTargetVideoFrame]): (-[WebAVPlayerLayer layoutSublayers]): (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView): (VideoFullscreenInterfaceAVKit::cleanupFullscreen): (VideoFullscreenInterfaceAVKit::didStartPictureInPicture): (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture): (VideoFullscreenInterfaceAVKit::doSetup): (VideoFullscreenInterfaceAVKit::doEnterFullscreen): (VideoFullscreenInterfaceAVKit::willEnterStandbyFromPictureInPicture): Deleted. (VideoFullscreenInterfaceAVKit::setWillEnterStandbyFromPictureInPicture): Deleted. Add a property isPictureInPicture to WebAVPlayerLayer, which will set to YES if a layer is created for picture-in-picture. This property is used in -[WebAVPlayerLayer layoutSublayers] to skip the unnecessary calculation of "targetVideoFrame" because the PiP window will always have the same aspect ratio as the video content, so we can set "targetVideoFrame" to be the bounds of the layer. Moreover, the calculation may lead to rounding errors for some numbers and the errors may trigger unnecessary picture-in-picture window resize events. * platform/ios/WebVideoFullscreenControllerAVKit.mm: This file has been moved to WebCore so we don't need to include WebCore headers in a way like "#include <WebCore/XXX.h>". * platform/mac/VideoFullscreenInterfaceMac.mm: (-[WebVideoFullscreenInterfaceMacObjC enterPIP]): (-[WebVideoFullscreenInterfaceMacObjC boundsDidChangeForVideoViewContainer:]): (WebCore::VideoFullscreenInterfaceMac::enterFullscreen): Add PIPState::EnteringPIP. Notify the observer that the video has entered picture-in-picture after the PiP window size is finalized. 2020-09-08 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Remove redundant FormattingContext::Quirks::lineDescentNeedsCollapsing https://bugs.webkit.org/show_bug.cgi?id=216259 Reviewed by Antti Koivisto. This function is not needed anymore. InlineBoxes start collapsed by default and they get stretched when they gain content (and the root inline box has no imaginary strut in non-standard mode). * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const): Deleted. 2020-09-08 Víctor Manuel Jáquez Leal <vjaquez@igalia.com> [GStreamer] Follow-up of "Convert custom GObject subclasses to WEBKIT_DEFINE_TYPE" https://bugs.webkit.org/show_bug.cgi?id=204673 <rdar://problem/68455348> Reviewed by Carlos Garcia Campos. This a continuation of 204673 since a post-merge review came up: it was also needed to remove g_type_class_add_private() calls. No new tests needed. * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (_WebKitWebAudioSrcPrivate::_WebKitWebAudioSrcPrivate): (webkit_web_audio_src_class_init): * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: (webkit_video_sink_class_init): * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (webkit_media_clear_key_decrypt_class_init): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkit_media_common_encryption_decrypt_class_init): * platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp: (webkit_media_thunder_decrypt_class_init): 2020-09-08 Rob Buis <rbuis@igalia.com> Fix crash in image-loading-lazy-slow.html WPT test https://bugs.webkit.org/show_bug.cgi?id=215998 Reviewed by Youenn Fablet. When setting images to an empty src, make sure to reset any lazy image load information. * html/LazyLoadImageObserver.h: * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): (WebCore::ImageLoader::elementDidMoveToNewDocument): (WebCore::ImageLoader::resetLazyImageLoading): * loader/ImageLoader.h: (WebCore::ImageLoader::isDeferred const): 2020-09-08 Antti Koivisto <antti@apple.com> Comparing styles with large but identical custom property maps is slow https://bugs.webkit.org/show_bug.cgi?id=216241 <rdar://problem/67946605> Reviewed by Darin Adler. In a full style rebuild we lose sharing of equal StyleCustomPropertyDatas between the old and the new style. Custom properties are usually defined in document element and this lack of sharing inherits to all elements. Without sharing equality comparisons end up requiring deep comparisons, which can be slow if there are thousands of properties. Fix by deduplicating identical property maps between the old the new style. All the descendants that inherit the properties will now be cheap to compare. The patch also contains some other basic custom property optimizations. Going to full screen and back on youtube, this patch reduces time in the longest style update from ~460ms to ~90ms. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::equals const): Check for pointer equality first. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::deduplicateInheritedCustomProperties): Deduplicate if the properties are equal but not shared. (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): Check if the value is already in the map before triggering copy-on-write. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setInheritedCustomPropertyValue): Deleted. (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): Deleted. * style/StyleBuilder.cpp: (WebCore::Style::Builder::applyCustomProperty): Don't create unnecesary copies of CSSCustomPropertyValue. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): Try to deduplicate before comparing the styles. 2020-09-07 Sergio Villar Senin <svillar@igalia.com> [css-flex] Don't skip flexboxes with auto height for percentage computations in quirks mode https://bugs.webkit.org/show_bug.cgi?id=216249 Reviewed by Darin Adler. We shouldn't skip flexboxes with height:auto when going up the ancestor chain as we do with other types as grid. Apart from that, we force flexible box to follow strict mode even when document is in quirks mode as flexbox was invented way after quirky browsers. This matches Chromium, Edge (pre-Chromium) and Firefox behaviour. * rendering/RenderBox.cpp: (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation const): Don't skip flexboxes. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight const): Ignore quirks mode for flexboxes. 2020-09-07 Ryosuke Niwa <rniwa@webkit.org> Move all remaining flags from ElementRareData to Node to reduce the frequency https://bugs.webkit.org/show_bug.cgi?id=216208 Reviewed by Darin Adler. This patch moves all remaining bit flags from ElementRareData to Node::m_nodeFlags. It also stores tabIndex of 0 and -1 in Node::m_nodeFlags to avoid creating ElementRareData for these common values. No new tests since there should be no behavioral change. * dom/Element.cpp: (WebCore::Element::clearTabIndexExplicitlyIfNeeded): Deleted. Merged into setTabIndexExplicitly. (WebCore::Element::setTabIndexExplicitly): Now takes Optional<int>. Stores 0 and -1 as node flags. (WebCore::Element::tabIndexSetExplicitly const): Added the special casing for 0 and -1. (WebCore::Element::removedFromAncestor): (WebCore::Element::containsFullScreenElement const): Deleted. (WebCore::Element::setContainsFullScreenElement): (WebCore::Element::hasPendingResources const): Deleted. (WebCore::Element::setHasPendingResources): Deleted. (WebCore::Element::clearHasPendingResources): Deleted. (WebCore::Element::hasCSSAnimation const): Deleted. (WebCore::Element::setHasCSSAnimation): Deleted. (WebCore::Element::clearHasCSSAnimation): Deleted. (WebCore::Element::createElementIdentifier): * dom/Element.h: (WebCore::Element::hasPendingResources const): Moved here from Element.cpp. (WebCore::Element::setHasPendingResources): Ditto. (WebCore::Element::clearHasPendingResources): Ditto. (WebCore::Element::hasCSSAnimation const): Ditto. (WebCore::Element::setHasCSSAnimation): Ditto. (WebCore::Element::clearHasCSSAnimation): Ditto. (WebCore::Element::containsFullScreenElement const): Ditto. * dom/ElementRareData.cpp: * dom/ElementRareData.h: (WebCore::ElementRareData::tabIndex const): Deleted. (WebCore::ElementRareData::setTabIndexExplicitly): Deleted. (WebCore::ElementRareData::tabIndexSetExplicitly const): Deleted. (WebCore::ElementRareData::clearTabIndexExplicitly): Deleted. (WebCore::ElementRareData::containsFullScreenElement): Deleted. (WebCore::ElementRareData::setContainsFullScreenElement): Deleted. (WebCore::ElementRareData::hasPendingResources const): Deleted. (WebCore::ElementRareData::setHasPendingResources): Deleted. (WebCore::ElementRareData::hasCSSAnimation const): Deleted. (WebCore::ElementRareData::setHasCSSAnimation): Deleted. (WebCore::ElementRareData::hasElementIdentifier const): Deleted. (WebCore::ElementRareData::setHasElementIdentifier): Deleted. (WebCore::ElementRareData::useTypes const): Added the missing use types for style maps, part list, and part names. (WebCore::ElementRareData::ElementRareData): (WebCore::ElementRareData::unusualTabIndex const): Renamed from tabIndex. (WebCore::ElementRareData::setUnusualTabIndex): Ditto from setTabIndexExplicitly. * dom/Node.cpp: (WebCore::stringForRareDataUseType): Added the missing strings. * dom/Node.h: (WebCore::Node::NodeFlags): Moved bit flags from ElementRareData and reserved the two highest bits to store TabIndexState. (WebCore::Node::s_tabIndexStateBitOffset): Added. (WebCore::Node::s_tabIndexStateBitMask): Added. (WebCore::Node::TabIndexState): Added. (WebCore::Node::tabIndexState const): Added. (WebCore::Node::setTabIndexState): Added. * dom/NodeRareData.h: (WebCore::NodeRareData::UseType): Added the missing use types: style maps, part list, and part names. * html/HTMLElement.cpp: (WebCore::HTMLElement::parseAttribute): * mathml/MathMLElement.cpp: (WebCore::MathMLElement::parseAttribute): * svg/SVGElement.cpp: (WebCore::SVGElement::parseAttribute): 2020-09-07 Chris Dumez <cdumez@apple.com> AudioParam.cancelAndHoldAtTime() is missing https://bugs.webkit.org/show_bug.cgi?id=215947 <rdar://problem/68362061> Reviewed by Darin Adler. Add implementation for AudioParam.cancelAndHoldAtTime(): - https://www.w3.org/TR/webaudio/#dom-audioparam-cancelandholdattime This patch is based on the following Blink commit by Raymond Toy: - https://codereview.chromium.org/1533103002 Tests: webaudio/audioparam-cancel-and-hold.html webaudio/cancel-values-crash-913217.html * Modules/webaudio/AudioParam.cpp: * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParam.idl: * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::setValueAtTime): (WebCore::AudioParamTimeline::linearRampToValueAtTime): (WebCore::AudioParamTimeline::exponentialRampToValueAtTime): (WebCore::AudioParamTimeline::setTargetAtTime): (WebCore::AudioParamTimeline::setValueCurveAtTime): (WebCore::AudioParamTimeline::insertEvent): (WebCore::AudioParamTimeline::cancelAndHoldAtTime): (WebCore::AudioParamTimeline::removeCancelledEvents): (WebCore::AudioParamTimeline::valueForContextTime): (WebCore::AudioParamTimeline::valuesForTimeRangeImpl): (WebCore::AudioParamTimeline::linearRampAtTime): (WebCore::AudioParamTimeline::exponentialRampAtTime): (WebCore::AudioParamTimeline::valueCurveAtTime): (WebCore::AudioParamTimeline::handleCancelValues): * Modules/webaudio/AudioParamTimeline.h: (WebCore::AudioParamTimeline::ParamEvent::createSetValueEvent): (WebCore::AudioParamTimeline::ParamEvent::createLinearRampEvent): (WebCore::AudioParamTimeline::ParamEvent::createExponentialRampEvent): (WebCore::AudioParamTimeline::ParamEvent::createSetTargetEvent): (WebCore::AudioParamTimeline::ParamEvent::createSetValueCurveEvent): (WebCore::AudioParamTimeline::ParamEvent::createCancelValuesEvent): (WebCore::AudioParamTimeline::ParamEvent::ParamEvent): (WebCore::AudioParamTimeline::ParamEvent::type const): (WebCore::AudioParamTimeline::ParamEvent::savedEvent): (WebCore::AudioParamTimeline::ParamEvent::setCancelledValue): (WebCore::AudioParamTimeline::ParamEvent::hasDefaultCancelledValue const): (WebCore::AudioParamTimeline::ParamEvent::curvePointsPerSecond const): (WebCore::AudioParamTimeline::ParamEvent::curveEndValue const): 2020-09-07 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r266645. https://bugs.webkit.org/show_bug.cgi?id=216251 Caused MotionMark regression Reverted changeset: "Move lazy DisplayLink tear down logic from the WebProcess to the UIProcess" https://bugs.webkit.org/show_bug.cgi?id=216195 https://trac.webkit.org/changeset/266645 2020-09-07 Sam Weinig <weinig@apple.com> [WebIDL] Fix issues found by preprocess-idls.pl parser validation and enabled parser validation by default for the tests https://bugs.webkit.org/show_bug.cgi?id=216246 Reviewed by Darin Adler. Enabling preprocess-idls.pl's validation parser for run-bindings-tests revealed a few issues that this change fixes: - Includes statements (as well as any other non-extended attribute related statement) in a comment were being treated as being part of the document. Fixed this by moving the existing c/c++ style comment removal from getInterfaceExtendedAttributesFromIDL to processIDL so it is run for all IDLs. Since getInterfaceExtendedAttributesFromIDL was called for most files anyway, this doesn't measurably change the performance. - Some test IDLs did not have their primary interface name matching the name of the IDL file. This resulted in a number of tests not actually producing any output. Updated the tests themselves to match name. To ensure we don't regress here, the validation parser is now always enabled when running the tests, and preprocess-idls.pl has been updated to be a little less noisy when running with the validation parser enabled (unless you specify --verbose) so that the test output is not disturbed. * bindings/scripts/preprocess-idls.pl: (processIDL): (getPartialNamesFromIDL): (getIncludedInterfacesFromIDL): (isCallbackInterfaceFromIDL): (isMixinInterfaceFromIDL): (containsIterableInterfaceFromIDL): (containsInterfaceOrCallbackInterfaceFromIDL): (containsInterfaceWithConstantsFromIDL): (getInterfaceExtendedAttributesFromIDL): (getUndefinedBaseDictionariesFromIDL): * bindings/scripts/test/JS/JSTestDomainSecurity.cpp: Added. * bindings/scripts/test/JS/JSTestDomainSecurity.h: Added. * bindings/scripts/test/JS/JSTestMapLike.cpp: Added. * bindings/scripts/test/JS/JSTestMapLike.h: Added. * bindings/scripts/test/JS/JSTestReadOnlyMapLike.cpp: Added. * bindings/scripts/test/JS/JSTestReadOnlyMapLike.h: Added. * bindings/scripts/test/JS/JSTestReadOnlySetLike.cpp: Added. * bindings/scripts/test/JS/JSTestReadOnlySetLike.h: Added. * bindings/scripts/test/JS/JSTestReportExtraMemoryCost.cpp: Added. * bindings/scripts/test/JS/JSTestReportExtraMemoryCost.h: Added. * bindings/scripts/test/JS/JSTestSetLike.cpp: Added. * bindings/scripts/test/JS/JSTestSetLike.h: Added. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestDomainSecurity.idl: * bindings/scripts/test/TestMapLike.idl: * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestReadOnlyMapLike.idl: * bindings/scripts/test/TestReadOnlySetLike.idl: * bindings/scripts/test/TestReportExtraMemoryCost.idl: * bindings/scripts/test/TestSetLike.idl: 2020-09-07 Youenn Fablet <youenn@apple.com> Fix https://trac.webkit.org/changeset/266508 as per post-commit comments https://bugs.webkit.org/show_bug.cgi?id=216242 Reviewed by Alex Christensen. No change of behavior. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::toRTCRtpCapabilities): 2020-09-07 Sam Weinig <weinig@apple.com> [WebIDL] Support extended attributes on includes statements to allow for conditionalized inclusion https://bugs.webkit.org/show_bug.cgi?id=216235 Reviewed by Darin Adler. In some circumstancs, such as with the AnimationFrameProvider interface mixin, it is useful to only include a mixin based on some conditional. For AnimationFrameProvider, we currently only want to include it in DedicatedWorkerGlobalScope if ENABLE(OFFSCREEN_CANVAS) is set at compile time, and the runtime feature flag offscreenCanvasEnabled() is turned on. To support that, this change adds support for specifying extended attributes on the includes statement itself, and having those extended attributes applied to each member of the mixin. For AnimationFrameProvider in DedicatedWorkerGlobalScope, that looks like: [Conditional=OFFSCREEN_CANVAS, EnabledAtRuntime=OffscreenCanvas] DedicatedWorkerGlobalScope includes AnimationFrameProvider; * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: Add new files, update xcfilelists. * animation/AnimationFrameProvider.idl: Added. * page/DOMWindow.idl: * workers/DedicatedWorkerGlobalScope.idl: Split AnimationFrameProvider.idl out into its own mixin (as specified) and included it in both DOMWindow and DedicatedWorkerGlobalScope (conditionally). * bindings/scripts/CodeGenerator.pm: (ProcessDocument): (ProcessDictionaryAndEnumerationImplementedAsOverrides): (ProcessInterfaces): (ProcessCallbackFunctions): (ProcessDictionaries): (ProcessEnumerations): Split processing of each different type of top level type into its own function, and defer processing of supplemental dependencies until the primary type has been selected. (MergeExtendedAttributesFromSupplemental): (IsValidSupplementalInterface): (IsValidSupplementalDictionary): (ProcessInterfaceSupplementalDependencies): (ProcessDictionarySupplementalDependencies): Split ProcessSupplementalDependencies into ProcessInterfaceSupplementalDependencies and ProcessDictionarySupplementalDependencies, which now get passed the primary interface or dictionary that needs supplementing. ProcessInterfaceSupplementalDependencies now also supports merging extended attributes from includes statements and checking that all includes are listed in the dependency set. * bindings/scripts/IDLAttributes.json: Allow setting use of Conditional, EnabledAtRuntime and EnabledBySetting for includes statements. * bindings/scripts/IDLParser.pm: (parseIncludesStatement): Fix ordering of struct members so that extendedAttributes is always last (no real good reason other than most of the structs already did this and the lack of consistency bothered me). Add extendedAttributes to IDLIncludesStatement and set it when parsing. * bindings/scripts/preprocess-idls.pl: (getIncludedInterfacesFromIDL): Fix bug in regex (found easily by the validation parser!) that incorrectly required the interface name in the includes statement to be the first word on a line. * bindings/scripts/test/BindingTestGlobalConstructors.idl: * bindings/scripts/test/JS/JSTestConditionalIncludes.cpp: Added. * bindings/scripts/test/JS/JSTestConditionalIncludes.h: Added. * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestConditionalIncludes.idl: Added. * bindings/scripts/test/TestIncludes.idl: Add tests for extended attributes on includes statements. 2020-09-07 Alex Christensen <achristensen@webkit.org> Add memory cache with/without validation to logResourceResponseSource https://bugs.webkit.org/show_bug.cgi?id=216244 <rdar://problem/64184239> Reviewed by Darin Adler. * loader/ResourceLoader.cpp: (WebCore::logResourceResponseSource): * page/DiagnosticLoggingKeys.cpp: (WebCore::DiagnosticLoggingKeys::memoryCacheKey): (WebCore::DiagnosticLoggingKeys::memoryCacheAfterValidationKey): * page/DiagnosticLoggingKeys.h: 2020-09-06 Darin Adler <darin@apple.com> Make TextCodecCJK and TextCodecSingleByte thread-safe and refactor a bit to share code https://bugs.webkit.org/show_bug.cgi?id=216229 Reviewed by Sam Weinig. The text encoding machinery is usable on multiple threads, but our new TextCodec classes have some global data structures that need to be guarded to keep that intact. * platform/text/EncodingTables.cpp: (WebCore::checkEncodingTableInvariants): One-time check for invariants that clients of these tables depend on. * platform/text/EncodingTables.h: Added checkEncodingTableInvariants. Also Added function templates for encoding tables: Added findFirstInSortedPairs, findLastInSortedPairs and findInSortedPairs for searching a sorted array of pairs used as a map. Added sortByFirst to aid in the creation of such a sorted array. And added isSortedByFirst and sortedFirstsAreUnique so we can assert those invariants. One of the good features of the findInSortedPairs functions is that they handle integer values that don't fit in an integral key type, returning WTF::nullopt in that case. That lets us pass code point values when looking in tables that use code units as their key, without separately checking if they are in range, which otherwise requires converting to UChar and checking for equality or calling U_IS_BMP. * platform/text/TextCodecCJK.cpp: (WebCore::TextCodecCJK::TextCodecCJK): Call checkEncodingTableInvariants. (WebCore::TextCodecCJK::encode const): Ditto. (WebCore::jis0208DecodeIndex): Use std::call_once for thread safety. Use sortByFirst and sortedFirstsAreUnique. (WebCore::codePointJIS0208): Use findFirstInSortedPairs. (WebCore::codePointJIS0212): Ditto. (WebCore::TextCodecCJK::eucJPDecode): Cast to char instad of LChar when adding an ASCII character to a StringBuilder. (WebCore::eucJPEncode): Use the name codePoint instead of c to match other surrounding code. Use findLastInSortedPairs. (WebCore::iso2022JPEncode): Removed some unneeded casts to uint8_t when appending bytes to a Vector. Added a static_assert to check the size of iso2022JPKatakana. Use findLastInSortedPairs. (WebCore::shiftJISEncode): Use findInSortedPairs. (WebCore::eucKREncodingIndex): Use std::call_once for thread safety. Use sortByFirst and sortedFirstsAreUnique. (WebCore::eucKREncode): Removed some unneeded casts to uint8_t when appending bytes to a Vector. Use findFirstInSortedPairs. (WebCore::TextCodecCJK::eucKRDecode): Use findFirstInSortedPairs. (WebCore::big5Encode): Use findInSortedPairs. Also renamed c to codePoint. (WebCore::big5DecodeIndex): Use std::call_once for thread safety. Use sortByFirst and sortedFirstsAreUnique. (WebCore::TextCodecCJK::big5Decode): Use findFirstInSortedPairs. Cast to char instad of LChar when adding an ASCII character to a StringBuilder. * platform/text/TextCodecSingleByte.cpp: (WebCore::tableForEncoding): Return an IteratorRange instead of a pair of pointer and size. This works with std::begin/end. Also make table with actual encoded bytes, by adding 0x80 here, rather than doing that when using the table. (WebCore::encode): Use std::call_once for thread safety. Use sortByFirst and sortedFirstsAreUnique. The code before was not sorting at all, which means it probably didn't work in any cases where the code units happen to not be in ascending order. We should add some test cases. (WebCore::decode): Use findFirstInSortedPairs. Also use StringView::codePoints because these are likely to be 8-bit strings and we don't need to temporarily upconvert them to 16-bit just to encode them. Should probably later measure if the use of StringView::upconvertedCharacters plus CodePointIterator<UChar> instead of StringView::codePoints is better for performance in the CJK encoding functions. This approach means more branching inside the loop, but the other version involves memory allocation and a second loop when the characters are all 8-bit. 2020-09-07 Youenn Fablet <youenn@apple.com> Fix Internals::supportsVCPEncoder on BigSur https://bugs.webkit.org/show_bug.cgi?id=216174 Reviewed by Eric Carlson. Fixed by unflaked test. * testing/Internals.cpp: (WebCore::Internals::supportsVCPEncoder): All MacOS supported versions now supports VCP. 2020-09-07 Youenn Fablet <youenn@apple.com> Update IDLAttributes.json to forbid Exposed on dictionary https://bugs.webkit.org/show_bug.cgi?id=216243 Reviewed by Alex Christensen. * bindings/scripts/IDLAttributes.json: 2020-09-07 Youenn Fablet <youenn@apple.com> Safari takes too long to fetch images from memory cache https://bugs.webkit.org/show_bug.cgi?id=216048 <rdar://problem/68260952> Reviewed by Antti Koivisto. In case of image resource, we skip revalidation if the stored image is from the same document. This is inline with https://html.spec.whatwg.org/#updating-the-image-data:list-of-available-images which defines a list of available images for each Document. In case fetch mode is different, we do not skip revalidation as we might otherwise bypass security checks. Tests: http/wpt/html/dom/elements/images/bypass-cache-redirection-revalidation.html http/wpt/html/dom/elements/images/hover-image-change.html imported/w3c/web-platform-tests/html/dom/elements/images/bypass-cache-revalidation.html * loader/cache/CachedImage.cpp: (WebCore::CachedImage::load): (WebCore::CachedImage::canSkipRevalidation const): * loader/cache/CachedImage.h: * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::determineRevalidationPolicy const): 2020-09-07 Youenn Fablet <youenn@apple.com> Add missing members to RTCIceCandidate https://bugs.webkit.org/show_bug.cgi?id=216075 Reviewed by Eric Carlson. Sync IDL with latest spec. Add missing enums and make use of libwebrtc parse routine to get fields from candidate SDP. Covered by updated tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/mediastream/RTCIceCandidate.cpp: (WebCore::RTCIceCandidate::RTCIceCandidate): (WebCore::RTCIceCandidate::create): * Modules/mediastream/RTCIceCandidate.h: * Modules/mediastream/RTCIceCandidate.idl: * Modules/mediastream/RTCIceCandidateInit.h: * Modules/mediastream/RTCIceCandidateInit.idl: * Modules/mediastream/RTCIceCandidateType.h: Added. * Modules/mediastream/RTCIceCandidateType.idl: Added. * Modules/mediastream/RTCIceComponent.h: Added. * Modules/mediastream/RTCIceComponent.idl: Added. * Modules/mediastream/RTCIceProtocol.h: Added. * Modules/mediastream/RTCIceProtocol.idl: Added. * Modules/mediastream/RTCIceTcpCandidateType.h: Added. * Modules/mediastream/RTCIceTcpCandidateType.idl: Added. * Modules/mediastream/RTCStatsReport.h: * Modules/mediastream/RTCStatsReport.idl: * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::iceCandidateState): (WebCore::fillRTCIceCandidateStats): * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::toRTCIceComponent): (WebCore::toRTCIceProtocol): (WebCore::toRTCIceTcpCandidateType): (WebCore::toRTCIceCandidateType): (WebCore::parseIceCandidateSDP): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * testing/MockLibWebRTCPeerConnection.cpp: (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::sendCandidates): 2020-09-07 Víctor Manuel Jáquez Leal <vjaquez@igalia.com> [GStreamer] Convert custom GObject subclasses to WEBKIT_DEFINE_TYPE https://bugs.webkit.org/show_bug.cgi?id=204673 Reviewed by Philippe Normand. Instead of using G_DEFINE_TYPE macro use rather WEBKIT_DEFINE_TYPE since it handles private structures. No new tests since no functional changes. * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: Renamed the private structure to match with class name so it can be autogeneterated by the macro. (_WebKitWebAudioSrcPrivate::_WebKitWebAudioSrcPrivate): add constructure. (_WebKitWebAudioSrcPrivate::~_WebKitWebAudioSrcPrivate): add destructor. (webkit_web_audio_src_class_init): remove duplicated initialization. (webKitWebAudioSrcConstructed): add constructed vmethod to initalize some private members. (webKitWebAudioSrcSetProperty): renamed private structure. (webKitWebAudioSrcGetProperty): ditto. (webKitWebAudioSrcAllocateBuffersAndRenderAudio): ditto. (webKitWebAudioSrcLoop): ditto. * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: (webkitVideoSinkConstructed): add constructed vmethod to initalize some private members. (webkit_video_sink_class_init): remove duplicated initialization. * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (webkit_media_clear_key_decrypt_class_init): remove duplicated initialization. * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkit_media_common_encryption_decrypt_class_init): remove duplicated initialization. (constructed): add constructed vmethod to initalize some private members. * platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp: (webkit_media_thunder_decrypt_class_init): remove duplicated initialization. 2020-09-07 Sergio Villar Senin <svillar@igalia.com> [css-flex] Allow indefinite size flex items to be definite wrt resolving percentages inside them https://bugs.webkit.org/show_bug.cgi?id=212264 Reviewed by Manuel Rego Casasnovas. Implement https://github.com/w3c/csswg-drafts/commit/5b5db39d21f3658ae2f4d7992daaf822aca178d8 which modified the way percentages were resolved in flexible items with indefinite sizes. From now on we can pretend that they're really definite. This allows us to mark 3 tests which were testing percentages in flex items as correct. Based on Blink's crrev.com/1247184 by <cbiesinger@chromium.org> This is a reland of r263399 which got reverted due to bug 214655. This same patch was previously relanded in r262124 which got reverted due to the bug fixed in r263389. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): Do only check flex container main size definiteness when computing the main size for percentage resolution, no need to check flex basis at all. 2020-09-02 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] min-height: auto not applied to nested flexboxes. https://bugs.webkit.org/show_bug.cgi?id=210089 Reviewed by Daniel Bates. Nested flexboxes with column direction were not computing correctly min-size:auto because we were explicitly preventing them from doing so in the code. Implemented the required bits to make it work correctly and thus removed the retriction. The idea is to set an indefinite override containing block size so that percentages would be resolved to auto as spec'ed. The code which decides whether to apply min-size:auto was refactored in the shouldApplyMinSizeAutoForChild() method. In order not to cause regressions some other two additional changes were also implemented. First we had to adjust childHasIntrinsicMainAxisSize() so that it also takes into account the cases where shouldApplyMinSizeAutoForChild() is true and return true. Secondly we had to add an additional case to mainAxisLengthIsDefinite() so that it returns false for column flows where the flexBasis is intrinsic. Inspired by Blink's crrev.com/c/1641510, crrev.com/c/1269995 & crrev.com/c/1786297 by <cbiesinger@chromium.org> * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::shouldApplyMinSizeAutoForChild const): Refactored from RenderFlexibleBox::adjustChildSizeForMinAndMax. (WebCore::RenderFlexibleBox::mainAxisLengthIsDefinite const): Additional case for column flows. (WebCore::RenderFlexibleBox::layoutFlexItems): Reset m_hasDefiniteHeight to Unknown after calling constructFlexItem() because the latter might set now an override containing block height which basically potentially makes any cached size value incorrect. (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax): Directly call shouldApplyMinSizeAutoForChild(). (WebCore::RenderFlexibleBox::constructFlexItem): Set an indefinite override containing block size for children with percentage sizes so that they're resolved as auto. (WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize const): Return true for those cases where the main axis length is indefinite and also when shouldApplyMinSizeAutoForChild(). * rendering/RenderFlexibleBox.h: 2020-09-06 Myles C. Maxfield <mmaxfield@apple.com> [iOS] attachmentActionFont() Needs to use kCTFontSymbolicTrait: @(kCTFontTraitTightLeading | kCTFontTraitEmphasized) to get the short emphasized footnote font https://bugs.webkit.org/show_bug.cgi?id=215707 <rdar://problem/63930892> Reviewed by Darin Adler. This is the correct way to get the short emphasized footnote font. * rendering/RenderThemeIOS.mm: (WebCore::attachmentActionFont): 2020-09-06 Myles C. Maxfield <mmaxfield@apple.com> [Cocoa] Prepare for migrating to CTFontHasTable() once it's faster than CTFontCopyAvailableTables() https://bugs.webkit.org/show_bug.cgi?id=215688 Reviewed by Darin Adler. We can directly ask Core Text for the information we're looking for. No new tests because there is no behavior change. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontType::FontType): * platform/graphics/cocoa/FontCocoa.mm: (WebCore::fontHasVerticalGlyphs): * platform/graphics/opentype/OpenTypeCG.cpp: (WebCore::OpenType::fontHasMathTable): 2020-09-06 Wenson Hsieh <wenson_hsieh@apple.com> Make `WebCore::WritingMode` an 8-bit enum class https://bugs.webkit.org/show_bug.cgi?id=216233 Reviewed by Darin Adler. Narrow WebCore::WritingMode to an 8-bit enum class; no change in behavior. * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator WritingMode const): * css/CSSProperty.cpp: (WebCore::resolveToPhysicalProperty): * dom/Element.cpp: (WebCore::toScrollAlignmentForInlineDirection): (WebCore::toScrollAlignmentForBlockDirection): * page/FrameView.cpp: (WebCore::paginationModeForRenderStyle): * platform/text/WritingMode.h: * rendering/GridBaselineAlignment.cpp: (WebCore::BaselineGroup::isOppositeBlockFlow const): (WebCore::BaselineGroup::isOrthogonalBlockFlow const): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::adjustBorderBoxRectForPainting): (WebCore::RenderBlock::paintRectToClipOutFromBorder): (WebCore::RenderBlock::borderTop const): (WebCore::RenderBlock::borderLeft const): (WebCore::RenderBlock::borderBottom const): (WebCore::RenderBlock::borderRight const): * rendering/RenderBox.cpp: (WebCore::shouldFlipBeforeAfterMargins): (WebCore::RenderBox::visualOverflowRectForPropagation const): (WebCore::RenderBox::layoutOverflowRectForPropagation const): * rendering/RenderDetailsMarker.cpp: (WebCore::RenderDetailsMarker::orientation const): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::isLeftToRightFlow const): (WebCore::RenderFlexibleBox::transformedWritingMode const): (WebCore::RenderFlexibleBox::flowAwareBorderBefore const): (WebCore::RenderFlexibleBox::flowAwareBorderAfter const): (WebCore::RenderFlexibleBox::flowAwarePaddingBefore const): (WebCore::RenderFlexibleBox::flowAwarePaddingAfter const): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild const): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::paddingTop const): (WebCore::RenderTableCell::paddingBottom const): (WebCore::RenderTableCell::paddingLeft const): (WebCore::RenderTableCell::paddingRight const): * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::canUseForStyle): * rendering/shapes/ShapeOutsideInfo.cpp: (WebCore::borderBeforeInWritingMode): (WebCore::borderAndPaddingBeforeInWritingMode): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::RenderStyle): (WebCore::RenderStyle::borderBefore const): (WebCore::RenderStyle::borderAfter const): (WebCore::RenderStyle::borderBeforeWidth const): (WebCore::RenderStyle::borderAfterWidth const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialWritingMode): (WebCore::RenderStyle::setWritingMode): * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::adjust const): * style/StyleBuilderState.cpp: (WebCore::Style::BuilderState::adjustStyleForInterCharacterRuby): 2020-09-06 Myles C. Maxfield <mmaxfield@apple.com> CTFontGetPhysicalSymbolicTraits() is faster than CTFontCopyPhysicalFont()/CTFontGetSymbolicTraits() https://bugs.webkit.org/show_bug.cgi?id=215685 Reviewed by Darin Adler. Instead of making the two calls, we can make a single call that has the same effect. No new tests because there is no behavior change. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::computeNecessarySynthesis): (WebCore::FontCache::systemFallbackForCharacters): * platform/graphics/cocoa/FontCacheCoreText.h: * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp: (WebCore::FontFamilySpecificationCoreText::fontRanges const): 2020-09-06 Wenson Hsieh <wenson_hsieh@apple.com> [MotionMark - Multiply] Web process spends ~1% of total samples in PropertyCascade::resolveDirectionAndWritingMode https://bugs.webkit.org/show_bug.cgi?id=216223 Reviewed by Darin Adler. A few subtests in MotionMark (Leaves, Focus, Design, and especially Multiply) spend large amounts of time in style resolution (`Document::resolveStyle`) due to constant style changes across many elements during every frame. In Multiply, ~3-4% of the time underneath `Document::resolveStyle` is spent resolving direction and writing modes inside `PropertyCascade::resolveDirectionAndWritingMode` (i.e., ~2.3 million invocations). This helper function is responsible for computing the text direction and CSS writing mode that is used to resolve direction-aware CSS properties (which are enumerated in `CSSProperty::isDirectionAwareProperty`). Resolving the direction and writing mode involves iterating over all of the matched CSS properties (`m_matchResult`) in the property cascade in search of CSS properties for writing and direction, which can be relatively expensive when there are lots of properties in the cascade. However, if there are no direction-aware CSS properties in the cascade, this work can actually be elided; to achieve this, we can store the inherited `Direction` in `m_direction`, and then lazily resolve it if needed. I measured this locally to yield a little under ~1% in the Multiply subtest in MotionMark. Otherwise, there is no change in behavior; see below for more details. * style/PropertyCascade.cpp: (WebCore::Style::PropertyCascade::PropertyCascade): (WebCore::Style::PropertyCascade::set): If we encounter a direction-aware CSS property, then use `direction()` to ensure that the direction and writing mode are resolved. (WebCore::Style::PropertyCascade::direction const): Make this getter call `resolveDirectionAndWritingMode` if needed. * style/PropertyCascade.h: Add a new `bool` member to keep track of whether or not the CSS direction has not yet been resolved. Note that since this member variable fits within the padding after `Direction m_direction;`, this class is still the same size. (WebCore::Style::PropertyCascade::direction const): Deleted. 2020-09-06 Myles C. Maxfield <mmaxfield@apple.com> Make GlyphBufferAdvance and GlyphBufferOrigin more robust https://bugs.webkit.org/show_bug.cgi?id=215143 Reviewed by Zalan Bujtas. GlyphBuffer contains vectors of advances and origins, which are conceptually FloatSizes and FloatPoints. However, we need to pass these arrays into CTFontShapeGlyphs() or CTFontTransformGlyphsWithLanguage(), which expects these vectors to use platform types. Rather than converting in/out of platform types around the call site, we can simply use the platform types throughout. Indeed, that's what we're doing today. However, the mechanism we use today to make this platform-independent is to make a struct which inherits from the platform types. Then, we static_cast the array of the struct to an array of the base type. This is brittle, because it relies on the assumption that the struct doesn't have any members added to it, which would change the stride of the array and feed garbage into the shaping function. Instead, a better design is to typedef the native type, and have all interactions with the types go through standalone functions which deal with the native type. That way, we can't accidentally change the size of the array elements. No new tests because there is no behavior change. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/ComplexTextController.cpp: (WebCore::ComplexTextController::advance): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthForSimpleText const): (WebCore::FontCascade::layoutComplexText const): (WebCore::FontCascade::drawGlyphBuffer const): (WebCore::FontCascade::drawEmphasisMarks const): (WebCore::GlyphToPathTranslator::extents): (WebCore::GlyphToPathTranslator::advance): * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::add): (WebCore::GlyphBuffer::makeHole): (WebCore::GlyphBuffer::expandLastAdvance): (WebCore::GlyphBuffer::flatten): (WebCore::GlyphBufferAdvance::GlyphBufferAdvance): Deleted. (WebCore::GlyphBufferAdvance::operator FloatSize): Deleted. (WebCore::GlyphBufferAdvance::setWidth): Deleted. (WebCore::GlyphBufferAdvance::setHeight): Deleted. (WebCore::GlyphBufferAdvance::width const): Deleted. (WebCore::GlyphBufferAdvance::height const): Deleted. (WebCore::GlyphBufferAdvance::encode const): Deleted. (WebCore::GlyphBufferAdvance::decode): Deleted. (WebCore::GlyphBufferOrigin::GlyphBufferOrigin): Deleted. (WebCore::GlyphBufferOrigin::operator FloatPoint): Deleted. (WebCore::GlyphBufferOrigin::setX): Deleted. (WebCore::GlyphBufferOrigin::setY): Deleted. (WebCore::GlyphBufferOrigin::x const): Deleted. (WebCore::GlyphBufferOrigin::y const): Deleted. (WebCore::GlyphBufferOrigin::encode const): Deleted. (WebCore::GlyphBufferOrigin::decode): Deleted. (WebCore::toFloatSize): Deleted. * platform/graphics/GlyphBufferMembers.h: Added. (WebCore::createGlyphBufferAdvance): (WebCore::floatSizeFromGlyphBufferAdvance): (WebCore::setGlyphBufferAdvanceWidth): (WebCore::setGlyphBufferAdvanceHeight): (WebCore::glyphBufferAdvanceWidth): (WebCore::glyphBufferAdvanceHeight): (WebCore::createGlyphBufferOrigin): (WebCore::floatPointFromGlyphBufferOrigin): (WebCore::setGlyphBufferOriginX): (WebCore::setGlyphBufferOriginY): (WebCore::glyphBufferOriginX): (WebCore::glyphBufferOriginY): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::applyFontTransforms): (WebCore::WidthIterator::advanceInternal): (WebCore::WidthIterator::advanceOneCharacter): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawGlyphs::computeBounds): 2020-09-06 Sam Weinig <weinig@apple.com> [WebIDL] Add mode to preprocess-idls.pl to validate fast regex based scanner with the normal IDL parser https://bugs.webkit.org/show_bug.cgi?id=216231 Reviewed by Darin Adler. To aid tracking down mistakes in the fast regex based scanner in preprocess-idls.pl, this adds a validation mode to the script which checks the results against what the normal, much slower, IDL parser gets. In building it, it caught that we were not creating a dependency on RTCRtpCodingParameters.idl for dictionaries that derived from it because it was missing from DerivedSources.make/CMakeLists.txt, which would have manifested in confusing build errors in some cases. * CMakeLists.txt: * DerivedSources.make: * bindings/scripts/generate-bindings-all.pl: Add missing RTCRtpCodingParameters.idl and update invocation of preprocess-idls.pl to pass in idlAttributesFile, which the parser needs (it is not read when not validating). * bindings/scripts/test/SupplementalDependencies.dep: Updated to include missing dictionary dependencies. * bindings/scripts/preprocess-idls.pl: (GeneratePartialInterface): (processIDL): (getPartialNamesFromIDL): (getIncludedInterfacesFromIDL): (isCallbackInterfaceFromIDL): (isMixinInterfaceFromIDL): (containsIterableInterfaceFromIDL): (containsInterfaceOrCallbackInterfaceFromIDL): (containsInterfaceWithConstantsFromIDL): (getInterfaceExtendedAttributesFromIDL): (getUndefinedBaseDictionariesFromIDL): (shouldExposeInterface): (getFileContents): Deleted. (interfaceIsIterable): Deleted. (containsInterfaceFromIDL): Deleted. (interfaceHasConstantAttribute): Deleted. (updateDictionaryDependencies): Deleted. - Allow enabling a validation mode via the $validateAgainstParser variable which parses each IDL with the normal IDL parser and compares results. - Updates a bunch of naming to be more clear about which variables contain file names vs. file paths. - Renames functions to use more consistent naming. - Fixes bug in dictionary dependency analysis that silently ignored dependencies that weren't in the file list. 2020-09-06 Myles C. Maxfield <mmaxfield@apple.com> Remove all non-web-exposed uses of ENABLE(VARIATION_FONTS) https://bugs.webkit.org/show_bug.cgi?id=216211 Reviewed by Darin Adler. This is the first step toward enabling variation fonts on all ports. This patch compiles internal data structures on all ports, keeping care to not make any web-exposed changes. It also stops consulting with ENABLE(VARIATION_FONTS) on Cocoa platforms, since the flag is enabled on all Cocoa platforms and we've been shipping it for years. No new tests because there is no behavior change. * css/CSSFontVariationValue.cpp: * css/CSSFontVariationValue.h: * css/CSSValue.cpp: (WebCore::CSSValue::equals const): (WebCore::CSSValue::cssText const): (WebCore::CSSValue::destroy): * css/CSSValue.h: (WebCore::CSSValue::isFontFeatureValue const): (WebCore::CSSValue::isFontVariationValue const): * platform/graphics/FontCache.h: (WebCore::FontDescriptionKey::FontDescriptionKey): (WebCore::FontDescriptionKey::operator== const): (WebCore::FontDescriptionKey::computeHash const): * platform/graphics/FontCascadeDescription.cpp: * platform/graphics/FontDescription.h: (WebCore::FontDescription::setFeatureSettings): (WebCore::FontDescription::setVariationSettings): (WebCore::FontDescription::operator== const): (WebCore::FontDescription::encode const): (WebCore::FontDescription::decode): * platform/graphics/FontTaggedSettings.cpp: (WebCore::operator<<): * platform/graphics/FontTaggedSettings.h: (WebCore::FontVariationSettings::isEmpty const): Deleted. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::denormalizeVariationWidth): (WebCore::normalizeVariationWidth): (WebCore::preparePlatformFont): (WebCore::extractVariationBounds): (WebCore::variationCapabilitiesForFontDescriptor): * platform/graphics/mac/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::supportsFormat): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::setFontVariationSettings): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::fontVariationSettings const): * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertFontVariationSettings): * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyInheritFontFeatureSettings): (WebCore::Style::BuilderCustom::applyInheritFontVariationSettings): 2020-09-06 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Rename Display::LineBox to Display::Line https://bugs.webkit.org/show_bug.cgi?id=216232 Reviewed by Sam Weinig. Display::LineBox represent a line and not to be confused with Layout::LineBox which represents a collection of inline boxes. * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const): * layout/displaytree/DisplayInlineContent.h: (WebCore::Display::InlineContent::lineForRun const): (WebCore::Display::InlineContent::lineBoxForRun const): Deleted. * layout/displaytree/DisplayLine.h: Renamed from Source/WebCore/layout/displaytree/DisplayLineBox.h. (WebCore::Display::Line::rect const): (WebCore::Display::Line::scrollableOverflow const): (WebCore::Display::Line::inkOverflow const): (WebCore::Display::Line::left const): (WebCore::Display::Line::right const): (WebCore::Display::Line::top const): (WebCore::Display::Line::bottom const): (WebCore::Display::Line::width const): (WebCore::Display::Line::height const): (WebCore::Display::Line::baseline const): (WebCore::Display::Line::Line): (WebCore::Display::Line::moveVertically): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintInlineContent): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::createDisplayBoxesForLineContent): * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const): * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::shrinkDisplayInlineContent): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::constructInlineBoxes): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::contentLogicalHeight const): (WebCore::LayoutIntegration::LineLayout::lineCount const): (WebCore::LayoutIntegration::LineLayout::firstLineBaseline const): (WebCore::LayoutIntegration::LineLayout::lastLineBaseline const): (WebCore::LayoutIntegration::LineLayout::collectOverflow): (WebCore::LayoutIntegration::LineLayout::paint): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell): * rendering/line/LineLayoutTraversalDisplayRunPath.h: (WebCore::LineLayoutTraversal::DisplayRunPath::baseline const): (WebCore::LineLayoutTraversal::DisplayRunPath::line const): (WebCore::LineLayoutTraversal::DisplayRunPath::lineBox const): Deleted. 2020-09-06 Chris Dumez <cdumez@apple.com> ConvolverNode incorrectly outputs silence because m_reverb is null https://bugs.webkit.org/show_bug.cgi?id=216230 Reviewed by Darin Adler. ConvolverNode relies on m_reverb to to audio processing. m_reverb would get initialized when calling ConvolverNode::setBuffer(). However, setting the buffer would cause ConvolverNode::checkNumberOfChannelsForInput(), which could cause unitialize() and then initialize() to get called. The issue was that unitialize() would null out m_reverb and nothing would re-initialize it. No new tests, rebaselined existing tests. * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::initialize): Deleted. (WebCore::ConvolverNode::uninitialize): Deleted. * Modules/webaudio/ConvolverNode.h: 2020-09-06 Myles C. Maxfield <mmaxfield@apple.com> Letter-spacing should disable ligatures https://bugs.webkit.org/show_bug.cgi?id=176215 <rdar://problem/17044265> Reviewed by Antti Koivisto. The CSS Text spec[1] says: "When the effective spacing between two characters is not zero (due to either justification or a non-zero value of letter-spacing), user agents should not apply optional ligatures." The CSS Fonts spec[2] describes exactly how this is supposed to work: "Step 11. Feature settings determined by properties other than font-variant or font-feature-settings are applied. For example, setting a non-default value for the letter-spacing property disables optional ligatures." Disabling ligatures requires modifying font features, which means that the information about whether we should disable them or not needs to be inside the FontDescription. This patch adds a new bit, m_shouldDisableLigaturesForSpacing, to FontDescription. preparePlatformFont() reads this bit and disables ligatures appropriately. There's a bit of complexity here because the letter-spacing value itself lies inside the RenderStyle, but the derived bit lies inside the FontDescriptor, which is one reason why this patch migrates letter-spacing to use custom codegen functions. There's also a bit of complexity about dependencies which is explained in a comment in maybeUpdateFontForLetterSpacing(). [1] https://drafts.csswg.org/css-text-3/#letter-spacing-property [2] https://drafts.csswg.org/css-fonts-4/#feature-variation-precedence Test: imported/w3c/web-platform-tests/css/css-fonts/font-feature-resolution-001.html * css/CSSProperties.json: letter-spacing has to be high-priority because it affects font selection, but it has to be processed after zoom because its <length> value is sensitive to zoom. This adds a new keyword CSSProperties.json: sink-property which can let a property sink to the bottom of its priority bucket. * css/makeprop.pl: (addProperty): (sortByDescendingPriorityAndName): * platform/graphics/FontCache.h: (WebCore::FontDescriptionKey::makeFlagsKey): * platform/graphics/FontDescription.h: (WebCore::FontDescription::shouldDisableLigaturesForSpacing const): (WebCore::FontDescription::setShouldDisableLigaturesForSpacing): (WebCore::FontDescription::operator== const): (WebCore::FontDescription::encode const): (WebCore::FontDescription::decode): * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::preparePlatformFont): We can get into a situation where "liga" and "clig" don't match, which means whichever one is later clobbers whichever one is earlier when applied to AAT fonts. We need to make sure these values match so we don't get surprising results. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::setLetterSpacing): (WebCore::RenderStyle::setLetterSpacingWithoutUpdatingFontDescription): * rendering/style/RenderStyle.h: * style/StyleBuilderCustom.h: (WebCore::Style::applyLetterSpacing): (WebCore::Style::BuilderCustom::applyInheritLetterSpacing): (WebCore::Style::BuilderCustom::applyInitialLetterSpacing): (WebCore::Style::maybeUpdateFontForLetterSpacing): (WebCore::Style::BuilderCustom::applyValueLetterSpacing): (WebCore::Style::BuilderCustom::applyValueWebkitLocale): (WebCore::Style::BuilderCustom::applyInitialFontFamily): (WebCore::Style::BuilderCustom::applyInheritFontFamily): (WebCore::Style::BuilderCustom::applyValueFontFamily): (WebCore::Style::BuilderCustom::applyInitialFontSize): (WebCore::Style::BuilderCustom::applyInheritFontSize): (WebCore::Style::BuilderCustom::applyValueFontSize): * style/StyleBuilderState.h: 2020-09-06 Zalan Bujtas <zalan@apple.com> [LFC][IFC] LineBox should contain all inline boxes https://bugs.webkit.org/show_bug.cgi?id=216221 Reviewed by Antti Koivisto. In this patch we decouple the line box and the line. Previously the LineBox was pretty much representing the line. It was responsible for both placing the inline boxes and sizing the line and position itself based on line-height/half leading. Now the LineBox is only responsible for placing the inline boxes and sizing itself, it has no position geometry anymore neither does it compute the line height. The line size is computed later using the combination of line-height property/LineBox height/FontMetrics::lineSpacing/half leading. This geometry is preserved in Display::LineBox (this needs to be renamed to Display::Line). 1. LineBuilder places the runs on the line after each other (at this point they only have horizontal geometry). 2. LineBreaker tells when to stop. 3. We start constructing inline boxes for the runs (root inline box etc) and place them inside an LineBox. This is when horizontal and vertical alignment happen. 4. We use the fully sized LineBox to compute the line geometry. Note that the line's geometry does not necessarily match the LineBox width/height (see below). 5. We construct a Display::LineBox for the line and Display::Runs for the runs inside the inline boxes. LineBox: - fully contains all the inline boxes, both horizontally and vertically. - has only width and height geometry - height is not constrained by the line-height property - does not have the concept of overflow. Line: - contains the LineBox, but the LineBox can overflow the line, both horizontally and vertically. - has position relative to the root block container. Simple case. <div>font went crazy with line spacing</div> ___________________________________________ line | ^ | | | line spacing | | v | | -------------------------------------------|--------- LineBox || ^ | | || | line box height | | ||----v--------------------------------------|-------- | alignment baseline | -------------------------------------------|--------- | ^ | ^ | | line spacing | | |____________________v_______________________| scrollable overflow When glyphs in subsequent lines overflow: <div style="line-height: 5px; font-size: 20px;">line box overflows the line</div> ___________________________________________ LineBox | ^ | | | line box height | | | | -|--------------------------|-----------------|- Line | | ^ | | | | | | line height | | | -|-----v--------------------|-----------------|- | | | |--------------------------|-----------------| alignment baseline | | | |__________________________v_________________| * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::createDisplayBoxesForLineContent): 2020-09-06 Darin Adler <darin@apple.com> TextCodec refinements https://bugs.webkit.org/show_bug.cgi?id=216219 Reviewed by Sam Weinig. * dom/TextDecoder.cpp: (WebCore::TextDecoder::bytesNeededForFullBOMIgnoreCheck const): Deleted. (WebCore::TextDecoder::isBeginningOfIncompleteBOM const): Deleted. (WebCore::TextDecoder::ignoreBOMIfNecessary): Deleted. (WebCore::TextDecoder::decode): Call stripByteOrderMark on the TextCodec to tell it to ignore the BOM, once when creating the codec, and also after each non-streaming invocation. Removed the rest of the BOM handling. * dom/TextDecoder.h: Removed WaitForMoreBOMBytes, ignoreBOMIfNecessary, bytesNeededForFullBOMIgnoreCheck, isBeginningOfIncompleteBOM, m_buffer, m_bomIgnoredIfNecessary, and made m_options const. * platform/text/TextCodec.h: Added a virtual stripByteOrderMark function to be used before decoding; does nothing by default. Changed the encode function to be a const member function to help implementers remember to not have it save any state, unlike the decode function which should. * platform/text/TextCodecCJK.cpp: Moved the TextCodecCJK::Encoding enumeration in here. (WebCore::jis0208DecodeIndex): Use a named type and use std::size instead of WTF_ARRAY_LENGTH. (WebCore::codePointJIS0212): Ditto. (WebCore::iso2022JPEncode): Made this a non-member function and moved the encoding state in here since each call to encode is separate and we don't want to leave any state behind in the TextCodec between calls. (WebCore::eucKREncodingIndex): Use a refernece instead of a pointer and std::size instead of WTF_ARRAY_LENGTH. (WebCore::big5DecodeIndex): Ditto. (WebCore::TextCodecCJK::encode const): Made const. * platform/text/TextCodecCJK.h: Marked the class final, moved the enumeration values for Encoding, ISO2022JPEncoderState, and m_iso2022JPEncoderState out of the class definition. Made encode const. * platform/text/TextCodecICU.cpp: (WebCore::TextCodecICU::encode const): Made const. * platform/text/TextCodecICU.h: Marked the class final, and rearranged the class members to match other TextCodec classes, with register functions before the constructor and destructor. Made encode const. * platform/text/TextCodecLatin1.cpp: (WebCore::TextCodecLatin1::encode const): Made const. * platform/text/TextCodecLatin1.h: Removed a stray blank line and made encode const. * platform/text/TextCodecReplacement.cpp: (WebCore::TextCodecReplacement::encode const): Added. * platform/text/TextCodecReplacement.h: Marked the class final, changed it to no longer derive from TextCodecUTF8, and added an encode function. * platform/text/TextCodecSingleByte.cpp: Moved the TextCodecSingleByte::Encoding enumeration in here and changed from Iso to ISO. Added SingleByteDecodeTable type and moved TextCodecSingleByte::EncodeTable in here and renamed it to SingleByteEncodeTable so it's not a class member any more. Marked all the decode tables static since we don't get internal linkage from just marking them constexpr, while moving to use the SingleByteDecodeTable type. (WebCore::tableForEncoding): Use SingleByteDecodeTable and SingleByteEncodeTable type names. Use std::count to count the replacement characters instead of writing our own loop. Use std::size(decodeTable) instead of defining a tableSize. Update for ISO name change. Use RELEASE_ASSERT_NOT_REACHED so we don't have to write a dead code return statement. (WebCore::tableForDecoding): Use SingleByteDecideTable type for return value. Update for ISO name change. Use RELEASE_ASSERT_NOT_REACHED so we don't have to write a dead code return statement. Also make this constexpr since it's just selecting a global based on an enumeration value. (WebCore::encode): Made this a non-member function since it does not need access to TextCodec members. This helps us keep implementation details out of the header. (WebCore::decode): Ditto. (WebCore::TextCodecSingleByte::encode const): Made this const and updated to call the non-member function. (WebCore::TextCodecSingleByte::decode): Ditto. (WebCore::TextCodecSingleByte::registerCodecs): Update for the ISO name change. * platform/text/TextCodecSingleByte.h: Marked the class final, and moved the enumeration values for Encoding, EncodeTable, and the encode and decode functions that take table arguments all out of the class definition. Made encode const. * platform/text/TextCodecUTF16.cpp: (WebCore::TextCodecUTF16::decode): Added logic to drop the first byte order mark after m_shouldStripByteOrderMark is set to true. Changed code to call through rather than recursively calling self in the case of an unpaired lead surrogate, removing the need to put the processBytesShared lambda into a Function. Renamed the processBytesShared lambda to processCodeUnit. (WebCore::TextCodecUTF16::encode const): Made const. * platform/text/TextCodecUTF16.h: Marked the class final, added a stripByteOrderMark member function and a m_shouldStripByteOrderMark data member, and made encode const. * platform/text/TextCodecUTF8.cpp: (WebCore::TextCodecUTF8::handlePartialSequence): Added logic to drop the first byte order mark after m_shouldStripByteOrderMark is set to true, making sure to keep it out of the hot ASCII decode loop. (WebCore::TextCodecUTF8::decode): Ditto. Also added code to make sure the partial sequence is cleared out as part of a flush even when stopOnError is true. (WebCore::TextCodecUTF8::encodeUTF8): Renamed this so it can be a static member function, so it can be called by TextCodecReplacement. (WebCore::TextCodecUTF8::encode const): Made this const and have it call encodeUTF8. * platform/text/TextCodecUTF8.h: Marked the class final, added a stripByteOrderMark member function and a m_shouldStripByteOrderMark data member, added static member function encodeUTF8, and made the encode function const. * platform/text/TextCodecUserDefined.cpp: (WebCore::TextCodecUserDefined::encode const): Made const. * platform/text/TextCodecUserDefined.h: Marked the class final and made encode const. * xml/XSLStyleSheetLibxslt.cpp: (WebCore::XSLStyleSheet::parseString): Use byteOrderMark. * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::switchToUTF16): Ditto. (WebCore::nativeEndianUTF16Encoding): Ditto. 2020-09-06 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Move Line handing to LineBuilder https://bugs.webkit.org/show_bug.cgi?id=216200 Reviewed by Antti Koivisto. 1. LineBuilder owns Line now. 2. LineBuilder can build line for both layout and intrinsic width computation (now these are two distinct code paths). 3. LineBuilder also constructs the LineBox when needed (This was previously in InlineFormattingContext::lineLayout). * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const): (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): (WebCore::Layout::InlineFormattingContext::constraintsForLine): Deleted. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::computedTextIndent const): Deleted. * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::formattingContext const): (WebCore::Layout::LineBox::root const): (WebCore::Layout::LineBox::layoutState const): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::contentLogicalWidth const): (WebCore::Layout::LineBox::formattingContext const): Deleted. (WebCore::Layout::LineBox::root const): Deleted. (WebCore::Layout::LineBox::layoutState const): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::LineBuilder): (WebCore::Layout::LineBuilder::layoutInlineContent): (WebCore::Layout::LineBuilder::initialize): (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::constraintsForLine): (WebCore::Layout::LineBuilder::commitFloats): (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): (WebCore::Layout::LineBuilder::commitPartialContent): (WebCore::Layout::LineBuilder::rebuildLine): (WebCore::Layout::LineBuilder::layoutState const): * layout/inlineformatting/InlineLineBuilder.h: 2020-09-05 Sam Weinig <weinig@apple.com> [WebIDL] Add support for interface mixins https://bugs.webkit.org/show_bug.cgi?id=216217 Reviewed by Darin Adler. Implement support for WebIDL interface mixins, which are interface fragments that can be included into other interfaces (using an 'includes' statement), but do not create new types themselves. Prior to this, we have been emulating the behavior by allowing any interface to be included in another interface, and marking some interfaces with the [LegacyNoInterfaceObject] extended attribute. This change codifies that with in the spec approved way. - Updates IDL parser to parse mixin interfaces (and fixes the parsing of callback interfaces to be a bit more strict while I was there). - Updates IDL pre-processor to avoid creating global variables and IsoSubspaces for mixins. - Updates IDL code generator to only support including mixin interfaces during supplemental inclusion. - Updates IDL files to use interface mixin where appropriately specified. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * CMakeLists.txt: * DerivedSources-output.xcfilelist: * DerivedSources.make: * dom/DeviceOrientationOrMotionEvent.idl: Removed. Remove DeviceOrientationOrMotionEvent.idl and corresponding generated files, inlining it into DeviceMotionEvent.idl and DeviceOrientationEvent.idl as specified. This is needed as mixin interfaces do not support static operations or attributes. * bindings/scripts/CodeGenerator.pm: (IsValidSupplementalInterface): (IsValidSupplementalDictionary): (ProcessSupplementalDependencies): (GetInterfaceExtendedAttributesFromName): Update IDL code generator to only support including mixin interfaces during supplemental inclusion. Also removes some left of remnents of exception interface support. * bindings/scripts/IDLParser.pm: (parseCallbackRestOrInterface): (parseCallbackInterface): (parseCallbackInterfaceMembers): (parseCallbackInterfaceMember): (parseMixin): (parseMixinMembers): (parseMixinMember): (parseNamespace): (parsePartialInterfaceMember): (parseAttributeOrOperationForStringifierOrStatic): Update IDL parser to parse mixin interfaces and fix the parsing of callback interfaces to match the spec by restricting its members to constants and regular functions. * bindings/scripts/preprocess-idls.pl: (isMixinInterfaceFromIDL): (containsInterfaceFromIDL): (getInterfaceExtendedAttributesFromIDL): (containsInterfaceOrExceptionFromIDL): Deleted. Ensure mixin interfaces don't get exposed on any global objects and remove some left of remnents of exception interface support. * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.cpp: Added. * bindings/scripts/test/JS/JSTestLegacyNoInterfaceObject.h: Added. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestIncludes.idl: * bindings/scripts/test/TestLegacyNoInterfaceObject.idl: Added. * bindings/scripts/test/TestOperationBase.idl: Update bindings tests to use mixins for includes. Add new dedicated [LegacyNoInterfaceObject] since it was no longer being tested. * Modules/fetch/FetchBody.idl: * Modules/mediasource/VideoPlaybackQuality.idl: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/streams/ReadableStreamSink.idl: * accessibility/AccessibilityRole.idl: * accessibility/AriaAttributes.idl: * animation/Animatable.idl: * css/ElementCSSInlineStyle.idl: * css/StyleMedia.idl: * dom/ChildNode.idl: * dom/DeviceMotionEvent.idl: * dom/DeviceOrientationEvent.idl: * dom/Document.idl: * dom/DocumentAndElementEventHandlers.idl: * dom/DocumentOrShadowRoot.idl: * dom/EventListener.idl: * dom/GlobalEventHandlers.idl: * dom/NavigatorMaxTouchPoints.idl: * dom/NonDocumentTypeChildNode.idl: * dom/NonElementParentNode.idl: * dom/ParentNode.idl: * dom/Slotable.idl: * html/HTMLHyperlinkElementUtils.idl: * html/HTMLOrForeignElement.idl: * html/canvas/CanvasCompositing.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasDrawPath.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasFilters.idl: * html/canvas/CanvasGradient.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasImageSmoothing.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPathDrawingStyles.idl: * html/canvas/CanvasRect.idl: * html/canvas/CanvasShadowStyles.idl: * html/canvas/CanvasState.idl: * html/canvas/CanvasText.idl: * html/canvas/CanvasTextDrawingStyles.idl: * html/canvas/CanvasTransform.idl: * html/canvas/CanvasUserInterface.idl: * html/canvas/WebGLRenderingContextBase.idl: * page/GlobalCrypto.idl: * page/GlobalPerformance.idl: * page/Navigator.idl: * page/NavigatorID.idl: * page/NavigatorLanguage.idl: * page/NavigatorOnLine.idl: * page/NavigatorPlugins.idl: * page/NavigatorServiceWorker.idl: * page/NavigatorShare.idl: * page/WindowEventHandlers.idl: * page/WindowOrWorkerGlobalScope.idl: * svg/SVGFilterPrimitiveStandardAttributes.idl: * svg/SVGFitToViewBox.idl: * svg/SVGTests.idl: * svg/SVGURIReference.idl: * svg/SVGZoomAndPan.idl: * workers/AbstractWorker.idl: * xml/XPathEvaluator.idl: * xml/XPathNSResolver.idl: Update IDLs. 2020-09-05 Wenson Hsieh <wenson_hsieh@apple.com> [MotionMark] RenderLayer::paintLayerContents spends ~5% of the time in MonotonicTime::now() in Multiply https://bugs.webkit.org/show_bug.cgi?id=216190 Reviewed by Darin Adler. In several of MotionMark's subtests (for instance, Multiply), we spent a large amount of time underneath `RenderLayer::paintLayerContents` due to both the large number of layers and the need to frequently repaint each layer (all of which are constantly being animated). Underneath this method, a nontrivial amount of time (~5%) is then spent grabbing the system time via `MonotonicTime::now()`. We can avoid this extra work by instead using the timestamp of the last rendering update (before we started painting), which we keep track of using a new member variable on `Page`. See below for more details, as well as the WebKit2 ChangeLog. * page/ChromeClient.h: (WebCore::ChromeClient::timestampForPaintFrequencyTracking const): Add a client hook to fetch the timestamp to use when tracking painting frequency. See the WebKit2 ChangeLog for more details. * page/Page.cpp: (WebCore::Page::updateRendering): Update `m_lastRenderingUpdateTimestamp`. * page/Page.h: (WebCore::Page::lastRenderingUpdateTimestamp const): * rendering/PaintFrequencyTracker.h: Drive-by cleanup: narrow the `PaintFrequency` enum to `bool` width. (WebCore::PaintFrequencyTracker::begin): (WebCore::SinglePaintFrequencyTracking::SinglePaintFrequencyTracking): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerContents): Call out to the client layer to return a timestamp for tracking painting frequency. By default, this is simply the current time (`MonotonicTime::now()`), but ports (namely, WebKit2) may opt for a coarser granularity. (WebCore::RenderLayer::simulateFrequentPaint): * rendering/RenderLayer.h: 2020-09-05 Sam Weinig <weinig@apple.com> Fix formatting of LegacyOverrideBuiltIns https://bugs.webkit.org/show_bug.cgi?id=216218 Reviewed by Darin Adler. Neglected to fix this bit of feedback in a previous change. Makes enum class LegacyOverrideBuiltIns a bit more readable. * bindings/js/JSDOMAbstractOperations.h: 2020-09-05 Oriol Brufau <obrufau@igalia.com> [css-grid] Use min-content size for intrinsic maximums resolution https://bugs.webkit.org/show_bug.cgi?id=216142 Reviewed by Darin Adler. By mistake the specification used to say that, for items spanning multiple tracks, the growth limits of the tracks with an intrinsic max track sizing function should grow to accommodate the minimum contribution of the item. But this was a mistake, because an intrinsic max track sizing function can only be min-content or max-content. So instead of distributing the minimum contribution, it should be the min-content contribution. The spec has been fixed and there is a CSSWG resolution in https://github.com/w3c/csswg-drafts/issues/4790 This patch fixes the problem by reverting r207290. The change is likely web compatible, since it only affects a rare edge case with 'minmax()' where the min sizing function is 'auto' or a fixed value smaller than the min-content contribution, the max sizing function is 'min-content', and an item whose minimum contribution is forced to be different than the min-content contribution, and spans multiple tracks. This is a port of https://crrev.com/803871 from Chromium. Tests: fast/css-grid-layout/grid-intrinsic-maximums.html imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-intrinsic-track-sizes-001.html * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::itemSizeForTrackSizeComputationPhase const): 2020-09-05 Oriol Brufau <obrufau@igalia.com> [css-logical] Ship flow-relative shorthand and offset properties https://bugs.webkit.org/show_bug.cgi?id=216178 Reviewed by Darin Adler. This patch ships the logical properties that were already implemented behind a flag. Specifically: - border-block, border-block-color, border-block-style, border-block-width - border-inline, border-inline-color, border-inline-style, border-inline-width - inset-block-start, inset-block-end, inset-inline-start, inset-inline-end - inset, inset-block, inset-inline - margin-block, margin-inline - padding-block, padding-inline Tests: imported/w3c/web-platform-tests/css/css-cascade/parsing/all-valid.html imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html imported/w3c/web-platform-tests/css/css-logical/animation-001.html imported/w3c/web-platform-tests/css/css-logical/animation-002.html imported/w3c/web-platform-tests/css/css-logical/getComputedStyle-listing.html imported/w3c/web-platform-tests/css/css-logical/inheritance.html imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html imported/w3c/web-platform-tests/css/css-logical/parsing/border-block-color-computed.html imported/w3c/web-platform-tests/css/css-logical/parsing/border-block-color-valid.html imported/w3c/web-platform-tests/css/css-logical/parsing/border-block-style-computed.html imported/w3c/web-platform-tests/css/css-logical/parsing/border-block-style-valid.html imported/w3c/web-platform-tests/css/css-logical/parsing/border-block-valid.html imported/w3c/web-platform-tests/css/css-logical/parsing/border-block-width-computed.html imported/w3c/web-platform-tests/css/css-logical/parsing/border-block-width-valid.html imported/w3c/web-platform-tests/css/css-logical/parsing/border-inline-color-computed.html imported/w3c/web-platform-tests/css/css-logical/parsing/border-inline-color-valid.html imported/w3c/web-platform-tests/css/css-logical/parsing/border-inline-style-computed.html imported/w3c/web-platform-tests/css/css-logical/parsing/border-inline-style-valid.html imported/w3c/web-platform-tests/css/css-logical/parsing/border-inline-valid.html imported/w3c/web-platform-tests/css/css-logical/parsing/border-inline-width-computed.html imported/w3c/web-platform-tests/css/css-logical/parsing/border-inline-width-valid.html imported/w3c/web-platform-tests/css/css-logical/parsing/inset-block-inline-computed.html imported/w3c/web-platform-tests/css/css-logical/parsing/inset-block-inline-shorthand.html imported/w3c/web-platform-tests/css/css-logical/parsing/inset-block-inline-valid.html imported/w3c/web-platform-tests/css/css-logical/parsing/inset-computed.html imported/w3c/web-platform-tests/css/css-logical/parsing/inset-shorthand.html imported/w3c/web-platform-tests/css/css-logical/parsing/inset-valid.html imported/w3c/web-platform-tests/css/css-logical/parsing/margin-block-inline-computed.html imported/w3c/web-platform-tests/css/css-logical/parsing/margin-block-inline-shorthand.html imported/w3c/web-platform-tests/css/css-logical/parsing/margin-block-inline-valid.html imported/w3c/web-platform-tests/css/css-logical/parsing/padding-block-inline-computed.html imported/w3c/web-platform-tests/css/css-logical/parsing/padding-block-inline-shorthand.html imported/w3c/web-platform-tests/css/css-logical/parsing/padding-block-inline-valid.html imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/border-001.html imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/margin-001.html imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-margin/padding-001.html imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html * css/CSSProperties.json: Enable logical properties by default. * css/makeprop.pl: Avoid compile warning when generating isEnabledCSSProperty if there is no property behind flag. 2020-09-05 Myles C. Maxfield <mmaxfield@apple.com> [iOS Family] Remove the concept of custom fallback fonts https://bugs.webkit.org/show_bug.cgi?id=215690 Reviewed by Sam Weinig. They're no longer necessary for iOS, and macOS doesn't even have the concept of custom fallback fonts, so we can just remove the entire concept. * platform/graphics/FontCache.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontCache::systemFallbackForCharacters): * platform/graphics/cocoa/FontCacheCoreText.h: * platform/graphics/ios/FontCacheIOS.mm: (WebCore::requiresCustomFallbackFont): Deleted. (WebCore::FontCache::getCustomFallbackFont): Deleted. 2020-09-05 Myles C. Maxfield <mmaxfield@apple.com> [Cocoa] USE(PLATFORM_SYSTEM_FALLBACK_LIST) is true on all Cocoa platforms, so there's no need to consult it in Cocoa-specific files https://bugs.webkit.org/show_bug.cgi?id=215684 Reviewed by Darin Adler. Removes dead code. No new tests because there is no behavior change. * Configurations/WebCore.xcconfig: * PlatformFTW.cmake: * PlatformWin.cmake: * page/cocoa/MemoryReleaseCocoa.mm: (WebCore::platformReleaseMemory): * platform/FreeType.cmake: * platform/graphics/FontCascadeDescription.cpp: (WebCore::FontCascadeDescription::effectiveFamilyCount const): Deleted. (WebCore::FontCascadeDescription::effectiveFamilyAt const): Deleted. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::invalidateFontCache): * platform/graphics/cocoa/FontDescriptionCocoa.cpp: (WebCore::FontCascadeDescription::effectiveFamilyAt const): * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp: (WebCore::FontFamilySpecificationCoreText::fontRanges const): * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: * platform/graphics/harfbuzz/FontDescriptionHarfBuzz.cpp: Added. Moved port-specific implementations into port-specific files. (WebCore::FontCascadeDescription::effectiveFamilyCount const): (WebCore::FontCascadeDescription::effectiveFamilyAt const): * platform/graphics/win/FontDescriptionWin.cpp: Added. Moved port-specific implementations into port-specific files. (WebCore::FontCascadeDescription::effectiveFamilyCount const): (WebCore::FontCascadeDescription::effectiveFamilyAt const): 2020-09-05 Alex Christensen <achristensen@webkit.org> XML documents in iframes should not inherit encoding from parent frame https://bugs.webkit.org/show_bug.cgi?id=216216 Reviewed by Darin Adler. This seems to match the behavior of Chrome and Firefox. Covered by newly passing web platform tests, which other browsers already pass. * loader/DocumentWriter.cpp: (WebCore::canReferToParentFrameEncoding): 2020-09-05 Devin Rousso <drousso@apple.com> Web Inspector: allow DOM breakpoints to be configured https://bugs.webkit.org/show_bug.cgi?id=215795 Reviewed by Brian Burg. Tests: inspector/dom-debugger/attribute-modified-style.html inspector/dom-debugger/dom-breakpoints.html inspector/dom-debugger/dom-breakpoint-attribute-modified.html inspector/dom-debugger/dom-breakpoint-node-removed-ancestor.html inspector/dom-debugger/dom-breakpoint-node-removed-direct.html inspector/dom-debugger/dom-breakpoint-subtree-modified-add.html inspector/dom-debugger/dom-breakpoint-subtree-modified-remove.html * inspector/agents/page/PageDOMDebuggerAgent.h: * inspector/agents/page/PageDOMDebuggerAgent.cpp: (WebCore::PageDOMDebuggerAgent::disable): (WebCore::PageDOMDebuggerAgent::setDOMBreakpoint): (WebCore::PageDOMDebuggerAgent::removeDOMBreakpoint): (WebCore::PageDOMDebuggerAgent::frameDocumentUpdated): (WebCore::calculateDistance): Added. (WebCore::PageDOMDebuggerAgent::willInsertDOMNode): (WebCore::PageDOMDebuggerAgent::willRemoveDOMNode): (WebCore::PageDOMDebuggerAgent::didRemoveDOMNode): (WebCore::PageDOMDebuggerAgent::willModifyDOMAttr): (WebCore::PageDOMDebuggerAgent::willInvalidateStyleAttr): (WebCore::PageDOMDebuggerAgent::buildPauseDataForDOMBreakpoint): Added. (WebCore::domTypeForName): Deleted. (WebCore::domTypeName): Deleted. (WebCore::PageDOMDebuggerAgent::didInsertDOMNode): Deleted. (WebCore::PageDOMDebuggerAgent::descriptionForDOMEvent): Deleted. (WebCore::PageDOMDebuggerAgent::updateSubtreeBreakpoints): Deleted. (WebCore::PageDOMDebuggerAgent::hasBreakpoint): Deleted. Replace the bitmask with separate `HashMap` for each type of DOM breakpoint. Instead of propagating the `SubtreeModified` bit to the entire subtree when new nodes are added (which means there's an entry in the `HashMap` for every descendant) and removing them all when that node is removed, only keep nodes in each `HashMap` if it directly has a DOM breakpoint. Walk up the ancestor chain when nodes are added/removed to determine if there is a nearby breakpoint to pause. When a node is removed, remove any existing DOM breakpoint if it's owner is part of the removed subtree. * inspector/agents/worker/WorkerDOMDebuggerAgent.h: * inspector/agents/worker/WorkerDOMDebuggerAgent.cpp: (WebCore::WorkerDOMDebuggerAgent::setDOMBreakpoint): * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didInsertDOMNodeImpl): 2020-09-05 Alex Christensen <achristensen@webkit.org> TextDecoder should properly handle streams https://bugs.webkit.org/show_bug.cgi?id=216202 Reviewed by Darin Adler. A TextCodec keeps state when it decodes part of valid input, such as the first byte of a multibyte sequence. TextEncoding::decode makes a new TextCodec and throws away that state. In order to properly handle streaming, we need to keep the TextCodec and call TextCodec::decode directly. Covered by newly passing web platform tests. I also added a test that failed in my first implementation attempt but passes now in WebKit as well as Chromium. Firefox hasn't implemented TextDecoderStream yet, but this test will hopefully help them not make the same mistake I did. * dom/TextDecoder.cpp: (WebCore::TextDecoder::decode): (WebCore::codeUnitByteSize): Deleted. * dom/TextDecoder.h: 2020-09-05 Myles C. Maxfield <mmaxfield@apple.com> [Cocoa] CTFontIsSystemUIFont() is faster than CTFontDescriptorIsSystemUIFont()/CTFontCopyFontDescriptor() https://bugs.webkit.org/show_bug.cgi?id=215687 Reviewed by Darin Adler. Instead of making the two calls, we can make a single call that has the same effect. No new tests because there is no behavior change. * platform/graphics/FontPlatformData.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::fontIsSystemFont): * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::FontCascade::primaryFontIsSystemFont const): * platform/graphics/cocoa/FontPlatformDataCocoa.mm: (WebCore::FontPlatformData::FontPlatformData): (WebCore::FontPlatformData::isSystemFont): 2020-09-05 Myles C. Maxfield <mmaxfield@apple.com> [Cocoa] Migrate off SPI in Font::platformWidthForGlyph() https://bugs.webkit.org/show_bug.cgi?id=215670 Reviewed by Zalan Bujtas. All the tests pass, and the microbenchmark attached to <rdar://problem/21026016> says it isn't a regression. * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::platformWidthForGlyph const): 2020-09-05 Myles C. Maxfield <mmaxfield@apple.com> [macOS] Don't apply synthetic bold or italics to emoji https://bugs.webkit.org/show_bug.cgi?id=215686 Reviewed by Darin Adler. Italicized emoji are one of the most hideous things I've ever seen. This unifies the behavior between macOS and iOS. Test: fast/text/emoji-synthesis.html * WebCore.xcodeproj/xcshareddata/xcschemes/WebCore.xcscheme: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::computeNecessarySynthesis): 2020-09-04 Simon Fraser <simon.fraser@apple.com> REGRESSION (r260571): Scrolling on weather.com in Safari causes the gradient background to flicker (fixed backgrounds) https://bugs.webkit.org/show_bug.cgi?id=216192 <rdar://problem/68192010> Reviewed by Tim Horton. If a page has slow-scrolling reasons, like background-attachment:fixed on a non-root element, then we should never update layer positions on the scrolling thread, since this results in scroll position being out of sync with the painted background position. * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::canUpdateLayersOnScrollingThread const): (WebCore::ThreadedScrollingTree::waitForRenderingUpdateCompletionOrTimeout): (WebCore::ThreadedScrollingTree::delayedRenderingUpdateDetectionTimerFired): (WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread): * page/scrolling/ThreadedScrollingTree.h: 2020-09-05 Myles C. Maxfield <mmaxfield@apple.com> [Cocoa] Unify implementation of custom font name aliases between all Cocoa platforms https://bugs.webkit.org/show_bug.cgi?id=215689 Reviewed by Darin Adler. The existing code is duplicated almost verbatim. There's no point in having two copies of the same thing. No new tests because there is no behavior change. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::fontWithFamilySpecialCase): (WebCore::fontWithFamily): * platform/graphics/cocoa/FontCacheCoreText.h: * platform/graphics/cocoa/FontDescriptionCocoa.cpp: (WebCore::FontCascadeDescription::effectiveFamilyCount const): (WebCore::FontCascadeDescription::effectiveFamilyAt const): * platform/graphics/ios/FontCacheIOS.mm: (WebCore::baseSystemFontDescriptor): Deleted. (WebCore::systemFontModificationAttributes): Deleted. (WebCore::systemFontDescriptor): Deleted. (WebCore::platformFontWithFamilySpecialCase): Deleted. * platform/graphics/mac/FontCacheMac.mm: Removed. 2020-09-05 Sam Weinig <weinig@apple.com> [WebIDL] Realign our IDL extended attribute names with those specified in WebIDL https://bugs.webkit.org/show_bug.cgi?id=216194 Reviewed by Darin Adler. Over time, the WebIDL and HTML specifications have added / renamed extended attributes and we have not stayed up to date. This updates the names everywhere and URLs in IDLAttributes.json. [AllowShared] -> new, marked as unsupported [HTMLConstructor] - > new, marked as unsupported [LegacyLenientSetter] -> renamed from [LenientSetter], still unsupported [LegacyLenientThis] -> renamed from [LenientThis] [LegacyNamespace] -> new, marked as unsupported [LegacyNoInterfaceObject] -> renamed from [NoInterfaceObject] [LegacyNullToEmptyString] -> renamed from [TreatNullAs=EmptyString] [LegacyOverrideBuiltIns] -> renamed from OverrideBuiltins [LegacyTreatNonObjectAsNull] -> renamed from [TreatNonObjectAsNull], still unsupported [LegacyUnforgeable] -> renamed from [Unforgeable] [Serializable] -> new, marked as unsupported [Transferable] -> new, marked as unsupported * Modules/applepay/ApplePayCancelEvent.idl: * Modules/applepay/ApplePayPaymentAuthorizedEvent.idl: * Modules/applepay/ApplePayPaymentMethodSelectedEvent.idl: * Modules/applepay/ApplePayShippingContactSelectedEvent.idl: * Modules/applepay/ApplePayShippingMethodSelectedEvent.idl: * Modules/applepay/ApplePayValidateMerchantEvent.idl: * Modules/fetch/FetchBody.idl: * Modules/mediacontrols/MediaControlsHost.idl: * Modules/mediasource/VideoPlaybackQuality.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/plugins/QuickTimePluginReplacement.idl: * Modules/quota/StorageInfo.idl: * Modules/quota/StorageQuota.idl: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/streams/ReadableStreamSink.idl: * Modules/streams/ReadableStreamSource.idl: * Modules/webaudio/WebKitAudioBufferSourceNode.idl: * Modules/webaudio/WebKitAudioListener.idl: * Modules/webaudio/WebKitDynamicsCompressorNode.idl: * Modules/webaudio/WebKitOscillatorNode.idl: * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: * accessibility/AccessibilityRole.idl: * accessibility/AriaAttributes.idl: * animation/Animatable.idl: * bindings/IDLTypes.h: * bindings/js/DOMWrapperWorld.h: (WebCore::DOMWrapperWorld::disableLegacyOverrideBuiltInsBehavior): (WebCore::DOMWrapperWorld::shouldDisableLegacyOverrideBuiltInsBehavior const): (WebCore::DOMWrapperWorld::disableOverrideBuiltinsBehavior): Deleted. (WebCore::DOMWrapperWorld::shouldDisableOverrideBuiltinsBehavior const): Deleted. * bindings/js/JSDOMAbstractOperations.h: (WebCore::isVisibleNamedProperty): (WebCore::accessVisibleNamedProperty): * bindings/js/JSDOMConvertNullable.h: * bindings/js/JSDOMConvertStrings.h: (WebCore::Converter<IDLTreatNullAsEmptyAdaptor<T>>::convert): Deleted. (WebCore::JSConverter<IDLTreatNullAsEmptyAdaptor<T>>::convert): Deleted. * bindings/scripts/CodeGeneratorJS.pm: (GenerateGetOwnPropertySlot): (GenerateGetOwnPropertySlotByIndex): (GeneratePut): (GeneratePutByIndex): (GenerateIsLegacyUnforgeablePropertyName): (GenerateDefineOwnProperty): (GenerateDeletePropertyCommon): (AttributeShouldBeOnInstance): (OperationShouldBeOnInstance): (IsAcceleratedDOMAttribute): (GetJSCAttributesForAttribute): (GenerateHeader): (GenerateImplementation): (GenerateAttributeGetterTrampolineDefinition): (GenerateAttributeSetterTrampolineDefinition): (IsAnnotatedType): (GetAnnotatedIDLType): (GenerateConstructorHelperMethods): (NeedsConstructorProperty): (IsLegacyUnforgeable): (ComputeFunctionSpecial): (GenerateIsUnforgeablePropertyName): Deleted. (IsUnforgeable): Deleted. * bindings/scripts/IDLAttributes.json: * bindings/scripts/preprocess-idls.pl: * bindings/scripts/test/BindingTestGlobalConstructors.idl: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.cpp: Added. * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.h: Added. * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.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/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.h: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.h: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: Removed. * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: Removed. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestIncludes.idl: * bindings/scripts/test/TestLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyUnforgeableProperties.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl: Removed. * bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl: Removed. * bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl: Removed. * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestOperationBase.idl: * bindings/scripts/test/TestOverrideBuiltins.idl: Removed. * css/CSSStyleDeclaration.idl: * css/CSSUnknownRule.idl: * css/ElementCSSInlineStyle.idl: * css/MediaList.idl: * css/StyleMedia.idl: * dom/CharacterData.idl: * dom/ChildNode.idl: * dom/DOMImplementation.idl: * dom/DOMStringMap.idl: * dom/DeviceOrientationOrMotionEvent.idl: * dom/Document.idl: * dom/DocumentAndElementEventHandlers.idl: * dom/DocumentOrShadowRoot.idl: * dom/Element.idl: * dom/Event.idl: * dom/EventListener.idl: * dom/GlobalEventHandlers.idl: * dom/NavigatorMaxTouchPoints.idl: * dom/NonDocumentTypeChildNode.idl: * dom/NonElementParentNode.idl: * dom/ParentNode.idl: * dom/ShadowRoot.idl: * dom/Slotable.idl: * html/HTMLBodyElement.idl: * html/HTMLDocument.idl: * html/HTMLElement.idl: * html/HTMLFontElement.idl: * html/HTMLFormElement.idl: * html/HTMLFrameElement.idl: * html/HTMLHyperlinkElementUtils.idl: * html/HTMLIFrameElement.idl: * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOrForeignElement.idl: * html/HTMLOutputElement.idl: * html/HTMLTableCellElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTextAreaElement.idl: * html/canvas/ANGLEInstancedArrays.idl: * html/canvas/CanvasCompositing.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasDrawPath.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasFilters.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasImageSmoothing.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPathDrawingStyles.idl: * html/canvas/CanvasRect.idl: * html/canvas/CanvasShadowStyles.idl: * html/canvas/CanvasState.idl: * html/canvas/CanvasText.idl: * html/canvas/CanvasTextDrawingStyles.idl: * html/canvas/CanvasTransform.idl: * html/canvas/CanvasUserInterface.idl: * html/canvas/EXTBlendMinMax.idl: * html/canvas/EXTColorBufferFloat.idl: * html/canvas/EXTColorBufferHalfFloat.idl: * html/canvas/EXTFragDepth.idl: * html/canvas/EXTShaderTextureLOD.idl: * html/canvas/EXTTextureFilterAnisotropic.idl: * html/canvas/EXTsRGB.idl: * html/canvas/OESElementIndexUint.idl: * html/canvas/OESStandardDerivatives.idl: * html/canvas/OESTextureFloat.idl: * html/canvas/OESTextureFloatLinear.idl: * html/canvas/OESTextureHalfFloat.idl: * html/canvas/OESTextureHalfFloatLinear.idl: * html/canvas/OESVertexArrayObject.idl: * html/canvas/WebGLColorBufferFloat.idl: * html/canvas/WebGLCompressedTextureASTC.idl: * html/canvas/WebGLCompressedTextureATC.idl: * html/canvas/WebGLCompressedTextureETC.idl: * html/canvas/WebGLCompressedTextureETC1.idl: * html/canvas/WebGLCompressedTexturePVRTC.idl: * html/canvas/WebGLCompressedTextureS3TC.idl: * html/canvas/WebGLCompressedTextureS3TCsRGB.idl: * html/canvas/WebGLDebugRendererInfo.idl: * html/canvas/WebGLDebugShaders.idl: * html/canvas/WebGLDepthTexture.idl: * html/canvas/WebGLDrawBuffers.idl: * html/canvas/WebGLLoseContext.idl: * html/canvas/WebGLRenderingContextBase.idl: * html/canvas/WebGLVertexArrayObjectOES.idl: * html/track/TextTrackCueGeneric.idl: * html/track/VTTRegionList.idl: * inspector/CommandLineAPIHost.idl: * inspector/InspectorFrontendHost.idl: * page/DOMWindow.idl: * page/GlobalCrypto.idl: * page/GlobalPerformance.idl: * page/Location.idl: * page/NavigatorID.idl: * page/NavigatorLanguage.idl: * page/NavigatorOnLine.idl: * page/NavigatorPlugins.idl: * page/NavigatorServiceWorker.idl: * page/NavigatorShare.idl: * page/RemoteDOMWindow.idl: * page/WindowEventHandlers.idl: * page/WindowOrWorkerGlobalScope.idl: * svg/SVGFilterPrimitiveStandardAttributes.idl: * svg/SVGFitToViewBox.idl: * svg/SVGTests.idl: * svg/SVGURIReference.idl: * svg/SVGZoomAndPan.idl: * testing/GCObservation.idl: * testing/InternalSettings.idl: * testing/Internals.idl: * testing/InternalsMapLike.idl: * testing/InternalsSetLike.idl: * testing/MallocStatistics.idl: * testing/MemoryInfo.idl: * testing/MockCDMFactory.idl: * testing/MockContentFilterSettings.idl: * testing/MockPageOverlay.idl: * testing/MockPaymentCoordinator.idl: * testing/ServiceWorkerInternals.idl: * testing/TypeConversions.idl: * testing/WebFakeXRDevice.idl: * testing/WebFakeXRInputController.idl: * testing/WebXRTest.idl: * workers/AbstractWorker.idl: * xml/XPathNSResolver.idl: 2020-09-05 Michael Catanzaro <mcatanzaro@gnome.org> -Wreturn-type warning in BaseAudioContext.cpp https://bugs.webkit.org/show_bug.cgi?id=216215 Reviewed by Darin Adler. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::periodicWave): 2020-09-05 Darin Adler <darin@apple.com> CSS revert should serialize as "revert", not "Revert" https://bugs.webkit.org/show_bug.cgi?id=216187 Reviewed by Anders Carlsson. Tests: imported/w3c/web-platform-tests/css/css-values/unset-value-storage.html imported/w3c/web-platform-tests/css/cssom/css-style-attr-decl-block.html * css/CSSRevertValue.cpp: (WebCore::CSSRevertValue::customCSSText const): Use lowercase "revert". * css/StyleProperties.cpp: (WebCore::isCSSWideValueKeyword): Added. Replaces isInitialOrInherit. (WebCore::StyleProperties::fontValue const): Use isCSSWideValueKeyword rather than isInitialOrInherit. (WebCore::StyleProperties::getLayeredShorthandValue const): Ditto. Also rearranged thee function a bit and shortened some excessively wordy code. (WebCore::StyleProperties::getShorthandValue const): Ditto. (WebCore::StyleProperties::borderPropertyValue const): Ditto. (WebCore::StyleProperties::asText const): Added code to properly handle the case where both background-position/repeat-x and -y are the same CSS-wide value keyword as well as cases involving "initial". The general case above handles these properly, but background-position/repeat have their own code, which needed to repeat some of the same logic. (WebCore::StyleProperties::PropertyReference::cssText const): Use makeString instead of StringBuilder. * dom/StyledElement.cpp: (WebCore::StyledElement::styleAttributeChanged): Removed incorrect code that detached the CSS object model style wrapper from the element when the style attribute was removed. This was incorrect behavior; it should stay attached. This fix happens to be tested by the same file as the "revert"/"Revert" fix and I wanted the whole file to pass, not just one more test. * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::addBlockStyle): Rewrote for simplicity, but also so this works properly when inlineStyle is non-null but empty. This case arises in one test now because of the change to StyledElement above. 2020-09-05 Darin Adler <darin@apple.com> Implement serialization of CSSPropertyGap https://bugs.webkit.org/show_bug.cgi?id=216210 Reviewed by Alex Christensen. * css/StyleProperties.cpp: (WebCore::StyleProperties::getPropertyValue const): Use get2Values to serialize the gap shorthand. 2020-09-05 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r266614 and r266657. https://bugs.webkit.org/show_bug.cgi?id=216213 Broke builds Reverted changesets: "Fix Internals::supportsVCPEncoder on BigSur" https://bugs.webkit.org/show_bug.cgi?id=216174 https://trac.webkit.org/changeset/266614 "Fix the build after r266614" https://bugs.webkit.org/show_bug.cgi?id=216174 https://trac.webkit.org/changeset/266657 2020-09-05 Myles C. Maxfield <mmaxfield@apple.com> Fix the build after r266614 https://bugs.webkit.org/show_bug.cgi?id=216174 Unreviewed. * testing/Internals.cpp: (WebCore::Internals::supportsVCPEncoder): These parentheses really should be in Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h, but I don't know the process for updating that third-party library. This is a short-term build fix. 2020-09-04 Tyler Wilcock <twilco.o@protonmail.com> CSS :visited color taken on non-visited link when using CSS variables https://bugs.webkit.org/show_bug.cgi?id=210525 Reviewed by Darin Adler. This patch fixes a bug in which :visited styles with variables (custom properties) were being applied to non-visited links, as the builder link match state was unconditionally changed from MatchVisited to MatchDefault when resolving said variables. Now all link state mutations are limited to the smallest scope possible, meaning the erroneous reset to MatchDefault is no longer necessary. Test: fast/css/link-with-variable-styling.html * style/StyleBuilder.cpp: (WebCore::Style::Builder::applyCustomProperty): Limit m_linkState mutations with SetForScope to prevent said mutations from leaking out and causing unintended side effects. 2020-09-04 Alex Christensen <achristensen@webkit.org> Fix build when using non-standard unified sources. * Modules/applepay/ApplePayPaymentMethod.h: There was a missing include. 2020-09-04 Alex Christensen <achristensen@webkit.org> Align KOI8-U and ibm866 encodings with Chrome, Firefox, and the specification https://bugs.webkit.org/show_bug.cgi?id=216184 Reviewed by Darin Adler. Covered by newly passing web platform tests. * platform/text/TextCodecICU.cpp: * platform/text/TextCodecSingleByte.cpp: (WebCore::tableForEncoding): (WebCore::tableForDecoding): (WebCore::TextCodecSingleByte::registerEncodingNames): (WebCore::TextCodecSingleByte::registerCodecs): * platform/text/TextCodecSingleByte.h: 2020-09-04 Sam Weinig <weinig@apple.com> [WebIDL] Adopt LegacyFactoryFunction extended attribute in lieu of NamedConstructor https://bugs.webkit.org/show_bug.cgi?id=213316 Reviewed by Darin Adler. Rename the following the extended attributes to more closely align with WebIDL: NamedConstructor -> LegacyFactoryFunction ConstructorCallWith -> LegacyFactoryFunctionCallWith ConstructorEnabledBySetting -> LegacyFactoryFunctionEnabledBySetting ConstructorMayThrowException -> LegacyFactoryFunctionMayThrowException Note, ConstructorCallWith, ConstructorEnabledBySetting and ConstructorMayThrowException were only used with NamedConstructors previously as normal constructors don't require interface level extended attributes for these as the extended attribute can be directly on the constructor itself. Ideally, we would do the same with LegacyFactoryFunction by allowing extended attributes on the operator itself like: [ ... LegacyFactoryFunction=[CallWith=Document] Audio(optional [AtomString] DOMString src) ] but this requires changes to the IDLParser (which are straightforward) and creates a lot of additional complexity inside the very hacky preprocess-idls.pl reproducing those parser changes. I will leave that additional cleanup for a subsequent change. * html/HTMLAudioElement.idl: * html/HTMLImageElement.idl: * html/HTMLOptionElement.idl: * html/track/TextTrackCue.idl: Update to use new names. * bindings/js/JSDOMLegacyFactoryFunction.h: Copied from bindings/js/JSDOMNamedConstructor.h. * bindings/js/JSDOMNamedConstructor.h: Removed. * WebCore.xcodeproj/project.pbxproj: Update for rename of JSDOMNamedConstructor.h to JSDOMLegacyFactoryFunction.h * bindings/scripts/CodeGeneratorJS.pm: * bindings/scripts/IDLParser.pm: (applyExtendedAttributeList): * bindings/scripts/preprocess-idls.pl: (GenerateConstructorAttributes): Update IDL processing to handle new names. * bindings/scripts/IDLAttributes.json: Update extended attribute definitions for new names. Removed unused Constructor extended attribute. * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp: Copied from bindings/scripts/test/JS/JSTestNamedConstructor.cpp. * bindings/scripts/test/JS/JSTestLegacyFactoryFunction.h: Copied from bindings/scripts/test/JS/JSTestNamedConstructor.h. * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedConstructor.h: Removed. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestLegacyFactoryFunction.idl: Copied from bindings/scripts/test/TestNamedConstructor.idl. * bindings/scripts/test/TestNamedConstructor.idl: Removed. Update tests for new names. 2020-09-04 Chris Dumez <cdumez@apple.com> Move lazy DisplayLink tear down logic from the WebProcess to the UIProcess https://bugs.webkit.org/show_bug.cgi?id=216195 Reviewed by Simon Fraser. Move lazy DisplayLink tear down logic from the WebProcess to the UIProcess, now that the DisplayLink has been moved to the UIProcess due to sandboxing. After a DisplayLink no longer has any clients, we keep it firing up to 20 times without any clients in case a new client gets added shortly after. The idea was to avoid killing and respawning too many threads when adding and removing clients in quick succession. However, now that the DisplayLink lives in the UIProcess side and sends IPC to the WebProcesses every time it fires, it makes a lot more sense to implement this logic in the UIProcess side, to avoid sending unnecessary IPC to processes that do not care about it. * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitor::displayDidRefresh): * platform/graphics/DisplayRefreshMonitor.h: (WebCore::DisplayRefreshMonitor::shouldBeTerminated const): 2020-09-04 Jer Noble <jer.noble@apple.com> [Cocoa,EME] -outputObscuredDueToInsufficientExternalProtection KVO will set OutputObscured for all attached MediaKeySessions. https://bugs.webkit.org/show_bug.cgi?id=216185 Reviewed by Eric Carlson. When EME clients add licenses that have, for instance, different HDCP level requirements, the keyStatus for each key in the Session (and indeed all attached MediaKeySessions) will be marked as OutputRestricted, since it is impossible to tell from that KVO which key or session was responsible for creating the violation. On platforms where the more granular -willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays: query is available, ignore the KVO from AVSampleBufferDisplayLayer, and rely entirely on the per-request query to determine key status. Drive-by fix: add logging when we receive the -outputObscuredDueToInsufficientExternalProtection KVO notification, and include keyIDs in the keyStatus logging. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WTF::LogArgument<WebCore::CDMInstanceFairPlayStreamingAVFObjC::Keys>::toString): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyRequestHasInsufficientProtectionForDisplayID const): 2020-09-04 Chris Dumez <cdumez@apple.com> Improve interpolation algorithm in OscillatorNode https://bugs.webkit.org/show_bug.cgi?id=216183 Reviewed by Geoffrey Garen. Align our OscillatorNode implementation with Chromium to get us a few more passes on WPT tests. In particular, the following changes were made: - Align detune AudioParam nominal range values with Chromium's. - We now clamp the frequency value to lie within Nyquist frequency. - Use different interpolation algorithms based on frequency. - Split A-Rate / K-Rate processing code into separate functions for clarity. No new tests, rebaselined existing tests. * Modules/webaudio/OscillatorNode.cpp: (WebCore::detuneToFrequencyMultiplier): (WebCore::clampFrequency): (WebCore::OscillatorNode::OscillatorNode): (WebCore::OscillatorNode::calculateSampleAccuratePhaseIncrements): (WebCore::doInterpolation): (WebCore::OscillatorNode::processARate): (WebCore::OscillatorNode::processKRate): (WebCore::OscillatorNode::process): * Modules/webaudio/OscillatorNode.h: 2020-09-04 Sam Weinig <weinig@apple.com> [WebIDL] Remove support for exception interfaces from WebIDL parser and code generators https://bugs.webkit.org/show_bug.cgi?id=216129 Reviewed by Chris Dumez. Replace exception interfaces, only used by DOMException.idl, OverconstrainedError.idl and the tests, with a new "Exception" extended attribute on the interface. The way WebIDL specifies things, the extended attribute should not really be necessary, as the DOMException interface is specifically called out as having special EcmaScript bindings (https://heycam.github.io/webidl/#es-DOMException-specialness), but since OverconstrainedError is currently relying on those semantics, using an extended attribute was a useful tool to maintain parity. * Modules/mediastream/OverconstrainedError.idl: * bindings/scripts/test/TestException.idl: * dom/DOMException.idl: Replace use of special "exception" style interface with Exception extended attribute. * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GenerateImplementation): Replace $interface->isException with $interface->extendedAttributes->{Exception} * bindings/scripts/IDLAttributes.json: Add new Exception attribute. * bindings/scripts/IDLParser.pm: (parseDefinition): (parseDictionaryMembers): (parseDictionaryMember): (parseArgument): (parseArgumentsRest): (parseException): Deleted. (parseExceptionMembers): Deleted. (parseOptionalOrRequiredArgument): Deleted. (parseExceptionMember): Deleted. (parseExceptionField): Deleted. Remove custom exception parsing. Update places using the $nextExceptionField_1 and $nextExceptionMembers_1 to use more clearly named constants. 2020-09-04 Alex Christensen <achristensen@webkit.org> Fix indentation after r266533 https://bugs.webkit.org/show_bug.cgi?id=193274 * dom/TextEncoder.cpp: (WebCore::TextEncoder::encodeInto): * dom/TextEncoder.idl: 2020-09-04 Alex Christensen <achristensen@webkit.org> Align EUC-JP, ISO-2022-JP, and Shift_JIS decoding with Chrome, Firefox, and the specification https://bugs.webkit.org/show_bug.cgi?id=216168 Reviewed by Youenn Fablet. Covered by newly passing web platform tests. * platform/text/EncodingTables.cpp: * platform/text/EncodingTables.h: * platform/text/TextCodecCJK.cpp: (WebCore::WTF_ARRAY_LENGTH): (WebCore::TextCodecCJK::decodeCommon): (WebCore::codePointJIS0208): (WebCore::codePointJIS0212): (WebCore::TextCodecCJK::eucJPDecode): (WebCore::TextCodecCJK::iso2022JPDecode): (WebCore::TextCodecCJK::iso2022JPEncode): (WebCore::TextCodecCJK::shiftJISDecode): (WebCore::TextCodecCJK::eucKRDecode): (WebCore::TextCodecCJK::big5Decode): (WebCore::TextCodecCJK::decode): * platform/text/TextCodecCJK.h: 2020-09-04 Wenson Hsieh <wenson_hsieh@apple.com> Add a fast path in TransformationMatrix::mapRect(const FloatRect&) for affine transformations https://bugs.webkit.org/show_bug.cgi?id=216139 Reviewed by Tim Horton. Add a fast path when mapping 2D points through affine transformation matrices that takes advantage of both: 1. The predetermined 0 and 1 values in affine transformation matrices. 2. The fact that points in the FloatRect are aligned with x and y axes (as opposed to a FloatQuad of 4 arbitrary points), which allows us to avoid mapping all 4 corners of the rect through the matrix. The current implementation of this method maps each of the 4 corners through the transformation matrix, creates a FloatQuad using these 4 transformed points, and then asks the FloatQuad for its bounding box. This requires a total of 26 floating point additions, 24 multiplications and 20 comparisons, as well as a small (but measurable) amount of overhead when creating the FloatPoints and FloatQuad and asking for the bounding rect. We can pare this down to just 8 additions, 8 multiplications, and 4 comparisons by using a different strategy that instead branches on the 4 relevant matrix coefficients `a, b, c, d` (rather than the each of the final x and y coordinates) to determine which of the min or max x and y values to multiply in order to compute the min and max x and y coordinates in the final bounding rect. In a quick microbenchmark that maps FloatRects through an affine TransformationMatrix, this roughly halves the time spent in `TransformationMatrix::mapRect`; on the Multiply subtest of MotionMark (which invokes this method ~17 million times, almost entirely with affine transformation matrices), I measured a ~1% improvement. * platform/graphics/transforms/TransformationMatrix.cpp: (WebCore::TransformationMatrix::mapRect const): 2020-09-03 Darin Adler <darin@apple.com> Simplify some editing code https://bugs.webkit.org/show_bug.cgi?id=216097 Reviewed by Sam Weinig. * dom/ContainerNode.cpp: (WebCore::ContainerNode::replaceAllChildrenWithNewText): If string is empty, don't add a text node. Turns out all callers wanted this behavior. * dom/Node.cpp: (WebCore::Node::setTextContent): Simplify by relying on new behavior of replaceAllChildrenWithNewText when passed an empty string. * editing/ios/EditorIOS.mm: (WebCore::Editor::setTextAsChildOfElement): Use replaceAllChildrenWithNewText instead of the unnecessarily complicated code that was here. Also simplify the VisibeSelection manipulation at the end of the function. * html/HTMLElement.cpp: (WebCore::HTMLElement::setInnerText): Simplify by relying on new behavior of replaceAllChildrenWithNewText when passed an empty string. * page/DOMSelection.cpp: (WebCore::DOMSelection::deleteFromDocument): Simplify by using the selection function that takes a SimpleRange rather than the one that takes two containers and offsets. 2020-09-04 Sam Weinig <weinig@apple.com> [WebIDL] Remove support for the legacycaller special operation type in favor of an extended attribute https://bugs.webkit.org/show_bug.cgi?id=216157 Reviewed by Anders Carlsson. WebIDL no longer specifies the legacycaller special operation type, so to make our parser more closely match the spec, this change removes support for it. Since we still need something for HTMLAllCollection's override of [[Call]], it is replaced with a new extended attribute [LegacyCaller], which has the same semantics as the old special. * bindings/scripts/CodeGeneratorJS.pm: (AddLegacyCallerOperationIfNeeded): * bindings/scripts/IDLAttributes.json: * bindings/scripts/IDLParser.pm: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::jsTestGlobalObjectTestDefaultToJSONConstructorGetter): (WebCore::jsTestGlobalObjectTestDefaultToJSONConstructor): (WebCore::setJSTestGlobalObjectTestDefaultToJSONConstructorSetter): (WebCore::setJSTestGlobalObjectTestDefaultToJSONConstructor): * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestObj.idl: * html/HTMLAllCollection.idl: 2020-09-04 Chris Dumez <cdumez@apple.com> REGRESSION(macOS Big Sur) https://magenta.github.io/lofi-player/ is broken https://bugs.webkit.org/show_bug.cgi?id=216163 <rdar://problem/68198173> Reviewed by Eric Carlson. Address a crash and a backward-compatibility issue on https://magenta.github.io/lofi-player/. Test: webaudio/webkitofflineaudiocontext-startRendering-crash.html * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioListener.idl: * Modules/webaudio/OscillatorNode.idl: Even after fixing the crash, the game would fail to load because it expected window.OscillatorNode to exist. When we started working on modern Web Audio, we renamed the non-standard oscillator node to WebKitOscillatorNode and added a new standards compliant OscillatorNode behind a runtime flag (off by default). As a result, window.OscillatorNode no longer existed on Big Sur, which is not backward compatible. To address the issue, we now expose window.OscillatorNode even if modern unprefixed WebAudio is not enabled and we merely disable its constructor at runtime. The same policy applies to AudioBufferSourceNode & AudioListener because we did the exact same thing for these interfaces. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::startRendering): Make sure we call lazyInitialize() before we start offline rendering. The context may not be initialized yet if no audio nodes were created for this context. This is similar to what is done in our modern Web Audio code in OfflineAudioContext::startOfflineRendering(), which is why the crash was not reproducible when enabling the Modern Web Audio experimental feature. 2020-09-04 Youenn Fablet <youenn@apple.com> Binding generator is not always computing the right interface attributes https://bugs.webkit.org/show_bug.cgi?id=216173 Reviewed by Alex Christensen. Update the regular expression to make sure preprocess-idls.pl computes the right attributes for interfaces. Previously, it was causing issues if a dictionary defined before an interface in the same file had some extended attributes. Add some global objects IDL files to enable binding test coverage. Covered by binding tests and existing layout tests. * bindings/scripts/preprocess-idls.pl: (getInterfaceExtendedAttributesFromIDL): * bindings/scripts/test/BindingTestGlobalConstructors.idl: Added. * bindings/scripts/test/DOMWindow.idl: Added. * bindings/scripts/test/DOMWindowConstructors.idl: Added. * bindings/scripts/test/DedicatedWorkerGlobalScope.idl: Added. * bindings/scripts/test/DedicatedWorkerGlobalScopeConstructors.idl: Added. * bindings/scripts/test/ExposedToWorkerAndWindow.idl: Added. * bindings/scripts/test/JS/JSBindingTestGlobalConstructors.cpp: Added. * bindings/scripts/test/JS/JSBindingTestGlobalConstructors.h: Added. * bindings/scripts/test/JS/JSDOMWindow.cpp: Added. (WebCore::JSDOMWindowConstructor::prototypeForStructure): (WebCore::JSDOMWindowConstructor::initializeProperties): (WebCore::JSDOMWindowPrototype::finishCreation): (WebCore::JSDOMWindow::JSDOMWindow): (WebCore::JSDOMWindow::finishCreation): (WebCore::JSDOMWindow::getConstructor): (WebCore::IDLAttribute<JSDOMWindow>::cast): (WebCore::jsDOMWindowConstructor): (WebCore::setJSDOMWindowConstructor): (WebCore::jsDOMWindowExposedToWorkerAndWindowConstructorGetter): (WebCore::jsDOMWindowExposedToWorkerAndWindowConstructor): (WebCore::setJSDOMWindowExposedToWorkerAndWindowConstructorSetter): (WebCore::setJSDOMWindowExposedToWorkerAndWindowConstructor): (WebCore::jsDOMWindowTestNodeConstructorGetter): (WebCore::jsDOMWindowTestNodeConstructor): (WebCore::setJSDOMWindowTestNodeConstructorSetter): (WebCore::setJSDOMWindowTestNodeConstructor): (WebCore::jsDOMWindowTestObjectConstructorGetter): (WebCore::jsDOMWindowTestObjectConstructor): (WebCore::setJSDOMWindowTestObjectConstructorSetter): (WebCore::setJSDOMWindowTestObjectConstructor): (WebCore::jsDOMWindowTestPromiseRejectionEventConstructorGetter): (WebCore::jsDOMWindowTestPromiseRejectionEventConstructor): (WebCore::setJSDOMWindowTestPromiseRejectionEventConstructorSetter): (WebCore::setJSDOMWindowTestPromiseRejectionEventConstructor): (WebCore::JSDOMWindow::subspaceForImpl): (WebCore::JSDOMWindow::analyzeHeap): (WebCore::toJSNewlyCreated): (WebCore::toJS): (WebCore::JSDOMWindow::toWrapped): * bindings/scripts/test/JS/JSDOMWindow.h: Added. (WebCore::JSDOMWindow::create): (WebCore::JSDOMWindow::createStructure): (WebCore::JSDOMWindow::subspaceFor): (WebCore::JSDOMWindow::wrapped const): (WebCore::toJS): (WebCore::toJSNewlyCreated): * bindings/scripts/test/JS/JSDOMWindowConstructors.cpp: Added. * bindings/scripts/test/JS/JSDOMWindowConstructors.h: Added. * bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.cpp: Added. (WebCore::JSDedicatedWorkerGlobalScopeConstructor::prototypeForStructure): (WebCore::JSDedicatedWorkerGlobalScopeConstructor::initializeProperties): (WebCore::JSDedicatedWorkerGlobalScopePrototype::finishCreation): (WebCore::JSDedicatedWorkerGlobalScope::JSDedicatedWorkerGlobalScope): (WebCore::JSDedicatedWorkerGlobalScope::finishCreation): (WebCore::JSDedicatedWorkerGlobalScope::getConstructor): (WebCore::jsDedicatedWorkerGlobalScopeConstructor): (WebCore::setJSDedicatedWorkerGlobalScopeConstructor): (WebCore::JSDedicatedWorkerGlobalScope::subspaceForImpl): (WebCore::JSDedicatedWorkerGlobalScope::analyzeHeap): * bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.h: Added. (WebCore::JSDedicatedWorkerGlobalScope::create): (WebCore::JSDedicatedWorkerGlobalScope::createStructure): (WebCore::JSDedicatedWorkerGlobalScope::subspaceFor): (WebCore::JSDedicatedWorkerGlobalScope::wrapped const): * bindings/scripts/test/JS/JSDedicatedWorkerGlobalScopeConstructors.cpp: Added. * bindings/scripts/test/JS/JSDedicatedWorkerGlobalScopeConstructors.h: Added. * bindings/scripts/test/JS/JSExposedToWorkerAndWindow.cpp: Added. (WebCore::convertDictionary<ExposedToWorkerAndWindow::Dict>): (WebCore::convertDictionaryToJS): (WebCore::JSExposedToWorkerAndWindowConstructor::construct): (WebCore::JSExposedToWorkerAndWindowConstructor::prototypeForStructure): (WebCore::JSExposedToWorkerAndWindowConstructor::initializeProperties): (WebCore::JSExposedToWorkerAndWindowPrototype::finishCreation): (WebCore::JSExposedToWorkerAndWindow::JSExposedToWorkerAndWindow): (WebCore::JSExposedToWorkerAndWindow::finishCreation): (WebCore::JSExposedToWorkerAndWindow::createPrototype): (WebCore::JSExposedToWorkerAndWindow::prototype): (WebCore::JSExposedToWorkerAndWindow::getConstructor): (WebCore::JSExposedToWorkerAndWindow::destroy): (WebCore::IDLOperation<JSExposedToWorkerAndWindow>::cast): (WebCore::jsExposedToWorkerAndWindowConstructor): (WebCore::setJSExposedToWorkerAndWindowConstructor): (WebCore::jsExposedToWorkerAndWindowPrototypeFunctionDoSomethingBody): (WebCore::jsExposedToWorkerAndWindowPrototypeFunctionDoSomething): (WebCore::JSExposedToWorkerAndWindow::subspaceForImpl): (WebCore::JSExposedToWorkerAndWindow::analyzeHeap): (WebCore::JSExposedToWorkerAndWindowOwner::isReachableFromOpaqueRoots): (WebCore::JSExposedToWorkerAndWindowOwner::finalize): (WebCore::toJSNewlyCreated): (WebCore::toJS): (WebCore::JSExposedToWorkerAndWindow::toWrapped): * bindings/scripts/test/JS/JSExposedToWorkerAndWindow.h: Copied from Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h. (WebCore::JSExposedToWorkerAndWindow::create): (WebCore::JSExposedToWorkerAndWindow::createStructure): (WebCore::JSExposedToWorkerAndWindow::subspaceFor): (WebCore::wrapperOwner): (WebCore::wrapperKey): (WebCore::toJS): (WebCore::toJSNewlyCreated): * bindings/scripts/test/JS/JSPaintWorkletGlobalScope.cpp: Added. (WebCore::JSPaintWorkletGlobalScopeConstructor::prototypeForStructure): (WebCore::JSPaintWorkletGlobalScopeConstructor::initializeProperties): (WebCore::JSPaintWorkletGlobalScopePrototype::finishCreation): (WebCore::JSPaintWorkletGlobalScope::JSPaintWorkletGlobalScope): (WebCore::JSPaintWorkletGlobalScope::finishCreation): (WebCore::JSPaintWorkletGlobalScope::getConstructor): (WebCore::jsPaintWorkletGlobalScopeConstructor): (WebCore::setJSPaintWorkletGlobalScopeConstructor): (WebCore::JSPaintWorkletGlobalScope::subspaceForImpl): (WebCore::JSPaintWorkletGlobalScope::analyzeHeap): * bindings/scripts/test/JS/JSPaintWorkletGlobalScope.h: Added. (WebCore::JSPaintWorkletGlobalScope::create): (WebCore::JSPaintWorkletGlobalScope::createStructure): (WebCore::JSPaintWorkletGlobalScope::subspaceFor): (WebCore::JSPaintWorkletGlobalScope::wrapped const): * bindings/scripts/test/JS/JSPaintWorkletGlobalScopeConstructors.cpp: Added. * bindings/scripts/test/JS/JSPaintWorkletGlobalScopeConstructors.h: Added. * bindings/scripts/test/JS/JSServiceWorkerGlobalScope.cpp: Added. (WebCore::JSServiceWorkerGlobalScopeConstructor::prototypeForStructure): (WebCore::JSServiceWorkerGlobalScopeConstructor::initializeProperties): (WebCore::JSServiceWorkerGlobalScopePrototype::finishCreation): (WebCore::JSServiceWorkerGlobalScope::JSServiceWorkerGlobalScope): (WebCore::JSServiceWorkerGlobalScope::finishCreation): (WebCore::JSServiceWorkerGlobalScope::getConstructor): (WebCore::jsServiceWorkerGlobalScopeConstructor): (WebCore::setJSServiceWorkerGlobalScopeConstructor): (WebCore::JSServiceWorkerGlobalScope::subspaceForImpl): (WebCore::JSServiceWorkerGlobalScope::analyzeHeap): * bindings/scripts/test/JS/JSServiceWorkerGlobalScope.h: Added. (WebCore::JSServiceWorkerGlobalScope::create): (WebCore::JSServiceWorkerGlobalScope::createStructure): (WebCore::JSServiceWorkerGlobalScope::subspaceFor): (WebCore::JSServiceWorkerGlobalScope::wrapped const): * bindings/scripts/test/JS/JSServiceWorkerGlobalScopeConstructors.cpp: Added. * bindings/scripts/test/JS/JSServiceWorkerGlobalScopeConstructors.h: Added. * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::jsTestGlobalObjectDOMWindowConstructorGetter): (WebCore::jsTestGlobalObjectDOMWindowConstructor): (WebCore::setJSTestGlobalObjectDOMWindowConstructorSetter): (WebCore::setJSTestGlobalObjectDOMWindowConstructor): (WebCore::jsTestGlobalObjectDedicatedWorkerGlobalScopeConstructorGetter): (WebCore::jsTestGlobalObjectDedicatedWorkerGlobalScopeConstructor): (WebCore::setJSTestGlobalObjectDedicatedWorkerGlobalScopeConstructorSetter): (WebCore::setJSTestGlobalObjectDedicatedWorkerGlobalScopeConstructor): (WebCore::jsTestGlobalObjectPaintWorkletGlobalScopeConstructorGetter): (WebCore::jsTestGlobalObjectPaintWorkletGlobalScopeConstructor): (WebCore::setJSTestGlobalObjectPaintWorkletGlobalScopeConstructorSetter): (WebCore::setJSTestGlobalObjectPaintWorkletGlobalScopeConstructor): (WebCore::jsTestGlobalObjectServiceWorkerGlobalScopeConstructorGetter): (WebCore::jsTestGlobalObjectServiceWorkerGlobalScopeConstructor): (WebCore::setJSTestGlobalObjectServiceWorkerGlobalScopeConstructorSetter): (WebCore::setJSTestGlobalObjectServiceWorkerGlobalScopeConstructor): (WebCore::jsTestGlobalObjectWorkerGlobalScopeConstructorGetter): (WebCore::jsTestGlobalObjectWorkerGlobalScopeConstructor): (WebCore::setJSTestGlobalObjectWorkerGlobalScopeConstructorSetter): (WebCore::setJSTestGlobalObjectWorkerGlobalScopeConstructor): (WebCore::jsTestGlobalObjectWorkletGlobalScopeConstructorGetter): (WebCore::jsTestGlobalObjectWorkletGlobalScopeConstructor): (WebCore::setJSTestGlobalObjectWorkletGlobalScopeConstructorSetter): (WebCore::setJSTestGlobalObjectWorkletGlobalScopeConstructor): * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructors.h: * bindings/scripts/test/JS/JSWorkerGlobalScope.cpp: Added. (WebCore::JSWorkerGlobalScopeConstructor::prototypeForStructure): (WebCore::JSWorkerGlobalScopeConstructor::initializeProperties): (WebCore::JSWorkerGlobalScopePrototype::finishCreation): (WebCore::JSWorkerGlobalScope::JSWorkerGlobalScope): (WebCore::JSWorkerGlobalScope::finishCreation): (WebCore::JSWorkerGlobalScope::createPrototype): (WebCore::JSWorkerGlobalScope::prototype): (WebCore::JSWorkerGlobalScope::getConstructor): (WebCore::IDLAttribute<JSWorkerGlobalScope>::cast): (WebCore::jsWorkerGlobalScopeConstructor): (WebCore::setJSWorkerGlobalScopeConstructor): (WebCore::jsWorkerGlobalScopeExposedToWorkerAndWindowConstructorGetter): (WebCore::jsWorkerGlobalScopeExposedToWorkerAndWindowConstructor): (WebCore::setJSWorkerGlobalScopeExposedToWorkerAndWindowConstructorSetter): (WebCore::setJSWorkerGlobalScopeExposedToWorkerAndWindowConstructor): (WebCore::jsWorkerGlobalScopeTestNodeConstructorGetter): (WebCore::jsWorkerGlobalScopeTestNodeConstructor): (WebCore::setJSWorkerGlobalScopeTestNodeConstructorSetter): (WebCore::setJSWorkerGlobalScopeTestNodeConstructor): (WebCore::jsWorkerGlobalScopeTestObjectConstructorGetter): (WebCore::jsWorkerGlobalScopeTestObjectConstructor): (WebCore::setJSWorkerGlobalScopeTestObjectConstructorSetter): (WebCore::setJSWorkerGlobalScopeTestObjectConstructor): (WebCore::jsWorkerGlobalScopeTestPromiseRejectionEventConstructorGetter): (WebCore::jsWorkerGlobalScopeTestPromiseRejectionEventConstructor): (WebCore::setJSWorkerGlobalScopeTestPromiseRejectionEventConstructorSetter): (WebCore::setJSWorkerGlobalScopeTestPromiseRejectionEventConstructor): (WebCore::JSWorkerGlobalScope::subspaceForImpl): (WebCore::JSWorkerGlobalScope::analyzeHeap): (WebCore::toJSNewlyCreated): (WebCore::toJS): (WebCore::JSWorkerGlobalScope::toWrapped): * bindings/scripts/test/JS/JSWorkerGlobalScope.h: Added. (WebCore::JSWorkerGlobalScope::create): (WebCore::JSWorkerGlobalScope::createStructure): (WebCore::JSWorkerGlobalScope::subspaceFor): (WebCore::JSWorkerGlobalScope::wrapped const): (WebCore::toJS): (WebCore::toJSNewlyCreated): * bindings/scripts/test/JS/JSWorkerGlobalScopeConstructors.cpp: Added. * bindings/scripts/test/JS/JSWorkerGlobalScopeConstructors.h: Added. * bindings/scripts/test/JS/JSWorkletGlobalScope.cpp: Added. (WebCore::JSWorkletGlobalScopeConstructor::prototypeForStructure): (WebCore::JSWorkletGlobalScopeConstructor::initializeProperties): (WebCore::JSWorkletGlobalScopePrototype::finishCreation): (WebCore::JSWorkletGlobalScope::JSWorkletGlobalScope): (WebCore::JSWorkletGlobalScope::finishCreation): (WebCore::JSWorkletGlobalScope::createPrototype): (WebCore::JSWorkletGlobalScope::prototype): (WebCore::JSWorkletGlobalScope::getConstructor): (WebCore::jsWorkletGlobalScopeConstructor): (WebCore::setJSWorkletGlobalScopeConstructor): (WebCore::JSWorkletGlobalScope::subspaceForImpl): (WebCore::JSWorkletGlobalScope::analyzeHeap): (WebCore::toJSNewlyCreated): (WebCore::toJS): (WebCore::JSWorkletGlobalScope::toWrapped): * bindings/scripts/test/JS/JSWorkletGlobalScope.h: Added. (WebCore::JSWorkletGlobalScope::create): (WebCore::JSWorkletGlobalScope::createStructure): (WebCore::JSWorkletGlobalScope::subspaceFor): (WebCore::JSWorkletGlobalScope::wrapped const): (WebCore::toJS): (WebCore::toJSNewlyCreated): * bindings/scripts/test/JS/JSWorkletGlobalScopeConstructors.cpp: Added. * bindings/scripts/test/JS/JSWorkletGlobalScopeConstructors.h: Added. * bindings/scripts/test/PaintWorkletGlobalScope.idl: Added. * bindings/scripts/test/PaintWorkletGlobalScopeConstructors.idl: Added. * bindings/scripts/test/ServiceWorkerGlobalScope.idl: Added. * bindings/scripts/test/ServiceWorkerGlobalScopeConstructors.idl: Added. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/WorkerGlobalScope.idl: Added. * bindings/scripts/test/WorkerGlobalScopeConstructors.idl: Added. * bindings/scripts/test/WorkletGlobalScope.idl: Added. * bindings/scripts/test/WorkletGlobalScopeConstructors.idl: Added. * dom/TextEncoder.idl: 2020-09-04 Youenn Fablet <youenn@apple.com> Fix Internals::supportsVCPEncoder on BigSur https://bugs.webkit.org/show_bug.cgi?id=216174 Reviewed by Eric Carlson. Fixed by unflaked test. * testing/Internals.cpp: (WebCore::Internals::supportsVCPEncoder): 2020-09-04 Youenn Fablet <youenn@apple.com> MediaRecorder timeslice parameter causing internal error on longer videos https://bugs.webkit.org/show_bug.cgi?id=216076 <rdar://problem/68209422> Reviewed by Eric Carlson. Test: http/wpt/fetch/blob-range.html * platform/network/BlobResourceHandle.cpp: (WebCore::BlobResourceHandle::readDataAsync): 2020-09-04 Youenn Fablet <youenn@apple.com> TextDecoderStreamDecoder.@encoding is broken https://bugs.webkit.org/show_bug.cgi?id=216169 Reviewed by Alex Christensen. Binding generator does not support private attributes. Use a private method instead. Covered by rebased tests. * dom/TextDecoderStream.js: (initializeTextDecoderStream): * dom/TextDecoderStreamDecoder.idl: 2020-09-04 David Kilzer <ddkilzer@apple.com> WebCore::DOMTimerFireState constructor fails to initialize m_initialDOMTreeVersion, m_previous on worker threads <https://webkit.org/b/216085> Reviewed by Darin Adler. * page/DOMTimer.cpp: (WebCore::DOMTimerFireState): - Reorder instance variables so more logic can be moved into the initializer list. 2020-09-04 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Rename LineLayoutContext to LineBuilder https://bugs.webkit.org/show_bug.cgi?id=216166 Reviewed by Antti Koivisto. LineLayoutContext builds the line. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const): (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineLineBuilder.cpp: Renamed from Source/WebCore/layout/inlineformatting/LineLayoutContext.cpp. (WebCore::Layout::endsWithSoftWrapOpportunity): (WebCore::Layout::isAtSoftWrapOpportunity): (WebCore::Layout::nextWrapOpportunity): (WebCore::Layout::LineCandidate::InlineContent::runs const): (WebCore::Layout::LineCandidate::InlineContent::logicalWidth const): (WebCore::Layout::LineCandidate::InlineContent::trailingLineBreak const): (WebCore::Layout::LineCandidate::InlineContent::appendLineBreak): (WebCore::Layout::LineCandidate::InlineContent::setTrailingLineBreak): (WebCore::Layout::LineCandidate::FloatContent::list const): (WebCore::Layout::LineCandidate::FloatContent::intrusiveWidth const): (WebCore::Layout::LineCandidate::InlineContent::appendInlineItem): (WebCore::Layout::LineCandidate::InlineContent::reset): (WebCore::Layout::LineCandidate::FloatContent::append): (WebCore::Layout::LineCandidate::FloatContent::reset): (WebCore::Layout::LineCandidate::reset): (WebCore::Layout::LineBuilder::inlineItemWidth const): (WebCore::Layout::LineBuilder::LineBuilder): (WebCore::Layout::LineBuilder::layoutInlineContent): (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::nextContentForLine): (WebCore::Layout::LineBuilder::commitFloats): (WebCore::Layout::LineBuilder::handleFloatsAndInlineContent): (WebCore::Layout::LineBuilder::commitPartialContent): (WebCore::Layout::LineBuilder::rebuildLine): * layout/inlineformatting/InlineLineBuilder.h: Renamed from Source/WebCore/layout/inlineformatting/LineLayoutContext.h. (WebCore::Layout::LineBuilder::InlineItemRange::isEmpty const): (WebCore::Layout::LineBuilder::InlineItemRange::size const): (WebCore::Layout::LineBuilder::formattingContext const): (WebCore::Layout::LineBuilder::root const): 2020-09-04 Zalan Bujtas <zalan@apple.com> Rename LineBuilder to Line https://bugs.webkit.org/show_bug.cgi?id=216165 Reviewed by Antti Koivisto. This class evolved to the actual line and LineLayoutContext became the LineBuilder. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const): * layout/inlineformatting/InlineLine.cpp: Renamed from Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp. (WebCore::Layout::isWhitespacePreserved): (WebCore::Layout::Line::Line): (WebCore::Layout::Line::~Line): (WebCore::Layout::Line::open): (WebCore::Layout::Line::clearContent): (WebCore::Layout::Line::close): (WebCore::Layout::Line::removeTrailingTrimmableContent): (WebCore::Layout::Line::visuallyCollapsePreWrapOverflowContent): (WebCore::Layout::Line::moveLogicalLeft): (WebCore::Layout::Line::moveLogicalRight): (WebCore::Layout::Line::append): (WebCore::Layout::Line::appendPartialTrailingTextItem): (WebCore::Layout::Line::appendWith): (WebCore::Layout::Line::appendNonBreakableSpace): (WebCore::Layout::Line::appendInlineContainerStart): (WebCore::Layout::Line::appendInlineContainerEnd): (WebCore::Layout::Line::appendTextContent): (WebCore::Layout::Line::appendNonReplacedInlineBox): (WebCore::Layout::Line::appendReplacedInlineBox): (WebCore::Layout::Line::appendLineBreak): (WebCore::Layout::Line::isRunVisuallyNonEmpty const): (WebCore::Layout::Line::formattingContext const): (WebCore::Layout::Line::TrimmableTrailingContent::TrimmableTrailingContent): (WebCore::Layout::Line::TrimmableTrailingContent::addFullyTrimmableContent): (WebCore::Layout::Line::TrimmableTrailingContent::addPartiallyTrimmableContent): (WebCore::Layout::Line::TrimmableTrailingContent::remove): (WebCore::Layout::Line::TrimmableTrailingContent::removePartiallyTrimmableContent): (WebCore::Layout::Line::Run::Run): (WebCore::Layout::Line::Run::expand): (WebCore::Layout::Line::Run::hasTrailingLetterSpacing const): (WebCore::Layout::Line::Run::trailingLetterSpacing const): (WebCore::Layout::Line::Run::removeTrailingLetterSpacing): (WebCore::Layout::Line::Run::removeTrailingWhitespace): (WebCore::Layout::Line::Run::visuallyCollapseTrailingWhitespace): (WebCore::Layout::Line::Run::setExpansionBehavior): (WebCore::Layout::Line::Run::expansionBehavior const): (WebCore::Layout::Line::Run::setHorizontalExpansion): * layout/inlineformatting/InlineLine.h: Renamed from Source/WebCore/layout/inlineformatting/InlineLineBuilder.h. (WebCore::Layout::Line::setHasIntrusiveFloat): (WebCore::Layout::Line::hasIntrusiveFloat const): (WebCore::Layout::Line::isVisuallyEmpty const): (WebCore::Layout::Line::lineLogicalWidth const): (WebCore::Layout::Line::contentLogicalWidth const): (WebCore::Layout::Line::availableWidth const): (WebCore::Layout::Line::trimmableTrailingWidth const): (WebCore::Layout::Line::isTrailingRunFullyTrimmable const): (WebCore::Layout::Line::Run::isText const): (WebCore::Layout::Line::Run::isBox const): (WebCore::Layout::Line::Run::isLineBreak const): (WebCore::Layout::Line::Run::isContainerStart const): (WebCore::Layout::Line::Run::isContainerEnd const): (WebCore::Layout::Line::Run::layoutBox const): (WebCore::Layout::Line::Run::style const): (WebCore::Layout::Line::Run::textContent const): (WebCore::Layout::Line::Run::logicalWidth const): (WebCore::Layout::Line::Run::logicalLeft const): (WebCore::Layout::Line::Run::logicalRight const): (WebCore::Layout::Line::Run::expansion const): (WebCore::Layout::Line::Run::hasExpansionOpportunity const): (WebCore::Layout::Line::Run::expansionOpportunityCount const): (WebCore::Layout::Line::Run::hasTrailingWhitespace const): (WebCore::Layout::Line::Run::trailingWhitespaceWidth const): (WebCore::Layout::Line::Run::moveHorizontally): (WebCore::Layout::Line::Run::shrinkHorizontally): (WebCore::Layout::Line::Run::setNeedsHyphen): (WebCore::Layout::Line::Run::hasCollapsibleTrailingWhitespace const): (WebCore::Layout::Line::Run::hasCollapsedTrailingWhitespace const): (WebCore::Layout::Line::runs const): (WebCore::Layout::Line::contentLogicalRight const): (WebCore::Layout::Line::TrimmableTrailingContent::width const): (WebCore::Layout::Line::TrimmableTrailingContent::isEmpty const): (WebCore::Layout::Line::TrimmableTrailingContent::isTrailingRunFullyTrimmable const): (WebCore::Layout::Line::TrimmableTrailingContent::isTrailingRunPartiallyTrimmable const): (WebCore::Layout::Line::TrimmableTrailingContent::reset): (WebCore::Layout::Line::Run::trailingWhitespaceType const): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::collectHangingContent): (WebCore::Layout::horizontalAlignmentOffset): (WebCore::Layout::LineBox::LineBox): (WebCore::Layout::LineBox::inlineRectForTextRun const): (WebCore::Layout::LineBox::constructInlineBoxes): * layout/inlineformatting/InlineLineBox.h: * layout/inlineformatting/LineLayoutContext.cpp: (WebCore::Layout::LineLayoutContext::layoutInlineContent): (WebCore::Layout::LineLayoutContext::close): (WebCore::Layout::LineLayoutContext::commitFloats): (WebCore::Layout::LineLayoutContext::handleFloatsAndInlineContent): (WebCore::Layout::LineLayoutContext::commitPartialContent): (WebCore::Layout::LineLayoutContext::rebuildLine): * layout/inlineformatting/LineLayoutContext.h: 2020-09-04 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Horizontal alignment should move the inline boxes and not the line box https://bugs.webkit.org/show_bug.cgi?id=216153 Reviewed by Antti Koivisto. When the "text-align" property triggers horizontal alignment, the line content (inline boxes and runs) should be moved horizontally while the line box should stay at the initial top/left position. This patch is also a preparation for making the LineBox more aligned with the spec. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::m_inlineFormattingContext): (WebCore::Layout::LineBox::inlineRectForTextRun const): (WebCore::Layout::LineBox::constructInlineBoxes): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::horizontalAlignmentOffset const): 2020-09-04 Carlos Garcia Campos <cgarcia@igalia.com> [GLIB] Stop using firefox user agent quirk for google docs https://bugs.webkit.org/show_bug.cgi?id=215845 Reviewed by Adrian Perez de Castro. It causes problems with the CSP headers when accounts.youtube.com is used by google login and it no longer works for google docs in any case. * platform/UserAgentQuirks.cpp: (WebCore::isGoogle): (WebCore::urlRequiresFirefoxBrowser): 2020-09-03 Ryosuke Niwa <rniwa@webkit.org> Store all styling flags in m_rendererWithStyleFlags https://bugs.webkit.org/show_bug.cgi?id=216069 Reviewed by Darin Adler. This patch moves all remaining styling flags and Style::Validity from m_nodeFlags to m_rendererWithStyleFlags since CSS JIT no longer rely on these flags directly and CompactPointerTuple has been expanded to store up to 16 bits of data as opposed to just 8 bits. No new tests since there should be no behavioral change. * dom/ContainerNode.h: (WebCore::ContainerNode::directChildNeedsStyleRecalc const): (WebCore::ContainerNode::setDirectChildNeedsStyleRecalc): * dom/Element.cpp: (WebCore::Element::resetStyleRelations): * dom/Element.h: (WebCore::Element::styleAffectedByEmpty const): (WebCore::Element::descendantsAffectedByPreviousSibling const): (WebCore::Element::childrenAffectedByFirstChildRules const): (WebCore::Element::childrenAffectedByLastChildRules const): (WebCore::Element::childrenAffectedByForwardPositionalRules const): (WebCore::Element::descendantsAffectedByForwardPositionalRules const): (WebCore::Element::childrenAffectedByBackwardPositionalRules const): (WebCore::Element::descendantsAffectedByBackwardPositionalRules const): (WebCore::Element::childrenAffectedByPropertyBasedBackwardPositionalRules const): (WebCore::Element::affectsNextSiblingElementStyle const): (WebCore::Element::styleIsAffectedByPreviousSibling const): Moved here from Node. (WebCore::Element::setStyleAffectedByEmpty): (WebCore::Element::setDescendantsAffectedByPreviousSibling): (WebCore::Element::setChildrenAffectedByFirstChildRules): (WebCore::Element::setChildrenAffectedByLastChildRules): (WebCore::Element::setChildrenAffectedByForwardPositionalRules): (WebCore::Element::setDescendantsAffectedByForwardPositionalRules): (WebCore::Element::setChildrenAffectedByBackwardPositionalRules): (WebCore::Element::setDescendantsAffectedByBackwardPositionalRules): (WebCore::Element::setChildrenAffectedByPropertyBasedBackwardPositionalRules): (WebCore::Element::setAffectsNextSiblingElementStyle): (WebCore::Element::setStyleIsAffectedByPreviousSibling): * dom/Node.cpp: (WebCore::Node::adjustStyleValidity): * dom/Node.h: (WebCore::Node::styleValidity const): (WebCore::Node::styleResolutionShouldRecompositeLayer const): (WebCore::Node::childNeedsStyleRecalc const): (WebCore::Node::styleIsAffectedByPreviousSibling const): Moved to Element. (WebCore::Node::setChildNeedsStyleRecalc): (WebCore::Node::flagChildrenAffectedByFirstChildRulesFlag): Deleted. (WebCore::Node::flagChildrenAffectedByLastChildRulesFlag): Deleted. (WebCore::Node::flagAffectsNextSiblingElementStyle): Deleted. (WebCore::Node::flagStyleIsAffectedByPreviousSibling): Deleted. (WebCore::Node::NodeStyleFlag): Added. Moved most of flags from m_nodeFlags here. (WebCore::Node::DynamicStyleRelationFlag): Renamed from ElementStyleFlag. (WebCore::Node::StyleBitfields): Added. A helper struct to read and manipulate bit-fields stored in m_rendererWithStyleFlags. (WebCore::Node::StyleBitfields::fromRaw): Added. (WebCore::Node::StyleBitfields::toRaw): Added. (WebCore::Node::StyleBitfields::styleValidity const): Added. (WebCore::Node::StyleBitfields::setStyleValidity): Added. (WebCore::Node::StyleBitfields::dynamicStyleRelations const): Added. (WebCore::Node::StyleBitfields::setDynamicStyleRelation): Added. (WebCore::Node::StyleBitfields::clearDynamicStyleRelations): Added. (WebCore::Node::StyleBitfields::flags const): Added. (WebCore::Node::StyleBitfields::setFlag): Added. (WebCore::Node::StyleBitfields::clearFlag): Added. (WebCore::Node::StyleBitfields::clearDescendantsNeedStyleResolution): Added. (WebCore::Node::styleBitfields const): Added. (WebCore::Node::setStyleBitfields): Added. (WebCore::Node::hasStyleFlag const): (WebCore::Node::setStyleFlag): (WebCore::Node::clearStyleFlags): Deleted. (WebCore::Node::hasDynamicStyleRelationFlag const): Added. (WebCore::Node::setHasValidStyle): Moved here from the class declaration. (WebCore::Node::setDynamicStyleRelationFlag): Added. (WebCore::Node::clearChildNeedsStyleRecalc): Added. (WebCore::Node::setHasValidStyle): 2020-09-03 Chris Dumez <cdumez@apple.com> Unreviewed, fix debug build after r266570. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::periodicWave): 2020-09-03 Chris Dumez <cdumez@apple.com> Tests using OscillatorNode are flaky https://bugs.webkit.org/show_bug.cgi?id=216152 Reviewed by Darin Adler. OscillatorNode was caching the different kind of PeriodicWaves in global static variables. However, the PeriodicWaves are specific to a given sample rate. As a result, we would sometimes use a cached periodic wave that was using the wrong sample rate, leading to flaky failures. To address the issue, we now cache the periodic waves per audio context instead. No new tests, rebaselined existing tests and unskip them. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::periodicWave): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::setType): * Modules/webaudio/OscillatorNode.h: 2020-09-03 Patrick Angle <pangle@apple.com> Web Inspector fails to preview response from XHR requests https://bugs.webkit.org/show_bug.cgi?id=215852 Reviewed by Devin Rousso. Test: http/tests/inspector/network/fetch-response-body.html Added workaround for 304 XHR/Fetch requests so that the mimeType and content are correctly set, otherwise the frontend does not have the information it needs to preview the response. * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::responseReceived): Storing new ResourceData members (WebCore::NetworkResourcesData::dataForURL): Support for finding a previous non-304 response for a URL. * inspector/NetworkResourcesData.h: (WebCore::NetworkResourcesData::ResourceData::httpStatusText const): (WebCore::NetworkResourcesData::ResourceData::setHTTPStatusText): (WebCore::NetworkResourcesData::ResourceData::mimeType const): (WebCore::NetworkResourcesData::ResourceData::setMIMEType): (WebCore::NetworkResourcesData::ResourceData::responseTimestamp const): (WebCore::NetworkResourcesData::ResourceData::setResponseTimestamp): * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::willSendRequest): Fixed issue where it was possible that we would inform the frontend that a request was of type `Other` even though we had request information indicating it was `XHR` or `Fetch`. (WebCore::InspectorNetworkAgent::didReceiveResponse): Added code path to work around underlying issue where XHR/Fetch 304s are not cached, and end up not passing necessary information to the frontend as a result. 2020-09-03 Chris Dumez <cdumez@apple.com> AudioDestinationNode.maxChannelCount always returns 0 https://bugs.webkit.org/show_bug.cgi?id=216127 Reviewed by Eric Carlson. Update AudioDestinationNode.maxChannelCount to return a sane value on both macOS and iOS. Also make sure the proper exceptions are thrown when trying to create an AudioNode with an invalid number of channels. No new tests, rebaselined existing tests. * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::setChannelCount): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::setChannelCount): * platform/audio/AudioSession.cpp: (WebCore::AudioSession::maximumNumberOfOutputChannels const): * platform/audio/AudioSession.h: * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestination::create): (WebCore::AudioDestination::maxChannelCount): * platform/audio/ios/AudioSessionIOS.mm: (WebCore::AudioSession::maximumNumberOfOutputChannels const): * platform/audio/mac/AudioSessionMac.mm: (WebCore::AudioSession::maximumNumberOfOutputChannels const): 2020-09-03 Chris Dumez <cdumez@apple.com> Make AudioParam.cancelScheduledValues() standards compliant https://bugs.webkit.org/show_bug.cgi?id=216132 Reviewed by Geoffrey Garen. Align our implementation of AudioParam.cancelScheduledValues() with Chromium's to give us a few more passes on WPT tests. In particular, this adds special handling for when the cancelTime lands in the middle of a SetValueCurve event. No new tests, rebaselined existing test. * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::cancelScheduledValues): 2020-09-02 Darin Adler <darin@apple.com> Remove EAffinity, UPSTREAM, DOWNSTREAM, SEL_DEFAULT_AFFINITY, and VisibleSelection::selectionType https://bugs.webkit.org/show_bug.cgi?id=216102 Reviewed by Sam Weinig. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::characterOffsetForTextMarkerData): Use Affinity. * accessibility/AXObjectCache.h: Ditto. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::performTextOperation): Ditto. (WebCore::AccessibilityObject::visiblePositionRangeForUnorderedPositions const): Ditto. (WebCore::AccessibilityObject::visiblePositionRangeForRange const): Ditto. (WebCore::AccessibilityObject::replaceTextInRange): Ditto. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::visiblePositionRangeForLine const): Removed unneeded call to Position::equal, simplified code. (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange const): Use Affinity. (WebCore::AccessibilityRenderObject::visiblePositionForIndex const): Ditto. (WebCore::AccessibilityRenderObject::doAXRangeForLine const): Ditto. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (getSelectionOffsetsForObject): Use Affinity. (wordAtPositionForAtkBoundary): Ditto. (sentenceAtPositionForAtkBoundary): Ditto. (lineAtPositionForAtkBoundary): Ditto. * accessibility/atk/WebKitAccessibleUtil.cpp: (objectFocusedAndCaretOffsetUnignored): Rely on default affinity. * dom/Element.cpp: (WebCore::Element::updateFocusAppearance): Rely on default affinity. * dom/Position.cpp: (WebCore::Position::previousCharacterPosition const): Use Affinity. (WebCore::Position::nextCharacterPosition const): Ditto. (WebCore::Position::leadingWhitespacePosition const): Ditto. (WebCore::Position::trailingWhitespacePosition const): Ditto. (WebCore::Position::inlineBoxAndOffset const): Ditto. * editing/ApplyBlockElementCommand.cpp: (WebCore::ApplyBlockElementCommand::formatSelection): Ditto. * editing/BreakBlockquoteCommand.cpp: (WebCore::BreakBlockquoteCommand::doApply): Ditto. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphWithClones): Rely on default affinity. (WebCore::CompositeEditCommand::moveParagraphs): Ditto. * editing/CreateLinkCommand.cpp: (WebCore::CreateLinkCommand::doApply): Use Affinity. * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::smartDeleteParagraphSpacers): Ditto. (WebCore::DeleteSelectionCommand::doApply): Ditto. * editing/Editing.cpp: (WebCore::firstInSpecialElement): Rely on default affinity. (WebCore::lastInSpecialElement): Ditto. (WebCore::visiblePositionBeforeNode): Ditto. (WebCore::visiblePositionAfterNode): Ditto. (WebCore::visiblePositionForIndexUsingCharacterIterator): Use Affinity. * editing/Editor.cpp: (WebCore::Editor::selectionForCommand): Use Affinity. (WebCore::Editor::canDeleteRange const): Rely on default affinity. (WebCore::Editor::applyStyle): Use isNone and isCaret. (WebCore::Editor::applyParagraphStyle): Ditto. (WebCore::Editor::setComposition): Use Affinity. (WebCore::Editor::advanceToNextMisspelling): Rely on default affinity. (WebCore::Editor::markMisspellingsAfterTypingToWord): Ditto. (WebCore::Editor::markAndReplaceFor): Ditto. Use isCaret. (WebCore::Editor::transpose): Rely on default affinity. (WebCore::Editor::insertTextPlaceholder): Ditto. (WebCore::Editor::removeTextPlaceholder): Ditto. (WebCore::Editor::firstRectForRange const): Ditto. Also simplify rectangle calculation at the end of the function. (WebCore::Editor::shouldChangeSelection const): Use Affinity. (WebCore::Editor::findString): Rely on default affinity. * editing/Editor.h: Use Affinity. * editing/EditorCommand.cpp: (WebCore::executeDeleteToMark): Ditto. (WebCore::executeSelectToMark): Ditto. * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveTo): Ditto. (WebCore::FrameSelection::modify): Ditto. (WebCore::FrameSelection::setBase): Ditto. (WebCore::FrameSelection::setExtent): Ditto. (WebCore::FrameSelection::setSelectedRange): Ditto. (WebCore::FrameSelection::revealSelection): Use isNone and isCaret. (WebCore::FrameSelection::setSelectionFromNone): Rely on default affinity. (WebCore::FrameSelection::expandSelectionToElementContainingCaretSelection): Ditto. * editing/FrameSelection.h: Use Affinity. * editing/IndentOutdentCommand.cpp: (WebCore::IndentOutdentCommand::outdentRegion): Rely on default affinity. * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply): Use Affinity. * editing/InsertNestedListCommand.cpp: (WebCore::InsertNestedListCommand::doApply): Ditto. * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply): Use Affinity. * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::insertTab): Rely on default affinity. * editing/RenderedPosition.cpp: (WebCore::RenderedPosition::RenderedPosition): Use Affinity. * editing/RenderedPosition.h: Ditto. * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply): Rely on default affinity. (WebCore::ReplaceSelectionCommand::completeHTMLReplacement): Use VisibleSelection::defaultAffinity. * editing/TextAffinity.h: Removed EAffinity, UPSTREAM, DOWNSTREAM. * editing/TextIterator.cpp: (WebCore::TextIterator::shouldRepresentNodeOffsetZero): Rely on default affinity. * editing/TypingCommand.cpp: (WebCore::TypingCommand::makeEditableRootEmpty): Use Affinity. (WebCore::TypingCommand::deleteKeyPressed): Use isCaretOrRange and isRange. (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto. * editing/VisiblePosition.cpp: (WebCore::VisiblePosition::VisiblePosition): Use Affinity. (WebCore::VisiblePosition::previous const): Rely on default affinity. (WebCore::VisiblePosition::left const): Ditto. (WebCore::VisiblePosition::right const): Ditto. (WebCore::operator<<): Use Affinity. * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::VisibleSelection): Use Affinity. Also use initialize in the class definition. (WebCore::VisibleSelection::selectionFromContentsOfNode): Rely on default affinity. (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity): Rename from "pos" to "position". (WebCore::VisibleSelection::updateSelectionType): Update from m_selectionType to m_type and use Affinity. (WebCore::VisibleSelection::validate): Use isRange. (WebCore::VisibleSelection::setWithoutValidation): Use Affinity and m_type. * editing/VisibleSelection.h: Removed SEL_DEFAULT_AFFINITY, replacing it with VisibleSelection::defaultAffinity. Removed both VisibleSelection::SelectionType and VisibleSelection::selectionType, replacing with private VisibleSelection::Type. Also renamed m_selectionType to m_type. * editing/VisibleUnits.cpp: (WebCore::logicallyPreviousBox): Use Affinity. (WebCore::logicallyNextBox): Ditto. (WebCore::previousLinePosition): Rely on default affinity. (WebCore::nextLinePosition): Ditto. (WebCore::startOfParagraph): Ditto. (WebCore::endOfParagraph): Ditto. (WebCore::withinTextUnitOfGranularity): Use Affinity. (WebCore::enclosingTextUnitOfGranularity): Ditto. * editing/cocoa/DictionaryLookup.mm: (WebCore::DictionaryLookup::rangeAtHitTestResult): Use isRange. * loader/EmptyClients.cpp: Use Affinity. * page/DOMSelection.cpp: (WebCore::DOMSelection::collapse): Ditto. (WebCore::DOMSelection::collapseToEnd): Ditto. (WebCore::DOMSelection::collapseToStart): Ditto. (WebCore::DOMSelection::setBaseAndExtent): Ditto. (WebCore::DOMSelection::setPosition): Ditto. (WebCore::DOMSelection::extend): Ditto. * page/EditorClient.h: Ditto. * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEventSingleClick): Rely on default affinity. * page/FocusController.cpp: (WebCore::FocusController::advanceFocusInDocumentOrder): Use constructor that takes a single Position and Affinity. * page/Page.cpp: (WebCore::replaceRanges): Use Affinity. * page/ios/FrameIOS.mm: (WebCore::Frame::interpretationsForCurrentRoot const): Use isNone. * rendering/RenderBlock.cpp: (WebCore::positionForPointRespectingEditingBoundaries): Use Affinity. (WebCore::RenderBlock::positionForPoint): Ditto. * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::positionForPointWithInlineChildren): Ditto. * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::positionForPoint): Ditto. * rendering/RenderObject.cpp: (WebCore::RenderObject::positionForPoint): Ditto. (WebCore::RenderObject::createVisiblePosition const): Ditto. * rendering/RenderObject.h: Ditto. * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::positionForPoint): Ditto. * rendering/RenderTextLineBoxes.cpp: (WebCore::RenderTextLineBoxes::positionForPoint const): Ditto. * rendering/RenderTreeAsText.cpp: (WebCore::writeSelection): Ditto. * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::positionForPoint): Ditto. * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::positionForPoint): Ditto. 2020-09-03 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r266498. https://bugs.webkit.org/show_bug.cgi?id=216143 crashes in debug Reverted changeset: "Simplify some editing code" https://bugs.webkit.org/show_bug.cgi?id=216097 https://trac.webkit.org/changeset/266498 2020-09-03 Frank Yang <guowei_yang@apple.com> CoreImage Implementation of SourceGraphic and saturate(), hue-rotate(), grayscale() and sepia() https://bugs.webkit.org/show_bug.cgi?id=213673 Reviewed by Darin Adler, Simon Fraser. Tests: css3/filters/effect-grayscale-square.html css3/filters/effect-hue-rotate-square.html css3/filters/effect-saturate-square.html css3/filters/effect-sepia-square.html Added CoreImage implementation of SourceGraphic and partial of FEColorMatrix, which is used to implement sepia(), grayscale() hue-rotate() and saturate(). Also added CIFilter caching, by storing CIFilters in a hash map, where the key is the level of traversal (an integer). * platform/graphics/coreimage/FilterEffectRendererCoreImage.h: Imported FEColorMatrix.h and SourceGraphic.h; added function getCIContext() that returns a static copy of CIContext. * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm: (WebCore::FilterEffectRendererCoreImage::getCIContext): Creating a CIContext is expensive. Instead of creating a CIContext on each frame update, we just use a static singleton on every draw (WebCore::FilterEffectRendererCoreImage::supportsCoreImageRendering): the function now returns true if the filter chain contains SourceGraphic and FEColorMatrix of TYPE_MATRIX, TYPE_SATURATE and TYPE_HUEROTATE (WebCore::FilterEffectRendererCoreImage::connectCIFilters): Made slight changes to wrap Obj-C pointers in RetainPtr (WebCore::FilterEffectRendererCoreImage::imageForSourceGraphic): Use the source image to create a CIImage and return it. If the source image is backed by IOSurface, we create a CIImage directly from the IOSurface; otherwise we create a CIImage by getting the NativeImagePtr from source image. (WebCore::FilterEffectRendererCoreImage::imageForFEColorMatrix): Based on the type of the matrix and input parameter, create different types of CIColorMatrix filers that are used to implement sepia, grayscale, hue-rotate, saturate (WebCore::FilterEffectRendererCoreImage::output const): Added a logging line (WebCore::FilterEffectRendererCoreImage::renderToImageBuffer): Minor refactors (WebCore::FilterEffectRendererCoreImage::clearResult): (WebCore::FilterEffectRendererCoreImage::FilterEffectRendererCoreImage): * platform/graphics/filters/FEColorMatrix.h: (isType): added SPECIALIZE_TYPE_TRAITS so that we can downcast to FEColorMatrix * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::requestedRegionOfInputImageData const): removed ASSERT(hasResult()); from the function, because CoreImage path wouldn't create image buffers inside FilterEffect, but CI path still needs to consult this function to obtain geometry info * platform/graphics/filters/FilterEffect.h: (WebCore::FilterEffect::filterEffectClassType const): Made the function a const (WebCore::FilterEffect::normalizedFloats): Changed this function to public since it is consulted in FilterEffectCoreImageRenderer. (WebCore::FilterEffect::filterEffectClassType): Deleted. * platform/graphics/filters/SourceGraphic.h: (isType): added SPECIALIZE_TYPE_TRAITS so that we can downcast to SourceGraphic * rendering/CSSFilter.cpp: (WebCore::CSSFilter::build): Checks whether m_filterRenderer is already created, no need to re-create if the pointer is non-null (WebCore::CSSFilter::allocateBackingStoreIfNeeded): If we are using m_filterRenderer, which is currently using CoreImage and relies on IOSurfaces, we ask source image to use IOSurface for performance concerns. 2020-09-03 Chris Dumez <cdumez@apple.com> BiquadFilterNode.getFrequencyResponse() should return NaN for out-of-bounds frequencies https://bugs.webkit.org/show_bug.cgi?id=216130 Reviewed by Eric Carlson. BiquadFilterNode.getFrequencyResponse() should return NaN for out-of-bounds frequencies. No new tests, rebaselined existing test. * platform/audio/Biquad.cpp: (WebCore::Biquad::getFrequencyResponse): 2020-09-03 Devin Rousso <drousso@apple.com> Web Inspector: allow url breakpoints to be configured https://bugs.webkit.org/show_bug.cgi?id=215793 Reviewed by Brian Burg. Tests: inspector/dom-debugger/url-breakpoints.html inspector/dom-debugger/url-breakpoints-all-requests.html inspector/dom-debugger/url-breakpoints-containing.html inspector/dom-debugger/url-breakpoints-matching.html * inspector/agents/InspectorDOMDebuggerAgent.h: * inspector/agents/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::disable): (WebCore::InspectorDOMDebuggerAgent::setURLBreakpoint): (WebCore::InspectorDOMDebuggerAgent::removeURLBreakpoint): (WebCore::InspectorDOMDebuggerAgent::breakOnURLIfNeeded): 2020-09-03 Alex Christensen <achristensen@webkit.org> Implement TextEncoder's encodeInto() https://bugs.webkit.org/show_bug.cgi?id=193274 Reviewed by Darin Adler. Covered by newly passing web platform tests. * bindings/js/JSDOMConvertBufferSource.h: (WebCore::JSConverter<IDLUint8Array>::convertNewlyCreated): * dom/TextEncoder.cpp: (WebCore::TextEncoder::encodeInto): * dom/TextEncoder.h: * dom/TextEncoder.idl: 2020-09-03 David Kilzer <ddkilzer@apple.com> REGRESSION (r237835): WebCore::TextDecorationThickness constructor fails to initialize m_length <https://webkit.org/b/216092> Reviewed by Tim Horton. * rendering/style/TextDecorationThickness.h: (WebCore::TextDecorationThickness): - Add default initializer for m_length. 2020-09-03 Alex Christensen <achristensen@webkit.org> TextDecoder should ignore byte-order-mark like other browsers and spec https://bugs.webkit.org/show_bug.cgi?id=216108 Reviewed by Darin Adler. Covered by newly passing web platform tests. * dom/TextDecoder.cpp: (WebCore::TextDecoder::ignoreBOMIfNecessary): (WebCore::TextDecoder::decode): (WebCore::TextDecoder::prependBOMIfNecessary): Deleted. * dom/TextDecoder.h: 2020-09-03 Alex Christensen <achristensen@webkit.org> Align ISO-8859-{3,6,7,8,8-I} and windows-{874,1253,1255,1257} encodings with Chrome, Firefox, and the specification https://bugs.webkit.org/show_bug.cgi?id=216094 Reviewed by Darin Adler. Covered by newly passing web platform tests. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/text/TextCodec.h: * platform/text/TextCodecCJK.cpp: (WebCore::Function<void): * platform/text/TextCodecICU.cpp: (WebCore::TextCodecICU::registerCodecs): * platform/text/TextCodecSingleByte.cpp: Added. (WebCore::tableForDecoding): (WebCore::tableForEncoding): (WebCore::TextCodecSingleByte::encode): (WebCore::TextCodecSingleByte::decode): (WebCore::TextCodecSingleByte::TextCodecSingleByte): (WebCore::TextCodecSingleByte::registerEncodingNames): (WebCore::TextCodecSingleByte::registerCodecs): * platform/text/TextCodecSingleByte.h: Copied from Source/WebCore/platform/text/TextCodec.h. 2020-09-03 Antoine Quint <graouts@webkit.org> Consecutive requestAnimationFrame callbacks may be passed the same timestamp https://bugs.webkit.org/show_bug.cgi?id=216122 <rdar://problem/68269445> Reviewed by Simon Fraser. Test: fast/animation/request-animation-frame-unique-timestamp.html Ensure that the page only sees increasing timestamps in requestAnimationFrame() callbacks. * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::shouldRescheduleRequestAnimationFrame const): 2020-09-03 Aditya Keerthi <akeerthi@apple.com> [macOS] Support stepping using keyboard in date inputs https://bugs.webkit.org/show_bug.cgi?id=216090 Reviewed by Darin Adler. Users should be able to step through dates using the up and down arrow keys, matching the functionality of NSDatePicker. To achieve this functionality, stepUp and stepDown methods were added to DateTimeFieldElement, incrementing and decrementing the value of the focused field on an up arrow keypress and a down arrow keypress respectively. If the currently focused field is empty during the keypress, stepping up will start from the minimum value and stepping down will start from the maximum value. Covered by a new test case in an existing test file. * html/shadow/DateTimeFieldElement.cpp: (WebCore::DateTimeFieldElement::defaultKeyboardEventHandler): * html/shadow/DateTimeFieldElement.h: * html/shadow/DateTimeNumericFieldElement.cpp: (WebCore::DateTimeNumericFieldElement::setValueAsIntegerByStepping): (WebCore::DateTimeNumericFieldElement::stepDown): (WebCore::DateTimeNumericFieldElement::stepUp): * html/shadow/DateTimeNumericFieldElement.h: * html/shadow/DateTimeSymbolicFieldElement.cpp: (WebCore::DateTimeSymbolicFieldElement::stepDown): (WebCore::DateTimeSymbolicFieldElement::stepUp): * html/shadow/DateTimeSymbolicFieldElement.h: 2020-09-03 Sam Weinig <weinig@apple.com> Update WebIDL parser to more closely align with current WebIDL spec https://bugs.webkit.org/show_bug.cgi?id=216089 Reviewed by Chris Dumez. Major changes are: - 'implements' keyword is now called 'includes' (this is the only observable change). - Added support for parsing namespaces, async iterable, partial mixins and ObservableArray, though the code generators don't support them yet, so they just clearly error out. - Update list of keywords that can be used as argument names. - Update parser to use the current terminology from WebIDL. - Added more comments to be clear what next steps to take such as removing legacy constructs like serializer, exception, legacycaller and moving synthetic operation additions from the parser to the code generators. * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchResponse.idl: * bindings/scripts/IDLParser.pm: (Parse): (applyTypedefs): (parseDefinition): (parseCallbackOrInterfaceOrMixin): (parseCallbackRestOrInterface): (parseInterfaceOrMixin): (parseInterface): (parseNamespace): (parseNamespaceMembers): (parseNamespaceMember): (parsePartialDefinition): (parsePartialInterfaceOrPartialMixin): (parsePartialInterface): (parsePartialInterfaceMembers): (parsePartialInterfaceMember): (parseInterfaceMember): (parsePartialDictionary): (parseIncludesStatement): (parseInheritAttribute): (parseOperation): (parseRegularOperation): (parseSpecial): (parseAsyncIterable): (parseOptionalIterableInterface): (parseArgumentNameKeyword): (parseDistinguishableType): (parseConstType): (parsePrimitiveType): (applyMemberList): (parseCallbackOrInterface): Deleted. (parseImplementsStatement): Deleted. (parseOperationOrReadWriteAttributeOrMaplike): Deleted. (parseReadWriteAttribute): Deleted. (parseInherit): Deleted. * bindings/scripts/preprocess-idls.pl: (getIncludedInterfacesFromIDL): (getImplementedInterfacesFromIDL): Deleted. * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::construct): (WebCore::jsTestInterfaceConstructorIncludesStaticReadOnlyAttrGetter): (WebCore::jsTestInterfaceConstructorIncludesStaticReadOnlyAttr): (WebCore::jsTestInterfaceConstructorIncludesStaticAttrGetter): (WebCore::jsTestInterfaceConstructorIncludesStaticAttr): (WebCore::setJSTestInterfaceConstructorIncludesStaticAttrSetter): (WebCore::setJSTestInterfaceConstructorIncludesStaticAttr): (WebCore::jsTestInterfaceIncludesStr1Getter): (WebCore::jsTestInterfaceIncludesStr1): (WebCore::jsTestInterfaceIncludesStr2Getter): (WebCore::jsTestInterfaceIncludesStr2): (WebCore::setJSTestInterfaceIncludesStr2Setter): (WebCore::setJSTestInterfaceIncludesStr2): (WebCore::jsTestInterfaceIncludesStr3Getter): (WebCore::jsTestInterfaceIncludesStr3): (WebCore::setJSTestInterfaceIncludesStr3Setter): (WebCore::setJSTestInterfaceIncludesStr3): (WebCore::jsTestInterfaceIncludesNodeGetter): (WebCore::jsTestInterfaceIncludesNode): (WebCore::setJSTestInterfaceIncludesNodeSetter): (WebCore::setJSTestInterfaceIncludesNode): (WebCore::jsTestInterfacePrototypeFunctionIncludesMethod1Body): (WebCore::jsTestInterfacePrototypeFunctionIncludesMethod1): (WebCore::jsTestInterfacePrototypeFunctionIncludesMethod2Body): (WebCore::jsTestInterfacePrototypeFunctionIncludesMethod2): (WebCore::jsTestInterfacePrototypeFunctionIncludesMethod3Body): (WebCore::jsTestInterfacePrototypeFunctionIncludesMethod3): (WebCore::jsTestInterfaceConstructorFunctionIncludesMethod4Body): (WebCore::jsTestInterfaceConstructorFunctionIncludesMethod4): (WebCore::jsTestInterfaceConstructorImplementsStaticReadOnlyAttrGetter): Deleted. (WebCore::jsTestInterfaceConstructorImplementsStaticReadOnlyAttr): Deleted. (WebCore::jsTestInterfaceConstructorImplementsStaticAttrGetter): Deleted. (WebCore::jsTestInterfaceConstructorImplementsStaticAttr): Deleted. (WebCore::setJSTestInterfaceConstructorImplementsStaticAttrSetter): Deleted. (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr): Deleted. (WebCore::jsTestInterfaceImplementsStr1Getter): Deleted. (WebCore::jsTestInterfaceImplementsStr1): Deleted. (WebCore::jsTestInterfaceImplementsStr2Getter): Deleted. (WebCore::jsTestInterfaceImplementsStr2): Deleted. (WebCore::setJSTestInterfaceImplementsStr2Setter): Deleted. (WebCore::setJSTestInterfaceImplementsStr2): Deleted. (WebCore::jsTestInterfaceImplementsStr3Getter): Deleted. (WebCore::jsTestInterfaceImplementsStr3): Deleted. (WebCore::setJSTestInterfaceImplementsStr3Setter): Deleted. (WebCore::setJSTestInterfaceImplementsStr3): Deleted. (WebCore::jsTestInterfaceImplementsNodeGetter): Deleted. (WebCore::jsTestInterfaceImplementsNode): Deleted. (WebCore::setJSTestInterfaceImplementsNodeSetter): Deleted. (WebCore::setJSTestInterfaceImplementsNode): Deleted. (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod1Body): Deleted. (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod1): Deleted. (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2Body): Deleted. (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2): Deleted. (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod3Body): Deleted. (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod3): Deleted. (WebCore::jsTestInterfaceConstructorFunctionImplementsMethod4Body): Deleted. (WebCore::jsTestInterfaceConstructorFunctionImplementsMethod4): Deleted. * bindings/scripts/test/JS/JSTestInterface.h: * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestImplements.idl: Removed. * bindings/scripts/test/TestIncludes.idl: Copied from Source/WebCore/bindings/scripts/test/TestImplements.idl. * bindings/scripts/test/TestInterface.idl: * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestOperationConditional.idl: * dom/CharacterData.idl: * dom/DeviceMotionEvent.idl: * dom/DeviceOrientationEvent.idl: * dom/Document.idl: * dom/DocumentFragment.idl: * dom/DocumentType.idl: * dom/Element.idl: * dom/ShadowRoot.idl: * dom/Text.idl: * html/HTMLAnchorElement.idl: * html/HTMLAreaElement.idl: * html/HTMLBodyElement.idl: * html/HTMLElement.idl: * html/HTMLFrameSetElement.idl: * html/canvas/CanvasRenderingContext2D.idl: * html/canvas/OffscreenCanvasRenderingContext2D.idl: * html/canvas/PaintRenderingContext2D.idl: * html/canvas/Path2D.idl: * html/canvas/WebGL2RenderingContext.idl: * html/canvas/WebGLRenderingContext.idl: * page/DOMWindow.idl: * page/Navigator.idl: * page/WorkerNavigator.idl: * svg/SVGAElement.idl: * svg/SVGAltGlyphElement.idl: * svg/SVGAnimationElement.idl: * svg/SVGCursorElement.idl: * svg/SVGElement.idl: * svg/SVGFEBlendElement.idl: * svg/SVGFEColorMatrixElement.idl: * svg/SVGFEComponentTransferElement.idl: * svg/SVGFECompositeElement.idl: * svg/SVGFEConvolveMatrixElement.idl: * svg/SVGFEDiffuseLightingElement.idl: * svg/SVGFEDisplacementMapElement.idl: * svg/SVGFEDropShadowElement.idl: * svg/SVGFEFloodElement.idl: * svg/SVGFEGaussianBlurElement.idl: * svg/SVGFEImageElement.idl: * svg/SVGFEMergeElement.idl: * svg/SVGFEMorphologyElement.idl: * svg/SVGFEOffsetElement.idl: * svg/SVGFESpecularLightingElement.idl: * svg/SVGFETileElement.idl: * svg/SVGFETurbulenceElement.idl: * svg/SVGFilterElement.idl: * svg/SVGGlyphRefElement.idl: * svg/SVGGradientElement.idl: * svg/SVGGraphicsElement.idl: * svg/SVGImageElement.idl: * svg/SVGMPathElement.idl: * svg/SVGMarkerElement.idl: * svg/SVGMaskElement.idl: * svg/SVGPatternElement.idl: * svg/SVGSVGElement.idl: * svg/SVGScriptElement.idl: * svg/SVGSymbolElement.idl: * svg/SVGTRefElement.idl: * svg/SVGTextPathElement.idl: * svg/SVGUseElement.idl: * svg/SVGViewElement.idl: * svg/SVGViewSpec.idl: * workers/Worker.idl: * workers/WorkerGlobalScope.idl: * workers/service/ServiceWorker.idl: 2020-09-03 Alex Christensen <achristensen@webkit.org> Align EUC-KR encoding with Chrome, Firefox, and specification https://bugs.webkit.org/show_bug.cgi?id=216081 Reviewed by Darin Adler. Covered by web platform tests. * platform/text/EncodingTables.cpp: * platform/text/EncodingTables.h: * platform/text/TextCodecCJK.cpp: (WebCore::TextCodecCJK::registerEncodingNames): (WebCore::TextCodecCJK::registerCodecs): (WebCore::eucKREncodingIndex): (WebCore::eucKREncode): (WebCore::TextCodecCJK::eucKRDecode): (WebCore::TextCodecCJK::decode): (WebCore::TextCodecCJK::encode): * platform/text/TextCodecCJK.h: * platform/text/TextCodecICU.cpp: (WebCore::TextCodecICU::registerCodecs): 2020-09-03 Chris Dumez <cdumez@apple.com> Make our implementation of ChannelMergerNode standards compliant https://bugs.webkit.org/show_bug.cgi?id=216113 Reviewed by Darin Adler. This aligns our implementation of ChannelMergerNode with Chromium's, allowing us to pass more web platform tests. No new tests, rebaselined existing tests. * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::disableOutputsIfNecessary): (WebCore::AudioNode::disableOutputs): * Modules/webaudio/AudioNode.h: Split disableOutputs() out of disableOutputsIfNecessary() so that it can be called directly. * Modules/webaudio/AudioNodeInput.cpp: (WebCore::AudioNodeInput::connect): * Modules/webaudio/AudioNodeOutput.h: (WebCore::AudioNodeOutput::isEnabled const): When connected to an output, AudioNodeInput keeps the output either in m_outputs when the output is enabled, m_disabledOutputs when it is disabled. AudioNodeInput's enable() & disable() take care of moving the output from one map to another. However, connect() would assume that the output we're connecting to is enabled and add it to m_outputs unconditionally. This was causing an assertion to get hit in enable() later on because the output we're trying to enable was not in m_disabledOutputs (because it was already in m_outputs). This change is needed because the ChannelMergerNode now disables its output right away, before it is connected. * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::ChannelMergerNode): Make sure that the output has a number of channels equal to the number of inputs. Initially disable outputs so that we output a single silent channel until something is connected. (WebCore::ChannelMergerNode::process): * Modules/webaudio/ChannelMergerNode.h: Simplify code now that the number of inputs is equal to output's number of channels. 2020-09-03 Alex Christensen <achristensen@webkit.org> Use unicode macros instead of manual range checks in TextCodecUTF16 https://bugs.webkit.org/show_bug.cgi?id=216098 Reviewed by Darin Adler. No change in behavior. Just responding to feedback from bug 216058. * platform/text/TextCodecSingleByte.cpp: Added. (WebCore::tableForDecoding): (WebCore::tableForEncoding): (WebCore::TextCodecSingleByte::encode): (WebCore::TextCodecSingleByte::decode): (WebCore::TextCodecSingleByte::TextCodecSingleByte): (WebCore::TextCodecSingleByte::registerEncodingNames): (WebCore::TextCodecSingleByte::registerCodecs): * platform/text/TextCodecSingleByte.h: Added. * platform/text/TextCodecUTF16.cpp: (WebCore::TextCodecUTF16::decode): 2020-09-03 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for vertical-align: text-bottom https://bugs.webkit.org/show_bug.cgi?id=215538 <rdar://problem/67613372> Reviewed by Antti Koivisto. See https://www.w3.org/TR/css-inline-3/#propdef-alignment-baseline (align with the baseline + descent of the parent inline box) Test: fast/layoutformattingcontext/vertical-align-bottom-nested.html * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::computeInlineBoxesLogicalHeight): (WebCore::Layout::LineBox::alignInlineBoxesVerticallyAndComputeLineBoxHeight): 2020-09-03 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for vertical-align: text-top https://bugs.webkit.org/show_bug.cgi?id=215545 <rdar://problem/67629969> Reviewed by Antti Koivisto. See https://www.w3.org/TR/css-inline-3/#propdef-alignment-baseline (align with the baseline + ascent of the parent inline box) Test: fast/layoutformattingcontext/vertical-align-top-nested.html * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::computeInlineBoxesLogicalHeight): (WebCore::Layout::LineBox::alignInlineBoxesVerticallyAndComputeLineBoxHeight): 2020-09-03 Aditya Keerthi <akeerthi@apple.com> [macOS] Add disabled and readonly behaviors to date inputs https://bugs.webkit.org/show_bug.cgi?id=216005 Reviewed by Devin Rousso. Added methods to EditControlOwner and FieldOwner so that DateTimeEditElement and DateTimeFieldElement are aware of the readonly and disabled states of their containing element. Disabled inputs should not be focusable and should not respond to any keyboard events. On the other hand, readonly inputs should respond to some keyboard events (such as left arrow, right arrow, and the tab key), but should not be editable. * css/html.css: Updated to add GrayText color for disabled fields. (input[disabled]::-webkit-datetime-edit-year-field,): * html/BaseChooserOnlyDateAndTimeInputType.cpp: (WebCore::BaseChooserOnlyDateAndTimeInputType::isEditControlOwnerDisabled const): (WebCore::BaseChooserOnlyDateAndTimeInputType::isEditControlOwnerReadOnly const): * html/BaseChooserOnlyDateAndTimeInputType.h: * html/shadow/DateTimeEditElement.cpp: (WebCore::DateTimeEditElement::isFieldOwnerDisabled const): (WebCore::DateTimeEditElement::isFieldOwnerReadOnly const): * html/shadow/DateTimeEditElement.h: * html/shadow/DateTimeFieldElement.cpp: (WebCore::DateTimeFieldElement::defaultEventHandler): If the owning element is disabled or readonly, elide a call to handleKeyboardEvent, which is implemented by subclasses to achieve editability. (WebCore::DateTimeFieldElement::defaultKeyboardEventHandler): Disabled inputs should not respond to any events. (WebCore::DateTimeFieldElement::isFieldOwnerDisabled const): (WebCore::DateTimeFieldElement::isFieldOwnerReadOnly const): (WebCore::DateTimeFieldElement::isFocusable const): Disabled inputs should not be focusable. * html/shadow/DateTimeFieldElement.h: 2020-09-03 Wenson Hsieh <wenson_hsieh@apple.com> Make TransformationMatrix::inverse() faster in the case of affine transformation matrices https://bugs.webkit.org/show_bug.cgi?id=216101 Reviewed by Tim Horton. The Multiply subtest of MotionMark places a large number of elements that are all rotated by some angle; when painting these, we currently spend about 7% of the time under `RenderLayer::paintLayerByApplyingTransform` just inverting the transformation matrix (underneath `TransformationMatrix::inverse()`) so that we can map the bounds of the dirty rect through this inverse. `TransformationMatrix::inverse()` currently has a fast path for identity and translation matrices that avoids having to fall back to the generalized 4-by-4 matrix inverse equation; this generalized algorithm works by dividing the entire adjoint matrix by the determinant, a process that involves nearly 1000 floating point additions and multiplications. However, in this case, all of the matrices are a combination of translations and rotations, which all result in affine transformations. As such, there's no need to fall back to the generalized algorithm for computing the inverse; instead, we can bail early with simpler strategy that only requires 15 floating point additions and multiplications. We can also take advantange of the fact that we currently go through most of the entries in the 4x4 matrix to determine whether the matrix is an identity or translation matrix, by introducing a new helper method that returns not only whether the matrix is the identity matrix or translation, but also whether the matrix is affine (by the definition of `TransformationMatrix::isAffine()`). Since most of the entries that need to be 1 or 0 in order for a matrix to be a translation matrix vs. just an affine transformation matrix are the same, this helps avoid some redundant checks in `TransformationMatrix::inverse()`. We also apply a similar optimization to `TransformationMatrix::isInvertible()`, reducing the multiplications and additions from roughly 200 to just 3. I measured this locally to be a (statistically significant) 2% improvement on Multiply. * platform/graphics/transforms/TransformationMatrix.cpp: (WebCore::TransformationMatrix::isInvertible const): (WebCore::TransformationMatrix::inverse const): * platform/graphics/transforms/TransformationMatrix.h: (WebCore::TransformationMatrix::type const): 2020-09-03 Youenn Fablet <youenn@apple.com> Expose RTCPeerConnection.restartIce https://bugs.webkit.org/show_bug.cgi?id=216072 Reviewed by Darin Adler. Add plubming code to expose restartIce. Covered by rebased test. * Modules/mediastream/PeerConnectionBackend.h: * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::restartIce): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::restartIce): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: 2020-09-03 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support nested inline box sizing and positioning https://bugs.webkit.org/show_bug.cgi?id=215748 Reviewed by Antti Koivisto. This patch splits the line box construction process into a few distinct steps. 1. Construct the inline boxes as needed. There's always a root inline box. 2. Size them by taking the vertical alignment into account - child inline boxes stretch their parent inline boxes in most cases (depending on the vertical-align property value). 3. Position the inline boxes relative to the line box. Test: fast/layoutformattingcontext/vertical-align-middle-nested.html fast/layoutformattingcontext/vertical-align-middle-simple.html * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::m_inlineFormattingContext): (WebCore::Layout::LineBox::inlineRectForTextRun const): (WebCore::Layout::LineBox::constructInlineBoxes): (WebCore::Layout::LineBox::computeInlineBoxesLogicalHeight): (WebCore::Layout::LineBox::alignInlineBoxesVerticallyAndComputeLineHeight): (WebCore::Layout::LineBox::inlineBoxForLayoutBox const): Deleted. (WebCore::Layout::LineBox::alignVertically): Deleted. * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineBox::setLogicalTop): (WebCore::Layout::LineBox::InlineBox::setLogicalWidth): (WebCore::Layout::LineBox::InlineBox::setLogicalHeight): (WebCore::Layout::LineBox::InlineBox::setBaseline): (WebCore::Layout::LineBox::inlineBoxForLayoutBox const): (WebCore::Layout::LineBox::inlineBoxForLayoutBox): 2020-09-03 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Finalize InlineBox alignment in LineBox https://bugs.webkit.org/show_bug.cgi?id=215410 Reviewed by Antti Koivisto. This patch completes the InlineBox transition. LineBox now has a dedicated root inline box and additional inline boxes as needed. Both horizontal and vertical alignments are performed on the inline boxes as opposed to on the runs. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::constraintsForLine): (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::initialLineHeight const): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::collectHangingContent): (WebCore::Layout::horizontalAlignmentOffset): (WebCore::Layout::halfLeadingMetrics): (WebCore::Layout::LineBox::InlineBox::InlineBox): (WebCore::Layout::LineBox::LineBox): (WebCore::Layout::m_inlineFormattingContext): (WebCore::Layout::LineBox::inlineBoxForLayoutBox const): (WebCore::Layout::LineBox::inlineRectForTextRun const): (WebCore::Layout::LineBox::constructInlineBoxes): (WebCore::Layout::LineBox::alignVertically): (WebCore::Layout::LineBox::rectForRun const): Deleted. (WebCore::Layout::LineBox::alignHorizontally): Deleted. (WebCore::Layout::LineBox::adjustBaselineAndLineHeight): Deleted. (WebCore::Layout::LineBox::collectHangingContent const): Deleted. * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineBox::AscentAndDescent::height const): (WebCore::Layout::LineBox::InlineBox::logicalRect const): (WebCore::Layout::LineBox::InlineBox::logicalTop const): (WebCore::Layout::LineBox::InlineBox::logicalLeft const): (WebCore::Layout::LineBox::InlineBox::logicalWidth const): (WebCore::Layout::LineBox::InlineBox::logicalHeight const): (WebCore::Layout::LineBox::InlineBox::baseline const): (WebCore::Layout::LineBox::InlineBox::descent const): (WebCore::Layout::LineBox::InlineBox::setLogicalTop): (WebCore::Layout::LineBox::InlineBox::setLogicalWidth): (WebCore::Layout::LineBox::InlineBox::isAtomicInlineLevelBox const): (WebCore::Layout::LineBox::InlineBox::setHasStrut): (WebCore::Layout::LineBox::InlineBox::hasStrut const): (WebCore::Layout::LineBox::alignmentBaseline const): (WebCore::Layout::AscentAndDescent::height const): Deleted. (WebCore::Layout::LineBox::ascentAndDescent const): Deleted. (WebCore::Layout::LineBox::setScrollableOverflow): Deleted. (WebCore::Layout::LineBox::InlineBox::InlineBox): Deleted. (WebCore::Layout::LineBox::setLogicalHeightIfGreater): Deleted. (WebCore::Layout::LineBox::setAlignmentBaselineIfGreater): Deleted. (WebCore::Layout::LineBox::setAscentIfGreater): Deleted. (WebCore::Layout::LineBox::setDescentIfGreater): Deleted. (WebCore::Layout::LineBox::halfLeadingMetrics): Deleted. * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::Run::logicalRight const): 2020-09-03 Youenn Fablet <youenn@apple.com> calling transceiver setCodecPreferences doesn't change the order of codecs in the offer/answer generated by the browser https://bugs.webkit.org/show_bug.cgi?id=215567 <rdar://problem/67277554> Reviewed by Eric Carlson. Make sure to serialize sdpFmtp information so that setCodecPreferences succeeds. Also make sure to throw the exception if there is any. Covered by updated imported/w3c/web-platform-tests/webrtc/RTCRtpTransceiver-setCodecPreferences.html. * Modules/mediastream/RTCRtpTransceiver.idl: * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::toRTCRtpCapabilities): 2020-09-02 Chris Dumez <cdumez@apple.com> Choose adequate number of channels for ConvolverNode's output https://bugs.webkit.org/show_bug.cgi?id=216099 Reviewed by Eric Carlson. Choose adequate number of channels for ConvolverNode's output. We were using 2 channels for the output no matter what but we're supposed to use a single channel if both the input and the response buffer are mono. This is based on the following Blink change by Raymond Toy: - https://codereview.chromium.org/2732523003 No new tests, rebaselined existing tests. * Modules/webaudio/ConvolverNode.cpp: (WebCore::computeNumberOfOutputChannels): (WebCore::ConvolverNode::create): Set the shouldNormalize flag *before* we set the buffer since setBuffer() relies on the flag. This gives us a few more test passes. (WebCore::ConvolverNode::ConvolverNode): (WebCore::ConvolverNode::setBuffer): (WebCore::ConvolverNode::checkNumberOfChannelsForInput): * Modules/webaudio/ConvolverNode.h: * platform/audio/Reverb.cpp: (WebCore::Reverb::Reverb): (WebCore::Reverb::initialize): (WebCore::Reverb::process): * platform/audio/Reverb.h: 2020-09-02 Darin Adler <darin@apple.com> Simplify some editing code https://bugs.webkit.org/show_bug.cgi?id=216097 Reviewed by Sam Weinig. * dom/ContainerNode.cpp: (WebCore::ContainerNode::replaceAllChildrenWithNewText): If string is empty, don't add a text node. Turns out all callers wanted this behavior. * dom/Node.cpp: (WebCore::Node::setTextContent): Simplify by relying on new behavior of replaceAllChildrenWithNewText when passed an empty string. * editing/ios/EditorIOS.mm: (WebCore::Editor::setTextAsChildOfElement): Use replaceAllChildrenWithNewText instead of the unnecessarily complicated code that was here. Also simplify the VisibeSelection manipulation at the end of the function. * html/HTMLElement.cpp: (WebCore::HTMLElement::setInnerText): Simplify by relying on new behavior of replaceAllChildrenWithNewText when passed an empty string. * page/DOMSelection.cpp: (WebCore::DOMSelection::deleteFromDocument): Simplify by using the selection function that takes a SimpleRange rather than the one that takes two containers and offsets. 2020-09-02 Chris Dumez <cdumez@apple.com> Don't modify the response when creating a ConvolverNode https://bugs.webkit.org/show_bug.cgi?id=216093 Reviewed by Eric Carlson. When creating a ConvolverNode with normalization (the default), the ConvolverNode was modifying the supplied AudioBuffer containing the desired impulse response. This happens because the normalization factor was applied to the buffer, convolver stages were computed, and then the normalization was undone. Due to floating-point roundoff, this can (and does) modify the buffer. Instead, compute the scale factor and pass it into the various routines so that the scaling can be done there. For stages using an FFT, the resulting FFT is scaled by the factor. For the direct convolver, the response is modified there. (The direct convolver makes a copy of the reponse, so this is safe.) This is a cherry-pick of the following Blink change by Raymond Toy: - https://chromium-review.googlesource.com/c/chromium/src/+/1623457 Test: webaudio/convolvernode-unmodified-buffer.html * platform/audio/FFTFrame.cpp: (WebCore::FFTFrame::scaleFFT): * platform/audio/FFTFrame.h: * platform/audio/Reverb.cpp: (WebCore::Reverb::Reverb): (WebCore::Reverb::initialize): * platform/audio/Reverb.h: * platform/audio/ReverbConvolver.cpp: (WebCore::ReverbConvolver::ReverbConvolver): * platform/audio/ReverbConvolver.h: * platform/audio/ReverbConvolverStage.cpp: (WebCore::ReverbConvolverStage::ReverbConvolverStage): * platform/audio/ReverbConvolverStage.h: 2020-09-02 Chris Dumez <cdumez@apple.com> Fix rounding for DelayDSPKernel's buffer size calculation https://bugs.webkit.org/show_bug.cgi?id=216091 Reviewed by Geoffrey Garen. Fix rounding for DelayDSPKernel's buffer size calculation. The DelayNode needs to buffer |maxDelayTime| sample frames, plus one frame for interpolation. If |maxDelayTime| isn't an integer, we have to round it up or the buffer would end up one frame short. No new tests, rebaselined existing test. * Modules/webaudio/DelayDSPKernel.cpp: (WebCore::DelayDSPKernel::bufferLengthForDelay const): 2020-09-02 Darin Adler <darin@apple.com> Change Affinity into an enum class https://bugs.webkit.org/show_bug.cgi?id=216096 Reviewed by Wenson Hsieh. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::localCaretRectForCharacterOffset): Use prefix. * dom/Position.cpp: (WebCore::Position::rendersInDifferentPosition const): Ditto. (WebCore::Position::inlineBoxAndOffset const): Ditto. * editing/FrameSelection.cpp: (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected): Ditto. * editing/TextAffinity.h: Use an enum class. * editing/VisiblePosition.cpp: (WebCore::VisiblePosition::VisiblePosition): Use prefix. * editing/VisiblePosition.h: Ditto. * editing/VisibleUnits.cpp: (WebCore::visualWordPosition): Ditto. (WebCore::nextBoundary): Ditto. (WebCore::endPositionForLine): Ditto. (WebCore::atBoundaryOfGranularity): Ditto. (WebCore::nextLineBoundaryInDirection): Ditto. * rendering/RenderTextLineBoxes.cpp: (WebCore::createVisiblePositionForBox): Ditto. (WebCore::RenderTextLineBoxes::positionForPoint const): Ditto. * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::positionForPoint): Ditto. 2020-09-01 Darin Adler <darin@apple.com> Remove comparePositions and make VisiblePosition improvements https://bugs.webkit.org/show_bug.cgi?id=215982 Reviewed by Sam Weinig. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::localCaretRectForCharacterOffset): Updated for inlineBoxAndOffset. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (getSelectionOffsetsForObject): Use std::max/min instead of comparePositions. (isWhiteSpaceBetweenSentences): Use isPointInRange instead of comparePositions. * dom/Position.cpp: (WebCore::Position::rendersInDifferentPosition const): Updated for inlineBoxAndOffset. (WebCore::Position::inlineBoxAndOffset const): Renamed from getInlineBoxAndOffset and changed to use a return value instead of out arguments. * dom/Position.h: Added InlineBoxAndOffset structure for the inlineBoxAndOffset function. Update for rename of EAffinity to Affinity. Changed getInlineBoxAndOffset to inlineBoxAndOffset and use a return value instead of out arguments. Change <, >, <=, and >= to call documentOrder. * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::updateStartEnd): Use <= instead of comparePositions. Use VisiblePosition::defaultAffinity instead of VP_DEFAULT_AFFINITY. (WebCore::ApplyStyleCommand::applyBlockStyle): Use < instead of comparePositions. (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): Ditto. Also added a missing null check. (WebCore::ApplyStyleCommand::applyInlineStyle): Ditto. (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle): Use <= and < instead of comparePositions. (WebCore::ApplyStyleCommand::removeInlineStyle): Use <= instead of comparePositions. (WebCore::ApplyStyleCommand::nodeFullySelected const): Use >= and <= instead of comparePositions. (WebCore::ApplyStyleCommand::nodeFullyUnselected const): Use < and > instead of comparePositions. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::deleteInsignificantText): Use < instead of comparePositions, in a way that handles the null case correctly. (WebCore::CompositeEditCommand::deleteInsignificantTextDownstream): Removed unnecessary explicit use of VP_DEFAULT_AFFINITY. (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Ditto. Also use < instead of comparePositions. (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement): Use <= instead of comparePositions. (WebCore::CompositeEditCommand::moveParagraphs): Use <= and >= instead of comparePositions. * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::initializeStartEnd): Use >= instead of comparePositions (WebCore::DeleteSelectionCommand::smartDeleteParagraphSpacers): Use VisiblePosition::defaultAffinity instead of VP_DEFAULT_AFFINITY, and in other cases removed unnecessary explicit use of VP_DEFAULT_AFFINITY. (WebCore::DeleteSelectionCommand::initializePositionData): Ditto. (WebCore::DeleteSelectionCommand::handleGeneralDelete): Use >= instead of comparePositions. (WebCore::DeleteSelectionCommand::mergeParagraphs): Use >= instead of comparePositions, also use isOrphan and merge two checks into one. * editing/Editing.cpp: (WebCore::comparePositions): Deleted. (WebCore::firstEditablePositionAfterPositionInRoot): Use < instead of comparePositions. (WebCore::lastEditablePositionBeforePositionInRoot): Use > instead of comparePositions. (WebCore::isNodeVisiblyContainedWithin): Use < instead of comparePositions. (WebCore::localCaretRectInRendererForCaretPainting): Update for localCaretRect function that no longer uses an out argument. * editing/Editing.h: Deleted comparePositions. * editing/Editor.cpp: (WebCore::Editor::adjustedSelectionRange): Use >= instead of comparePositions. * editing/FrameSelection.cpp: (WebCore::FrameSelection::setSelectionByMouseIfDifferent): Assign an empty value rather than using a clear function. (WebCore::FrameSelection::directionOfSelection): Updated for inlineBoxAndOffset. (WebCore::FrameSelection::contains const): Use isPointInRange instead of comparePositions. (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected): Use Upstream instead of VP_UPSTREAM_IF_POSSIBLE. (WebCore::FrameSelection::elementRangeContainingCaretSelection const): Removed unnecessary explicit use of VP_DEFAULT_AFFINITY. (WebCore::FrameSelection::characterInRelationToCaretSelection const): Ditto. (WebCore::FrameSelection::characterBeforeCaretSelection const): Deleted. There is only one caller, and we can move the algorithm, now a one-liner, there. (WebCore::FrameSelection::characterAfterCaretSelection const): Deleted. Ditto. (WebCore::FrameSelection::selectionAtDocumentStart const): Deleted. Ditto. (WebCore::FrameSelection::selectionAtWordStart const): Use visibleStart inatead of creating a new position with VP_DEFAULT_AFFINITY. Also streamlined the function a bit. (WebCore::FrameSelection::selectRangeOnElement): Deleted. (WebCore::FrameSelection::wordSelectionContainingCaretSelection): Removed unnecessary explicit use of VP_DEFAULT_AFFINITY. (WebCore::FrameSelection::selectionAtSentenceStart const): Ditto. * editing/FrameSelection.h: Updated for above. * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Removed unnecessary explicit use of VP_DEFAULT_AFFINITY. Also tightened up the code a bit including removing an unnecessary assertion. (WebCore::InsertParagraphSeparatorCommand::doApply): Use <= instead of comparePositions. * editing/RenderedPosition.cpp: (WebCore::RenderedPosition::RenderedPosition): Have the VisiblePosition constructor call through to the Position/Affinity constructor instead of repeating the logic twice. Update for inlineBoxAndOffset. Initialize m_offset in the class definition so we don't have to do it here. * editing/RenderedPosition.h: Initialize all data members. Sorted a function member above the data members. * editing/TextAffinity.h: Renamed for modern WebKit coding style, eliminating the use of all caps and the "E" prefix on EAffinity. For now, old names are also still supported. * editing/VisiblePosition.cpp: (WebCore::VisiblePosition::VisiblePosition): Use member construction rather than assignment. Rewrote the code that stores upstream affinity only when appropriate to be more straightforward. The old code would set to upstream and then change back. The new code sets to upstream only after testing that it worked. Should also be faster since it saves one call to canonicalPosition. (WebCore::VisiblePosition::init): Deleted. Rolled into the constructor. (WebCore::VisiblePosition::leftVisuallyDistinctCandidate const): Update for inlineBoxAndOffset. (WebCore::VisiblePosition::rightVisuallyDistinctCandidate const): Ditto. (WebCore::VisiblePosition::localCaretRect const): Return the renderer as part of the return value rather than an out argument. Update for inlineBoxAndOffset and streamline logic a bit. (WebCore::VisiblePosition::absoluteSelectionBoundsForLine const): Update for inlineBoxAndOffset and remove unneded special cases already covered by that function. (WebCore::VisiblePosition::lineDirectionPointForBlockDirectionNavigation const): Updated for localCaretRect. (WebCore::documentOrder): Added. * editing/VisiblePosition.h: Added VisiblePosition::defaultAffinity to replace VP_DEFAULT_AFFINITY. Deleted VP_UPSTREAM_IF_POSSIBLE; callers will just use Upstream. Deleted the clear function. Renamed getInlineBoxAndOffset to inlineBoxAndOffset and use a return value instead of out arguments. Use a return value instead of out arguments for localCaretRect. Made canonicalPosition a static member function. Use documentOrder to implement <, >, <=, and >=. * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::toNormalizedRange const): Use > instead of comparePositions. Also do the comparison after calling parentAnchoredEquivalent instead of before. (WebCore::VisibleSelection::setBaseAndExtentToDeepEquivalents): Use <= instead of comparePositions. (WebCore::VisibleSelection::setWithoutValidation): Ditto. * editing/VisibleUnits.cpp: (WebCore::visualWordPosition): Update for inlineBoxAndOffset. (WebCore::nextBoundary): Use Upstream instad of VP_UPSTREAM_IF_POSSIBLE. (WebCore::endPositionForLine): Ditto. (WebCore::previousLinePosition): Update for inlineBoxAndOffset. (WebCore::nextLinePosition): Ditto. (WebCore::atBoundaryOfGranularity): Use Upstream instead of VP_UPSTREAM_IF_POSSIBLE. This is especially important here, because setAffinity does not actually check if upstream is possible, so it is setting to Upstream unconditionally. The old name was misleading here. (WebCore::nextLineBoundaryInDirection): Ditto. Same misleading use. * editing/cocoa/HTMLConverter.mm: (HTMLConverter::convert): Use > instead of comparePositions. * editing/ios/EditorIOS.mm: (WebCore::Editor::setTextAsChildOfElement): Removed unnecessary explicit use of VP_DEFAULT_AFFINITY. * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::serializeNodes): Use <= instead of comparePositions. (WebCore::serializePreservingVisualAppearanceInternal): Use == and < instead of comparePositions. * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEventSingleClick): Use < instead of comparePositions. (WebCore::EventHandler::updateSelectionForMouseDrag): Ditto. * rendering/RenderTextLineBoxes.cpp: (WebCore::createVisiblePositionForBox): Use VisiblePosition::defaultAffinity instead of VP_DEFAULT_AFFINITY and Upstream instead of VP_UPSTREAM_IF_POSSIBLE. (WebCore::RenderTextLineBoxes::positionForPoint const): DItto. * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::positionForPoint): Ditto. 2020-09-02 Timothy Horton <timothy_horton@apple.com> iPad + Trackpad: JW Library highlighting and edit menus don't appear https://bugs.webkit.org/show_bug.cgi?id=216086 Reviewed by Wenson Hsieh. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isJWLibrary): 2020-09-02 Chris Dumez <cdumez@apple.com> New AutoParam timeline events should have their startTime adjusted when they are in the past https://bugs.webkit.org/show_bug.cgi?id=216080 Reviewed by Geoffrey Garen. New AutoParam timeline events should have their startTime adjusted when they are in the past. We adjust the time to be the current time when it is in the past. No new tests, rebaselined existing tests. * Modules/webaudio/AudioParam.cpp: 2020-09-02 John Wilander <wilander@apple.com> Storage Access API: Allow requests for storage access from nested iframes https://bugs.webkit.org/show_bug.cgi?id=216019 <rdar://problem/68109918> Reviewed by Alex Christensen. It was decided browsers should support requests for storage access from nested iframes as part of the standardization of the Storage Access API. The issue is discussed here: https://github.com/privacycg/storage-access/issues/10. No new tests. Existing tests were changed. * dom/DocumentStorageAccess.cpp: (WebCore::DocumentStorageAccess::requestStorageAccessQuickCheck): 2020-09-02 Chris Dumez <cdumez@apple.com> OfflineAudioContext incorrectly renders at beginning of output buffer after resuming https://bugs.webkit.org/show_bug.cgi?id=216078 Reviewed by Geoff Garen. OfflineAudioContext incorrectly renders at beginning of output buffer after resuming, instead of rendering where it left off. No new tests, rebaselined existing tests. * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::offlineRender): * Modules/webaudio/OfflineAudioDestinationNode.h: 2020-09-02 Sihui Liu <sihui_liu@apple.com> REGRESSION (r264661): Crashes in WebCore::wrap<WebCore::Blob> in CloneDeserializer https://bugs.webkit.org/show_bug.cgi?id=215835 Reviewed by Youenn Fablet. Partially revert r264661 as there are cases, other than our previous IDB, where we may not use JSDOMGlobalObject for serialization and deserialization, like the one showed in the crashlog. Therefore, we still need the check for JSDOMGlobalObject. API Test: WebKit.EvaluateJavaScriptThatCreatesBlob * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::CloneDeserializer::readFile): (WebCore::CloneDeserializer::readRTCCertificate): (WebCore::CloneDeserializer::readTerminal): 2020-09-02 Chris Dumez <cdumez@apple.com> Implement event convergence for AudioParam.setTargetAtTime() https://bugs.webkit.org/show_bug.cgi?id=216064 Reviewed by Geoffrey Garen. Implement event convergence for AudioParam.setTargetAtTime(). This is to match Chromium's behavior and pass the corresponding WPT test. No new tests, rebaselined existing test. * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::hasSetTargetConverged): (WebCore::AudioParamTimeline::valuesForTimeRangeImpl): 2020-09-02 Youenn Fablet <youenn@apple.com> Introduce a C++ chain of operations in RTCPeerConnection https://bugs.webkit.org/show_bug.cgi?id=216006 Reviewed by Eric Carlson. Remove RTCPeerConnection JS built-ins and introduce a C++ version. This allows to make replaceTrack part of the chain of operation. Also update setLocalDescription to take no parameters. Covered by rebased tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Headers.cmake: * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::createOfferSucceeded): (WebCore::PeerConnectionBackend::createAnswerSucceeded): (WebCore::PeerConnectionBackend::setLocalDescription): (WebCore::PeerConnectionBackend::setRemoteDescription): (WebCore::PeerConnectionBackend::transceiverFromSender): Deleted. * Modules/mediastream/PeerConnectionBackend.h: * Modules/mediastream/RTCIceCandidate.cpp: (WebCore::RTCIceCandidate::create): * Modules/mediastream/RTCIceCandidate.h: * Modules/mediastream/RTCIceCandidate.idl: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::create): (WebCore::RTCPeerConnection::removeTrack): (WebCore::RTCPeerConnection::createOffer): (WebCore::RTCPeerConnection::createAnswer): (WebCore::RTCPeerConnection::setLocalDescription): (WebCore::RTCPeerConnection::setRemoteDescription): (WebCore::RTCPeerConnection::addIceCandidate): (WebCore::RTCPeerConnection::getStats): (WebCore::RTCPeerConnection::doClose): (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent): (WebCore::RTCPeerConnection::chainOperation): (WebCore::RTCPeerConnection::initializeWith): Deleted. (WebCore::RTCPeerConnection::queuedCreateOffer): Deleted. (WebCore::RTCPeerConnection::queuedCreateAnswer): Deleted. (WebCore::RTCPeerConnection::queuedSetLocalDescription): Deleted. (WebCore::RTCPeerConnection::queuedSetRemoteDescription): Deleted. (WebCore::RTCPeerConnection::queuedAddIceCandidate): Deleted. * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCPeerConnection.js: Removed. * Modules/mediastream/RTCPeerConnectionInternals.js: Removed. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::create): (WebCore::RTCRtpSender::RTCRtpSender): (WebCore::RTCRtpSender::replaceTrack): (WebCore::RTCRtpSender::isCreatedBy const): (WebCore::RTCRtpSender::dtmf): (WebCore::RTCRtpSender::currentTransceiverDirection const): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpSenderBackend.h: * Modules/mediastream/RTCSessionDescription.cpp: (WebCore::RTCSessionDescription::create): * Modules/mediastream/RTCSessionDescription.h: * Modules/mediastream/RTCSessionDescription.idl: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription): (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription): (WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription): (WebCore::LibWebRTCPeerConnectionBackend::addTrack): (WebCore::LibWebRTCPeerConnectionBackend::addTransceiverFromTrackOrKind): (WebCore::LibWebRTCPeerConnectionBackend::newRemoteTransceiver): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: (WebCore::LibWebRTCRtpSenderBackend::replaceTrack): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-09-02 Youenn Fablet <youenn@apple.com> Introduce a ThreadableWebSocketChannel identifier https://bugs.webkit.org/show_bug.cgi?id=216034 Reviewed by Alex Christensen. Clean-up code to have a single identifier for all WebSockets. We use a WebSocketIdentifier that is now moved from WebKit to WebCore. Introduce CookieGetter name following comments from https://bugs.webkit.org/show_bug.cgi?id=215928 review. No change of behavior. * Headers.cmake: * Modules/websockets/ThreadableWebSocketChannel.cpp: (WebCore::ThreadableWebSocketChannel::ThreadableWebSocketChannel): * Modules/websockets/ThreadableWebSocketChannel.h: (WebCore::ThreadableWebSocketChannel::ref): (WebCore::ThreadableWebSocketChannel::deref): (WebCore::ThreadableWebSocketChannel::identifier const): * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::connect): (WebCore::WebSocketChannel::clientHandshakeRequest const): * Modules/websockets/WebSocketChannel.h: * Modules/websockets/WebSocketHandshake.cpp: (WebCore::WebSocketHandshake::clientHandshakeRequest const): * Modules/websockets/WebSocketHandshake.h: * Modules/websockets/WebSocketIdentifier.h: Added. * Modules/websockets/WorkerThreadableWebSocketChannel.h: * WebCore.xcodeproj/project.pbxproj: * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::enable): (WebCore::InspectorNetworkAgent::webSocketForRequestId): * page/SocketProvider.cpp: (WebCore::SocketProvider::createSocketStreamHandle): * page/SocketProvider.h: 2020-09-02 Alex Christensen <achristensen@webkit.org> Allow direct creation of replacement codec https://bugs.webkit.org/show_bug.cgi?id=216063 Reviewed by Youenn Fablet. Chrome and Firefox do. Covered by a newly passing web platform test. * platform/text/TextCodecReplacement.cpp: (WebCore::TextCodecReplacement::registerEncodingNames): * platform/text/TextEncoding.cpp: (WebCore::TextEncoding::TextEncoding): 2020-09-02 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Start constructing InlineBoxes for inline runs https://bugs.webkit.org/show_bug.cgi?id=215168 Reviewed by Antti Koivisto. In this transitional step we start constructing inline boxes. However at this point, each run gains a dedicated inline box. While this is somewhat incorrect from the spec point of view, this is all internal and very tempoarary at this point. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): * layout/inlineformatting/InlineLineBox.cpp: (WebCore::Layout::LineBox::LineBox): (WebCore::Layout::LineBox::rectForRun const): (WebCore::Layout::LineBox::alignHorizontally): (WebCore::Layout::LineBox::alignVertically): (WebCore::Layout::LineBox::adjustBaselineAndLineHeight): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineBox::InlineBox): (WebCore::Layout::LineBox::inlineRectList const): Deleted. 2020-09-02 Aditya Keerthi <akeerthi@apple.com> [macOS] Update date picker when the inner control is edited https://bugs.webkit.org/show_bug.cgi?id=216004 Reviewed by Wenson Hsieh. The value of the attached date picker should match the value in the inner control. In order to achieve this behavior, m_dateTimeChooser is notified whenever didChangeValueFromControl is called. Note that the attached date picker's value is not updated on a programmatic edit (setting input.value), as a sudden change not triggered by the user would result in a poor user experience. Test: fast/forms/date/date-editable-components/date-picker-update-on-edit.html * html/BaseChooserOnlyDateAndTimeInputType.cpp: (WebCore::BaseChooserOnlyDateAndTimeInputType::didChangeValueFromControl): 2020-09-02 Alex Christensen <achristensen@webkit.org> Align UTF-16 decoder with Chrome, Firefox, and specification https://bugs.webkit.org/show_bug.cgi?id=216058 Reviewed by Youenn Fablet. Covered by web platform tests. * platform/text/TextCodecUTF16.cpp: (WebCore::TextCodecUTF16::decode): * platform/text/TextCodecUTF16.h: (): Deleted. 2020-09-02 Youenn Fablet <youenn@apple.com> Safari is not able to hear audio when using WebRTC in multiple tabs https://bugs.webkit.org/show_bug.cgi?id=215270 <rdar://problem/66736746> Reviewed by Eric Carlson. Covered by manually testing that audio continues when two pages in the same process create a peer connection, one plays audio with WebRTC and the second one is closed. Before the patch, the closing page would stop the audio device module, even though the first page would like the module to continue playing. Fix this by creating an audio module per page instead of process wide. * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h: * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::initializePeerConnectionFactoryAndThreads): (WebCore::LibWebRTCProvider::factory): (WebCore::LibWebRTCProvider::createPeerConnectionFactory): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: 2020-09-02 Said Abou-Hallawa <sabouhallawa@apple.com> Unreviewed, reverting r266449. Underlying frameworks do not work correctly for loopCount >= 1. Reverted changeset: "[CG] REGRESSION (Big Sur): A GIF image with a finite loopCount loops an extra cycle" https://bugs.webkit.org/show_bug.cgi?id=216018 https://trac.webkit.org/changeset/266449 2020-09-01 Said Abou-Hallawa <sabouhallawa@apple.com> [CG] REGRESSION (Big Sur): A GIF image with a finite loopCount loops an extra cycle https://bugs.webkit.org/show_bug.cgi?id=216018 <rdar://problem/66660579> Reviewed by Tim Horton. Remove the extra 'one' we used to add to the GIF loopCount since it is now added by the underlying frameworks. But make sure we are compatible with the older versions of macOS and iOS. * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoderCG::repetitionCount const): 2020-09-01 Alex Christensen <achristensen@webkit.org> Align ISO-2022-JP and Shift_JIS encodings with Chrome, Firefox, and the specification https://bugs.webkit.org/show_bug.cgi?id=216052 Reviewed by Darin Adler. Covered by newly passing web platform tests. * platform/text/TextCodecCJK.cpp: (WebCore::TextCodecCJK::TextCodecCJK): (WebCore::TextCodecCJK::registerEncodingNames): (WebCore::TextCodecCJK::registerCodecs): (WebCore::eucJPEncode): (WebCore::TextCodecCJK::iso2022JPEncode): (WebCore::shiftJISEncode): (WebCore::big5Encode): (WebCore::TextCodecCJK::big5Decode): (WebCore::TextCodecCJK::decode): (WebCore::TextCodecCJK::encode): * platform/text/TextCodecCJK.h: * platform/text/TextCodecICU.cpp: 2020-09-01 Hector Lopez <hector_i_lopez@apple.com> Unreviewed, reverting r266408. Revision caused constant crashes on iOS and macOS Reverted changeset: "Convert runtime flag to setting for lazy image loading" https://bugs.webkit.org/show_bug.cgi?id=215610 https://trac.webkit.org/changeset/266408 2020-09-01 Dean Jackson <dino@apple.com> REGRESSION(r262366): MotionMark1.1 | macOS | Some devices | 1-3% overall regression https://bugs.webkit.org/show_bug.cgi?id=215989 <rdar://problem/66845937> Reviewed by Darin Adler. The new approach to compositing WebGL caused a slowdown in some canvas performance tests. They were notifying the Document of all drawing commands, even on 2d canvases that didn't need to prepare before compositing. The solution is to only add the Document as an observer when necessary. This recovers the performance hit - measured using the Canvas Lines MotionMark test. Tests: fast/canvas/webgl/move-canvas-in-document-while-clean.html fast/canvas/webgl/move-canvas-in-document.html * dom/Document.cpp: (WebCore::Document::prepareCanvasesForDisplayIfNeeded): Leave a FIXME indicating that we should try to avoid the copyToVector if we can ensure that the prepareForDisplay call will not mutate the HashSet. * html/CanvasBase.cpp: Remove some copyToVector calls. It should be fine to iterate over the HashSet for these notification functions. (WebCore::CanvasBase::notifyObserversCanvasChanged): (WebCore::CanvasBase::notifyObserversCanvasResized): * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::HTMLCanvasElement): Don't add the Document as a canvas observer. Wait until we know it is a context that needs observing. (WebCore::HTMLCanvasElement::createContextWebGL): Now we can add it as an observer. (WebCore::HTMLCanvasElement::didMoveToNewDocument): Swap observation to the new Document. (WebCore::HTMLCanvasElement::insertedIntoAncestor): Ditto, but also be aware that we might be in a "dirty" state, and thus need to immediately tell the new document that the canvas needs preparation. (WebCore::HTMLCanvasElement::removedFromAncestor): Remove the observer. (WebCore::HTMLCanvasElement::needsPreparationForDisplay): Use a virtual function on the context instead of checking the type. (WebCore::HTMLCanvasElement::prepareForDisplay): Ditto. * html/canvas/CanvasRenderingContext.h: New virtual functions to avoid type checking in HTMLCanvasElement. (WebCore::CanvasRenderingContext::compositingResultsNeedUpdating const): (WebCore::CanvasRenderingContext::needsPreparationForDisplay const): (WebCore::CanvasRenderingContext::prepareForDisplay): * html/canvas/WebGLRenderingContextBase.cpp: Implementations of the virtual functions that tell HTMLCanvasElement that it needs to prepareForDisplay. (WebCore::WebGLRenderingContextBase::markContextChanged): (WebCore::WebGLRenderingContextBase::markContextChangedAndNotifyCanvasObserver): (WebCore::WebGLRenderingContextBase::didComposite): * html/canvas/WebGLRenderingContextBase.h: 2020-09-01 Chris Dumez <cdumez@apple.com> Make sure BiquadFilterNode tail is getting processed https://bugs.webkit.org/show_bug.cgi?id=216050 Reviewed by Darin Adler. Some nodes have have a significant tail-time and shouldn't be disconnected simply because they no longer have any input connections. We used to deal with this by hard-coding node types in AudioNode::disableOutputsIfNecessary() which was not ideal. We now use a AudioNode::requiresTailProcessing() virtual function instead, similarly to what Blink is doing. This patch fixes tail processing for BiquadFilterNode. No new tests, rebaselined existing test. * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::requiresTailProcessing const): * Modules/webaudio/AnalyserNode.h: * Modules/webaudio/AudioBasicProcessorNode.cpp: (WebCore::AudioBasicProcessorNode::requiresTailProcessing const): * Modules/webaudio/AudioBasicProcessorNode.h: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::disableOutputsIfNecessary): * Modules/webaudio/AudioNode.h: * Modules/webaudio/AudioScheduledSourceNode.h: * Modules/webaudio/BiquadDSPKernel.cpp: (WebCore::BiquadDSPKernel::requiresTailProcessing const): * Modules/webaudio/BiquadDSPKernel.h: * Modules/webaudio/ChannelMergerNode.h: * Modules/webaudio/ChannelSplitterNode.h: * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::requiresTailProcessing const): * Modules/webaudio/ConvolverNode.h: * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/DelayDSPKernel.cpp: (WebCore::DelayDSPKernel::requiresTailProcessing const): * Modules/webaudio/DelayDSPKernel.h: * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::requiresTailProcessing const): * Modules/webaudio/DynamicsCompressorNode.h: * Modules/webaudio/GainNode.h: * Modules/webaudio/IIRDSPKernel.cpp: (WebCore::IIRDSPKernel::requiresTailProcessing const): * Modules/webaudio/IIRDSPKernel.h: * Modules/webaudio/MediaElementAudioSourceNode.h: * Modules/webaudio/MediaStreamAudioDestinationNode.h: * Modules/webaudio/MediaStreamAudioSourceNode.h: * Modules/webaudio/OfflineAudioDestinationNode.h: * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::requiresTailProcessing const): * Modules/webaudio/PannerNode.h: * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::requiresTailProcessing const): * Modules/webaudio/ScriptProcessorNode.h: * Modules/webaudio/StereoPannerNode.h: * Modules/webaudio/WaveShaperDSPKernel.cpp: (WebCore::WaveShaperDSPKernel::requiresTailProcessing const): * Modules/webaudio/WaveShaperDSPKernel.h: * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::requiresTailProcessing const): * Modules/webaudio/WebKitAudioPannerNode.h: * platform/audio/AudioDSPKernel.h: * platform/audio/AudioDSPKernelProcessor.cpp: (WebCore::AudioDSPKernelProcessor::requiresTailProcessing const): * platform/audio/AudioDSPKernelProcessor.h: * platform/audio/AudioProcessor.h: * platform/audio/DynamicsCompressor.h: * platform/audio/EqualPowerPanner.h: * platform/audio/HRTFPanner.cpp: (WebCore::HRTFPanner::requiresTailProcessing const): * platform/audio/HRTFPanner.h: * platform/audio/Panner.h: 2020-09-01 Chris Dumez <cdumez@apple.com> <video> element prevents screen from sleeping even after playback finishes https://bugs.webkit.org/show_bug.cgi?id=216017 <rdar://problem/66665846> Reviewed by Darin Adler. When video playback would finish (due to reaching end of file), HTMLMediaElement::mediaPlayerRateChanged() would get called, which would call updateSleepDisabling(). The idea was that updateSleepDisabling() would destroy the SleepDisabler to allow the display to sleep again. However, updateSleepDisabling() would not destroy the SleepDisabler because it does not know yet that the media has been paused. We only learned about it later on, when MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange() gets called. To address the problem, we now call updateSleepDisabling() when MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange() is called too. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange): 2020-09-01 Rob Buis <rbuis@igalia.com> Convert runtime flag to setting for lazy image loading https://bugs.webkit.org/show_bug.cgi?id=215610 Reviewed by Youenn Fablet. Convert runtime flag to setting for lazy image loading. Settings are preferred over RuntimeEnabledFeatures as they are not global singletons and are automatically accessible in layout tests via InternalSettingsGenerated. * loader/ImageLoader.cpp: 2020-09-01 Tim Horton <timothy_horton@apple.com> Some apps linked beyond iOS 13.4 don't respect mouse events, only touch events https://bugs.webkit.org/show_bug.cgi?id=216021 <rdar://problem/64830335> Reviewed by Wenson Hsieh. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isFIFACompanion): (WebCore::IOSApplication::isNoggin): (WebCore::IOSApplication::isOKCupid): Add some more bundle checks. 2020-09-01 Brady Eidson <beidson@apple.com> Crashtracer in SubresourceLoader::didCancel. <rdar://problem/32831629> and https://bugs.webkit.org/show_bug.cgi?id=216020 Reviewed by Alex Christensen. No new tests (Despite spotting theoretical ways this is possible, unable to construct a reproduction) It's possible for a newly created SubresourceLoader to be cancelled right after creation. In this case, m_resource will be null inside of SubresourceLoader::didCancel. Other parts of SubresourceLoader null check m_resource, so it's reasonable to state ::didCancel should as well. * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didCancel): Early return if reachedTerminalState(), and ASSERT(m_resource) after. 2020-09-01 Antti Koivisto <antti@apple.com> EventRegion paint should respect layer's foreground and background painting phases https://bugs.webkit.org/show_bug.cgi?id=216031 <rdar://problem/67282372> Reviewed by Simon Fraser. We are currently painting event region for the box background to the foreground layer, which can cause foreground layer to wrongly catch scroll events. Similarly we are unnecessarily painting foreground for layers that don't need it. Test: fast/scrolling/mac/negative-z-index-overflow-scroll.html * rendering/PaintPhase.h: Add two new event region specific PaintBehaviors for foreground and background paint. This essentially duplicates foreground/background PaintPhases but since event region paint is itself a paint phase we can't use those. This should be reconciled at some point. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintContents): Add the background flag when painting contents as the descendant backgrounds are part of the layer foreground. (WebCore::RenderBlock::paintObject): Respect the new flags. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerContents): Setup the flags based on what we are supposed to be painting on this layer. (WebCore::RenderLayer::collectEventRegionForFragments): Flag filtering moves to paintLayerContents. 2020-09-01 Chris Dumez <cdumez@apple.com> Add proper k-rate automation support for BiquadFilterNode https://bugs.webkit.org/show_bug.cgi?id=216027 Reviewed by Youenn Fablet. Add proper k-rate automation support for BiquadFilterNode. This patch is based on Chromium's implementation. No new tests, rebaselined existing tests. * Modules/webaudio/BiquadDSPKernel.cpp: (WebCore::hasConstantValues): (WebCore::BiquadDSPKernel::updateCoefficientsIfNecessary): (WebCore::BiquadDSPKernel::updateCoefficients): (WebCore::BiquadDSPKernel::process): (WebCore::BiquadDSPKernel::getFrequencyResponse): (WebCore::BiquadDSPKernel::tailTime const): (WebCore::BiquadDSPKernel::updateTailTime): * Modules/webaudio/BiquadDSPKernel.h: * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::checkForDirtyCoefficients): (WebCore::BiquadProcessor::getFrequencyResponse): * Modules/webaudio/BiquadProcessor.h: * platform/audio/Biquad.cpp: (WebCore::Biquad::Biquad): (WebCore::Biquad::process): (WebCore::Biquad::processFast): (WebCore::Biquad::reset): (WebCore::Biquad::setLowpassParams): (WebCore::Biquad::setHighpassParams): (WebCore::Biquad::setNormalizedCoefficients): (WebCore::Biquad::setLowShelfParams): (WebCore::Biquad::setHighShelfParams): (WebCore::Biquad::setPeakingParams): (WebCore::Biquad::setAllpassParams): (WebCore::Biquad::setNotchParams): (WebCore::Biquad::setBandpassParams): (WebCore::Biquad::getFrequencyResponse): (WebCore::repeatedRootResponse): (WebCore::rootFinder): (WebCore::Biquad::tailFrame): * platform/audio/Biquad.h: 2020-09-01 Alex Christensen <achristensen@webkit.org> Align Big5 decoding with spec, Chrome, and Firefox https://bugs.webkit.org/show_bug.cgi?id=216016 Reviewed by Darin Adler. I also introduce a new class TextCodecCJK instead of duct taping this into TextCodecICU. Covered by web platform tests. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/text/EncodingTables.cpp: * platform/text/EncodingTables.h: * platform/text/TextCodecCJK.cpp: Added. (WebCore::TextCodecCJK::TextCodecCJK): (WebCore::TextCodecCJK::registerEncodingNames): (WebCore::TextCodecCJK::registerCodecs): (WebCore::eucJPEncode): (WebCore::big5Encode): (WebCore::appendDecimal): (WebCore::urlEncodedEntityUnencodableHandler): (WebCore::entityUnencodableHandler): (WebCore::questionMarkUnencodableHandler): (WebCore::Function<void): (WebCore::big5DecodeIndex): (WebCore::TextCodecCJK::big5Decode): (WebCore::TextCodecCJK::decode): (WebCore::TextCodecCJK::encode): * platform/text/TextCodecCJK.h: Added. * platform/text/TextCodecICU.cpp: (WebCore::TextCodecICU::encode): (WebCore::eucJPEncode): Deleted. (WebCore::big5Encode): Deleted. (WebCore::uncheckedAppendDecimal): Deleted. (WebCore::urlEncodedEntityUnencodableHandler): Deleted. (WebCore::entityUnencodableHandler): Deleted. (WebCore::questionMarkUnencodableHandler): Deleted. (WebCore::Function<void): Deleted. * platform/text/TextEncodingRegistry.cpp: (WebCore::extendTextCodecMaps): 2020-09-01 Aditya Keerthi <akeerthi@apple.com> [macOS] Handle events for date inputs with editable components https://bugs.webkit.org/show_bug.cgi?id=215938 Reviewed by Darin Adler. This patch adds actual editability to date inputs with editable components, as the individual components now respond to keyboard events. Number keys can be used to enter a day, month, or year. The left and right arrow keys, as well as the tab key, can be used to traverse the various components. Finally, the backspace and delete keys can be used to clear the value of a particular component. To match the behavior of NSDatePicker, a typeahead buffer with a timeout is used when editing. For example, entering "2" and "3" in immediate succession will result in a year of "0023", but a one second gap between the two characters will result in a year of "0003". Finally, this patch ensures that "focus", "blur", "input", and "change" events are dispatched appropriately. Tests: fast/forms/date/date-editable-components/date-editable-components-focus-and-blur-events.html fast/forms/date/date-editable-components/date-editable-components-keyboard-events.html fast/forms/date/date-editable-components/date-editable-components-mouse-events.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * html/BaseChooserOnlyDateAndTimeInputType.cpp: (WebCore::BaseChooserOnlyDateAndTimeInputType::handleFocusEvent): Override this method so that any attempt to focus the date input element will focus the appropriate editable component. (WebCore::BaseChooserOnlyDateAndTimeInputType::hasCustomFocusLogic const): Override this method and return false if editable components are present so that the element can be a FocusScopeOwner. This is needed to be able to tab through individual components. (WebCore::BaseChooserOnlyDateAndTimeInputType::didBlurFromControl): (WebCore::BaseChooserOnlyDateAndTimeInputType::didChangeValueFromControl): * html/BaseChooserOnlyDateAndTimeInputType.h: * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::isKeyboardFocusable const): Date inputs should be keyboard focusable on all platforms. * html/BaseDateAndTimeInputType.h: * html/DateInputType.cpp: (WebCore::DateInputType::formatDateTimeFieldsState const): Serialize the state of the edit control into a valid HTML date string. * html/DateInputType.h: * html/DateTimeFieldsState.h: Added. DateTimeFieldsState is used to serialize and deserialize the contents of DateTimeEditElement. In the future, this class will also be used to save form state on forward/backward navigation. * html/DateTimeLocalInputType.cpp: (WebCore::DateTimeLocalInputType::formatDateTimeFieldsState const): * html/DateTimeLocalInputType.h: * html/MonthInputType.cpp: (WebCore::MonthInputType::formatDateTimeFieldsState const): * html/MonthInputType.h: * html/TimeInputType.cpp: (WebCore::TimeInputType::formatDateTimeFieldsState const): * html/TimeInputType.h: * html/WeekInputType.cpp: (WebCore::WeekInputType::formatDateTimeFieldsState const): * html/WeekInputType.h: * html/shadow/DateTimeEditElement.cpp: (WebCore::DateTimeEditElement::fieldIndexOf const): (WebCore::DateTimeEditElement::blurFromField): If a field is blurred, ensure the owner is notified if none of the other fields are focused. (WebCore::DateTimeEditElement::fieldValueChanged): (WebCore::DateTimeEditElement::focusOnNextFocusableField): (WebCore::DateTimeEditElement::focusByOwner): (WebCore::DateTimeEditElement::focusOnNextField): (WebCore::DateTimeEditElement::focusOnPreviousField): (WebCore::DateTimeEditElement::value const): (WebCore::DateTimeEditElement::valueAsDateTimeFieldsState const): * html/shadow/DateTimeEditElement.h: * html/shadow/DateTimeFieldElement.cpp: (WebCore::DateTimeFieldElement::defaultEventHandler): (WebCore::DateTimeFieldElement::defaultKeyboardEventHandler): (WebCore::DateTimeFieldElement::dispatchBlurEvent): (WebCore::DateTimeFieldElement::didBlur): (WebCore::DateTimeFieldElement::updateVisibleValue): Add EventBehavior parameter to dispatch "input" and "change" events accordingly. * html/shadow/DateTimeFieldElement.h: * html/shadow/DateTimeFieldElements.cpp: (WebCore::DateTimeDayFieldElement::DateTimeDayFieldElement): (WebCore::DateTimeDayFieldElement::populateDateTimeFieldsState): (WebCore::DateTimeMonthFieldElement::DateTimeMonthFieldElement): (WebCore::DateTimeMonthFieldElement::populateDateTimeFieldsState): (WebCore::DateTimeSymbolicMonthFieldElement::populateDateTimeFieldsState): (WebCore::DateTimeYearFieldElement::DateTimeYearFieldElement): (WebCore::DateTimeYearFieldElement::populateDateTimeFieldsState): * html/shadow/DateTimeFieldElements.h: * html/shadow/DateTimeNumericFieldElement.cpp: (WebCore::DateTimeNumericFieldElement::Range::clampValue const): (WebCore::DateTimeNumericFieldElement::Range::isInRange const): (WebCore::DateTimeNumericFieldElement::DateTimeNumericFieldElement): (WebCore::DateTimeNumericFieldElement::formatValue const): (WebCore::DateTimeNumericFieldElement::setEmptyValue): (WebCore::DateTimeNumericFieldElement::setValueAsInteger): (WebCore::DateTimeNumericFieldElement::handleKeyboardEvent): (WebCore::DateTimeNumericFieldElement::didBlur): * html/shadow/DateTimeNumericFieldElement.h: (WebCore::DateTimeNumericFieldElement::Range::Range): * html/shadow/DateTimeSymbolicFieldElement.cpp: (WebCore::DateTimeSymbolicFieldElement::setEmptyValue): (WebCore::DateTimeSymbolicFieldElement::setValueAsInteger): (WebCore::DateTimeSymbolicFieldElement::handleKeyboardEvent): * html/shadow/DateTimeSymbolicFieldElement.h: * platform/DateComponents.cpp: (WebCore::DateComponents::parseYear): (WebCore::withinHTMLDateLimits): (WebCore::DateComponents::parseWeek): (WebCore::DateComponents::setMonthsSinceEpoch): (WebCore::DateComponents::setMillisecondsSinceEpochForWeek): * platform/DateComponents.h: Partial revert of changes made in r265126, to ensure the minimumYear and maximumYear are accessible. (WebCore::DateComponents::minimumYear): (WebCore::DateComponents::maximumYear): 2020-09-01 Youenn Fablet <youenn@apple.com> Enable inspection of WebSocket when opening Web Inspector in the middle of the connection like done for the legacy WebSocket implementation https://bugs.webkit.org/show_bug.cgi?id=215928 Reviewed by Devin Rousso. Retrofit API used by Inspector from WebCore::WebSocketChannel to ThreadableWebSocketChannel. Make Inspector code work with ThreadableWebSocketChannel. Add a dummy implementation for Worker WebSocket (not supported currently by Web Inspector). Covered by http/tests/websocket/tests/hybi/inspector with NSURLSession WebSocket code path enabled. * Modules/websockets/ThreadableWebSocketChannel.h: * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::clientHandshakeRequest const): * Modules/websockets/WebSocketChannel.h: * Modules/websockets/WorkerThreadableWebSocketChannel.h: * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::enable): (WebCore::InspectorNetworkAgent::webSocketForRequestId): * inspector/agents/page/PageNetworkAgent.cpp: 2020-09-01 Chris Lord <clord@igalia.com> [GTK][WPE] Add support for smooth scrolling animation with async scrolling https://bugs.webkit.org/show_bug.cgi?id=210382 Reviewed by Carlos Garcia Campos. This removes the dependency on ScrollableArea from ScrollAnimationSmooth, which allows its use as a utility class for smooth scrolling. This class is then used in the Nicosia async layer composition scrolling code to provide smooth scrolling, when the feature is enabled. This mirrors the work done in bug 209230 for kinetic scrolling. No new tests, enabling existing functionality in more situations. * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::scrollTo): * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeFrameScrollingNodeNicosia::ScrollingTreeFrameScrollingNodeNicosia): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent): (WebCore::ScrollingTreeFrameScrollingNodeNicosia::stopScrollAnimations): * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::ScrollingTreeOverflowScrollingNodeNicosia): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::commitStateAfterChildren): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent): (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::stopScrollAnimations): * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h: * platform/ScrollAnimation.h: (WebCore::ScrollAnimation::serviceAnimation): * platform/ScrollAnimationKinetic.cpp: * platform/ScrollAnimationKinetic.h: * platform/ScrollAnimationSmooth.cpp: (WebCore::ScrollAnimationSmooth::ScrollAnimationSmooth): (WebCore::ScrollAnimationSmooth::scroll): (WebCore::ScrollAnimationSmooth::stop): (WebCore::ScrollAnimationSmooth::updateVisibleLengths): (WebCore::ScrollAnimationSmooth::animationTimerFired): * platform/ScrollAnimationSmooth.h: * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::ScrollAnimator): * platform/generic/ScrollAnimatorGeneric.cpp: (WebCore::ScrollAnimatorGeneric::ScrollAnimatorGeneric): (WebCore::ScrollAnimatorGeneric::ensureSmoothScrollingAnimation): 2020-09-01 Carlos Garcia Campos <cgarcia@igalia.com> [Linux] Web Inspector: show per thread cpu usage https://bugs.webkit.org/show_bug.cgi?id=215883 Reviewed by Adrian Perez de Castro. Get per thread CPU usage and information to fill ResourceUsageData in Linux. * page/ResourceUsageThread.h: * page/cocoa/ResourceUsageThreadCocoa.mm: (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting): Update to new API in SamplingProfiler. * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting): Initialize m_samplingProfilerThreadID. (WebCore::threadInfoMap): (WebCore::threadCPUUsage): (WebCore::collectCPUUsage): (WebCore::ResourceUsageThread::platformCollectCPUData): (WebCore::cpuUsage): Deleted. 2020-08-31 Myles C. Maxfield <mmaxfield@apple.com> Ahom text is still busted https://bugs.webkit.org/show_bug.cgi?id=216024 <rdar://problem/60571257> Reviewed by Zalan Bujtas. r259533 didn't actually solve the problem becasue I made a typo. Luckily, iOS 14 and macOS Big Sur include a font with which this patch can be tested! So this patch actually fixes it for real. Test: fast/text/ahom.html * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::characterRangeCodePath): 2020-08-31 Mark Lam <mark.lam@apple.com> Missing exception check while handling the onbeforeunload event. https://bugs.webkit.org/show_bug.cgi?id=216015 <rdar://problem/66324934> Reviewed by Saam Barati. Test: js/dom/missing-exception-check-while-handling-onbeforeunload.html * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent): 2020-08-31 Wenson Hsieh <wenson_hsieh@apple.com> Avoid computing metadata for idempotent text autosizing on macOS https://bugs.webkit.org/show_bug.cgi?id=216011 Reviewed by Darin Adler. Avoids an unnecessary call to `adjustForTextAutosizing` during style resolution on macOS, where idempotent text autosizing is disabled. This function call populates the `AutosizeStatus` fields on `RenderStyle` that are used by the idempotent text autosizing heuristic. This function call appears consistently in traces taken while running the Multiply subtest of MotionMark, if only for a relatively small number of samples. While `AutosizeStatus::computeStatus` is designed to be very cheap, it ends up being called around 1.6 million times over the course of the subtest. * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::adjust const): 2020-08-31 Joonghun Park <jh718.park@samsung.com> Unreviewed. Remove the unused variable build warning since r238538. No new tests, no new behaviors. * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::copyNonAttributePropertiesFromElement): 2020-08-31 James Darpinian <jdarpinian@chromium.org> Implement WEBGL_compressed_texture_s3tc_srgb extension https://bugs.webkit.org/show_bug.cgi?id=215973 Reviewed by Dean Jackson. Tested by webgl/2.0.0/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMConvertWebGL.cpp: (WebCore::convertToJSValue): * html/canvas/WebGLCompressedTextureS3TCsRGB.cpp: Added. (WebCore::WebGLCompressedTextureS3TCsRGB::WebGLCompressedTextureS3TCsRGB): (WebCore::WebGLCompressedTextureS3TCsRGB::getName const): (WebCore::WebGLCompressedTextureS3TCsRGB::supported): * html/canvas/WebGLCompressedTextureS3TCsRGB.h: Added. * html/canvas/WebGLCompressedTextureS3TCsRGB.idl: Added. * html/canvas/WebGLExtension.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::getExtension): (WebCore::WebGLRenderingContext::getSupportedExtensions): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::extensionIsEnabled): (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData): (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions): (WebCore::WebGLRenderingContextBase::validateCompressedTexSubDimensions): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/ExtensionsGL.h: 2020-08-31 Antti Koivisto <antti@apple.com> Wheel event region code is not fully disabled https://bugs.webkit.org/show_bug.cgi?id=216008 <rdar://problem/68086333> Reviewed by Simon Fraser. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintObject): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::maintainsEventRegion const): Use the relevant ENABLE flag rather than !PLATFORM_IOS to compile out the code. 2020-08-31 James Darpinian <jdarpinian@chromium.org> WebGL goes in a bad state where glContext.createProgram() returns null https://bugs.webkit.org/show_bug.cgi?id=215844 Reviewed by Kenneth Russell. Added test webgl/2.0.0/conformance/canvas/render-after-resize-test.html * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::reshape): 2020-08-31 Sam Weinig <weinig@apple.com> Many settings in RuntimeEnabledSettings should autogenerated Settings: Part 1 https://bugs.webkit.org/show_bug.cgi?id=215981 Reviewed by Darin Adler. This moves an initial chunk of RuntimeEnabledSettings settings to Settings.yaml, focusing on settings that don't require substantial refactoring or new features to work in Settings.yaml. The one "substantial" change to Settings generation was to switch the conditional key, to require the complete conditional form (e.g. require ENABLE(FOO) rather than FOO), which matches WebPreferences.yaml in WebKit, and is more versitile allowing non-ENABLE based conditionals. * Modules/credentialmanagement/BasicCredential.idl: * Modules/credentialmanagement/CredentialsContainer.idl: * Modules/credentialmanagement/NavigatorCredentials.idl: * Modules/encryptedmedia/MediaKeyMessageEvent.idl: * Modules/encryptedmedia/MediaKeySession.idl: * Modules/encryptedmedia/MediaKeyStatusMap.idl: * Modules/encryptedmedia/MediaKeySystemAccess.idl: * Modules/encryptedmedia/MediaKeys.idl: * Modules/encryptedmedia/NavigatorEME.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: * Modules/gamepad/Gamepad.idl: * Modules/gamepad/GamepadButton.idl: * Modules/gamepad/GamepadEvent.idl: * Modules/gamepad/NavigatorGamepad.idl: * Modules/mediarecorder/BlobEvent.idl: * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediarecorder/MediaRecorderErrorEvent.idl: * Modules/mediastream/MediaDevices.idl: * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::updateCaptureAccordingToMutedState): * Modules/mediastream/NavigatorMediaDevices.idl: * Modules/webauthn/AuthenticatorAssertionResponse.idl: * Modules/webauthn/AuthenticatorAttestationResponse.idl: * Modules/webauthn/AuthenticatorResponse.idl: * Modules/webauthn/PublicKeyCredential.cpp: (WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable): * Modules/webauthn/PublicKeyCredential.idl: * Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb: * Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb: * Scripts/SettingsTemplates/Settings.cpp.erb: * Scripts/SettingsTemplates/Settings.h.erb: * WebCore.xcodeproj/project.pbxproj: * css/DOMCSSCustomPropertyDescriptor.idl: * css/DOMCSSRegisterCustomProperty.idl: * dom/BeforeLoadEvent.idl: * dom/CustomElementRegistry.idl: * dom/DataTransfer.idl: * dom/DataTransferItem.idl: * dom/DataTransferItemList.idl: * dom/Document.cpp: (WebCore::createUpgradeCandidateElement): * dom/Document.idl: * dom/Element.idl: * dom/InputEvent.idl: * dom/Node.cpp: (WebCore::Node::dispatchBeforeLoadEvent): * dom/StaticRange.idl: * editing/Editor.cpp: (WebCore::Editor::registerCustomUndoStep): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::isSystemPreviewLink): (WebCore::HTMLAnchorElement::parseAdClickAttribution const): (WebCore::HTMLAnchorElement::handleClick): (WebCore::HTMLAnchorElement::referrerPolicy const): * html/HTMLAnchorElement.idl: * html/HTMLAreaElement.idl: * html/HTMLButtonElement.idl: * html/HTMLFieldSetElement.idl: * html/HTMLFormElement.idl: * html/HTMLIFrameElement.cpp: (WebCore::HTMLIFrameElement::referrerPolicy const): * html/HTMLIFrameElement.idl: * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::attributeChanged): (WebCore::HTMLImageElement::isSystemPreviewImage const): (WebCore::HTMLImageElement::referrerPolicy const): * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLKeygenElement.idl: * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::as const): (WebCore::HTMLLinkElement::referrerPolicy const): * html/HTMLLinkElement.idl: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updateShouldContinueAfterNeedKey): (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded): (WebCore::HTMLMediaElement::webkitSetMediaKeys): (WebCore::HTMLMediaElement::keyAdded): (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered): * html/HTMLMediaElement.idl: * html/HTMLMetaElement.cpp: (WebCore::HTMLMetaElement::process): * html/HTMLObjectElement.idl: * html/HTMLOutputElement.idl: * html/HTMLPictureElement.cpp: (WebCore::HTMLPictureElement::isSystemPreviewImage): * html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::referrerPolicy const): * html/HTMLScriptElement.idl: * html/HTMLSelectElement.idl: * html/HTMLTextAreaElement.idl: * html/LinkRelAttribute.cpp: (WebCore::LinkRelAttribute::LinkRelAttribute): (WebCore::LinkRelAttribute::isSupported): * html/MediaEncryptedEvent.idl: * html/WebKitMediaKeyError.idl: * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner): (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): (WebCore::TokenPreloadScanner::StartTagScanner::resourceType const): (WebCore::TokenPreloadScanner::scan): * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): * loader/LinkLoader.cpp: (WebCore::LinkLoader::resourceTypeFromAsAttribute): (WebCore::createLinkPreloadResourceClient): (WebCore::LinkLoader::isSupportedType): (WebCore::LinkLoader::preloadIfNeeded): (WebCore::LinkLoader::prefetchIfNeeded): * loader/LinkLoader.h: * page/DOMWindow.idl: * page/IntersectionObserver.idl: * page/IntersectionObserverEntry.idl: * page/Navigator.cpp: (WebCore::Navigator::canShare): (WebCore::Navigator::share): * page/Navigator.h: * page/NavigatorShare.idl: * page/RuntimeEnabledFeatures.cpp: (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): (WebCore::RuntimeEnabledFeatures::touchEventsEnabled const): Deleted. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setMouseEventsSimulationEnabled): (WebCore::RuntimeEnabledFeatures::setBlankAnchorTargetImpliesNoOpenerEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::blankAnchorTargetImpliesNoOpenerEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLinkPreloadEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::linkPreloadEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLinkPrefetchEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::linkPrefetchEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setMediaPreloadingEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::mediaPreloadingEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputEventsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::inputEventsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInteractiveFormValidationEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::interactiveFormValidationEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setCustomElementsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::customElementsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setDataTransferItemsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::dataTransferItemsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebShareEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webShareEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebAuthenticationEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webAuthenticationEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebAuthenticationLocalAuthenticatorEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webAuthenticationLocalAuthenticatorEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setDisabledAdaptationsMetaTagEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::disabledAdaptationsMetaTagEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setCSSCustomPropertiesAndValuesEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::cssCustomPropertiesAndValuesEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setSyntheticEditingCommandsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::syntheticEditingCommandsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::mediaRecorderEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setMediaRecorderEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::mediaDevicesEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setMediaDevicesEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::mediaStreamEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setMediaStreamEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::screenCaptureEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setScreenCaptureEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::setGamepadsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::gamepadsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setDownloadAttributeEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::downloadAttributeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setIntersectionObserverEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::intersectionObserverEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setUndoManagerAPIEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::undoManagerAPIEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setEncryptedMediaAPIEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::encryptedMediaAPIEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLegacyEncryptedMediaAPIEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::legacyEncryptedMediaAPIEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setSystemPreviewEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::systemPreviewEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLegacyBeforeLoadEventEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::legacyBeforeLoadEventEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::adClickAttributionEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setAdClickAttributionEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::setTouchEventsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::referrerPolicyAttributeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setReferrerPolicyAttributeEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::interruptAudioOnPageVisibilityChangeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInterruptAudioOnPageVisibilityChangeEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::linkPreloadResponsiveImagesEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setLinkPreloadResponsiveImagesEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::setLazyImageLoadingEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::lazyImageLoadingEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setIsInAppBrowserPrivacyEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::isInAppBrowserPrivacyEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setNeedsInAppBrowserPrivacyQuirks): Deleted. (WebCore::RuntimeEnabledFeatures::needsInAppBrowserPrivacyQuirks const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebShareFileAPIEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webShareFileAPIEnabled const): Deleted. * page/Settings.yaml: * page/UndoItem.idl: * page/UndoManager.idl: * rendering/RenderImage.cpp: (WebCore::RenderImage::paintIntoRect): * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::setScreenCaptureEnabled): Deleted. * testing/InternalSettings.h: * testing/InternalSettings.idl: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setShouldInterruptAudioOnPageVisibilityChange): (WebCore::Internals::addPrefetchLoadEventListener): 2020-08-31 Hector Lopez <hector_i_lopez@apple.com> Unreviewed, reverting r266350. Revision is causing a constant crash on both macOS and iOS Reverted changeset: "Convert runtime flag to setting for lazy image loading" https://bugs.webkit.org/show_bug.cgi?id=215610 https://trac.webkit.org/changeset/266350 2020-08-31 Sam Weinig <weinig@apple.com> DeprecatedGlobalSettings::globalConstRedeclarationShouldThrow() is not actually a setting, so should not be in DeprecatedGlobalSettings https://bugs.webkit.org/show_bug.cgi?id=215978 Reviewed by Darin Adler. Move behavior quirk defined by DeprecatedGlobalSettings::globalConstRedeclarationShouldThrow() to its only call site in CommonVM.cpp * bindings/js/CommonVM.cpp: (WebCore::globalConstRedeclarationShouldThrow): (WebCore::commonVMSlow): * page/DeprecatedGlobalSettings.cpp: (WebCore::DeprecatedGlobalSettings::globalConstRedeclarationShouldThrow): Deleted. * page/DeprecatedGlobalSettings.h: 2020-08-31 Alex Christensen <achristensen@webkit.org> Make Big5 encoder conform to the specification and behavior of Chrome and Firefox https://bugs.webkit.org/show_bug.cgi?id=215983 Reviewed by Darin Adler. Covered by web platform tests. * platform/text/EncodingTables.cpp: * platform/text/EncodingTables.h: * platform/text/TextCodecICU.cpp: (WebCore::eucJPEncode): (WebCore::big5Encode): (WebCore::uncheckedAppendDecimal): (WebCore::urlEncodedEntityUnencodableHandler): (WebCore::entityUnencodableHandler): (WebCore::questionMarkUnencodableHandler): (WebCore::Function<void): (WebCore::TextCodecICU::encode): 2020-08-31 Wenson Hsieh <wenson_hsieh@apple.com> Optimize the implementation of TransformationMatrix::rotate(double) https://bugs.webkit.org/show_bug.cgi?id=215994 Reviewed by Tim Horton. TransformationMatrix::rotate(angle) currently just calls TransformationMatrix::rotate3d(0, 0, 1, angle), which has a fast path for the case where we're rotating about the z-axis. However, we can make this *slightly* faster by omitting the hypotenuse computation, several floating point comparisons, and several assignments in this case because we already know that we're just rotating about the z-axis. This is a small (but measurable) improvement on the Multiply subtest of MotionMark, which applies a little over 3 million rotation transformations over the course of 30 seconds. * platform/graphics/transforms/RotateTransformOperation.h: Instead of calling `rotate3d`, just have `rotate` directly call `multiply` with the following `TransformationMatrix`: ``` [[ cos(z) sin(z) 0 0 ] [ -sin(z) cos(z) 0 0 ] [ 0 0 1 0 ] [ 0 0 0 1 ]] ``` ...where `z` is the angle of rotation, in radians. * platform/graphics/transforms/TransformationMatrix.cpp: (WebCore::TransformationMatrix::rotate): * platform/graphics/transforms/TransformationMatrix.h: (WebCore::TransformationMatrix::rotate): Deleted. 2020-08-31 Aditya Keerthi <akeerthi@apple.com> [macOS] Date inputs should contain editable components https://bugs.webkit.org/show_bug.cgi?id=215155 Reviewed by Devin Rousso. Currently, users are unable to edit the values in date and time input types. To match system date controls, users should be able to select and edit individual components of the input. For example, <input type="date"> should contain an editable year, month, and day control. Note that this functionality was present in WebKit, up until it was removed in r150876. Previously known as "INPUT_MULTIPLE_FIELDS_UI", the feature was removed as it was only used by Chromium port. However, much of the removed logic remains useful and is resurfaced in this patch. Modifications were made to update the code to follow current WebKit practices. DateTimeEditElement is a wrapper element that contains individual fields. The fields are all DateTimeFieldElements. Note that DateTimeFieldElements are further specialized into DateTimeNumericFieldElement (for integral values) and DateTimeSymbolicFieldElement (for symbolic values such as A.M and P.M). DateTimeEditElement builds the control using the visitor pattern and existing parsing logic contained in DateTimeFormat. In order to reduce the patch size, this patch only sets up the rendering and layout of multiple fields for <input type="date">. Upcoming patches will add rendering for other date/time input types and introduce editability. Test: fast/forms/date/date-pseudo-elements.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/html.css: (input::-webkit-datetime-edit): (input::-webkit-datetime-edit-fields-wrapper): (input::-webkit-datetime-edit-year-field,): (input::-webkit-datetime-edit-year-field:focus,): (input::-webkit-datetime-edit-text): * html/BaseChooserOnlyDateAndTimeInputType.cpp: (WebCore::DateTimeFormatValidator::visitField): (WebCore::DateTimeFormatValidator::validateFormat): (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree): (WebCore::BaseChooserOnlyDateAndTimeInputType::destroyShadowSubtree): (WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue): (WebCore::BaseChooserOnlyDateAndTimeInputType::valueForEditControl const): (WebCore::BaseChooserOnlyDateAndTimeInputType::localeIdentifier const): * html/BaseChooserOnlyDateAndTimeInputType.h: * html/BaseDateAndTimeInputType.h: * html/DateInputType.cpp: (WebCore::DateInputType::isValidFormat const): (WebCore::DateInputType::setupLayoutParameters const): * html/DateInputType.h: * html/DateTimeLocalInputType.cpp: (WebCore::DateTimeLocalInputType::isValidFormat const): (WebCore::DateTimeLocalInputType::setupLayoutParameters const): * html/DateTimeLocalInputType.h: * html/MonthInputType.cpp: (WebCore::MonthInputType::isValidFormat const): (WebCore::MonthInputType::setupLayoutParameters const): * html/MonthInputType.h: * html/TimeInputType.cpp: (WebCore::TimeInputType::isValidFormat const): (WebCore::TimeInputType::setupLayoutParameters const): * html/TimeInputType.h: * html/WeekInputType.cpp: (WebCore::WeekInputType::isValidFormat const): (WebCore::WeekInputType::setupLayoutParameters const): * html/WeekInputType.h: * html/shadow/DateTimeEditElement.cpp: Added. (WebCore::DateTimeEditBuilder::DateTimeEditBuilder): (WebCore::DateTimeEditBuilder::build): (WebCore::DateTimeEditBuilder::visitField): (WebCore::DateTimeEditBuilder::visitLiteral): (WebCore::DateTimeEditElement::DateTimeEditElement): (WebCore::DateTimeEditElement::fieldsWrapperElement const): (WebCore::DateTimeEditElement::addField): (WebCore::DateTimeEditElement::create): (WebCore::DateTimeEditElement::layout): (WebCore::DateTimeEditElement::localeIdentifier const): (WebCore::DateTimeEditElement::resetFields): (WebCore::DateTimeEditElement::setValueAsDate): (WebCore::DateTimeEditElement::setEmptyValue): (WebCore::DateTimeEditElement::value const): * html/shadow/DateTimeEditElement.h: Added. * html/shadow/DateTimeFieldElement.cpp: Added. (WebCore::DateTimeFieldElement::DateTimeFieldElement): (WebCore::DateTimeFieldElement::initialize): (WebCore::DateTimeFieldElement::localeForOwner const): (WebCore::DateTimeFieldElement::localeIdentifier const): (WebCore::DateTimeFieldElement::updateVisibleValue): (WebCore::DateTimeFieldElement::supportsFocus const): * html/shadow/DateTimeFieldElement.h: Added. * html/shadow/DateTimeFieldElements.cpp: Added. (WebCore::DateTimeDayFieldElement::DateTimeDayFieldElement): (WebCore::DateTimeDayFieldElement::create): (WebCore::DateTimeDayFieldElement::setValueAsDate): (WebCore::DateTimeMonthFieldElement::DateTimeMonthFieldElement): (WebCore::DateTimeMonthFieldElement::create): (WebCore::DateTimeMonthFieldElement::setValueAsDate): (WebCore::DateTimeSymbolicMonthFieldElement::DateTimeSymbolicMonthFieldElement): (WebCore::DateTimeSymbolicMonthFieldElement::create): (WebCore::DateTimeSymbolicMonthFieldElement::setValueAsDate): (WebCore::DateTimeYearFieldElement::DateTimeYearFieldElement): (WebCore::DateTimeYearFieldElement::create): (WebCore::DateTimeYearFieldElement::setValueAsDate): * html/shadow/DateTimeFieldElements.h: Added. * html/shadow/DateTimeNumericFieldElement.cpp: Added. (WebCore::DateTimeNumericFieldElement::DateTimeNumericFieldElement): (WebCore::DateTimeNumericFieldElement::formatValue const): (WebCore::DateTimeNumericFieldElement::hasValue const): (WebCore::DateTimeNumericFieldElement::initialize): (WebCore::DateTimeNumericFieldElement::setEmptyValue): (WebCore::DateTimeNumericFieldElement::setValueAsInteger): (WebCore::DateTimeNumericFieldElement::value const): (WebCore::DateTimeNumericFieldElement::valueAsInteger const): (WebCore::DateTimeNumericFieldElement::visibleValue const): * html/shadow/DateTimeNumericFieldElement.h: Added. * html/shadow/DateTimeSymbolicFieldElement.cpp: Added. (WebCore::makeVisibleEmptyValue): (WebCore::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement): (WebCore::DateTimeSymbolicFieldElement::hasValue const): (WebCore::DateTimeSymbolicFieldElement::initialize): (WebCore::DateTimeSymbolicFieldElement::setEmptyValue): (WebCore::DateTimeSymbolicFieldElement::setValueAsInteger): (WebCore::DateTimeSymbolicFieldElement::value const): (WebCore::DateTimeSymbolicFieldElement::valueAsInteger const): (WebCore::DateTimeSymbolicFieldElement::visibleEmptyValue const): (WebCore::DateTimeSymbolicFieldElement::visibleValue const): * html/shadow/DateTimeSymbolicFieldElement.h: Added. (WebCore::DateTimeSymbolicFieldElement::symbolsSize const): 2020-08-31 Rob Buis <rbuis@igalia.com> Convert runtime flag to setting for lazy image loading https://bugs.webkit.org/show_bug.cgi?id=215610 Reviewed by Youenn Fablet. Convert runtime flag to setting for lazy image loading. * html/HTMLImageElement.idl: * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setLazyImageLoadingEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::lazyImageLoadingEnabled const): Deleted. * page/Settings.yaml: 2020-08-31 Youenn Fablet <youenn@apple.com> Add support for TextDecoderStream https://bugs.webkit.org/show_bug.cgi?id=215919 Reviewed by Alex Christensen. Implement TextEncoderStream as a JS built-in. It is enabled by transform stream runtime flag. TextDecoderStream takes a TransformStream and TextDecoderStreamEncoder as private slots. Add TextDecoderStreamEncoder to implement the actual UTF-8 encoding steps, as a wrapper around TextDecoder. Covered by rebased tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/TextDecoderStream.idl: Added. * dom/TextDecoderStream.js: Added. (initializeTextDecoderStream): (getter.encoding): (getter.fatal): (getter.ignoreBOM): (getter.readable): (getter.writable): * dom/TextDecoderStreamDecoder.cpp: Added. (WebCore::TextDecoderStreamDecoder::create): (WebCore::TextDecoderStreamDecoder::TextDecoderStreamDecoder): (WebCore::TextDecoderStreamDecoder::decode): (WebCore::TextDecoderStreamDecoder::flush): * dom/TextDecoderStreamDecoder.h: Added. (WebCore::TextDecoderStreamDecoder::encoding const): * dom/TextDecoderStreamDecoder.idl: Added. 2020-08-30 Wenson Hsieh <wenson_hsieh@apple.com> Make StyleRareNonInheritedData::mask and StyleBackgroundData::background DataRefs https://bugs.webkit.org/show_bug.cgi?id=215942 Reviewed by Darin Adler. A significant amount of time in MotionMark's Multiply subtest is spent underneath the copy constructor `StyleRareNonInheritedData`, and a significant amount of time underneath this copy constructor is spent copying the rare non-inherited data's mask (a `FillLayer`). This `FillLayer` is currently inline data in `StyleRareNonInheritedData`; to reduce the cost of copying rare non-inherited data, we can instead make this a `DataRef<FillLayer>`, such that copying rare data will only copy the reference to the `FillLayer` rather than the `FillLayer` itself. Upon mutating the `FillLayer`, we now use `DataRef::access()` to ensure that these `FillLayer`s are copied before writing. See below for more details. * css/makeprop.pl: (generateFillLayerPropertyInheritValueSetter): (generateFillLayerPropertyValueSetter): * rendering/style/FillLayer.cpp: (WebCore::FillLayer::create): (WebCore::FillLayer::FillLayer): Deeply copy the `FillLayer`'s linked list of `FillLayer`s. This preserves existing behavior, which currently uses `std::unique_ptr` to store the pointer to the next `FillLayer` (and therefore, requires a deep copy of the linked list when copying `FillLayer`). In a future patch, we could probably further optimize this as well to behave in a copy-on-write way, by turning the `RefPtr<FillLayer> m_next;` into an `Optional<DataRef<FillLayer>>` instead (and then use `access()` to copy the next `FillLayer` prior to writing). (WebCore::FillLayer::~FillLayer): (WebCore::FillLayer::operator=): * rendering/style/FillLayer.h: Make `FillLayer` ref-counted, and introduce new `create` methods for constructing `FillLayer`s. Use these methods in several places where we currently call the constructors directly, via `makeUnique`. (WebCore::FillLayer::copy const): (WebCore::FillLayer::setNext): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::hasBackgroundImage const): (WebCore::RenderStyle::hasFixedBackgroundImage const): (WebCore::RenderStyle::backgroundRepeatX const): (WebCore::RenderStyle::backgroundRepeatY const): (WebCore::RenderStyle::backgroundComposite const): (WebCore::RenderStyle::backgroundAttachment const): (WebCore::RenderStyle::backgroundClip const): (WebCore::RenderStyle::backgroundOrigin const): (WebCore::RenderStyle::backgroundXPosition const): (WebCore::RenderStyle::backgroundYPosition const): (WebCore::RenderStyle::backgroundSizeType const): (WebCore::RenderStyle::backgroundSizeLength const): (WebCore::RenderStyle::ensureBackgroundLayers): (WebCore::RenderStyle::maskImage const): (WebCore::RenderStyle::maskRepeatX const): (WebCore::RenderStyle::maskRepeatY const): (WebCore::RenderStyle::maskComposite const): (WebCore::RenderStyle::maskClip const): (WebCore::RenderStyle::maskOrigin const): (WebCore::RenderStyle::maskXPosition const): (WebCore::RenderStyle::maskYPosition const): (WebCore::RenderStyle::maskSizeType const): (WebCore::RenderStyle::maskSizeLength const): (WebCore::RenderStyle::ensureMaskLayers): (WebCore::RenderStyle::hasMask const): (WebCore::RenderStyle::setBackgroundXPosition): (WebCore::RenderStyle::setBackgroundYPosition): (WebCore::RenderStyle::setBackgroundSize): (WebCore::RenderStyle::setBackgroundSizeLength): (WebCore::RenderStyle::clearBackgroundLayers): (WebCore::RenderStyle::inheritBackgroundLayers): (WebCore::RenderStyle::clearMaskLayers): (WebCore::RenderStyle::inheritMaskLayers): (WebCore::RenderStyle::setMaskImage): (WebCore::RenderStyle::setMaskXPosition): (WebCore::RenderStyle::setMaskYPosition): (WebCore::RenderStyle::setMaskSize): * rendering/style/StyleBackgroundData.cpp: (WebCore::StyleBackgroundData::StyleBackgroundData): (WebCore::StyleBackgroundData::dump const): * rendering/style/StyleBackgroundData.h: Since `FillLayer` is now ref-counted, `StyleBackgroundData::background` needs to be a `DataRef` as well. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): * rendering/style/StyleRareNonInheritedData.h: 2020-08-30 Tim Horton <timothy_horton@apple.com> Remove unused editable image code https://bugs.webkit.org/show_bug.cgi?id=215991 Reviewed by Simon Fraser. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * editing/EditAction.cpp: (WebCore::undoRedoLabel): * editing/EditAction.h: * editing/Editor.cpp: (WebCore::Editor::insertEditableImage): Deleted. * editing/Editor.h: * editing/EditorCommand.cpp: (WebCore::createCommandMap): (WebCore::executeInsertEditableImage): Deleted. (WebCore::enabledInRichlyEditableTextWithEditableImagesEnabled): Deleted. * editing/InsertEditableImageCommand.cpp: Removed. * editing/InsertEditableImageCommand.h: Removed. * en.lproj/Localizable.strings: * html/HTMLAttributeNames.in: * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): (WebCore::HTMLImageElement::insertedIntoAncestor): (WebCore::HTMLImageElement::removedFromAncestor): (WebCore::HTMLImageElement::copyNonAttributePropertiesFromElement): (WebCore::HTMLImageElement::supportsFocus const): Deleted. (WebCore::HTMLImageElement::isFocusable const): Deleted. (WebCore::HTMLImageElement::didFinishInsertingNode): Deleted. (WebCore::HTMLImageElement::hasEditableImageAttribute const): Deleted. (WebCore::HTMLImageElement::editableImageViewID const): Deleted. (WebCore::HTMLImageElement::updateEditableImage): Deleted. (WebCore::HTMLImageElement::defaultEventHandler): Deleted. * html/HTMLImageElement.h: * page/ChromeClient.h: (WebCore::ChromeClient::associateEditableImageWithAttachment): Deleted. (WebCore::ChromeClient::didCreateEditableImage): Deleted. (WebCore::ChromeClient::didDestroyEditableImage): Deleted. * page/EditableImageReference.cpp: Removed. * page/EditableImageReference.h: Removed. * page/Settings.yaml: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::nextEmbeddedViewID): Deleted. * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::setContentsToSolidColor): (WebCore::GraphicsLayer::setContentsToEmbeddedView): Deleted. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView): Deleted. (WebCore::GraphicsLayerCA::setContentsToEmbeddedView): Deleted. * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCALayer.cpp: (WebCore::operator<<): * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa): (WebCore::PlatformCALayerCocoa::embeddedViewID const): Deleted. * rendering/RenderImage.cpp: (WebCore::RenderImage::isEditableImage const): Deleted. (WebCore::RenderImage::requiresLayer const): Deleted. * rendering/RenderImage.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::shouldBeNormalFlowOnly const): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingLayer const): (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const): Deleted. * rendering/RenderLayerCompositor.h: 2020-08-30 Sam Weinig <weinig@apple.com> EnabledBySetting extended attributes on a partial interface do not get merged with EnabledBySetting extended attributes on properties of that partial interface https://bugs.webkit.org/show_bug.cgi?id=215992 Reviewed by Darin Adler. Add support for merging extended attributes that support conjunctions (like EnabledBySetting) when they are used in both a partial wide context and on a member. This allows a case like: [ EnabledBySettings=FirstSetting ] partial interface Foo { [EnabledBySettings=SecondSetting] attribute DOMString bar; }; to be identical to: partial interface Foo { [EnabledBySettings=FirstSetting&SecondSetting] attribute DOMString bar; }; * bindings/scripts/CodeGenerator.pm: (MergeExtendedAttributesFromSupplemental): Factor out and rework merging logic. Only allow adding extended attributes that are allowed for the context they are being merge into to be merged, and only allow extended attributes declared in IDLAttributes.json as supporting conjunctions to be merged. (ProcessSupplementalDependencies): Call MergeExtendedAttributesFromSupplemental for each type of member. (ExtendedAttributeContains): Fix variable name, since this is used for all extended attributes, not just callWith. * bindings/scripts/IDLAttributes.json: Add supportsConjunction keys for extended attributes that support the conjunction (&) syntax and semantics. * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::JSTestEnabledBySettingPrototype::finishCreation): (WebCore::jsTestEnabledBySettingEnabledByTwoSettingsAttributeGetter): (WebCore::jsTestEnabledBySettingEnabledByTwoSettingsAttribute): (WebCore::setJSTestEnabledBySettingEnabledByTwoSettingsAttributeSetter): (WebCore::setJSTestEnabledBySettingEnabledByTwoSettingsAttribute): (WebCore::jsTestEnabledBySettingSupplementalAttributeGetter): (WebCore::jsTestEnabledBySettingSupplementalAttribute): (WebCore::setJSTestEnabledBySettingSupplementalAttributeSetter): (WebCore::setJSTestEnabledBySettingSupplementalAttribute): * bindings/scripts/test/JS/JSTestEnabledBySettingSupplemental.cpp: Added. * bindings/scripts/test/JS/JSTestEnabledBySettingSupplemental.h: Added. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestEnabledBySetting.idl: * bindings/scripts/test/TestEnabledBySettingSupplemental.idl: Added. Add/update tests. 2020-08-30 Simon Fraser <simon.fraser@apple.com> REGRESSION (r266333): Mousewheel scrolling no longer works on WinCairo https://bugs.webkit.org/show_bug.cgi?id=215990 Reviewed by Tim Horton. Make sure we call processWheelEventForScrolling() when ENABLE(WHEEL_EVENT_LATCHING) is not defined. * page/EventHandler.cpp: (WebCore::EventHandler::handleWheelEvent): 2020-08-30 Simon Fraser <simon.fraser@apple.com> Rubberbanding in an overflow:scroll can trigger page jiggles https://bugs.webkit.org/show_bug.cgi?id=215629 <rdar://problem/67295797> Reviewed by Tim Horton. When a scroller starts to rubberband, and is receiving momentum scroll events, it gets into a state where events are ignored (to stop endless stretching). When in that state, ScrollController::handleWheelEvent() needs to report that it handled the event, to avoid the event bouncing to the scrolling thread and triggering page scrolls. Test: fast/scrolling/mac/rubberband-overflow-in-wheel-region-root-jiggle.html * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): 2020-08-30 Simon Fraser <simon.fraser@apple.com> REGRESSION (r266262): Scroll latching fails when scrolling into a preventDefault() region https://bugs.webkit.org/show_bug.cgi?id=215988 <rdar://problem/68034716> Reviewed by Tim Horton. In r266262 ScrollingTreeLatchingController started to consult the "last handled wheel event" time when deciding whether to use the latched node, but we didn't update this timestamp when handling an event on the latched node, on the scrolling thread. So fix that. Test: fast/scrolling/latching/latched-scroll-into-nonfast-region.html * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::handleWheelEvent): 2020-08-29 Simon Fraser <simon.fraser@apple.com> Rewrite main thread scroll latching logic https://bugs.webkit.org/show_bug.cgi?id=215979 Reviewed by Tim Horton. The existing main thread wheel event handling and latching logic had a number of issues, some of which were indicated via the FIXME comments added in r266016: - It tracked scrollable containers as ContainerNodes rather than ScrollableAreas - It fetched and used latched state from a different frame, causing an EventHandler to end up scrolling some unrelated frame. - Overflow scrolling ignored latched state. - The latching stack's purpose was unclear. This patch fixes those issues. The design is as follow: - Latching logic is moved into ScrollLatchingController, which is owned by Page. - ScrollLatchingController owns a stack of FrameState. - When receiving a wheel event, determineWheelEventTarget() identifies the target ScrollableArea, if any, for that frame only. - As hit-testing descends into subframes, state is pushed onto ScrollLatchingController's state stack. Frames with potential scrollers have a non-null ScrollableArea in their state. - The latched ScrollableArea is the top non-null ScrollableArea in this stack. - EventHandler consults ScrollLatchingController for select, overflow and frame scrolling. This change fixes an issue where scrolling over an overflow:scroll in the non-fast scrollable region would rubber-band the overflow, rather than the main page (tested by the adjusted fast/scrolling/mac/rubberband-overflow-in-wheel-region.html). Tests: fast/scrolling/latching/latched-scroll-remove-iframe.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Element.cpp: (WebCore::Element::removedFromAncestor): * page/EventHandler.cpp: (WebCore::EventHandler::EventHandler): (WebCore::EventHandler::determineWheelEventTarget): (WebCore::EventHandler::processWheelEventForScrolling): (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): (WebCore::EventHandler::processWheelEventForScrollSnap): (WebCore::EventHandler::completeWidgetWheelEvent): (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::clearLatchedState): (WebCore::EventHandler::defaultWheelEventHandler): (WebCore::EventHandler::clearLatchedStateTimerFired): Deleted. (WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded): Deleted. * page/EventHandler.h: * page/Page.cpp: (WebCore::Page::startMonitoringWheelEvents): (WebCore::Page::scrollLatchingController): (WebCore::Page::scrollLatchingControllerIfExists): (WebCore::Page::latchingState): Deleted. (WebCore::Page::pushNewLatchingState): Deleted. (WebCore::Page::resetLatchingState): Deleted. (WebCore::Page::popLatchingState): Deleted. (WebCore::Page::removeLatchingStateForTarget): Deleted. * page/Page.h: (WebCore::Page::latchingStateStack const): Deleted. * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::determineWheelEventTarget): (WebCore::EventHandler::processWheelEventForScrolling): (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): (WebCore::EventHandler::processWheelEventForScrollSnap): (WebCore::deltaIsPredominantlyVertical): Deleted. (WebCore::scrolledToEdgeInDominantDirection): Deleted. (WebCore::latchingIsLockedToPlatformFrame): Deleted. (WebCore::latchingIsLockedToAncestorOfThisFrame): Deleted. (WebCore::latchedToFrameOrBody): Deleted. (WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded): Deleted. (WebCore::frameViewForLatchingState): Deleted. * page/scrolling/ScrollLatchingController.cpp: Added. (WebCore::ScrollLatchingController::ScrollLatchingController): (WebCore::ScrollLatchingController::clear): (WebCore::ScrollLatchingController::clearOrScheduleClearIfNeeded): (WebCore::ScrollLatchingController::clearTimerFired): (WebCore::ScrollLatchingController::receivedWheelEvent): (WebCore::ScrollLatchingController::latchingAllowsScrollingInFrame const): (WebCore::ScrollLatchingController::updateLatchingStateForFrame): (WebCore::ScrollLatchingController::getLatchingStateForFrame const): (WebCore::ScrollLatchingController::removeLatchingStateForTarget): (WebCore::ScrollLatchingController::removeLatchingStateForFrame): (WebCore::deltaIsPredominantlyVertical): (WebCore::ScrollLatchingController::shouldLatchToScrollableArea const): (WebCore::ScrollLatchingController::hasStateForFrame const): (WebCore::ScrollLatchingController::stateForFrame): (WebCore::ScrollLatchingController::stateForFrame const): (WebCore::ScrollLatchingController::dump const): (WebCore::operator<<): * page/scrolling/ScrollLatchingController.h: Added. (WebCore::ScrollLatchingController::cumulativeEventDelta const): * page/scrolling/ScrollLatchingState.cpp: Removed. * page/scrolling/ScrollLatchingState.h: Removed. * page/scrolling/ScrollingTreeLatchingController.cpp: (WebCore::ScrollingTreeLatchingController::receivedWheelEvent): (WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent): * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching const): (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching const): (WebCore::newGestureIsStarting): Deleted. * platform/PlatformWheelEvent.h: (WebCore::PlatformWheelEvent::isGestureStart const): (WebCore::PlatformWheelEvent::isGestureContinuation const): (WebCore::PlatformWheelEvent::shouldResetLatching const): (WebCore::PlatformWheelEvent::isNonGestureEvent const): (WebCore::PlatformWheelEvent::shouldConsiderLatching const): Deleted. Renamed to isGestureStart(). This class should not prescribe latching behaviors. 2020-08-30 Youenn Fablet <youenn@apple.com> Add support for TextEncoderStream https://bugs.webkit.org/show_bug.cgi?id=215916 Reviewed by Alex Christensen. Implement TextEncoderStream as a JS built-in. It is controlled by transform stream runtime flag. TextEncoderStream takes a TransformStream and TextEncoderStreamEncoder as private slots. Add TextEncoderStreamEncoder to implement the actual UTF-8 encoding steps. Covered by rebased tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/streams/TransformStream.idl: * Modules/streams/TransformStream.js: (initializeTransformStream): * Modules/streams/TransformStreamInternals.js: (createTransformStream): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/TextEncoderStream.idl: Added. * dom/TextEncoderStream.js: Added. (initializeTextEncoderStream): (getter.encoding): (getter.readable): (getter.writable): * dom/TextEncoderStreamEncoder.cpp: Added. (WebCore::TextEncoderStreamEncoder::encode): (WebCore::TextEncoderStreamEncoder::flush): * dom/TextEncoderStreamEncoder.h: Added. (WebCore::TextEncoderStreamEncoder::create): * dom/TextEncoderStreamEncoder.idl: Added. 2020-08-29 Alex Christensen <achristensen@webkit.org> Remove NFC normalization when submitting forms and encoding URL queries and fix EUC-JP encoding https://bugs.webkit.org/show_bug.cgi?id=215970 Reviewed by Darin Adler. This fixes 3 things that were common between Chrome and Firefox but different in WebKit. The first two are omitting NFC normalization when submitting forms and encoding URL queries in documents with non-UTF-8 encodings. The third is a problem with our use of ICU's EUC-JP encoding, which uses the euc-jp-2007 table. Chrome and Firefox use a slightly different table from https://encoding.spec.whatwg.org/index-jis0208.txt which is not in ICU. To be compatible and pass many web platform tests, I include the table here, which adds about 30kb to WebKit's binary size. I intend to do the same with Big5, ISO-2022-JP, Shift_JIS, and EUC-KR. I opened https://github.com/whatwg/encoding/issues/225 to resolve an ambiguity in the standard related to this. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/network/FormData.cpp: (WebCore::normalizeStringData): * platform/text/EncodingTables.cpp: Added. * platform/text/EncodingTables.h: Added. * platform/text/TextCodecICU.cpp: (WebCore::eucJPEncode): (WebCore::uncheckedAppendDecimal): (WebCore::urlEncodedEntityUnencodableHandler): (WebCore::entityUnencodableHandler): (WebCore::questionMarkUnencodableHandler): (WebCore::Function<void): (WebCore::TextCodecICU::encode): * platform/text/TextEncoding.cpp: (WebCore::TextEncoding::encode const): * platform/text/TextEncoding.h: 2020-08-29 Andy Estes <aestes@apple.com> [Cocoa] MediaSample JSON strings are created for logging to disabled channels https://bugs.webkit.org/show_bug.cgi?id=215980 <rdar://problem/68004132> Reviewed by Simon Fraser. On platforms that USE(OS_LOG), DEBUG_LOG() evaluates its arguments even in production builds. In SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID(), one DEBUG_LOG() call involved creating a non-trivial JSON object describing a MediaSample then converting that to a JSON string. This string was created even when debug logging was disabled at runtime. Profiles showed this cost half a millisecond per second of video playback on netflix.com in Safari on a MacBook Pro. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID): Rather than calling MediaSample::toJSONString() directly, let the LogArgument<MediaSample> specialization call toJSONString() iff the log channel is enabled. 2020-08-29 Sam Weinig <weinig@apple.com> Move PerformanceMonitor related DeprecatedGlobalSettings to Settings https://bugs.webkit.org/show_bug.cgi?id=215963 Reviewed by Anders Carlsson. The PerformanceMonitor related uses of DeprecatedGlobalSettings can easily be moved to Settings, as PerformanceMonitor has a Page reference. * page/DeprecatedGlobalSettings.h: (WebCore::DeprecatedGlobalSettings::isPostLoadCPUUsageMeasurementEnabled): Deleted. (WebCore::DeprecatedGlobalSettings::isPostBackgroundingCPUUsageMeasurementEnabled): Deleted. (WebCore::DeprecatedGlobalSettings::isPerActivityStateCPUUsageMeasurementEnabled): Deleted. (WebCore::DeprecatedGlobalSettings::isPostLoadMemoryUsageMeasurementEnabled): Deleted. (WebCore::DeprecatedGlobalSettings::isPostBackgroundingMemoryUsageMeasurementEnabled): Deleted. * page/Settings.yaml: * page/SettingsDefaultValues.h: Moved settings from DeprecatedGlobalSettings.h to Settings.yaml. Default values encoded in SettingsDefaultValues.h * page/PerformanceMonitor.cpp: (WebCore::PerformanceMonitor::PerformanceMonitor): (WebCore::PerformanceMonitor::didFinishLoad): (WebCore::PerformanceMonitor::activityStateChanged): Access the settings via m_page.settings(). Update constants to use constexpr. 2020-08-28 Chris Dumez <cdumez@apple.com> Update PannerNode to support k-rate automation of its AudioParams https://bugs.webkit.org/show_bug.cgi?id=215901 Reviewed by Darin Adler. Update PannerNode to support k-rate automation of its AudioParams. This patch is based on Chromium's implementation and the following change in particular: - https://chromium-review.googlesource.com/c/chromium/src/+/2096786 No new tests, rebaselined existing tests. * Modules/webaudio/AudioListener.cpp: (WebCore::AudioListener::AudioListener): (WebCore::AudioListener::hasSampleAccurateValues const): (WebCore::AudioListener::shouldUseARate const): (WebCore::AudioListener::updateValuesIfNeeded): (WebCore::AudioListener::positionXValues): (WebCore::AudioListener::positionYValues): (WebCore::AudioListener::positionZValues): (WebCore::AudioListener::forwardXValues): (WebCore::AudioListener::forwardYValues): (WebCore::AudioListener::forwardZValues): (WebCore::AudioListener::upXValues): (WebCore::AudioListener::upYValues): (WebCore::AudioListener::upZValues): Add functions to retrieve sample accurate values from the AudioListener's AudioParams. Those values are cached for performance. (WebCore::AudioListener::setPosition): Call AudioParam::setValueAtTime(value, now) instead of AudioParam::setValue(), as per: - https://www.w3.org/TR/webaudio/#dom-audiolistener-setposition (WebCore::AudioListener::setOrientation): Call AudioParam::setValueAtTime(value, now) instead of AudioParam::setValue(), as per: - https://www.w3.org/TR/webaudio/#dom-audiolistener-setorientation * Modules/webaudio/AudioListener.h: * Modules/webaudio/AudioListener.idl: Update IDL to indicate that setPosition() / setOrientation() may now throw exceptions. * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::calculateFinalValues): If we're not sample accurate, make sure we duplicate the first element of |values| to other elements. Some WPT tests kept failing without this change. * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParamTimeline.h: (WebCore::AudioParamTimeline::hasValues const): Add more constness. * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::process): (WebCore::PannerNode::processSampleAccurateValues): Add support for k-rate automation of PannerNode's AudioParams. (WebCore::PannerNode::hasSampleAccurateValues const): (WebCore::PannerNode::shouldUseARate const): (WebCore::PannerNode::setPanningModel): (WebCore::PannerNode::setPosition): Call AudioParam::setValueAtTime(value, now) instead of AudioParam::setValue(), as per: - https://www.w3.org/TR/webaudio/#dom-pannernode-setposition (WebCore::PannerNode::setOrientation): Call AudioParam::setValueAtTime(value, now) instead of AudioParam::setValue(), as per: - https://www.w3.org/TR/webaudio/#dom-pannernode-setorientation (WebCore::PannerNode::setDistanceModel): (WebCore::PannerNode::setRefDistance): (WebCore::PannerNode::setMaxDistance): (WebCore::PannerNode::setRolloffFactor): (WebCore::PannerNode::setConeOuterGain): (WebCore::PannerNode::setConeOuterAngle): (WebCore::PannerNode::setConeInnerAngle): (WebCore::PannerNode::setChannelCount): (WebCore::PannerNode::setChannelCountMode): (WebCore::PannerNode::calculateAzimuthElevation): (WebCore::PannerNode::azimuthElevation): (WebCore::PannerNode::calculateDistanceConeGain): (WebCore::PannerNode::distanceConeGain): * Modules/webaudio/PannerNode.h: * Modules/webaudio/PannerNode.idl: * platform/audio/EqualPowerPanner.cpp: (WebCore::EqualPowerPanner::calculateDesiredGain): (WebCore::EqualPowerPanner::panWithSampleAccurateValues): * platform/audio/EqualPowerPanner.h: * platform/audio/HRTFPanner.cpp: (WebCore::HRTFPanner::panWithSampleAccurateValues): * platform/audio/HRTFPanner.h: * platform/audio/Panner.h: 2020-08-28 Simon Fraser <simon.fraser@apple.com> Debug event regions should paint the interactive region https://bugs.webkit.org/show_bug.cgi?id=215955 Reviewed by Tim Horton. Interactive regions (EventRegion's region()) were not ever shown on macOS, even though we use them for async-scrolling hit-testing. Fix RenderLayerBacking::paintDebugOverlays() to always paint them if wheel event handler, or touch-action regions are enabled. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintDebugOverlays): 2020-08-28 Eric Carlson <eric.carlson@apple.com> [macOS] AirPlay device name is wrong when playing to multiple devices https://bugs.webkit.org/show_bug.cgi?id=215952 <rdar://problem/66930799> Reviewed by Jer Noble. Tested manually because this requires a specific hardware setup. * platform/graphics/avfoundation/MediaPlaybackTargetCocoa.mm: (WebCore::MediaPlaybackTargetCocoa::deviceName const): If the AVOutputContext supports multiple output devices, create the device name by concatenating the names of all of the active output devices. 2020-08-28 Sam Weinig <weinig@apple.com> [WebIDL] 'void' type is changing to 'undefined' https://bugs.webkit.org/show_bug.cgi?id=215514 <rdar://problem/67566201> Reviewed by Darin Adler. Update IDLs and IDL parsing / code generation for the switch from 'void' to 'undefined'. Also updates the parser to better match current WebIDL grammar, removing the special 'ReturnType' construction and just using 'Type' instead. * Modules/applepay/ApplePaySession.idl: * Modules/async-clipboard/Clipboard.idl: * Modules/cache/DOMCache.idl: * Modules/credentialmanagement/CredentialsContainer.idl: * Modules/encryptedmedia/MediaKeySession.h: * Modules/encryptedmedia/MediaKeySession.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: * Modules/entriesapi/ErrorCallback.idl: * Modules/entriesapi/FileCallback.idl: * Modules/entriesapi/FileSystemDirectoryEntry.idl: * Modules/entriesapi/FileSystemDirectoryReader.idl: * Modules/entriesapi/FileSystemEntriesCallback.idl: * Modules/entriesapi/FileSystemEntry.idl: * Modules/entriesapi/FileSystemEntryCallback.idl: * Modules/entriesapi/FileSystemFileEntry.idl: * Modules/fetch/FetchHeaders.idl: * Modules/geolocation/Geolocation.idl: * Modules/geolocation/PositionCallback.idl: * Modules/geolocation/PositionErrorCallback.idl: * Modules/indexeddb/IDBCursor.idl: * Modules/indexeddb/IDBDatabase.idl: * Modules/indexeddb/IDBObjectStore.idl: * Modules/indexeddb/IDBTransaction.idl: * Modules/mediacontrols/MediaControlsHost.idl: * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediasession/MediaSession.idl: * Modules/mediasource/MediaSource.idl: * Modules/mediasource/SourceBuffer.idl: * Modules/mediastream/CanvasCaptureMediaStreamTrack.idl: * Modules/mediastream/MediaStream.idl: * Modules/mediastream/MediaStreamTrack.idl: * Modules/mediastream/NavigatorMediaDevices.idl: * Modules/mediastream/RTCDTMFSender.idl: * Modules/mediastream/RTCDataChannel.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpTransceiver.idl: * Modules/notifications/Notification.idl: * Modules/notifications/NotificationPermissionCallback.idl: * Modules/paymentrequest/MerchantValidationEvent.idl: * Modules/paymentrequest/PaymentRequest.idl: * Modules/paymentrequest/PaymentRequestUpdateEvent.idl: * Modules/paymentrequest/PaymentResponse.idl: * Modules/pictureinpicture/DocumentPictureInPicture.idl: * Modules/plugins/QuickTimePluginReplacement.idl: * Modules/quota/StorageErrorCallback.idl: * Modules/quota/StorageInfo.idl: * Modules/quota/StorageQuota.idl: * Modules/quota/StorageQuotaCallback.idl: * Modules/quota/StorageUsageCallback.idl: * Modules/remoteplayback/RemotePlayback.idl: * Modules/speech/SpeechSynthesis.idl: * Modules/streams/ReadableByteStreamController.idl: * Modules/streams/ReadableStreamBYOBReader.idl: * Modules/streams/ReadableStreamBYOBRequest.idl: * Modules/streams/ReadableStreamDefaultController.idl: * Modules/streams/ReadableStreamDefaultReader.idl: * Modules/streams/ReadableStreamSink.idl: * Modules/streams/ReadableStreamSource.idl: * Modules/streams/TransformStreamDefaultController.idl: * Modules/streams/WritableStreamDefaultController.idl: * Modules/streams/WritableStreamDefaultWriter.idl: * Modules/webaudio/AnalyserNode.idl: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioBufferCallback.idl: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioListener.idl: * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioScheduledSourceNode.idl: * Modules/webaudio/BiquadFilterNode.idl: * Modules/webaudio/IIRFilterNode.idl: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/PannerNode.idl: * Modules/webaudio/WebKitAudioBufferSourceNode.idl: * Modules/webaudio/WebKitAudioContext.idl: * Modules/webaudio/WebKitAudioListener.idl: * Modules/webaudio/WebKitAudioPannerNode.idl: * Modules/webaudio/WebKitOscillatorNode.idl: * Modules/webdatabase/Database.idl: * Modules/webdatabase/DatabaseCallback.idl: * Modules/webdatabase/SQLStatementCallback.idl: * Modules/webdatabase/SQLTransaction.idl: * Modules/webdatabase/SQLTransactionCallback.idl: * Modules/webdatabase/SQLTransactionErrorCallback.idl: * Modules/webgpu/WebGPUBuffer.idl: * Modules/webgpu/WebGPUCommandEncoder.idl: * Modules/webgpu/WebGPUComputePassEncoder.idl: * Modules/webgpu/WebGPUDeviceErrorScopes.idl: * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: * Modules/webgpu/WebGPUQueue.idl: * Modules/webgpu/WebGPURenderPassEncoder.idl: * Modules/webgpu/WebGPUTexture.idl: * Modules/websockets/WebSocket.idl: * Modules/webxr/WebXRSession.idl: * Modules/webxr/WebXRSystem.idl: * Modules/webxr/XRFrameRequestCallback.idl: * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: * animation/AnimationEffect.idl: * animation/KeyframeEffect.idl: * animation/WebAnimation.idl: * bindings/IDLTypes.h: * bindings/js/DOMPromiseProxy.h: * bindings/scripts/CodeGenerator.pm: * bindings/scripts/CodeGeneratorJS.pm: (NeedsExplicitPropagateExceptionCall): (GenerateCallbackImplementationContent): (GenerateImplementationFunctionCall): (GetBaseIDLType): * bindings/scripts/IDLParser.pm: (parseCallbackRest): (parseAttributeOrOperationForStringifierOrStatic): (parseOperation): (parseSpecialOperation): (parseMapLikeProperties): (parseSetLikeProperties): (parseSingleType): (parseUnionMemberType): (parseDistinguishableType): (parseConstType): (parsePrimitiveType): (parseNonAnyType): Deleted. (parseReturnType): Deleted. * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp: (WebCore::JSTestCallbackFunctionWithThisObject::handleEvent): * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h: * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp: (WebCore::JSTestCallbackFunctionWithTypedefs::handleEvent): * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h: * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: (WebCore::JSTestCallbackInterface::callbackWithNoParam): (WebCore::JSTestCallbackInterface::callbackWithArrayParam): (WebCore::JSTestCallbackInterface::callbackWithSerializedScriptValueParam): (WebCore::JSTestCallbackInterface::callbackWithStringList): (WebCore::JSTestCallbackInterface::callbackWithBoolean): (WebCore::JSTestCallbackInterface::callbackRequiresThisToPass): * bindings/scripts/test/JS/JSTestCallbackInterface.h: * bindings/scripts/test/JS/JSTestIterable.cpp: * bindings/scripts/test/JS/JSTestNode.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::construct): (WebCore::JSTestObjPrototype::finishCreation): (WebCore::jsTestObjTestReadOnlyVoidPromiseAttributeGetter): (WebCore::jsTestObjPrototypeFunctionUndefinedMethodBody): (WebCore::jsTestObjPrototypeFunctionUndefinedMethod): (WebCore::jsTestObjPrototypeFunctionUndefinedMethodWithArgsBody): (WebCore::jsTestObjPrototypeFunctionUndefinedMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromiseBody): (WebCore::jsTestObjPrototypeFunctionTestReturnsOwnPromiseAndPromiseProxyFunctionBody): (WebCore::jsTestObjPrototypeFunctionVoidMethodBody): Deleted. (WebCore::jsTestObjPrototypeFunctionVoidMethod): Deleted. (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgsBody): Deleted. (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs): Deleted. * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp: (WebCore::JSTestVoidCallbackFunction::handleEvent): * bindings/scripts/test/JS/JSTestVoidCallbackFunction.h: * bindings/scripts/test/TestCEReactions.idl: * bindings/scripts/test/TestCallTracer.idl: * bindings/scripts/test/TestCallbackFunctionWithThisObject.idl: * bindings/scripts/test/TestCallbackFunctionWithTypedefs.idl: * bindings/scripts/test/TestCallbackInterface.idl: * bindings/scripts/test/TestDomainSecurity.idl: * bindings/scripts/test/TestEnabledBySetting.idl: * bindings/scripts/test/TestGlobalObject.idl: * bindings/scripts/test/TestImplements.idl: * bindings/scripts/test/TestIndexedSetterNoIdentifier.idl: * bindings/scripts/test/TestIndexedSetterThrowingException.idl: * bindings/scripts/test/TestIndexedSetterWithIdentifier.idl: * bindings/scripts/test/TestJSBuiltinConstructor.idl: * bindings/scripts/test/TestNamedAndIndexedSetterNoIdentifier.idl: * bindings/scripts/test/TestNamedAndIndexedSetterThrowingException.idl: * bindings/scripts/test/TestNamedAndIndexedSetterWithIdentifier.idl: * bindings/scripts/test/TestNamedDeleterNoIdentifier.idl: * bindings/scripts/test/TestNamedDeleterThrowingException.idl: * bindings/scripts/test/TestNamedDeleterWithIdentifier.idl: * bindings/scripts/test/TestNamedDeleterWithIndexedGetter.idl: * bindings/scripts/test/TestNamedSetterNoIdentifier.idl: * bindings/scripts/test/TestNamedSetterThrowingException.idl: * bindings/scripts/test/TestNamedSetterWithIdentifier.idl: * bindings/scripts/test/TestNamedSetterWithIndexedGetter.idl: * bindings/scripts/test/TestNamedSetterWithIndexedGetterAndSetter.idl: * bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl: * bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl: * bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl: * bindings/scripts/test/TestNode.idl: * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestOperationBase.idl: * bindings/scripts/test/TestSerializedScriptValueInterface.idl: * bindings/scripts/test/TestSupplemental.idl: * bindings/scripts/test/TestTypedefs.idl: * bindings/scripts/test/TestVoidCallbackFunction.idl: * css/CSSKeyframesRule.idl: * css/CSSMediaRule.idl: * css/CSSPaintCallback.idl: * css/CSSStyleDeclaration.idl: * css/CSSStyleSheet.idl: * css/CSSSupportsRule.idl: * css/DOMCSSRegisterCustomProperty.idl: * css/DeprecatedCSSOMPrimitiveValue.idl: * css/FontFaceSet.idl: * css/MediaList.idl: * css/MediaQueryList.idl: * css/WebKitCSSMatrix.idl: * dom/AbortAlgorithm.idl: * dom/AbortController.idl: * dom/AbortSignal.idl: * dom/CharacterData.idl: * dom/ChildNode.idl: * dom/CompositionEvent.idl: * dom/CustomElementRegistry.idl: * dom/CustomEvent.idl: * dom/DOMStringMap.idl: * dom/DataTransfer.idl: * dom/DataTransferItem.idl: * dom/DataTransferItemList.idl: * dom/DeviceMotionEvent.idl: * dom/DeviceOrientationEvent.idl: * dom/Document.idl: * dom/DocumentFullscreen.idl: * dom/DocumentStorageAccess.idl: * dom/Element.idl: * dom/Event.idl: * dom/EventListener.idl: * dom/EventTarget.idl: * dom/HashChangeEvent.idl: * dom/IdleRequestCallback.idl: * dom/KeyboardEvent.idl: * dom/MessageEvent.idl: * dom/MessagePort.idl: * dom/MouseEvent.idl: * dom/MutationCallback.idl: * dom/MutationEvent.idl: * dom/MutationObserver.idl: * dom/Node.idl: * dom/NodeIterator.idl: * dom/ParentNode.idl: * dom/Range.idl: * dom/RequestAnimationFrameCallback.idl: * dom/StringCallback.idl: * dom/TextEvent.idl: * dom/TouchEvent.idl: * dom/UIEvent.idl: * dom/WheelEvent.idl: * fileapi/BlobCallback.idl: * fileapi/FileReader.idl: * html/DOMFormData.idl: * html/DOMTokenList.idl: * html/DOMURL.idl: * html/HTMLButtonElement.idl: * html/HTMLCanvasElement.idl: * html/HTMLDialogElement.idl: * html/HTMLElement.idl: * html/HTMLFieldSetElement.idl: * html/HTMLFormElement.idl: * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLKeygenElement.idl: * html/HTMLMarqueeElement.idl: * html/HTMLMediaElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOptionsCollection.idl: * html/HTMLOrForeignElement.idl: * html/HTMLOutputElement.idl: * html/HTMLSelectElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTableSectionElement.idl: * html/HTMLTextAreaElement.idl: * html/HTMLVideoElement.idl: * html/ImageBitmap.idl: * html/MediaController.idl: * html/URLSearchParams.idl: * html/VoidCallback.idl: * html/canvas/ANGLEInstancedArrays.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasDrawPath.idl: * html/canvas/CanvasGradient.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPathDrawingStyles.idl: * html/canvas/CanvasPattern.idl: * html/canvas/CanvasRect.idl: * html/canvas/CanvasRenderingContext2D.idl: * html/canvas/CanvasState.idl: * html/canvas/CanvasText.idl: * html/canvas/CanvasTransform.idl: * html/canvas/CanvasUserInterface.idl: * html/canvas/ImageBitmapRenderingContext.idl: * html/canvas/OESVertexArrayObject.idl: * html/canvas/OffscreenCanvasRenderingContext2D.idl: * html/canvas/Path2D.idl: * html/canvas/WebGL2RenderingContext.idl: * html/canvas/WebGLDrawBuffers.idl: * html/canvas/WebGLLoseContext.idl: * html/canvas/WebGLRenderingContextBase.idl: * html/track/TextTrack.idl: * inspector/CommandLineAPIHost.idl: * inspector/InspectorFrontendHost.idl: * loader/appcache/DOMApplicationCache.idl: * page/DOMSelection.idl: * page/DOMWindow.idl: * page/EventSource.idl: * page/History.idl: * page/IntersectionObserver.idl: * page/IntersectionObserverCallback.idl: * page/Location.idl: * page/Navigator.idl: * page/NavigatorIsLoggedIn.idl: * page/NavigatorShare.idl: * page/Performance.idl: * page/PerformanceObserver.idl: * page/PerformanceObserverCallback.idl: * page/RemoteDOMWindow.idl: * page/ResizeObserver.idl: * page/ResizeObserverCallback.idl: * page/UndoManager.idl: * page/WindowOrWorkerGlobalScope.idl: * plugins/DOMPluginArray.idl: * storage/Storage.idl: * storage/StorageEvent.idl: * svg/SVGAngle.idl: * svg/SVGAnimationElement.idl: * svg/SVGFEDropShadowElement.idl: * svg/SVGFEGaussianBlurElement.idl: * svg/SVGFEMorphologyElement.idl: * svg/SVGLength.idl: * svg/SVGLengthList.idl: * svg/SVGMarkerElement.idl: * svg/SVGNumberList.idl: * svg/SVGPathSegList.idl: * svg/SVGPointList.idl: * svg/SVGSVGElement.idl: * svg/SVGStringList.idl: * svg/SVGTextContentElement.idl: * svg/SVGTransform.idl: * svg/SVGTransformList.idl: * testing/InternalSettings.idl: * testing/Internals.idl: * testing/MockCDMFactory.idl: * testing/MockPageOverlay.idl: * testing/MockPaymentCoordinator.idl: * testing/ServiceWorkerInternals.idl: * testing/TypeConversions.idl: * testing/WebFakeXRDevice.idl: * testing/WebFakeXRInputController.idl: * testing/WebXRTest.idl: * testing/XRSimulateUserActivationFunction.idl: * workers/DedicatedWorkerGlobalScope.idl: * workers/Worker.idl: * workers/WorkerGlobalScope.idl: * workers/service/ExtendableEvent.idl: * workers/service/FetchEvent.idl: * workers/service/ServiceWorker.idl: * workers/service/ServiceWorkerClient.idl: * workers/service/ServiceWorkerClients.idl: * workers/service/ServiceWorkerContainer.idl: * workers/service/ServiceWorkerGlobalScope.idl: * workers/service/ServiceWorkerRegistration.idl: * worklets/PaintWorkletGlobalScope.idl: * worklets/Worklet.idl: * xml/XMLHttpRequest.idl: * xml/XSLTProcessor.idl: 2020-08-28 Darin Adler <darin@apple.com> Remove almost all the remaining uses of live ranges https://bugs.webkit.org/show_bug.cgi?id=215755 Reviewed by Sam Weinig. * accessibility/AXObjectCache.cpp: (WebCore::characterOffsetsInOrder): Use documentOrder. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::misspellingRange const): Ditto. (WebCore::rangeClosestToRange): Use characterCount. Also removed unnnecessary assertions and special cases. (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): Use documentOrder. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange const): Use intersects. Also use firstRange instead of toNormalizedRange. * dom/Element.h: Export attachShadow so it can be used in unit tests. * dom/Node.cpp: (WebCore::depthInComposedTree): Renamed and changed to use parentInComposedTree instead of parentOrShadowHostNode to handle cases involving assigned slots correctly. (WebCore::commonInclusiveAncestorAndChildren): Ditto. (WebCore::isSiblingSubsequent): Added assertions. (WebCore::documentOrder): Add logic so shadow roots are ordered before the other children of their hosts in cases that don't involve assigned slots. Without this the results would be inconsistent based on the order of the arguments passed to documentOrder. * dom/Node.h: Added is_neq, is_lteq, and is_gteq for use with PartialOrdering, matching the names and behavior from C++20. * dom/Range.cpp: Removed unused CoordinateSpace. (WebCore::Range::Range): Updated since RangeBoundaryPoint now uses references. (WebCore::Range::updateDocument): Renamed from setDocument and changed so that it maintains the invariants without requiring the caller pass any arguments. Also updated for RangeBoundaryPoint anme changes. (WebCore::Range::compareBoundaryPoints): Deleted. (WebCore::checkForDifferentRootContainer): Deleted. (WebCore::Range::setStart): Updated for checkNodeOffsetPair name change. Removed too-complex code for moving between documents. Use documentOrder instead of checkForDifferentRootContainer to check for start/end that have incorrect order or no common ancestor. Use updateDocument. (WebCore::Range::setEnd): Ditto. (WebCore::Range::isPointInRange): Use isPointInRange that takes a SimpleRange. Also updated for checkNodeOffsetPair name change. (WebCore::Range::comparePoint const): Use documentOrder. Ditto. (WebCore::Range::compareNode const): Use documentOrder. (WebCore::top): Deleted. (WebCore::Range::compareBoundaryPoints const): Deleted more overloads. Kept only the one needed for bindings, and renamed it from compareBoundaryPointsForBindings. Also fixed the implementatin to be simpler, use documentOrder, and match the DOM specification more closely (without a behavior change). (WebCore::Range::boundaryPointsValid const): Deleted. (WebCore::Range::intersectsNode const): Use intersects from SimpleRange. Also don't raise exceptions. (WebCore::lengthOfContentsInNode): Deleted. This gives the same result as Node::length, but less efficiently. (WebCore::Range::processContents): Updated since RangeBoundaryPoint now uses references. (WebCore::processContentsBetweenOffsets): Removed obsolete comment. (WebCore::Range::toString const): Use intersectingNodes and characterDataOffsetRange. (WebCore::Range::text const): Deleted. (WebCore::Range::detach): Moved to the header. (WebCore::Range::checkNodeOffsetPair const): Rneamed from checkNodeWOffset. (WebCore::Range::cloneRange): Use m_ownerDocument. (WebCore::Range::setStartAfter): Tweaked coding style. (WebCore::Range::setEndBefore): Ditto. (WebCore::Range::setEndAfter): Ditto. (WebCore::Range::selectNode): Ditto. Also removed unnecessary code to call setDocument, since setStart takes care of that. (WebCore::Range::selectNodeContents): Ditto. (WebCore::Range::setStartBefore): Ditto. (WebCore::Range::firstNode const): Deleted. (WebCore::Range::pastLastNode const): Deleted. (WebCore::Range::contains const): Deleted. (WebCore::areRangesEqual): Deleted. (WebCore::rangesOverlap): Deleted. (WebCore::boundaryNodeChildrenChanged): Tweaked coding style and updated since RangeBoundaryPoint uses a reference. (WebCore::Range::nodeChildrenChanged): Use m_ownerDocument. (WebCore::boundaryNodeChildrenWillBeRemoved): Removed unneeded code to handle case where one of the children is the childBefore but the node is not inside the container -- that case doesn't exist. Use Node::contains. (WebCore::Range::nodeChildrenWillBeRemoved): Use m_ownerDocument. (WebCore::boundaryNodeWillBeRemoved): Simplify logic using Range::contains. (WebCore::Range::nodeWillBeRemoved): Use m_ownerDocument. (WebCore::Range::parentlessNodeMovedToNewDocumentAffectsRange): Updated since RangeBoundaryPoint uses a reference. (WebCore::boundaryTextInserted): Ditto. (WebCore::boundaryTextRemoved): Ditto. (WebCore::boundaryTextNodesMerged): Ditto. (WebCore::boundaryTextNodesSplit): Ditto. (showTree): Removed call to boundaryPointsValid. That's checking something the class already treats as an invariant, so it's obsolete code left from long ago when we didn't have that implemented correctly. * dom/Range.h: Reorganized the header to match the IDL file. Removed ownerDocument, compareBoundaryPoints overloads other than the one used from bindings, firstNode, pastLastNode, text, contains, areRangesEqual, and rangesOverlap. Also updated since RangeBoundaryPoint::container is now a reference. Moved detach function here to the header as an empty inline. * dom/Range.idl: Changed start/endOffset to unsigned. Stopped using the name compareBoundaryPointersForBindings. Updated intersectsNode to not throw exceptions as called for in the DOM specification. Tweaked comments. * dom/RangeBoundaryPoint.h: Changed constructor argument to a reference. Renamed setToBeforeChild, setToAfterChild, setToStartOfNode, and setToEndOfNode to setToBeforeNode, setToAfterNode, setToBeforeContents, setToAfterContents. Merged ensureOffsetIsValid into the offset function. Changed m_containerNode into a Ref<> and renamed it m_container. Removed clear. * dom/SimpleRange.cpp: (WebCore::isOffsetBeforeChild): Add logic so shadow roots are ordered after offset 0 but before offset 1 in their hosts in cases that don't involve assigned slots. This is an arbitrary choice, but is consistent with how we order shadow roots before other child nodes. (WebCore::documentOrder): Use parentInComposedTree instead of parentOrShadowHostNode to handle cases involving assigned slots correctly. (WebCore::isPointInRange): Added. (WebCore::documentOrder): Added. (WebCore::contains): Added. (WebCore::intersects): Added. (WebCore::unionRange): Added. * dom/SimpleRange.h: Updated for above. * editing/Editing.cpp: (WebCore::comparePositions): Use documentOrder. (WebCore::isNodeVisiblyContainedWithin): Use contains. * editing/Editor.cpp: (WebCore::isFrameInRange): Use intersects. (WebCore::Editor::scanSelectionForTelephoneNumbers): Use intersects. * editing/EditorCommand.cpp: (WebCore::unionRanges): Moved to SimpleRange.cpp, where it's now implemented using documentOrder. (WebCore::executeDeleteToMark): Updated name to unionRange. (WebCore::executeSelectToMark): Ditto. * editing/FrameSelection.cpp: (WebCore::FrameSelection::respondToNodeModification): Use intersects. * editing/mac/DictionaryLookupLegacy.mm: (WebCore::selectionContainsPosition): Use isPointInRange. * page/DOMSelection.cpp: (WebCore::DOMSelection::extend): Use makeRefPtr and Node::length to streamline the implementation. (WebCore::DOMSelection::getRangeAt): Use makeBoundaryPointBeforeNode and remove unneeded null check that's already covered above. (WebCore::DOMSelection::addRange): Use intersects and unionRange. (WebCore::DOMSelection::containsNode const): Use intersects and contains. (WebCore::DOMSelection::isValidForPosition const): Use boolean logic. * page/DragController.cpp: (WebCore::DragController::draggableElement const): Use contains. (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret): Use intersects. * page/EventHandler.cpp: (WebCore::EventHandler::dispatchMouseEvent): Use contains. * page/Page.cpp: (WebCore::Page::findTextMatches): Use documentOrder. * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): Use contains. * testing/Internals.cpp: (WebCore::Internals::rangeAsText): Use plainText. (WebCore::join): Added. (WebCore::Internals::rangeAsTextUsingBackwardsTextIterator): Use a vector that we reverse and join rather than inserting at the start of a string. (WebCore::Internals::subrange): Added a call to updateLayout since text iterator functions depend on the state of the render tree. Realized this was theoretically needed because of Internals::rangeAsText. (WebCore::Internals::rangeOfStringNearLocation): Ditto. 2020-08-28 Chris Dumez <cdumez@apple.com> AudioParam.value setter should call setValueAtTime(value, now) https://bugs.webkit.org/show_bug.cgi?id=215946 Reviewed by Eric Carlson. AudioParam.value setter should call setValueAtTime(value, now), as per: - https://www.w3.org/TR/webaudio/#dom-audioparam-value No new tests, rebaselined existing tests. * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::valueForBindings const): (WebCore::AudioParam::setValueForBindings): * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParam.idl: 2020-08-27 Simon Fraser <simon.fraser@apple.com> Vertical scrolling gets stuck when a horizontal scroller is under the mouse (google search results) https://bugs.webkit.org/show_bug.cgi?id=215641 <rdar://problem/67430532> Reviewed by Tim Horton. There are two parts to this fix. First, findEnclosingScrollableContainer() needs to use the same vertical-biasing delta fixup that we use in other places, to bias towards vertical scrolling. Second, when we've determined that the main frame should perform the scroll and dispatch the wheel event to the scrolling thread, we used to hit-test from scratch on the scrolling thread and and try to send the event to a scroller which we already know should not handle it. So pass along a target ScrollingNodeID, and start the scrolling thread handling from that node. Test: fast/scrolling/mac/horizontal-overflow-trapping-small-deltas.html * page/FrameView.cpp: (WebCore::FrameView::wheelEvent): * page/mac/EventHandlerMac.mm: (WebCore::findEnclosingScrollableContainer): * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::handleWheelEvent): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::handleWheelEvent): (WebCore::ScrollingTree::handleWheelEventWithNode): * page/scrolling/ScrollingTree.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread): * page/scrolling/ThreadedScrollingTree.h: * page/scrolling/mac/ScrollingCoordinatorMac.h: * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::handleWheelEvent): * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: (WebCore::ScrollingCoordinatorNicosia::handleWheelEvent): * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h: 2020-08-28 Zalan Bujtas <zalan@apple.com> No need to run full can-use-for (fast inline layout codepath) check on every style change. https://bugs.webkit.org/show_bug.cgi?id=215937 <rdar://problem/67951360> Reviewed by Antti Koivisto. Let's use the StyleDifference to figure out how extensive the can-use-for check should be. We can certainly skip some relatively expensive content checks when we know that the style change only triggers repaint or positioned-movement-only changes. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::canUseForAfterStyleChange): * layout/integration/LayoutIntegrationLineLayout.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::styleDidChange): * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::canUseForAfterStyleChange): * rendering/SimpleLineLayout.h: 2020-08-28 Myles C. Maxfield <mmaxfield@apple.com> [iOS] Vertical text's logical width calculation is stale from the previous height of the WKWebView https://bugs.webkit.org/show_bug.cgi?id=215910 Reviewed by Simon Fraser. When there is vertical text (really: orthogonal flows) in the content, the available width of the vertical text is the height of its containing block. However, the height of the containing block (indeed: all ancestors) may be "auto", in which case the CSS spec says the available width of the element should be "the initial containing block's size."[1] Previously, we were using the FrameView's visibleHeight as this metric. However, the visibleHeight is calculated asynchronously, after layout, after a round-trip from the Web Process to the UI Process and back to the Web Process. Therefore, if content changes the WKWebView's size and the web view immediatey re-lays-out, this visibleHeight metric is stale from whatever the previous height of the WKWebView was. In addition, the visibleHeight metric isn't even supposed to be used inside layout; it's instead only supposed to be used for things like position: fixed elements. Instead, we should use FrameView::layoutSize(), which is set before layout to the size of the WKWebView. The name even indicates that it should be used for layout purposes. [1] https://drafts.csswg.org/css-writing-modes-4/#orthogonal-auto Test: WebKit.OrthogonalFlowAvailableSize * rendering/RenderBox.cpp: (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight const): * rendering/RenderView.cpp: (WebCore::RenderView::availableLogicalHeight const): 2020-08-28 Tyler Wilcock <twilco.o@protonmail.com> Fix text-transform inheritance to ::marker https://bugs.webkit.org/show_bug.cgi?id=214359 Reviewed by Darin Adler. Per https://github.com/w3c/csswg-drafts/issues/4206, default ::marker pseudoelement style to `text-transform: none` in the UA stylesheet to avoid surprising effects from inheritance. No tests added -- change is tested by existing WPTs. * css/html.css: (::marker): 2020-08-28 Said Abou-Hallawa <sabouhallawa@apple.com> Remove the system tracing from DisplayList::Replayer::replay() https://bugs.webkit.org/show_bug.cgi?id=215933 Reviewed by Simon Fraser. Remove this expensive tracing point since it can affect the tracing of the MotionMark Design test. * platform/graphics/displaylists/DisplayListReplayer.cpp: (WebCore::DisplayList::Replayer::replay): 2020-08-28 Youenn Fablet <youenn@apple.com> initializeReadableStream should check for highWaterMark be undefined https://bugs.webkit.org/show_bug.cgi?id=215890 Reviewed by Alex Christensen. Covered by updated tests. * Modules/streams/ReadableStream.js: (initializeReadableStream): 2020-08-28 Ryosuke Niwa <rniwa@webkit.org> Remove adopted node from TextManipulationController https://bugs.webkit.org/show_bug.cgi?id=215914 Reviewed by Wenson Hsieh. Remove Node from TextManipulationController when it gets adopted to a new document. * dom/Node.cpp: (WebCore::Node::moveNodeToNewDocument): 2020-08-28 Antoine Quint <graouts@webkit.org> REGRESSION (r263506): scale transform transitions won't overshoot https://bugs.webkit.org/show_bug.cgi?id=215826 <rdar://problem/67759310> Reviewed by Simon Fraser. Test: webanimations/accelerated-css-transition-with-easing-y-axis-above-1.html In r263506 we made a change where accelerated animations would set their animation-wide timing functions using PlatformCAAnimation::setTimingFunction() instead of setting it on individual keyframes. This change was required to support the unique ability of JS-originated animations to specify both an animation-wide timing function as well as per-keyframe timing functions. In the case of CSS Transitions, this meant that instead of setting a per-keyframe timing function, this change would set the animation-wide timing function since CSS Transitions should map the transition-timing-function property to the "easing" property of the Animation object exposed by the Web Animations API, not as the timing function of the single keyframe interval. However, this change surfaced a bug in Core Animation on macOS and iOS where a cubic-bezier() timing function with y values above 1 get clipped when applied to a CAKeyframeAnimation using the timingFunction property (singular) instead of the timingFunctions property (plural). To work around this issue, we set Animation::property() on the generated Animation object passed to GraphicsLayerCA to make it possible to detect when we're dealing with a CSS Transition and set the timing function on the keyframe interval rather than on the animation itself. Alas, this does not fix the case where a JS-originated animation will specify an animation-wide timing function with a cubic-bezier() timing function with y values above 1. There is no known workaround at this time for this case and this is covered by bug 215918. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): 2020-08-28 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Move inline alignment code to LineBox https://bugs.webkit.org/show_bug.cgi?id=215117 Reviewed by Antti Koivisto. LineBox is responsible for aligning the runs both vertically and horizontally (LineContentAligner -> LineBox). (Note that LineBox::m_runRectList is transitional and will eventually be converted to inline boxes.) * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): (WebCore::Layout::HangingContent::width const): Deleted. (WebCore::Layout::HangingContent::isConditional const): Deleted. (WebCore::Layout::HangingContent::setIsConditional): Deleted. (WebCore::Layout::HangingContent::expand): Deleted. (): Deleted. (WebCore::Layout::HangingContent::reset): Deleted. (WebCore::Layout::LineContentAligner::inlineRectList const): Deleted. (WebCore::Layout::LineContentAligner::formattingContext const): Deleted. (WebCore::Layout::LineContentAligner::layoutState const): Deleted. (WebCore::Layout::LineContentAligner::LineContentAligner): Deleted. (WebCore::Layout::LineContentAligner::alignHorizontally): Deleted. (WebCore::Layout::LineContentAligner::alignVertically): Deleted. (WebCore::Layout::LineContentAligner::adjustBaselineAndLineHeight): Deleted. (WebCore::Layout::LineContentAligner::collectHangingContent const): Deleted. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::inlineRectList const): (WebCore::Layout::LineBox::logicalBottom const): (WebCore::Layout::LineBox::logicalRect const): (WebCore::Layout::LineBox::scrollableOverflow const): (WebCore::Layout::LineBox::formattingContext const): (WebCore::Layout::LineBox::layoutState const): (WebCore::Layout::LineBox::setLogicalHeight): Deleted. (WebCore::Layout::LineBox::setLogicalWidth): Deleted. (WebCore::Layout::LineBox::moveHorizontally): Deleted. (WebCore::Layout::LineBox::expandHorizontally): Deleted. (WebCore::Layout::LineBox::shrinkHorizontally): Deleted. (WebCore::Layout::LineBox::expandVertically): Deleted. (WebCore::Layout::LineBox::shrinkVertically): Deleted. (WebCore::Layout::LineBox::isConsideredEmpty const): Deleted. (WebCore::Layout::LineBox::setIsConsideredEmpty): Deleted. (WebCore::Layout::LineBox::setIsConsideredNonEmpty): Deleted. (WebCore::Layout::LineBox::LineBox): Deleted. (WebCore::Layout::LineBox::resetAlignmentBaseline): Deleted. * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::lineLogicalWidth const): (WebCore::Layout::LineBuilder::availableWidth const): * layout/inlineformatting/LineLayoutContext.cpp: (WebCore::Layout::LineLayoutContext::close): * layout/inlineformatting/LineLayoutContext.h: 2020-08-28 Chris Lord <clord@igalia.com> Add WebGL(2) context support to OffscreenCanvas https://bugs.webkit.org/show_bug.cgi?id=209809 Reviewed by Dean Jackson. Enable WebGL contexts with OffscreenCanvas by making sure the required settings are marshalled to workers and that any functionality that doesn't require an HTMLCanvasElement uses CanvasBase instead. No new tests, rebaselined existing test. * html/CanvasBase.h: * html/CustomPaintCanvas.cpp: (WebCore::CustomPaintCanvas::clearCopiedImage const): * html/CustomPaintCanvas.h: * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::clearCopiedImage const): * html/HTMLCanvasElement.h: * html/OffscreenCanvas.cpp: (WebCore::requiresAcceleratedCompositingForWebGL): (WebCore::shouldEnableWebGL): (WebCore::OffscreenCanvas::createContextWebGL): (WebCore::OffscreenCanvas::getContext): * html/OffscreenCanvas.h: * html/OffscreenCanvas.idl: * html/canvas/WebGL2RenderingContext.idl: * html/canvas/WebGLRenderingContext.idl: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): (WebCore::WebGLRenderingContextBase::markContextChanged): (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): * workers/WorkerGlobalScope.h: (WebCore::WorkerGlobalScope::acceleratedCompositingEnabled const): (WebCore::WorkerGlobalScope::webGLEnabled const): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): * workers/WorkerThread.cpp: (WebCore::WorkerParameters::isolatedCopy const): * workers/WorkerThread.h: * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::ServiceWorkerThread): 2020-08-28 Zalan Bujtas <zalan@apple.com> [LFC][IFC] LineBuilder:Run should not have vertical geometry https://bugs.webkit.org/show_bug.cgi?id=215068 Reviewed by Antti Koivisto. Since LineBuilder only takes care of the horizontal ascpect of a run, LineBuilder::Run should only have logical left and width geometry. The vertical geometry is computed as part of the content alignment phase in LineContentAligner (along with the final horizontal position adjusted with the alignment). This is still a transitional state (see InlineRunRectList m_runRectList) and all the line box related code will get moved to the LineBox class. This patch also enables us to keep LineBuilder::Run const. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::LineContentAligner::inlineRectList const): (WebCore::Layout::LineContentAligner::LineContentAligner): (WebCore::Layout::LineContentAligner::alignHorizontally): (WebCore::Layout::LineContentAligner::alignVertically): (WebCore::Layout::LineContentAligner::adjustBaselineAndLineHeight): (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): (WebCore::Layout::LineContentAligner::justifyRuns): Deleted. (WebCore::Layout::LineContentAligner::runContentHeight const): Deleted. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::visuallyCollapsePreWrapOverflowContent): (WebCore::Layout::LineBuilder::TrimmableTrailingContent::addFullyTrimmableContent): (WebCore::Layout::LineBuilder::TrimmableTrailingContent::addPartiallyTrimmableContent): (WebCore::Layout::LineBuilder::Run::Run): (WebCore::Layout::LineBuilder::Run::expand): (WebCore::Layout::LineBuilder::Run::removeTrailingWhitespace): (WebCore::Layout::LineBuilder::Run::setHorizontalExpansion): (WebCore::Layout::m_textContent): Deleted. (WebCore::Layout::LineBuilder::Run::setComputedHorizontalExpansion): Deleted. * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::Run::style const): (WebCore::Layout::LineBuilder::Run::logicalWidth const): (WebCore::Layout::LineBuilder::Run::logicalLeft const): (WebCore::Layout::LineBuilder::Run::expansion const): (WebCore::Layout::LineBuilder::Run::hasExpansionOpportunity const): (WebCore::Layout::LineBuilder::Run::expansionOpportunityCount const): (WebCore::Layout::LineBuilder::Run::hasTrailingWhitespace const): (WebCore::Layout::LineBuilder::Run::trailingWhitespaceWidth const): (WebCore::Layout::LineBuilder::Run::moveHorizontally): (WebCore::Layout::LineBuilder::Run::shrinkHorizontally): (WebCore::Layout::LineBuilder::Run::hasCollapsedTrailingWhitespace const): (WebCore::Layout::LineBuilder::runs const): (WebCore::Layout::LineBuilder::Run::logicalRect const): Deleted. (WebCore::Layout::LineBuilder::Run::adjustLogicalTop): Deleted. (WebCore::Layout::LineBuilder::Run::moveVertically): Deleted. (WebCore::Layout::LineBuilder::Run::setLogicalHeight): Deleted. (WebCore::Layout::LineBuilder::runs): Deleted. 2020-08-27 Chris Dumez <cdumez@apple.com> AudioParam's minValue / maxValue are ignored https://bugs.webkit.org/show_bug.cgi?id=215905 Reviewed by Darin Adler. Clamp the AudioParam's values so that they are always in the [minValue, maxValue] range. Test: webaudio/audioparam-nominal-range.html * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::value): (WebCore::AudioParam::setValue): (WebCore::AudioParam::smooth): (WebCore::AudioParam::calculateFinalValues): (WebCore::AudioParam::calculateTimelineValues): * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valueForContextTime): (WebCore::AudioParamTimeline::valuesForTimeRange): * Modules/webaudio/AudioParamTimeline.h: * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::BiquadProcessor): 2020-08-27 Ryosuke Niwa <rniwa@webkit.org> Prevent infinite recursion when upgrading custom elements https://bugs.webkit.org/show_bug.cgi?id=206605 Reviewed by Antti Koivisto. This patch updates our implementation of the concept to upgrade an element [1] and related algorithms to match the latest HTML5 specification. In particular, it incorporates the algorithmic change [2] to prevent infinite recursion an element is re-inserted into a document tree inside its constructor. The key code change is in JSCustomElementInterface::upgradeElement where this patch adds an early exit when custom element is not "undefined" or "uncustomized" and the custom element state is set to "failed" immediately before invoking the constructor. The rest of code changes deals with this "failed" state appearing during upgrades and updates various debug assertions. [1] https://html.spec.whatwg.org/multipage/custom-elements.html#concept-upgrade-an-element [2] https://github.com/whatwg/html/pull/5126 [3] https://html.spec.whatwg.org/multipage/custom-elements.html#concept-try-upgrade Test: imported/w3c/web-platform-tests/custom-elements/upgrading.html * bindings/js/JSCustomElementInterface.cpp: (WebCore::JSCustomElementInterface::constructElementWithFallback): (WebCore::JSCustomElementInterface::upgradeElement): Implements the new behavior. Note that we still need to clear the queue where we used to set the custom element state to "failed" to avoid memory leaks. * dom/CustomElementReactionQueue.cpp: (WebCore::CustomElementReactionQueue::hasJustUpgradeReaction const): Added. (WebCore::CustomElementReactionQueue::enqueueElementUpgrade): Enqueue the element to the element queue even if it had already been scheduled to upgrade previously. This makes the innermost attempt to upgrade to succeed instead of the outermost. Also updated debug assertions. (WebCore::CustomElementReactionQueue::tryToUpgradeElement): Renamed from enqueueElementUpgradeIfDefined to match the spec's name [3]. Unlike the concept in the spec, this function doesn't get called when the custom element state of the elemnt is either "undefined" or "uncustomized" to avoid unnecessary work. * dom/CustomElementReactionQueue.h: (WebCore::CustomElementReactionQueue::isEmpty const): Added. * dom/CustomElementRegistry.cpp: (WebCore::upgradeElementsInShadowIncludingDescendants): (WebCore::CustomElementRegistry::upgrade): * dom/Document.cpp: (WebCore::createFallbackHTMLElement): Call setIsCustomElementUpgradeCandidate on a newly created since we can no longer update node flags in enqueueToUpgrade * dom/Element.cpp: (WebCore::Element::insertedIntoAncestor): (WebCore::Element::setIsFailedCustomElement): Removed the unused function argument. (WebCore::Element::setIsFailedCustomElementWithoutClearingReactionQueue): Extracted from setIsFailedCustomElement. (WebCore::Element::clearReactionQueueFromFailedCustomElement): Ditto. (WebCore::Element::enqueueToUpgrade): No longer updates node flags as this would clear "failed" state from a custom element which is currently being upgraded and cause all sorts of issues. (WebCore::Element::reactionQueue const): Updated debug assertions. * dom/Element.h: 2020-08-27 John Wilander <wilander@apple.com> Remove the feature flag for capped cookies set in 3rd-party CNAME cloaked HTTP responses and add ITP debug logging https://bugs.webkit.org/show_bug.cgi?id=215902 <rdar://problem/66699731> Reviewed by Brent Fulgham. This change removes the feature flag, effectively turning the feature on. It also adds log output of cookie names that have been capped when ITP Debug Mode is enabled. WebCore::NetworkStorageSession now has a member flag for ITP debug logging. No new tests. This feature already has tests. * page/Settings.yaml: * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::setResourceLoadStatisticsDebugLoggingEnabled): (WebCore::NetworkStorageSession::resourceLoadStatisticsDebugLoggingEnabled const): New function to be able to conditionalize log output in the new feature. * platform/network/NetworkStorageSession.h: 2020-08-27 Frank Yang <guowei_yang@apple.com> CSS Filter invert() and opacity() Implementation Should Use Linear Transfer Function for Clarity and Simplicity https://bugs.webkit.org/show_bug.cgi?id=215896 Simplify CSS filters, invert() and opacity() implementation by using "linear" transfer function, instead of using a more confusing transfer function, "table". For invert(), the transfer function is type="table" tableValues="[amount] (1 - [amount])", which is equivalent to a linear function of slope 1 - 2 * [amount] and intercept [amount]; for opacity the transfer function is type="table" tableValues="0 [amount]" which is equivalent to a linear transfer function of slope [amount] and intercept 0. This change will make the implementation clearer and simpler. Reviewed by Myles C. Maxfield. No new tests needed, using existing tests in css/filter-effects * rendering/CSSFilter.cpp: (WebCore::CSSFilter::build): Modified the implementation of invert() and opacity() so that they both use a linear component transfer function instead of a more confusing table transfer function. 2020-08-27 Devin Rousso <drousso@apple.com> [iOS] provide a way to get previously inserted alternatives for the selected text https://bugs.webkit.org/show_bug.cgi?id=215816 <rdar://problem/66646042> Reviewed by Darin Adler. * editing/cocoa/AlternativeTextUIController.h: * editing/cocoa/AlternativeTextUIController.mm: (WebCore::AlternativeTextUIController::alternativesForContext): Return the raw `NSTextAlternatives *` and let the caller create the `Vector<String>` if they need to so that callers that don't can use the actual `NSTextAlternatives *`. * editing/Editor.h: * editing/Editor.cpp: (WebCore::Editor::applyDictationAlternative): Added. (WebCore::Editor::applyDictationAlternativelternative): Deleted. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): Drive-by: fix typo. 2020-08-27 Chris Dumez <cdumez@apple.com> AudioParam does not need to store its values as double https://bugs.webkit.org/show_bug.cgi?id=215903 Reviewed by Darin Adler. AudioParam does not need to store its values as double. float precision is sufficient for Web Audio values and we end up casting these values to float anyway. * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::AudioParam): (WebCore::AudioParam::value): (WebCore::AudioParam::smoothedValue): (WebCore::AudioParam::smooth): (WebCore::AudioParam::calculateFinalValues): (WebCore::AudioParam::calculateTimelineValues): * Modules/webaudio/AudioParam.h: 2020-08-27 Simon Fraser <simon.fraser@apple.com> Scrolling on select element doesn't work after scrolling the page https://bugs.webkit.org/show_bug.cgi?id=215900 <rdar://problem/67766032> Reviewed by Tim Horton. The scrolling thread could use a node that was latched some time ago; we need to check the freshness of the latched node before using it. Test: fast/scrolling/latching/latching-stuck-to-main-page.html * page/scrolling/ScrollingTreeLatchingController.cpp: (WebCore::ScrollingTreeLatchingController::receivedWheelEvent): (WebCore::ScrollingTreeLatchingController::latchedNodeForEvent const): (WebCore::ScrollingTreeLatchingController::latchedNodeIsRelevant const): * page/scrolling/ScrollingTreeLatchingController.h: 2020-08-27 Chris Dumez <cdumez@apple.com> Fix AudioParam.linearRampToValueAtTime() formula to match specification https://bugs.webkit.org/show_bug.cgi?id=215904 Reviewed by Darin Adler. Fix AudioParam.linearRampToValueAtTime() formula to match specification: - https://www.w3.org/TR/webaudio/#dom-audioparam-linearramptovalueattime We were using a different formula to compute the value and this was causing us to fail some web platform tests. No new tests, rebaselined existing tests. * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valuesForTimeRangeImpl): 2020-08-27 Joonghun Park <jh718.park@samsung.com> Implement @supports selector(). https://bugs.webkit.org/show_bug.cgi?id=199237 Reviewed by Antti Koivisto. This feature allows authors to test if the browser supports the tested selector syntax. The corresponding spec is https://drafts.csswg.org/css-conditional-4/#at-supports-ext. And unknown -webkit- pseudo elements are not supported according to the spec, https://drafts.csswg.org/css-conditional-4/#support-definition-ext. Tests: css3/conditional/w3c/at-supports-040.html css3/conditional/w3c/at-supports-041.html css3/conditional/w3c/at-supports-042.html * css/CSSValueKeywords.in: * css/parser/CSSParserImpl.h: (WebCore::CSSParserImpl::context const): * css/parser/CSSSelectorParser.cpp: (WebCore::CSSSelectorParser::supportsComplexSelector): (WebCore::CSSSelectorParser::containsUnknownWebKitPseudoElements): * css/parser/CSSSupportsParser.cpp: (WebCore::CSSSupportsParser::supportsCondition): (WebCore::CSSSupportsParser::consumeCondition): (WebCore::CSSSupportsParser::consumeNegation): (WebCore::CSSSupportsParser::consumeSupportsFeatureOrGeneralEnclosed): (WebCore::CSSSupportsParser::consumeSupportsSelectorFunction): (WebCore::CSSSupportsParser::consumeConditionInParenthesis): (WebCore::CSSSupportsParser::consumeDeclarationConditionOrGeneralEnclosed): Deleted. * css/parser/CSSSupportsParser.h: 2020-08-27 Simon Fraser <simon.fraser@apple.com> ScrollLatchingState::previousWheelScrolledElement() is unused https://bugs.webkit.org/show_bug.cgi?id=215881 Reviewed by Zalan Bujtas. Scroll latching's previousWheelScrolledElement() was unused. It was never set since we never end up with a null wheelEventElement. This functionality has been retained from ancient code with little understanding of its utility. * page/EventHandler.cpp: (WebCore::handleWheelEventInAppropriateEnclosingBox): (WebCore::EventHandler::defaultWheelEventHandler): * page/scrolling/ScrollLatchingState.cpp: (WebCore::ScrollLatchingState::clear): (WebCore::operator<<): (WebCore::ScrollLatchingState::setPreviousWheelScrolledElement): Deleted. * page/scrolling/ScrollLatchingState.h: 2020-08-27 Wenson Hsieh <wenson_hsieh@apple.com> Occasional crashes when restoring replaced text under Editor::changeBackToReplacedString https://bugs.webkit.org/show_bug.cgi?id=215892 <rdar://problem/67731156> Reviewed by Tim Horton. While reverting the replaced string in `Editor::changeBackToReplacedString`, it's possible for text replacement (`Editor::replaceSelectionWithText`) to cause the text checking paragraph range to become orphaned (if for no reason other than the fact that arbitrary script can run in between). If this happens, then our attempts to expand the checking range to paragraph boundaries underneath `TextCheckingParagraph::paragraphRange` will result in a null dereference, since the boundary points computed underneath the `expandToParagraphBoundary` helper will be `nullopt`. Mitigate this (and any other potentially similar crashes) by making `expandToParagraphBoundary` robust in the case where expanding to the start and end fails, and just fall back to returning the original text checking range instead. Test: editing/mac/input/change-back-to-replaced-string.html * editing/Editor.h: * editing/TextCheckingHelper.cpp: (WebCore::expandToParagraphBoundary): See above for more details. * testing/Internals.cpp: (WebCore::Internals::changeBackToReplacedString): * testing/Internals.h: * testing/Internals.idl: Add a simple internal testing hook to change the currently selected text back to the given replaced string. 2020-08-27 Antti Koivisto <antti@apple.com> :host() pseudo-selector reported as :host in CSSStyleRule https://bugs.webkit.org/show_bug.cgi?id=207567 <rdar://problem/59365547> Reviewed by Simon Fraser. Test case by jlo@logrocket.com Test: fast/shadow-dom/css-scoping-host-serialization.html * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): Serialize the function form of :host. 2020-08-27 Sihui Liu <sihui_liu@apple.com> REGRESSION (r264790): IndexedDB may abort transactions of in-memory databases https://bugs.webkit.org/show_bug.cgi?id=215855 <rdar://problem/67418574> Reviewed by Youenn Fablet. We don't abort transactions on in-memory database before process suspension because they don't hold database file lock. Before r264790, only ephemeral session would use in-memory databases, so we only checked session. Now persistent session also uses in-memory databases for third-party storage, so we need to add another check. API test: IndexedDB.SuspendImminentlyForThirdPartyDatabases * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::stopDatabaseActivitiesOnMainThread): 2020-08-27 Youenn Fablet <youenn@apple.com> Fix propagation of errors in TransformStream https://bugs.webkit.org/show_bug.cgi?id=215888 Reviewed by Alex Christensen. We were not passing the right values to the reject function of the promise capability. Covered by rebased tests. * Modules/streams/TransformStreamInternals.js: (transformStreamDefaultControllerPerformTransform): (transformStreamDefaultSinkWriteAlgorithm): (transformStreamDefaultSinkCloseAlgorithm): 2020-08-27 Antoine Quint <graouts@webkit.org> REGRESSION (r263506): timing of CSS Animation on https://animate.style is incorrect https://bugs.webkit.org/show_bug.cgi?id=215807 <rdar://problem/66770136> Reviewed by Simon Fraser. Test: webanimations/accelerated-css-animation-with-easing.html In r263506, we added a way for accelerated animations to adhere to both a timing function set on the animation, affecting the timing of the entire animation, as well as a timing function set on individual keyframes, affecting the timing of the animation in a given interval. Alas, this change broke handling of timing functions with implicit animation-timing-function on keyframes. That code change assumed that the Animation object ultimately passed to GraphicsLayerCA::setupAnimation() would return the animation-wide timing function through Animation::timingFunction(). This was correct for JS-originated animations, but not for CSS Animations, since that value was set based on the computed CSS property animation-timing-function for the target element. However, that CSS property does not specify the animation-wide timing function, but rather the default timing function to use for keyframes should they fail to specify an explicit timing function. To fix this, first, we ensure that the animation-wide timing function is set on the Animation object, changing KeyframeEffect::backingAnimationForCompositedRenderer() to always generate an Animation object based on the effect, divorcing itself from the Animation object created through CSS. Then, we add a new member to Animation to specify the default timing function for keyframes, allowing GraphicsLayerCA to use it to determine the timing function when building keyframes. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): Always generate an Animation object based on the effect's properties, also setting the new defaultTimingFunctionForKeyframes in the case of a CSS Animation object. * platform/animation/Animation.h: (WebCore::Animation::defaultTimingFunctionForKeyframes const): (WebCore::Animation::setDefaultTimingFunctionForKeyframes): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::animationHasStepsTimingFunction): Use the optional defaultTimingFunctionForKeyframes to determine whether a keyframe uses a steps timing function. (WebCore::GraphicsLayerCA::timingFunctionForAnimationValue): Use the optional defaultTimingFunctionForKeyframes to determine the timing function for a keyframe. 2020-08-27 Jer Noble <jer.noble@apple.com> REGRESSION (r258215): Title preview movie isn't displayed at www.thismmalife.com https://bugs.webkit.org/show_bug.cgi?id=215774 <rdar://problem/67707957> Reviewed by Eric Carlson. Test: media/video-as-img-output-pts.html Use CMSampleBufferGetOutputPresentationTimeStamp() for sample PTS. * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::ImageDecoderAVFObjC::storeSampleBuffer): 2020-08-23 Simon Fraser <simon.fraser@apple.com> ScrollLatchingState::startedGestureAtScrollLimit() is always false; remove it https://bugs.webkit.org/show_bug.cgi?id=215758 Reviewed by Darin Adler. ScrollLatchingState::startedGestureAtScrollLimit() is initialized to false and never set to true, so remove it. * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::determineWheelEventTarget): (WebCore::EventHandler::processWheelEventForScrolling): (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): * page/scrolling/ScrollLatchingState.cpp: (WebCore::operator<<): * page/scrolling/ScrollLatchingState.h: 2020-08-27 Chris Dumez <cdumez@apple.com> Unreviewed, address review comments for r266221 that I missed before landing. * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::updateSchedulingInfo): * platform/audio/AudioUtilities.cpp: (WebCore::AudioUtilities::timeToSampleFrame): 2020-08-27 Antti Koivisto <antti@apple.com> Step animations invalidate style on every rendering update whether or not they need to https://bugs.webkit.org/show_bug.cgi?id=215229 <rdar://problem/66636153> Reviewed by Antoine Quint. Step timing functions with transforms try and fail to start accelerated which causes them to repeatedly schedule unnecessary rendering updates. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::updateAcceleratedActions): Step timing functions are never accelerated so don't bother trying to start them in accelerated state. This is similar to treatmeant of unaccelerated properties. 2020-08-27 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Move LineBox out of LineBuilder https://bugs.webkit.org/show_bug.cgi?id=215048 Reviewed by Antti Koivisto. Since none of the LineBox related operations (content alignment, line sizing etc) is done during line building, we don't really need to construct a LineBox until after we finished placing all the runs on the current line. It enables us to decouple the LineBuilder and the LineBox. Let the LineBuilder place the runs and compute horizontal geometry, while LineBox takes care of the final alignment of those runs. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::LineContentAligner::adjustBaselineAndLineHeight): (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const): (WebCore::Layout::InlineFormattingContext::constraintsForLine): (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::initialLineHeight const): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::halfLeadingMetrics): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::open): (WebCore::Layout::LineBuilder::clearContent): (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::removeTrailingTrimmableContent): (WebCore::Layout::LineBuilder::visuallyCollapsePreWrapOverflowContent): (WebCore::Layout::LineBuilder::moveLogicalLeft): (WebCore::Layout::LineBuilder::appendWith): (WebCore::Layout::LineBuilder::appendNonBreakableSpace): (WebCore::Layout::LineBuilder::appendInlineContainerEnd): (WebCore::Layout::LineBuilder::appendTextContent): (WebCore::Layout::LineBuilder::appendNonReplacedInlineBox): (WebCore::Layout::LineBuilder::isRunVisuallyNonEmpty const): (WebCore::Layout::LineBuilder::initialize): Deleted. (WebCore::Layout::LineBuilder::clear): Deleted. (WebCore::Layout::LineBuilder::isVisuallyNonEmpty const): Deleted. (WebCore::Layout::LineBuilder::halfLeadingMetrics): Deleted. * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::setHasIntrusiveFloat): (WebCore::Layout::LineBuilder::hasIntrusiveFloat const): (WebCore::Layout::LineBuilder::isVisuallyEmpty const): (WebCore::Layout::LineBuilder::contentLogicalWidth const): (WebCore::Layout::LineBuilder::contentLogicalRight const): (WebCore::Layout::LineBuilder::lineBox const): Deleted. (WebCore::Layout::LineBuilder::lineBox): Deleted. * layout/inlineformatting/LineLayoutContext.cpp: (WebCore::Layout::LineLayoutContext::layoutInlineContent): (WebCore::Layout::LineLayoutContext::commitFloats): (WebCore::Layout::LineLayoutContext::rebuildLine): 2020-08-27 Antti Koivisto <antti@apple.com> Animation are invalidating too much https://bugs.webkit.org/show_bug.cgi?id=215849 Reviewed by Antoine Quint. * animation/KeyframeEffect.cpp: (WebCore::invalidateElement): Changes due to animations can't affect sibling elements so we can use internal invalidation. 2020-08-27 Youenn Fablet <youenn@apple.com> Add support for TransformStream https://bugs.webkit.org/show_bug.cgi?id=215607 Reviewed by Alex Christensen. Add initial implementation as JS built-ins as per spec. Covered by rebased tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Headers.cmake: * Modules/streams/ReadableStreamInternals.js: (readableStreamDefaultControllerShouldCallPull): (readableStreamDefaultControllerCallPullIfNeeded): * Modules/streams/TransformStream.idl: Added. * Modules/streams/TransformStream.js: Added. (initializeTransformStream): (getter.readable): (writable): * Modules/streams/TransformStreamDefaultController.idl: Added. * Modules/streams/TransformStreamDefaultController.js: Added. (initializeTransformStreamDefaultController): (getter.desiredSize): (enqueue): (error): (terminate): * Modules/streams/TransformStreamInternals.js: Added. (isTransformStream): (isTransformStreamDefaultController): (initializeTransformStream): (transformStreamError): (transformStreamErrorWritableAndUnblockWrite): (transformStreamSetBackpressure): (setUpTransformStreamDefaultController): (setUpTransformStreamDefaultControllerFromTransformer): (transformStreamDefaultControllerClearAlgorithms): (transformStreamDefaultControllerEnqueue): (transformStreamDefaultControllerError): (transformStreamDefaultControllerPerformTransform): (transformStreamDefaultSinkWriteAlgorithm): (transformStreamDefaultSinkAbortAlgorithm): (transformStreamDefaultSinkCloseAlgorithm): (transformStreamDefaultSourcePullAlgorithm): * Modules/streams/WritableStream.js: (initializeWritableStream): * Modules/streams/WritableStreamInternals.js: (createWritableStream): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setTransformStreamAPIEnabled): (WebCore::RuntimeEnabledFeatures::transformStreamAPIEnabled const): 2020-08-27 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Include the run loop source name in frame rendering timeline https://bugs.webkit.org/show_bug.cgi?id=215847 Reviewed by Adrian Perez de Castro. Include the given name in rendering frame record data. * inspector/TimelineRecordFactory.cpp: (WebCore::TimelineRecordFactory::createRenderingFrameData): * inspector/TimelineRecordFactory.h: * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::internalStart): 2020-08-27 Chris Dumez <cdumez@apple.com> Drop unnecessary BufferPlaybackMode enum from AudioBufferSourceNode https://bugs.webkit.org/show_bug.cgi?id=215878 Reviewed by Youenn Fablet. Drop unnecessary BufferPlaybackMode enum from AudioBufferSourceNode, only one of the enum values is ever used. No new tests, no web-facing behavior change. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::startLater): (WebCore::AudioBufferSourceNode::startPlaying): * Modules/webaudio/AudioBufferSourceNode.h: 2020-08-26 Brian Burg <bburg@apple.com> Web Inspector: button for Inspector^2 doesn't work without setting default for DeveloperExtrasEnabled https://bugs.webkit.org/show_bug.cgi?id=215828 Reviewed by Devin Rousso. * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::inspectInspector): Explicitly set DeveloperExtrasEnabled for the Inspector web view so that the Inspect context menu appears and so the [2] button works as expected. 2020-08-26 Zalan Bujtas <zalan@apple.com> [LFC][IFC] LineBuilder should not align the runs https://bugs.webkit.org/show_bug.cgi?id=215016 Reviewed by Antti Koivisto. This is in preparation for moving alignment logic over to the LineBox. LineBuilder is responsible for adding content to the line, but the final alignment will be done by the LineBox. This works well with preferred width computation, where we use the LineBuilder to compute line width but we don't really need to construct a LineBox (and no alignment is needed). * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::HangingContent::width const): (WebCore::Layout::HangingContent::isConditional const): (WebCore::Layout::HangingContent::setIsConditional): (WebCore::Layout::HangingContent::expand): (WebCore::Layout::HangingContent::reset): (WebCore::Layout::LineContentAligner::formattingContext const): (WebCore::Layout::LineContentAligner::layoutState const): (WebCore::Layout::LineContentAligner::LineContentAligner): (WebCore::Layout::LineContentAligner::alignHorizontally): (WebCore::Layout::LineContentAligner::alignVertically): (WebCore::Layout::LineContentAligner::justifyRuns): (WebCore::Layout::LineContentAligner::adjustBaselineAndLineHeight): (WebCore::Layout::LineContentAligner::collectHangingContent const): (WebCore::Layout::LineContentAligner::runContentHeight const): (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::LineBuilder): (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::removeTrailingTrimmableContent): (WebCore::Layout::LineBuilder::isVisuallyNonEmpty const): (WebCore::Layout::HangingContent::width const): Deleted. (WebCore::Layout::HangingContent::isConditional const): Deleted. (WebCore::Layout::HangingContent::setIsConditional): Deleted. (WebCore::Layout::HangingContent::expand): Deleted. (): Deleted. (WebCore::Layout::HangingContent::reset): Deleted. (WebCore::Layout::LineContentAligner::formattingContext const): Deleted. (WebCore::Layout::LineContentAligner::layoutState const): Deleted. (WebCore::Layout::LineContentAligner::LineContentAligner): Deleted. (WebCore::Layout::LineContentAligner::alignHorizontally): Deleted. (WebCore::Layout::LineContentAligner::alignVertically): Deleted. (WebCore::Layout::LineContentAligner::justifyRuns): Deleted. (WebCore::Layout::LineContentAligner::adjustBaselineAndLineHeight): Deleted. (WebCore::Layout::LineContentAligner::collectHangingContent const): Deleted. (WebCore::Layout::LineContentAligner::runContentHeight const): Deleted. * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::lineBox): (WebCore::Layout::LineBuilder::runs): * layout/inlineformatting/LineLayoutContext.cpp: (WebCore::Layout::LineLayoutContext::close): * layout/inlineformatting/LineLayoutContext.h: 2020-08-26 Chris Dumez <cdumez@apple.com> Add support for sub-sample accurate start for AudioBufferSourceNode https://bugs.webkit.org/show_bug.cgi?id=215868 Reviewed by Darin Adler. Implement sub-sample accurate start for AudioBufferSourceNode. Previously, if the start time was between sample boundaries, we would start the output at the frame before the start time. This is actually incorrect because we haven't actually started yet. We should start the output at the next boundary, and interpolating the value based on the true start time and the sample boundary. This is based on the following Chromium changes: - https://chromium-review.googlesource.com/c/chromium/src/+/1212270 - https://chromium-review.googlesource.com/c/chromium/src/+/1446869 No new tests, rebaselined existing test. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::process): (WebCore::AudioBufferSourceNode::renderFromBuffer): * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::updateSchedulingInfo): * Modules/webaudio/AudioScheduledSourceNode.h: * Modules/webaudio/ConstantSourceNode.cpp: (WebCore::ConstantSourceNode::process): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::process): * platform/audio/AudioUtilities.cpp: (WebCore::AudioUtilities::timeToSampleFrame): * platform/audio/AudioUtilities.h: 2020-08-26 Chris Dumez <cdumez@apple.com> Update DynamicsCompressorNode::process() to use AudioParam::finalValue() https://bugs.webkit.org/show_bug.cgi?id=215874 Reviewed by Darin Adler. Update DynamicsCompressorNode::process() to use AudioParam::finalValue(). All of DynamicsCompressorNode use k-rate (in fixed mode) so we should be using AudioParam::finalValue() unconditionally. No new tests, rebaselined existing test. * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::process): 2020-08-26 Devin Rousso <drousso@apple.com> REGRESSION: touchbar controls don't reflect video state in fullscreen https://bugs.webkit.org/show_bug.cgi?id=215873 <rdar://problem/66723354> Reviewed by Eric Carlson. * platform/mac/WebPlaybackControlsManager.h: * platform/mac/WebPlaybackControlsManager.mm: (-[WebPlaybackControlsManager setPlaying:]): (-[WebPlaybackControlsManager isPlaying]): Create an actual ivar `_playing` for holding the play/pause state. This is needed because `AVTouchBarScrubber` uses KVO to update the state of the play/pause button whenever the related video controller (in this case `AVTouchBarPlaybackControlsControlling`) changes using an `NSValueBinding`. KVO needs an actual ivar in order to function properly. 2020-08-26 Kate Cheney <katherine_cheney@apple.com> Resource Load Statistics data summary does not report data which is held up in the web content process. https://bugs.webkit.org/show_bug.cgi?id=215822 <rdar://problem/66682044> Reviewed by Chris Dumez. Send empty lambda when calling updateCentralStatisticsStore() because in these cases we don't care about timing. * loader/ResourceLoadObserver.h: (WebCore::ResourceLoadObserver::updateCentralStatisticsStore): * page/DOMWindow.cpp: (WebCore::DOMWindow::close): * testing/Internals.cpp: (WebCore::Internals::notifyResourceLoadObserver): 2020-08-25 Ryosuke Niwa <rniwa@webkit.org> Make it possible to create a WeakPtr to Node and use it store assigned nodes in SlotAssignment https://bugs.webkit.org/show_bug.cgi?id=215673 <rdar://problem/67440818> Reviewed by Darin Adler. This patch makes Node inherit from CanMakeWeakPtr<Node> and uses it in SlotAssignment's assignedNodes and related member variables and functions. No new tests since there should be no behavioral difference. * dom/ComposedTreeIterator.cpp: (WebCore::ComposedTreeIterator::traverseNextInShadowTree): (WebCore::ComposedTreeIterator::advanceInSlot): * dom/ComposedTreeIterator.h: (WebCore::firstChildInComposedTreeIgnoringUserAgentShadow): (WebCore::nextSiblingInComposedTreeIgnoringUserAgentShadow): * dom/ContainerNode.h: * dom/Node.h: * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::assignedNodesForSlot): * dom/ShadowRoot.h: * dom/SlotAssignment.cpp: (WebCore::SlotAssignment::assignedNodesForSlot): (WebCore::SlotAssignment::assignToSlot): * dom/SlotAssignment.h: * html/HTMLSlotElement.cpp: (WebCore::HTMLSlotElement::assignedNodes const): (WebCore::flattenAssignedNodes): (WebCore:: const): Deleted. * html/HTMLSlotElement.h: * page/FocusController.cpp: (WebCore::FocusNavigationScope::firstNodeInScope const): (WebCore::FocusNavigationScope::lastNodeInScope const): 2020-08-26 Andres Gonzalez <andresg_22@apple.com> Buttons with aria-haspopup attribute are not exposed to accessibility clients as form controls. https://bugs.webkit.org/show_bug.cgi?id=215866 Reviewed by Chris Fleizach. Test: accessibility/mac/search-predicate-element-count.html. Buttons with aria-haspopup were not included in the search results for client queries for form controls. Added buttons with aria-haspopup which have role PopUpButton, to the list of roles returned as form controls. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isARIAInput): Re-wrote using a switch statement for clarity and maintainability. (WebCore::AccessibilityObject::isARIAControl): Ditto. * accessibility/AccessibilityObject.h: 2020-08-26 Said Abou-Hallawa <sabouhallawa@apple.com> Leading white spaces should be ignored when parsing an SVG list property https://bugs.webkit.org/show_bug.cgi?id=215602 Reviewed by Sam Weinig. The SVG2.0 specs state that the CSS value definition syntax must be used to define the syntax of the SVG attributes. The CSS syntax states that leading and trailing spaces should be ignored when parsing the primitive data types of all the SVG lists. This has been inconsistency between WebKit and other browsers and within WebKit itself. Parsing the attribute string of an SVGTransformList skips the leading white spaces while the rest of the lists do not do that. All the parsing methods should skip the leading white spaces before looping to parse individual items. The last step of the loop is to skip the trailing spaces and the delimiter which we do already. Tests: svg/custom/feColorMatrix-values-leading-spaces.html svg/dom/svg-list-properties-parser-leading-trailing-spaces.html * svg/SVGLengthList.cpp: (WebCore::SVGLengthList::parse): * svg/SVGNumberList.cpp: (WebCore::SVGNumberList::parse): * svg/SVGStringList.cpp: (WebCore::SVGStringList::parse): * svg/SVGTransformList.cpp: (WebCore::SVGTransformList::parseGeneric): 2020-08-26 Wenson Hsieh <wenson_hsieh@apple.com> Avoid unnecessarily copying a Vector in WebCore::transformsForValue https://bugs.webkit.org/show_bug.cgi?id=215858 Reviewed by Tim Horton. Avoid copying the `Vector` of `TransformOperation`s in this helper function by directly appending newly created transform operations to the given `TransformOperations`. This does, however, mean that we need to clear these items in the case where conversion fails and we return false. * css/TransformFunctions.cpp: (WebCore::transformsForValue): 2020-08-26 Dean Jackson <dino@apple.com> Flickering on sedona.dev https://bugs.webkit.org/show_bug.cgi?id=215141 Reviewed by Darin Adler. Test: fast/canvas/webgl/compositing-without-drawing.html Our logic to determine if a canvas needs to be "repainted" was over-zealous for WebGL. We were marking any context that called draw commands as dirty, but they could in fact be rendering to an offscreen texture/framebuffer. Then, when it came time to composite, we'd happily swap buffers and show something that had never been rendered to. The fix is simply to ignore any of the dirtying notifications when we are not bound to the default (canvas) framebuffer. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::markContextChangedAndNotifyCanvasObserver): Only mark if we're rendering to the default framebuffer. 2020-08-26 Alex Christensen <achristensen@webkit.org> Implement DataTransfer constructor and multipart form filename encoding as other browsers do https://bugs.webkit.org/show_bug.cgi?id=215837 Reviewed by Youenn Fablet. Covered by newly passing WPT tests that Chrome and Firefox both pass. * dom/DataTransfer.cpp: (WebCore::DataTransfer::create): * dom/DataTransfer.h: * dom/DataTransfer.idl: * platform/network/FormDataBuilder.cpp: (WebCore::FormDataBuilder::addFilenameToMultiPartHeader): 2020-08-26 Chris Dumez <cdumez@apple.com> IIRFilterNode interface is not supported https://bugs.webkit.org/show_bug.cgi?id=215810 Reviewed by Darin Adler. Add support for IIRFilterNode interface: - https://www.w3.org/TR/webaudio/#iirfilternode The implementation is based on Chromium's. No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioNode.cpp: (WebCore::convertEnumerationToString): (WebCore::AudioNode::disableOutputsIfNecessary): * Modules/webaudio/AudioNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createIIRFilter): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/IIRDSPKernel.cpp: Added. (WebCore::IIRDSPKernel::IIRDSPKernel): (WebCore::IIRDSPKernel::getFrequencyResponse): (WebCore::IIRDSPKernel::process): (WebCore::IIRDSPKernel::reset): * Modules/webaudio/IIRDSPKernel.h: Added. * Modules/webaudio/IIRFilterNode.cpp: Added. (WebCore::isFilterStable): (WebCore::IIRFilterNode::create): (WebCore::IIRFilterNode::IIRFilterNode): (WebCore::IIRFilterNode::getFrequencyResponse): * Modules/webaudio/IIRFilterNode.h: Added. * Modules/webaudio/IIRFilterNode.idl: Added. * Modules/webaudio/IIRFilterOptions.h: Added. * Modules/webaudio/IIRFilterOptions.idl: Added. * Modules/webaudio/IIRProcessor.cpp: Added. (WebCore::IIRProcessor::IIRProcessor): (WebCore::IIRProcessor::~IIRProcessor): (WebCore::IIRProcessor::createKernel): (WebCore::IIRProcessor::process): (WebCore::IIRProcessor::getFrequencyResponse): * Modules/webaudio/IIRProcessor.h: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * platform/audio/IIRFilter.cpp: Added. (WebCore::evaluatePolynomial): (WebCore::IIRFilter::IIRFilter): (WebCore::IIRFilter::reset): (WebCore::IIRFilter::process): (WebCore::IIRFilter::getFrequencyResponse): (WebCore::IIRFilter::tailTime): * platform/audio/IIRFilter.h: Added. * platform/graphics/ImageUtilities.h: 2020-08-26 Alex Christensen <achristensen@webkit.org> Use endings from FilePropertyBag when constructing Blob data from the File https://bugs.webkit.org/show_bug.cgi?id=215857 Reviewed by Darin Adler. We had an unnecessary conversion function that converted one of the two properties of BlobPropertyBag (endings was missing). Since FilePropertyBag inherits from BlobPropertyBag, just use the original FilePropertyBag to get both properties. Covered by newly-passing WPT tests that Chrome and Firefox both pass. * fileapi/File.cpp: (WebCore::File::File): (WebCore::convertPropertyBag): Deleted. 2020-08-26 Youenn Fablet <youenn@apple.com> Abort pipeTo based on AbortSignal https://bugs.webkit.org/show_bug.cgi?id=215448 Reviewed by Alex Christensen. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/streams/ReadableStreamInternals.js: (readableStreamPipeToWritableStream): (pipeToFinalize): * Modules/streams/WritableStream.js: (initializeWritableStream): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::makeDOMExceptionForBuiltins): (WebCore::whenSignalAborted): (WebCore::JSDOMGlobalObject::addBuiltinGlobals): * bindings/js/WebCoreBuiltinNames.h: * dom/AbortAlgorithm.h: Copied from Source/WebCore/dom/AbortSignal.idl. * dom/AbortAlgorithm.idl: Copied from Source/WebCore/dom/AbortSignal.idl. * dom/AbortSignal.cpp: (WebCore::AbortSignal::whenSignalAborted): * dom/AbortSignal.h: * dom/AbortSignal.idl: 2020-08-26 Jer Noble <jer.noble@apple.com> [Mac,EME] Netflix.com shows HDCP error for all streams https://bugs.webkit.org/show_bug.cgi?id=215825 Reviewed by Eric Carlson. New API added to AVContentKeySession hits a sandbox restriction when run in the WebContent process, and the default behavior when an error checking HDCP status is to report that the output is restricted, regardless of the displays actual capabilities. To work around this behavior for now, pass in an empty displayID array, rather than the actual displayID. This causes AVFoundation to do a "lowest common level of support" rather than a specific display check. The upside is that this call no longer requires a connection to the WindowServer. The downside is that the AVContentKeyRequest will report that its output is restricted if any non-HDCP compliant display is attached. * WebCore.xcodeproj/project.pbxproj: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyRequestHasInsufficientProtectionForDisplayID const): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateProtectionStatusForDisplayID): 2020-08-26 Oriol Brufau <obrufau@igalia.com> [css-grid] Set available column space before grid items prelayout https://bugs.webkit.org/show_bug.cgi?id=199648 Reviewed by Javier Fernandez. Before running the grid track sizing algorithm, there is a prelayout step which takes care of the baseline alignment of the items. In order to do that, we estimate the size of the grid area, since we have not calculated the final size yet. The problem was that, when calculating this estimate, the available column space had not been set yet. So if a column had a percentage track sizing function, it would be treated as auto and the estimated size would be wrong. This patch sets the available column space so that we can resolve percentage track sizing functions and get a more correct estimate. Test: imported/w3c/web-platform-tests/css/css-grid/alignment/self-baseline/grid-self-baseline-008.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutBlock): 2020-08-26 Andres Gonzalez <andresg_22@apple.com> Code cleanup and consistent naming in AXIsolatedTree classes, no change in behavior. https://bugs.webkit.org/show_bug.cgi?id=215850 Reviewed by Chris Fleizach. - Renamed AXIsolatedObject::m_attributeMap to m_propertyMap for naming conssistency. - typedef -> using - Removed AXPropertyName::None, not used. - Replaced AccessibilityIsolatedTreeMathMultiscriptPair alias with its definition, shorter, clearer, and can be used for other property of the same type. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::setMathscripts): (WebCore::AXIsolatedObject::setProperty): (WebCore::AXIsolatedObject::insertMathPairs): (WebCore::AXIsolatedObject::mathPrescripts): (WebCore::AXIsolatedObject::mathPostscripts): (WebCore::AXIsolatedObject::intPointAttributeValue const): (WebCore::AXIsolatedObject::objectAttributeValue const): (WebCore::AXIsolatedObject::rectAttributeValue const): (WebCore::AXIsolatedObject::vectorAttributeValue const): (WebCore::AXIsolatedObject::optionSetAttributeValue const): (WebCore::AXIsolatedObject::pairAttributeValue const): (WebCore::AXIsolatedObject::uint64AttributeValue const): (WebCore::AXIsolatedObject::urlAttributeValue const): (WebCore::AXIsolatedObject::pathAttributeValue const): (WebCore::AXIsolatedObject::colorAttributeValue const): (WebCore::AXIsolatedObject::floatAttributeValue const): (WebCore::AXIsolatedObject::doubleAttributeValue const): (WebCore::AXIsolatedObject::unsignedAttributeValue const): (WebCore::AXIsolatedObject::boolAttributeValue const): (WebCore::AXIsolatedObject::stringAttributeValue const): (WebCore::AXIsolatedObject::intAttributeValue const): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.h: 2020-08-26 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Move inline run alignment logic to a dedicated class https://bugs.webkit.org/show_bug.cgi?id=214527 <rdar://problem/66115796> Reviewed by Antti Koivisto. This is in preparation for moving line alignment logic to LineBox (LineBuilder will not going to be responsible for aligning runs on the line). * layout/FormattingContext.h: * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineContentAligner::formattingContext const): (WebCore::Layout::LineContentAligner::layoutState const): (WebCore::Layout::LineContentAligner::LineContentAligner): (WebCore::Layout::LineContentAligner::alignHorizontally): (WebCore::Layout::LineContentAligner::alignVertically): (WebCore::Layout::LineContentAligner::justifyRuns): (WebCore::Layout::LineContentAligner::adjustBaselineAndLineHeight): (WebCore::Layout::LineContentAligner::collectHangingContent const): (WebCore::Layout::LineContentAligner::runContentHeight const): (WebCore::Layout::LineBuilder::LineBuilder): (WebCore::Layout::LineBuilder::~LineBuilder): (WebCore::Layout::LineBuilder::initialize): (WebCore::Layout::LineBuilder::clear): (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::alignContentVertically): Deleted. (WebCore::Layout::LineBuilder::justifyRuns): Deleted. (WebCore::Layout::LineBuilder::alignHorizontally): Deleted. (WebCore::Layout::LineBuilder::collectHangingContent): Deleted. (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight): Deleted. (WebCore::Layout::LineBuilder::runContentHeight const): Deleted. (WebCore::Layout::LineBuilder::layoutState const): Deleted. (WebCore::Layout::LineBuilder::root const): Deleted. * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::availableWidth const): (WebCore::Layout::LineBuilder::contentLogicalRight const): (WebCore::Layout::LineBuilder::logicalTop const): Deleted. (WebCore::Layout::LineBuilder::logicalBottom const): Deleted. (WebCore::Layout::LineBuilder::logicalLeft const): Deleted. (WebCore::Layout::LineBuilder::logicalRight const): Deleted. (WebCore::Layout::LineBuilder::logicalWidth const): Deleted. (WebCore::Layout::LineBuilder::logicalHeight const): Deleted. (WebCore::Layout::LineBuilder::baseline const): Deleted. 2020-08-26 Chris Dumez <cdumez@apple.com> REGRESSION (r265908): Crash under Blob::arrayBuffer() / Blob::text() in stress GC https://bugs.webkit.org/show_bug.cgi?id=215832 <rdar://problem/67741677> Reviewed by Ryosuke Niwa. r265908 added support for Blob::arrayBuffer() / Blob::text() which are asynchronous operations returning promises. The crash is due to the fact that the Blob's JS wrapper may get garbage collected before the promise is settled. To address the issue, this patch makes Blob an ActiveDOMObject and creates an ActiveDOMObject::pendingActivity whenever there is a pending promise so that the JS wrapper does not get garbage collected too early. Test: fast/files/blob-text-gc.html * Modules/async-clipboard/Clipboard.cpp: (WebCore::Clipboard::getType): * Modules/async-clipboard/ClipboardImageReader.h: (WebCore::ClipboardImageReader::ClipboardImageReader): * Modules/async-clipboard/ClipboardItem.cpp: (WebCore::ClipboardItem::blobFromString): * Modules/async-clipboard/ClipboardItem.h: * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp: (WebCore::ClipboardItemBindingsDataSource::getType): * Modules/async-clipboard/ios/ClipboardImageReaderIOS.mm: (WebCore::ClipboardImageReader::readBuffer): * Modules/async-clipboard/mac/ClipboardImageReaderMac.mm: (WebCore::ClipboardImageReader::readBuffer): * Modules/entriesapi/DOMFileSystem.cpp: (WebCore::DOMFileSystem::getFile): * Modules/entriesapi/DOMFileSystem.h: * Modules/entriesapi/FileSystemFileEntry.cpp: (WebCore::FileSystemFileEntry::file): * Modules/entriesapi/FileSystemFileEntry.h: * Modules/entriesapi/FileSystemFileEntry.idl: * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::fromFormData): * Modules/fetch/FetchBody.h: * Modules/fetch/FetchBodyConsumer.cpp: (WebCore::blobFromData): (WebCore::packageFormData): (WebCore::resolveWithTypeAndData): (WebCore::FetchBodyConsumer::resolve): (WebCore::FetchBodyConsumer::takeAsBlob): * Modules/fetch/FetchBodyConsumer.h: * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::blob): * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::requestData): * Modules/mediastream/RTCDataChannel.cpp: (WebCore::RTCDataChannel::didReceiveRawData): * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::didReceiveBinaryData): * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: (WebCore::WorkerThreadableWebSocketChannel::Bridge::send): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readFile): (WebCore::CloneDeserializer::readTerminal): * dom/DataTransfer.cpp: (WebCore::DataTransfer::updateFileList): (WebCore::DataTransfer::items): (WebCore::DataTransfer::filesFromPasteboardAndItemList const): (WebCore::DataTransfer::files const): * dom/DataTransfer.h: * dom/DataTransfer.idl: * dom/DataTransferItemList.cpp: (WebCore::DataTransferItemList::DataTransferItemList): (WebCore::DataTransferItemList::remove): (WebCore::DataTransferItemList::clear): (WebCore::DataTransferItemList::ensureItems const): (WebCore::DataTransferItemList::document const): * dom/DataTransferItemList.h: * dom/DataTransferItemList.idl: * editing/WebCorePasteboardFileReader.cpp: (WebCore::WebCorePasteboardFileReader::readFilename): (WebCore::WebCorePasteboardFileReader::readBuffer): * editing/WebCorePasteboardFileReader.h: * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::createFragmentForImageAttachment): (WebCore::replaceRichContentWithAttachments): (WebCore::createFragmentAndAddResources): (WebCore::sanitizeMarkupWithArchive): (WebCore::WebContentReader::readImage): (WebCore::attachmentForFilePath): (WebCore::attachmentForData): * editing/markup.cpp: (WebCore::restoreAttachmentElementsInFragment): * fileapi/Blob.cpp: (WebCore::Blob::Blob): (WebCore::Blob::loadBlob): (WebCore::Blob::activeDOMObjectName const): * fileapi/Blob.h: (WebCore::Blob::create): (WebCore::Blob::deserialize): (WebCore::Blob::slice const): * fileapi/Blob.idl: * fileapi/File.cpp: (WebCore::File::createWithRelativePath): (WebCore::File::create): (WebCore::File::File): (WebCore::File::activeDOMObjectName const): * fileapi/File.h: * fileapi/File.idl: * html/DOMFormData.cpp: (WebCore::DOMFormData::createFileEntry): * html/DirectoryFileListCreator.cpp: (WebCore::FileInformation::isolatedCopy const): (WebCore::appendDirectoryFiles): (WebCore::gatherFileInformation): (WebCore::toFileList): (WebCore::DirectoryFileListCreator::start): * html/DirectoryFileListCreator.h: * html/FileInputType.cpp: (WebCore::FileInputType::appendFormData const): (WebCore::FileInputType::filesChosen): * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData): * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::toBlob): * testing/Internals.cpp: (WebCore::Internals::createFile): * testing/ServiceWorkerInternals.cpp: (WebCore::ServiceWorkerInternals::createOpaqueWithBlobBodyResponse): * workers/service/context/ServiceWorkerFetch.cpp: (WebCore::ServiceWorkerFetch::dispatchFetchEvent): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createResponseBlob): 2020-08-26 Andres Gonzalez <andresg_22@apple.com> When caching the AccessibilityText property in AXIsolatedObject, the Strings need to be isolatedCopied. https://bugs.webkit.org/show_bug.cgi?id=215834 Reviewed by Chris Fleizach. The initialization of the AccessibilityText property in AXIsolatedObject::initializeAttributeData wasn't isolatedCopying the Strings contained in the AccessibilityText structure. Instead it was copying the String into a different structure. This patch straightlines the caching of the AccessibilityText property by isolatedCopying the original Strings. This simplifies the retrieval of this property since there is no conversion to make in the AXIsolatedObject::accessibilityText method. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): isolatedCopies the String in AccessibilityText. (WebCore::AXIsolatedObject::accessibilityText const): No conversion needed to retrieve the property. * accessibility/isolatedtree/AXIsolatedTree.h: Removed the AccessibilityIsolatedTreeText structure since it is not needed. 2020-08-26 Youenn Fablet <youenn@apple.com> enumerateDevices should expose audiooutput devices that are tied to an audio input device https://bugs.webkit.org/show_bug.cgi?id=215806 Reviewed by Eric Carlson. Add support for a speaker selection feature policy, as per https://w3c.github.io/mediacapture-output/#permissions-policy-integration. Add support for speaker mock devices and for listing speakers on MacOS in CoreAudioCaptureDeviceManager. Add support for groupId to group microphones and speakers for both mock audio manager and CoreAudioCaptureDeviceManager. For mock speakers, we add two audiooutput devices that are related to a microphone and one audiooutput that is not related to any microphone. Test: fast/mediastream/enumerate-speaker.html * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::MediaDevices): (WebCore::checkSpeakerAccess): (WebCore::toMediaDeviceInfoKind): (WebCore::MediaDevices::refreshDevices): * Modules/mediastream/MediaDevices.h: * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::sourceCaptureState): (WebCore::MediaStreamTrack::updateToPageMutedState): * html/FeaturePolicy.cpp: (WebCore::policyTypeName): (WebCore::FeaturePolicy::parse): (WebCore::FeaturePolicy::allows const): * html/FeaturePolicy.h: * page/Settings.yaml: * platform/mediastream/CaptureDevice.h: (WebCore::CaptureDevice::label const): (WebCore::CaptureDevice::setGroupId): * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices): * platform/mediastream/RealtimeMediaSourceFactory.h: * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp: (WebCore::GStreamerAudioCaptureSourceFactory::speakerDevices const): * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h: * platform/mediastream/mac/CoreAudioCaptureDevice.cpp: (WebCore::CoreAudioCaptureDevice::create): (WebCore::CoreAudioCaptureDevice::CoreAudioCaptureDevice): (WebCore::CoreAudioCaptureDevice::relatedAudioDeviceIDs): * platform/mediastream/mac/CoreAudioCaptureDevice.h: * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: (WebCore::CoreAudioCaptureDeviceManager::captureDevices): (WebCore::deviceHasOutputStreams): (WebCore::getDefaultCaptureInputDevice): (WebCore::hasDevice): (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices): * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSourceFactory::speakerDevices const): * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp: (WebCore::DisplayCaptureManagerCocoa::captureDeviceWithPersistentID): * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::create): * platform/mock/MockMediaDevice.h: (WebCore::MockSpeakerProperties::encode const): (WebCore::MockSpeakerProperties::decode): (WebCore::MockMediaDevice::isSpeaker const): (WebCore::MockMediaDevice::captureDevice const): (WebCore::MockMediaDevice::type const): (WebCore::MockMediaDevice::speakerProperties const): (WebCore::MockMediaDevice::encode const): (WebCore::MockMediaDevice::decode): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::defaultDevices): (WebCore::deviceListForDevice): (WebCore::toCaptureDevice): (WebCore::createMockDevice): (WebCore::MockRealtimeMediaSourceCenter::setDevices): (WebCore::MockRealtimeMediaSourceCenter::addDevice): (WebCore::MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID): (WebCore::MockRealtimeMediaSourceCenter::microphoneDevices): (WebCore::MockRealtimeMediaSourceCenter::speakerDevices): (WebCore::MockRealtimeMediaSourceCenter::videoDevices): * platform/mock/MockRealtimeMediaSourceCenter.h: 2020-08-26 Youenn Fablet <youenn@apple.com> pipeThrough should check for readableStream type https://bugs.webkit.org/show_bug.cgi?id=215497 Reviewed by Alex Christensen. Covered by rebased tests. * Modules/streams/ReadableStream.js: (pipeThrough): 2020-08-25 Fujii Hironori <Hironori.Fujii@sony.com> Move FreeType port's Font::platformWidthForGlyph and Font::platformBoundsForGlyph for Cairo port (WinCairo port) https://bugs.webkit.org/show_bug.cgi?id=215838 Reviewed by Carlos Garcia Campos. WinCairo was using GDI API to implement Font::platformWidthForGlyph and Font::platformBoundsForGlyph. This is a problem for Cairo DirectWrite font backend (Bug 215259). FreeType port has platform independent implementations which are using Cairo API. Use them for WinCairo. * platform/graphics/cairo/FontCairo.cpp: (WebCore::Font::platformBoundsForGlyph const): Moved from SimpleFontDataFreeType.cpp. (WebCore::Font::platformWidthForGlyph const): Ditto. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::Font::platformBoundsForGlyph const): Moved to FontCairo.cpp. (WebCore::Font::platformWidthForGlyph const): Ditto. * platform/graphics/win/SimpleFontDataCairoWin.cpp: (WebCore::Font::platformBoundsForGlyph const): Deleted. (WebCore::Font::platformWidthForGlyph const): Deleted. 2020-08-25 Tim Horton <timothy_horton@apple.com> Web Share API Level 2 functions even when its experimental feature flag is disabled https://bugs.webkit.org/show_bug.cgi?id=215831 <rdar://problem/67760687> Reviewed by Darin Adler. Tests: fast/web-share/canShare-with-files-feature-disabled.html fast/web-share/share-with-files-feature-disabled.html We had a feature flag for Web Share API Level 2, but it isn't actually consulted anywhere in the implementation. * page/Navigator.cpp: (WebCore::Navigator::canShare): Rewrite canShare to be a bit more readable, and also to consult the Level 2 feature flag. (WebCore::Navigator::share): Since canShare (per the spec) will return true if we have files and other content, even if files are not shareable, check the feature flag again before loading the files. 2020-08-25 Ryosuke Niwa <rniwa@webkit.org> HashMap<Ref<T>>::take should return RefPtr<T> https://bugs.webkit.org/show_bug.cgi?id=215830 Reviewed by Darin Adler. * Modules/indexeddb/client/IDBConnectionProxy.cpp: (WebCore::IDBClient::IDBConnectionProxy::didGetAllDatabaseNamesAndVersions): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::removeTreeForPageID): * crypto/SubtleCrypto.cpp: (WebCore::getPromise): * dom/CustomElementRegistry.cpp: (WebCore::CustomElementRegistry::addElementDefinition): * dom/ScriptRunner.cpp: (WebCore::ScriptRunner::notifyFinished): * inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::didRemoveDOMNode): * page/PageOverlayController.cpp: (WebCore::PageOverlayController::uninstallPageOverlay): * workers/service/ServiceWorkerClients.cpp: (WebCore::ServiceWorkerClients::claim): * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::ServiceWorkerThreadProxy::cancelFetch): * workers/service/server/SWServer.cpp: (WebCore::SWServer::workerContextTerminated): 2020-08-25 Zalan Bujtas <zalan@apple.com> Facebook post with lots of comments has cut off scrollbar, and can't scroll fully to the bottom (sticky) https://bugs.webkit.org/show_bug.cgi?id=215719 <rdar://problem/66411757> Reviewed by Simon Fraser. While computing the scrollable overflow for inflow positioned (or transformed) renderers, we need to take their paint geometry into account so that scrolling matches their final positions. e.g. <div style="width: 100px; height: 100px;"></div> <div style="position: relative; top: -20; width: 50px; height: 50px;"></div> While the inflow positioned block box is placed right below the previous sibling div, visually they overlap each other. If these boxes happen to be in a scrollable container, the scrolling should be driven by the overlapping state (paint geometry) and not by the layout geometry (where the 2 boxes are placed vertically after each other). While stickily positioned boxes are also considered inflow positioned, their initial inflow layout positions contribute to the scrollable overflow as they are not stationary boxes. Test: fast/css/scrollable-overflow-with-sticky-positioning.html * rendering/RenderBox.cpp: (WebCore::RenderBox::layoutOverflowRectForPropagation const): 2020-08-25 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Do not move the runs out of the LineBuilder while closing the line https://bugs.webkit.org/show_bug.cgi?id=214790 Reviewed by Antti Koivisto. Closing the line should not mean that the LineBuilder does not have the line runs anymore. This is in preparation for moving alignment code from LineBuilder to LineBox. (This patch also refactors InlineFormattingContext::lineLayout to make it less verbose.) * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::lineLayout): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const): (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::initialize): (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::append): * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::runs const): * layout/inlineformatting/LineLayoutContext.cpp: (WebCore::Layout::LineLayoutContext::layoutInlineContent): (WebCore::Layout::LineLayoutContext::close): (WebCore::Layout::LineLayoutContext::nextContentForLine): (WebCore::Layout::LineLayoutContext::commitFloats): (WebCore::Layout::LineLayoutContext::layoutLine): Deleted. * layout/inlineformatting/LineLayoutContext.h: (WebCore::Layout::LineLayoutContext::InlineItemRange::isEmpty const): (WebCore::Layout::LineLayoutContext::InlineItemRange::size const): 2020-08-25 Tim Horton <timothy_horton@apple.com> Web Share API can share non-HTTP(S) URLs https://bugs.webkit.org/show_bug.cgi?id=215823 <rdar://problem/62083130> Reviewed by Wenson Hsieh. Test: fast/web-share/share-disallows-file-urls.html * page/Navigator.cpp: (WebCore::shareableURLForShareData): (WebCore::Navigator::canShare): (WebCore::Navigator::share): Factor out the code to complete and check the scheme of the URL. Make canShare() return NO and share() fail for non-HTTP(S) or data: URLs. 2020-08-25 Brady Eidson <beidson@apple.com> Font loads quickly followed by navigations may fail indefinitely <rdar://problem/65560550> and https://bugs.webkit.org/show_bug.cgi?id=215435 Reviewed by Myles C. Maxfield. Second take at this. Myles took the first swipe at this, but a conflict with SuspendableTimer caused issues in the form of layout test asserts with http/tests/security/navigate-when-restoring-cached-page.html His original ChangeLog entry: Font loads are coalesced using a zero-delay timer. However, that zero-delay timer can fire while the page is in the middle of a navigation, which will cause the font loads to fail. Then, the second page can request those same fonts, which are marked as failed, and as such will never actually load/use the desired web font. This patch just stops the zero-delay timer during navigations, and resumes it when resuming the document. This means: 1. The second page in the above story will not see that the font has failed, or even started, and will then re-request the font and load it successfully 2. If the user goes "back" to the previous page, the zero-delay timer is restarted, the CachedFont realizes it's already succeeded, and the previous page is rendered as expected. Test: fast/loader/font-load-timer.html --- Now the explanation of the failure it caused: The font loading timer was a SuspendableTimer, which is an ActiveDOMObject. An ActiveDOMObject was used to make sure the delayed font loads play well with the page cache, which is still necessary. But we also still need to suspend the timer manually when "stopLoading()" is called, which doesn't play well with ActiveDOMObject's automatic suspend/resume. My solution: - Make the timer "just a normal timer" - Make CSSFontSelector itself the ActiveDOMObject - Let DocumentLoader explicitly pause the font load timer - Rely on ActiveDOMObject to resume the timer These keep the bug fixed and resolve the layout test ASSERT seen with http/tests/security/navigate-when-restoring-cached-page.html * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::CSSFontSelector): (WebCore::CSSFontSelector::clearDocument): (WebCore::CSSFontSelector::beginLoadingFontSoon): (WebCore::CSSFontSelector::suspendFontLoadingTimer): (WebCore::CSSFontSelector::fontLoadingTimerFired): (WebCore::CSSFontSelector::stop): (WebCore::CSSFontSelector::suspend): (WebCore::CSSFontSelector::resume): (WebCore::CSSFontSelector::beginLoadTimerFired): Deleted. * css/CSSFontSelector.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::stopLoading): 2020-08-25 Peng Liu <peng.liu6@apple.com> When using airplay with Youtube, the Youtube tab becomes completely empty and is unresponsive for an extended period of time if we switch the tab https://bugs.webkit.org/show_bug.cgi?id=215821 Reviewed by Eric Carlson. We should ignore the request to paint the current video frame when we are using airplay. It is not necessary to do so, and -[AVAssetImageGenerator copyCGImageAtTime:actualTime:error:] will block the web process for a long time if the video is airplaying. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext): 2020-08-25 Ryosuke Niwa <rniwa@webkit.org> Resolve with the class used to define the Custom Element https://bugs.webkit.org/show_bug.cgi?id=215562 Reviewed by Darin Adler. Implemented the new behavior to resolve customElements.whenDefined(~) with the custom element's constructor when it's defined. Test: imported/w3c/web-platform-tests/custom-elements/CustomElementRegistry.html * bindings/js/JSCustomElementRegistryCustom.cpp: (WebCore::JSCustomElementRegistry::define): (WebCore::whenDefinedPromise): * bindings/js/JSDOMPromiseDeferred.h: (WebCore::DeferredPromise::resolveWithJSValue): Added. * dom/CustomElementRegistry.cpp: (WebCore::CustomElementRegistry::addElementDefinition): Made this return DeferredPromise. * dom/CustomElementRegistry.h: 2020-08-25 Alex Christensen <achristensen@webkit.org> Fix read-after-free introduced in r266087 https://bugs.webkit.org/show_bug.cgi?id=215671 * Modules/fetch/FetchBodyConsumer.cpp: (WebCore::packageFormData): Keep the CString in scope while we are using it. 2020-08-25 Andres Gonzalez <andresg_22@apple.com> Crash in WebCore::AccessibilityRenderObject::textUnderElement in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=215790 Reviewed by Darin Adler. This crash is happening in isolated tree mode because AXIsolatedObject::initializeAttributeData is caching all properties of the object on a checked state changed notification. In some cases like the web page in the bug report, not all properties can be computed in the notification handler. In particular AccessibilityRenderObject::textUnderElement does the following checks: // Renders referenced by accessibility objects could get destroyed, if TextIterator ends up triggering // style update/layout here. See also AXObjectCache::deferTextChangedIfNeeded(). ASSERT_WITH_SECURITY_IMPLICATION(!nodeDocument->childNeedsStyleRecalc()); ASSERT_WITH_SECURITY_IMPLICATION(!nodeDocument->view()->layoutContext().isInRenderTreeLayout()); This patch addresses this problem by only updating the checked state property of the isolated object, instead of all properties, in the checked state change notification. This is also a performance enhancement since only the property that changed is re-calculated. The same approach will be used for other properties. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::updateIsolatedTree): Checked state changed notifications trigger an update of the corresponding isolated object's chekced state instead of the creation of a new object and re-calculation of all cached properties. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::setProperty): Removed ASSERT since it is now called in applyPendingChanges on the secondary thread. * accessibility/isolatedtree/AXIsolatedObject.h: Moved the AXPropertyName enumeration, the AttributeValueVariant and attribute map declarations out of this header into AXIsolatedTree.h in order to be able to use them in both classes. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateNode): Removed unnecessary scope operator. (WebCore::AXIsolatedTree::updateNodeCheckedState): Added. (WebCore::AXIsolatedTree::applyPendingChanges): Added updating the pending properties on the secondary thread. * accessibility/isolatedtree/AXIsolatedTree.h: Moved to this header the declarations that are now shared by AXIsolatedObject and AXIsolatedTree. 2020-08-25 Youenn Fablet <youenn@apple.com> Refresh ReadableStream.pipeTo implementation up to spec https://bugs.webkit.org/show_bug.cgi?id=215415 Reviewed by Alex Christensen. Update pipeTo implementation as per specification. Keep the old implementation if WritableStream is not enabled. Covered by existing tests. * Modules/streams/ReadableStream.js: (pipeThrough): * Modules/streams/ReadableStreamInternals.js: (acquireReadableStreamDefaultReader): (readableStreamPipeToWritableStream): (pipeToLoop): (pipeToErrorsMustBePropagatedForward): (pipeToErrorsMustBePropagatedBackward): (pipeToClosingMustBePropagatedForward): (pipeToClosingMustBePropagatedBackward): (pipeToShutdownWithAction): (pipeToShutdown): * Modules/streams/WritableStream.js: (initializeWritableStream): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::isWritableStreamAPIEnabled): (WebCore::JSDOMGlobalObject::addBuiltinGlobals): * bindings/js/WebCoreBuiltinNames.h: * dom/AbortSignal.idl: 2020-08-25 Rob Buis <rbuis@igalia.com> Add setting for lazy iframe loading https://bugs.webkit.org/show_bug.cgi?id=215566 Reviewed by Youenn Fablet. Add setting for lazy iframe loading, disabling it until this feature is implemented. * page/Settings.yaml: 2020-08-25 Zalan Bujtas <zalan@apple.com> [LFC][IFC] The initial alignment baseline is always set by the strut https://bugs.webkit.org/show_bug.cgi?id=214785 Reviewed by Antti Koivisto. Let's just use the strut ascent as the initial alignment baseline. * layout/FormattingContext.h: (WebCore::Layout::FormattingContext::root const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const): (WebCore::Layout::InlineFormattingContext::constraintsForLine): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::initialLineHeight const): (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const): Deleted. * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::LineBox): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::initialize): (WebCore::Layout::LineBuilder::root const): * layout/inlineformatting/InlineLineBuilder.h: 2020-08-25 Darin Adler <darin@apple.com> REGRESSION (r266028): platform/ios/ios/fast/coordinates/range-client-rects.html https://bugs.webkit.org/show_bug.cgi?id=215772 Reviewed by Anders Carlsson. * dom/Range.cpp: (WebCore::Range::getClientRects const): Call updateLayout since it's not safe to start working with the render tree without updating it first. Not required to fix this bug, but an obvious omission. Ideally should make a test to show this is needed. (WebCore::Range::getBoundingClientRect const): Ditto. * dom/SimpleRange.cpp: (WebCore::order): Added. (WebCore::documentOrder): Removed bogus special case. Test case proving this is wrong is coming in the next documentOrder-related patch. Not needed to fix this bug, but seems dangerous to leave this in the tree the way it was. (WebCore::firstIntersectingNodeWithDeprecatedZeroOffsetStartQuirk): Added. (WebCore::IntersectingNodeIterator::IntersectingNodeIterator): Added. * dom/SimpleRange.h: Added intersectingNodesWithDeprecatedZeroOffsetStartQuirk. * rendering/RenderObject.cpp: (WebCore::borderAndTextRects): Use intersectingNodesWithDeprecatedZeroOffsetStartQuirk because this needs to get the set of nodes in a way that works for our incorrectly formed selection ranges and includes the first element even when the range technically starts inside that element. We need to fix those, but that's a big project that affects a lot of editing code. For now, restoring the old quirk is expedient. (WebCore::RenderObject::collectSelectionRectsInternal): Ditto. 2020-08-25 Eric Carlson <eric.carlson@apple.com> [macOS] Update audio arbitration manager when audio transport changes https://bugs.webkit.org/show_bug.cgi?id=215781 <rdar://problem/65920613> Reviewed by Jer Noble. No new tests, updated AudioRoutingArbitration API test. * platform/audio/AudioSession.cpp: (WebCore::AudioSession::audioOutputDeviceChanged): Add empty method. (WebCore::setIsPlayingToBluetoothOverride): Ditto. * platform/audio/AudioSession.h: * platform/audio/cocoa/MediaSessionManagerCocoa.h: * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::audioOutputDeviceChanged): Call AudioSession::audioOutputDeviceChanged. * platform/audio/mac/AudioSessionMac.mm: (WebCore::defaultDeviceTransportIsBluetooth): New. (WebCore::AudioSession::audioOutputDeviceChanged): Clear m_private->playingToBluetooth if bluetooth transport has changed since the last arbitration update. (WebCore::AudioSession::setIsPlayingToBluetoothOverride): Allow override of bluetooth transport for testing. (WebCore::AudioSession::setCategory): Update routing arbitration if audio session category or bluetooth transport changes. * testing/Internals.cpp: (WebCore::Internals::setIsPlayingToBluetoothOverride): * testing/Internals.h: * testing/Internals.idl: 2020-08-25 Youenn Fablet <youenn@apple.com> Generated bindings for derived dictionaries are not regenerated when the base dictionary changes https://bugs.webkit.org/show_bug.cgi?id=181714 Reviewed by Darin Adler. Add dictionary file dependencies to SupplementalDependencies.dep. We add the base dictionary IDL file as a dependency to the JS cpp file of the derived dictionary. We do so if we detect that a dictionary is deriving from another and both dictionaries are in their own IDL file. Covered by updated binding tests. * bindings/scripts/preprocess-idls.pl: (updateDictionaryDependencies): * bindings/scripts/test/SupplementalDependencies.dep: Added. * bindings/scripts/test/TestDerivedDictionary2.idl: Added. * bindings/scripts/test/TestInheritedDictionary2.idl: Added. * bindings/scripts/test/JS/JSTestDerivedDictionary2.cpp: Added. (WebCore::convertDictionary<TestDerivedDictionary2>): (WebCore::convertDictionaryToJS): (WebCore::convertDictionary<TestDerivedDictionary2::Dictionary>): * bindings/scripts/test/JS/JSTestDerivedDictionary2.h: Added. * bindings/scripts/test/JS/JSTestInheritedDictionary2.cpp: Added. (WebCore::convertDictionary<TestInheritedDictionary2>): (WebCore::convertDictionaryToJS): * bindings/scripts/test/JS/JSTestInheritedDictionary2.h: Added. 2020-08-25 Myles C. Maxfield <mmaxfield@apple.com> Fonts lie about being monospaced https://bugs.webkit.org/show_bug.cgi?id=162546 <rdar://problem/28494654> Reviewed by Darin Adler. When a font reports itself to be monospace, we use this as a signal that we can perform width computations by assuming all characters have the same width as the space character. However, some fonts erroneously claim to be monospaced. We can't know this ahead of time without measuring a bunch of characters at font load time, which would be too slow, so even though the optimization would be nice there is no practical way to do it correctly. Firefox and Chrome both do not use this signal, so therefore they both correctly render these fonts. We should ignore this bit in the font as well. Also, CJK fonts generally do not have this bit set (because they usually have at least one character which is not fullwidth) so this isn't a concern there. Our Page Load Test shows this is not a performance regression. Tests: fast/text/font-erroneous-monospace.html fast/text/font-monospaced-lie.html * rendering/RenderText.cpp: (WebCore::RenderText::widthFromCache const): 2020-08-25 Youenn Fablet <youenn@apple.com> Add support for MediaRecorder bitrate options https://bugs.webkit.org/show_bug.cgi?id=214973 Reviewed by Eric Carlson. Pipe options to MediaRecorderPrivate constructor. For the actual implementation, pass it down to VideoSampleBufferCompressor and AudioSampleBufferCompressor. For AudioSampleBufferCompressor, we do not handle well some bit rates, so for now, we limit to specific values. Tests: http/wpt/mediarecorder/MediaRecorder-audio-bitrate.html http/wpt/mediarecorder/MediaRecorder-video-bitrate.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::createMediaRecorderPrivate): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorderProvider.cpp: (WebCore::MediaRecorderProvider::createMediaRecorderPrivate): * Modules/mediarecorder/MediaRecorderProvider.h: * WebCore.xcodeproj/project.pbxproj: * loader/EmptyClients.cpp: * platform/mediarecorder/MediaRecorderPrivate.h: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: (WebCore::AudioSampleBufferCompressor::setBitsPerSecond): (WebCore::AudioSampleBufferCompressor::outputBitRate const): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): Do not exit when not able to set bitrate as we still want to set m_maxOutputPacketSize. In case of error in setting up the converter, clean it up so that we do not use a partially set up converter. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::create): (WebCore::MediaRecorderPrivateWriter::setOptions): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: (WebCore::VideoSampleBufferCompressor::setBitsPerSecond): (WebCore::setCompressionSessionProperty): (WebCore::VideoSampleBufferCompressor::initCompressionSession): * testing/Internals.cpp: (WebCore::createRecorderMockSource): 2020-08-25 Rob Buis <rbuis@igalia.com> Use more enum classes in DateComponents https://bugs.webkit.org/show_bug.cgi?id=215544 Reviewed by Sam Weinig. Make Type and SecondFormat enum classes since this is more readable and allows us to have less includes in header files. * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::serializeWithComponents const): * html/DateInputType.cpp: (WebCore::DateInputType::dateType const): * html/DateInputType.h: * html/DateTimeLocalInputType.cpp: (WebCore::DateTimeLocalInputType::dateType const): * html/DateTimeLocalInputType.h: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::dateType const): * html/HTMLInputElement.h: * html/InputType.cpp: (WebCore::InputType::dateType const): * html/InputType.h: * html/MonthInputType.cpp: (WebCore::MonthInputType::dateType const): * html/MonthInputType.h: * html/TimeInputType.cpp: (WebCore::TimeInputType::dateType const): * html/TimeInputType.h: * html/WeekInputType.cpp: (WebCore::WeekInputType::dateType const): * html/WeekInputType.h: * platform/DateComponents.cpp: (WebCore::DateComponents::parseMonth): (WebCore::DateComponents::parseDate): (WebCore::DateComponents::parseWeek): (WebCore::DateComponents::parseTime): (WebCore::DateComponents::parseDateTimeLocal): (WebCore::DateComponents::setMillisecondsSinceEpochForDate): (WebCore::DateComponents::setMillisecondsSinceEpochForDateTimeLocal): (WebCore::DateComponents::setMillisecondsSinceEpochForMonth): (WebCore::DateComponents::setMillisecondsSinceMidnight): (WebCore::DateComponents::setMonthsSinceEpoch): (WebCore::DateComponents::setMillisecondsSinceEpochForWeek): (WebCore::DateComponents::millisecondsSinceEpochForTime const): (WebCore::DateComponents::millisecondsSinceEpoch const): (WebCore::DateComponents::monthsSinceEpoch const): (WebCore::DateComponents::toStringForTime const): (WebCore::DateComponents::toString const): * platform/DateComponents.h: (WebCore::DateComponents::DateComponents): (WebCore::DateComponents::type const): * platform/text/PlatformLocale.cpp: (WebCore::Locale::formatDateTime): * platform/text/PlatformLocale.h: * platform/text/cocoa/LocaleCocoa.mm: (WebCore::LocaleCocoa::formatDateTime): * platform/text/ios/LocalizedDateCache.h: * platform/text/ios/LocalizedDateCache.mm: (WebCore::LocalizedDateCache::formatterForDateType): (WebCore::LocalizedDateCache::maximumWidthForDateType): (WebCore::LocalizedDateCache::createFormatterForType): (WebCore::LocalizedDateCache::calculateMaximumWidth): 2020-08-25 Carlos Garcia Campos <cgarcia@igalia.com> [SOUP] Initialize HSTS storage directory from network session initialization https://bugs.webkit.org/show_bug.cgi?id=215802 Reviewed by Alex Christensen. Stop handling HSTS persistent storage as a global setting. SoupNetworkSession::setHSTSPersistentStorage() is no longer static and it does what setupHSTSEnforcer() did but simplified. The session is now always created with a memory enforcer that is only replaced by a persistent one when setHSTSPersistentStorage() is called on non-ephemeral sessions. * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::SoupNetworkSession): (WebCore::SoupNetworkSession::setHSTSPersistentStorage): (WebCore::SoupNetworkSession::getHostNamesWithHSTSCache): (WebCore::SoupNetworkSession::deleteHSTSCacheForHostNames): (WebCore::SoupNetworkSession::clearHSTSCache): (WebCore::hstsStorageDirectory): Deleted. (WebCore::SoupNetworkSession::setupHSTSEnforcer): Deleted. * platform/network/soup/SoupNetworkSession.h: 2020-08-25 Philippe Normand <pnormand@igalia.com> Unreviewed, follow-up to r266109 * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webKitWebAudioSrcAllocateBuffersAndRenderAudio): The element clock can be null so we need to check it before attempting to use it. 2020-08-25 Philippe Normand <pnormand@igalia.com> [GStreamer][WebAudio] Fill in output timestamps https://bugs.webkit.org/show_bug.cgi?id=215703 Reviewed by Xabier Rodriguez-Calvar. Set the output timestamp as the buffer PTS. The monotonic timestamp is retrieved using the corresponding GLib API, offset'ed by the pipeline clock time (which always starts at 0). * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webKitWebAudioSrcAllocateBuffersAndRenderAudio): * platform/graphics/gstreamer/GRefPtrGStreamer.cpp: (WTF::adoptGRef): (WTF::refGPtr<GstClock>): (WTF::derefGPtr<GstClock>): * platform/graphics/gstreamer/GRefPtrGStreamer.h: 2020-08-25 Carlos Garcia Campos <cgarcia@igalia.com> Unreviewed. Fix GTK/WPE build after r266103 * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::internalStart): 2020-08-24 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Implement rendering frames timeline panel for GTK+ port https://bugs.webkit.org/show_bug.cgi?id=150392 <rdar://problem/23200510> Reviewed by Brian Burg. Use new RunLoop API to observe the run loop events when the GLib event loop is used. * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::internalStart): (WebCore::InspectorTimelineAgent::internalStop): * inspector/agents/InspectorTimelineAgent.h: 2020-08-24 Alex Christensen <achristensen@webkit.org> Implement Request/Response consuming as FormData https://bugs.webkit.org/show_bug.cgi?id=215671 Reviewed by Darin Adler. Covered by many newly passing WPT tests, for most of which Safari was the only failing browser. * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::formData): (WebCore::FetchBody::consume): (WebCore::FetchBody::consumeFormData): * Modules/fetch/FetchBody.h: * Modules/fetch/FetchBodyConsumer.cpp: (WebCore::formDataFromData): (WebCore::resolveWithTypeAndData): (WebCore::FetchBodyConsumer::resolve): * Modules/fetch/FetchBodyConsumer.h: 2020-08-24 Emilio Cobos Álvarez <emilio@crisal.io> Support quotes:auto and fix quotes serialization. https://bugs.webkit.org/show_bug.cgi?id=215646 Reviewed by Darin Adler. Tests: imported/w3c/web-platform-tests/css/css-content/inheritance.html imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::Ref<CSSValue>valueForQuotes): (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeQuotes): * rendering/style/QuotesData.h: (WebCore::QuotesData::size const): * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertQuotes): 2020-08-24 Devin Rousso <drousso@apple.com> Web Inspector: rename `ScriptDebugServer` subclasses/methods https://bugs.webkit.org/show_bug.cgi?id=215363 <rdar://problem/67310441> Reviewed by Brian Burg. r266074 merged `Inspector::ScriptDebugServer` into `JSC::Debugger`. All subclasses and functions should be renamed to match this change. * Headers.cmake: * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * inspector/InspectorController.h: * inspector/InspectorController.cpp: * inspector/PageDebugger.h: Renamed from Source/WebCore/inspector/PageScriptDebugServer.h. * inspector/PageDebugger.cpp: Renamed from Source/WebCore/inspector/PageScriptDebugServer.cpp. * inspector/mac/PageDebuggerMac.mm: Renamed from Source/WebCore/inspector/mac/PageScriptDebugServerMac.mm. * inspector/WorkerDebugger.h: Renamed from Source/WebCore/inspector/WorkerScriptDebugServer.h. * inspector/WorkerDebugger.cpp: Renamed from Source/WebCore/inspector/WorkerScriptDebugServer.cpp. * inspector/WorkerInspectorController.h: * inspector/WorkerInspectorController.cpp: * inspector/agents/InspectorTimelineAgent.cpp: * inspector/agents/page/PageDebuggerAgent.cpp: 2020-08-24 Sihui Liu <sihui_liu@apple.com> Text manipulation should not manipulate nodes out of paragraph range https://bugs.webkit.org/show_bug.cgi?id=215406 Reviewed by Wenson Hsieh. TextManipulationController currently does not set correct start path for insertion. Therefore, it does not mark the nodes on the start path but out of range correctly, and may change position of those nodes by mistake. For example, in the newly added test, text node "zero" can be moved around even though it is not in range. API test: TextManipulation.CompleteTextManipulationShouldOnlyChangeNodesInParagraphRange * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::replace): 2020-08-24 Devin Rousso <drousso@apple.com> Web Inspector: allow event breakpoints to be configured https://bugs.webkit.org/show_bug.cgi?id=215362 <rdar://problem/66932921> Reviewed by Brian Burg. This allows developers to do things like: - only pause when `window.event.type` is a certain value - ignore the first N pauses - evaluate JavaScript whenever an event listener is invoked without pausing Tests: inspector/dom/breakpoint-for-event-listener.html inspector/dom-debugger/event-animation-frame-breakpoints.html inspector/dom-debugger/event-interval-breakpoints.html inspector/dom-debugger/event-listener-breakpoints.html inspector/dom-debugger/event-timeout-breakpoints.html * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::getEventListenersForNode): (WebCore::InspectorDOMAgent::setBreakpointForEventListener): (WebCore::InspectorDOMAgent::removeBreakpointForEventListener): (WebCore::InspectorDOMAgent::buildObjectForEventListener): (WebCore::InspectorDOMAgent::breakpointForEventListener): (WebCore::InspectorDOMAgent::hasBreakpointForEventListener): Deleted. * inspector/agents/InspectorDOMDebuggerAgent.h: * inspector/agents/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::disable): (WebCore::InspectorDOMDebuggerAgent::mainFrameNavigated): (WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint): (WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint): (WebCore::InspectorDOMDebuggerAgent::willHandleEvent): (WebCore::InspectorDOMDebuggerAgent::didHandleEvent): (WebCore::InspectorDOMDebuggerAgent::willFireTimer): (WebCore::InspectorDOMDebuggerAgent::didFireTimer): * inspector/agents/page/PageDOMDebuggerAgent.h: * inspector/agents/page/PageDOMDebuggerAgent.cpp: (WebCore::PageDOMDebuggerAgent::disable): (WebCore::PageDOMDebuggerAgent::mainFrameNavigated): (WebCore::PageDOMDebuggerAgent::willFireAnimationFrame): (WebCore::PageDOMDebuggerAgent::didFireAnimationFrame): (WebCore::PageDOMDebuggerAgent::setAnimationFrameBreakpoint): * inspector/agents/worker/WorkerDOMDebuggerAgent.h: * inspector/agents/worker/WorkerDOMDebuggerAgent.cpp: (WebCore::WorkerDOMDebuggerAgent::setAnimationFrameBreakpoint): Keep a `JSC::Breakpoint` for each event breakpoint instead of a simple `bool`, allowing for configuration when the breakpoint is first set. When any of these breakpoints are hit, pass it to the `JSC::Debugger` as a "special breakpoint", which behaves the same as "pause ASAP" but also supports a condition, an ignore count, actions, and auto-continue. Reset the hit count for any of these "special breakpoints" that persist across Web Inspector sessions when the main frame navigates. * inspector/PageScriptDebugServer.h: * inspector/PageScriptDebugServer.cpp: (WebCore::PageScriptDebugServer::PageScriptDebugServer): (WebCore::PageScriptDebugServer::attachDebugger): (WebCore::PageScriptDebugServer::detachDebugger): (WebCore::PageScriptDebugServer::didPause): (WebCore::PageScriptDebugServer::didContinue): (WebCore::PageScriptDebugServer::runEventLoopWhilePaused): (WebCore::PageScriptDebugServer::runEventLoopWhilePausedInternal): (WebCore::PageScriptDebugServer::isContentScript const): (WebCore::PageScriptDebugServer::reportException const): * inspector/WorkerScriptDebugServer.h: * inspector/WorkerScriptDebugServer.cpp: (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer): (WebCore::WorkerScriptDebugServer::attachDebugger): (WebCore::WorkerScriptDebugServer::detachDebugger): (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused): (WebCore::WorkerScriptDebugServer::reportException const): * inspector/agents/page/PageDebuggerAgent.h: * inspector/agents/page/PageDebuggerAgent.cpp: (WebCore::PageDebuggerAgent::sourceMapURLForScript): Replace `Inspector::ScriptDebugServer` with `JSC::Debugger`. * inspector/TimelineRecordFactory.h: * inspector/TimelineRecordFactory.cpp: (WebCore::TimelineRecordFactory::createProbeSampleData): * inspector/agents/InspectorTimelineAgent.h: * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::internalStart): (WebCore::InspectorTimelineAgent::internalStop): (WebCore::InspectorTimelineAgent::breakpointActionProbe): Replace `Inspector::ScriptBreakpoint` with `JSC::Breakpoint`. * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::didHandleEvent): (WebCore::InspectorInstrumentation::didFireTimer): * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didHandleEventImpl): (WebCore::InspectorInstrumentation::didFireTimerImpl): (WebCore::InspectorInstrumentation::didCommitLoadImpl): (WebCore::InspectorInstrumentation::didFireAnimationFrameImpl): * dom/EventTarget.cpp: (WebCore::EventTarget::innerInvokeEventListeners): * page/DOMTimer.cpp: (WebCore::DOMTimer::fired): When notifying Web Inspector that activity did occur, include all information previously included when notifying Web Inspector that that activity was about to occur so that Web Inspector can know whether a pause for the "special breakpoint" for that activity is still scheduled and if so cancel it. 2020-08-24 Aditya Keerthi <akeerthi@apple.com> [macOS] Show picker for date and datetime-local input types https://bugs.webkit.org/show_bug.cgi?id=214946 Reviewed by Darin Adler and Wenson Hsieh. Date and datetime-local input types require a calendar picker to be presented when activated. Consequently, BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent was modified to create a DateTimeChooser and display a calendar upon activation. This object is destroyed when the element is blurred, hiding the calendar. There is currently no picker UI for month, week, and time input types. As a result, handleDOMActivateEvent is a no-op on those input types. Wrote an encoder and decoder for DateTimeChooserParameters, so that the picker can be created with the correct values. Tests: fast/forms/date/date-show-hide-picker.html fast/forms/datetimelocal/datetimelocal-show-hide-picker.html * WebCore.xcodeproj/project.pbxproj: * html/BaseChooserOnlyDateAndTimeInputType.cpp: (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent): (WebCore::BaseChooserOnlyDateAndTimeInputType::elementDidBlur): (WebCore::BaseChooserOnlyDateAndTimeInputType::isPresentingAttachedView const): (WebCore::BaseChooserOnlyDateAndTimeInputType::didChooseValue): * html/BaseChooserOnlyDateAndTimeInputType.h: * html/HTMLInputElement.cpp: * html/MonthInputType.cpp: (WebCore::MonthInputType::handleDOMActivateEvent): * html/MonthInputType.h: * html/TimeInputType.cpp: (WebCore::TimeInputType::handleDOMActivateEvent): * html/TimeInputType.h: * html/WeekInputType.cpp: (WebCore::WeekInputType::handleDOMActivateEvent): * html/WeekInputType.h: * loader/EmptyClients.cpp: (WebCore::EmptyChromeClient::createDateTimeChooser): * loader/EmptyClients.h: * page/Chrome.cpp: (WebCore::Chrome::createDateTimeChooser): * page/Chrome.h: * page/ChromeClient.h: * platform/DateTimeChooser.h: * platform/DateTimeChooserClient.h: * platform/DateTimeChooserParameters.h: Added. (WebCore::DateTimeChooserParameters::encode const): (WebCore::DateTimeChooserParameters::decode): 2020-08-24 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Rename LineBox::baseline to alignment baseline https://bugs.webkit.org/show_bug.cgi?id=214784 Reviewed by Antti Koivisto. See https://www.w3.org/TR/css-inline-3/#alignment-baseline Use the spec term. This helps to tell the dominant and the alignment baselines apart during line building. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::LineBox): (WebCore::Layout::LineBox::setAlignmentBaselineIfGreater): (WebCore::Layout::LineBox::setAscentIfGreater): (WebCore::Layout::LineBox::alignmentBaseline const): (WebCore::Layout::LineBox::resetAlignmentBaseline): (WebCore::Layout::LineBox::setBaselineIfGreater): Deleted. (WebCore::Layout::LineBox::baseline const): Deleted. (WebCore::Layout::LineBox::resetBaseline): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight): * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::baseline const): 2020-08-24 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes, late August 2020 edition https://bugs.webkit.org/show_bug.cgi?id=215768 Unreviewed build fix. No new tests needed. * Modules/webaudio/StereoPannerNode.cpp: Add missing headers AudioNodeInput.h, AudioNodeOutput.h, and wtf/IsoMallocInlines.h. * bindings/js/JSHTMLCanvasElementCustom.cpp: (WebCore::JSHTMLCanvasElement::visitAdditionalChildren): Add JSC:: namespace to SlotVisitor parameter type. * dom/SimpleRange.cpp: Add missing ShadowRoot.h header. * history/CachedPage.cpp: Add missing FrameLoaderClient.h header. 2020-08-24 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Use the term 'baseline' to indicate alignment baseline https://bugs.webkit.org/show_bug.cgi?id=214779 Reviewed by Antti Koivisto. This patch is in preparation for decoupling the line box and the root inline box geometry. Inline boxes have ascent/descent pairs, while line boxes have inline boxes and a baseline. * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintInlineContent): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const): * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::AscentAndDescent::height const): (WebCore::Layout::LineBox::ascentAndDescent const): (WebCore::Layout::LineBox::LineBox): (WebCore::Layout::LineBox::InlineBox::InlineBox): (WebCore::Layout::LineBox::setBaselineIfGreater): (WebCore::Layout::LineBox::setAscentIfGreater): (WebCore::Layout::LineBox::setDescentIfGreater): (WebCore::Layout::LineBox::baseline const): (WebCore::Layout::LineBox::resetBaseline): (WebCore::Layout::LineBox::InlineBox::Baseline::height const): Deleted. (WebCore::Layout::LineBox::setBaselineOffsetIfGreater): Deleted. (WebCore::Layout::LineBox::baselineOffset const): Deleted. (WebCore::Layout::LineBox::InlineBox::Baseline::Baseline): Deleted. (WebCore::Layout::LineBox::InlineBox::Baseline::setAscent): Deleted. (WebCore::Layout::LineBox::InlineBox::Baseline::setDescent): Deleted. (WebCore::Layout::LineBox::InlineBox::Baseline::reset): Deleted. (WebCore::Layout::LineBox::InlineBox::Baseline::ascent const): Deleted. (WebCore::Layout::LineBox::InlineBox::Baseline::descent const): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::initialize): (WebCore::Layout::LineBuilder::alignContentVertically): (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight): (WebCore::Layout::LineBuilder::halfLeadingMetrics): * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::baseline const): (WebCore::Layout::LineBuilder::baselineOffset const): Deleted. * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::paint): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraSpace): * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell): * layout/tableformatting/TableGrid.h: (WebCore::Layout::TableGrid::Row::setBaseline): (WebCore::Layout::TableGrid::Row::baseline const): (WebCore::Layout::TableGrid::Cell::setBaseline): (WebCore::Layout::TableGrid::Cell::baseline const): (WebCore::Layout::TableGrid::Row::setBaselineOffset): Deleted. (WebCore::Layout::TableGrid::Row::baselineOffset const): Deleted. (WebCore::Layout::TableGrid::Cell::setBaselineOffset): Deleted. (WebCore::Layout::TableGrid::Cell::baselineOffset const): Deleted. * layout/tableformatting/TableLayout.cpp: (WebCore::Layout::TableFormattingContext::TableLayout::distributedVerticalSpace): 2020-08-24 Carlos Garcia Campos <cgarcia@igalia.com> Unreviewed. Fix GTK4 build * SourcesGTK.txt: * platform/gtk/GtkUtilities.cpp: (WebCore::monitorWorkArea): * platform/gtk/GtkUtilities.h: * platform/gtk/PlatformScreenGtk.cpp: (WebCore::screenAvailableRect): 2020-08-24 Rob Buis <rbuis@igalia.com> Make window.find not default the search string to undefined https://bugs.webkit.org/show_bug.cgi?id=215757 Reviewed by Darin Adler. Make window.find not default the search string to undefined, instead use the null string. Before this change window.find() would find a hit in a page containing the text string "undefined". Test: fast/text/window-find.html * page/DOMWindow.idl: 2020-08-24 Justin Uberti <justin@uberti.name> RTCRtpSynchronizationSource.rtpTimestamp is not present https://bugs.webkit.org/show_bug.cgi?id=215722 Reviewed by Youenn Fablet. Updated expected results in LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https-expected.txt. * Modules/mediastream/RTCRtpContributingSource.idl: * Modules/mediastream/RTCRtpContributingSource.idl: * Modules/mediastream/RTCRtpSynchronizationSource.idl: Minor modification to ensure JSRTCRtpSynchronizationSource.cpp gets regenerated. * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp: (WebCore::fillRTCRtpContributingSource): 2020-08-23 Wenson Hsieh <wenson_hsieh@apple.com> Programmatic selection of text in a text field causes the highlight overlay to spill out https://bugs.webkit.org/show_bug.cgi?id=215647 <rdar://problem/67404979> Reviewed by Darin Adler. See WebKit ChangeLog for more detail. * html/HTMLTextFormControlElement.h: Export a helper function. 2020-08-23 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Introduce the root inline box https://bugs.webkit.org/show_bug.cgi?id=214733 Reviewed by Antti Koivisto. This is in preparation for having a dedicated line box for each line with inline boxes inside. At this point we only use the root inline box to proxy the baseline handling. See https://www.w3.org/TR/css-inline-3/#model * layout/inlineformatting/InlineLineBox.h: (WebCore::Layout::LineBox::InlineBox::Baseline::height const): (WebCore::Layout::LineBox::LineBox): (WebCore::Layout::LineBox::InlineBox::InlineBox): (WebCore::Layout::LineBox::setLogicalHeightIfGreater): (WebCore::Layout::LineBox::baseline const): (WebCore::Layout::LineBox::setBaselineOffsetIfGreater): (WebCore::Layout::LineBox::setAscentIfGreater): (WebCore::Layout::LineBox::setDescentIfGreater): (WebCore::Layout::LineBox::baselineOffset const): (WebCore::Layout::LineBox::resetBaseline): (WebCore::Layout::LineBox::InlineBox::Baseline::Baseline): (WebCore::Layout::LineBox::InlineBox::Baseline::setAscent): (WebCore::Layout::LineBox::InlineBox::Baseline::setDescent): (WebCore::Layout::LineBox::InlineBox::Baseline::reset): (WebCore::Layout::LineBox::InlineBox::Baseline::ascent const): (WebCore::Layout::LineBox::InlineBox::Baseline::descent const): (WebCore::Layout::InlineBox::Baseline::height const): Deleted. (WebCore::Layout::InlineBox::logicalRect const): Deleted. (WebCore::Layout::InlineBox::scrollableOverflow const): Deleted. (WebCore::Layout::InlineBox::logicalLeft const): Deleted. (WebCore::Layout::InlineBox::logicalRight const): Deleted. (WebCore::Layout::InlineBox::logicalTop const): Deleted. (WebCore::Layout::InlineBox::logicalBottom const): Deleted. (WebCore::Layout::InlineBox::logicalWidth const): Deleted. (WebCore::Layout::InlineBox::logicalHeight const): Deleted. (WebCore::Layout::InlineBox::resetDescent): Deleted. (WebCore::Layout::InlineBox::setLogicalHeight): Deleted. (WebCore::Layout::InlineBox::setLogicalWidth): Deleted. (WebCore::Layout::InlineBox::setScrollableOverflow): Deleted. (WebCore::Layout::InlineBox::moveHorizontally): Deleted. (WebCore::Layout::InlineBox::expandHorizontally): Deleted. (WebCore::Layout::InlineBox::shrinkHorizontally): Deleted. (WebCore::Layout::InlineBox::expandVertically): Deleted. (WebCore::Layout::InlineBox::shrinkVertically): Deleted. (WebCore::Layout::InlineBox::isConsideredEmpty const): Deleted. (WebCore::Layout::InlineBox::setIsConsideredEmpty): Deleted. (WebCore::Layout::InlineBox::setIsConsideredNonEmpty): Deleted. (WebCore::Layout::InlineBox::InlineBox): Deleted. (WebCore::Layout::InlineBox::setLogicalHeightIfGreater): Deleted. (WebCore::Layout::InlineBox::baseline const): Deleted. (WebCore::Layout::InlineBox::setBaselineOffsetIfGreater): Deleted. (WebCore::Layout::InlineBox::setAscentIfGreater): Deleted. (WebCore::Layout::InlineBox::setDescentIfGreater): Deleted. (WebCore::Layout::InlineBox::baselineOffset const): Deleted. (WebCore::Layout::InlineBox::resetBaseline): Deleted. (WebCore::Layout::InlineBox::Baseline::Baseline): Deleted. (WebCore::Layout::InlineBox::Baseline::setAscent): Deleted. (WebCore::Layout::InlineBox::Baseline::setDescent): Deleted. (WebCore::Layout::InlineBox::Baseline::reset): Deleted. (WebCore::Layout::InlineBox::Baseline::ascent const): Deleted. (WebCore::Layout::InlineBox::Baseline::descent const): Deleted. * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::initialize): (WebCore::Layout::LineBuilder::halfLeadingMetrics): * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::lineBox const): * layout/inlineformatting/LineLayoutContext.h: 2020-08-23 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Display::LineBox does not need ascent/descent geometry https://bugs.webkit.org/show_bug.cgi?id=214720 Reviewed by Antti Koivisto. Line box is just a rectangular area that contains all the inline boxes that form a single line. It generally has a non-zero baseline (the root inline box's baseline), but it does not have ascent/descent geometry. * layout/displaytree/DisplayLineBox.h: (WebCore::Display::LineBox::baseline const): (WebCore::Display::LineBox::LineBox): (WebCore::Display::LineBox::Baseline::height const): Deleted. (WebCore::Display::LineBox::Baseline::ascent const): Deleted. (WebCore::Display::LineBox::Baseline::descent const): Deleted. (WebCore::Display::LineBox::baselineOffset const): Deleted. (WebCore::Display::LineBox::Baseline::Baseline): Deleted. * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintInlineContent): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::alignContentVertically): (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::firstLineBaseline const): (WebCore::LayoutIntegration::LineLayout::lastLineBaseline const): (WebCore::LayoutIntegration::LineLayout::paint): * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::layoutFormattingContextEnabled const): (WebCore::RuntimeEnabledFeatures::layoutFormattingContextIntegrationEnabled const): * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::boundingBoxForRenderTreeDump const): * rendering/SimpleLineLayoutResolver.h: (WebCore::SimpleLineLayout::RunResolver::Run::baseline const): (WebCore::SimpleLineLayout::RunResolver::Run::baselineOffset const): Deleted. * rendering/line/LineLayoutTraversal.h: (WebCore::LineLayoutTraversal::Box::baseline const): (WebCore::LineLayoutTraversal::Box::baselineOffset const): Deleted. * rendering/line/LineLayoutTraversalComplexPath.h: (WebCore::LineLayoutTraversal::ComplexPath::baseline const): (WebCore::LineLayoutTraversal::ComplexPath::baselineOffset const): Deleted. * rendering/line/LineLayoutTraversalDisplayRunPath.h: (WebCore::LineLayoutTraversal::DisplayRunPath::baseline const): (WebCore::LineLayoutTraversal::DisplayRunPath::baselineOffset const): Deleted. * rendering/line/LineLayoutTraversalSimplePath.h: (WebCore::LineLayoutTraversal::SimplePath::baseline const): (WebCore::LineLayoutTraversal::SimplePath::baselineOffset const): Deleted. 2020-08-23 Rob Buis <rbuis@igalia.com> Do not use undefined default param in CSSStyleDeclaration.idl https://bugs.webkit.org/show_bug.cgi?id=215753 Reviewed by Darin Adler. Do not use undefined default parameter value in CSSStyleDeclaration.idl, instead use no explicit default parameter at all. This means a zero length String will be used, which will be more efficient when using the cssPropertyID helper method, as well as less error-prone. * css/CSSStyleDeclaration.idl: 2020-08-23 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Move all line height and baseline adjustment logic to LineBuilder::adjustBaselineAndLineHeight https://bugs.webkit.org/show_bug.cgi?id=214474 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/inline-text-outside-of-inline-container-simple.html * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight): * layout/inlineformatting/InlineLineBuilder.h: 2020-08-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] adjustBaselineAndLineHeight should take the parent inline box. https://bugs.webkit.org/show_bug.cgi?id=214406 Reviewed by Antti Koivisto. This is in prepartion for supporting nested lineboxes required by certain vertical alignment values. <div>text content</div> <- This content requires only one inline box, the root linebox. <div>nested <span><span style="vertical-align: text-top">text</span> </span>content</div> <- the content [text] is vertically aligned with the top of the _parent element_'s font and not the root inline box. 1. Let's rename the LineBoxBuilder to InlineBox. We'll have a bunch of these. 2. Pass in the parent inline to adjustBaselineAndLineHeight (currently there's only one inline box per line, the root inline box). * WebCore.xcodeproj/project.pbxproj: * layout/inlineformatting/InlineFormattingContextQuirks.cpp: (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const): * layout/inlineformatting/InlineLineBox.h: Renamed from Source/WebCore/layout/inlineformatting/InlineLineBoxBuilder.h. (WebCore::Layout::LineBox::Baseline::height const): (WebCore::Layout::LineBox::logicalRect const): (WebCore::Layout::LineBox::scrollableOverflow const): (WebCore::Layout::LineBox::logicalLeft const): (WebCore::Layout::LineBox::logicalRight const): (WebCore::Layout::LineBox::logicalTop const): (WebCore::Layout::LineBox::logicalBottom const): (WebCore::Layout::LineBox::logicalWidth const): (WebCore::Layout::LineBox::logicalHeight const): (WebCore::Layout::LineBox::resetDescent): (WebCore::Layout::LineBox::setLogicalHeight): (WebCore::Layout::LineBox::setLogicalWidth): (WebCore::Layout::LineBox::setScrollableOverflow): (WebCore::Layout::LineBox::moveHorizontally): (WebCore::Layout::LineBox::expandHorizontally): (WebCore::Layout::LineBox::shrinkHorizontally): (WebCore::Layout::LineBox::expandVertically): (WebCore::Layout::LineBox::shrinkVertically): (WebCore::Layout::LineBox::isConsideredEmpty const): (WebCore::Layout::LineBox::setIsConsideredEmpty): (WebCore::Layout::LineBox::setIsConsideredNonEmpty): (WebCore::Layout::LineBox::LineBox): (WebCore::Layout::LineBox::setLogicalHeightIfGreater): (WebCore::Layout::LineBox::baseline const): (WebCore::Layout::LineBox::setBaselineOffsetIfGreater): (WebCore::Layout::LineBox::setAscentIfGreater): (WebCore::Layout::LineBox::setDescentIfGreater): (WebCore::Layout::LineBox::baselineOffset const): (WebCore::Layout::LineBox::resetBaseline): (WebCore::Layout::LineBox::Baseline::Baseline): (WebCore::Layout::LineBox::Baseline::setAscent): (WebCore::Layout::LineBox::Baseline::setDescent): (WebCore::Layout::LineBox::Baseline::reset): (WebCore::Layout::LineBox::Baseline::ascent const): (WebCore::Layout::LineBox::Baseline::descent const): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::initialize): (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight): (WebCore::Layout::LineBuilder::halfLeadingMetrics): * layout/inlineformatting/InlineLineBuilder.h: (WebCore::Layout::LineBuilder::lineBox const): * layout/inlineformatting/LineLayoutContext.h: 2020-08-20 Darin Adler <darin@apple.com> Move node geometry functions from Range to RenderObject https://bugs.webkit.org/show_bug.cgi?id=215677 Reviewed by Zalan Bujtas. Moved functions that return quads and rectangles out of Range into RenderObject. We could find another home for them, but for now they make sense as static member functions there since RenderObject has the non-static member functions that they call on multiple nodes. Mostly did not change the design of these functions much, and was careful not to change behavior at all. But did change a few things: - Got rid of the functions that return a single unioned rectangle. Instead callers call unionRect at each call site. - Changed the "use selection height" boolean to a BoundingRectBehavior flag. * accessibility/AccessibilityRenderObject.cpp: (WebCore::boundsForRects): Call unionRect(RenderObject::absoluteTextRects) instead of Range::absoluteBoundingBox. * dom/DocumentMarkerController.cpp: (WebCore::updateRenderedRectsForMarker): Instead of passing "true", pass "RenderObject::BoundingRectBehavior::UseSelectionHeight". * dom/Range.cpp: (WebCore::Range::absoluteBoundingBox const): Deleted. (WebCore::Range::absoluteRectsForRangeInText const): Deleted. (WebCore::Range::absoluteTextRects const): Deleted. (WebCore::Range::getClientRects const): Call RenderObject::clientBorderAndTextRects. (WebCore::Range::getBoundingClientRect const): Call unionRect(RenderObject::clientBorderAndTextRects). (WebCore::Range::borderAndTextRects const): Deleted. (WebCore::Range::boundingRect const): Deleted. (WebCore::Range::absoluteBoundingRect const): Deleted. * dom/Range.h: Updated for above. * dom/SimpleRange.cpp: (WebCore::IntersectingNodeIterator::IntersectingNodeIterator): Fix bug affecting empty ranges by calling enforceEndInvariant. (WebCore::IntersectingNodeIterator::advance): Refactor to call enforceEndInvariant. (WebCore::IntersectingNodeIterator::advanceSkippingChildren): Ditto. (WebCore::IntersectingNodeIterator::enforceEndInvariant): Added. * dom/SimpleRange.h: Added enforceEndInvariant. * editing/FrameSelection.cpp: (WebCore::FrameSelection::getClippedVisibleTextRectangles const): Instead of passing a useSelectionHeight boolean, pass BoundingRectBehavior. * page/TextIndicator.cpp: (WebCore::absoluteBoundingRectForRange): Call unionRectIgnoringZeroRects(RenderObject::absoluteBorderAndTextRects). (WebCore::initializeIndicator): Call RenderObject::absoluteTextRects. * platform/graphics/GeometryUtilities.cpp: (WebCore::unionRectIgnoringZeroRects): Added. * platform/graphics/GeometryUtilities.h: Updated for above. * rendering/RenderLineBreak.h: Marked a lot of functions final. Added a default value for the absoluteQuads out argument. * rendering/RenderObject.cpp: (WebCore::RenderObject::addPDFURLRect): Tweaked code style a bit. (WebCore::RenderObject::absoluteTextQuads): Replaced boolean useSelectionHeight argument with a BoundingRectBehavior argument. Also added a downcast so the call to RenderLineBreak::absoluteQuads is a non-virtual function call. (WebCore::absoluteRectsForRangeInText): Added. (WebCore::RenderObject::absoluteTextRects): Replaced boolean useSelectionHeight argument with a BoundingRectBehavior argument. (WebCore::nodeBefore): Added. (WebCore::borderAndTextRects): Added. (WebCore::RenderObject::absoluteBorderAndTextRects): Added. (WebCore::RenderObject::clientBorderAndTextRects): Added. * rendering/RenderObject.h: Updated for above. 2020-08-18 Darin Adler <darin@apple.com> Make some small improvements involving sorting https://bugs.webkit.org/show_bug.cgi?id=215617 Reviewed by Anders Carlsson. * contentextensions/DFA.cpp: (WebCore::ContentExtensions::printTransitions): Fixed "incomming" spelling error. * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::fillImageSet): Use std::stable_sort instead of std::sort because there is no guarantee that each image has different resolution and we want repeatable behavior when they are the same. * page/Performance.cpp: (WebCore::Performance::appendBufferedEntriesByType const): Removed the return value since we don't need it any more. * page/Performance.h: Updated for above. * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): Use std::stable_sort only on the new entries and then use std::inplace_merge. It's wasteful to re-sort the entire array when adding entries. A little less elegant, but more efficient. 2020-08-17 Darin Adler <darin@apple.com> Create documentOrder function, start refactoring to use it instead of Range::compare functions https://bugs.webkit.org/show_bug.cgi?id=215551 Reviewed by Chris Dumez. * WebCore.xcodeproj/project.pbxproj: Make TextControlInnerElements.h Private so we can use it from unit tests. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::text const): Tweak code slightly. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::selectedTextRange const): Always use the native text control's idea of the selected text range. There is no need to use the document-based range with any of these native text controls. The check before would almost always return true, except for unusual cases, particularly combo box, which returns false for isARIATextControl. We may want to change isARIATextControl to return true for combo box, but it's not necessary for this fix. Without this change, a test involving a combo box was failing because changes caused documentBasedSelectedTextRange to no longer accidentally do the right thing. * dom/BoundaryPoint.h: Added != and documentOrder. * dom/Document.h: Export allocation function and constructor so we can allocate in a unit test. * dom/Node.cpp: (WebCore::connectedInSameTreeScope): Renamed from areNodesConnectedInSameTreeScope. (WebCore::Node::compareDocumentPosition): Updated for name change above. (WebCore::depth): Changed to take a const& and to walk acrosss shadow host boundaries, so this can be used in algorithms that are intended to work on the combined tree. Has no effect when called on nodes that are not in a shadow tree. (WebCore::commonInclusiveAncestorAndChildren): Refactored so this can be used by callers that need to know the distinct ancestor children as well as the common ancestor. Also revised it to work across shadow tree boundaries. (WebCore::commonInclusiveAncestor): Updated to call commonInclusiveAncestorAndChildren. (WebCore::isSiblingSubsequent): Added. (WebCore::documentOrder): Added. Implemented using commonInclusiveAncestorAndChildren and isSiblingSubsequent. * dom/Node.h: Updated for above. Also added PartialOrdering class, a compatible subset of C++20's std::partial_ordering, for return value for documentOrder. * dom/Position.cpp: (WebCore::Position::computeOffsetInContainerNode const): Removed clamping the result to the length of the container node; not needed. (WebCore::Position::previous const): Updated for name change. (WebCore::Position::next const): Updated for name change. (WebCore::Position::upstream const): Updated for name change. (WebCore::Position::downstream const): Updated for name change. (WebCore::commonInclusiveAncestor): Renamed from commonShadowIncludingAncestor since this is now the same as the commonInclusiveAncestor that takes two nodes; they now both take shadow trees into account. (WebCore::makeContainerOffsetPosition): Added. Clearer way to construct positions from containers and offsets. An alternative to makeDeprecatedLegacyPosition for cases where we don't need the deprecated legacy behavior. (WebCore::makeDeprecatedLegacyPosition): Renamed from createLegacyEditingPosition. Adding the word "deprecated" to be clearer that this is not just "legacy" but also something we are trying to get rid of. Changing from "create" to "make" because this does not allocate memory on the heap. (WebCore::documentOrder): Added. Still to do: more optimized implementation when we can compare two positions without computing node offsets. * dom/Position.h: Updated for above. (WebCore::minOffsetForNode): Deleted. * dom/RadioButtonGroups.cpp: (WebCore::RadioButtonGroup::members const): Use documentOrder instead of documentOrderComparator. * dom/Range.cpp: (WebCore::areRangesEqual): Rewrote to not use Position. (WebCore::rangesOverlap): Updated for name change. (WebCore::Range::expand): Rewrote to not use Range::start/endPosition. (WebCore::operator<<): Deleted. * dom/Range.h: Removed now-unused Range::start/endPosition, documentOrderComparator, and TextStream operators. * dom/RangeBoundaryPoint.h: Removed now-unused RangeBoundaryPoint::toPosition. Added makeBoundaryPoint function to convert RangeBoundaryPoint into BoundaryPoint. * dom/SimpleRange.cpp: (WebCore::isOffsetBeforeChild): Added. For use by documentOrder. (WebCore::documentOrder): Added. * editing/TextIterator.cpp: (WebCore::characterCount): Use documentOrder instead of Range::compareBoundaryPoints. * editing/VisiblePosition.cpp: (WebCore::areVisiblePositionsInSameTreeScope): Updated for name change. * editing/VisiblePosition.h: Use assignment insteed of calling clear, to possibly prepare to get rid of Position::clear in the future. Added a documentORder function that takes two visible positions. * editing/cocoa/HTMLConverter.mm: (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted): Use commonInclusiveAncestor instead of commonShadowIncludingAncestor. * editing/markup.cpp: (WebCore::serializePreservingVisualAppearanceInternal): Ditto. * html/HTMLBodyElement.h: Export create function so it can used in unit tests. * html/HTMLDivElement.h: Ditto. * html/HTMLHtmlElement.h: Ditto. * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::create): Added so it can be used in unit tests. * html/HTMLTextAreaElement.h: Ditto. Also export the innerTextElement function so it can be used in unit tests. * page/DOMSelection.cpp: (WebCore::DOMSelection::addRange): Use makeDeprecatedLegacyPosition directly rather than using Range::start/endPosition. This was the only place in WebCore still using Range::start/endPosition and over time we would like to move from makeDeprecatedLegacyPosition to makeContainerOffsetPosition, so it's good to have it be explicit here rather than hidden inside the Range class. (WebCore::DOMSelection::containsNode const): Added a check of containingShadowRoot. This preserves the old behavior. Before, constructing the range resulted in a collapsed range when the shadow tree was involved. This is a more direct way to achieve the same result. * page/Page.cpp: (WebCore::replaceRanges): Use documentOrder instead of comparePositions. Eventually we will delete comparePositions. 2020-08-22 Philippe Normand <pnormand@igalia.com> [GTK][WPE] Compilation warnings with clang/gcc 10 https://bugs.webkit.org/show_bug.cgi?id=215699 Reviewed by Darin Adler. * Modules/indexeddb/server/SQLiteIDBBackingStore.h: Mark class as final because its destructor is marked as such. (WebCore::IDBServer::SQLiteIDBBackingStore::databaseDirectory const): Deleted. (WebCore::IDBServer::SQLiteIDBBackingStore::sessionID const): Deleted. (WebCore::IDBServer::SQLiteIDBBackingStore::databaseRootDirectoryIsolatedCopy const): Deleted. * dom/messageports/MessagePortChannelProviderImpl.h: Ditto. * layout/Verification.cpp: (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): Remove spurious matchingRuns assignment. I have no idea how this was supposed to work? * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: (WebCore::JPEGImageReader::decode): Use FALLTHROUGH macro. * platform/image-decoders/webp/WEBPImageDecoder.cpp: (WebCore::WEBPImageDecoder::decodeFrame): Ditto. 2020-08-21 Simon Fraser <simon.fraser@apple.com> Add some FIXMEs in the EventHandler wheel event handling code for all the things that are wrong https://bugs.webkit.org/show_bug.cgi?id=215741 Reviewed by Wenson Hsieh. There is much confusing code here. Trying to document the issues I've found. * page/EventHandler.cpp: (WebCore::EventHandler::handleWheelEvent): * page/mac/EventHandlerMac.mm: (WebCore::findEnclosingScrollableContainer): (WebCore::EventHandler::determineWheelEventTarget): (WebCore::EventHandler::processWheelEventForScrolling): * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::handleWheelEvent): 2020-08-21 Rob Buis <rbuis@igalia.com> Merge two DOMURL constructors https://bugs.webkit.org/show_bug.cgi?id=215734 Reviewed by Darin Adler. Merge two DOMURL constructors to make it match the relevant WebIDL: https://url.spec.whatwg.org/#dom-url-url-url-base-base * html/DOMURL.cpp: (WebCore::DOMURL::create): * html/DOMURL.h: * html/DOMURL.idl: 2020-08-21 Kimmo Kinnunen <kkinnunen@apple.com> Fix USE_ANGLE=0 build after "WebGLLayer clobbers TEXTURE_2D binding on iOS" https://bugs.webkit.org/show_bug.cgi?id=211758 Reviewed by Kenneth Russell. No new tests, build fix. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getUniformIndices): Mark parameters unused when USE_ANGLE=0 * platform/graphics/cocoa/WebGLLayer.mm: Define scoped binding restorer only for USE_ANGLE=1, since it's not used otherwise and it is implemented in terms of ANGLE gl::... API. * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp: Include Logging.h to make RELEASE_LOG(WebGL, ...) work. Presumably this file is not compiled with USE_ANGLE=1 or the unified build mechanism hides the error. 2020-08-21 Andres Gonzalez <andresg_22@apple.com> Range::contains does not work correctly when the common ancestor node is a Document. https://bugs.webkit.org/show_bug.cgi?id=215714 Reviewed by Darin Adler. Test: accessibility/mac/selected-visible-position-range.html. For a Range with a Document object as common ancestor, Range::contains(otherRange) would return false for any given other range in the same document. This causes problems in VoiceOver navigation and Braille functionality in the MacOS Mail.app. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange const): Use SimpleRange::isNull instead of repeating its implementation. * dom/Range.cpp: (WebCore::Range::contains const): Compare the Documents of the ranges' common ancesstor nodes instead of their ownerDocuments. 2020-08-20 Carlos Garcia Campos <cgarcia@igalia.com> [GTK][WPE] Debug crashes in backdrop filter tests https://bugs.webkit.org/show_bug.cgi?id=215209 Reviewed by Adrian Perez de Castro. This only happens in WKTR because RenderLayerCompositor::flushPendingLayerChanges() is called from RenderLayerCompositor::layerTreeAsText(), so the coordinator doesn't know layers are being flushed and we don't return early from notifyFlushRequired(). We don't really need to have a coordinator associated to the backdrop layer, we just need to attach the layer to the coordinator to ensure it's updated. * platform/graphics/nicosia/NicosiaAnimation.cpp: (Nicosia::Animation::applyInternal): Handle AnimatedPropertyWebkitBackdropFilter. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer): Detach also the backdrop layer. (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): Attach the backdrop layer to the coordinator if there's one. (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers): Do not call this for the backdrop layer. (WebCore::CoordinatedGraphicsLayer::invalidateCoordinator): Set coordinator to nullptr. (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded): Set the coordinator and attach the layer. Also attach the backdrop layer. (WebCore::CoordinatedGraphicsLayer::setCoordinator): Deleted. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: 2020-08-20 Wenson Hsieh <wenson_hsieh@apple.com> REGRESSION (r263729): Carousel freezes on "fourth page"/fourth click on right arrow on netflix.com https://bugs.webkit.org/show_bug.cgi?id=215655 <rdar://problem/65845979> Reviewed by Dean Jackson. On netflix.com, when clicking on the left and right arrows in each movie or TV show carousel, the page attempts to animate to the next page of the carousel using a CSS transform transition. The logic applies `transform` and `transition` CSS properties to a container `div`, and adds a `transitionend` event listener which the page expects to be invoked when the animation is complete. While waiting for this `transitionend` event, the script also sets a boolean flag that prevents the carousel from being advanced to any other page. However, after the changes in r263729, the carousel gets into a state where `transition` and `transform` styles are set, but the animation never begins, and thus, no subsequent `transitionend` event is observed. This causes the page to believe that the carousel is indefinitely animating, so it never unsets the boolean flag, which results in the carousel being permanently stuck. This occurs because we now have logic in `AnimationTimeline::updateCSSTransitionsForElementAndProperty` that moves the `CSSTransition` from the element's map of running transitions to the map of completed transitions in the case where the corresponding `WebAnimation` is already in `Finished` state. However, consider the case where there is no matching backing animation (i.e. `matchingBackingAnimation` is `nullptr`); for instance, this can happen if the transition CSS property is set to none in the middle of the `transitionend` event, as demonstrated in the new layout test. Before the change, we would've removed the `CSSTransition` from the map of running transitions and canceled it, but now, we instead move it to the map of completed transitions, where it remains until the next CSS transition update is triggered (which would potentially be indefinitely long!). On netflix.com, this next CSS transition update happens the page attempts to advance the carousel. Since the old `CSSTransition` is still in the "completed" transitions map, we end up returning `true` when checking `propertyInStyleMatchesValueForTransitionInMap`, and consequently never attempt to create a new `CSSTransition` and add it to the map of running transitions in step 1 of the algorithm. As described above, this causes the carousel to get stuck in a bad state. To fix this, we simply revert to pre-r263729 behavior in the case where the matching backing animation was already removed, and allow step 3 of the algorithm to cancel the running animation and remove it altogether instead of moving it into the element's completed transitions map. Test: animations/animation-followed-by-two-transitions.html * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty): 2020-08-20 Chris Dumez <cdumez@apple.com> AudioBufferSourceNode should use "final" values for playbackRate and detune https://bugs.webkit.org/show_bug.cgi?id=215669 Reviewed by Eric Carlson. AudioBufferSourceNode should use "final" values for playbackRate and detune to take into account changes to the AudioParamTimeline (for example, when AudioBufferSourceNode.playbackRate.setValueAtTime() is called). No new tests, rebaselined existing test. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::totalPitchRate): 2020-08-20 Chris Dumez <cdumez@apple.com> AudioParam.automationRate attribute is missing https://bugs.webkit.org/show_bug.cgi?id=215710 Reviewed by Darin Adler. Add initial support for AudioParam.automationRate: - https://www.w3.org/TR/webaudio/#dom-audioparam-automationrate No new tests, rebaselined existing tests. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): * Modules/webaudio/AudioListener.cpp: (WebCore::AudioListener::AudioListener): * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::AudioParam): (WebCore::AudioParam::setAutomationRate): (WebCore::AudioParam::calculateSampleAccurateValues): * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParam.idl: * Modules/webaudio/BiquadDSPKernel.cpp: (WebCore::BiquadDSPKernel::updateCoefficientsIfNecessary): * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::BiquadProcessor): * Modules/webaudio/ConstantSourceNode.cpp: (WebCore::ConstantSourceNode::ConstantSourceNode): (WebCore::ConstantSourceNode::process): * Modules/webaudio/DelayDSPKernel.cpp: (WebCore::DelayDSPKernel::process): * Modules/webaudio/DelayProcessor.cpp: (WebCore::DelayProcessor::DelayProcessor): * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::GainNode): (WebCore::GainNode::process): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::OscillatorNode): (WebCore::OscillatorNode::calculateSampleAccuratePhaseIncrements): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::PannerNode): (WebCore::PannerNode::distanceConeGain): * Modules/webaudio/PannerNode.h: * Modules/webaudio/StereoPannerNode.cpp: (WebCore::StereoPannerNode::StereoPannerNode): (WebCore::StereoPannerNode::process): * Modules/webaudio/WebKitAudioBufferSourceNode.h: * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode): (WebCore::WebKitAudioPannerNode::distanceConeGain): * Modules/webaudio/WebKitAudioPannerNode.h: * Modules/webaudio/WebKitDynamicsCompressorNode.h: 2020-08-20 Kenneth Russell <kbr@chromium.org> [WebGL2] Pass context-lost-restored.html test https://bugs.webkit.org/show_bug.cgi?id=215599 Reviewed by Dean Jackson. Support losing extensions, and restoring them via WEBGL_lose_context. Necessarily changed WebGLExtensions to be RefCounted rather than managed via unique_ptr. Multiple instances of the same WebGLExtension subclass can now be vended from a WebGL rendering context, and WebGLExtensions can now outlive their rendering context - they do not ref their context. Extensions now hold a weak pointer to their WebGLRenderingContextBase rather than a C++ reference. When an extension's parent context is lost, that pointer is nulled out. Extensions are forcibly lost upon WebGL context destruction. WebGL extensions' IDLs still use GenerateIsReachable=ImplWebGLRenderingContext, so that if the context is still alive, the JavaScript wrappers for the extension objects will be preserved. (If the extension is lost, the bindings will fetch nullptr for the context, which won't be in the opaque root set, so the JavaScript wrapper won't be artificially kept alive.) Covered by existing WebGL conformance tests. * html/canvas/ANGLEInstancedArrays.cpp: (WebCore::ANGLEInstancedArrays::drawArraysInstancedANGLE): (WebCore::ANGLEInstancedArrays::drawElementsInstancedANGLE): (WebCore::ANGLEInstancedArrays::vertexAttribDivisorANGLE): * html/canvas/OESVertexArrayObject.cpp: (WebCore::OESVertexArrayObject::createVertexArrayOES): (WebCore::OESVertexArrayObject::deleteVertexArrayOES): (WebCore::OESVertexArrayObject::isVertexArrayOES): (WebCore::OESVertexArrayObject::bindVertexArrayOES): * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getExtension): * html/canvas/WebGLDebugShaders.cpp: (WebCore::WebGLDebugShaders::getTranslatedShaderSource): * html/canvas/WebGLDrawBuffers.cpp: (WebCore::WebGLDrawBuffers::drawBuffersWEBGL): * html/canvas/WebGLExtension.cpp: (WebCore::WebGLExtension::WebGLExtension): (WebCore::WebGLExtension::loseParentContext): * html/canvas/WebGLExtension.h: (WebCore::WebGLExtension::context): (WebCore::WebGLExtension::isLost): (WebCore::WebGLExtension::ref): Deleted. (WebCore::WebGLExtension::deref): Deleted. * html/canvas/WebGLLoseContext.cpp: (WebCore::WebGLLoseContext::loseContext): (WebCore::WebGLLoseContext::restoreContext): (WebCore::WebGLLoseContext::loseParentContext): * html/canvas/WebGLLoseContext.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::getExtension): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase): (WebCore::WebGLRenderingContextBase::loseContextImpl): (WebCore::WebGLRenderingContextBase::loseExtensions): * html/canvas/WebGLRenderingContextBase.h: 2020-08-20 Aditya Keerthi <akeerthi@apple.com> Add runtime setting for editable components in date/time inputs https://bugs.webkit.org/show_bug.cgi?id=215705 Reviewed by Wenson Hsieh. This setting controls the ability to edit individual components of date and time input types. For example, <input type=date> will have three editable components - year, month, and day. * page/Settings.yaml: 2020-08-20 Rob Buis <rbuis@igalia.com> XMLHttpRequest.open should use USVString https://bugs.webkit.org/show_bug.cgi?id=215704 Reviewed by Chris Dumez. XMLHttpRequest.open should use USVString as mentioned in the FIXMEs and the spec [1]. Test: imported/w3c/web-platform-tests/xhr/open-url-encoding.html [1] https://xhr.spec.whatwg.org/#ref-for-dom-xmlhttprequest-open * xml/XMLHttpRequest.idl: 2020-08-20 Clark Wang <clark_wang@apple.com> Introduce StereoPannerNode Interface https://bugs.webkit.org/show_bug.cgi?id=215518 Reviewed by Darin Adler. Added StereoPannerNode according to spec: https://www.w3.org/TR/webaudio/#stereopannernode. Used Chromium implementation for guidance: https://source.chromium.org/chromium/chromium/src/ +/master:third_party/blink/renderer/modules/webaudio/stereo_panner_node.cc. Added in StereoPannerOptions and StereoPanner files as well. The latter used Chromium implementation for guidance: https://source.chromium.org/chromium/chromium/src/+ /master:third_party/blink/renderer/platform/audio/stereo_panner.cc Re-baselined existing tests. Some now fail due to missing automation rate. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioNode.cpp: (WebCore::convertEnumerationToString): * Modules/webaudio/AudioNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createStereoPanner): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/StereoPannerNode.cpp: Added. (WebCore::StereoPannerNode::create): (WebCore::StereoPannerNode::StereoPannerNode): (WebCore::StereoPannerNode::~StereoPannerNode): (WebCore::StereoPannerNode::process): (WebCore::StereoPannerNode::initialize): (WebCore::StereoPannerNode::uninitialize): (WebCore::StereoPannerNode::listener): (WebCore::StereoPannerNode::setChannelCount): (WebCore::StereoPannerNode::setChannelCountMode): * Modules/webaudio/StereoPannerNode.h: Added. * Modules/webaudio/StereoPannerNode.idl: Added. * Modules/webaudio/StereoPannerOptions.h: Added. * Modules/webaudio/StereoPannerOptions.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * platform/audio/StereoPanner.cpp: Added. (WebCore::StereoPanner::create): (WebCore::StereoPanner::StereoPanner): (WebCore::StereoPanner::panWithSampleAccurateValues): (WebCore::StereoPanner::panToTargetValue): * platform/audio/StereoPanner.h: Added. (WebCore::StereoPanner::~StereoPanner): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: 2020-08-20 Sergio Villar Senin <svillar@igalia.com> Unreviewed, reverting r265850. Tests crash on debug builds Reverted changeset: "[WebXR] Make "in parallel" code run really in parallel" https://bugs.webkit.org/show_bug.cgi?id=215642 https://trac.webkit.org/changeset/265850 2020-08-20 Chris Dumez <cdumez@apple.com> Sandbox violation when calling [NSHTTPCookieStorage sharedHTTPCookieStorage] from the WebProcess https://bugs.webkit.org/show_bug.cgi?id=215701 <rdar://problem/67069826> Reviewed by Geoffrey Garen. The sandbox does not allow calling [NSHTTPCookieStorage sharedHTTPCookieStorage] from the WebProcess. createPrivateStorageSession() was calling [NSHTTPCookieStorage sharedHTTPCookieStorage] to retrieve the cookieAcceptPolicy and createPrivateStorageSession() is used by the cookie cache in the WebProcess. To address the issue, we now allow the caller of createPrivateStorageSession() to provide the cookieAcceptPolicy and we have the cookie cache retrieve the cookieAcceptPolicy from the NetworkProcessConnection. * platform/network/NetworkStorageSession.h: * platform/network/cf/NetworkStorageSessionCFNetWin.cpp: (WebCore::createPrivateStorageSession): * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::createPrivateStorageSession): 2020-08-19 Kate Cheney <katherine_cheney@apple.com> Third party domains are not stored in the case of back/forward navigations https://bugs.webkit.org/show_bug.cgi?id=215595 <rdar://problem/66642893> Reviewed by Chris Dumez. Add a FrameLoaderClient function to store loaded third party domains in a CachedPage in the case of back/forward navigations. * history/CachedPage.cpp: (WebCore::CachedPage::CachedPage): (WebCore::CachedPage::restore): (WebCore::CachedPage::clear): * history/CachedPage.h: * loader/FrameLoaderClient.h: 2020-08-19 Chris Dumez <cdumez@apple.com> Blob is missing text() & arrayBuffer() operations https://bugs.webkit.org/show_bug.cgi?id=215663 Reviewed by Geoff Garen. Implementation support for Blob.text() & Blob.arrayBuffer() as per specification: - https://w3c.github.io/FileAPI/#blob-section The implementation relies on the pre-existing BlobLoader class but the following changes were made: - Stop calling start() in the BlobLoader constructor and have the caller call start() explicitly after constructing the BlobLoader. This is important because the load may fail synchronously in some cases. - Add support for reading Blob as text. Previously, BlobLoader would only support reading the blob as an ArrayBuffer. - Use a CompletionHandler instead of a Function and make sure that it is always called. No new tests, rebaselined existing tests. * fileapi/Blob.cpp: (WebCore::Blob::~Blob): (WebCore::Blob::loadBlob): (WebCore::Blob::text): (WebCore::Blob::arrayBuffer): * fileapi/Blob.h: * fileapi/Blob.idl: * fileapi/BlobLoader.h: (WebCore::BlobLoader::BlobLoader): (WebCore::BlobLoader::~BlobLoader): (WebCore::BlobLoader::cancel): (WebCore::BlobLoader::start): (WebCore::BlobLoader::didFinishLoading): (WebCore::BlobLoader::didFail): (WebCore::BlobLoader::complete): Deleted. * fileapi/NetworkSendQueue.cpp: (WebCore::NetworkSendQueue::enqueue): (WebCore::NetworkSendQueue::clear): (WebCore::NetworkSendQueue::processMessages): * page/ShareDataReader.cpp: (WebCore::ShareDataReader::start): (WebCore::ShareDataReader::didFinishLoading): (WebCore::ShareDataReader::cancel): 2020-08-19 Alexey Shvayka <shvaikalesh@gmail.com> Introduce OpIsCallable bytecode and intrinsic https://bugs.webkit.org/show_bug.cgi?id=215572 Reviewed by Ross Kirsling and Saam Barati. No new tests, no behavior change. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::openDatabase const): 2020-08-19 Peng Liu <peng.liu6@apple.com> A PiP window is closed when the video element is removed from DOM https://bugs.webkit.org/show_bug.cgi?id=215594 Reviewed by Eric Carlson. Test: media/remove-video-element-in-pip-from-document.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::pauseAfterDetachedTask): When a video is playing in the picture-in-picture mode, do not pause it or exit the picture-in-picture mode when detaching the video element from the DOM. (WebCore::HTMLMediaElement::mediaPlayerRenderingCanBeAccelerated): Always return true when the video is playing in the picture-in-picture mode. * rendering/RenderVideo.cpp: (WebCore::RenderVideo::willBeDestroyed): Don't hide the player when destroying the renderer of an inline video. 2020-08-19 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Restore a 10_15_* user-agent string when requesting desktop site https://bugs.webkit.org/show_bug.cgi?id=215657 <rdar://problem/67376157> Reviewed by Tim Horton. Reporting a major version of `11_0` causes numerous compatibility issues on websites that attempt to parse major and minor versions from the user agent string. This partially reverts r263970, and replaces the string with `10_15_6`, which matches the UA string of the latest shipped macOS version. * platform/ios/UserAgentIOS.mm: (WebCore::standardUserAgentWithApplicationName): 2020-08-18 Ryosuke Niwa <rniwa@webkit.org> REGRESSION(r265092): delegatesFocus causes WebKit to crash https://bugs.webkit.org/show_bug.cgi?id=215622 Reviewed by Youenn Fablet. The bug was caused by a missing nullptr check. Added it. Test: fast/shadow-dom/delegates-focus-unsuccessfully-by-activation.html * page/EventHandler.cpp: (WebCore::EventHandler::dispatchMouseEvent): Added a nullptr check. 2020-08-19 Aditya Keerthi <akeerthi@apple.com> Remove use of ControlSize in ThemeMac https://bugs.webkit.org/show_bug.cgi?id=215651 Reviewed by Sam Weinig. ThemeMac contains incorrectly mixes the use of Carbon's ControlSize and AppKit's NSControlSize. This inconsistency went unnoticed as ControlSize is a UInt16, and NSControlSize is an NSUInteger. No new tests as there is no change in behavior. * platform/mac/ThemeMac.mm: (WebCore::controlSizeFromPixelSize): This method always returns an NSControlSize, but it's declared return type is a ControlSize. Correct the declared return type. (WebCore::setControlSize): (WebCore::paintStepper): (WebCore::ThemeMac::inflateControlPaintRect const): 2020-08-19 Aditya Keerthi <akeerthi@apple.com> [macOS] Move stepper painting code off of Carbon API https://bugs.webkit.org/show_bug.cgi?id=215619 <rdar://problem/41936617> Reviewed by Darin Adler. Use CoreUI and AppKit SPI to paint steppers. There are two benefits to this new approach. 1. The stepper now has an appropriate appearance in dark mode. 2. We move away from using the outdated Carbon API. Note that we still cannot use NSStepperCell to paint steppers, since it is not possible to draw one with the up button highlighted. However, the approach used in this patch is shared by NSStepperCell. Test: fast/forms/number/number-dark-appearance.html * platform/mac/ThemeMac.mm: (WebCore::paintStepper): 2020-08-19 Lauro Moura <lmoura@igalia.com> [WebXR] Remove uneeded assert Rubber-stamped by Sergio Villar Senin context being a Document is tracked by the downcast when capturing. Fixes debug build error complaining about not capturing context. Covered by existing tests. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::requestReferenceSpace): 2020-08-17 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] min-height:auto not updated after an image loads when the image has a specified height and width. https://bugs.webkit.org/show_bug.cgi?id=210475 Reviewed by Javier Fernandez. The flex layout algorithm needs the item's intrinsic size even if it has a specified size, that's why the flex item size should be recomputed in the event of changes in its intrinsic size. * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::setNeedsLayoutIfNeededAfterIntrinsicSizeChange): set the needs layout flag also for replaced elements which happen to be flex items. 2020-08-17 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] Apply aspect ratios when computing flex-basis https://bugs.webkit.org/show_bug.cgi?id=215570 Reviewed by Javier Fernandez. Aspect ratios (clamped by min/max restrictions) should be considered when computing flex-basis. Based on Blink's crrev.com/c/1525444 & crrev.com/c/1672014 by <cbiesinger@chromium.org> * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild): 2020-08-19 Youenn Fablet <youenn@apple.com> Optimise resolution of promises with values in ReadableStream implementation https://bugs.webkit.org/show_bug.cgi?id=215557 <rdar://problem/66828616> Reviewed by Yusuke Suzuki. Instead of going through the slow @Promise.@resolve, we can directly use @fulfillPromise which is faster. To make things consistent, we move from @newPromiseCapability to @newPromise. Test: streams/readableStream-then.html * Modules/streams/ReadableByteStreamInternals.js: (readableByteStreamControllerPull): (readableStreamFulfillReadIntoRequest): (readableByteStreamControllerPullInto): * Modules/streams/ReadableStreamInternals.js: (readableStreamDefaultControllerPull): (readableStreamClose): (readableStreamFulfillReadRequest): (readableStreamDefaultReaderRead): * Modules/streams/StreamInternals.js: (createFulfilledPromise): 2020-08-18 Sergio Villar Senin <svillar@igalia.com> <button> should support display:inline-grid/grid/inline-flex/flex correctly https://bugs.webkit.org/show_bug.cgi?id=209656 Reviewed by Javier Fernandez. Button elements with display type (inline-) flex or grid should be laid out as their display type states and not as buttons. That's mentioned in the HTML spec here https://html.spec.whatwg.org/multipage/rendering.html#button-layout. * html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::createElementRenderer): let HTMLFormControlElement create a renderer instead of using a RenderButton whenever display is (inline-)grid/flex. 2020-08-19 Sergio Villar Senin <svillar@igalia.com> [WebXR] Make "in parallel" code run really in parallel https://bugs.webkit.org/show_bug.cgi?id=215642 Reviewed by Carlos Garcia Campos. As the HTML spec mentions https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel "in parallel" means that the task should be run in parallel to the event loop using any available mechanism (threads, processess...). We were instead queueing those tasks to be run in the main thread causing freezes while initializing the whole OpenXR machinery. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::WebXRSession): create a WorkQueue. (WebCore::WebXRSession::requestReferenceSpace): Dispatch to the work queue. * Modules/webxr/WebXRSession.h: * Modules/webxr/WebXRSystem.cpp: (WebCore::WebXRSystem::WebXRSystem): create a WorkQueue. (WebCore::WebXRSystem::isSessionSupported): Dispatch to the work queue. (WebCore::WebXRSystem::requestSession): Ditto. * Modules/webxr/WebXRSystem.h: 2020-08-18 Chris Dumez <cdumez@apple.com> AudioBuffer.duration should use double precision https://bugs.webkit.org/show_bug.cgi?id=215632 Reviewed by Darin Adler. AudioBuffer.duration should use double precision: - https://www.w3.org/TR/webaudio/#AudioBuffer No new tests, rebaselined existing test. * Modules/webaudio/AudioBuffer.h: (WebCore::AudioBuffer::duration const): * Modules/webaudio/AudioBuffer.idl: 2020-08-18 Ryosuke Niwa <rniwa@webkit.org> Rename replaceAllChildren to replaceAllChildrenWithNewText https://bugs.webkit.org/show_bug.cgi?id=215634 Reviewed by Darin Adler. Renamed ContainerNode::replaceAllChildren to replaceAllChildrenWithNewText and changed the type of Argument from Ref<Node>&& to const String&. * dom/ContainerNode.cpp: (WebCore::ContainerNode::replaceAllChildrenWithNewText): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::Node::setTextContent): * html/HTMLElement.cpp: (WebCore::HTMLElement::setInnerText): 2020-08-18 Andres Gonzalez <andresg_22@apple.com> Fix for accessibility/mac/aria-expanded-notifications.html in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=215613 Reviewed by Darin Adler. Test: accessibility/mac/aria-expanded-notifications.html. Refactored AXObjectCache::handleAriaExpandedChange so that it doesn't call into AccessibilityObject to handle the notification, to then call into AXObjectCache again. The new implementation is cleaner and more straightforward. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAriaExpandedChange): (WebCore::AXObjectCache::updateIsolatedTree): Updates the isolated tree on the row expanded/collapsed-related notifications. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::supportsRowCountChange const): Added. * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged): Deleted, not needed any longer since it is handled in AXObjectCache where it should. * accessibility/AccessibilityRenderObject.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): Caches the supportsRowCountChange property. (WebCore::AXIsolatedObject::handleAriaExpandedChanged): Deleted, not needed any longer. * accessibility/isolatedtree/AXIsolatedObject.h: 2020-08-18 James Darpinian <jdarpinian@chromium.org> [WebGL2] Various parameters should be non-nullable in IDL https://bugs.webkit.org/show_bug.cgi?id=215616 Reviewed by Kenneth Russell. Fixes 5 conformance tests: conformance/misc/error-reporting.html conformance/misc/null-object-behaviour.html conformance/misc/bad-arguments-test.html conformance/textures/misc/tex-sub-image-2d-bad-args.html conformance/programs/get-active-test.html * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::attachShader): (WebCore::WebGLRenderingContextBase::bindAttribLocation): (WebCore::WebGLRenderingContextBase::compileShader): (WebCore::WebGLRenderingContextBase::detachShader): (WebCore::WebGLRenderingContextBase::getActiveAttrib): (WebCore::WebGLRenderingContextBase::getActiveUniform): (WebCore::WebGLRenderingContextBase::getAttachedShaders): (WebCore::WebGLRenderingContextBase::getAttribLocation): (WebCore::WebGLRenderingContextBase::getProgramParameter): (WebCore::WebGLRenderingContextBase::getProgramInfoLog): (WebCore::WebGLRenderingContextBase::getShaderParameter): (WebCore::WebGLRenderingContextBase::getShaderInfoLog): (WebCore::WebGLRenderingContextBase::getShaderSource): (WebCore::WebGLRenderingContextBase::getUniform): (WebCore::WebGLRenderingContextBase::getUniformLocation): (WebCore::WebGLRenderingContextBase::linkProgram): (WebCore::WebGLRenderingContextBase::shaderSource): (WebCore::WebGLRenderingContextBase::validateProgram): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLRenderingContextBase.idl: * inspector/InspectorShaderProgram.cpp: (WebCore::InspectorShaderProgram::updateShader): 2020-08-18 Chris Dumez <cdumez@apple.com> PannerNode's rolloffFactor should be clamped to [0, 1] internally when distanceModel is "linear" https://bugs.webkit.org/show_bug.cgi?id=215625 Reviewed by Darin Adler. PannerNode's rolloffFactor should be clamped to [0, 1] internally when distanceModel is "linear": - https://www.w3.org/TR/webaudio/#dom-pannernode-rollofffactor No new tests, rebaselined existing test. * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::setRolloffFactor): * platform/audio/Distance.cpp: (WebCore::DistanceEffect::linearGain): 2020-08-18 Chris Dumez <cdumez@apple.com> ScriptProcessNode should only run script asynchronously if the audio context is not an OfflineAudioContext https://bugs.webkit.org/show_bug.cgi?id=215624 Reviewed by Eric Carlson. ScriptProcessNode should only run script asynchronously if the audio context is not an OfflineAudioContext. If the context is an OfflineAudioContext, then it should pause processing until the script has finished execution. This aligns our behavior with Blink and helps us pass more WPT tests. No new tests, rebaselined existing test. * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::ScriptProcessorNode): (WebCore::ScriptProcessorNode::process): 2020-08-18 Eric Carlson <eric.carlson@apple.com> [Catalyst] Video should pause automatically when switching desktops https://bugs.webkit.org/show_bug.cgi?id=215620 Reviewed by Jer Noble. * platform/audio/ios/MediaSessionManagerIOS.h: * platform/audio/ios/MediaSessionManagerIOS.mm: Don't override resetRestrictions on Catalyst so we don't pause video in the background. 2020-08-18 Kenneth Russell <kbr@chromium.org> [WebGL2] Pass user-defined-properties-on-context.html layout test https://bugs.webkit.org/show_bug.cgi?id=215433 Reviewed by Yusuke Suzuki. Keep the canvas' rendering context alive from the canvas itself by adding a custom mark function for HTMLCanvasElement, and adding a new GenerateIsReachable=ImplCanvasBase extended IDL attribute, used from all rendering context types (2D, WebGL, and WebGPU). This patch does not touch OffscreenCanvas since the implementation there seems to be incomplete and there are no associated tests of GC behavior. Tests: fast/canvas/2d.context.expando.html webgpu/expando-properties.html * Modules/webgpu/GPUCanvasContext.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSHTMLCanvasElementCustom.cpp: Copied from Source/WebCore/html/canvas/WebGLRenderingContext.idl. (WebCore::JSHTMLCanvasElement::visitAdditionalChildren): * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/IDLAttributes.json: * html/HTMLCanvasElement.idl: * html/canvas/WebGL2RenderingContext.idl: * html/canvas/WebGLRenderingContext.idl: 2020-08-18 Chris Dumez <cdumez@apple.com> WaveShaperNode.curve setter should create a copy of the input array https://bugs.webkit.org/show_bug.cgi?id=215615 Reviewed by Eric Carlson. WaveShaperNode.curve setter should create a copy of the input array, so that follow-up modifications of the array by the JS do not impact audio processing: - https://www.w3.org/TR/webaudio/#dom-waveshapernode-curve No new tests, rebaselined existing test. * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::setCurve): 2020-08-17 Ryosuke Niwa <rniwa@webkit.org> REGRESSION(r262381): replaceChildren should not use DeferChildrenChanged::No https://bugs.webkit.org/show_bug.cgi?id=215600 Reviewed by Antti Koivisto. It's not correct to use DeferChildrenChanged::No when the new node may have an old parent. Use DeferChildrenChanged::Yes instead. * dom/ContainerNode.cpp: (WebCore::ContainerNode::replaceAllChildren): Added a release assertion to make sure people don't start using this function incorrectly in the future. (WebCore::ContainerNode::replaceChildren): Fixed the bug. 2020-08-18 Simon Fraser <simon.fraser@apple.com> Turn off wheel event regions until we need them https://bugs.webkit.org/show_bug.cgi?id=215586 Reviewed by Darin Adler. Leave ENABLE_WHEEL_EVENT_REGIONS off because it's currently unused, and adds extra region building overhead on macOS. * page/scrolling/ScrollingTree.cpp: * page/scrolling/ScrollingTree.h: * page/scrolling/mac/ScrollingTreeMac.h: * page/scrolling/mac/ScrollingTreeMac.mm: 2020-08-18 Youenn Fablet <youenn@apple.com> Update platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html to account for low latency code path https://bugs.webkit.org/show_bug.cgi?id=215601 Reviewed by Eric Carlson. Covered by existing/updated test. * testing/Internals.cpp: (WebCore::Internals::supportsVCPEncoder): In case low latency code path is enabled, supportsVCPEncoder should return true. 2020-08-18 Simon Fraser <simon.fraser@apple.com> REGRESSION (Async overflow scrolling): No rubberbanding in overflow:scroll in the wheel event region https://bugs.webkit.org/show_bug.cgi?id=215598 <rdar://problem/64895442> Reviewed by Darin Adler. Scrolling in overflow:scroll inside the non-fast event region (e.g. inside an ancestor with a wheel event handler) happens via ScrollAnimatorMac::handleWheelEvent() which calls ScrollableArea::setScrollOffsetFromAnimation() which bounces to the scrolling thread via RenderLayer::requestScrollPositionUpdate(). We were clamping the scroll offset here, thus disallowing the overscrolled offsets required for rubberbanding. Fix is to allow clamping for user scrolls. Also add more logging. Test: fast/scrolling/mac/rubberband-overflow-in-wheel-region.html * dom/Element.cpp: (WebCore::Element::dispatchWheelEvent): * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::handleWheelEvent): * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::handleWheelEvent): (WebCore::ScrollableArea::setScrollOffsetFromAnimation): 2020-08-18 Chris Dumez <cdumez@apple.com> Unreviewed, null-deref fix after r265797. MockAudioDestinationCocoa::tick() is calling AudioDestinationCocoa::inputProc() with a null AudioTimeStamp struct so we need to deal with this. * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestinationCocoa::render): 2020-08-18 Antti Koivisto <antti@apple.com> The CSS specificity of :host() pseudo-classes is wrong https://bugs.webkit.org/show_bug.cgi?id=202494 <rdar://problem/66292568> Reviewed by Anders Carlsson. https://drafts.csswg.org/css-scoping/#host-selector “The specificity of :host() is that of a pseudo-class, plus the specificity of its argument.” * css/CSSSelector.cpp: (WebCore::simpleSelectorSpecificityInternal): 2020-08-18 Youenn Fablet <youenn@apple.com> Add a JS built-in routine to mark a promise as handled https://bugs.webkit.org/show_bug.cgi?id=215558 Reviewed by Darin Adler. Wrap long line of code inside a method to ease code readability. No change of behavior. * Modules/streams/ReadableStream.js: (pipeThrough): * Modules/streams/ReadableStreamInternals.js: (readableStreamError): (readableStreamReaderGenericRelease): * Modules/streams/StreamInternals.js: (markPromiseAsHandled): (shieldingPromiseResolve): * Modules/streams/WritableStreamInternals.js: (setUpWritableStreamDefaultWriter): (writableStreamRejectCloseAndClosedPromiseIfNeeded): (writableStreamDefaultWriterEnsureClosedPromiseRejected): (writableStreamDefaultWriterEnsureReadyPromiseRejected): 2020-08-17 Chris Dumez <cdumez@apple.com> AudioContext.getOutputTimestamp() is missing https://bugs.webkit.org/show_bug.cgi?id=215591 Reviewed by Darin Adler. AudioContext.getOutputTimestamp() is missing: - https://www.w3.org/TR/webaudio/#dom-audiocontext-getoutputtimestamp No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::getOutputTimestamp): * Modules/webaudio/AudioContext.h: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::render): * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/AudioTimestamp.h: Copied from Source/WebCore/Modules/webaudio/AudioContext.h. * Modules/webaudio/AudioTimestamp.idl: Copied from Source/WebCore/Modules/webaudio/AudioContext.h. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::handlePreRenderTasks): (WebCore::BaseAudioContext::outputPosition): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::offlineRender): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/AudioIOCallback.h: (WebCore::AudioIOPosition::encode const): (WebCore::AudioIOPosition::decode): * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::machAbsoluteTimeToMonotonicTime): (WebCore::AudioDestinationCocoa::render): (WebCore::AudioDestinationCocoa::inputProc): * platform/audio/cocoa/AudioDestinationCocoa.h: 2020-08-17 Chris Dumez <cdumez@apple.com> Improve channel mixing support in AudioBus https://bugs.webkit.org/show_bug.cgi?id=215597 Reviewed by Darin Adler. Improve channel mixing support in AudioBus to match the specification: - https://www.w3.org/TR/webaudio/#channel-up-mixing-and-down-mixing Our implementation also matches Blink's: - https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/platform/audio/audio_bus.cc No new tests, rebaselined existing test. * platform/audio/AudioBus.cpp: (WebCore::AudioBus::copyFrom): (WebCore::AudioBus::sumFrom): (WebCore::AudioBus::speakersSumFromByUpMixing): (WebCore::AudioBus::speakersSumFromByDownMixing): * platform/audio/AudioBus.h: 2020-08-17 Karl Rackler <rackler@apple.com> Unreviewed, reverting r265603. Reverting per commiter because commit caused consisent crash with test. Reverted changeset: "Font loads quickly followed by navigations may fail indefinitely" https://bugs.webkit.org/show_bug.cgi?id=215435 https://trac.webkit.org/changeset/265603 2020-08-17 Chris Dumez <cdumez@apple.com> AudioNode.disconnect() does not match the specification https://bugs.webkit.org/show_bug.cgi?id=215578 Reviewed by Eric Carlson. AudioNode.disconnect() did not match the specification. There were a lot of overloads in the specification that we did not support: - https://www.w3.org/TR/webaudio/#dom-audionode-disconnect No new tests, rebaselined existing tests. * Modules/webaudio/AudioBasicInspectorNode.cpp: (WebCore::AudioBasicInspectorNode::connect): Deleted. (WebCore::AudioBasicInspectorNode::disconnect): Deleted. * Modules/webaudio/AudioBasicInspectorNode.h: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::connect): (WebCore::AudioNode::disconnect): * Modules/webaudio/AudioNode.h: (WebCore::AudioNode::updatePullStatus): * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioNodeOutput.h: (WebCore::AudioNodeOutput::isConnectedTo const): 2020-08-17 Chris Dumez <cdumez@apple.com> WaveShaperNode should not output silence when it has no input or when input is silence https://bugs.webkit.org/show_bug.cgi?id=215574 Reviewed by Eric Carlson. WaveShaperNode should not output silence when it has no input or when input is silence. It should still apply its curve to the silent input. No new tests, rebaselined existing test. * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::disableOutputsIfNecessary): Do not disable the WaveShaperNode's output when its has no input. The WaveShaperNode may still provide non-silent output when it has no input. * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::propagatesSilence const): * Modules/webaudio/WaveShaperNode.h: Override propagatesSilence() to return false when the WaveShaperNode has a curve to apply, so that we ask the node to process the input even when it is silence. 2020-08-17 David Kilzer <ddkilzer@apple.com> Clean up DragApplicationFlags after switch to OptionSet<> <https://webkit.org/b/215349> Reviewed by Darin Adler. Change WebCore::DragApplicationFlags to an enum class. No new tests since no change in behavior. * page/gtk/DragControllerGtk.cpp: (WebCore::DragController::isCopyKeyDown): * page/mac/DragControllerMac.mm: (WebCore::DragController::isCopyKeyDown): (WebCore::DragController::dragOperation): * platform/DragData.h: 2020-08-17 Yusuke Suzuki <ysuzuki@apple.com> JSDOMConstructorNotConstructable should be a constructor https://bugs.webkit.org/show_bug.cgi?id=215554 <rdar://problem/65770688> Reviewed by Darin Adler. Test: js/dom/window-is-constructor.html While JSDOMConstructorNotConstructable throws an error, still it should be a constructor, which means, `IsConstructor(JSDOMConstructorNotConstructable)` should be true. To fix it, we add getConstructData which configures a function throwing an error. * bindings/js/JSDOMConstructorNotConstructable.h: 2020-08-17 Youenn Fablet <youenn@apple.com> Make sure writableStreamDefaultWriterEnsureClosedPromiseRejected overwrite the closedPromise if needed https://bugs.webkit.org/show_bug.cgi?id=215540 Reviewed by Darin Adler. Covered by rebased tests. * Modules/streams/WritableStreamInternals.js: (writableStreamDefaultWriterEnsureClosedPromiseRejected): As per spec, if promise is already settled, we overwrite it to reject it. 2020-08-17 Youenn Fablet <youenn@apple.com> Check WritableStream underlyingSink methods https://bugs.webkit.org/show_bug.cgi?id=215539 Reviewed by Darin Adler. Covered by updated tests. * Modules/streams/WritableStream.js: (initializeWritableStream): 2020-08-16 Simon Fraser <simon.fraser@apple.com> Fix some spelling and editorial issues https://bugs.webkit.org/show_bug.cgi?id=215553 Reviewed by Darin Adler. "Stretches" has a t in the middle, and "padding" is singular. * inspector/InspectorOverlay.cpp: (WebCore::buildRendererHighlight): * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::geometryForBox const): * layout/FormattingContext.h: * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): * rendering/RenderTable.cpp: (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth): * rendering/RenderTableCell.cpp: * rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::layout): 2020-08-14 Simon Fraser <simon.fraser@apple.com> Scrolling sync changes in r261985 regressed CPU usage by ~2 ms/s https://bugs.webkit.org/show_bug.cgi?id=215529 <rdar://problem/66866163> Reviewed by Geoff Garen. r261985 added two code paths that wake up the scrolling thread on every rendering update (triggered by displayDidRefresh()). One is a ping from the EventDispatcher thread, the other is a wake-and-block from the main thread. If the scrolling thread isn't active (no wheel events received recently), we can avoid both of these to reduce the number of CPU core wakeups. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::isRecentlyActive): (WebCore::ScrollingTree::setRecentlyActive): * page/scrolling/ScrollingTree.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::willStartRenderingUpdate): (WebCore::ThreadedScrollingTree::displayDidRefresh): 2020-08-16 Dean Jackson <dino@apple.com> [AS Layout Tests] 6 WPT css-backgrounds tests consistently failing https://bugs.webkit.org/show_bug.cgi?id=215533 rdar://66660924 Reviewed by Youenn Fablet. A static_cast from float to int, where the float value is larger than MAX_INT, produces different results on x86_64 and arm64e. Unfortunately, fixing this exposed the fact that we were accidentally passing the tests below on Intel. This commit addresses the casting issue and marks the tests as now accurately failing. Details on the new bug at: webkit.org/b/206753 Covered by: imported/w3c/web-platform-tests/css/css-backgrounds/background-size/vector/tall--contain--height.html imported/w3c/web-platform-tests/css/css-backgrounds/background-size/vector/tall--contain--width.html imported/w3c/web-platform-tests/css/css-backgrounds/background-size/vector/wide--contain--height.html imported/w3c/web-platform-tests/css/css-backgrounds/background-size/vector/wide--contain--width.html * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::containerSize const): Don't static_cast from float to int. Rather, use the explicit IntSize constructor. 2020-08-15 Andres Gonzalez <andresg_22@apple.com> Revert unnecessary change for https://bugs.webkit.org/show_bug.cgi?id=215521. https://bugs.webkit.org/show_bug.cgi?id=215541 Reviewed by Chris Fleizach. These additional checks are no longer necessary since makeSimpleRange returns a null Optional if any of the VisiblePosition parameters is null. Darin Adler already fixed the crasher in https://bugs.webkit.org/show_bug.cgi?id=215521 with the patch https://trac.webkit.org/changeset/265044/webkit. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::rangeMatchesTextNearRange): 2020-08-15 Youenn Fablet <youenn@apple.com> WritableStream rejected promises should be marked as handled as per spec https://bugs.webkit.org/show_bug.cgi?id=215501 Reviewed by Darin Adler. Marking promises that got rejected as handled to ensure onunhandledrejection handler is not called erroneously. Covered by rebased tests. * Modules/streams/WritableStreamInternals.js: (setUpWritableStreamDefaultWriter): (writableStreamRejectCloseAndClosedPromiseIfNeeded): (writableStreamDefaultWriterEnsureClosedPromiseRejected): (writableStreamDefaultWriterEnsureReadyPromiseRejected): 2020-08-14 Brady Eidson <beidson@apple.com> Crash inside FrameLoader::defaultRequestCachingPolicy (null DocumentLoader) <rdar://problem/42167093> and https://bugs.webkit.org/show_bug.cgi?id=215527 Reviewed by Darin Adler. We have CrashTracer data, but despite my best efforts no way of reproducing. * loader/FrameLoader.cpp: (WebCore::FrameLoader::defaultRequestCachingPolicy): If a PingLoader is sending a CSP violation report sometime after part of the Document's lifecycle, the FrameLoader as a null DocumentLoader here. Like everywhere else in FrameLoader, null check it. 2020-08-14 Zalan Bujtas <zalan@apple.com> RenderTextControlSingleLine::scroll* functions should not call Element::scroll* on the inner text content https://bugs.webkit.org/show_bug.cgi?id=215516 <rdar://problem/64739768> Reviewed by Simon Fraser. Normally the RenderBox::content*, border*, padding* and scroll* functions grab the geometry information from the renderer itself. The clients of these functions expect the geometry data to be consistent with the rest of the rendering context (e.g coordinates are in the coordinate system of the containing block, paint time operations are not applied etc). Also these functions are supposed to be const. They should not mutate the geometry or the render tree itself. Forwarding ::scroll* calls to Element::scroll* can't guarantee neither of these above. * rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::scrollWidth const): (WebCore::RenderTextControlSingleLine::scrollHeight const): (WebCore::RenderTextControlSingleLine::scrollLeft const): (WebCore::RenderTextControlSingleLine::scrollTop const): 2020-08-14 Chris Dumez <cdumez@apple.com> OfflineAudioContext.destination has incorrect number of channels & channel count mode https://bugs.webkit.org/show_bug.cgi?id=215522 Reviewed by Eric Carlson. OfflineAudioContext.destination currently always has a number of channels that is 0, no matter the numberOfChannels provided when constructing the OfflineAudioContext. The channel count mode is also "max" instead of "explicit" (as per [1]). [1] https://www.w3.org/TR/webaudio/#AudioDestinationNode No new tests, rebaselined existing tests. * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode): (WebCore::OfflineAudioDestinationNode::maxChannelCount const): * Modules/webaudio/OfflineAudioDestinationNode.h: 2020-08-14 James Darpinian <jdarpinian@chromium.org> [WebGL2] releaseShaderCompiler is not allowed to be supported in WebGL https://bugs.webkit.org/show_bug.cgi?id=215432 Reviewed by Dean Jackson. Fixes WebGL conformance tests methods.html and methods-2.html * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::releaseShaderCompiler): Deleted. * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLRenderingContextBase.idl: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::releaseShaderCompiler): Deleted. * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp: (WebCore::GraphicsContextGLOpenGL::releaseShaderCompiler): Deleted. * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp: (WebCore::GraphicsContextGLOpenGL::releaseShaderCompiler): Deleted. 2020-08-14 Devin Rousso <drousso@apple.com> RTL: volume slider and icons are backwards https://bugs.webkit.org/show_bug.cgi?id=215482 <rdar://problem/65730749> Reviewed by Eric Carlson. * Modules/modern-media-controls/controls/inline-media-controls.js: (InlineMediaControls.prototype.layout): Flip the inline volume button when not in LTR. * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js: (MacOSFullscreenMediaControls.prototype.layout): (MacOSFullscreenMediaControls.prototype._volumeControlsForCurrentDirection): Added. Reverse the order of the fullscreen volume controls when not in LTR. * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css: (.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) :is(.volume-down, .volume.slider, .volume-up)): Added. (.media-controls.mac.fullscreen:not(.uses-ltr-user-interface-layout-direction) .volume.slider): Deleted. Also flip the fullscreen volume up and volume down buttons. 2020-08-14 Kenneth Russell <kbr@chromium.org> [WebGL2] expando-loss and expando-loss-2 conformance tests are failing https://bugs.webkit.org/show_bug.cgi?id=214765 Reviewed by Yusuke Suzuki. Re-land with locking fixes ysuzuki@ pointed out as necessary, and advised heavily on. Use JSWebGLRenderingContext's and JSWebGL2RenderingContext's existing visitAdditionalChildren hook, via JSCustomMarkFunction in their IDL, to add opaque roots for all WebGLObjects latched in to the context state, and all WebGLObjects they refer to. Extensions were already previously handled. In order to support JSC's concurrent marking, grab a per-WebGL-context lock in visitAdditionalChildren, and in all WebGL context- and object-related methods which modify compound data structures like HashMaps and Vectors that are traversed by visitAdditionalChildren and its callees. Add "const AbstractLocker&" throughout WebGL's call hierarchy to guarantee that this lock is held where needed. Add needed exception in WebGLObjects' destructors to avoid recursive locking, and in WebGLContextGroup destruction to avoid mutating objects that GC might be traversing when a lock is no longer available on the application's thread. Add "GenerateIsReachable=Impl" to the IDL files of needed WebGL objects (WebGLBuffer, WebGLTexture, etc.) so that they pay attention to the opaque root state when determining liveness of their JavaScript wrappers. Add a FIXME to objectGraphLock in WebGLRenderingContextBase to consider rewriting this in a lock-free manner. Covered by existing WebGL conformance tests. * bindings/js/JSWebGL2RenderingContextCustom.cpp: (WebCore::JSWebGL2RenderingContext::visitAdditionalChildren): * bindings/js/JSWebGLRenderingContextCustom.cpp: (WebCore::JSWebGLRenderingContext::visitAdditionalChildren): * html/canvas/OESVertexArrayObject.cpp: (WebCore::OESVertexArrayObject::deleteVertexArrayOES): (WebCore::OESVertexArrayObject::bindVertexArrayOES): * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::validateAndCacheBufferBinding): (WebCore::WebGL2RenderingContext::bindFramebuffer): (WebCore::WebGL2RenderingContext::deleteFramebuffer): (WebCore::WebGL2RenderingContext::deleteQuery): (WebCore::WebGL2RenderingContext::beginQuery): (WebCore::WebGL2RenderingContext::endQuery): (WebCore::WebGL2RenderingContext::deleteSampler): (WebCore::WebGL2RenderingContext::bindSampler): (WebCore::WebGL2RenderingContext::deleteSync): (WebCore::WebGL2RenderingContext::deleteTransformFeedback): (WebCore::WebGL2RenderingContext::bindTransformFeedback): (WebCore::WebGL2RenderingContext::beginTransformFeedback): (WebCore::WebGL2RenderingContext::setIndexedBufferBinding): (WebCore::WebGL2RenderingContext::deleteVertexArray): (WebCore::WebGL2RenderingContext::bindVertexArray): (WebCore::WebGL2RenderingContext::addMembersToOpaqueRoots): (WebCore::WebGL2RenderingContext::uncacheDeletedBuffer): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLBuffer.cpp: (WebCore::WebGLBuffer::~WebGLBuffer): (WebCore::WebGLBuffer::deleteObjectImpl): * html/canvas/WebGLBuffer.h: * html/canvas/WebGLBuffer.idl: * html/canvas/WebGLContextGroup.cpp: (WebCore::WebGLContextGroup::hasAContext const): (WebCore::WebGLContextGroup::objectGraphLockForAContext): (WebCore::WebGLContextGroup::detachAndRemoveAllObjects): * html/canvas/WebGLContextGroup.h: * html/canvas/WebGLContextObject.cpp: (WebCore::WebGLContextObject::detachContext): (WebCore::WebGLContextObject::objectGraphLockForContext): * html/canvas/WebGLContextObject.h: * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::~WebGLFramebuffer): (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer): (WebCore::WebGLFramebuffer::deleteObjectImpl): (WebCore::WebGLFramebuffer::initializeAttachments): (WebCore::WebGLFramebuffer::addMembersToOpaqueRoots): (WebCore::WebGLFramebuffer::setAttachmentInternal): (WebCore::WebGLFramebuffer::removeAttachmentInternal): * html/canvas/WebGLFramebuffer.h: * html/canvas/WebGLFramebuffer.idl: * html/canvas/WebGLObject.cpp: (WebCore::WebGLObject::runDestructor): (WebCore::WebGLObject::deleteObject): * html/canvas/WebGLObject.h: * html/canvas/WebGLProgram.cpp: (WebCore::WebGLProgram::~WebGLProgram): (WebCore::WebGLProgram::deleteObjectImpl): (WebCore::WebGLProgram::attachShader): (WebCore::WebGLProgram::detachShader): (WebCore::WebGLProgram::addMembersToOpaqueRoots): * html/canvas/WebGLProgram.h: * html/canvas/WebGLProgram.idl: * html/canvas/WebGLQuery.cpp: (WebCore::WebGLQuery::~WebGLQuery): (WebCore::WebGLQuery::deleteObjectImpl): * html/canvas/WebGLQuery.h: * html/canvas/WebGLQuery.idl: * html/canvas/WebGLRenderbuffer.cpp: (WebCore::WebGLRenderbuffer::~WebGLRenderbuffer): (WebCore::WebGLRenderbuffer::deleteObjectImpl): * html/canvas/WebGLRenderbuffer.h: * html/canvas/WebGLRenderbuffer.idl: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::attachShader): (WebCore::WebGLRenderingContextBase::validateAndCacheBufferBinding): (WebCore::WebGLRenderingContextBase::bindBuffer): (WebCore::WebGLRenderingContextBase::bindFramebuffer): (WebCore::WebGLRenderingContextBase::bindRenderbuffer): (WebCore::WebGLRenderingContextBase::bindTexture): (WebCore::WebGLRenderingContextBase::deleteObject): (WebCore::WebGLRenderingContextBase::uncacheDeletedBuffer): (WebCore::WebGLRenderingContextBase::setBoundVertexArrayObject): (WebCore::WebGLRenderingContextBase::deleteBuffer): (WebCore::WebGLRenderingContextBase::deleteFramebuffer): (WebCore::WebGLRenderingContextBase::deleteProgram): (WebCore::WebGLRenderingContextBase::deleteRenderbuffer): (WebCore::WebGLRenderingContextBase::deleteShader): (WebCore::WebGLRenderingContextBase::deleteTexture): (WebCore::WebGLRenderingContextBase::detachShader): (WebCore::WebGLRenderingContextBase::useProgram): (WebCore::WebGLRenderingContextBase::vertexAttribPointer): (WebCore::WebGLRenderingContextBase::detachAndRemoveAllObjects): (WebCore::WebGLRenderingContextBase::setFramebuffer): (WebCore::WebGLRenderingContextBase::addMembersToOpaqueRoots): (WebCore::WebGLRenderingContextBase::objectGraphLock): * html/canvas/WebGLRenderingContextBase.h: (WebCore::WebGLRenderingContextBase::setBoundVertexArrayObject): Deleted. * html/canvas/WebGLSampler.cpp: (WebCore::WebGLSampler::~WebGLSampler): (WebCore::WebGLSampler::deleteObjectImpl): * html/canvas/WebGLSampler.h: * html/canvas/WebGLSampler.idl: * html/canvas/WebGLShader.cpp: (WebCore::WebGLShader::~WebGLShader): (WebCore::WebGLShader::deleteObjectImpl): * html/canvas/WebGLShader.h: * html/canvas/WebGLShader.idl: * html/canvas/WebGLSharedObject.cpp: (WebCore::WebGLSharedObject::detachContextGroup): (WebCore::WebGLSharedObject::detachContextGroupWithoutDeletingObject): (WebCore::WebGLSharedObject::hasGroupOrContext const): (WebCore::WebGLSharedObject::objectGraphLockForContext): * html/canvas/WebGLSharedObject.h: * html/canvas/WebGLSync.cpp: (WebCore::WebGLSync::~WebGLSync): (WebCore::WebGLSync::deleteObjectImpl): * html/canvas/WebGLSync.h: * html/canvas/WebGLTexture.cpp: (WebCore::WebGLTexture::~WebGLTexture): (WebCore::WebGLTexture::deleteObjectImpl): * html/canvas/WebGLTexture.h: * html/canvas/WebGLTexture.idl: * html/canvas/WebGLTransformFeedback.cpp: (WebCore::WebGLTransformFeedback::~WebGLTransformFeedback): (WebCore::WebGLTransformFeedback::deleteObjectImpl): (WebCore::WebGLTransformFeedback::setProgram): (WebCore::WebGLTransformFeedback::setBoundIndexedTransformFeedbackBuffer): (WebCore::WebGLTransformFeedback::addMembersToOpaqueRoots): (WebCore::WebGLTransformFeedback::unbindBuffer): * html/canvas/WebGLTransformFeedback.h: * html/canvas/WebGLTransformFeedback.idl: * html/canvas/WebGLVertexArrayObject.cpp: (WebCore::WebGLVertexArrayObject::~WebGLVertexArrayObject): (WebCore::WebGLVertexArrayObject::deleteObjectImpl): * html/canvas/WebGLVertexArrayObject.h: * html/canvas/WebGLVertexArrayObject.idl: * html/canvas/WebGLVertexArrayObjectBase.cpp: (WebCore::WebGLVertexArrayObjectBase::setElementArrayBuffer): (WebCore::WebGLVertexArrayObjectBase::setVertexAttribState): (WebCore::WebGLVertexArrayObjectBase::unbindBuffer): (WebCore::WebGLVertexArrayObjectBase::addMembersToOpaqueRoots): * html/canvas/WebGLVertexArrayObjectBase.h: * html/canvas/WebGLVertexArrayObjectOES.cpp: (WebCore::WebGLVertexArrayObjectOES::~WebGLVertexArrayObjectOES): (WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl): * html/canvas/WebGLVertexArrayObjectOES.h: * html/canvas/WebGLVertexArrayObjectOES.idl: 2020-08-14 Andres Gonzalez <andresg_22@apple.com> Crash in WebCore::AXObjectCache::rangeMatchesTextNearRange. https://bugs.webkit.org/show_bug.cgi?id=215521 <rdar://problem/64773177> Reviewed by Chris Fleizach. The test accessibility/ios-simulator/text-marker-range-matches-text.html exercises this code path, but doesn't reproduce this crash. Added a check for nullity of the VisiblePositions before creating the SimpleRange. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::rangeMatchesTextNearRange): 2020-08-14 Chris Dumez <cdumez@apple.com> Add support for suspending / resuming an OfflineAudioContext https://bugs.webkit.org/show_bug.cgi?id=215417 Reviewed by Eric Carlson. Add support for suspending / resuming an OfflineAudioContext, as per: - https://www.w3.org/TR/webaudio/#dom-offlineaudiocontext-suspend - https://www.w3.org/TR/webaudio/#dom-offlineaudiocontext-resume Tests: webaudio/offlineaudiocontext-suspend-resume-basic.html webaudio/offlineaudiocontext-suspend-resume-eventhandler.html webaudio/offlineaudiocontext-suspend-resume-graph-manipulation.html webaudio/offlineaudiocontext-suspend-resume-promise.html webaudio/offlineaudiocontext-suspend-resume-sequence.html * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::didSuspendRendering): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::shouldSuspend): * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::uninitialize): (WebCore::OfflineAudioContext::startOfflineRendering): (WebCore::OfflineAudioContext::suspendOfflineRendering): (WebCore::OfflineAudioContext::resumeOfflineRendering): (WebCore::OfflineAudioContext::shouldSuspend): (WebCore::OfflineAudioContext::didSuspendRendering): (WebCore::OfflineAudioContext::didFinishOfflineRendering): * Modules/webaudio/OfflineAudioContext.h: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode): (WebCore::OfflineAudioDestinationNode::startRendering): (WebCore::OfflineAudioDestinationNode::offlineRender): * Modules/webaudio/OfflineAudioDestinationNode.h: 2020-08-14 Peng Liu <peng.liu6@apple.com> The PiP button on the fullscreen youtube player disappears after starting a new video in a playlist https://bugs.webkit.org/show_bug.cgi?id=215488 Reviewed by Eric Carlson. When a fullscreen video player (e.g., YouTube.com) completes the current video and starts the next one in a playlist, it may reuse the video element, so m_mediaElement of the PlaybackSessionModelMediaElement instance won't change. However, the video element will exit video fullscreen standby and then enter video fullscreen standby. Those transitions are invisible to users. But the corresponding PlaybackSessionModelContext instance will be destroyed and a new instance will be created. By default, the member variable m_pictureInPictureSupported of the PlaybackSessionModelContext instance is "false". After a new video starts to play, the function PlaybackSessionModelMediaElement::setMediaElement() won't ask the PlaybackSessionManager to send a PlaybackSessionManagerProxy::PictureInPictureSupportedChanged message (because we don't change m_mediaElement) to notify the PlaybackSessionModelContext instance in the UI process that m_pictureInPictureSupported should be "true". Therefore, the PlaybackSessionModelContext instance will tell the WKFullScreenViewController instance that picture-in-picture is not supported, which in turn will hide the picture-in-picture button. With this patch, PlaybackSessionModelMediaElement::setMediaElement() will ask the PlaybackSessionManager instance to send an IPC message if m_mediaElement is not nullptr even we don't change the media element. So that the PlaybackSessionModelContext instance in the UI process will always have a consistent state as the PlaybackSessionModelMediaElement instance in the Web process. * platform/cocoa/PlaybackSessionModelMediaElement.mm: (WebCore::PlaybackSessionModelMediaElement::setMediaElement): 2020-08-14 Clark Wang <clark_wang@apple.com> Introduce ConstantSourceNode Interface https://bugs.webkit.org/show_bug.cgi?id=215377 Reviewed by Chris Dumez. Introduced new ConstantSourceNode interface according to spec: https://www.w3.org/TR/webaudio/#ConstantSourceNode and with guidance from Chromium implementation: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/webaudio/constant_source_node.cc. Re-baselined existing tests. Some fail further, mainly due to lack of support for automation rate in AudioParam. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioNode.cpp: (WebCore::convertEnumerationToString): * Modules/webaudio/AudioNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createConstantSource): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/ConstantSourceNode.cpp: Added. (WebCore::ConstantSourceNode::create): (WebCore::ConstantSourceNode::ConstantSourceNode): (WebCore::ConstantSourceNode::~ConstantSourceNode): (WebCore::ConstantSourceNode::process): (WebCore::ConstantSourceNode::propagatesSilence const): * Modules/webaudio/ConstantSourceNode.h: Added. * Modules/webaudio/ConstantSourceNode.idl: Added. * Modules/webaudio/ConstantSourceOptions.h: Added. * Modules/webaudio/ConstantSourceOptions.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2020-08-14 Rob Buis <rbuis@igalia.com> Simplify FrameLoader::open https://bugs.webkit.org/show_bug.cgi?id=215505 Reviewed by Darin Adler. There is no need to set m_isComplete to false since the started() call a few lines below does the same thing. * loader/FrameLoader.cpp: (WebCore::FrameLoader::open): 2020-08-14 Rob Buis <rbuis@igalia.com> Simplify HTMLFrameElementBase::openURL https://bugs.webkit.org/show_bug.cgi?id=215504 Reviewed by Darin Adler. The expression effectively uses the indirection document -> frame -> document, but we can just use the document directly. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::openURL): 2020-08-14 Chris Dumez <cdumez@apple.com> Make sure OfflineAudioContext::startOfflineRendering() does lazy initialization https://bugs.webkit.org/show_bug.cgi?id=215481 Reviewed by Eric Carlson. Make sure OfflineAudioContext::startOfflineRendering() does lazy initialization before actually starting rendering. If lazy initialization has not happened yet (because no audio nodes were created for this context yet), then rendering would fail with an InvalidStateError, due to lack on initialization. No new tests, rebaselined existing tests. * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::startOfflineRendering): * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::offlineRender): 2020-08-14 Chris Dumez <cdumez@apple.com> Fix bad check in AudioBufferSourceNode::renderFromBuffer() https://bugs.webkit.org/show_bug.cgi?id=215513 Reviewed by Darin Adler. Fix bad check in AudioBufferSourceNode::renderFromBuffer() that is causing us to incorrectly output silence and failing many WPT tests. No new tests, rebaselined existing tests. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::renderFromBuffer): 2020-08-14 Chris Dumez <cdumez@apple.com> AudioBufferSourceNode.buffer setter should throw when the buffer was already set https://bugs.webkit.org/show_bug.cgi?id=215510 Reviewed by Darin Adler. AudioBufferSourceNode.buffer setter should throw when the buffer was already set: - https://www.w3.org/TR/webaudio/#dom-audiobuffersourcenode-buffer Note that the setter for the WebKit-prefixed AudioBufferSourceNode still does not throw, to ensure backward-compatibility. No new tests, rebaselined existing test. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::setBuffer): * Modules/webaudio/AudioBufferSourceNode.h: (WebCore::AudioBufferSourceNode::isWebKitAudioBufferSourceNode const): * Modules/webaudio/WebKitAudioBufferSourceNode.h: 2020-08-14 Wenson Hsieh <wenson_hsieh@apple.com> REGRESSION (r259184): Typing -- then Return into an email moves the selection by two lines https://bugs.webkit.org/show_bug.cgi?id=215491 <rdar://problem/66938121> Reviewed by Darin Adler. When inserting a newline after text that is about to be replaced (e.g. using smart dashes, or a system-wide text replacement), logic in `Editor::markAndReplaceFor` attempts to detect the fact that we've just inserted a new paragraph (setting `adjustSelectionForParagraphBoundaries` to `true`), and subsequently causes us to advance the selection forward by 1 character after we're done handling the text replacement. This logic appears to have been added to deal with the fact that prior to r259184, `TextIterator::subrange()` with a range that ended in a line break would not include the line break as a part of the resulting subrange. For instance, suppose we're inserting a newline after "--", text replacement has just run and replaced the two hyphens with a single dash (—), and there is a newline after the dash. The extended paragraph range consists of the dash, followed by the line break after it ("—\n"), with a `selectionOffset` of 2. The following code: `auto selectionRange = extendedParagraph.subrange({ 0, selectionOffset });` ...would compute a `selectionRange` that encompasses only the "—", despite a selection offset of 2, causing the following code to only move the selection to the end of the "—": `m_document.selection().moveTo(createLegacyEditingPosition(selectionRange.end), DOWNSTREAM);` This requires the logic in the `adjustSelectionForParagraphBoundaries` to subsequently move the selection to the line break, as the user would expect. However, after the changes in r259184, the subrange now (correctly) returns a range that starts before the "—" and ends at the following line break. However, this also means that the subsequent adjustment logic will cause us to advance unnecessarily! To fix this, we remove the `adjustSelectionForParagraphBoundaries` case altogether, since its only (apparent) purpose is to work around the fact that `TextIterator::subrange` didn't include trailing line breaks before r259184. Test: editing/spelling/text-replacement-after-typing-to-word.html * editing/Editor.cpp: (WebCore::Editor::markAndReplaceFor): 2020-08-14 Takeshi Kurosawa <taken.spc@gmail.com> @font-face font-weight descriptor should reject bolder and lighter https://bugs.webkit.org/show_bug.cgi?id=215359 Reviewed by Darin Adler. Both bolder and lighter are not allowed in font-weight descriptor. This patch splits font-weight descriptor parsers from font-weight property parsers. Tested by existing (formerly failing) test: web-platform-tests/css/css-fonts/variations/at-font-face-descriptors.html: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeFontWeightAbsoluteKeywordValue): (WebCore::consumeFontWeightAbsoluteRange): (WebCore::consumeFontWeightAbsolute): (WebCore::CSSPropertyParser::parseFontFaceDescriptor): (WebCore::consumeFontWeightRange): Deleted. 2020-08-14 Youenn Fablet <youenn@apple.com> WritableStreamDefaultWriterEnsureReadyPromiseRejected should create a new readPromise if the current readyPromise is not pending https://bugs.webkit.org/show_bug.cgi?id=215500 Reviewed by Geoffrey Garen. Create new promise if current is not pending. Also mark it as handled so that it does not end up call onunhandledrejection. Covered by rebased tests. * Modules/streams/WritableStreamInternals.js: (writableStreamDefaultWriterEnsureClosedPromiseRejected): 2020-08-13 Sergio Villar Senin <svillar@igalia.com> [WebXR] Implement WebXRSession::updateRenderState() https://bugs.webkit.org/show_bug.cgi?id=213555 Reviewed by Darin Adler. Added an implementation which matches the current specs. The updateRenderState() is specially useful to set the base layer in the session where WebXR contents would be rendered. Authors would normally do: glCanvas.getContext("webgl").makeXRCompatible().then(() => { xrSession.updateRenderState({ baseLayer: new XRWebGLLayer(xrSession, gl) }); }); The XRRenderStateInit has also been updated to the latest version of specs. * Modules/webxr/WebXRRenderState.cpp: (WebCore::WebXRRenderState::WebXRRenderState): (WebCore::WebXRRenderState::depthNear const): Inlined. (WebCore::WebXRRenderState::depthFar const): Ditto. (WebCore::WebXRRenderState::inlineVerticalFieldOfView const): Ditto. (WebCore::WebXRRenderState::baseLayer const): Ditto. * Modules/webxr/WebXRRenderState.h: (WebCore::WebXRRenderState::depthNear const): Inlined. (WebCore::WebXRRenderState::setDepthNear): Ditto. (WebCore::WebXRRenderState::depthFar const): Ditto. (WebCore::WebXRRenderState::setDepthFar): Ditto. (WebCore::WebXRRenderState::inlineVerticalFieldOfView const): Added. (WebCore::WebXRRenderState::setInlineVerticalFieldOfView): Ditto. (WebCore::WebXRRenderState::baseLayer const): Ditto. (WebCore::WebXRRenderState::setBaseLayer): Ditto. * Modules/webxr/WebXRSession.cpp: (WebCore::isImmersive): (WebCore::WebXRSession::updateRenderState): Implemented. (WebCore::WebXRSession::referenceSpaceIsSupported const): * Modules/webxr/WebXRSession.h: updateRenderState may throw exception. * Modules/webxr/WebXRSession.idl: Ditto. * Modules/webxr/WebXRWebGLLayer.h: (WebCore::WebXRWebGLLayer::session): Added. * Modules/webxr/XRRenderStateInit.h: Added layers and made many attributes optional. * Modules/webxr/XRRenderStateInit.idl: Ditto. 2020-08-13 Carlos Garcia Campos <cgarcia@igalia.com> REGRESSION(r254506): [Freetype] Spektra variable font does not work properly https://bugs.webkit.org/show_bug.cgi?id=215214 <rdar://problem/66984524> Reviewed by Adrian Perez de Castro. This regressed in r254506, when a font smoothing mode is passed to drawGlyphsToContext() a new cairo font options is set, using the default font options and changing the antialiasing. This means the font options from the font (the ones containing the variation settings) set in the context by cairo_set_scaled_font() are lost. We should copy the scaled font options instead, then set the antialiasing and apply them. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::drawGlyphsToContext): Use cairo_scaled_font_get_font_options() instead of getDefaultCairoFontOptions(). 2020-08-13 Carlos Garcia Campos <cgarcia@igalia.com> Crash in WebCore::StyledMarkupAccumulator::traverseNodesForSerialization https://bugs.webkit.org/show_bug.cgi?id=199224 Reviewed by Michael Catanzaro. The crash happens in StyledMarkupAccumulator::traverseNodesForSerialization() when we can't enter the node and nextSkippingChildren() returns nullptr. Test: editing/pasteboard/copy-across-shadow-boundaries-crash.html * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): Set next to pastEnd if nextSkippingChildren() returns nullptr. 2020-08-13 Andres Gonzalez <andresg_22@apple.com> VoiceOver not able to invoke play button on some web sites. https://bugs.webkit.org/show_bug.cgi?id=215484 <rdar://problem/62729643> Reviewed by Chris Fleizach. Test: accessibility/ios-simulator/has-touch-event-listener.html. We were checking for the presence of listeners for touchstart and touchend events only. Now we check for the presence of any touch-related event listener. * accessibility/ios/AccessibilityObjectIOS.mm: (WebCore::AccessibilityObject::hasTouchEventListener const): 2020-08-13 Dean Jackson <dino@apple.com> Pocket City game play area is blank (WebGL is broken in Catalyst) https://bugs.webkit.org/show_bug.cgi?id=215251 Follow-up review comments from Darin Adler. * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): 2020-08-13 Zalan Bujtas <zalan@apple.com> Add RenderTreeMutationDisallowedScope to track intrusive render tree mutations https://bugs.webkit.org/show_bug.cgi?id=215463 <rdar://problem/67012831> Reviewed by Simon Fraser. RenderLayer::enclosingScrollableLayer should not mutate the render tree accidentally. This is related to <rdar://problem/64739768>. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * rendering/RenderTreeMutationDisallowedScope.cpp: Added. * rendering/RenderTreeMutationDisallowedScope.h: Added. (WebCore::RenderTreeMutationDisallowedScope::RenderTreeMutationDisallowedScope): (WebCore::RenderTreeMutationDisallowedScope::~RenderTreeMutationDisallowedScope): (WebCore::RenderTreeMutationDisallowedScope::isMutationAllowed): * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::destroy): 2020-08-13 Chris Dumez <cdumez@apple.com> REGRESSION (r260684): Messages YouTube inline video: after Multitasking away and Back, Audio is heard but icon indicates "muted" https://bugs.webkit.org/show_bug.cgi?id=215453 <rdar://problem/66136673> Reviewed by Tim Horton. r260684 silenced all JS events during the snapshot sequence that occurs whenever the user homes out of Safari. This was meant to address compatibility with websites that did not expect various resize/orientationchange events when homing out. However, the snapshot sequence is fairly long and this was causing us to silence JS events which have nothing to do with the snapshot sequence, like window.postMessage()'s message events. This is what caused this regression. To address the issue, this patch basically reverts r260684 and deals with websites-compatibility issues via less risky site-specific and event-specific quirks: - We silence Window resize events on nytimes.com to address <rdar://problem/59763843>. - We silence Window resize events and MediaQueryList change events on twitter.com to address <rdar://problem/58804852> and <rdar://problem/61731801>. * css/MediaQueryMatcher.cpp: (WebCore::MediaQueryMatcher::evaluateAll): * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): * page/FrameView.cpp: (WebCore::FrameView::sendResizeEventIfNeeded): * page/Page.h: (WebCore::Page::isTakingSnapshotsForApplicationSuspension const): (WebCore::Page::setIsTakingSnapshotsForApplicationSuspension): (WebCore::Page::shouldFireEvents const): Deleted. (WebCore::Page::setShouldFireEvents): Deleted. * page/Quirks.cpp: (WebCore::Quirks::shouldSilenceWindowResizeEvents const): (WebCore::Quirks::shouldSilenceMediaQueryListChangeEvents const): * page/Quirks.h: 2020-08-13 Aditya Keerthi <akeerthi@apple.com> [macOS] Zoomed-in search field is clipped out https://bugs.webkit.org/show_bug.cgi?id=215428 <rdar://problem/66161781> Reviewed by Darin Adler. r257150 added support for painting large form controls using NSControlSizeLarge. However, RenderThemeMac::searchFieldSizes() still returned a height corresponding to NSControlSizeRegular rather than NSControlSizeLarge. This behavior causes the height of the layout rect to be smaller than the height of the painted cell, resulting in clipping. Returning the correct height in searchFieldSizes is not enough to solve the issue. Currently, the height of the layout rect is set before adjusting the font size of the corresponding RenderStyle. This is problematic as the initial font size could correspond to NSControlSizeRegular, but when adjusted for zoom, the font size could correspond to NSControlSizeLarge. To ensure that the font size and height correspond to the same control size, the font size is now adjusted prior to adjusting the height. Test: fast/forms/search/search-zoom-computed-style-height.html * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::searchFieldSizes const): Correct height for NSControlSizeLarge. (WebCore::RenderThemeMac::adjustSearchFieldStyle const): 2020-08-12 Myles C. Maxfield <mmaxfield@apple.com> Font loads quickly followed by navigations may fail indefinitely https://bugs.webkit.org/show_bug.cgi?id=215435 <rdar://problem/65560550> Reviewed by Darin Adler. Font loads are coalesced using a zero-delay timer. However, that zero-delay timer can fire while the page is in the middle of a navigation, which will cause the font loads to fail. Then, the second page can request those same fonts, which are marked as failed, and as such will never actually load/use the desired web font. This patch just stops the zero-delay timer during navigations, and resumes it when resuming the document. This means: 1. The second page in the above story will not see that the font has failed, or even started, and will then re-request the font and load it successfully 2. If the user goes "back" to the previous page, the zero-delay timer is restarted, the CachedFont realizes it's already succeeded, and the previous page is rendered as expected. Test: fast/loader/font-load-timer.html * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::suspendFontLoadingTimer): (WebCore::CSSFontSelector::restartFontLoadingTimer): * css/CSSFontSelector.h: * dom/Document.cpp: (WebCore::Document::resume): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::stopLoading): 2020-08-12 Lauro Moura <lmoura@igalia.com> Highpass Biquads use old formulas https://bugs.webkit.org/show_bug.cgi?id=181191 Reviewed by Darin Adler. Like r265517, but for the highpass filter. Spec: https://www.w3.org/TR/webaudio/#dom-biquadfiltertype-highpass Covered by existing tests * platform/audio/Biquad.cpp: (WebCore::Biquad::setHighpassParams): 2020-08-12 Dean Jackson <dino@apple.com> First search on Google Maps shows black bar at top of map and blank strips through the middle https://bugs.webkit.org/show_bug.cgi?id=214945 <rdar://problem/63374422> Reviewed by Tim Horton. On iOS with an attached keyboard, Google Maps appears to calculate the viewport it will use for map display at a time when the Unified Control Bar (keyboard accessories) is visible. If it then changes the map location via the user submitting a search form, the resulting map will be using the incorrect viewport as the control bar has disappeared. This causes parts of the map display to get the wrong stencil masks, leaving blank strips. This fixes itself as soon as you force the map to recalculate its viewport (e.g. by rotating the device). Rather than have Google Maps update its code to detect these viewport changes, we're adding a Quirk to not use the control bar in these calculations. * page/Quirks.cpp: (WebCore::Quirks::shouldAvoidResizingWhenInputViewBoundsChange const): Return true for "*.google.com/maps/". 2020-08-12 Ryosuke Niwa <rniwa@webkit.org> Add my new Twitter handle to the feature status page https://bugs.webkit.org/show_bug.cgi?id=215429 Reviewed by Chris Dumez. rniwa_dev is my new Twitter handle. * features.json: 2020-08-12 Stephan Szabo <stephan.szabo@sony.com> [PlayStation] Build fix for !ENABLE(ACCESSIBILITY) after r265514 https://bugs.webkit.org/show_bug.cgi?id=215426 AXObjectCache::getOrCreate(AccessibilityRole) changed names in the above, but the short definition for !ENABLE(ACCESSIBILITY) didn't update. Unreviewed build fix. * accessibility/AXObjectCache.h: Update name to match new name 2020-08-12 Peng Liu <peng.liu6@apple.com> Add the support to return to element fullscreen from picture-in-picture https://bugs.webkit.org/show_bug.cgi?id=215305 Reviewed by Jer Noble. When a container element enters fullscreen (with the fullscreen API), a descendant video element will enter the video fullscreen standby state so that it can enter picture-in-picture on application suspend (r226217). But we cannot restore to that state from the picture-in-picture mode when we click the "restore" button on the top-right corner of the PiP window. Instead, the video element will return to the inline mode. However, when a video element enters video fullscreen first and then enters picture-in-picture, we can let the video restore to fullscreen by clicking the "restore" button on the top-right corner of the picture-in-picture window. The inconsistent behaviors may confuse users who are not aware of the difference between the fullscreen API (or element fullscreen) and video fullscreen. This patch enables the support to restore to element fullscreen from picture-in-picture mode so that users can have a consistent experience on element fullscreen and video fullscreen. * dom/FullscreenManager.h: Export requestFullscreenForElement() so that we can use it in WebKit code. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::enterFullscreen): (WebCore::HTMLMediaElement::prepareForVideoFullscreenStandby): * html/HTMLMediaElement.h: * page/ChromeClient.h: (WebCore::ChromeClient::prepareForVideoFullscreen): Add the interface to request a video element to be prepared for the video fullscreen standby state. * platform/cocoa/VideoFullscreenChangeObserver.h: Add prepareToExitFullscreen() and fullscreenWillReturnToInline(). * platform/cocoa/VideoFullscreenModel.h: (WebCore::VideoFullscreenModelClient::hasVideoChanged): (WebCore::VideoFullscreenModelClient::videoDimensionsChanged): (WebCore::VideoFullscreenModelClient::prepareToExitPictureInPicture): Some minor clean-ups and add function prepareToExitPictureInPicture(). * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::cleanupFullscreen): (VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStop): (VideoFullscreenInterfaceAVKit::didStartPictureInPicture): (VideoFullscreenInterfaceAVKit::willStopPictureInPicture): (VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler): (VideoFullscreenInterfaceAVKit::setReadyToStopPictureInPicture): (VideoFullscreenInterfaceAVKit::willEnterStandbyFromPictureInPicture): (VideoFullscreenInterfaceAVKit::setWillEnterStandbyFromPictureInPicture): (VideoFullscreenInterfaceAVKit::fullscreenMayReturnToInline): Deleted. When we enter picture-in-picture, we need to save the state and be prepared to restore to element fullscreen if needed. Before we exit picture-in-picture, if the "restore" button is clicked, we need to notify the client to prepare for the picture-in-picture stop, and call VideoFullscreenInterfaceAVKit::setReadyToStopPictureInPicture(true) when the client is ready. Based on those changes, a client (e.g., WKFullScreenWindowControllerVideoFullscreenModelClient) can coordinate with WKFullScreenWindowController to implement the "restore to element fullscreen" feature. * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::fullscreenWillReturnToInline): (VideoFullscreenControllerContext::fullscreenMayReturnToInline): Deleted. 2020-08-12 Wenson Hsieh <wenson_hsieh@apple.com> Broken formatting in price table on yandex.ru after translating to English https://bugs.webkit.org/show_bug.cgi?id=215416 <rdar://problem/66354018> Reviewed by Tim Horton. Extend the behavior added in r265188 so that it applies to all elements that have `display: table-cell;`, rather than only table data cell elements. * editing/TextManipulationController.cpp: (WebCore::isEnclosingItemBoundaryElement): 2020-08-12 Adrian Perez de Castro <aperez@igalia.com> Unreviewed non-unified build fix. No new tests needed. * accessibility/AccessibilityMenuListOption.cpp: Add missing inclusion of HTMLSelectElement.h. * page/Quirks.h: Add mising forward declaration of HTMLVideoElement. * page/UndoItem.cpp: Add missing inclusion of Document.h. 2020-08-12 Chris Dumez <cdumez@apple.com> Unreviewed, address post-landing review comment from Sam Weinig for r265536. * Modules/webaudio/WaveShaperDSPKernel.cpp: (WebCore::WaveShaperDSPKernel::processCurve): 2020-08-12 Sergio Villar Senin <svillar@igalia.com> Unreviewed build fix after r265546. The <Ref.h> include should be now in the header now that we've inlined the create() function. * Modules/webxr/WebXRInputSourceArray.cpp: Removed include. * Modules/webxr/WebXRInputSourceArray.h: Added include 2020-08-12 Youenn Fablet <youenn@apple.com> Refresh WritableStream up to spec https://bugs.webkit.org/show_bug.cgi?id=215267 Reviewed by Geoff Garen. Update according latest spec, including WebIDL, controller and writer. Covered by rebased tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/streams/StreamInternals.js: * Modules/streams/WritableStream.idl: * Modules/streams/WritableStream.js: * Modules/streams/WritableStreamDefaultController.idl: Added. * Modules/streams/WritableStreamDefaultController.js: Added. * Modules/streams/WritableStreamDefaultWriter.idl: Added. * Modules/streams/WritableStreamDefaultWriter.js: Added. * Modules/streams/WritableStreamInternals.js: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2020-08-06 Sergio Villar Senin <svillar@igalia.com> [WebXR] Update WebXR WPT directory https://bugs.webkit.org/show_bug.cgi?id=215224 Reviewed by Youenn Fablet. The update of the WebXR WPT directory helped us to unveil a couple of mistakes in the current code. First of all the Events defined in the WebXR spec had to be iso allocated as the Event base class. Secondly the WebXRInputSourceArray must have a ::create() method. Finally the m_inputSources attribute of the WebXRSession must be a Ref instead of a RefPtr because the specs mention that the initial value is an empty array. Tests: imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_create_move.https.html imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_delay_creation.https.html imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_failure.https.html imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_freefloating_pause_resume_stop.https.html imported/w3c/web-platform-tests/webxr/anchors/ar_anchor_states.https.html imported/w3c/web-platform-tests/webxr/anchors/idlharness.https.window.html imported/w3c/web-platform-tests/webxr/dom-overlay/ar_dom_overlay_hit_test.https.html imported/w3c/web-platform-tests/webxr/dom-overlay/idlharness.https.window.html imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_inputSources.https.html imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_regular.https.html imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_states_transient.https.html imported/w3c/web-platform-tests/webxr/hit-test/ar_hittest_subscription_transientInputSources.https.html imported/w3c/web-platform-tests/webxr/hit-test/idlharness.https.html imported/w3c/web-platform-tests/webxr/render_state_update.https.html imported/w3c/web-platform-tests/webxr/webGLCanvasContext_makecompatible_reentrant.https.html imported/w3c/web-platform-tests/webxr/xrReferenceSpace_relationships.https.html * Modules/webxr/WebXRInputSourceArray.cpp: (WebCore::WebXRInputSourceArray::create): Added. * Modules/webxr/WebXRInputSourceArray.h: * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::WebXRSession): Initialize the m_inputSources. (WebCore::WebXRSession::inputSources const): Return a const reference. * Modules/webxr/WebXRSession.h: * Modules/webxr/XRInputSourcesChangeEvent.cpp: Make it iso allocated. * Modules/webxr/XRInputSourcesChangeEvent.h: Ditto. * Modules/webxr/XRSessionEvent.cpp: Ditto. * Modules/webxr/XRSessionEvent.h: Ditto. 2020-08-12 Antti Koivisto <antti@apple.com> REGRESSION (r259805): Not able to scroll vertically after scrolling horizontally without leaving message and coming back https://bugs.webkit.org/show_bug.cgi?id=215374 <rdar://problem/65269837> Reviewed by Darin Adler. The content has a horizontally scrolling overflow. While rubberbanding it we mark a wheel event unhandled which causes Mail to take over event handling and leaves us semi-permanently in stretched state. * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): Dissallowed vertical stretch would mark the event unhandled even though we are rubberbanding in horizontal direction. Only mark a wheel event unhandled if it actually concerns the tested direction. 2020-08-12 Chris Lord <clord@igalia.com> Implement Canvas.transferControlToOffscreen and OffscreenCanvasRenderingContext2D.commit https://bugs.webkit.org/show_bug.cgi?id=202797 Reviewed by Dean Jackson. Implement HTMLCanvasElement.transferControlToOffscreen and OffscreenCanvasRenderingContext2D.commit. This allows for (synchronous) display of asynchronously rendered OffscreenCanvas content. No new tests. Covered by existing tests. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::setHeight): (WebCore::HTMLCanvasElement::setWidth): (WebCore::HTMLCanvasElement::reset): (WebCore::HTMLCanvasElement::transferControlToOffscreen): (WebCore::HTMLCanvasElement::setImageBufferAndMarkDirty): (WebCore::HTMLCanvasElement::isControlledByOffscreen const): * html/HTMLCanvasElement.h: * html/HTMLCanvasElement.idl: * html/OffscreenCanvas.cpp: (WebCore::DetachedOffscreenCanvas::takePlaceholderCanvas): (WebCore::OffscreenCanvas::create): (WebCore::OffscreenCanvas::getContext): (WebCore::OffscreenCanvas::didDraw): (WebCore::OffscreenCanvas::detach): (WebCore::OffscreenCanvas::setPlaceholderCanvas): (WebCore::OffscreenCanvas::pushBufferToPlaceholder): (WebCore::OffscreenCanvas::commitToPlaceholderCanvas): (WebCore::OffscreenCanvas::scheduleCommitToPlaceholderCanvas): (WebCore::OffscreenCanvas::reset): * html/OffscreenCanvas.h: * html/canvas/OffscreenCanvasRenderingContext2D.cpp: (WebCore::OffscreenCanvasRenderingContext2D::commit): * html/canvas/OffscreenCanvasRenderingContext2D.h: * html/canvas/OffscreenCanvasRenderingContext2D.idl: * html/canvas/PlaceholderRenderingContext.cpp: (WebCore::PlaceholderRenderingContext::canvas const): * html/canvas/PlaceholderRenderingContext.h: 2020-08-12 Carlos Garcia Campos <cgarcia@igalia.com> REGRESSION(r261570): [GTK] Fails to send drop event to JavaScript https://bugs.webkit.org/show_bug.cgi?id=215032 Reviewed by Darin Adler. Add support for custom data in drag and drop operations too. * platform/gtk/PasteboardGtk.cpp: (WebCore::Pasteboard::write): Se custom data on m_selectionData. (WebCore::Pasteboard::read): Initialize the content origin also for drag and drop pasteboards. (WebCore::Pasteboard::hasData): For drag and drop pasteboards return true also if m_selectionData has custom data. (WebCore::Pasteboard::typesSafeForBindings): Implement this for drag and drop pasteboards. (WebCore::Pasteboard::readOrigin): Ditto. (WebCore::Pasteboard::readStringInCustomData): Ditto. (WebCore::Pasteboard::writeCustomData): Ditto. 2020-08-11 James Darpinian <jdarpinian@chromium.org> [WebGL2] Depth formats can have mipmaps in WebGL 2 https://bugs.webkit.org/show_bug.cgi?id=215404 Reviewed by Kenneth Russell. Fixes 150 WebGL 2 conformance tests. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::validateTexFuncFormatAndType): 2020-08-11 Chris Dumez <cdumez@apple.com> Unreviewed, address post-landing review comment from Darin for r265536. * Modules/webaudio/WaveShaperDSPKernel.cpp: (WebCore::WaveShaperDSPKernel::processCurve): 2020-08-11 Chris Dumez <cdumez@apple.com> Fix WaveShapperNode's waveshaping curve implementation https://bugs.webkit.org/show_bug.cgi?id=215391 Reviewed by Darin Adler. Fix WaveShapperNode's waveshaping curve implementation using the algorithm in the specification: - https://www.w3.org/TR/webaudio/#dom-waveshapernode-curve No new tests, rebaselined existing tests. * Modules/webaudio/WaveShaperDSPKernel.cpp: (WebCore::WaveShaperDSPKernel::processCurve): 2020-08-11 Simon Fraser <simon.fraser@apple.com> Have render tree dumps show overflow information https://bugs.webkit.org/show_bug.cgi?id=215385 Reviewed by Zalan Bujtas. Add code to RenderObject::outputRenderObject() to show layout/visual overflow, as we do for render tree dumps. * rendering/RenderObject.cpp: (WebCore::RenderObject::outputRenderObject const): 2020-08-11 Brady Eidson <beidson@apple.com> Add a "use stored credentials" setting to WKWebView. <rdar://problem/63308019> and https://bugs.webkit.org/show_bug.cgi?id=215388 Reviewed by Geoff Garen. Covered by Preconnect API tests. This setting is to allow apps to explicitly deny using the credential storage for network operations. (e.g. to make sure the Keychain UI doesn't pop up for an offscreen load) * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::shouldUseCredentialStorage): * page/Page.h: (WebCore::Page::setCanUseCredentialStorage): (WebCore::Page::canUseCredentialStorage const): 2020-08-11 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r265502. https://bugs.webkit.org/show_bug.cgi?id=215396 Needs locking to avoid flaky GC-related crashes Reverted changeset: "[WebGL2] expando-loss and expando-loss-2 conformance tests are failing" https://bugs.webkit.org/show_bug.cgi?id=214765 https://trac.webkit.org/changeset/265502 2020-08-11 Jon Davis <jond@apple.com> Add privacy and security keywords to feature status entries https://bugs.webkit.org/show_bug.cgi?id=215203 Reviewed by Youenn Fablet. * features.json: 2020-08-11 Chris Dumez <cdumez@apple.com> Fix BiquadFilterNode's lowpass filter https://bugs.webkit.org/show_bug.cgi?id=215381 Reviewed by Darin Adler. Fix BiquadFilterNode's lowpass filter as it was causing us to fail a WPT test: - https://www.w3.org/TR/webaudio/#dom-biquadfiltertype-lowpass No new tests, rebaselined existing test. * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::BiquadProcessor): * platform/audio/Biquad.cpp: (WebCore::Biquad::setLowpassParams): 2020-08-11 Darin Adler <darin@apple.com> LayoutTest accessibility/mac/select-element-selection-with-optgroups.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=175341 Reviewed by Chris Fleizach. Failures were due to new AX objects being created for HTMLOptionElement. Unlike most other AX objects, these were not cached in the AXObjectCache and multiple objects could be created for the same underlying option. Fixed this by changing it to track the option element in the cache in the conventional way. * WebCore.xcodeproj/project.pbxproj: Remove AccessibilityMediaControls.h/cpp. The source files were removed back in April. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::getOrCreate): Added code for HTMLOptionElement and HTMLOptGroupElement so AccessibilityMenuListOption and AccessibilityListBoxOption can be created in this function. (WebCore::AXObjectCache::create): Renamed the version of this that takes an AccessibilityRole to not claim that it ever gets the value from the cache, because it never does. Also removed the cases for ListBoxOption and MenuListOption. * accessibility/AXObjectCache.h: Updated for above. * accessibility/AccessibilityARIAGrid.cpp: (WebCore::AccessibilityARIAGrid::addChildren): Use create. * accessibility/AccessibilityListBox.cpp: (WebCore::AccessibilityListBox::addChildren): Removed super-old comment that mentions the long-ago-removed WML. (WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject const): Use the element to get the list box option rather than creating a new one every time. No longer any need to special case <hr> elements since the getOrCreate function will return nil for non-option elements that don't have a renderer. * accessibility/AccessibilityListBoxOption.cpp: (WebCore::AccessibilityListBoxOption::AccessibilityListBoxOption): Take the element in the constructor instead of using a separate function to associate it. (WebCore::AccessibilityListBoxOption::create): Ditto. (WebCore::AccessibilityListBoxOption::isEnabled const): Update for WeakPtr. (WebCore::AccessibilityListBoxOption::isSelected const): Ditto. (WebCore::AccessibilityListBoxOption::canSetSelectedAttribute const): Ditto. (WebCore::AccessibilityListBoxOption::actionElement const): Update for WeakPtr. (WebCore::AccessibilityListBoxOption::node const): Added. For some reason the AccessibilityMenuListOption class had this function and this one did not. They should both have it. * accessibility/AccessibilityListBoxOption.h: Updated for above. Made most functions private and final. Fixed includes and forward declarations. Removed the setHTMLElement function. Changed m_optionElement from HTMLElement* to WeakPtr<HTMLElement>. * accessibility/AccessibilityMenuList.cpp: (WebCore::AccessibilityMenuList::addChildren): Use create. * accessibility/AccessibilityMenuListOption.cpp: (WebCore::AccessibilityMenuListOption::AccessibilityMenuListOption): Take the element in the constructor instead of using a separate function to associate it. (WebCore::AccessibilityMenuListOption::create): Ditto. (WebCore::AccessibilityMenuListOption::setElement): Deleted. (WebCore::AccessibilityMenuListOption::node const): Moved here from the header. (WebCore::AccessibilityMenuListOption::isEnabled const): Removed unneeded cast now that m_element has a more specific type, and added a null check. (WebCore::AccessibilityMenuListOption::isVisible const): Removed dependency on m_parent pointer, which does not exist now that we don't derive from AccessibilityMockObject. (WebCore::AccessibilityMenuListOption::isSelected const): Removed unneeded cast now that m_element has a more specific type, and added a null check. (WebCore::AccessibilityMenuListOption::setSelected): Ditto, but no null check needed because canSetSelectedAttribute takes care of that. (WebCore::AccessibilityMenuListOption::stringValue const): Ditto. * accessibility/AccessibilityMenuListOption.h: Updated for above. Marked functions final instead of override. Changed m_element from RefPtr<HTMLElement> to WeakPtr<HTMLOptionElement> to avoid reference cycles that could leak to memory leaks. Derive from AccessibilityObject instead of AccessibilityMockObject, since the latter class has nothing to offer us. * accessibility/AccessibilityMenuListPopup.cpp: (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject const): Use the element to get the menu list option rather than creating a new one every time. No longer any need to check that the type is HTMLOptionElement because that's the responsibility of the code in the cache now. (WebCore::AccessibilityMenuListPopup::addChildren): Removed unneeded call to setParent since the menu list option objects no longer hold parent pointers. * accessibility/AccessibilityNodeObject.cpp: (WebCore::accessibleNameForNode): Added a special case for HTMLOptionElement like the one for HTMLInputElement. The code worked for fairly well for option elements before, almost by accident, and the way it worked was perturbed by the change to whether we cache those objects. This newer code path works in a more straightforward way, keeps our existing tests psasing, and likely gets some edge cases handled more correctly (should add new tests for those). * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::documentLinks): Use create. (WebCore::AccessibilityRenderObject::addImageMapChildren): Ditto. (WebCore::AccessibilityRenderObject::addTextFieldChildren): Ditto. * accessibility/AccessibilitySlider.cpp: (WebCore::AccessibilitySlider::addChildren): Ditto. * accessibility/AccessibilitySpinButton.cpp: (WebCore::AccessibilitySpinButton::addChildren): Ditto. * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::addChildren): Ditto. (WebCore::AccessibilityTable::headerContainer): Ditto. * accessibility/atk/WebKitAccessible.cpp: (fallbackObject): Deleted. (webkitAccessibleGetName): Added null check. (webkitAccessibleGetDescription): Ditto. (webkitAccessibleGetParent): Ditto. (webkitAccessibleGetNChildren): Ditto. (webkitAccessibleRefChild): Ditto. (webkitAccessibleGetIndexInParent): Ditto. (webkitAccessibleGetAttributes): Ditto. (webkitAccessibleGetRole): Ditto. (webkitAccessibleRefStateSet): Ditto. (webkitAccessibleRefRelationSet): Ditto. (webkitAccessibleGetObjectLocale): Ditto. (webkitAccessibleGetAccessibilityObject): Ditto. (webkitAccessibleDetach): Use nullptr instead of fallbackObject. (webkitAccessibleIsDetached): Ditto. * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::selected const): Made this const. An earlier version of the patch required this; the latest version doesn't, but it's more logical and better for it to be const. * html/HTMLOptionElement.h: Updated for above. 2020-08-11 Timothy Hatcher <timothy@apple.com> Deferred WKUserScripts are exponentially injected on preloaded pages with frames. https://bugs.webkit.org/show_bug.cgi?id=215382 rdar://problem/66837802 Reviewed by Sam Weinig. When defering a script in a frame it was previously added to a vector per-page. Later when notified to inject the defered scripts, the page would iterate over all the frames and evaluate the scripts on each frame. Since this vector had all the frame's scripts the evaluations would be multiplied by the number of frames. Now the defered scripts are stored per-frame and the page asks each frame to inject the defered scripts. * page/Frame.cpp: (WebCore::Frame::injectUserScripts): (WebCore::Frame::addUserScriptAwaitingNotification): (WebCore::Frame::injectUserScriptsAwaitingNotification): * page/Frame.h: * page/Page.cpp: (WebCore::Page::notifyToInjectUserScripts): (WebCore::Page::addUserScriptAwaitingNotification): Deleted. * page/Page.h: * page/Quirks.cpp: (WebCore::Quirks::triggerOptionalStorageAccessQuirk const): 2020-08-11 Wenson Hsieh <wenson_hsieh@apple.com> Text input autocorrect="off" attribute ignored on Mac https://bugs.webkit.org/show_bug.cgi?id=151019 <rdar://problem/65061700> Reviewed by Simon Fraser. Add support for the `autocorrect` attribute on macOS, by not showing the automatic spell checking popup or automatically correcting misspelled words if the root editable element has `autocorrect="off"`. Tests: editing/input/cocoa/autocorrect-off.html editing/input/cocoa/autocorrect-on.html * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::isAutomaticSpellingCorrectionEnabled): 2020-08-11 Sihui Liu <sihui_liu@apple.com> Text manipulation crashes when replacing element with img role https://bugs.webkit.org/show_bug.cgi?id=215344 Reviewed by Wenson Hsieh. positionInParentAfterNode and positionInParentBeforeNode do not return Position with Nodes that are ignored by editing. Element with img role is one of such Nodes. However, TextManipulationController can manipulate content of children of the ignored Nodes (see the newly added test). Therefore, we'd better not use positionInParentBeforeNode or positionInParentBeforeNode in TextManipulationController::replace, because insertion position can be inside a ignored Node. API Test: TextManipulation.CompleteTextManipulationShouldReplaceContentIgnoredByEditing * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::replace): 2020-08-11 Kenneth Russell <kbr@chromium.org> [WebGL2] expando-loss and expando-loss-2 conformance tests are failing https://bugs.webkit.org/show_bug.cgi?id=214765 Reviewed by Darin Adler. Use JSWebGLRenderingContext's and JSWebGL2RenderingContext's existing visitAdditionalChildren hook (via JSCustomMarkFunction in their IDL) to add opaque roots for all WebGLObjects latched in to the context state, and all WebGLObjects they refer to. (Extensions were already previously handled.) Add "GenerateIsReachable=Impl" to the IDL files for all such objects (WebGLBuffer, WebGLTexture, etc.) so that they pay attention to the opaque root state when determining liveness of their JavaScript wrappers. Thanks to ysuzuki@ for pointing out the need for this. * bindings/js/JSWebGL2RenderingContextCustom.cpp: (WebCore::JSWebGL2RenderingContext::visitAdditionalChildren): * bindings/js/JSWebGLRenderingContextCustom.cpp: (WebCore::JSWebGLRenderingContext::visitAdditionalChildren): * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::visitReferencedJSWrappers): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLBuffer.idl: * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::visitReferencedJSWrappers): * html/canvas/WebGLFramebuffer.h: * html/canvas/WebGLFramebuffer.idl: * html/canvas/WebGLProgram.cpp: (WebCore::WebGLProgram::visitReferencedJSWrappers): * html/canvas/WebGLProgram.h: * html/canvas/WebGLProgram.idl: * html/canvas/WebGLQuery.idl: * html/canvas/WebGLRenderbuffer.idl: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::visitReferencedJSWrappers): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLSampler.idl: * html/canvas/WebGLShader.idl: * html/canvas/WebGLTexture.idl: * html/canvas/WebGLTransformFeedback.cpp: (WebCore::WebGLTransformFeedback::visitReferencedJSWrappers): * html/canvas/WebGLTransformFeedback.h: * html/canvas/WebGLTransformFeedback.idl: * html/canvas/WebGLVertexArrayObject.idl: * html/canvas/WebGLVertexArrayObjectBase.cpp: (WebCore::WebGLVertexArrayObjectBase::visitReferencedJSWrappers): * html/canvas/WebGLVertexArrayObjectBase.h: * html/canvas/WebGLVertexArrayObjectOES.idl: 2020-08-11 Youenn Fablet <youenn@apple.com> Add JS console log message in case of capture failure https://bugs.webkit.org/show_bug.cgi?id=215370 Reviewed by Eric Carlson. Covered by rebased test. * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::trackEnded): 2020-08-11 Zalan Bujtas <zalan@apple.com> [AutoTableLayout] REGRESSION(r263855) Paypal email is rendered right aligned on Safari https://bugs.webkit.org/show_bug.cgi?id=215340 <rdar://problem/66540254> Reviewed by Simon Fraser. Prior to r263855, these zero-length, non-empty columns had the preferred width value of 1px and the available space got distributed based on this made-up 1px value. In this patch, we distribute the available horizontal space evenly among these zero-length, 'width: auto' columns. Test: fast/table/zero-length-non-empty-columns-with-auto-width.html * rendering/AutoTableLayout.cpp: (WebCore::AutoTableLayout::layout): 2020-08-11 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] Only update the intrinsic height if we don't have an override height https://bugs.webkit.org/show_bug.cgi?id=215369 Reviewed by Javier Fernandez. If we do have an override height, children will size themselves relative to the override height (e.g. flexbox flexing/stretching, percentage heights). Because flex intrinsic height is based on its children, it would then store an incorrect intrinsic height. This is specially problematic with min-height:auto is nested column flexboxes where flexboxes are flex items at the same time. Based on Blink's https://crrev.com/c/1283482 by <cbiesinger@chromium.org> * rendering/RenderBox.cpp: (WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem const): Early return if there is an override height. 2020-08-11 Andres Gonzalez <andresg_22@apple.com> Update the isolated tree on element language changes. https://bugs.webkit.org/show_bug.cgi?id=215354 <rdar://problem/65583698> Reviewed by Chris Fleizach. Test: accessibility/language-attribute-change.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAttributeChange): Added handling of AXLanguageChanged notifications. (WebCore::AXObjectCache::updateIsolatedTree): Update the isolated tree for ASLanguage notifications. * accessibility/AXObjectCache.h: 2020-08-11 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Remove m_sourceBufferPrivateClient checks in SourceBufferPrivateGStreamer https://bugs.webkit.org/show_bug.cgi?id=215263 Reviewed by Xabier Rodriguez-Calvar. m_sourceBufferPrivateClient is only reset to NULL from SourceBuffer's destructor. At this point SourceBufferPrivateGStreamer is about to receive its last unref by SourceBuffer and therefore be destroyed. Similarly, there is no need to check for m_mediaSource being null. m_mediaSource is only reset when the SourceBuffer is removed, and at that point SourceBufferPrivate shouldn't receive any calls. This is a clean-up and doesn't introduce new behavior. Asserts have been added checking the precondition above. * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource): (WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment): (WebCore::SourceBufferPrivateGStreamer::didReceiveSample): (WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples): (WebCore::SourceBufferPrivateGStreamer::appendParsingFailed): 2020-08-11 Philippe Normand <pnormand@igalia.com> [GStreamer] gst-full standalone library support https://bugs.webkit.org/show_bug.cgi?id=215262 Reviewed by Xabier Rodriguez-Calvar. A new CMake option is introduced to enable gst-full support: USE_GSTREAMER_FULL. By default this option is disabled. WebKit distributors might want to enable this if they distribute GStreamer through gst-build's gst-full library. In gst-build the following options can be used to produce a usable libgstreamer-full-1.0.so: -Dpython=disabled -Dges=disabled -Ddevtools=disabled -Dintrospection=disabled -Ddefault_library=static Once enabled in our build, the dynamic library libgstreamer-full-1.0.so will be loaded instead of all the other GStreamer libraries. Plugins are statically registered in this library as well. This can be useful when deploying WebKit in controlled embedded platform where disk space is limited. One of the goals of gst-full is to enable full customization of the plugins to be included in the library. Static registration can also reduce GStreamer initialization time. * platform/GStreamer.cmake: * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::initializeGStreamer): (WebCore::initializeGStreamerAndRegisterWebKitElements): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Disable missing-plugins handling when gst-full is in use. The plugin installer doesn't make much sense for this scenario. 2020-08-10 Myles C. Maxfield <mmaxfield@apple.com> Fix bad merge in r265488 https://bugs.webkit.org/show_bug.cgi?id=214769 Unreviewed. This is something that got dropped in a bad merge from r265488. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::layoutSimpleText const): * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::originAt const): (WebCore::GlyphBuffer::expandInitialAdvance): 2020-08-10 Myles C. Maxfield <mmaxfield@apple.com> Spacing of Chinese characters is inconsistent in macOS 11/Safari 14 beta https://bugs.webkit.org/show_bug.cgi?id=214769 Reviewed by Darin Adler. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=206208.. In the general case, text shaping is Turing-complete. In order for it to work properly, we need to feed the text shaping virtual machine the correct inputs so that it can produce correct outputs. The input to text shaping is supposed to be the raw glyph advances straight from CTFontGetAdvancesForGlyphs(). Previously, we were applying letter-spacing, word-spacing, justification, and tab stops before shaping. Most fonts don't care about this and still produce the correct results. However, Ping Fang on macOS Big Sur and iOS 14 _does_ care about this, and its shaping rules operate incorrectly when fed these pre-expanded glyph widths. The solution is to apply this extra spacing after shaping occurs. However, because shaping is Turing-complete, it is free to add or remove glyphs willy-nilly. This means we need some way of tracing back which character in the input string correspond to which output glyphs, so we know which glyphs to add additional spacing to. This is what https://bugs.webkit.org/show_bug.cgi?id=215059 does: It switches from using CTFontTransformGlyphsWithLanguage() to CTFontShapeGlyphs(), which outputs this glyph-character tracing info. Then, once we have this tracing info, we can apply spacing properly after shaping has completed. That's what this patch does. Tests: fast/text/letter-spacing-shaping.html fast/text/tab-letter-space.html * platform/graphics/FontCascade.cpp: Clients of WidthIterator::advance() need to call WidthIterator::finalize() (see below). (WebCore::FontCascade::widthOfTextRange const): (WebCore::FontCascade::layoutSimpleText const): (WebCore::FontCascade::floatWidthForSimpleText const): (WebCore::FontCascade::adjustSelectionRectForSimpleText const): (WebCore::FontCascade::offsetForPositionForSimpleText const): * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::expandInitialAdvance): (WebCore::GlyphBuffer::expandAdvance): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::WidthIterator): (WebCore::WidthIterator::hasExtraSpacing const): (WebCore::WidthIterator::advanceInternal): Delete the code that used to apply spacing before shaping. Instead, it gets moved to applyExtraSpacingAfterShaping(). (WebCore::WidthIterator::calculateAdditionalWidth const): This is a refactoring of the additional space calculation code. This is a const function, and has no side-effects. It outputs 4 floats: - How much space needs to be added to the left of the current character - How much space needs to be added to the right of the current character - How much space needs to be added to the left of the current character due to justification - How much space needs to be added to the right of the current character due to justification We need these last two values because one of the outputs of WidthIterator::advance() is a bool which represents whether or not we are ending on a justification space, so that the next WidthIterator that gets created for the next thing on the line can forbid/require a leading justification appropriately. (WebCore::WidthIterator::applyAdditionalWidth): Given the 4 values calculated in calculateAdditionalWidth(), apply them. We're operating in logical order, so this function has to do some translation from visual order to logical order (hence all the m_run.ltr() calls). If we're trying to add size to the left of the first character in LTR, we can't directly do that, because advances can only add space to the right side of a character, and there is no character to the left of the first character to expand. Therefore, we do this by increasing the initial advance of the GlyphBuffer, which is a special advance created just to solve this problem. In RTL, the problem is a bit more complicated - we don't know whether advance() will be called again, thereby delivering a glyph which we _can_ expand, so we instead store what would have been expanded inside m_leftoverJustificationWidth, and wait for the next call to advance(). If none comes, clients have to call finalize() instead, which will apply m_leftoverJustificationWidth to the GlyphBuffer's initial advance. (WebCore::WidthIterator::applyExtraSpacingAfterShaping): (WebCore::WidthIterator::finalize): (WebCore::WidthIterator::advance): * platform/graphics/WidthIterator.h: * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::measureTextRenderer): 2020-08-10 Myles C. Maxfield <mmaxfield@apple.com> [Cocoa] Migrate from CTFontTransformGlyphsWithLanguage() to CTFontShapeGlyphs() https://bugs.webkit.org/show_bug.cgi?id=215059 Reviewed by Darin Adler. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. The solution for https://bugs.webkit.org/show_bug.cgi?id=214769 requires applying letter-spacing after text shaping. Today, we apply letter-spacing before text shaping which is wrong. However, if we want to apply letter-spacing after text shaping, we need to use CTFontShapeGlyphs(), which returns the glyph -> string mapping, which allows us to determine which glyphs to add letter-spacing to. Updates existing tests. Tests: fast/text/international/kana-voiced-sound-marks-1.html fast/text/international/kana-voiced-sound-marks-2.html * platform/graphics/Font.cpp: (WebCore::Font::applyTransforms const): * platform/graphics/Font.h: * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthForSimpleText const): (WebCore::FontCascade::characterRangeCodePath): (WebCore::FontCascade::layoutSimpleText const): * platform/graphics/FontCascade.h: * platform/graphics/SurrogatePairAwareTextIterator.cpp: (WebCore::SurrogatePairAwareTextIterator::consumeSlowCase): Now that we're using CTFontShapeGlyphs(), the shaping routine can and does look at the underlying character string to perform character composition. This means that the glyph buffer needs to match exactly what is in the string. We can't do any shenanigans where we pretend the string has characters that aren't actually there. * platform/graphics/SurrogatePairAwareTextIterator.h: (WebCore::SurrogatePairAwareTextIterator::consume): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::shouldApplyFontTransforms const): (WebCore::WidthIterator::applyFontTransforms): Reversing the glyph buffer for rtl content needs to be done inside platform-specific code, because its behavior depends on which platform shaping routine is being used. (WebCore::WidthIterator::commitCurrentFontRange): (WebCore::WidthIterator::advanceInternal): * platform/graphics/WidthIterator.h: * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::applyTransforms const): * platform/graphics/mac/SimpleFontDataCoreText.cpp: (WebCore::Font::getCFStringAttributes const): 2020-08-10 Devin Rousso <drousso@apple.com> Add quirk to force touch events on mail.yahoo.com https://bugs.webkit.org/show_bug.cgi?id=215329 <rdar://problem/59824469> Reviewed by Darin Adler and Tim Horton. <https://mail.yahoo.com/> serves a mobile site even in desktop browsing "mode", meaning that certain actions, such as selecting an aufotill contact, expect mobile behaviors, such as mouse events being dispatched after touch events rather than instantly (in the case of a connected trackpad with an iPad). This quirk ensures always mobile behavior for those actions, matching the expectations of <https://mail.yahoo.com/>. * page/Quirks.h: * page/Quirks.cpp: (WebCore::isYahooMail): Added. (WebCore::Quirks::shouldSynthesizeTouchEvents const): Added. (WebCore::Quirks::shouldAvoidPastingImagesAsWebContent const): * loader/DocumentLoader.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::mouseEventPolicy const): 2020-08-10 Chris Dumez <cdumez@apple.com> AuxiliaryProcess::didReceiveInvalidMessage() for WebPage::PerformDragControllerAction IPC https://bugs.webkit.org/show_bug.cgi?id=215341 <rdar://problem/59344091> Reviewed by Alex Christensen. Consistently use OptionSet<DragApplicationFlags> instead of DragApplicationFlags. * page/gtk/DragControllerGtk.cpp: (WebCore::DragController::isCopyKeyDown): * page/mac/DragControllerMac.mm: (WebCore::DragController::isCopyKeyDown): (WebCore::DragController::dragOperation): * platform/DragData.cpp: (WebCore::DragData::DragData): * platform/DragData.h: (WebCore::DragData::flags const): * platform/cocoa/DragDataCocoa.mm: (WebCore::DragData::DragData): * platform/win/DragDataWin.cpp: (WebCore::DragData::DragData): 2020-08-10 Peng Liu <peng.liu6@apple.com> MobileSafari crashes at WebCore: -[WebAVPlayerController seekToTime:toleranceBefore:toleranceAfter:] https://bugs.webkit.org/show_bug.cgi?id=215332 Reviewed by Eric Carlson. Add a NULL pointer check to fix a crash. * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController seekToTime:toleranceBefore:toleranceAfter:]): 2020-08-10 Myles C. Maxfield <mmaxfield@apple.com> Shaping can be performed on glyphIDs from the wrong font https://bugs.webkit.org/show_bug.cgi?id=215333 Reviewed by Darin Adler. The problem is this line: if (font != lastFontData && width) This means we will only trigger shaping code if width is non-zero. However, even if width is non-zero, we will still happily add glyphs to the glyph buffer, and when we do eventually get around to shaping, we shape all yet-unshaped glyphs, regardless of which font they came from. Test: fast/text/zero-width-shaping-font-mismatch.html * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::commitCurrentFontRange): (WebCore::WidthIterator::advanceInternal): * platform/graphics/WidthIterator.h: 2020-08-10 Clark Wang <clark_wang@apple.com> Add AudioProcessingEvent Constructor https://bugs.webkit.org/show_bug.cgi?id=215237 Reviewed by Chris Dumez. Added constructor according to spec: https://bugs.webkit.org/show_bug.cgi?id=215237. Added in AudioProcessingEventInit files. Test: webaudio/audioprocessingevent-constructor.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioProcessingEvent.cpp: (WebCore::AudioProcessingEvent::create): (WebCore::AudioProcessingEvent::AudioProcessingEvent): * Modules/webaudio/AudioProcessingEvent.h: * Modules/webaudio/AudioProcessingEvent.idl: * Modules/webaudio/AudioProcessingEventInit.h: Added. * Modules/webaudio/AudioProcessingEventInit.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-10 Chris Dumez <cdumez@apple.com> Align existing AudioParam API with the specification https://bugs.webkit.org/show_bug.cgi?id=215301 Reviewed by Sam Weinig. Align existing AudioParam API with the specification: - https://www.w3.org/TR/webaudio/#AudioParam In particular, the following changes were made: - Use float instead of unrestricted float where appropriate, so that we properly throw when provided non-finite values. - Use double instead of float where appropriate - A lot of the operations were previously returning nothing but they should return the AudioParam itself to allow chaining. - Throw an exceptions when passed invalid values (e.g. negative times) - Throw exceptions when events overlap. This part is based on Chromium's implementation here: - https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/modules/webaudio/audio_param_timeline.cc#L513 and is specification is here: - https://webaudio.github.io/web-audio-api/#dfn-automation-event This allows us to pass some more WPT webaudio tests. No new tests, rebaselined existing tests. * Modules/webaudio/AudioParam.cpp: * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParam.idl: * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::setValueAtTime): (WebCore::AudioParamTimeline::linearRampToValueAtTime): (WebCore::AudioParamTimeline::exponentialRampToValueAtTime): (WebCore::AudioParamTimeline::setTargetAtTime): (WebCore::AudioParamTimeline::setValueCurveAtTime): (WebCore::AudioParamTimeline::insertEvent): (WebCore::AudioParamTimeline::cancelScheduledValues): (WebCore::AudioParamTimeline::valuesForTimeRangeImpl): * Modules/webaudio/AudioParamTimeline.h: (WebCore::AudioParamTimeline::ParamEvent::ParamEvent): (WebCore::AudioParamTimeline::ParamEvent::time const): (WebCore::AudioParamTimeline::ParamEvent::duration const): (WebCore::AudioParamTimeline::ParamEvent::curve): 2020-08-10 Eric Carlson <eric.carlson@apple.com> r262456 broke sites that expect webkitDisplayingFullscreen to be true almost immediately https://bugs.webkit.org/show_bug.cgi?id=215240 <rdar://problem/66284042> Reviewed by Darin Adler. Add a quirk for sites that use the Akamai Media Player, which begins polling `webkitDisplayingFullscreen` every 100ms immediately after entering video fullscreen mode and exits fullscreen as soon as it returns false. r262456 changed the HTMLMediaPlayer state machine so `webkitDisplayingFullscreen` doesn't return `true` until the fullscreen window has been opened in the UI process. This was done to fix bugs triggered by rapidly entering and exiting fullscreen and PiP and make our own fullscreen/PiP tests less flakey, so instead of reverting the change universally do it as a quirk for sites using the Akamai Media Player. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): * page/Quirks.cpp: (WebCore::Quirks::needsAkamaiMediaPlayerQuirk const): * page/Quirks.h: 2020-08-10 Antti Koivisto <antti@apple.com> Return values of FontDatabase::collectionForFamily are not thread safe https://bugs.webkit.org/show_bug.cgi?id=215320 <rdar://problem/66502539> Reviewed by Anders Carlsson. Font prewarming can add new entries to m_familyNameToFontDescriptors while lookups are being made. Access to it is protected by a lock. However if the hashmap ends up rehashing, the pointer returned from collectionForFamily may end up becoming invalid. This can result in a crash later under findClosestFont. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): Heap allocate the hashmap values so they stay valid over hashtable mutations. 2020-08-09 Said Abou-Hallawa <sabouhallawa@apple.com> [macOS] Drag/drop an image of a unsupported format to an file input element should convert it to a supported format https://bugs.webkit.org/show_bug.cgi?id=212482 <rdar://problem/63731672> Reviewed by Darin Adler. Although the list of the dropped files are sent from the UI process to the Web process through the WebPage channel, the file input settings are only known by the Web process. So we have to do the image transcoding in WebCore. Tests: fast/forms/file/entries-api/image-no-transcode-drag-drop.html fast/forms/file/entries-api/image-transcode-drag-drop.html * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * html/FileInputType.cpp: (WebCore::FileInputType::handleDOMActivateEvent): (WebCore::FileInputType::fileChooserSettings const): Move filling FileChooserSettings to the function: fileChooserSettings(). (WebCore::FileInputType::applyFileChooserSettings): Call fileChooserSettings() instead of receiving FileChooserSettings as an argument. (WebCore::FileInputType::filesChosen): Add this function which can be called from receiveDroppedFiles() or receiveDroppedFilesWithImageTranscoding(). (WebCore::FileInputType::receiveDroppedFilesWithImageTranscoding): Finds out whether image transcoding is needed for the dropped files. If it is needed, it will be done in a WorkQueue and call filesChosen() when it is done. Otherwise it will call filesChosen() immediately. (WebCore::FileInputType::receiveDroppedFiles): * html/FileInputType.h: * platform/graphics/ImageUtilities.h: Added. * platform/graphics/cg/ImageUtilitiesCG.cpp: Added. (WebCore::sharedImageTranscodingQueue): Provide a shared WorkQueue which can be used by WebCore and WebKit. (WebCore::transcodeImage): (WebCore::findImagesForTranscoding): (WebCore::transcodeImages): 2020-08-09 Wenson Hsieh <wenson_hsieh@apple.com> REGRESSION (r260831): Web process crashes under Editor::setComposition() after navigating with marked text https://bugs.webkit.org/show_bug.cgi?id=215315 <rdar://problem/64740092> Reviewed by Darin Adler. To address a variety of crashes due to frames changing (or otherwise losing) their document while executing editing commands, r260831 refactored the Editor class such that it extends the functionality of the Document class, rather than the Frame class. In nearly all scenarios, this either leads to no behavior change or prevents null pointer crashes, since a document is almost always attached to a frame when applying any editing commands. However, there is one scenario where a document that has not yet been attached to its frame (and therefore does not have a browsing context) will cause a null deref when trying to confirm an existing IME composition. The logic added in <https://trac.webkit.org/r150291> will try and confirm any existing composition range on a document right before committing provisional navigation. In the case where we are navigating back to a previously visited page, `m_frame`'s document in `FrameLoader::commitProvisionalLoad()` will not be attached until the cached page's mainframe is opened underneath `CachedPage::restore()`. Since the call to `Editor::confirmComposition()` currently happens before this step, we end up crashing while attempting to create a `UserTypingGestureIndicator`. Note that even if we avoid this with a null check, we'll still end up crashing shortly thereafter, underneath `Editor::insertTextForConfirmedComposition`. And even if this second crash is avoided with another null check, we'll just end up with some version of webkit.org/b/59121, where the composition range is present after navigation, but is out of sync with platform UI. To fix the crash (and also not bring back bug #59121), we refactor this composition confirmation logic so that it lives in Editor, and is also robust against the case where the document is not attached to a frame; we then invoke this call after we're done committing the provisional load, so that any frame that is not yet attached before commiting the load still has a chance to confirm its composition. Test: WKWebViewMacEditingTests.ProcessSwapAfterSettingMarkedText * editing/Editor.cpp: (WebCore::Editor::confirmCompositionAndNotifyClient): Move functionality from `willTransitionToCommitted` to `confirmCompositionAndNotifyClient`, a helper method that will bail if the document is not attached, but otherwise confirm the active composition (if it exists). * editing/Editor.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::commitProvisionalLoad): Add a call to confirm the editor's current composition after we're done committing the load. Note that in the case where we had a composition before committing the load, we'll end up confirming the composition earlier (in the first call site), rather than confirming after the load has been committed. This means that this second call will be a no-op, due to the editor not having any composition. (WebCore::FrameLoader::willTransitionToCommitted): Deleted. * loader/FrameLoader.h: 2020-08-09 Ben Nham <nham@apple.com> Preload graphics drivers in Mac WebProcess https://bugs.webkit.org/show_bug.cgi?id=215183 Reviewed by Darin Adler. In newer versions of Mac OS, graphics drivers are no longer part of the shared cache due to size restrictions. This can cause first render to be blocked by ~10 ms when we dlopen those drivers. To work around this, we preload the drivers when prewarming the WebProcess. * page/ProcessWarming.cpp: (WebCore::ProcessWarming::prewarmGlobally): 2020-08-09 Youenn Fablet <youenn@apple.com> Always resolve ReadableStream's tee()'s cancel promise after the stream closes or errors https://bugs.webkit.org/show_bug.cgi?id=215197 Reviewed by Darin Adler. Make sure to resolve the cancel promise if the source gets closed or errored. Test: imported/w3c/web-platform-tests/streams/queuing-strategies-size-function-per-global.window.html * Modules/streams/ReadableStreamInternals.js: (readableStreamTee): (readableStreamTeePullFunction): 2020-08-08 Myles C. Maxfield <mmaxfield@apple.com> Update OriginalAdvancesForCharacterTreatedAsSpace to work correctly in the presence of inserted or removed glyphs https://bugs.webkit.org/show_bug.cgi?id=215302 Reviewed by Darin Adler. OriginalAdvancesForCharacterTreatedAsSpace is trying to make sure that shaping doesn't cause spaces to get wider or thinner. However, the way it was doing that is, for all the space characters, overwrite that glyph index's advance after shaping to be what it was before shaping. However, this is wrong, because shaping can insert or delete glyphs. Instead, now that we have explicit string indices for each glyph, we can use those to determine which glyphs come from space characters. These glyphs are the ones which should be overwritten. * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::applyFontTransforms): (WebCore::WidthIterator::advanceInternal): * platform/graphics/WidthIterator.h: 2020-08-08 Myles C. Maxfield <mmaxfield@apple.com> Fix bad merge in r265241 https://bugs.webkit.org/show_bug.cgi?id=215051 Unreviewed. This is something that got dropped in a bad merge from r265241. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthForSimpleText const): 2020-08-08 Myles C. Maxfield <mmaxfield@apple.com> Make GlyphBuffers required in the fast text codepath https://bugs.webkit.org/show_bug.cgi?id=215052 Reviewed by Darin Adler. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. Performing shaping affects the width of strings; indeed, that is one of its purposes for existence. Shaping can only happen when we have a GlyphBuffer to shape. We can't just arbitrarily decide to disable shaping for various functions just because those functions don't ever inspect the exact glyphs. No new tests. This is a preparation step toward https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208, and I couldn't come up with a test case that was broken here. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthOfTextRange const): (WebCore::FontCascade::widthForSimpleText const): (WebCore::FontCascade::layoutSimpleText const): (WebCore::FontCascade::floatWidthForSimpleText const): (WebCore::FontCascade::adjustSelectionRectForSimpleText const): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::shouldApplyFontTransforms const): (WebCore::WidthIterator::applyFontTransforms): (WebCore::WidthIterator::advanceInternal): (WebCore::WidthIterator::advance): (WebCore::WidthIterator::advanceOneCharacter): * platform/graphics/WidthIterator.h: * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::advanceSimpleText): 2020-08-08 Myles C. Maxfield <mmaxfield@apple.com> WidthIterator::m_finalRoundingWidth is always 0 https://bugs.webkit.org/show_bug.cgi?id=215307 Reviewed by Darin Adler. There's no reason for it to exist. No new tests because there is no behavior change. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::layoutSimpleText const): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::advanceInternal): * platform/graphics/WidthIterator.h: (WebCore::WidthIterator::runWidthSoFar const): (WebCore::WidthIterator::finalRoundingWidth const): Deleted. 2020-08-08 Myles C. Maxfield <mmaxfield@apple.com> Use references instead of pointers for GlyphBuffer::add()'s Font argument https://bugs.webkit.org/show_bug.cgi?id=215309 Reviewed by Darin Adler. They're not allowed to be null. No new tests because there is no behavior change. * platform/graphics/ComplexTextController.cpp: (WebCore::ComplexTextController::advance): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthForSimpleText const): (WebCore::FontCascade::drawGlyphBuffer const): (WebCore::offsetToMiddleOfGlyph): (WebCore::FontCascade::drawEmphasisMarks const): (WebCore::GlyphToPathTranslator::GlyphToPathTranslator): (WebCore::GlyphToPathTranslator::advance): (WebCore::FontCascade::dashesForIntersectionsWithRect const): * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::fontAt const): (WebCore::GlyphBuffer::add): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::advanceInternal): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const): * rendering/mathml/MathOperator.cpp: (WebCore::MathOperator::paintGlyph): (WebCore::MathOperator::paint): * rendering/mathml/RenderMathMLToken.cpp: (WebCore::RenderMathMLToken::paint): 2020-08-07 Chris Dumez <cdumez@apple.com> AudioContext / OfflineAudioContext should support a wider sample rate range https://bugs.webkit.org/show_bug.cgi?id=215289 Reviewed by Eric Carlson. AudioContext / OfflineAudioContext should support a wider sample rate range. We only supported sample rates in the [44100, 96000] range, which is much smaller than other browsers and would cause us to fail a LOT of web-platform-tests. We now support sample rates in the range [3000, 384000], which is the same range as Chromium. No new tests, rebaselined existing tests. * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::create): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::isSampleRateRangeGood): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::create): * platform/audio/FFTFrame.h: * platform/audio/HRTFPanner.cpp: (WebCore::HRTFPanner::fftSizeForSampleRate): Update fftSizeForSampleRate() to support wider sample rate range. This implementation is based on Chromium's: https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/platform/audio/hrtf_panner.cc#L70 * platform/audio/gstreamer/FFTFrameGStreamer.cpp: (WebCore::FFTFrame::minFFTSize): (WebCore::FFTFrame::maxFFTSize): * platform/audio/mac/FFTFrameMac.cpp: (WebCore::FFTFrame::minFFTSize): (WebCore::FFTFrame::maxFFTSize): 2020-08-07 James Darpinian <jdarpinian@chromium.org> [WebGL2] Missing validation for sampler unit index https://bugs.webkit.org/show_bug.cgi?id=215303 Reviewed by Dean Jackson. Test: webgl/2.0.0/deqp/functional/gles3/negativeshaderapi.html * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::bindSampler): 2020-08-07 James Darpinian <jdarpinian@chromium.org> Off by one error in transform feedback buffer binding https://bugs.webkit.org/show_bug.cgi?id=215298 Reviewed by Dean Jackson. Caught by conformance test deqp/functional/gles3/negativebufferapi.html * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::setIndexedBufferBinding): 2020-08-07 Alexey Shvayka <shvaikalesh@gmail.com> {Intersection,Resize,Performance}Observer callbacks get incorrect `this` value https://bugs.webkit.org/show_bug.cgi?id=215162 Reviewed by Geoffrey Garen. This change utilizes CallbackThisObject] IDL attribute to invoke a callback of IntersectionObserver [1], ResizeObserver [2], and PerformanceObserver [3] with correct `this` value of its observer, aligning WebKit with Blink and Gecko. Tests: imported/w3c/web-platform-tests/intersection-observer/observer-callback-arguments.html imported/w3c/web-platform-tests/resize-observer/observe.html imported/w3c/web-platform-tests/performance-timeline/po-observe.any.js [1] https://w3c.github.io/IntersectionObserver/#notify-intersection-observers-algo (step 3.4) [2] https://github.com/w3c/csswg-drafts/pull/5383 [3] https://w3c.github.io/performance-timeline/#queue-the-performanceobserver-task (step 3.3.5) * html/LazyLoadImageObserver.cpp: * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::notify): * page/IntersectionObserverCallback.h: * page/IntersectionObserverCallback.idl: * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::deliver): * page/PerformanceObserverCallback.h: * page/PerformanceObserverCallback.idl: * page/ResizeObserver.cpp: (WebCore::ResizeObserver::deliverObservations): * page/ResizeObserverCallback.h: * page/ResizeObserverCallback.idl: 2020-08-07 Chris Dumez <cdumez@apple.com> baseLatency attribute is missing on AudioContext interface https://bugs.webkit.org/show_bug.cgi?id=215277 Reviewed by Eric Carlson. baseLatency attribute is missing on AudioContext interface: - https://www.w3.org/TR/webaudio/#dom-audiocontext-baselatency Test: webaudio/audiocontext-baselatency.html * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::baseLatency): (WebCore::AudioContext::destination): * Modules/webaudio/AudioContext.h: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::framesPerBuffer const): * Modules/webaudio/DefaultAudioDestinationNode.h: * platform/audio/AudioDestination.h: * platform/audio/cocoa/AudioDestinationCocoa.cpp: (WebCore::AudioDestinationCocoa::framesPerBuffer const): * platform/audio/cocoa/AudioDestinationCocoa.h: * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: (WebCore::AudioDestinationGStreamer::framesPerBuffer const): * platform/audio/gstreamer/AudioDestinationGStreamer.h: 2020-08-07 Rob Buis <rbuis@igalia.com> Implement PerfomanceObserverInit.buffered https://bugs.webkit.org/show_bug.cgi?id=214883 Reviewed by Darin Adler. Implement PerfomanceObserverInit.buffered IDL and functionality [1]. Behavior matches Chrome and Firefox. Tests: imported/w3c/web-platform-tests/resource-timing/buffered-flag.any.html imported/w3c/web-platform-tests/resource-timing/buffered-flag.any.worker.html imported/w3c/web-platform-tests/user-timing/buffered-flag.any.html imported/w3c/web-platform-tests/user-timing/buffered-flag.any.worker.html imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.html imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.worker.html [1] https://w3c.github.io/performance-timeline/#performanceobserverinit-dictionary * page/Performance.cpp: (WebCore::Performance::appendBufferedEntriesByType const): * page/Performance.h: * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/PerformanceObserver.h: * page/PerformanceObserver.idl: 2020-08-07 John Wilander <wilander@apple.com> Experimental: Cap the expiry of persistent cookies set in 3rd-party CNAME cloaked HTTP responses https://bugs.webkit.org/show_bug.cgi?id=215201 <rdar://problem/57454633> Reviewed by Brent Fulgham. Also reviewed and commented on by Chris Dumez, Jiten Mehta, Sam Weinig, and Alex Christensen. Tests: http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-1p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-3p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-matching-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-cname-sub-no-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-1p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-3p-cname.html http/tests/resourceLoadStatistics/cname-cloaking-top-no-cname-sub-no-cname.html * page/Settings.yaml: Added the off-by-default flag isCNAMECloakingMitigationEnabled. * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::resourceLoadStatisticsEnabled const): New getter for the ITP setting. * platform/network/NetworkStorageSession.h: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::capExpiryOfPersistentCookie): Broke this function out so that it can be reused. (WebCore::parseDOMCookie): Here's from where the function above was broken out. The existing functionality has a test case. 2020-08-07 Chris Dumez <cdumez@apple.com> length attribute is missing on OfflineAudioContext https://bugs.webkit.org/show_bug.cgi?id=215287 Reviewed by Geoffrey Garen. length attribute is missing on OfflineAudioContext: - https://www.w3.org/TR/webaudio/#dom-offlineaudiocontext-length Test: webaudio/offlineaudiocontext-length.html * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::renderTarget const): * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::length const): * Modules/webaudio/OfflineAudioContext.h: * Modules/webaudio/OfflineAudioContext.idl: 2020-08-07 Alexey Shvayka <shvaikalesh@gmail.com> Reduce the amount of custom binding code for JSXPathNSResolver https://bugs.webkit.org/show_bug.cgi?id=161030 Reviewed by Darin Adler. This patch introduces CustomXPathNSResolver callback interface, cleaning up CodeGeneratorJS.pm and removing custom binding code. XPathNSResolver is kept as a wrapper for NativeXPathNSResolver, preserving common case performance via IDL interface converter, and because a callback interface can't be returned from a function without substantial code generator change. Also, improves non-callable method error message and fixes 2 spec incompatibilities: a) no "lookupNamespaceURI" method lookup on functions [1]; b) resolver's "prefix" parameter is required [2]. Since C++ methods can't be overload based on return type, this patch adds [ImplementedAs] IDL attribute support for callback interface methods. Because XPathNSResolver wrappers are always temporary (no reference is kept), [IsWeakCallback] IDL attribute isn't added, preserving strong reference. [1]: https://heycam.github.io/webidl/#call-a-user-objects-operation (step 10.1) [2]: https://dom.spec.whatwg.org/#dom-xpathnsresolver-lookupnamespaceuri Tests: imported/w3c/web-platform-tests/dom/idlharness.window.js imported/w3c/web-platform-tests/domxpath/callback-interface.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/IDLTypes.h: * bindings/js/JSCallbackData.cpp: (WebCore::JSCallbackData::invokeCallback): * bindings/js/JSCustomXPathNSResolver.cpp: Removed. * bindings/js/JSCustomXPathNSResolver.h: Removed. * bindings/js/JSDOMConvertXPathNSResolver.h: (WebCore::Converter<IDLInterface<XPathNSResolver>>::convert): (WebCore::Converter<IDLXPathNSResolver<T>>::convert): Deleted. (WebCore::JSConverter<IDLXPathNSResolver<T>>::convert): Deleted. (WebCore::JSConverter<IDLXPathNSResolver<T>>::convertNewlyCreated): Deleted. * bindings/scripts/CodeGenerator.pm: (IsBuiltinType): (IsWrapperType): * bindings/scripts/CodeGeneratorJS.pm: (AddToIncludesForIDLType): (GenerateHeader): (GenerateCallbackHeaderContent): (GenerateCallbackImplementationContent): (GetBaseIDLType): (NativeToJSValueDOMConvertNeedsState): (NativeToJSValueDOMConvertNeedsGlobalObject): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameterBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolverBody): * xml/CustomXPathNSResolver.cpp: Copied from Source/WebCore/bindings/js/JSXPathNSResolverCustom.cpp. (WebCore::CustomXPathNSResolver::lookupNamespaceURI): * xml/CustomXPathNSResolver.h: Copied from Source/WebCore/bindings/js/JSXPathNSResolverCustom.cpp. * xml/CustomXPathNSResolver.idl: Renamed from Source/WebCore/bindings/js/JSXPathNSResolverCustom.cpp. * xml/XPathNSResolver.idl: 2020-08-07 Antti Koivisto <antti@apple.com> REGRESSION (r260276): instructure.com custom PDF viewer stops scrolling / loading after switching to another tab then switching back https://bugs.webkit.org/show_bug.cgi?id=215215 <rdar://problem/65743028> Reviewed by Simon Fraser. Test: scrollingcoordinator/overflow-proxy-reattach.html * page/scrolling/ScrollingStateOverflowScrollProxyNode.cpp: (WebCore::ScrollingStateOverflowScrollProxyNode::setPropertyChangedBitsAfterReattach): We need to reset OverflowScrollingNode after reattach. * page/scrolling/ScrollingStateOverflowScrollProxyNode.h: * testing/Internals.cpp: (WebCore::Internals::setPageIsInWindow): * testing/Internals.h: * testing/Internals.idl: Add direct testing support for background tab state. 2020-08-07 Chris Dumez <cdumez@apple.com> Stop storing the sampleRate on AudioNode and get it from the AudioContext instead https://bugs.webkit.org/show_bug.cgi?id=215246 Reviewed by Eric Carlson. Stop storing the sampleRate on AudioNode and get it from the AudioContext instead. This avoids having to pass the sampleRate everywhere when we construct nodes. No new tests, no behavior change. * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::AnalyserNode): * Modules/webaudio/AudioBasicInspectorNode.cpp: (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode): * Modules/webaudio/AudioBasicInspectorNode.h: * Modules/webaudio/AudioBasicProcessorNode.cpp: (WebCore::AudioBasicProcessorNode::AudioBasicProcessorNode): * Modules/webaudio/AudioBasicProcessorNode.h: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::AudioDestinationNode): * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::AudioNode): (WebCore::AudioNode::sampleRate const): (WebCore::AudioNode::processIfNecessary): * Modules/webaudio/AudioNode.h: * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode): * Modules/webaudio/AudioScheduledSourceNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createScriptProcessor): * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::BiquadFilterNode): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): (WebCore::ChannelMergerNode::ChannelMergerNode): * Modules/webaudio/ChannelMergerNode.h: * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): (WebCore::ChannelSplitterNode::ChannelSplitterNode): * Modules/webaudio/ChannelSplitterNode.h: * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::ConvolverNode): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode): (WebCore::DefaultAudioDestinationNode::sampleRate const): * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::DelayNode): * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::GainNode): * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode): * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode): * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode): * Modules/webaudio/OfflineAudioDestinationNode.h: * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::OscillatorNode): * Modules/webaudio/PannerNode.cpp: * Modules/webaudio/PannerNode.h: * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::create): (WebCore::ScriptProcessorNode::ScriptProcessorNode): * Modules/webaudio/ScriptProcessorNode.h: * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::WaveShaperNode): * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createWebKitPanner): * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode): * Modules/webaudio/WebKitAudioPannerNode.h: 2020-08-07 Dean Jackson <dino@apple.com> Pocket City game play area is blank (WebGL is broken in Catalyst) https://bugs.webkit.org/show_bug.cgi?id=215251 Reviewed by Tim Horton. Our configuration for WebGL under Catalyst was incorrect. Since it uses "desktop" OpenGL, it had to use the normal macOS setup (enabling texture rectangle extension, and the correct target). * platform/graphics/GraphicsContextGL.h: Add PLATFORM(MACCATALYST). * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: Ditto. (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): 2020-08-07 Rob Buis <rbuis@igalia.com> Fix warnings related to unsigned >=0 ASSERTs https://bugs.webkit.org/show_bug.cgi?id=215223 Reviewed by Sergio Villar Senin. Fix warnings related to unsigned >=0 ASSERTs by removing the expressions. Example warning: TextCheckingHelper.cpp:425:39: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] * editing/Editor.cpp: (WebCore::Editor::markAndReplaceFor): * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspelledWordOrUngrammaticalPhrase const): (WebCore::TextCheckingHelper::findUngrammaticalPhrases const): (WebCore::TextCheckingHelper::guessesForMisspelledWordOrUngrammaticalPhrase const): 2020-08-06 Sihui Liu <sihui_liu@apple.com> Text manipulation: leading and trailing spaces should be ignored when comparing content https://bugs.webkit.org/show_bug.cgi?id=214878 <rdar://problem/63735024> Reviewed by Ryosuke Niwa. TextIterator does not emit collapsed space if there is no text emitted before or the last emitted character is collapsed space. When TextManipulationController starts observing paragraphs, it iterates the whole document and the range of TextIterator is the range of document. For some text node A in the document, if TextIterator emits text for some other text node B before it, the collapsed space at the beginning of A will be emitted, and TextManipulationController would think the emitted space is part of A's content. When TextManipulationController replaces content for A, and the range of TextIterator is set to the range of A, the collapsed space is not emitted. The check to ensure A's content is unchanged would fail. To solve this issue, for first and last token in the paragraph, TextManipulationController checks content after removing leading and trailing spaces. API test: TextManipulation.CompleteTextManipulationParagraphsContainCollapsedSpaces * editing/TextManipulationController.cpp: (WebCore::areEqualIgnoringLeadingAndTrailingWhitespaces): (WebCore::TextManipulationController::replace): 2020-08-06 Kenneth Russell <kbr@chromium.org> Implement createImageBitmap(ImageData) https://bugs.webkit.org/show_bug.cgi?id=183438 Reviewed by Dean Jackson. Implement createImageBitmap(ImageData), including scaling, flipping and alpha premultiplication, and fix bugs in createImageBitmap(ImageBitmap). Support copying unpremultiplied-alpha data to the unpremultiplied-alpha format in ImageBuffer::putImageData. Plumb this change through all ImageBuffer backends and display lists. Handle error cases exposed by W3C WPT tests now that createImageBitmap(ImageData) is working. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpImageBitmap): (WebCore::CloneDeserializer::readImageBitmap): * html/ImageBitmap.cpp: (WebCore::ImageBitmap::create): (WebCore::ImageBitmap::detachBitmaps): (WebCore::alphaPremultiplicationForPremultiplyAlpha): (WebCore::ImageBitmap::resolveWithBlankImageBuffer): (WebCore::ImageBitmap::createPromise): (WebCore::ImageBitmap::createFromBuffer): * html/ImageBitmap.h: * html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::transferToImageBitmap): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texImageSourceHelper): (WebCore::WebGLRenderingContextBase::texImageImpl): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/ConcreteImageBuffer.h: (WebCore::ConcreteImageBuffer::putImageData): * platform/graphics/ImageBuffer.h: (WebCore::ImageBuffer::putImageData): * platform/graphics/ImageBufferBackend.cpp: (WebCore::ImageBufferBackend::convertToLuminanceMask): (WebCore::copyUnpremultipliedToUnpremultiplied): (WebCore::ImageBufferBackend::copyImagePixels const): (WebCore::ImageBufferBackend::putImageData): * platform/graphics/ImageBufferBackend.h: * platform/graphics/cairo/GraphicsContextGLCairo.cpp: (WebCore::GraphicsContextGLOpenGL::ImageExtractor::extractImage): * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.cpp: (WebCore::ImageBufferCairoSurfaceBackend::putImageData): * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.h: * platform/graphics/cg/GraphicsContextGLCG.cpp: (WebCore::GraphicsContextGLOpenGL::ImageExtractor::extractImage): * platform/graphics/cg/ImageBufferCGBackend.cpp: (WebCore::copyImagePixelsAccelerated): * platform/graphics/cg/ImageBufferCGBitmapBackend.cpp: (WebCore::ImageBufferCGBitmapBackend::putImageData): * platform/graphics/cg/ImageBufferCGBitmapBackend.h: * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: (WebCore::ImageBufferIOSurfaceBackend::putImageData): * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::PutImageData::PutImageData): (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::PutImageData::create): (WebCore::DisplayList::PutImageData::destFormat const): (WebCore::DisplayList::PutImageData::encode const): (WebCore::DisplayList::PutImageData::decode): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::putImageData): * platform/graphics/displaylists/DisplayListRecorder.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: (WebCore::GraphicsContextGLOpenGL::ImageExtractor::ImageExtractor): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/win/GraphicsContextGLDirect2D.cpp: (WebCore::GraphicsContextGLOpenGL::ImageExtractor::extractImage): * platform/graphics/win/ImageBufferDirect2DBackend.cpp: (WebCore::ImageBufferDirect2DBackend::putImageData): * platform/graphics/win/ImageBufferDirect2DBackend.h: 2020-08-06 Simon Fraser <simon.fraser@apple.com> Avoid triggering redundant compositing updates when trying ot run a steps() animation on transform https://bugs.webkit.org/show_bug.cgi?id=215241 <rdar://problem/62737868> Reviewed by Zalan Bujtas. With a steps() timing function and keyframes animating the transform property, KeyframeEffect::applyPendingAcceleratedActions() tries to restart the animation every time because the GraphicsLayer reports that it didn't start an accelerated animation. r264856 patched some of this, but we still call animationFinished() every time, and this triggers a compositing update via the m_owningLayer.setNeeds* calls in RenderLayerBacking::animationFinished(). So don't try to remove the animation if wasn't running. This makes those compositing updates a no-op, which is important because these animations still invalidate style on every frame (webkit.org/b/215229). Test: animations/steps-transform-compositing-updates.html * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::applyPendingAcceleratedActions): 2020-08-06 Peng Liu <peng.liu6@apple.com> Web process crashes at WebCore::FullscreenManager::didExitFullscreen https://bugs.webkit.org/show_bug.cgi?id=215243 Reviewed by Eric Carlson. No new tests, no functional change. * dom/FullscreenManager.cpp: (WebCore::FullscreenManager::didExitFullscreen): m_fullscreenElement might be nullptr when fullscreenOrPendingElement() is not nullptr. 2020-08-06 Wenson Hsieh <wenson_hsieh@apple.com> WeakPtr threading assertion on editing/undo-manager/undo-manager-delete-stale-undo-items.html https://bugs.webkit.org/show_bug.cgi?id=215221 <rdar://problem/66632111> Reviewed by Devin Rousso. Refactors `UndoItem` to avoid dereferencing its `m_undoManager` underneath `UndoItem::document`, which is consulted when computing its JS wrapper's opaque roots. Instead of going through `m_undoManager` to grab the document, store a `WeakPtr` to the `Document` upon setting the `UndoManager` and return its pointer value directly in `document()`. * page/UndoItem.cpp: (WebCore::UndoItem::setUndoManager): (WebCore::UndoItem::invalidate): (WebCore::UndoItem::document const): * page/UndoItem.h: 2020-08-06 Myles C. Maxfield <mmaxfield@apple.com> Use references instead of pointers for WidthIterator's fonts https://bugs.webkit.org/show_bug.cgi?id=215186 Reviewed by Zalan Bujtas. They can never be null. No new tests because there is no behavior change. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthOfTextRange const): (WebCore::FontCascade::layoutSimpleText const): (WebCore::FontCascade::floatWidthForSimpleText const): (WebCore::FontCascade::adjustSelectionRectForSimpleText const): (WebCore::FontCascade::offsetForPositionForSimpleText const): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::WidthIterator): (WebCore::WidthIterator::applyFontTransforms): (WebCore::WidthIterator::advanceInternal): * platform/graphics/WidthIterator.h: * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer): 2020-08-06 Chris Dumez <cdumez@apple.com> BaseAudioContext.decodeAudioData() should return a Promise https://bugs.webkit.org/show_bug.cgi?id=215242 Reviewed by Eric Carlson. BaseAudioContext.decodeAudioData() should return a Promise as per: - https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-decodeaudiodata Behavior is unchanged for prefixed WebKitAudioContext.decodeAudioData() to ensure backward compatibility. No new tests, rebaselined existing tests. * Modules/webaudio/AsyncAudioDecoder.cpp: (WebCore::AsyncAudioDecoder::decodeAsync): (WebCore::AsyncAudioDecoder::DecodingTask::DecodingTask): (WebCore::AsyncAudioDecoder::DecodingTask::notifyComplete): * Modules/webaudio/AsyncAudioDecoder.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::decodeAudioData): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/WebKitAudioContext.idl: 2020-08-06 Chris Dumez <cdumez@apple.com> Drop non-standard createBuffer(ArrayBuffer, boolean) overload from AudioContext https://bugs.webkit.org/show_bug.cgi?id=215238 Reviewed by Darin Adler. Drop non-standard createBuffer(ArrayBuffer, boolean) overload from AudioContext: - https://webaudio.github.io/web-audio-api/#BaseAudioContext This overload is kept on WebKitAudioContext for backward-compatibility when the page is still using the prefixed API. No new tests, rebaselined existing test. * Modules/webaudio/BaseAudioContext.cpp: * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createLegacyBuffer): * Modules/webaudio/WebKitAudioContext.h: * Modules/webaudio/WebKitAudioContext.idl: 2020-08-06 Chris Dumez <cdumez@apple.com> MediaStreamAudioDestinationNode should have a constructor https://bugs.webkit.org/show_bug.cgi?id=215233 Reviewed by Geoffrey Garen. MediaStreamAudioDestinationNode should have a constructor: - https://webaudio.github.io/web-audio-api/#mediastreamaudiodestinationnode No new tests, rebaselined existing tests. * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::AnalyserNode): * Modules/webaudio/AudioBasicInspectorNode.cpp: (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode): (WebCore::AudioBasicInspectorNode::pullInputs): (WebCore::AudioBasicInspectorNode::checkNumberOfChannelsForInput): (WebCore::AudioBasicInspectorNode::updatePullStatus): * Modules/webaudio/AudioBasicInspectorNode.h: * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::createMediaStreamDestination): * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: (WebCore::MediaStreamAudioDestinationNode::create): (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode): * Modules/webaudio/MediaStreamAudioDestinationNode.h: * Modules/webaudio/MediaStreamAudioDestinationNode.idl: * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createMediaStreamDestination): 2020-08-06 Said Abou-Hallawa <sabouhallawa@apple.com> [CG] Avoid creating a sub-image when drawing a small scaled sub-rect from a native image https://bugs.webkit.org/show_bug.cgi?id=215015 <rdar://problem/63845893> Reviewed by Simon Fraser. The reason for creating the sub-image in GraphicsContext::drawNativeImage() is to have a better image interpolation for the scaled sub-rect. For small destRect, the interpolation on the original image is almost the same as the interpolation on the sub-image. So we should avoid creating the sub- image if destRect.area() is less than some minimum value. Creating many sub-images can affect the rendering performance. * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::drawNativeImage): 2020-08-06 David Kilzer <ddkilzer@apple.com> WTF::makeString() should handle enum values <https://webkit.org/b/214906> Reviewed by Sam Weinig. * Modules/webgpu/WHLSL/Metal/WHLSLMangledNames.h: (WTF::MangledNameAdaptor::length): (WTF::MangledNameAdaptor::writeTo): - Update for function renames. 2020-08-06 Chris Dumez <cdumez@apple.com> MediaStreamAudioSourceNode should have a constructor https://bugs.webkit.org/show_bug.cgi?id=215225 Reviewed by Eric Carlson. MediaStreamAudioSourceNode should have a constructor: - https://webaudio.github.io/web-audio-api/#mediastreamaudiosourcenode No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::createMediaStreamSource): * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::create): * Modules/webaudio/MediaStreamAudioSourceNode.h: * Modules/webaudio/MediaStreamAudioSourceNode.idl: * Modules/webaudio/MediaStreamAudioSourceOptions.h: Copied from Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl. * Modules/webaudio/MediaStreamAudioSourceOptions.idl: Copied from Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.idl. * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createMediaStreamSource): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-06 Myles C. Maxfield <mmaxfield@apple.com> Rename LeadingExpansion and TrailingExpansion to LeftExpansion and RightExpansion https://bugs.webkit.org/show_bug.cgi?id=215211 Reviewed by Darin Adler. "Leading" and "Trailing" are terms-of-art which represent logical order. However, the behavior of these flags operates in visual order. Instead, we should rename them to their visual order analogues: left and right. No new tests because there is no behavior change. * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::measureText): (WebCore::CanvasRenderingContext2D::drawTextInternal): * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::justifyRuns): (WebCore::Layout::LineBuilder::Run::expand): (WebCore::Layout::LineBuilder::Run::visuallyCollapseTrailingWhitespace): * platform/graphics/ComplexTextController.cpp: (WebCore::expansionLocation): (WebCore::ComplexTextController::adjustGlyphsAndAdvances): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::expansionOpportunityCountInternal): (WebCore::FontCascade::leftExpansionOpportunity): (WebCore::FontCascade::rightExpansionOpportunity): (WebCore::FontCascade::leadingExpansionOpportunity): Deleted. (WebCore::FontCascade::trailingExpansionOpportunity): Deleted. * platform/graphics/FontCascade.h: * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::WidthIterator): (WebCore::expansionLocation): (WebCore::WidthIterator::advanceInternal): * platform/text/TextFlags.h: * rendering/ComplexLineLayout.cpp: (WebCore::expansionBehaviorForInlineTextBox): (WebCore::applyExpansionBehavior): * rendering/EllipsisBox.cpp: (WebCore::EllipsisBox::paint): (WebCore::EllipsisBox::selectionRect): (WebCore::EllipsisBox::paintSelection): * rendering/InlineBox.h: (WebCore::InlineBox::setCanHaveLeftExpansion): (WebCore::InlineBox::setCanHaveRightExpansion): (WebCore::InlineBox::setForceRightExpansion): (WebCore::InlineBox::setForceLeftExpansion): (WebCore::InlineBox::InlineBoxBitfields::InlineBoxBitfields): (WebCore::InlineBox::hasSelectedChildren const): (WebCore::InlineBox::setHasSelectedChildren): (WebCore::InlineBox::canHaveLeftExpansion const): (WebCore::InlineBox::canHaveRightExpansion const): (WebCore::InlineBox::forceRightExpansion const): (WebCore::InlineBox::forceLeftExpansion const): (WebCore::InlineBox::setCanHaveLeadingExpansion): Deleted. (WebCore::InlineBox::setCanHaveTrailingExpansion): Deleted. (WebCore::InlineBox::setForceTrailingExpansion): Deleted. (WebCore::InlineBox::setForceLeadingExpansion): Deleted. (WebCore::InlineBox::canHaveLeadingExpansion const): Deleted. (WebCore::InlineBox::canHaveTrailingExpansion const): Deleted. (WebCore::InlineBox::forceTrailingExpansion const): Deleted. (WebCore::InlineBox::forceLeadingExpansion const): Deleted. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::expansionBehavior const): * rendering/InlineTextBox.h: * rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::paintObject): (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths const): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::updateFromElement): (WebCore::RenderListBox::paintItemForeground): * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::getAverageCharWidth): * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::expansionBehavior): * rendering/SimpleLineLayout.h: * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::initializeInlineTextBox): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::constructTextRun const): * rendering/svg/SVGTextMetrics.cpp: (WebCore::SVGTextMetrics::constructTextRun): 2020-08-06 Chris Dumez <cdumez@apple.com> DynamicsCompressorNode.reduction attribute should be a float, not an AudioParam https://bugs.webkit.org/show_bug.cgi?id=215195 Reviewed by Youenn Fablet. DynamicsCompressorNode.reduction attribute should be a float, not an AudioParam: - https://webaudio.github.io/web-audio-api/#dynamicscompressornode Backward-compatibility is maintained for the prefixed WebAudio API. No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): (WebCore::DynamicsCompressorNode::process): * Modules/webaudio/DynamicsCompressorNode.h: (WebCore::DynamicsCompressorNode::reduction const): (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): (WebCore::DynamicsCompressorNode::setReduction): * Modules/webaudio/DynamicsCompressorNode.idl: * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createWebKitDynamicsCompressor): * Modules/webaudio/WebKitAudioContext.h: * Modules/webaudio/WebKitAudioContext.idl: * Modules/webaudio/WebKitDynamicsCompressorNode.h: Copied from Source/WebCore/Modules/webaudio/DynamicsCompressorNode.idl. * Modules/webaudio/WebKitDynamicsCompressorNode.idl: Copied from Source/WebCore/Modules/webaudio/DynamicsCompressorNode.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-06 Truitt Savell <tsavell@apple.com> Unreviewed, reverting r265328. Broke 17 MediaRecorder tests. Reverted changeset: "Add support for MediaRecorder bitrate options" https://bugs.webkit.org/show_bug.cgi?id=214973 https://trac.webkit.org/changeset/265328 2020-08-06 Chris Dumez <cdumez@apple.com> MediaElementAudioSourceNode interface should have a constructor https://bugs.webkit.org/show_bug.cgi?id=215200 Reviewed by Youenn Fablet. MediaElementAudioSourceNode interface should have a constructor: - https://webaudio.github.io/web-audio-api/#mediaelementaudiosourcenode Test: webaudio/mediaelementaudiosourcenode-constructor.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::createMediaElementSource): * Modules/webaudio/AudioContext.idl: * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::create): (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode): * Modules/webaudio/MediaElementAudioSourceNode.h: * Modules/webaudio/MediaElementAudioSourceNode.idl: * Modules/webaudio/MediaElementAudioSourceOptions.h: Copied from Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.idl. * Modules/webaudio/MediaElementAudioSourceOptions.idl: Copied from Source/WebCore/Modules/webaudio/MediaElementAudioSourceNode.idl. * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createMediaElementSource): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-06 Youenn Fablet <youenn@apple.com> Add support for MediaRecorder bitrate options https://bugs.webkit.org/show_bug.cgi?id=214973 Reviewed by Eric Carlson. Pipe options to MediaRecorderPrivate constructor. For the actual implementation, pass it down to VideoSampleBufferCompressor and AudioSampleBufferCompressor. For AudioSampleBufferCompressor, we do not handle well some bit rates, so for now, we limit to specific values. Tests: http/wpt/mediarecorder/MediaRecorder-audio-bitrate.html http/wpt/mediarecorder/MediaRecorder-video-bitrate.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::createMediaRecorderPrivate): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorderProvider.cpp: (WebCore::MediaRecorderProvider::createMediaRecorderPrivate): * Modules/mediarecorder/MediaRecorderProvider.h: * WebCore.xcodeproj/project.pbxproj: * loader/EmptyClients.cpp: * platform/mediarecorder/MediaRecorderPrivate.h: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: (WebCore::AudioSampleBufferCompressor::setBitsPerSecond): (WebCore::AudioSampleBufferCompressor::outputBitRate const): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): Do not exit when not able to set bitrate as we still want to set m_maxOutputPacketSize. In case of error in setting up the converter, clean it up so that we do not use a partially set up converter. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::create): (WebCore::MediaRecorderPrivateWriter::setOptions): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: (WebCore::VideoSampleBufferCompressor::setBitsPerSecond): (WebCore::setCompressionSessionProperty): (WebCore::VideoSampleBufferCompressor::initCompressionSession): * testing/Internals.cpp: (WebCore::createRecorderMockSource): 2020-08-06 Simon Fraser <simon.fraser@apple.com> Scrolling tree nodes sometimes don't match layer z-order https://bugs.webkit.org/show_bug.cgi?id=215210 Reviewed by Antti Koivisto. When adding nodes to the scrolling state tree during compositing layer traversal, we would sometimes add then in the wrong order. For example, if the composited layer tree was: + Root + Stacking context Fixed layer 1 Fixed layer 2 we would build a scrolling tree like: + Root scrolling node Node for layer 2 Node for layer 1 This happened because RenderLayerCompositor::updateBackingAndHierarchy() failed to propagate up scrollingTreeState.nextChildIndex. This is generally benign, but inserting node 1 followed by node 2 would be seen as a scrolling tree mutation, causing us to re-commit the scrolling tree when it hadn't really changed, triggering extra CPU usage. Part of <rdar://problem/62737868>: higher CPU usage on instagram.com. Test: scrollingcoordinator/scrolling-tree/sibling-node-order.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): 2020-08-05 Rob Buis <rbuis@igalia.com> Remove the StyleResolver-specific evaluate function in MediaQueryEvaluator https://bugs.webkit.org/show_bug.cgi?id=152089 Reviewed by Darin Adler. The function mentioned in the bug is already gone (see r252736), also remove the StyleResolver reference. * css/MediaQueryEvaluator.h: 2020-08-05 Simon Fraser <simon.fraser@apple.com> Add some more Animations logging https://bugs.webkit.org/show_bug.cgi?id=215181 Reviewed by Zalan Bujtas. Add logging that shows when DeclarativeAnimation::tick() runs and when it invalidates style. * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::tick): * animation/DocumentTimelinesController.cpp: (WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents): * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::invalidate): 2020-08-05 Peng Liu <peng.liu6@apple.com> Netflix.com shows a scrubber that doesn't work https://bugs.webkit.org/show_bug.cgi?id=215199 Reviewed by Eric Carlson. The "contentDuration" property of WebPlaybackControlsManager needs to be infinite when the video is not seekable. Otherwise, AVKit will show a scrubber that doesn't work on the Touch Bar. * platform/mac/WebPlaybackControlsManager.mm: (-[WebPlaybackControlsManager contentDuration]): (-[WebPlaybackControlsManager setContentDuration:]): 2020-08-05 James Darpinian <jdarpinian@chromium.org> [WebGL2] Upgrade vertexAttribPointer with new supported types https://bugs.webkit.org/show_bug.cgi?id=215036 Reviewed by Dean Jackson. Tested by updated WebGL conformance tests webgl/2.0.0/conformance/attribs/gl-vertexattribpointer-offsets.html and webgl/2.0.0/conformance/attribs/gl-vertexattribpointer.html * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::sizeInBytes): (WebCore::WebGLRenderingContextBase::vertexAttribPointer): 2020-08-05 Tim Horton <timothy_horton@apple.com> Remove all references to non-existent 10.16 https://bugs.webkit.org/show_bug.cgi?id=215202 Reviewed by Wenson Hsieh. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: 2020-08-05 Andres Gonzalez <andresg_22@apple.com> Crash in com.apple.WebKit.WebContent at com.apple.AppKit: _NSAccessibilityRemoveAllObserversAndSendDestroyedNotification https://bugs.webkit.org/show_bug.cgi?id=215189 <rdar://problem/66561167> Reviewed by Chris Fleizach. AXIsolatedObject::detachPlatformWrapper was calling the wrapper's detach method that in turn calls the system NSAccessibilityUnregisterUniqueIdForUIElement on the secondary thread. This function is not thread safe and hence the random crashes. This changes AXIsolatedObject::detachPlatformWrapper to call the wrapper's detachIsolatedObject, avoiding the above problem altogether. The wrapper's detach remains the same that it was before isolated tree mode was introduced, and should only run on the main thread. * accessibility/AccessibilityObjectInterface.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::applyPendingChanges): * accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm: (WebCore::AXIsolatedObject::detachPlatformWrapper): * accessibility/mac/WebAccessibilityObjectWrapperBase.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase detach]): (-[WebAccessibilityObjectWrapperBase detachIsolatedObject:]): (-[WebAccessibilityObjectWrapperBase detachAXObject]): Merged back into detach. (-[WebAccessibilityObjectWrapperBase detachIsolatedObject]): Deleted. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper unregisterUniqueIdForUIElement]): 2020-08-05 Chris Dumez <cdumez@apple.com> Add constructor for DynamicsCompressorNode https://bugs.webkit.org/show_bug.cgi?id=215180 Reviewed by Geoffrey Garen. Add constructor for DynamicsCompressorNode: - https://webaudio.github.io/web-audio-api/#dynamicscompressornode This patch also add a new handleAudioNodeOptions() member function to AudioNode to avoid code duplication and every node constructor. No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::create): * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::AudioNode): (WebCore::AudioNode::initializeDefaultNodeOptions): (WebCore::AudioNode::handleAudioNodeOptions): * Modules/webaudio/AudioNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createDynamicsCompressor): * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::create): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::create): (WebCore::ConvolverNode::ConvolverNode): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode): * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::create): * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::create): (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): (WebCore::DynamicsCompressorNode::setChannelCount): (WebCore::DynamicsCompressorNode::setChannelCountMode): * Modules/webaudio/DynamicsCompressorNode.h: * Modules/webaudio/DynamicsCompressorNode.idl: * Modules/webaudio/DynamicsCompressorOptions.h: Copied from Source/WebCore/Modules/webaudio/DynamicsCompressorNode.idl. * Modules/webaudio/DynamicsCompressorOptions.idl: Copied from Source/WebCore/Modules/webaudio/DynamicsCompressorNode.idl. * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::create): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::create): (WebCore::PannerNode::PannerNode): * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::create): * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-05 Chris Dumez <cdumez@apple.com> Add constructor to ConvolverNode https://bugs.webkit.org/show_bug.cgi?id=215169 Reviewed by Eric Carlson. Add constructor to ConvolverNode, as per specification: - https://webaudio.github.io/web-audio-api/#ConvolverNode No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createConvolver): * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::create): (WebCore::ConvolverNode::ConvolverNode): (WebCore::ConvolverNode::setBuffer): (WebCore::ConvolverNode::setChannelCount): (WebCore::ConvolverNode::setChannelCountMode): * Modules/webaudio/ConvolverNode.h: * Modules/webaudio/ConvolverNode.idl: * Modules/webaudio/ConvolverOptions.h: Copied from Source/WebCore/Modules/webaudio/ConvolverNode.idl. * Modules/webaudio/ConvolverOptions.idl: Copied from Source/WebCore/Modules/webaudio/ConvolverNode.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-05 Chris Dumez <cdumez@apple.com> REGRESSION (r265266) DumpRenderTree crash at WebKitAudioListener::dopplerFactor https://bugs.webkit.org/show_bug.cgi?id=215171 <rdar://problem/66556999> Reviewed by Eric Carlson. We were calling the isWebKitAudioContext() virtual function from the BaseAudioContext constructor, which was not OK. We now initialize the listener lazily so that we can know if we are a WebKitAudioContext or not at the time of creation. Also use downcast<> instead of static_cast<> to cast from AudioListener to WebKitAudioListener for extra safety. Finally, AudioListener was missing a virtual destructor even though we were using polymorphism. No new tests, covered by existing tests that are crashing on the bots. * Modules/webaudio/AudioListener.h: (WebCore::AudioListener::isWebKitAudioListener const): * Modules/webaudio/AudioListener.idl: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::constructCommon): (WebCore::WebCore::BaseAudioContext::listener): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::listener): Deleted. * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::listener): (WebCore::PannerNode::getAzimuthElevation): (WebCore::PannerNode::distanceConeGain): * Modules/webaudio/PannerNode.h: * Modules/webaudio/WebKitAudioContext.h: (WebCore::WebKitAudioContext::listener): * Modules/webaudio/WebKitAudioListener.h: (isType): * Modules/webaudio/WebKitAudioListener.idl: * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::listener): (WebCore::WebKitAudioPannerNode::getAzimuthElevation): (WebCore::WebKitAudioPannerNode::dopplerRate): (WebCore::WebKitAudioPannerNode::distanceConeGain): * Modules/webaudio/WebKitAudioPannerNode.h: 2020-08-05 Chris Dumez <cdumez@apple.com> Align BiquadFilterNode.getFrequencyResponse() with the specification https://bugs.webkit.org/show_bug.cgi?id=215148 Reviewed by Eric Carlson. Align BiquadFilterNode.getFrequencyResponse() with the specification: - https://webaudio.github.io/web-audio-api/#dom-biquadfilternode-getfrequencyresponse In particular, the 3 argument arrays should not be nullable and we should throw if they have different lengths. No new tests, rebaselined existing tests. * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::getFrequencyResponse): * Modules/webaudio/BiquadFilterNode.h: * Modules/webaudio/BiquadFilterNode.idl: 2020-08-05 Chris Dumez <cdumez@apple.com> Add constructor to BiquadFilterNode https://bugs.webkit.org/show_bug.cgi?id=215144 Reviewed by Eric Carlson. Add constructor to BiquadFilterNode: - https://webaudio.github.io/web-audio-api/#biquadfilternode No new tests, rebaselined existing tests.. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createBiquadFilter): * Modules/webaudio/BiquadDSPKernel.cpp: (WebCore::BiquadDSPKernel::updateCoefficientsIfNecessary): * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::create): (WebCore::BiquadFilterNode::BiquadFilterNode): * Modules/webaudio/BiquadFilterNode.h: * Modules/webaudio/BiquadFilterNode.idl: * Modules/webaudio/BiquadFilterOptions.h: Copied from Source/WebCore/Modules/webaudio/BiquadFilterNode.idl. * Modules/webaudio/BiquadFilterOptions.idl: Copied from Source/WebCore/Modules/webaudio/BiquadFilterNode.idl. * Modules/webaudio/BiquadFilterType.h: Copied from Source/WebCore/Modules/webaudio/BiquadFilterNode.idl. * Modules/webaudio/BiquadFilterType.idl: Copied from Source/WebCore/Modules/webaudio/BiquadFilterNode.idl. * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::BiquadProcessor): * Modules/webaudio/BiquadProcessor.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-04 Simon Fraser <simon.fraser@apple.com> Update event regions only once per frame https://bugs.webkit.org/show_bug.cgi?id=215132 <rdar://problem/66533779> Reviewed by Darin Adler. Event regions (for touch-action, editable areas etc) were updated as part of compositing updates, but we only need their output once per rendering update, so move their computation out of RenderLayerCompositor::updateBackingAndHierarchy() and into a new RenderLayer tree walk that is called from Page::doAfterUpdateRendering(). RenderLayerBacking stores a dirty bit to track when regions need to be updated. Reduces the amount of time spent in rendering updates when scrolling on facebook.com on iPad, which has lots of discontiguous touch-action regions. * dom/Document.cpp: (WebCore::Document::updateEventRegions): * dom/Document.h: * page/Frame.cpp: (WebCore::Frame::layerTreeAsText const): * page/Page.cpp: (WebCore::Page::doAfterUpdateRendering): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::maintainsEventRegion const): (WebCore::RenderLayerBacking::updateEventRegion): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateEventRegions): (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): * rendering/RenderLayerCompositor.h: 2020-08-05 Adrian Perez de Castro <aperez@igalia.com> Unreviewed non-unified build fix. No new tests needed. * Modules/webaudio/AudioListener.h: Add forward declaration for BaseAudioSharedUnit. 2020-08-05 Sihui Liu <sihui_liu@appe.com> TextManipulationController should observe newly inserted or displayed text https://bugs.webkit.org/show_bug.cgi?id=215157 Reviewed by Wenson Hsieh. TextManipulationController already tracks renderer state of Element, but the case where Text children of an Element is newly inserted and displayed is not covered. Therefore, TextManipulationController also needs to know when render of Text is created. API test: TextManipulation.CompleteTextManipulationForNewlyDisplayedText * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::didCreateRendererForTextNode): (WebCore::TextManipulationController::scheduleObservationUpdate): (WebCore::TextManipulationController::removeNode): * editing/TextManipulationController.h: * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::createTextRenderer): 2020-08-05 Youenn Fablet <youenn@apple.com> RegistrationDatabase::openSQLiteDatabase can spin https://bugs.webkit.org/show_bug.cgi?id=215120 <rdar://problem/64850347> Reviewed by Geoffrey Garen. In case we fail opening the database when importing, we delete the database, the file and retry. We do not need to retry in that case since there is nothing to import. Update the code to proceed with sending an import failure to SWServer. In case of pushing changes to the database, it might be useful to retry but it is best to do this asynchronously. For instance, there might be a script deleting the files/folders where is stored the database. In that case, we check the result of pushing changes. If they succeed, we call the completion handler and stop. Otherwise, we will retry pushing the changes if changes were not pushed again in the meantime. We introduce a push counter for that purpose. * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::postTaskToWorkQueue): (WebCore::RegistrationDatabase::openSQLiteDatabase): (WebCore::RegistrationDatabase::importRecordsIfNecessary): (WebCore::RegistrationDatabase::pushChanges): (WebCore::RegistrationDatabase::schedulePushChanges): (WebCore::RegistrationDatabase::doPushChanges): * workers/service/server/RegistrationDatabase.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::registrationStoreDatabaseFailedToOpen): 2020-08-05 Youenn Fablet <youenn@apple.com> SWServerJobQueue::didResolveRegistrationPromise should not assume its registration key relates to an existing worker https://bugs.webkit.org/show_bug.cgi?id=215123 <rdar://problem/65096786> Reviewed by Geoffrey Garen. We know that in some cases, the registration is null in SWServerJobQueue::didResolveRegistrationPromise. This might happen for instance in case a worker gets terminated, thus removing a job and the next job is clearing the registration. Also, SWServerJobQueue::didResolveRegistrationPromise is not checking that the job identifier is the same in SWServerJobQueue::install and SWServerJobQueue::didResolveRegistrationPromise while other code paths do. A future refactoring might allow to call SWServerJobQueue::didResolveRegistrationPromise code synchronously from SWServerJobQueue::install. In the meantime, let's add a null check and add release logging for that case. * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::install): (WebCore::SWServerJobQueue::didResolveRegistrationPromise): 2020-08-05 Rob Buis <rbuis@igalia.com> Allow multiple calls to PerformanceObserver.observe with different types https://bugs.webkit.org/show_bug.cgi?id=214884 Reviewed by Darin Adler. Allow multiple calls to PerformanceObserver.observe with different type, but throw an exception if the observer type is changed [1]. Behavior matches Firefox and Chrome. Test: imported/web-platform-tests/performance-timeline/po-observe-type.any.html [1] https://w3c.github.io/performance-timeline/#observe-method * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/PerformanceObserver.h: 2020-08-05 Youenn Fablet <youenn@apple.com> Update AudioSampleDataSource offset computation https://bugs.webkit.org/show_bug.cgi?id=215127 <rdar://problem/65938265> Reviewed by Eric Carlson. As per logs, it sometimes happens that the offset is so big that the timestamp is below the start of the window. In that case, our logic is not able to catch up and reduce the offset. To handle this, we special case if the timestamp is below the start frame and do as if we were starting from scratch. Otherwise, we continue our logic to fine tune the offset by slowly making it bigger to not hit the end of the window but still be close to it. Updated logging to help further debugging this issue if needed. * platform/audio/mac/AudioSampleDataSource.h: * platform/audio/mac/AudioSampleDataSource.mm: (WebCore::AudioSampleDataSource::pushSamplesInternal): (WebCore::computeOffsetDelay): (WebCore::AudioSampleDataSource::pullSamplesInternal): (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks): * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp: (WebCore::RealtimeIncomingAudioSourceCocoa::OnData): 2020-08-05 Eric Liang <ericliang@apple.com> AX: WebCore should provide a way to get raw role for accessibility objects https://bugs.webkit.org/show_bug.cgi?id=215149 Reviewed by Chris Fleizach. Added a conversion from WebRole to string for accessibility. This allows us to get it in the WebKit bundle. * accessibility/AXLogger.cpp: (WebCore::operator<<): * accessibility/AccessibilityObjectInterface.h: (WebCore::accessibilityRoleToString): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityElementCount]): (-[WebAccessibilityObjectWrapper _accessibilityWebRoleAsString]): (-[WebAccessibilityObjectWrapper accessibilityTraits]): 2020-08-04 Devin Rousso <drousso@apple.com> "DoubleDown Casino" respin button stops working with trackpad https://bugs.webkit.org/show_bug.cgi?id=215146 <rdar://problem/64668138> Reviewed by Tim Horton. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isDoubleDown): Added. 2020-08-04 Chris Dumez <cdumez@apple.com> Align AudioListener with the W3C specification https://bugs.webkit.org/show_bug.cgi?id=215134 Reviewed by Geoffrey Garen. Align AudioListener with the W3C specification: - https://webaudio.github.io/web-audio-api/#audiolistener Note that the prefixed API still behaves the way it used to. I have maintained the old version of the AudioListener API by moving it to a new WebKitAudioListener interface. No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioListener.cpp: (WebCore::AudioListener::AudioListener): (WebCore::AudioListener::setPosition): (WebCore::AudioListener::position const): (WebCore::AudioListener::setOrientation): (WebCore::AudioListener::orientation const): (WebCore::AudioListener::upVector const): * Modules/webaudio/AudioListener.h: (WebCore::AudioListener::create): (WebCore::AudioListener::positionX): (WebCore::AudioListener::positionY): (WebCore::AudioListener::positionZ): (WebCore::AudioListener::forwardX): (WebCore::AudioListener::forwardY): (WebCore::AudioListener::forwardZ): (WebCore::AudioListener::upX): (WebCore::AudioListener::upY): (WebCore::AudioListener::upZ): * Modules/webaudio/AudioListener.idl: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::constructCommon): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::dopplerRate): * Modules/webaudio/WebKitAudioContext.h: (WebCore::WebKitAudioContext::listener): * Modules/webaudio/WebKitAudioContext.idl: * Modules/webaudio/WebKitAudioListener.h: Copied from Source/WebCore/Modules/webaudio/AudioListener.h. * Modules/webaudio/WebKitAudioListener.idl: Copied from Source/WebCore/Modules/webaudio/AudioListener.idl. * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::listener): * Modules/webaudio/WebKitAudioPannerNode.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2020-08-04 Myles C. Maxfield <mmaxfield@apple.com> Add glyph origins member to GlyphBuffer https://bugs.webkit.org/show_bug.cgi?id=215057 Reviewed by Darin Adler. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. The solution for https://bugs.webkit.org/show_bug.cgi?id=214769 requires applying letter-spacing after text shaping. Today, we apply letter-spacing before text shaping, which is wrong. However, if we want to apply letter-spacing after text shaping, we need to use CTFontShapeGlyphs(), which outputs glyph origins in addition to glyph advances. Adding a glyph origins field to GlyphBuffer allows us to flatten these origins at the appropriate places. This patch is meant to be applied on top of https://bugs.webkit.org/show_bug.cgi?id=215051, which decreases the inline sizes of these vector members from 2048 to 1024. I measured the median and mean of these strings in our Page Load Test to be 6 and 7.4, which indicates we were being wildly inefficient with the members of GlyphBuffer. Decreasing these inline sizes means we're now using less memory than we were before. No new tests becasue there is no behavior change yet. This patch just adds the field. The next patch will hook up CTFontShapeGlyphs() itself. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::drawText const): (WebCore::FontCascade::drawEmphasisMarks const): (WebCore::FontCascade::displayListForTextRun const): (WebCore::FontCascade::drawGlyphBuffer const): * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBufferAdvance::GlyphBufferAdvance): (WebCore::GlyphBufferOrigin::GlyphBufferOrigin): (WebCore::GlyphBufferOrigin::operator FloatPoint): (WebCore::GlyphBufferOrigin::setX): (WebCore::GlyphBufferOrigin::setY): (WebCore::GlyphBufferOrigin::x const): (WebCore::GlyphBufferOrigin::y const): (WebCore::GlyphBufferOrigin::encode const): (WebCore::GlyphBufferOrigin::decode): (WebCore::GlyphBuffer::clear): (WebCore::GlyphBuffer::origins): (WebCore::GlyphBuffer::origins const): (WebCore::GlyphBuffer::add): (WebCore::GlyphBuffer::remove): (WebCore::GlyphBuffer::makeHole): (WebCore::GlyphBuffer::shrink): (WebCore::GlyphBuffer::flatten): (WebCore::GlyphBuffer::isFlattened const): (WebCore::GlyphBuffer::swap): * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawGlyphs): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const): 2020-08-04 Chris Fleizach <cfleizach@apple.com> AX: VoiceOver needs access to font styling at insertion point https://bugs.webkit.org/show_bug.cgi?id=215129 <rdar://problem/65114972> Reviewed by Darin Adler. Give access to relevant font styling properties at the insertion point so that VoiceOver can speak them when text commands alter styling. Test: accessibility/mac/resolved-text-editing.html * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::resolvedEditingStyles const): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilityResolvedEditingStyles]): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::resolvedEditingStyles const): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase baseAccessibilityResolvedEditingStyles]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 2020-08-04 Peng Liu <peng.liu6@apple.com> REGRESSION (r265019): ASSERTION FAILED: !m_impl || m_impl->wasConstructedOnMainThread() == isMainThread() under WebCore::PlaybackSessionInterfaceAVKit::invalidate() https://bugs.webkit.org/show_bug.cgi?id=215118 Reviewed by Jer Noble. Revert the change about using a WeakPtr of PlaybackSessionModel in r265019. On WK1, a VideoFullscreenControllerContext (a subclass of PlaybackSessionModel) object is created on the main thread, so we cannot use a WeakPtr of it on the UI thread. No new tests, fix an API test failure: WebKitLegacy.AudioSessionCategoryIOS. * platform/ios/PlaybackSessionInterfaceAVKit.h: * platform/ios/PlaybackSessionInterfaceAVKit.mm: (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit): (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const): 2020-08-04 Chris Dumez <cdumez@apple.com> Align AudioBufferSourceNode's start() / stop() with the specification https://bugs.webkit.org/show_bug.cgi?id=215130 Reviewed by Darin Adler. Align AudioBufferSourceNode's start() / stop() with the specification: - https://www.w3.org/TR/webaudio/#dom-audiobuffersourcenode-start - https://www.w3.org/TR/webaudio/#dom-audioscheduledsourcenode-stop In particular, we should throw a RangeError when the parameters are invalid, not an InvalidStateError. Also, we should not return early if there is no buffer. No new tests, rebaselined existing tests. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::startPlaying): * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::startLater): (WebCore::AudioScheduledSourceNode::stopLater): 2020-08-04 Andres Gonzalez <andresg_22@apple.com> Add the ability of comparing the accessibility tree with isolated tree mode on and off. https://bugs.webkit.org/show_bug.cgi?id=215000 Reviewed by Chris Fleizach. Test: accessibility/mac/isolated-tree-mode-on-off.html Added [WebAccessibilityObjectWrapper isIsolatedObject] for testing purposes, so that layout tests can determine whether an object is isolated or not. It should not be used by real clients since there should be no difference in behavior of a WebAccessibilityObjectWrapper from a client point of view, regardless the underlying object being isolated or not. * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase isIsolatedObject]): 2020-08-04 Chris Dumez <cdumez@apple.com> Move non standard AudioBufferSourceNode API to new WebKitAudioBufferSourceNode interface https://bugs.webkit.org/show_bug.cgi?id=215106 Reviewed by Eric Carlson. Move non standard AudioBufferSourceNode API to new WebKitAudioBufferSourceNode interface to maintain backward compatibility while having an unprefixed API that matches the specification: - https://www.w3.org/TR/webaudio/#AudioBufferSourceNode In particular the 'playbackState' and 'gain' attributes should not part of the standard. Test: webaudio/audiobuffersourcenode-legacy-api.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): (WebCore::AudioBufferSourceNode::process): (WebCore::AudioBufferSourceNode::reset): * Modules/webaudio/AudioBufferSourceNode.h: (WebCore::AudioBufferSourceNode::legacyGainValue const): * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/WebKitAudioBufferSourceNode.h: Copied from Source/WebCore/Modules/webaudio/AudioBufferSourceNode.idl. * Modules/webaudio/WebKitAudioBufferSourceNode.idl: Copied from Source/WebCore/Modules/webaudio/AudioBufferSourceNode.idl. * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createWebKitBufferSource): * Modules/webaudio/WebKitAudioContext.h: * Modules/webaudio/WebKitAudioContext.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2020-08-04 Youenn Fablet <youenn@apple.com> Remove AudioSampleDataSource::setPaused https://bugs.webkit.org/show_bug.cgi?id=215125 Reviewed by Geoffrey Garen. m_paused is unused except for setting m_transitioningFromPaused. setPaused is only used in AudioMediaStreamTrackRenderCocoa at creation of the source. We can remove the call for setPaused(true) and remove setPaused/m_paused. * platform/audio/mac/AudioSampleDataSource.h: * platform/audio/mac/AudioSampleDataSource.mm: (WebCore::AudioSampleDataSource::setPaused): Deleted. * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp: (WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples): 2020-08-04 Rob Buis <rbuis@igalia.com> Performance.getEntriesByName/Type should match case sensitive https://bugs.webkit.org/show_bug.cgi?id=214960 Reviewed by Youenn Fablet. Performance.getEntriesByName/Type should match case sensitive [1]. Behavior matches Firefox and Chrome. Tests: imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.html imported/w3c/web-platform-tests/performance-timeline/case-sensitivity.any.worker.html [1] https://w3c.github.io/performance-timeline/#getentriesbytype-method * page/Performance.cpp: (WebCore::Performance::getEntriesByType const): (WebCore::Performance::getEntriesByName const): 2020-08-03 Simon Fraser <simon.fraser@apple.com> m_isEditableRegionEnabled should be reset in didCommitLoad, not didFinishLoad https://bugs.webkit.org/show_bug.cgi?id=215115 Reviewed by Wenson Hsieh. Resetting m_isEditableRegionEnabled in didFinishLoad() is too late because inline script at the end of the <body> (e.g. in a layout test) will have already run before the reset. Fix by adding Page::didCommitLoad() and resetting m_isEditableRegionEnabled there. * loader/FrameLoader.cpp: (WebCore::FrameLoader::dispatchDidCommitLoad): * page/Page.cpp: (WebCore::Page::didCommitLoad): (WebCore::Page::didFinishLoad): * page/Page.h: 2020-08-03 Myles C. Maxfield <mmaxfield@apple.com> Unconditionally record string offsets in the fast text codepath https://bugs.webkit.org/show_bug.cgi?id=215051 Reviewed by Darin Adler. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. The solution for https://bugs.webkit.org/show_bug.cgi?id=214769 requires applying letter-spacing after text shaping. Today, we apply letter-spacing before text shaping, which is wrong. However, if we want to apply letter-spacing after text shaping, we will need a way of mapping back which shaped glyphs correspond to which characters in the string, so we can apply letter-spacing to the correct glyphs. Therefore, we need to record string offsets any time letter-spacing can be applied (which is all the time - letter spacing can be applied on any element). This also helps on the path toward https://bugs.webkit.org/show_bug.cgi?id=214769. When we move off the complex text codepath, we will need these string offsets to calculate things like what the text range of a selection is when the user has selected some glyphs on the page. There is no performance change because these string offsets were already being calculated; the difference is just that we're storing them now. Also, we were being wildly inefficient with the members of GlyphBuffer, giving them inline sizes of 2048. I measured the median and mean of these strings in our Page Load Test to be 6 and 7.4. So, I cut down the inline sizes down to 1024, so now we're using less memory than we were before. No new tests because there is no behavior change. The additional string offsets are unused (for now). A subsequent patch will start using them. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::layoutText const): (WebCore::FontCascade::drawEmphasisMarks const): (WebCore::computeUnderlineType): (WebCore::FontCascade::layoutSimpleText const): (WebCore::FontCascade::layoutComplexText const): (WebCore::FontCascade::dashesForIntersectionsWithRect const): * platform/graphics/FontCascade.h: * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::clear): (WebCore::GlyphBuffer::fonts): (WebCore::GlyphBuffer::offsetsInString): (WebCore::GlyphBuffer::fonts const): (WebCore::GlyphBuffer::offsetsInString const): (WebCore::GlyphBuffer::glyphAt const): (WebCore::GlyphBuffer::advanceAt const): (WebCore::GlyphBuffer::stringOffsetAt const): (WebCore::GlyphBuffer::add): (WebCore::GlyphBuffer::remove): (WebCore::GlyphBuffer::makeHole): (WebCore::GlyphBuffer::expandLastAdvance): (WebCore::GlyphBuffer::shrink): (WebCore::GlyphBuffer::swap): (WebCore::GlyphBuffer::saveOffsetsInString): Deleted. (WebCore::GlyphBuffer::offsetInString const): Deleted. 2020-08-03 Myles C. Maxfield <mmaxfield@apple.com> Rename WidthIterator::m_currentCharacter to WidthIterator::m_currentCharacterIndex https://bugs.webkit.org/show_bug.cgi?id=215056 Reviewed by Darin Adler. It represents an index, not a character. No new tests because there is no behavior change. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::offsetForPositionForSimpleText const): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::advanceInternal): (WebCore::WidthIterator::advance): (WebCore::WidthIterator::advanceOneCharacter): * platform/graphics/WidthIterator.h: (WebCore::WidthIterator::currentCharacterIndex const): (WebCore::WidthIterator::currentCharacter const): Deleted. 2020-08-03 Youenn Fablet <youenn@apple.com> Move user gesture propagation over promise behind a feature flag https://bugs.webkit.org/show_bug.cgi?id=215014 Reviewed by Eric Carlson. If runtime flag is false, disable user gesture propagation to the next micro task. * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::queueMicrotaskToEventLoop): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::userGesturePromisePropagationEnabled const): (WebCore::RuntimeEnabledFeatures::setUserGesturePromisePropagationEnabled): 2020-08-03 Chris Dumez <cdumez@apple.com> Add constructor for AudioBufferSourceNode https://bugs.webkit.org/show_bug.cgi?id=215096 Reviewed by Darin Adler. Add constructor for AudioBufferSourceNode as per: - https://www.w3.org/TR/webaudio/#DelayNode This patch also adds support for the detune attribute on AudioBufferSourceNode, which gets initialized by the constructor. No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::create): (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): (WebCore::AudioBufferSourceNode::process): (WebCore::AudioBufferSourceNode::reset): (WebCore::AudioBufferSourceNode::totalPitchRate): * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioBufferSourceOptions.h: Copied from Source/WebCore/Modules/webaudio/AudioBufferSourceNode.idl. * Modules/webaudio/AudioBufferSourceOptions.idl: Copied from Source/WebCore/Modules/webaudio/AudioBufferSourceNode.idl. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createBufferSource): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-03 Simon Fraser <simon.fraser@apple.com> Add an EventRegions log channel https://bugs.webkit.org/show_bug.cgi?id=215092 Reviewed by Daniel Bates. Add a log channel for EventRegions, add logging in some interesting places. * platform/Logging.h: * rendering/EventRegion.cpp: (WebCore::EventRegion::unite): (WebCore::EventRegion::uniteTouchActions): (WebCore::EventRegion::uniteEventListeners): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintObject): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateEventRegion): 2020-08-03 Myles C. Maxfield <mmaxfield@apple.com> Make FontCascade.drawText() return a FloatSize instead of a float https://bugs.webkit.org/show_bug.cgi?id=215055 Reviewed by Darin Adler. Advances are philosophically two-dimensional data structures. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. No new tests because there shouldn't be any behavior change. But in the weird rare case where there might be, we should be defensive and handle it correctly. I've never seen one of these cases, though. * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::drawElementTitle): * page/DebugPageOverlays.cpp: (WebCore::drawRightAlignedText): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::drawText const): * platform/graphics/FontCascade.h: * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawText): (WebCore::GraphicsContext::drawBidiText): * platform/graphics/GraphicsContext.h: 2020-08-03 Tim Horton <timothy_horton@apple.com> Occasional crashes when running nested runloops while using UIWebView https://bugs.webkit.org/show_bug.cgi?id=213067 <rdar://problem/64239727> Reviewed by Darin Adler. New test: WebKitLegacy.NestedRunLoopUnderRunLoopObserverDoubleUnlock * platform/ios/wak/WebCoreThread.mm: (MainRunLoopAutoUnlock): (_WebThreadAutoLock): Under certain circumstances, a CFRunLoopObserver that is already removed can fire again (e.g. when removed in a nested runloop, it can be fired again in the main runloop). The WebThread code assumes that the auto-unlock observer is called exactly once after being installed. If this is not the case, the main thread lock count can underflow, wreaking havoc the next time we try to lock. Instead of depending on CFRunLoop to do this for us, make it explicit with a global boolean. This leaves in place the somewhat-odd behavior that running a nested runloop can cause the main runloop's WebThread lock to be dropped, because a great deal of code (and tests) depend on this behavior (keeping the lock held until the outer runloop spins would result in deadlock if the inner runloop's loop condition depends on the WebThread being able to execute code). However, this is not unique to this underflow case, and appears to be extremely long-standing behavior, so maintaining it seems the best course of action. 2020-08-03 Wenson Hsieh <wenson_hsieh@apple.com> Remove the ENABLE_DATA_INTERACTION feature flag https://bugs.webkit.org/show_bug.cgi?id=215091 Reviewed by Megan Gardner. `ENABLE(DATA_INTERACTION)` is an alias for `PLATFORM(IOS_FAMILY) && ENABLE(DRAG_SUPPORT)`. It was used early on when bringing drag and drop support to iPad in order to hide the feature from open source WebKit code, and has not been necessary for several years. * page/DragController.cpp: (WebCore::DragController::shouldUseCachedImageForDragImage const): * page/DragController.h: (WebCore::DragController::canLoadDataFromDraggingPasteboard const): * page/EventHandler.cpp: (WebCore::EventHandler::dragCancelled): (WebCore::EventHandler::didStartDrag): * page/FocusController.cpp: (WebCore::shouldClearSelectionWhenChangingFocusedElement): * page/mac/DragControllerMac.mm: * platform/DragImage.cpp: * platform/ios/WebItemProviderPasteboard.mm: 2020-08-03 Chris Dumez <cdumez@apple.com> Add constructor for GainNode https://bugs.webkit.org/show_bug.cgi?id=215093 Reviewed by Eric Carlson. Add constructor for GainNode as per: - https://www.w3.org/TR/webaudio/#gainnode No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createGain): * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::create): (WebCore::GainNode::GainNode): (WebCore::GainNode::process): (WebCore::GainNode::reset): * Modules/webaudio/GainNode.h: * Modules/webaudio/GainNode.idl: * Modules/webaudio/GainOptions.h: Copied from Source/WebCore/Modules/webaudio/GainNode.idl. * Modules/webaudio/GainOptions.idl: Copied from Source/WebCore/Modules/webaudio/GainNode.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-03 Chris Dumez <cdumez@apple.com> Add constructor to DelayNode https://bugs.webkit.org/show_bug.cgi?id=215083 Reviewed by Eric Carlson. Add constructor to DelayNode: - https://www.w3.org/TR/webaudio/#DelayNode No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createDelay): * Modules/webaudio/DelayDSPKernel.cpp: (WebCore::DelayDSPKernel::process): * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::DelayNode): (WebCore::DelayNode::create): (WebCore::DelayNode::delayTime): * Modules/webaudio/DelayNode.h: * Modules/webaudio/DelayNode.idl: * Modules/webaudio/DelayOptions.h: Copied from Source/WebCore/Modules/webaudio/DelayNode.idl. * Modules/webaudio/DelayOptions.idl: Copied from Source/WebCore/Modules/webaudio/DelayNode.idl. * Modules/webaudio/DelayProcessor.cpp: (WebCore::DelayProcessor::DelayProcessor): * Modules/webaudio/DelayProcessor.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-03 Myles C. Maxfield <mmaxfield@apple.com> Make WidthIterator::advance() return void https://bugs.webkit.org/show_bug.cgi?id=215053 Reviewed by Darin Adler. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769 and https://bugs.webkit.org/show_bug.cgi?id=206208. This is a small simplification in the fast text codepath. It used to return how many characters were consumed. However, this information is already exposed by just calling currentCharacter() on the width iterator before and after calling advance(). No new tests because there is no behavior change. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::drawText const): (WebCore::FontCascade::displayListForTextRun const): (WebCore::FontCascade::layoutSimpleText const): (WebCore::FontCascade::adjustSelectionRectForSimpleText const): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::advanceInternal): (WebCore::WidthIterator::advance): * platform/graphics/WidthIterator.h: * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::advanceSimpleText): 2020-08-03 Youenn Fablet <youenn@apple.com> MediaRecorderPrivateWriter should ensure its writer input is ready for more data before appending new samples https://bugs.webkit.org/show_bug.cgi?id=215081 Reviewed by Eric Carlson. After r265192, we were checking whether the writer input was ready. If so, we were pushing pending samples and then the new sample. The issue is that pushing pending samples might make the writer input no longer ready. Update the code to enqueue the sample if its writer input is not ready. Add an ASSERT in appendCompressedVideoSampleBuffer to make sure this is the case. Also make sure that we only enqueue the end of segment sample if video writer input is ready. Make sure flushCompressedSampleBuffers is called directly by stopRecording only if not already flushing samples. If we are not flushing, we proceed with the stop steps. If not, we wait for the end of flushCompressedSampleBuffers to proceed with the stop steps. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBufferIfPossible): (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBufferIfPossible): (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers): (WebCore::MediaRecorderPrivateWriter::stopRecording): (WebCore::MediaRecorderPrivateWriter::finishedFlushingSamples): (WebCore::MediaRecorderPrivateWriter::doStopRecording): 2020-08-03 Clark Wang <clark_wang@apple.com> Added AudioBuffer Constructor https://bugs.webkit.org/show_bug.cgi?id=214990 Reviewed by Chris Dumez. Added AudioBuffer constructor according to spec: https://www.w3.org/TR/webaudio/#AudioBuffer-constructors. Added in AudioBufferOptions files. Updated BaseAudioContext::createBuffer to use new constructor. Re-baselined existing tests. Some fail now due to unsupported sampleRate. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::create): (WebCore::AudioBuffer::AudioBuffer): * Modules/webaudio/AudioBuffer.h: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioBufferOptions.h: Added. * Modules/webaudio/AudioBufferOptions.idl: Added. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createBuffer): * Modules/webaudio/BaseAudioContext.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-03 Kenneth Russell <kbr@chromium.org> [WebGL2] webgl/2.0.0/conformance[2]/textures/image_bitmap* failures https://bugs.webkit.org/show_bug.cgi?id=211484 Reviewed by Dean Jackson. Implement ImageBitmapOptions' ImageOrientation and PremultiplyAlpha settings. ImageOrientation="flipY" is supported directly while constructing ImageBitmap's representation, ImageBuffer. PremultiplyAlpha="premultiply" can not be supported via ImageBuffer's graphics operations, so this attribute is stored on ImageBitmap, serialized and deserialized when ImageBitmap is transferred, and handled in the WebGL implementation. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpImageBitmap): (WebCore::CloneDeserializer::deserialize): (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::CloneDeserializer::readImageBitmap): (WebCore::SerializedScriptValue::SerializedScriptValue): * bindings/js/SerializedScriptValue.h: (WebCore::SerializedScriptValue::SerializedScriptValue): * html/ImageBitmap.cpp: (WebCore::ImageBitmap::create): (WebCore::ImageBitmap::detachBitmaps): (WebCore::imageOrientationForOrientation): (WebCore::ImageBitmap::createPromise): (WebCore::ImageBitmap::createFromBuffer): * html/ImageBitmap.h: * html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::transferToImageBitmap): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texImageSourceHelper): * platform/graphics/ImageBuffer.h: 2020-08-03 Brian Burg <bburg@apple.com> [WebDriver] window.print should not invoke native UI https://bugs.webkit.org/show_bug.cgi?id=215084 Reviewed by Devin Rousso. This could be handled at a higher level if there is a valid use case to allow printing, but I'm not aware of one. For now, this fixes a script evaluation hang on Mac and iOS. * page/DOMWindow.cpp: (WebCore::DOMWindow::print): Don't call out to print delegates if this is a WebDriver-controlled page. 2020-08-03 Rob Buis <rbuis@igalia.com> Remove unused API in HighlightMap https://bugs.webkit.org/show_bug.cgi?id=215078 Reviewed by Sam Weinig. Remove unused API in HighlightMap, this is probably not needed anymore since the maplike code changed at some point. * Modules/highlight/HighlightMap.cpp: (WebCore::HighlightMap::getGroupForKey): Deleted. * Modules/highlight/HighlightMap.h: 2020-08-03 James Darpinian <jdarpinian@chromium.org> [WebGL2] Assert when restoring lost context https://bugs.webkit.org/show_bug.cgi?id=214999 Reviewed by Darin Adler. Remove an assert that was wrong when restoring a lost context. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects): 2020-08-03 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes, early August 20202 edition https://bugs.webkit.org/show_bug.cgi?id=215082 Unreviewed build fix. No new tests needed. * accessibility/AccessibilityRenderObject.cpp: Add missing inclusion of Range.h. * dom/RadioButtonGroups.cpp: Ditto. * editing/Editing.cpp: Ditto. * editing/EditingStyle.cpp: Ditto. * editing/EditorCommand.cpp: Ditto. * editing/FrameSelection.cpp: Ditto. * editing/TypingCommand.cpp: Ditto. * editing/VisiblePosition.cpp: Add missing inclusion of SimpleRange.h. * rendering/HitTestResult.cpp: Add missing inclusion of Range.h. 2020-08-03 Antti Koivisto <antti@apple.com> REGRESSION(r259585) Text decoration color with value currentColor miscomputed in some cases https://bugs.webkit.org/show_bug.cgi?id=215079 Reviewed by Zalan Bujtas. r259585 did some refactoring that broke a special case where text decoration color comes from '-webkit-text-fill-color' property. Test: fast/text/text-decoration-currentcolor-fill-color.html * rendering/TextDecorationPainter.cpp: (WebCore::TextDecorationPainter::decorationColor): Move resolving currentColor to RenderStyle. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::colorResolvingCurrentColor const): Handle CSSPropertyTextDecorationColor as a special case here. (WebCore::RenderStyle::visitedDependentColor const): 2020-08-03 Clark Wang <clark_wang@apple.com> Added Constructor to AnalyserNode https://bugs.webkit.org/show_bug.cgi?id=215040 Reviewed by Chris Dumez. Introduced AnalyserNode constructor and AnalyserOptions according to spec: https://www.w3.org/TR/webaudio/#AnalyserNode-constructors. Re-baselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::create): (WebCore::AnalyserNode::AnalyserNode): (WebCore::AnalyserNode::setFftSize): (WebCore::AnalyserNode::setMinMaxDecibels): (WebCore::AnalyserNode::setMinDecibels): (WebCore::AnalyserNode::setMaxDecibels): * Modules/webaudio/AnalyserNode.h: * Modules/webaudio/AnalyserNode.idl: * Modules/webaudio/AnalyserOptions.h: Added. * Modules/webaudio/AnalyserOptions.idl: Added. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createAnalyser): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-08-03 Youenn Fablet <youenn@apple.com> MediaRecorderPrivateWriter::appendEndOfVideoSampleDurationIfNeeded should only call requestMediaDataWhenReadyOnQueue once https://bugs.webkit.org/show_bug.cgi?id=214972 Reviewed by Eric Carlson. When processing a compressed sample, pass it to the writer if its ready. Otherwise buffer it and retry passing it to the writer next time we have a sample. When finishing a write, we call requestMediaDataWhenReadyOnQueue to finish passing samples that are still enqueued. Covered by existing tests no longer triggering ObjC exception. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBufferIfPossible): (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendCompressedSampleBuffers): (WebCore::MediaRecorderPrivateWriter::finishAppendingCompressedAudioSampleBuffers): (WebCore::MediaRecorderPrivateWriter::finishAppendingCompressedVideoSampleBuffers): (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers): 2020-08-02 Darin Adler <darin@apple.com> Remove some member functions of Range and many calls to createLiveRange https://bugs.webkit.org/show_bug.cgi?id=215070 Reviewed by Sam Weinig. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::nextBoundary): Remove createLiveRange. (WebCore::AXObjectCache::previousBoundary): Ditto. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _convertToNSRange:]): Take SimpleRange. (-[WebAccessibilityObjectWrapper positionForTextMarker:]): Remove createLiveRange. (-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]): Ditto. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper _convertToNSRange:]): Take SimpleRange. (-[WebAccessibilityObjectWrapper _indexForTextMarker:]): Remove createLiveRange. (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]): Ditto. * dom/DocumentMarkerController.cpp: (WebCore::updateRenderedRectsForMarker): Renamed range to makeSimpleRange. (WebCore::makeSimpleRange): Ditto. * dom/DocumentMarkerController.h: Update for the above. * dom/Range.cpp: (WebCore::Range::text const): Use makeSimpleRange. (WebCore::Range::shadowRoot const): Deleted. (WebCore::intervalsSufficientlyOverlap): Deleted. (WebCore::adjustLineHeightOfSelectionRects): Deleted. (WebCore::coalesceSelectionRects): Deleted. (WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines const): Deleted. (WebCore::Range::collectSelectionRects const): Deleted. * dom/Range.h: Update for the above. Also make pastLastNode private since it is only used inside the Range class's implementation. * dom/SimpleRange.cpp: (WebCore::SimpleRange::SimpleRange): Removed overload that takes a Range. * dom/SimpleRange.h: Update for the above. Removed both constructor overloads that take a Range. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::timerFired): Remove createLiveRange. (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): Use makeSimpleRange. (WebCore::AlternativeTextController::applyAlternativeTextToRange): Remove createLiveRange. * editing/EditingStyle.cpp: (WebCore::EditingStyle::styleAtSelectionStart): Remove createLiveRange. * editing/Editor.cpp: (WebCore::Editor::performCutOrCopy): Ditto. (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Ditto. (WebCore::Editor::replaceRangeForSpellChecking): Ditto. (WebCore::correctSpellcheckingPreservingTextCheckingParagraph): Ditto. (WebCore::Editor::changeBackToReplacedString): Ditto. (WebCore::Editor::countMatchesForText): Ditto. * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::doApply): Ditto. (WebCore::InsertListCommand::doApplyForSingleParagraph): Change out argument type to SimpleRange. * editing/InsertListCommand.h: Update for above. * editing/SpellChecker.cpp: (WebCore::SpellChecker::isCheckable const): Rewrite questionable logic to use intersectingNodes instead of firstNode. * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findUngrammaticalPhrases const): Remove createLiveRange. * editing/TypingCommand.cpp: (WebCore::TypingCommand::deleteKeyPressed): Ditto. (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto. * editing/markup.cpp: (WebCore::createFragmentFromText): Ditto. * editing/ios/EditorIOS.mm: (WebCore::Editor::setTextAsChildOfElement): Use makeRangeSelectingNodeContents. * editing/win/EditorWin.cpp: (WebCore::Editor::pasteWithPasteboard): Remove createLiveRange. * page/DOMSelection.cpp: (WebCore::DOMSelection::addRange): Use makeSimpleRange. (WebCore::DOMSelection::deleteFromDocument): Remove createLiveRange. * page/DragController.cpp: (WebCore::documentFragmentFromDragData): Take SimpleRange. (WebCore::DragController::concludeEditDrag): Remove createLiveRange. (WebCore::DragController::startDrag): Ditto. * page/TextIndicator.cpp: (WebCore::selectionRects): Deleted. (WebCore::initializeIndicator): Call collectSelectionRects directly here, avoiding createLiveRange and using map to convert from Vector<SelectionRect> to Vector<FloatRect>. * page/ios/FrameIOS.mm: (WebCore::Frame::interpretationsForCurrentRoot const): Use makeSimpleRange. * platform/DragImage.cpp: (WebCore::createDragImageForRange): Take SimpleRange. * platform/DragImage.h: Update createDragImageForRange to take SimpleRange. * platform/Pasteboard.h: Updated Windows-only layering-violating functions to take SimpleRange. * platform/ios/DragImageIOS.mm: (WebCore::createDragImageForRange): Take SimpleRange. * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeRangeToDataObject): Take SimpleRange. (WebCore::Pasteboard::writeSelection): Ditto. (WebCore::Pasteboard::documentFragment): Ditto. * rendering/RenderObject.cpp: (WebCore::intervalsSufficientlyOverlap): Added. Moved from Range. Mostly unchanged but uses SimpleRange now instead of a live range, and intersectingNodes instead of a loop using firstNode and pastLastNode. (WebCore::adjustLineHeightOfSelectionRects): Ditto. (WebCore::coalesceSelectionRects): Ditto. (WebCore::RenderObject::collectSelectionRectsWithoutUnionInteriorLines): Ditto. (WebCore::RenderObject::collectSelectionRectsInternal): Ditto. (WebCore::RenderObject::collectSelectionRects): Ditto. * rendering/RenderObject.h: Update for above. * testing/Internals.cpp: (WebCore::Internals::markerRangeForNode): Use makeSimplRange. (WebCore::Internals::locationFromRange): Ditto. (WebCore::Internals::lengthFromRange): Ditto. (WebCore::Internals::rangeAsTextUsingBackwardsTextIterator): Ditto. (WebCore::Internals::subrange): Ditto. (WebCore::Internals::rangeOfStringNearLocation): Ditto. (WebCore::Internals::textIndicatorForRange): Ditto. 2020-08-02 Wenson Hsieh <wenson_hsieh@apple.com> Table data is incorrectly translated in some articles on en.wikipedia.org https://bugs.webkit.org/show_bug.cgi?id=215071 <rdar://problem/66354013> Reviewed by Darin Adler. Text in table cells sometimes end up in adjacent cells after translation, since adjacent cells are currently extracted as different tokens in a single item; mitigate this by splitting text in table cells into different text manipulation items instead. Test: TextManipulation.StartTextManipulationExtractsTableCellsAsSeparateItems * editing/TextManipulationController.cpp: (WebCore::isEnclosingItemBoundaryElement): 2020-08-01 Rob Buis <rbuis@igalia.com> Remove superfluous ResourceTiming constructor overload https://bugs.webkit.org/show_bug.cgi?id=215063 Reviewed by Sam Weinig. Remove superfluous ResourceTiming constructor overload, we can just call another overload from ResourceTiming::fromLoad. * loader/ResourceTiming.cpp: (WebCore::ResourceTiming::fromLoad): * loader/ResourceTiming.h: 2020-08-01 Brady Eidson <beidson@apple.com> Special HID mapping for the Logitech F310/F710 controllers. https://bugs.webkit.org/show_bug.cgi?id=215050 Reviewed by Tim Horton. Covered by API test. These two controllers match the standard mapping perfectly. Easy to support. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/gamepad/KnownGamepads.h: * platform/gamepad/mac/GamepadConstantsMac.h: * platform/gamepad/mac/HIDGamepad.cpp: (WebCore::HIDGamepad::create): * platform/gamepad/mac/HIDGamepadElement.cpp: (WebCore::HIDGamepadElement::HIDGamepadElement): * platform/gamepad/mac/HIDGamepadElement.h: (WebCore::HIDGamepadElement::isAxis const): * platform/gamepad/mac/LogitechGamepad.cpp: Added. (WebCore::LogitechGamepadHatswitch::gamepadValueChanged): (WebCore::LogitechGamepad::LogitechGamepad): * platform/gamepad/mac/LogitechGamepad.h: 2020-08-01 Joonghun Park <jh718.park@samsung.com> Unreviewed. Remove the build warnings below since r265150. warning: unused parameter ‘foo’ [-Wunused-parameter] No new tests, no new behaviors. * workers/service/server/SWServerJobQueue.cpp: (WebCore::doCertificatesMatch): 2020-08-01 Brady Eidson <beidson@apple.com> Special HID mapping for the Google Stadia controller https://bugs.webkit.org/show_bug.cgi?id=215061 Reviewed by Tim Horton. New API test coverage. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/gamepad/GamepadConstants.h: * platform/gamepad/KnownGamepads.h: * platform/gamepad/mac/GamepadConstantsMac.h: * platform/gamepad/mac/HIDGamepad.cpp: (WebCore::HIDGamepad::create): * platform/gamepad/mac/HIDGamepadElement.cpp: (WebCore::HIDGamepadElement::HIDGamepadElement): (WebCore::HIDGamepadHatswitch::gamepadValueChanged): (WebCore::HIDGamepadHatswitch::normalizedValue): * platform/gamepad/mac/HIDGamepadElement.h: (WebCore::HIDGamepadElement::isAxis const): (WebCore::HIDGamepadHatswitch::HIDGamepadHatswitch): * platform/gamepad/mac/StadiaHIDGamepad.cpp: Added. (WebCore::StadiaHIDGamepad::StadiaHIDGamepad): * platform/gamepad/mac/StadiaHIDGamepad.h: 2020-08-01 Sam Weinig <weinig@apple.com> Convert LinkHeader to use StringParsingBuffer https://bugs.webkit.org/show_bug.cgi?id=215017 Reviewed by Darin Adler. Update LinkHeader parsing to use StringParsingBuffer and do some light cleanup. * loader/LinkHeader.cpp: (WebCore::isSpaceOrTab): (WebCore::isNotURLTerminatingChar): (WebCore::isValidParameterNameChar): (WebCore::isParameterValueEnd): (WebCore::isParameterValueChar): (WebCore::findURLBoundaries): (WebCore::invalidParameterDelimiter): (WebCore::validFieldEnd): (WebCore::parseParameterDelimiter): (WebCore::paramterNameFromString): (WebCore::parseParameterName): (WebCore::skipQuotesIfNeeded): (WebCore::parseParameterValue): (WebCore::findNextHeader): (WebCore::LinkHeader::LinkHeader): (WebCore::LinkHeaderSet::LinkHeaderSet): (WebCore::LinkHeaderSet::init): Deleted. * loader/LinkHeader.h: 2020-08-01 Darin Adler <darin@apple.com> Remove Range::create and many more uses of live ranges https://bugs.webkit.org/show_bug.cgi?id=215004 Reviewed by Sam Weinig. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange const): Use makeSimpleRange. * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::nodeTextChangePlatformNotification): Use SimpleRange. * accessibility/atk/WebKitAccessibleHyperlink.cpp: (rangeLengthForObject): Take SimpleRange. (webkitAccessibleHyperlinkGetStartIndex): Use makeSimpleRange. (webkitAccessibleHyperlinkGetEndIndex): Ditto. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (getSelectionOffsetsForObject): Ditto. * accessibility/atk/WebKitAccessibleUtil.cpp: (objectFocusedAndCaretOffsetUnignored): Ditto. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (+[WebAccessibilityTextMarker startOrEndTextMarkerForRange:isStart:cache:]): Take SimpleRange. (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]): Use makeSimpleRange. (-[WebAccessibilityObjectWrapper _convertToDOMRange:]): Return SimpleRange. (-[WebAccessibilityObjectWrapper textMarkerRange]): Remove createLiveRange. (-[WebAccessibilityObjectWrapper textMarkerForPosition:]): Use auto. (-[WebAccessibilityObjectWrapper misspellingTextMarkerRange:forward:]): Remove createLiveRange. (-[WebAccessibilityObjectWrapper rangeFromMarkers:withText:]): Return SimpleRange. (-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]): Add createLiveRange. (-[WebAccessibilityObjectWrapper rangeForTextMarkers:]): Return SimpleRange. (-[WebAccessibilityObjectWrapper startOrEndTextMarkerForTextMarkers:isStart:]): Use auto. (-[WebAccessibilityObjectWrapper textMarkerRangeForMarkers:]): Get rid of local. (-[WebAccessibilityObjectWrapper textMarkersForRange:]): Take SimpleRange. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (accessibilityTextOperationForParameterizedAttribute): Remove makeSimpleRange. (accessibilityMisspellingSearchCriteriaForParameterizedAttribute): Return SimpleRange. (-[WebAccessibilityObjectWrapper textMarkerRangeFromRange:]): Take SimpleRange. (textMarkerRangeFromRange): Ditto. (-[WebAccessibilityObjectWrapper startOrEndTextMarkerForRange:isStart:]): Ditto. (startOrEndTextmarkerForRange): Return SimpleRange. (-[WebAccessibilityObjectWrapper rangeForTextMarkerRange:]): Ditto. (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]): Use auto. (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]): Remove createLiveRange. (-[WebAccessibilityObjectWrapper textMarkerRangeAtTextMarker:forUnit:]): Ditto. (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): Ditto. * dom/DocumentMarkerController.cpp: (WebCore::updateRenderedRectsForMarker): Use document marker range function. (WebCore::range): Added. * dom/DocumentMarkerController.h: Update for above. * dom/Position.cpp: Removed unneeded Range.h include. * dom/Range.cpp: (WebCore::Range::Range): Removed unused overload that takes start/end. (WebCore::Range::create): Removed overloads that take start/end. (WebCore::Range::setStart): Removed overload that takes Position. (WebCore::Range::setEnd): Ditto. (WebCore::Range::cloneRange const): Rewrote to use setStart/End since that's what the constructor used to do. (WebCore::Range::contains const): Use SimpleRange/createLiveRange instead of makeRange. Soon this function will be deleted. (WebCore::rangeOfContents): Deleted. (WebCore::createLiveRange): Rewrote to use setStart/End since that's what the constructor used to do. * dom/Range.h: Update for above removals. * dom/SimpleRange.h: Export commonInclusiveAncestor for use outside WebCore. * dom/StaticRange.cpp: (WebCore::StaticRange::create): Added overload that copies the SimpleRange. * dom/StaticRange.h: Update for above. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): Use document marker range function. * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle): Use makeSimpleRange. * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::mergeParagraphs): Ditto. (WebCore::DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection): Ditto. * editing/EditingStyle.cpp: (WebCore::EditingStyle::textDirectionForSelection): Use makeSimpleRange and intersectingNodes. * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): Use makeRangeSelectingNodeContents. (WebCore::Editor::updateMarkersForWordsAffectedByEditing): Use makeSimpleRange. (WebCore::Editor::transpose): Ditto. (WebCore::Editor::rangeOfString): Use makeRangeSelectingNodeContents. (WebCore::Editor::handleAcceptedCandidate): Update since rangeForTextCheckingResult now returns an Optional<SimpleRange>. * editing/FrameSelection.cpp: (WebCore::FrameSelection::selectRangeOnElement): Use SimpleRange. * editing/ReplaceRangeWithTextCommand.cpp: (WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand): Take SimpleRange. (WebCore::ReplaceRangeWithTextCommand::willApplyCommand): Update since m_rangeToBeReplaced is a SimpleRange. (WebCore::ReplaceRangeWithTextCommand::doApply): Ditto. (WebCore::ReplaceRangeWithTextCommand::targetRanges const): Ditto. * editing/ReplaceRangeWithTextCommand.h: Update for above. * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::insertedContentRange const): Return a SimpleRange. * editing/ReplaceSelectionCommand.h: Update for above. * editing/SpellingCorrectionCommand.cpp: (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand): Take a SimpleRange. (WebCore::SpellingCorrectionCommand::create): Moved here from header. * editing/SpellingCorrectionCommand.h: Update for above. * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspelledWordOrUngrammaticalPhrase const): Use makeSimpleRange. * editing/TypingCommand.cpp: (WebCore::TypingCommand::markMisspellingsAfterTyping): Use makeSimpleRange. (WebCore::TypingCommand::willAddTypingToOpenCommand): Take SimpleRange. (WebCore::TypingCommand::deleteKeyPressed): Remove createLiveRange. (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto. * editing/TypingCommand.h: Update for above. * editing/VisiblePosition.cpp: (WebCore::makeRange): Deleted. (WebCore::startVisiblePosition): Deleted. (WebCore::endVisiblePosition): Deleted. (WebCore::setStart): Deleted. (WebCore::setEnd): Deleted. * editing/VisiblePosition.h: Update for above. Also export makeSimpleRange for use outside WebCore. * editing/VisibleUnits.cpp: (WebCore::suffixLengthForRange): Take SimpleRange. (WebCore::prefixLengthForRange): Ditto. (WebCore::previousBoundary): Use makeSimpleRange. (WebCore::nextBoundary): Ditto. * editing/VisibleUnits.h: Update for above. * editing/cocoa/DataDetection.mm: (WebCore::buildQuery): Remove unused local variable. * editing/ios/EditorIOS.mm: (WebCore::Editor::setDictationPhrasesAsChildOfElement): Use makeRangeSelectingNodeContents. * page/DOMSelection.cpp: (WebCore::DOMSelection::getRangeAt): Use createLiveRange. * page/DragController.cpp: (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret): Remove makeSimpleRange. * page/Frame.cpp: (WebCore::Frame::rangeForPoint): Return SimpleRange. * page/Frame.h: Update for above. * page/ios/FrameIOS.mm: (WebCore::Frame::interpretationsForCurrentRoot const): Use makeRangeSelectingNodeContents, intersectingNodes, and makeSimpleRange. * testing/Internals.cpp: (WebCore::Internals::markerRangeForNode): Use createLiveRange and the document marker range function. 2020-07-31 Jer Noble <jer.noble@apple.com> [Mac] AudioSessionRoutingArbitrator causes a launch time regression checking for CoreAudio muted state https://bugs.webkit.org/show_bug.cgi?id=214993 Reviewed by Eric Carlson. The initial query of isMuted() is only there to tell whether, when we get a notification that the mute state changed, whether our internal state is dirty and we need to fire a notification. Instead, replace the bool member with an Optional<bool>, so we know we need to fire a changed notification whenever the first mute state change comes in. * platform/audio/mac/AudioSessionMac.mm: (WebCore::AudioSession::AudioSession): (WebCore::AudioSession::handleMutedStateChange): (WebCore::AudioSessionPrivate::AudioSessionPrivate): Deleted. 2020-07-31 Jer Noble <jer.noble@apple.com> Unreviewed Windows build fix after r265167; add some missing includes. * page/Screen.cpp: 2020-07-31 Myles C. Maxfield <mmaxfield@apple.com> Clean up text layout code a bit https://bugs.webkit.org/show_bug.cgi?id=215013 Reviewed by Zalan Bujtas. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=214769. See file-specific ChangeLog entries for more information. No tests because there is no behavior change. * platform/graphics/Font.h: Remove unnecessary declaration. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::layoutText const): Rename glyphBufferForTextRun() to layoutText(). Also, make it return a GlyphBuffer instead of taking a GlyphBuffer as an out param. Its previous return, the initial advance, is now returned in GlyphBuffer::initialAdvance. (WebCore::FontCascade::drawText const): Update to new signature of layoutText(). (WebCore::FontCascade::drawEmphasisMarks const): Inline drawEmphasisMarksForSimpleText() and drawEmphasisMarksForComplexText(), since they're nearly identical. Update to the new signature of layoutText(). (WebCore::FontCascade::displayListForTextRun const): Update to the new signature of layoutText(). (WebCore::FontCascade::layoutSimpleText const): Make this return a new GlyphBuffer, instead of taking one as an out param. Also, use accessors of WidthIterator instead of reaching into its guts. The previous return value is now returned in GlyphBuffer::initialAdvance. (WebCore::FontCascade::layoutComplexText const): Ditto. (WebCore::FontCascade::floatWidthForSimpleText const): Use accessors of WidthIterator instead of reaching into its guts. (WebCore::FontCascade::adjustSelectionRectForSimpleText const): Ditto. (WebCore::FontCascade::offsetForPositionForSimpleText const): Ditto. (WebCore::FontCascade::dashesForIntersectionsWithRect const): Same as FontCascade::drawEmphasisMarks() above. (WebCore::FontCascade::glyphBufferForTextRun const): Renamed to layoutText(). (WebCore::FontCascade::getGlyphsAndAdvancesForSimpleText const): Renamed to layoutSimpleText(). (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Renamed to layoutComplexText(). (WebCore::FontCascade::drawEmphasisMarksForSimpleText const): Inlined into drawEmphasisMarks(). (WebCore::FontCascade::drawEmphasisMarksForComplexText const): Ditto. * platform/graphics/FontCascade.h: * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBufferAdvance::GlyphBufferAdvance): (WebCore::GlyphBufferAdvance::operator FloatSize): * platform/graphics/TextRun.h: Remove unnecessary declaration. * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::WidthIterator): Update for changes to WidthIterator.h * platform/graphics/WidthIterator.h: Rearrange the class members to sort them by size, to get better packing. Also, make all member variables private, and initialize them all with { } syntax. (WebCore::WidthIterator::finalRoundingWidth const): (WebCore::WidthIterator::currentCharacter const): * rendering/svg/SVGTextMetrics.cpp: Remove unnecessary include. 2020-07-31 Chris Dumez <cdumez@apple.com> Add OfflineAudioCompletionEvent constructor https://bugs.webkit.org/show_bug.cgi?id=214994 Reviewed by Eric Carlson. Add OfflineAudioCompletionEvent constructor, as per: - https://www.w3.org/TR/webaudio/#OfflineAudioCompletionEvent Test: webaudio/OfflineAudioCompletionEvent-constructor.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::finishedRendering): * Modules/webaudio/OfflineAudioCompletionEvent.cpp: (WebCore::OfflineAudioCompletionEvent::create): (WebCore::OfflineAudioCompletionEvent::OfflineAudioCompletionEvent): * Modules/webaudio/OfflineAudioCompletionEvent.h: * Modules/webaudio/OfflineAudioCompletionEvent.idl: * Modules/webaudio/OfflineAudioCompletionEventInit.h: Copied from Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.idl. * Modules/webaudio/OfflineAudioCompletionEventInit.idl: Copied from Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-31 Jer Noble <jer.noble@apple.com> [Mac] YouTube does not offer HDR variants to devices which support HDR https://bugs.webkit.org/show_bug.cgi?id=215022 Reviewed by Eric Carlson. Test: platform/mac/media/media-source/is-type-supported-vp9-codec-check.html There are three separate issues which block YouTube from offering HDR: 1) YouTube checks both valid and invalid VP9 strings through MediaSource.isTypeSupported(), and UAs which answer `true` to even invalid VP9 strings are blocked from HDR. To solve this, we will now send isTypeSupported() through the same code path as Media Capabilities. 2) YouTube's standard valid and invalid VP9 strings do not include the fullRangeVideoFlag field, which would normally be tossed as invalid. We shouldn't relax our requirements globally, so we will add a Quirk which relaxes the requriement that VP9 strings contain a fullRangeVideoFlag. 3) YouTube's HDR query checks that window.screen.pixelDepth is > 24. We obviously don't want to change the value of this field globally, so we will add separate Quirk which sets window.screen.pixelDepth to 25 (a totally nonsensical value) when HDR is available. Each of these Quirks has a path towards removal for YouTube. The fullRangeVideoFlag field involves YouTube updating their compatibility check to inculde the fullRangeVideoFlag. The pixelDepth check can be replaced by the `dynamic-range:high` Media Query. * Modules/mediasource/MediaSource.cpp: (WebCore::addVP9FullRangeVideoFlagToContentType): (WebCore::MediaSource::addSourceBuffer): (WebCore::MediaSource::removeSourceBuffer): (WebCore::MediaSource::isTypeSupported): (WebCore::MediaSource::onReadyStateChange): (WebCore::MediaSource::activeRanges const): * Modules/mediasource/MediaSource.h: * page/Quirks.cpp: (WebCore::Quirks::needsVP9FullRangeFlagQuirk const): (WebCore::Quirks::needsHDRPixelDepthQuirk const): * page/Quirks.h: * page/Screen.cpp: (WebCore::Screen::pixelDepth const): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::isContentTypeSupported): * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::isVPCodecConfigurationRecordSupported): (WebCore::validateVPParameters): 2020-07-31 Chris Dumez <cdumez@apple.com> Add linked-on-after check to keep WebSQL working in UIWebView until apps are rebuilt with iOS 14 SDK https://bugs.webkit.org/show_bug.cgi?id=215035 <rdar://problem/65003342> Reviewed by Tim Horton. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isJesusCalling): Deleted. (WebCore::IOSApplication::isFudget): Deleted. (WebCore::IOSApplication::isFamilyHealthApp): Deleted. Drop code that is no longer needed. 2020-07-31 Brady Eidson <beidson@apple.com> Log a warning to the dev console when gamepads are accessed from an insecure context. https://bugs.webkit.org/show_bug.cgi?id=214995 Reviewed by Tim Horton. Test: http/tests/misc/gamepads-insecure.html * Modules/gamepad/NavigatorGamepad.cpp: (WebCore::NavigatorGamepad::getGamepads): Insecure contexts should log that getGamepads() will be going away in a future release. Just do it once, because getGamepads() is called frequently. 2020-07-31 Aditya Keerthi <akeerthi@apple.com> [macOS] Date/time input types should have a textfield appearance https://bugs.webkit.org/show_bug.cgi?id=214978 Reviewed by Wenson Hsieh. On iOS, date/time input types have a menulist-button appearance. However, this appearance does not match the style of native date controls on macOS. The textfield appearance with no focus ring brings us closer to a natively styled control. * rendering/RenderTheme.h: * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::dateInputStyleSheet const): (WebCore::RenderThemeMac::dateTimeLocalInputStyleSheet const): (WebCore::RenderThemeMac::monthInputStyleSheet const): (WebCore::RenderThemeMac::timeInputStyleSheet const): (WebCore::RenderThemeMac::weekInputStyleSheet const): 2020-07-31 Brady Eidson <beidson@apple.com> Special HID mapping for the Dualshock 3 controller <rdar://problem/66255198> and https://bugs.webkit.org/show_bug.cgi?id=214911 Reviewed by Tim Horton. Covered by API tests. - Move GamepadButtons into a GamepadConstants header - Add a "KnownGamepads" header to hold all vendor/product pairs that WebKit knows about - Add a Dualshock3 controller mapping based on its HID report - Add a basic DS3 test based on the HID report * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/gamepad/GamepadConstants.cpp: Copied from Source/WebCore/platform/gamepad/mac/GenericHIDGamepad.h. (WebCore::standardGamepadMappingString): * platform/gamepad/GamepadConstants.h: Added. * platform/gamepad/KnownGamepads.h: Copied from Source/WebCore/platform/gamepad/mac/GenericHIDGamepad.h. * platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::GameControllerGamepad::setupAsExtendedGamepad): * platform/gamepad/mac/Dualshock3HIDGamepad.cpp: Added. (WebCore::Dualshock3HIDGamepad::Dualshock3HIDGamepad): * platform/gamepad/mac/Dualshock3HIDGamepad.h: Copied from Source/WebCore/platform/gamepad/mac/GenericHIDGamepad.h. * platform/gamepad/mac/GenericHIDGamepad.cpp: (WebCore::GenericHIDGamepad::GenericHIDGamepad): (WebCore::GenericHIDGamepad::id): Deleted. * platform/gamepad/mac/GenericHIDGamepad.h: * platform/gamepad/mac/HIDGamepad.cpp: (WebCore::HIDGamepad::create): (WebCore::HIDGamepad::HIDGamepad): (WebCore::HIDGamepad::initialize): * platform/gamepad/mac/HIDGamepad.h: * platform/mac/HIDDevice.h: (WebCore::HIDDevice::fullProductIdentifier const): * platform/mac/HIDElement.h: (WebCore::HIDElement::fullUsage const): 2020-07-31 Alex Christensen <achristensen@webkit.org> Fix Windows build. https://bugs.webkit.org/show_bug.cgi?id=214988 * platform/network/cf/CertificateInfo.h: * platform/network/cf/CertificateInfoCFNet.cpp: 2020-07-31 Chris Dumez <cdumez@apple.com> Add constructor for WaveShaperNode https://bugs.webkit.org/show_bug.cgi?id=214989 Reviewed by Youenn Fablet. Add constructor for WaveShaperNode: - https://www.w3.org/TR/webaudio/#waveshapernode No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createWaveShaper): * Modules/webaudio/OverSampleType.h: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl. * Modules/webaudio/OverSampleType.idl: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl. * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::create): (WebCore::WaveShaperNode::setCurve): (WebCore::processorType): * Modules/webaudio/WaveShaperNode.h: (WTF::LogArgument<WebCore::OverSampleType>::toString): * Modules/webaudio/WaveShaperNode.idl: * Modules/webaudio/WaveShaperOptions.h: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl. * Modules/webaudio/WaveShaperOptions.idl: Copied from Source/WebCore/Modules/webaudio/WaveShaperNode.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-31 Youenn Fablet <youenn@apple.com> Update service worker if certificate info does not match when soft updating https://bugs.webkit.org/show_bug.cgi?id=214988 Reviewed by Alex Christensen. In case service worker certificate info does not match, treat it as if the script changed. This is a convenient way to update the service worker and the stored registration database. Covered by API test. * platform/network/cf/CertificateInfo.h: * platform/network/cf/CertificateInfoCFNet.cpp: (WebCore::certificatesMatch): * workers/service/server/SWServerJobQueue.cpp: (WebCore::doCertificatesMatch): (WebCore::SWServerJobQueue::scriptFetchFinished): * workers/service/server/SWServerWorker.h: (WebCore::SWServerWorker::certificateInfo const): 2020-07-31 Sihui Liu <sihui_liu@appe.com> -[WKWebsiteDataStore _renameOrigin:] needs to support IndexedDB renames https://bugs.webkit.org/show_bug.cgi?id=214905 <rdar://problem/66247978> Reviewed by Alex Christensen. To do the renaming, we close all existing databases whose top origin is old origin, and move all files in directory of old origin to that of new origin. API test: WebKit.WebsiteDataStoreRenameOriginForIndexedDatabase * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::closeDatabasesForOrigins): (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins): (WebCore::IDBServer::IDBServer::renameOrigin): * Modules/indexeddb/server/IDBServer.h: 2020-07-31 Chris Fleizach <cfleizach@apple.com> AX: Inteterminate progressbar reading as 50% with Voiceover https://bugs.webkit.org/show_bug.cgi?id=214330 <rdar://problem/65570800> Reviewed by Zalan Bujtas. Expose indeterminate status to iOS API. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityIsIndeterminate]): (-[WebAccessibilityObjectWrapper accessibilityIsInDescriptionListTerm]): (-[WebAccessibilityObjectWrapper accessibilityIsInDescriptionListDefinition]): - Drive by style fix. 2020-07-31 Peng Liu <peng.liu6@apple.com> PIP on netflix.com shows only a gray window and spinner https://bugs.webkit.org/show_bug.cgi?id=214899 Reviewed by Jer Noble. Use an empty "seekableRanges" instead of a special "duration" value (NaN) to indicate that seeking is not supported. With this change, the "duration" will always have a meaningful value, so that WebAVPlayerController can work properly in the picture-in-picture mode. Related change: https://trac.webkit.org/changeset/217858. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::supportsSeeking const): * platform/cocoa/PlaybackSessionModelMediaElement.mm: (WebCore::PlaybackSessionModelMediaElement::duration const): (WebCore::PlaybackSessionModelMediaElement::seekableRanges const): * platform/mac/WebPlaybackControlsManager.mm: (-[WebPlaybackControlsManager canBeginTouchBarScrubbing]): 2020-07-31 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Mouse wheel events on horizontal scrollbar not correctly handled when AC mode is forced https://bugs.webkit.org/show_bug.cgi?id=207113 Reviewed by Adrian Perez de Castro. Remove GTK specific code to invert scroll direction of wheel events. * page/EventHandler.cpp: (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::shouldSwapScrollDirection const): Deleted. * platform/SourcesGLib.txt: * platform/glib/EventHandlerGLib.cpp: Removed. 2020-07-10 Sergio Villar Senin <svillar@igalia.com> [WebXR] Retrieve supported reference spaces from actual XR systems https://bugs.webkit.org/show_bug.cgi?id=214187 Reviewed by Carlos Garcia Campos. Each XR system supports a set of reference spaces which are used by WebXR to stablish a spatial relationship with user's physical environment. The list of supported reference spaces determine whether or not a session request succeeds or not, as it will refuse to start a session with an unsupported reference space. So far, no reference spaces were retrieved from the actual devices. This patch adds the required OpenXR machinery to retrieve them. In particular, we have to create a XrSession (although we don't have to start it) in order to retrieve the reference spaces. Since we don't need it to show content to the user we can create it in headless mode and then discard it afterwards when no longer needed. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::WebXRSession): Clarify a comment. Also s/TODO/FIXME/g. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::isExtensionSupported): New method to check whether a specific extension is supported. (PlatformXR::Instance::Impl::checkInstanceExtensionProperties const): renamed from enumerateInstanceExtensionProperties(). Returns whether or not the call succeeded. (PlatformXR::Instance::Impl::Impl): Pass the list of enabled extensions to the instance. (PlatformXR::Instance::enumerateImmersiveXRDevices): Log the systems found. (PlatformXR::OpenXRDevice::OpenXRDevice): (PlatformXR::OpenXRDevice::enumerateReferenceSpaces const): New method to list the supported reference spaces by the XR system. (PlatformXR::OpenXRDevice::collectSupportedSessionModes): Store reference spaces as enabled features for supported modes. (PlatformXR::OpenXRDevice::collectConfigurationViews): Renamed from enumerateConfigurationViews(). (PlatformXR::Instance::Impl::enumerateInstanceExtensionProperties const): Deleted. (PlatformXR::OpenXRDevice::enumerateConfigurationViews): Deleted. * platform/xr/openxr/PlatformXROpenXR.h: 2020-07-31 Youenn Fablet <youenn@apple.com> Add LibWebRTCAudioModule logging https://bugs.webkit.org/show_bug.cgi?id=214987 Reviewed by Eric Carlson. * platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp: (WebCore::LibWebRTCAudioModule::RegisterAudioCallback): (WebCore::LibWebRTCAudioModule::StartPlayout): (WebCore::LibWebRTCAudioModule::StopPlayout): 2020-07-30 Simon Fraser <simon.fraser@apple.com> Minor RenderLayerCompositor::updateBackingAndHierarchy() cleanup https://bugs.webkit.org/show_bug.cgi?id=215008 Reviewed by Zalan Bujtas. Instead of setting child layers, and then adding another child (overflowControlLayer), append overflowControlLayer to the vector and then set children. No behavior change. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): 2020-07-30 Sam Weinig <weinig@apple.com> It would be nice if the predicate taking functions in ParsingUtilities.h didn't require specifying the character type https://bugs.webkit.org/show_bug.cgi?id=215002 Reviewed by Darin Adler. Remove the need for specifying the character type by providing overloads for LChar and UChar explicitly. * html/parser/HTMLSrcsetParser.cpp: (WebCore::parseImageCandidatesFromSrcsetAttribute): * html/parser/ParsingUtilities.h: (WebCore::characterPredicate): * html/track/VTTScanner.h: (WebCore::characterPredicate): * loader/LinkHeader.cpp: (WebCore::findURLBoundaries): (WebCore::invalidParameterDelimiter): (WebCore::parseParameterDelimiter): (WebCore::parseParameterName): (WebCore::skipQuotesIfNeeded): (WebCore::parseParameterValue): (WebCore::findNextHeader): * loader/ResourceCryptographicDigest.cpp: (WebCore::parseCryptographicDigestImpl): (WebCore::parseEncodedCryptographicDigestImpl): * loader/SubresourceIntegrity.cpp: (WebCore::splitOnSpaces): * loader/appcache/ApplicationCacheManifestParser.cpp: (WebCore::parseApplicationCacheManifest): * page/csp/ContentSecurityPolicyDirectiveList.cpp: (WebCore::ContentSecurityPolicyDirectiveList::parseDirective): (WebCore::ContentSecurityPolicyDirectiveList::parseReportURI): * page/csp/ContentSecurityPolicyMediaListDirective.cpp: (WebCore::ContentSecurityPolicyMediaListDirective::parse): * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::isSourceListNone): (WebCore::ContentSecurityPolicySourceList::parse): (WebCore::ContentSecurityPolicySourceList::parseSource): (WebCore::ContentSecurityPolicySourceList::parseScheme): (WebCore::ContentSecurityPolicySourceList::parseHost): (WebCore::ContentSecurityPolicySourceList::parsePath): (WebCore::ContentSecurityPolicySourceList::parsePort): (WebCore::ContentSecurityPolicySourceList::parseNonceSource): * platform/DateComponents.cpp: (WebCore::countDigits): * svg/SVGLengthList.cpp: (WebCore::SVGLengthList::parse): * svg/SVGParserUtilities.cpp: (WebCore::genericParseNumber): * svg/SVGParserUtilities.h: (WebCore::skipOptionalSVGSpaces): 2020-07-30 Sam Weinig <weinig@apple.com> Convert DateComponents to use StringParsingBuffer https://bugs.webkit.org/show_bug.cgi?id=213929 Reviewed by Darin Adler. - Switches string parsing in DateComponents to using StringParsingBuffer, making use of ParsingUtilities to streamline / simplify the code. - Moves a few constant values only used in DateComponents.cpp to DateComponents.cpp - Rename toInt in DateComponents.cpp to parseInt, and have use an Optional return value rather than bool + out-parameter. - Add new parseIntWithinLimits that also checks that parsed value is within specfied limits, as this is what almost all of the int parsing in DateComponents needs. * platform/DateComponents.cpp: (WebCore::countDigits): (WebCore::parseInt): (WebCore::parseIntWithinLimits): (WebCore::DateComponents::parseYear): (WebCore::withinHTMLDateLimits): (WebCore::createFromString): (WebCore::DateComponents::fromParsingMonth): (WebCore::DateComponents::fromParsingDate): (WebCore::DateComponents::fromParsingWeek): (WebCore::DateComponents::fromParsingTime): (WebCore::DateComponents::fromParsingDateTimeLocal): (WebCore::DateComponents::fromParsingDateTime): (WebCore::DateComponents::parseTimeZone): (WebCore::DateComponents::parseMonth): (WebCore::DateComponents::parseDate): (WebCore::DateComponents::parseWeek): (WebCore::DateComponents::parseTime): (WebCore::DateComponents::parseDateTimeLocal): (WebCore::DateComponents::parseDateTime): (WebCore::DateComponents::setMonthsSinceEpoch): (WebCore::DateComponents::setMillisecondsSinceEpochForWeek): (WebCore::toInt): Deleted. * platform/DateComponents.h: (WebCore::DateComponents::minimumYear): Deleted. (WebCore::DateComponents::maximumYear): Deleted. 2020-07-30 Ryan Haddad <ryanhaddad@apple.com> Unreviewed attempt to fix Catalyst build after r265084. * editing/cocoa/DictionaryLookup.mm: 2020-07-30 Dean Jackson <dino@apple.com> [WebGL] Safari snapshots of WebGL content in the tab picker don't work https://bugs.webkit.org/show_bug.cgi?id=214452 <rdar://problem/21243082> Original patch by Justin Fan. Reviewed by Darin Adler. Test is in TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::paint): Will properly request a paint when a snapshot is requested. * html/HTMLCanvasElement.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas): Only clear the last snapshot if readPixels will succeed. * rendering/RenderHTMLCanvas.cpp: (WebCore::RenderHTMLCanvas::paintReplaced): 2020-07-30 Jer Noble <jer.noble@apple.com> [Cocoa] Adopt -[AVContentKeyRequest willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays:] https://bugs.webkit.org/show_bug.cgi?id=214659 <rdar://problem/63555006> Reviewed by Darin Adler. Use the new WTF::Observer object as the listener type for notifying clients of display changes. When a displayChanged event is observed, use the new AVContentKeyRequest -willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays: to set the keyStatus for that request appropriately. * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::MediaKeySession): (WebCore::MediaKeySession::displayID): (WebCore::MediaKeySession::displayChanged): * Modules/encryptedmedia/MediaKeySession.h: * dom/Document.cpp: (WebCore::Document::windowScreenDidChange): (WebCore::Document::addDisplayChangedObserver): * dom/Document.h: * platform/encryptedmedia/CDMInstanceSession.h: (WebCore::CDMInstanceSession::displayChanged): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (-[WebCoreFPSContentKeySessionDelegate contentKeySession:externalProtectionStatusDidChangeForContentKeyRequest:]): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::externalProtectionStatusDidChangeForContentKeyRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::displayChanged): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::externalProtectionStatusDidChangeForContentKeyRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateProtectionStatusForDisplayID): 2020-07-30 James Darpinian <jdarpinian@chromium.org> [WebGL2] Buffer updates https://bugs.webkit.org/show_bug.cgi?id=209511 Reviewed by Dean Jackson. Various fixes in bufferData, bufferSubData, and getBufferSubData. Passes all WebGL conformance tests in conformance/buffers/* and conformance2/buffers/*. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::sliceArrayBufferView): (WebCore::WebGL2RenderingContext::getBufferSubData): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::bufferData): (WebCore::WebGLRenderingContextBase::bufferSubData): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLRenderingContextBase.idl: 2020-07-30 Jer Noble <jer.noble@apple.com> [Cocoa] Make DecoderTest run against .mp4 files; add rate-limiting. https://bugs.webkit.org/show_bug.cgi?id=214807 Reviewed by Darin Adler. Export registerWebKitVP9Decoder() from VP9UtilitiesCocoa instead of LibWebRTCProvider to make it easier for DecodeTest to import, as LibWebRTCProvider also pulls in a bunch of libwebrtc headers. Also, export SourceBufferParser.h so DecoderTest can create parsers for fMP4 files. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::registerWebKitVP9Decoder): 2020-07-30 Ryosuke Niwa <rniwa@webkit.org> Clicking on a shadow DOM does not move the selection to the focused element when delegatesFocus is set to true https://bugs.webkit.org/show_bug.cgi?id=214859 <rdar://problem/66192901> Reviewed by Wenson Hsieh. The bug was caused by EventHandler moving the selection to where the user had clicked, not to where the focus had been delegated, which is a uniquely WebKit behavior. Fixed the bug by revealing the focused element as done in Element::focus in EventHandler::dispatchMouseEvent and avoid updating the selection to the clicked point later in EventHandler::handleMousePressEventSingleClick by adding an early exit. Test: fast/shadow-dom/delegates-focus-and-types-into-input.html * dom/Element.cpp: (WebCore::Element::focus): (WebCore::Element::revealFocusedElement): Extracted from Element::focus. * dom/Element.h: * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEventSingleClick): Added an early exit when dispatchMouseEvent had delegated the focus to an element different from the one the user had clicked. (WebCore::EventHandler::dispatchMouseEvent): Added a code to reveal the newly focused element when the focus had been delegated. * page/EventHandler.h: 2020-07-30 Tim Horton <timothy_horton@apple.com> Web content gets stuck in an inactive state (no cursor updates or text insertion caret) when activating a tab with a thumbnail visible https://bugs.webkit.org/show_bug.cgi?id=214962 <rdar://problem/65670984> Reviewed by Wenson Hsieh. New API test: WebKit.WKThumbnailViewResetsViewStateWhenUnparented * testing/Internals.cpp: (WebCore::Internals::isPageActive const): * testing/Internals.h: * testing/Internals.idl: Add a "view window is active" getter. 2020-07-30 Antoine Quint <graouts@webkit.org> [iOS] Unable to swipe on IMDB.com after long press on image https://bugs.webkit.org/show_bug.cgi?id=214968 <rdar://problem/66234421> Reviewed by Wenson Hsieh. When a long press occurs on an <img>, a system drag interaction is initiated on iOS. In WebCore, EventHandler::tryToBeginDragAtPoint() is called and a synthetic mouse event is produced, causing handleMousePressEvent() to be called. Further down the call chain, dispatchPointerEventIfNeeded() is called and a valid PointerEvent is generated in PointerCaptureController::pointerEventForMouseEvent() with "pointerType" set to "mouse", even though there is already a touch interaction initiated. We now check whether there are known touches before generating a PointerEvent for a MouseEvent. In the case of IMDb, the page would keep track of "pointerdown" events to track whether a multi-touch user gesture is in progress so that their slide shows can support two-finger zooming as well as single-finger swiping. In the case of a long press, the second "pointerdown" event would trick the code in thinking a zoom gesture was initiated and it never recovered. Test: pointerevents/ios/long-press-yields-single-pointerdown-event.html * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::pointerEventForMouseEvent): 2020-07-30 Chris Dumez <cdumez@apple.com> OfflineAudioContext.startRendering() should return a Promise https://bugs.webkit.org/show_bug.cgi?id=214940 Reviewed by Eric Carlson. OfflineAudioContext.startRendering() should return a Promise: - https://www.w3.org/TR/webaudio/#dom-offlineaudiocontext-startrendering This is important as it was preventing a lot of web-platform-tests from running properly and our test coverage was therefore really poor. No new tests, rebaselined existing tests. * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::finishedRendering): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::didFinishOfflineRendering): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::startRendering): * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::startOfflineRendering): (WebCore::OfflineAudioContext::didFinishOfflineRendering): * Modules/webaudio/OfflineAudioContext.h: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::startRendering): * Modules/webaudio/OfflineAudioDestinationNode.h: 2020-07-30 Darin Adler <darin@apple.com> Further reduction in the use of live ranges, particularly in headers https://bugs.webkit.org/show_bug.cgi?id=214793 Reviewed by Sam Weinig. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::performTextOperation): Do not call createLiveRange. (WebCore::AccessibilityObject::replaceTextInRange): Ditto. * dom/SimpleRange.cpp: Moved makeSimpleRange functions to the header. * dom/SimpleRange.h: Reworked the makeSimpleRange implementation to avoid a mistake which made template expansion infinitely recurse while compiling and crash the compiler. Ended up moving all the code to the header. Should be a good thing; I expect it will optimize well inlined. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): Use makeSimpleRange. * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithText): Do not call createLiveRange. (WebCore::Editor::setComposition): Use SimpleRange. (WebCore::Editor::stringForCandidateRequest const): Do not call createLiveRange. (WebCore::Editor::handleAcceptedCandidate): Use auto intead of RefPtr<Range>. * editing/EditorCommand.cpp: (WebCore::expandSelectionToGranularity): Do not call createLiveRange. (WebCore::executeDeleteToMark): Ditto. (WebCore::executeSelectToMark): Ditto. (WebCore::valueFormatBlock): Ditto. * editing/FormatBlockCommand.cpp: (WebCore::FormatBlockCommand::formatRange): Use makeSimpleRange. (WebCore::FormatBlockCommand::elementForFormatBlockCommand): Take a SimpleRange. * editing/FormatBlockCommand.h: Updated for above. * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveTo): Deleted overload taking a live range. (WebCore::FrameSelection::setSelectedRange): Take a SimpleRange. * editing/FrameSelection.h: Updated for above. * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplacementFragment::ReplacementFragment): Do not call createLiveRange. * editing/VisibleUnits.cpp: (WebCore::enclosingTextUnitOfGranularity): Return SimpleRange. (WebCore::wordRangeFromPosition): Ditto. (WebCore::closestWordBoundaryForPosition): Use SimpleRange. (WebCore::rangeExpandedByCharactersInDirectionAtWordBoundary): Return a SimpleRange. (WebCore::rangeExpandedAroundPositionByCharacters): Ditto. (WebCore::wordBoundaryForPositionWithoutCrossingLine): Use SimpleRange. * editing/VisibleUnits.h: Updated for above. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectItemAroundHitTestResult): Use SimpleRange. * editing/cocoa/DictionaryLookup.mm: (WebCore::DictionaryLookup::rangeForSelection): Use SimpleRange. (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto. * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::getPasteboardTypesAndDataForAttachment): Do not call createLiveRange. * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::WebContentReader::readPlainText): Ditto. * editing/gtk/WebContentReaderGtk.cpp: (WebCore::WebContentReader::readPlainText): Ditto. * editing/libwpe/EditorLibWPE.cpp: (WebCore::createFragmentFromPasteboardData): Ditto. * editing/mac/DictionaryLookupLegacy.mm: (WebCore::DictionaryLookup::rangeAtHitTestResult): Use SimpleRange. * editing/markup.cpp: (WebCore::serializePreservingVisualAppearance): Take SimpleRange. (WebCore::contextPreservesNewline): Ditto. (WebCore::createFragmentFromText): Ditto. * editing/markup.h: Updated for above. * loader/archive/cf/LegacyWebArchive.cpp: (WebCore::LegacyWebArchive::create): Take SimpleRange. * loader/archive/cf/LegacyWebArchive.h: Updated for above. * page/DragController.cpp: (WebCore::DragController::performDragOperation): Use SimpleRange. (WebCore::DragController::concludeEditDrag): Do not call createLiveRange. (WebCore::selectElement): Use SimpleRange. (WebCore::DragController::removeAllDroppedImagePlaceholders): Ditto. (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret): Ditto. * page/DragController.h: Use SimpleRange. * page/Page.cpp: (WebCore::Page::findTextMatches): Return vector of SimpleRange, in structure so we have one return value instead of two out arguments. Also renamed from findStringMatchingRanges. (WebCore::Page::rangeOfString): Return SimpleRange. (WebCore::replaceRanges): Do not call createLiveRange. (WebCore::Page::replaceRangesWithText): Take SimpleRange. * page/Page.h: Updated for above. * page/ios/FrameIOS.mm: (WebCore::Frame::wordsInCurrentParagraph const): Use SimpleRange. * rendering/HitTestResult.cpp: (WebCore::HitTestResult::isOverTextInsideFormControlElement const): Use SimpleRange, and also use hasAnyPlainText instead of computing the plain text string and checking if it's empty. 2020-07-30 Brady Eidson <beidson@apple.com> Refactor HID gamepad code to be much less fragile and much easier to hack on. https://bugs.webkit.org/show_bug.cgi?id=214910 Reviewed by Darin Adler. Covered by API tests. Currently - for HID device gamepads - we throw all buttons and axes against the wall and see what sticks. Instead, for specific popular devices, we'd like to have device-specific mappings so the representation makes sense. To support that work, this is a major refactoring of the HID gamepad code. It does the following: - Breaks out logic specific to IOHIDDeviceRef into HIDDevice - Breaks out logic specific to IOHIDElementRef into HIDElement - Moves responsibities of managing things to the right places (e.g. HIDElement manages its own current value directly) - Makes HIDGamepadElement derive from HIDElement directly - Moves device specific logic from HIDGamepad into a subclass of HID gamepad. Currently the only subclass is "generic" which encompasses HIDGamepad's old behavior - Changes button/value vectors from Vector<double> to Vector<SharedGamepadValue> so multiple objects can reference the value at once. e.g. HIDGamepadButton can simply update it's own SharedGamepadValue without knowing which HIDGamepad owns it or which index into the gamepad's value vector it should be mutating. This will be critical in the "specific device mapping" work as some types of HIDElements actually drive more than one gamepad button value. e.g. a "direction pad axis" actually manages 2 button values, or a "hat-switch" direction pad manages 4 button values This patch doesn't change any current behavior. * Modules/gamepad/Gamepad.cpp: (WebCore::Gamepad::updateFromPlatformGamepad): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/Logging.h: * platform/gamepad/PlatformGamepad.h: * platform/gamepad/SharedGamepadValue.h: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::SharedGamepadValue::SharedGamepadValue): (WebCore::SharedGamepadValue::setValue): (WebCore::SharedGamepadValue::value const): (WebCore::SharedGamepadValue::Data::Data): * platform/gamepad/cocoa/GameControllerGamepad.h: * platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::GameControllerGamepad::setupAsExtendedGamepad): (WebCore::GameControllerGamepad::setupAsGamepad): * platform/gamepad/mac/GenericHIDGamepad.cpp: Added. (WebCore::GenericHIDGamepad::GenericHIDGamepad): (WebCore::GenericHIDGamepad::id): (WebCore::GenericHIDGamepad::maybeAddGenericDesktopElement): (WebCore::GenericHIDGamepad::maybeAddButtonElement): * platform/gamepad/mac/GenericHIDGamepad.h: Copied from Source/WebKit/WebProcess/Gamepad/WebGamepad.h. * platform/gamepad/mac/HIDGamepad.cpp: (WebCore::HIDGamepad::create): (WebCore::HIDGamepad::HIDGamepad): (WebCore::HIDGamepad::initialize): (WebCore::HIDGamepad::valueChanged): (WebCore::HIDGamepad::getCurrentValueForElement): Deleted. (WebCore::HIDGamepad::initElements): Deleted. (WebCore::HIDGamepad::initElementsFromArray): Deleted. (WebCore::HIDGamepad::maybeAddButton): Deleted. (WebCore::HIDGamepad::maybeAddAxis): Deleted. * platform/gamepad/mac/HIDGamepad.h: (WebCore::HIDGamepad::hidDevice const): (WebCore::HIDGamepadElement::HIDGamepadElement): Deleted. (WebCore::HIDGamepadElement::~HIDGamepadElement): Deleted. (WebCore::HIDGamepadElement::isButton const): Deleted. (WebCore::HIDGamepadElement::isAxis const): Deleted. (WebCore::HIDGamepadButton::HIDGamepadButton): Deleted. (WebCore::HIDGamepadAxis::HIDGamepadAxis): Deleted. * platform/gamepad/mac/HIDGamepadElement.cpp: Added. (WebCore::HIDGamepadElement::HIDGamepadElement): (WebCore::HIDGamepadElement::refreshCurrentValue): (WebCore::HIDGamepadElement::normalizedValue): (WebCore::HIDGamepadButton::gamepadValueChanged): (WebCore::HIDGamepadAxis::gamepadValueChanged): (WebCore::HIDGamepadAxis::normalizedValue): * platform/gamepad/mac/HIDGamepadElement.h: Copied from Source/WebCore/platform/gamepad/PlatformGamepad.h. (WebCore::HIDGamepadElement::~HIDGamepadElement): (WebCore::HIDGamepadElement::isButton const): (WebCore::HIDGamepadElement::isAxis const): * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::HIDGamepadProvider::deviceAdded): * platform/gamepad/mac/MultiGamepadProvider.h: * platform/graphics/cocoa/SourceBufferParserWebM.cpp: * platform/mac/HIDDevice.cpp: Added. (WebCore::HIDDevice::HIDDevice): (WebCore::HIDDevice::uniqueInputElementsInDeviceTreeOrder const): * platform/mac/HIDDevice.h: Copied from Source/WebCore/platform/gamepad/PlatformGamepad.h. (WebCore::HIDDevice::rawElement const): (WebCore::HIDDevice::vendorID const): (WebCore::HIDDevice::productID const): (WebCore::HIDDevice::productName const): * platform/mac/HIDElement.cpp: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::HIDElement::HIDElement): (WebCore::HIDElement::valueChanged): * platform/mac/HIDElement.h: Copied from Source/WebKit/UIProcess/Gamepad/UIGamepad.h. (WebCore::HIDElement::rawElement const): (WebCore::HIDElement::physicalMin const): (WebCore::HIDElement::physicalMax const): (WebCore::HIDElement::physicalValue const): (WebCore::HIDElement::usage const): (WebCore::HIDElement::usagePage const): (WebCore::HIDElement::cookie const): * testing/MockGamepad.cpp: (WebCore::MockGamepad::updateDetails): (WebCore::MockGamepad::setAxisValue): (WebCore::MockGamepad::setButtonValue): * testing/MockGamepad.h: 2020-07-29 Joonghun Park <jh718.park@samsung.com> Unreviewed. Remove the build warning below since r265062. warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] No new tests, no new behaviors. * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::copyFromChannel): (WebCore::AudioBuffer::copyToChannel): 2020-07-29 Jer Noble <jer.noble@apple.com> Support HDR decode in SW VP9 https://bugs.webkit.org/show_bug.cgi?id=214928 Reviewed by Eric Carlson. Convert the incoming properties parsed from the VP9 header into extensions to our CMFormatDescription attached to each incoming video fram. Drive-by fix: Files in the wild will have incorrect values for whether a given frame is a keyframe or not. Trust the VP9 header parser rather than the container in this situations. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::convertToCMColorPrimaries): (WebCore::convertToCMTransferFunction): (WebCore::convertToCMYCbCRMatrix): (WebCore::createFormatDescriptionFromVP9HeaderParser): (WebCore::SourceBufferParserWebM::OnFrame): 2020-07-29 Wenson Hsieh <wenson_hsieh@apple.com> [iPadOS] Custom dropdown menu dismisses immediately on account.nhl.com https://bugs.webkit.org/show_bug.cgi?id=214944 <rdar://problem/66248506> Reviewed by Jer Noble. Exempt account.nhl.com from site-specific "simulated mouse events" behavior, since it is incompatible with some custom dropdown menus that appear on this website. * page/Quirks.cpp: (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const): 2020-07-29 Clark Wang <clark_wang@apple.com> Added constructor methods to ChannelMergerNode, ChannelSplitterNode https://bugs.webkit.org/show_bug.cgi?id=214851 <rdar://problem/66233763> Reviewed by Chris Dumez. Added constructors for ChannelMergerNode, ChannelSplitterNode according to spec: https://www.w3.org/TR/webaudio/#ChannelMergerNode-constructors. Added new files for ChannelMergerOptions and ChannelSplitterOptions. This patch also ensures that BaseAudioContext::create*() and *Node::create() methods behave the same. Re-baselined existing tests that now pass, or fail further along. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createChannelSplitter): (WebCore::BaseAudioContext::createChannelMerger): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): (WebCore::ChannelMergerNode::setChannelCount): (WebCore::ChannelMergerNode::setChannelCountMode): * Modules/webaudio/ChannelMergerNode.h: * Modules/webaudio/ChannelMergerNode.idl: * Modules/webaudio/ChannelMergerOptions.h: Added. * Modules/webaudio/ChannelMergerOptions.idl: Added. * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): (WebCore::ChannelSplitterNode::setChannelCount): (WebCore::ChannelSplitterNode::setChannelCountMode): (WebCore::ChannelSplitterNode::setChannelInterpretation): * Modules/webaudio/ChannelSplitterNode.h: * Modules/webaudio/ChannelSplitterNode.idl: * Modules/webaudio/ChannelSplitterOptions.h: Added. * Modules/webaudio/ChannelSplitterOptions.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-29 Clark Wang <clark_wang@apple.com> Added copyFromChannel, copyToChannel to AudioBuffer https://bugs.webkit.org/show_bug.cgi?id=214926 Reviewed by Chris Dumez. Added copyFromChannel, copyToChannel methods according to spec: https://www.w3.org/TR/webaudio/#dom-audiobuffer-copyfromchannel-destination. Used Chromium implementation for reference: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/webaudio/audio_buffer.cc. Re-baselined existing tests. Fails on catching sharedBuffer being passed in, but currently WebKit does not support sharedBuffer implementation. * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::getChannelData): (WebCore::AudioBuffer::copyFromChannel): (WebCore::AudioBuffer::copyToChannel): * Modules/webaudio/AudioBuffer.h: * Modules/webaudio/AudioBuffer.idl: 2020-07-29 Wenson Hsieh <wenson_hsieh@apple.com> [macOS] Inspector bar in Mail compose shows incorrect text alignment style for ranged selections https://bugs.webkit.org/show_bug.cgi?id=214930 <rdar://problem/66185224> Reviewed by Tim Horton. When a range of text is selected, AppKit consults `-attributedSubstringForProposedRange:completionHandler:` (or just `-attributedSubstringFromRange:` in WebKitLegacy) to update the inspector bar with new style information. Among this information is the paragraph style (an `NSParagraphStyle` corresponding to the attribute key `NSParagraphStyleAttributeName`), which AppKit uses to select either the left, center or right text alignment segmented control. However, in both WebKitLegacy and modern WebKit, we don't include this information at all in HTMLConverter, so AppKit just defaults to using `-[NSParagraphStyle defaultParagraphStyle]`, with a default text alignment of `NSTextAlignmentNatural`. To fix this, include a new paragraph style object in the case where the text alignment is not equal to natural (in other words, either a direction has been explicitly specified, or the text alignment style is not equal to "start"). This paragraph style matches the default paragraph style, except for the `alignment` property which is set to the corresponding `NSTextAlignment` value. Tests: AttributedSubstringForProposedRange.TextAlignmentParagraphStyles FontAttributes.FontAttributesAfterChangingSelection * editing/Editor.cpp: (WebCore::Editor::fontAttributesAtSelectionStart const): Also fixes an existing bug in `Editor::fontAttributesAtSelectionStart`, where `NSTextAlignmentNatural` is currently always used for `text-align: start;`, even if the direction is specified as RTL. Instead, change this so that we only fall back to "natural" if no direction is specified; otherwise, go with the explicit "left" or "right" values. * editing/cocoa/HTMLConverter.mm: (WebCore::editingAttributedString): 2020-07-29 Jer Noble <jer.noble@apple.com> REGRESSION(r264476): Calling systemHasAC() regresses launch time performance https://bugs.webkit.org/show_bug.cgi?id=214907 <rdar://problem/66191430> Reviewed by Eric Carlson. Because calling into IOPS can block, delay queries about AC state during WebProcessPool creation until the next run-loop. Simultaneously, we don't need to check HDR state in the UI process for IOS, so send a default value there as well. * platform/cocoa/PowerSourceNotifier.h: * platform/cocoa/PowerSourceNotifier.mm: (WebCore::PowerSourceNotifier::PowerSourceNotifier): * platform/cocoa/SystemBattery.h: * platform/cocoa/SystemBattery.mm: (WebCore::cachedSystemHasAC): * platform/ios/PlatformScreenIOS.mm: (WebCore::collectScreenProperties): 2020-07-29 Don Olmstead <don.olmstead@sony.com> Remove USE(ZLIB) https://bugs.webkit.org/show_bug.cgi?id=214929 Reviewed by Darin Adler. Remove USE(ZLIB) guards in WebSocket code. Since WebSocketDeflateFramer::canDeflate is always true remove it and the callsite checking it in WebSocketChannel. * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::connect): * Modules/websockets/WebSocketDeflateFramer.cpp: (WebCore::WebSocketExtensionDeflateFrame::processResponse): (WebCore::WebSocketDeflateFramer::enableDeflate): (WebCore::WebSocketDeflateFramer::deflate): (WebCore::WebSocketDeflateFramer::resetDeflateContext): (WebCore::WebSocketDeflateFramer::inflate): (WebCore::WebSocketDeflateFramer::resetInflateContext): (WebCore::WebSocketDeflateFramer::canDeflate const): Deleted. * Modules/websockets/WebSocketDeflateFramer.h: * Modules/websockets/WebSocketDeflater.cpp: 2020-07-29 Chris Dumez <cdumez@apple.com> Calling AudioNode constructors should have identical behavior to using create*() function on BaseAudioContext https://bugs.webkit.org/show_bug.cgi?id=214931 Reviewed by Eric Carlson. Calling AudioNode constructors should have identical behavior to using create*() function on BaseAudioContext. Otherwise, this leads to assertion hits on the bots like we saw for Bug 214851. We need to make sure that the AudioContext gets initialized when an AudioNode constructor gets called. We also need to make sure refNode() gets called if necessary. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createPanner): (WebCore::BaseAudioContext::createOscillator): (WebCore::BaseAudioContext::createPeriodicWave): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::create): * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::create): 2020-07-29 Simon Fraser <simon.fraser@apple.com> REGRESSION: ASSERTION FAILED: !needsLayout() on tiled-drawing/scrolling/fast-scroll-mainframe-zoom.html flakily https://bugs.webkit.org/show_bug.cgi?id=214651 <rdar://problem/65952371> Reviewed by Zalan Bujtas. Page::doAfterUpdateRendering() is expected to only call functions that can't trigger layout. However, it could cause the firing of the "monitorWheelEvent" callback which can run arbitrary JS, so move that earlier in the rendering update, before we do the final layout. Also assert that the main frame doesn't need layout at the end of Page::doAfterUpdateRendering(); we were only checking subframes. Tested by lots of existing tests. * page/Page.cpp: (WebCore::Page::updateRendering): (WebCore::Page::doAfterUpdateRendering): 2020-07-29 Chris Dumez <cdumez@apple.com> Make sure playback state constants remain on OscillatorNode for backward compatibility https://bugs.webkit.org/show_bug.cgi?id=214925 Reviewed by Eric Carlson. Make sure playback state constants remain on OscillatorNode for backward compatibility, while we keep supporting the prefixed Web Audio API. No new tests, updated existing test. * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/WebKitOscillatorNode.idl: 2020-07-29 Chris Dumez <cdumez@apple.com> http/tests/cookies/document-cookie-multiple-cookies.html is failing on Windows https://bugs.webkit.org/show_bug.cgi?id=214880 Reviewed by Darin Adler. Fix same bug as in r264943 but on Windows. No new tests, covered by http/tests/cookies/document-cookie-multiple-cookies.html. * platform/network/cf/NetworkStorageSessionCFNetWin.cpp: (WebCore::parseDOMCookie): (WebCore::NetworkStorageSession::setCookiesFromDOM const): 2020-07-29 Youenn Fablet <youenn@apple.com> scaleResolutionDownBy has no effect on RTCRtpSender https://bugs.webkit.org/show_bug.cgi?id=214783 <rdar://problem/66108346> Reviewed by Eric Carlson. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::updateRTCRtpSendParameters): Allow to change scaleResolutionDownBy. 2020-07-29 Mark Lam <mark.lam@apple.com> CodeGeneratorJS should release the throwScope before doing a void call at end of a function. https://bugs.webkit.org/show_bug.cgi?id=214924 Reviewed by Chris Dumez. It is necessary to release the throwScope because the void call at the end of the function may throw an exception. Releasing the throwScope here says that this function is releasing the responsibility to handle the exception, and will allow the potential exception from the trailing void call to propagate to its caller. The responsibility to handle the exception is passed to this function's caller (or some earlier caller in the stack). It is ok to release the throwScope here because the trailing void call will effectively be the last thing that this function does before returning. Covered by existing tests. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementationFunctionCall): * bindings/scripts/test/JS/JSMapLike.cpp: (WebCore::jsMapLikePrototypeFunctionClearBody): * bindings/scripts/test/JS/JSSetLike.cpp: (WebCore::jsSetLikePrototypeFunctionClearBody): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunctionBody): (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessageBody): (WebCore::jsTestActiveDOMObjectPrototypeFunctionOverloadedMethod1Body): (WebCore::jsTestActiveDOMObjectPrototypeFunctionOverloadedMethod2Body): * bindings/scripts/test/JS/JSTestCEReactions.cpp: (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsBody): (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsNotNeededBody): * bindings/scripts/test/JS/JSTestCallTracer.cpp: (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgumentBody): * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::jsTestEnabledBySettingPrototypeFunctionEnabledBySettingOperationBody): * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperationBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1Body): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2Body): (WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStaticBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabledBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeaturesEnabledBody): (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunctionBody): (WebCore::jsTestGlobalObjectInstanceFunctionCalculateSecretResultBody): * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: (WebCore::jsTestIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod1Body): (WebCore::jsTestInterfaceConstructorFunctionImplementsMethod4Body): (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1Body): (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4Body): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: (WebCore::jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetterBody): (WebCore::jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody): * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: (WebCore::jsTestNamedDeleterWithIdentifierPrototypeFunctionNamedDeleterBody): * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: (WebCore::jsTestNamedSetterWithIdentifierPrototypeFunctionNamedSetterBody): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: (WebCore::jsTestNamedSetterWithIndexedGetterPrototypeFunctionNamedSetterBody): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionNamedSetterBody): (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionIndexedSetter1Body): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: (WebCore::jsTestNamedSetterWithUnforgablePropertiesInstanceFunctionUnforgeableOperationBody): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsInstanceFunctionUnforgeableOperationBody): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::jsTestNodePrototypeFunctionTestWorkerPromiseBody): (WebCore::jsTestNodePrototypeFunctionCalculateSecretResultBody): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::callJSTestObj1): (WebCore::callJSTestObj3): (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1Body): (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2Body): (WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStaticBody): (WebCore::jsTestObjPrototypeFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabledBody): (WebCore::jsTestObjPrototypeFunctionWorldSpecificMethodBody): (WebCore::jsTestObjPrototypeFunctionCalculateSecretResultBody): (WebCore::jsTestObjPrototypeFunctionVoidMethodBody): (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgsBody): (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameterBody): (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithByteStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNullableByteStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithByteStringArgTreatingNullAsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionSerializedValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithRecordBody): (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionAddEventListenerBody): (WebCore::jsTestObjPrototypeFunctionRemoveEventListenerBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidExceptionBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateBody): (WebCore::jsTestObjPrototypeFunctionWithDocumentArgumentBody): (WebCore::jsTestObjPrototypeFunctionWithCallerDocumentArgumentBody): (WebCore::jsTestObjPrototypeFunctionWithCallerWindowArgumentBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgsBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefinedBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringIsNullBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringIsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaNBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaNBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZeroBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZeroBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmptyBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalseBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAnyBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalObjectBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperIsNullBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolverBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalRecordBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromiseBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionAndOptionalArgBody): (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArgBody): (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArgBody): (WebCore::jsTestObjPrototypeFunctionConditionalMethod2Body): (WebCore::jsTestObjPrototypeFunctionConditionalMethod3Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod13Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnions1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnions2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter1Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter2Body): (WebCore::jsTestObjConstructorFunctionClassMethodBody): (WebCore::jsTestObjConstructorFunctionOverloadedMethod11Body): (WebCore::jsTestObjConstructorFunctionOverloadedMethod12Body): (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampBody): (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampOnOptionalBody): (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeBody): (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeOnOptionalBody): (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequenceBody): (WebCore::jsTestObjPrototypeFunctionOperationWithOptionalUnionParameterBody): (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequenceBody): (WebCore::jsTestObjPrototypeFunctionConvert1Body): (WebCore::jsTestObjPrototypeFunctionConvert2Body): (WebCore::jsTestObjPrototypeFunctionConvert3Body): (WebCore::jsTestObjPrototypeFunctionConvert4Body): (WebCore::jsTestObjPrototypeFunctionOrangeBody): (WebCore::jsTestObjPrototypeFunctionVariadicStringMethodBody): (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethodBody): (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethodBody): (WebCore::jsTestObjPrototypeFunctionVariadicUnionMethodBody): (WebCore::jsTestObjPrototypeFunctionAnyBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Body): (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Body): (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionBody): (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionConditionalOverload1Body): (WebCore::jsTestObjPrototypeFunctionConditionalOverload2Body): (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1Body): (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2Body): (WebCore::jsTestObjPrototypeFunctionAttachShadowRootBody): (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameterBody): (WebCore::jsTestObjPrototypeFunctionBufferSourceParameterBody): (WebCore::jsTestObjPrototypeFunctionLegacyCallerNamedBody): (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationBody): (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWindowFunctionBody): (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWorkerFunctionBody): (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWindowAndWorkerFunctionBody): * bindings/scripts/test/JS/JSTestOperationConditional.cpp: (WebCore::jsTestOperationConditionalPrototypeFunctionNonConditionalOperationBody): (WebCore::jsTestOperationConditionalPrototypeFunctionConditionalOperationBody): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionBody): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::jsTestTypedefsPrototypeFunctionFuncBody): (WebCore::jsTestTypedefsPrototypeFunctionSetShadowBody): (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArgBody): (WebCore::jsTestTypedefsPrototypeFunctionSequenceOfNullablesArgBody): (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArgBody): (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArgBody): (WebCore::jsTestTypedefsPrototypeFunctionUnionArgBody): (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampBody): (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampInTypedefBody): (WebCore::jsTestTypedefsPrototypeFunctionMethodWithExceptionBody): 2020-07-29 Darin Adler <darin@apple.com> Improve range idioms and other changes to prepare the way for more reduction in live range use https://bugs.webkit.org/show_bug.cgi?id=214882 Reviewed by Sam Weinig. * accessibility/AXObjectCache.cpp: (WebCore::AccessibilityReplacedText::AccessibilityReplacedText): Call the VisiblePosition versions of start and end instead of converting to Position and then back to VisiblePosition. (WebCore::AXObjectCache::rangeMatchesTextNearRange): Simplify with makeSimpleRange. (WebCore::AXObjectCache::characterOffsetForPoint): Ditto. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::visiblePositionRangeForUnorderedPositions const): Update idiom for creating VisiblePositionRange since it's just a struct now without explicit constructors. (WebCore::AccessibilityObject::positionOfLeftWord const): Ditto. (WebCore::AccessibilityObject::positionOfRightWord const): Ditto. (WebCore::AccessibilityObject::leftLineVisiblePositionRange const): Ditto. (WebCore::AccessibilityObject::rightLineVisiblePositionRange const): Ditto. (WebCore::AccessibilityObject::sentenceForPosition const): Ditto. (WebCore::AccessibilityObject::paragraphForPosition const): Ditto. (WebCore::AccessibilityObject::styleRangeForPosition const): Ditto. (WebCore::AccessibilityObject::visiblePositionRangeForRange const): Ditto. (WebCore::AccessibilityObject::lineRangeForPosition const): Ditto. (WebCore::AccessibilityObject::stringForVisiblePositionRange): Ditto. (WebCore::AccessibilityObject::lengthForVisiblePositionRange const): Ditto. (WebCore::AccessibilityObject::nextSentenceEndPosition const): Ditto. (WebCore::AccessibilityObject::previousSentenceStartPosition const): Ditto. * accessibility/AccessibilityObjectInterface.h: Moved VisiblePositionRange to VisiblePosition.h for wider use. Also removed constructors. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::textUnderElement const): Simplify with makeSimpleRange. (WebCore::AccessibilityRenderObject::linkClickPoint): Ditto. (WebCore::AccessibilityRenderObject::clickPoint): Ditto. (WebCore::AccessibilityRenderObject::visiblePositionRange const): Updated for removal of VisiblePositionRange constructor. (WebCore::AccessibilityRenderObject::visiblePositionRangeForLine const): Remove unnecessary explicit conversion to VisiblePositionRange. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (visiblePositionRangeForTextMarkerRange): Added, replacing separate functions for start and end. (-[WebAccessibilityObjectWrapper visiblePositionRangeForTextMarkerRange:]): Simplify using visiblePositionRangeForTextMarkerRange. * dom/Document.cpp: Added include of "Range.h", may not be needed right now, but highly likely to be needed after future live range work. * dom/Node.cpp: Removed include of "Range.h". * dom/Position.h: Added PositionRange. This will be a more efficient alternative to SimpleRange that can avoid computing node offets for positions before and after anchor nodes in some cases. Not used yet. * dom/RadioButtonGroups.cpp: Removed include of "Range.h". * dom/Range.h: Export makeSimpleRange overload now used outside WebCore. * dom/SimpleRange.cpp: (WebCore::makeSimpleRange): Added overloads for ranges that consist of just a single boundary point, so the argument does not have to be passed twice. (WebCore::commonInclusiveAncestor): Added overload so caller can just pass a simple range rather than passing two boundary point container nodes. * dom/SimpleRange.h: Added makeSimpleRange overloads that take one or more argument that can be passed to makeBoundaryPoint or actual boundary points. * dom/StaticRange.cpp: Removed include of "Range.h". * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): Simplify with makeSimpleRange. (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult): Ditto. * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyBlockStyle): Ditto. * editing/CompositeEditCommand.cpp: (WebCore::stringForVisiblePositionIndexRange): Updated for removal of VisiblePositionRange constructor; also use move to reduce reference count churn a tiny bit. (WebCore::CompositeEditCommand::moveParagraphs): Simplify with makeSimpleRange. * editing/DeleteSelectionCommand.cpp: Added include of "Range.h", may not be needed now, but highly likely to be needed after future live range work. * editing/Editing.cpp: (WebCore::indexForVisiblePosition): Simplify using makeSimpleRange and makeBoundaryPointBeforeNodeContents. * editing/Editor.cpp: (WebCore::Editor::selectedText const): Simplify using VisibleSelection::firstRange. (WebCore::extendSelection): Simplify using makeSimpleRange. (WebCore::Editor::contextRangeForCandidateRequest const): Ditto. (WebCore::Editor::adjustedSelectionRange): Simplify with the new overload of commonInclusiveAncestor. * editing/FrameSelection.cpp: (WebCore::FrameSelection::wordOffsetInRange const): Deleted. Moved the code into the iOS-specific part of WebKitLegacy WebFrame. (WebCore::FrameSelection::spaceFollowsWordInRange const): Deleted. Moved the code into the iOS-specific part of WebKitLegacy WebFrame. (WebCore::FrameSelection::selectionAtSentenceStart const): Merged in with actualSelectionAtSentenceStart. (WebCore::FrameSelection::actualSelectionAtSentenceStart const): Deleted. * editing/FrameSelection.h: Updated for the above deletion. * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingParagraph::offsetTo const): Simplify with makeSimpleRange. * editing/TextManipulationController.cpp: (WebCore::ParagraphContentIterator::ParagraphContentIterator): Simplify with makeSimpleRange. * editing/TypingCommand.cpp: (WebCore::TypingCommand::postTextStateChangeNotificationForDeletion): Pass visibleStart/End instead of converting to Position and back to VisiblePosition. * editing/VisiblePosition.cpp: (WebCore::makeSimpleRange): Added. Converts a VisiblePositionRange into a SimpleRange. * editing/VisiblePosition.h: Moved VisiblePositionRange here. * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::firstRange const): Simplify using makeSimpleRange. (WebCore::VisibleSelection::toNormalizedRange const): Ditto. (WebCore::makeSearchRange): Deleted. This was confusingly named given that it was only used in appendTrailingWhitespace. (WebCore::VisibleSelection::appendTrailingWhitespace): Merged makeSearchRange in here and simplified using makeSimpleRange. * editing/VisibleSelection.h: Added conversion to VisiblePositionRange. Previously this was implemented as a constructor for VisiblePositionRange, but that was a layering inversion since this is built on top of VisiblePosition. * editing/VisibleUnits.cpp: (WebCore::distanceBetweenPositions): Simplified using makeSimpleRange. (WebCore::charactersAroundPosition): Ditto. (WebCore::wordRangeFromPosition): Removed an unhelpful comment. (WebCore::closestWordBoundaryForPosition): Ditto. * editing/cocoa/DataDetection.mm: (WebCore::detectItem): Simplify using makeSimpleRange. (WebCore::searchForLinkRemovingExistingDDLinks): Removed out argument about modifying the DOM. This was used to work around a problem caused by using live ranges. The problem no longer exists because the code does not use live ranges any more. (WebCore::DataDetection::detectContentInRange): Removed the workaround. * editing/cocoa/DictionaryLookup.mm: (WebCore::DictionaryLookup::rangeForSelection): Simplify using makeSimpleRange. (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto. * editing/cocoa/WebContentReaderCocoa.mm: Added include of "Range.h", may not be needed now, but highly likely to be needed after future live range work. * editing/ios/DictationCommandIOS.cpp: Removed include of "Range.h". * editing/mac/DictionaryLookupLegacy.mm: (WebCore::DictionaryLookup::rangeForSelection): Simplify using makeSimpleRange. (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto. * editing/mac/EditorMac.mm: Removed include of "Range.h". * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::renderedTextRespectingRange): Simplify using makeSimpleRange. * editing/win/EditorWin.cpp: Added include of "Range.h", may not be needed now, but highly likely to be needed after future live range work. * html/shadow/mac/ImageControlsButtonElementMac.cpp: Removed include of "Range.h". * page/DOMSelection.cpp: (WebCore::DOMSelection::addRange): Call setSelection instead of moveTo. No need to have two functions that do the same thing. * page/EventHandler.cpp: (WebCore::textDistance): Simplify using makeSimpleRange. * page/Frame.cpp: (WebCore::Frame::rangeForPoint): Simplify using makeSimpleRange. * page/TextIndicator.cpp: (WebCore::estimatedBackgroundColorForRange): Simplify using the commonInclusiveAncestor overload that takes a range. (WebCore::initializeIndicator): Ditto. 2020-07-29 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes, late July 2020 edition https://bugs.webkit.org/show_bug.cgi?id=214918 Unreviewed build fix. No new tests needed. * Modules/webaudio/WebKitOscillatorNode.h: Add missing WebKitAudioContext.h header to make the constructor of WebKitOscillatorNode that WebKitAudioContext inherits from the base context, otherwise the compiler does not know which base class constructor to invoke. * bindings/js/JSDOMConvertDate.h: Add missing JSGlobalObject.h header. * bindings/js/ReadableStreamDefaultController.cpp: Sprinkle missing JSC:: namespace prefixes where needed. (WebCore::invokeReadableStreamDefaultControllerFunction): (WebCore::ReadableStreamDefaultController::close): (WebCore::ReadableStreamDefaultController::error): (WebCore::ReadableStreamDefaultController::enqueue): * editing/SpellChecker.cpp: Add missing inclusion of TextIterator.h. * editing/SpellChecker.h: Add missing inclusion of SimpleRange.h. * editing/TextCheckingHelper.h: Forward declare Frame and VisibleSelection. * editing/TextIterator.cpp: Add missing inclusion of Range.h. * workers/WorkerScriptLoader.h: Add missing inclusion of CertificateInfo.h. 2020-07-29 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r265002. https://bugs.webkit.org/show_bug.cgi?id=214919 Broke imported/w3c/web-platform-tests/webaudio/the-audio-api /the-scriptprocessornode-interface/simple-input-output.html Reverted changeset: "Added constructor methods to ChannelMergerNode, ChannelSplitterNode" https://bugs.webkit.org/show_bug.cgi?id=214851 https://trac.webkit.org/changeset/265002 2020-07-28 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] REGRESSION(r264986) Unreviewed crash fix https://bugs.webkit.org/show_bug.cgi?id=201507 * platform/graphics/egl/GLContextEGL.cpp: (WebCore::GLContextEGL::createWindowContext): Initialize a variable 'surface' as EGL_NO_SURFACE for WinCairo. 2020-07-28 Chris Dumez <cdumez@apple.com> Move non standard OscillatorNode API to new webKitOscillatorNode interface https://bugs.webkit.org/show_bug.cgi?id=214902 Reviewed by Darin Adler. Move non standard OscillatorNode API to new webKitOscillatorNode interface: https://webaudio.github.io/web-audio-api/#oscillatornode Namely, the playbackState attribute and its associated constants are now exposed on the prefixed webKitOscillatorNode interface instead of the unprefixed OscillatorNode. This way, this API is still available to apps using the prefixed API but we do not support this legacy API if the app is using the modern unprefixed API. Test: webaudio/oscillatornode-legacy-api.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): (WebCore::OscillatorNode::setType): (WebCore::OscillatorNode::setPeriodicWave): * Modules/webaudio/OscillatorNode.h: * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createWebKitOscillator): * Modules/webaudio/WebKitAudioContext.h: * Modules/webaudio/WebKitAudioContext.idl: * Modules/webaudio/WebKitOscillatorNode.h: Copied from Source/WebCore/Modules/webaudio/OscillatorNode.idl. (WebCore::WebKitOscillatorNode::create): (WebCore::WebKitOscillatorNode::setWebKitPeriodicWave): (WebCore::WebKitOscillatorNode::WebKitOscillatorNode): * Modules/webaudio/WebKitOscillatorNode.idl: Copied from Source/WebCore/Modules/webaudio/OscillatorNode.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2020-07-28 Karl Rackler <rackler@apple.com> Unreviewed, reverting r264930. Reverting Pre-Submission Testing Reverted changeset: "scaleResolutionDownBy has no effect on RTCRtpSender" https://bugs.webkit.org/show_bug.cgi?id=214783 https://trac.webkit.org/changeset/264930 2020-07-28 Oriol Brufau <obrufau@igalia.com> [css-grid] Fix 'align-content' in grid containers with small content area https://bugs.webkit.org/show_bug.cgi?id=214370 Reviewed by Darin Adler. In order to properly obey 'align-content', grid containers need to know the available grid space for the block axis. But there was a bug when the sum of border and padding sizes in the block axis were bigger than the content area. Then the available space was considered to be that sum. This patch fixes it so that the available grid space is the size of its content box when that is definite. Tests: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-place-content-001.html imported/w3c/web-platform-tests/css/css-sizing/available-height-for-replaced-content-001.html * rendering/RenderBox.cpp: (WebCore::RenderBox::availableLogicalHeight const): 2020-07-28 Peng Liu <peng.liu6@apple.com> Clean up PlaybackSessionInterface[Mac|AVKit] https://bugs.webkit.org/show_bug.cgi?id=214895 Reviewed by Eric Carlson. No new tests, no functional change. * platform/ios/PlaybackSessionInterfaceAVKit.h: * platform/ios/PlaybackSessionInterfaceAVKit.mm: (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit): (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const): Remove unnecessary WEBCORE_EXPORT. Include the correct header for Ref. Replace "protected" with "private". Use WeakPtr of PlaybackSessionModel instead of a raw pointer. * platform/mac/PlaybackSessionInterfaceMac.h: Add "final" to ensureControlsManager(). Some small cleanup. 2020-07-28 Chris Dumez <cdumez@apple.com> [EventSource] WebKit fails to UTF-8 encode the Last-Event-ID HTTP header value https://bugs.webkit.org/show_bug.cgi?id=214860 Reviewed by Alex Christensen and Darin Adler. WebKit fails to UTF-8 encode the Last-Event-ID HTTP header value for EventSource. The specification is here: https://html.spec.whatwg.org/multipage/server-sent-events.html#reestablish-the-connection (step 5.3.) This is causing us to fail a couple of EventSource web-platform-tests which are passing in both Chrome & Firefox. No new tests, rebaselined existing tests. * platform/network/cf/ResourceRequestCFNet.cpp: (WebCore::setHeaderFields): * platform/network/cf/ResourceRequestCFNet.h: (WebCore::httpHeaderValueUsingSuitableEncoding): * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::doUpdatePlatformRequest): 2020-07-28 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] ANGLE D3D renderer can crash when PlatformDisplayWin is destructed in IPC thread https://bugs.webkit.org/show_bug.cgi?id=214241 Reviewed by Don Olmstead. Web process calls _exit() in IPC thread when the IPC connection is closed. PlatformDisplay::sharedDisplay has a static variable of std::unique_ptr<PlatformDisplay> to ensure it will be destructed on the process termination. This rarely causes crashes in ANGLE because ANGLE D3D renderer isn't thread-safe at the moment. * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::sharedDisplay): Don't destruct PlatformDisplay for PLATFORM(WIN). Use unique_ptr::release to leak it. 2020-07-28 Clark Wang <clark_wang@apple.com> Added constructor methods to ChannelMergerNode, ChannelSplitterNode https://bugs.webkit.org/show_bug.cgi?id=214851 Reviewed by Chris Dumez. Added constructors for ChannelMergerNode, ChannelSplitterNode according to spec: https://www.w3.org/TR/webaudio/#ChannelMergerNode-constructors. Added new files for ChannelMergerOptions and ChannelSplitterOptions. Re-baselined existing tests that now pass, or fail due to a different interface. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioNode.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createChannelSplitter): (WebCore::BaseAudioContext::createChannelMerger): * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): (WebCore::ChannelMergerNode::setChannelCount): (WebCore::ChannelMergerNode::setChannelCountMode): * Modules/webaudio/ChannelMergerNode.h: * Modules/webaudio/ChannelMergerNode.idl: * Modules/webaudio/ChannelMergerOptions.h: Added. * Modules/webaudio/ChannelMergerOptions.idl: Added. * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): (WebCore::ChannelSplitterNode::setChannelCount): (WebCore::ChannelSplitterNode::setChannelCountMode): (WebCore::ChannelSplitterNode::setChannelInterpretation): * Modules/webaudio/ChannelSplitterNode.h: * Modules/webaudio/ChannelSplitterNode.idl: * Modules/webaudio/ChannelSplitterOptions.h: Added. * Modules/webaudio/ChannelSplitterOptions.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-28 Rob Buis <rbuis@igalia.com> PerformanceObserver should work with 'type' and not just `entryTypes` https://bugs.webkit.org/show_bug.cgi?id=209216 Reviewed by Youenn Fablet. Add support for 'type' attribute as specified here [1]. Tests: imported/w3c/web-platform-tests/performance-timeline/po-observe-type.any.html imported/w3c/web-platform-tests/performance-timeline/po-observe-type.any.worker.html [1] https://w3c.github.io/performance-timeline/#dom-performanceobserverinit * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/PerformanceObserver.h: * page/PerformanceObserver.idl: 2020-07-28 Karl Rackler <rackler@apple.com> Unreviewed, reverting r264955. Reverting because this commit may have caused issues with tests. Reverted changeset: "WebCoreResourceHandleAsOperationQueueDelegate can use RunLoop::dispatch" https://bugs.webkit.org/show_bug.cgi?id=214771 https://trac.webkit.org/changeset/264955 2020-07-28 Saam Barati <sbarati@apple.com> JSPromise::reject might throw more than an unterminated exception https://bugs.webkit.org/show_bug.cgi?id=214854 <rdar://problem/66152648> Reviewed by Yusuke Suzuki. Before, we were assuming the only exception that could be thrown was an early termination exception. However, it's tenuous to assume the types of exceptions that can be thrown. This particular test was throwing a stack overflow exception. It's better form to just propagate the exception upwards instead of attempting to enumerate the list of valid exceptions. Test: js/dom/promise-rejection-might-stack-overflow.html * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::DeferredPromise::reject): 2020-07-28 Alex Christensen <achristensen@webkit.org> Add null checks in ResourceLoader https://bugs.webkit.org/show_bug.cgi?id=214786 <rdar://problem/61106685> Reviewed by Youenn Fablet. We had added some iOS-only checks based on crash tracer data. It turns out these code paths are indeed reachable. Let's make ResourceLoader less platform-dependent. The original patch for this has a test that would reach this code, but it never finishes loading. Rather than add a test that always times out or not committing the fix, I commit the fix without the test. * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::init): (WebCore::ResourceLoader::cancel): 2020-07-28 Yusuke Suzuki <ysuzuki@apple.com> IndexedDB binding utilities miss exception checks https://bugs.webkit.org/show_bug.cgi?id=214820 <rdar://problem/66152374> Reviewed by Mark Lam. Test: js/dom/indexed-db-operations-exception-checks.html This patch appropriately inserts exception checking code into IndexedDB binding utilities. * Modules/indexeddb/IDBKeyRange.cpp: (WebCore::IDBKeyRange::only): (WebCore::IDBKeyRange::lowerBound): (WebCore::IDBKeyRange::upperBound): (WebCore::IDBKeyRange::bound): (WebCore::IDBKeyRange::includes): * bindings/js/IDBBindingUtilities.cpp: (WebCore::get): (WebCore::set): (WebCore::toJS): (WebCore::createIDBKeyFromValue): (WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath): (WebCore::ensureNthValueOnKeyPath): (WebCore::injectIDBKeyIntoScriptValue): (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): (WebCore::canInjectIDBKeyIntoScriptValue): (WebCore::scriptValueToIDBKey): * bindings/js/IDBBindingUtilities.h: * bindings/js/JSCustomXPathNSResolver.cpp: (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI): * bindings/js/JSDOMConvertDate.cpp: (WebCore::valueToDate): * bindings/js/JSDOMConvertDate.h: (WebCore::Converter<IDLDate>::convert): * bindings/js/JSDOMConvertStrings.h: (WebCore::JSConverter<IDLDOMString>::convert): (WebCore::JSConverter<IDLByteString>::convert): (WebCore::JSConverter<IDLUSVString>::convert): * bindings/js/JSDOMConvertWebGL.cpp: (WebCore::convertToJSValue): * bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::initializeJSFunction const): * bindings/scripts/CodeGeneratorJS.pm: (GenerateEnumerationImplementationContent): * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: (WebCore::convertEnumerationToJS): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::convertEnumerationToJS): * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: (WebCore::convertEnumerationToJS): * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp: (WebCore::convertEnumerationToJS): * bridge/c/c_utility.cpp: (JSC::Bindings::convertNPVariantToValue): 2020-07-28 Adrian Perez de Castro <aperez@igalia.com> [GTK] Crash in Nicosia::GC3DLayer::makeContextCurrent due to failure in EGL display creation https://bugs.webkit.org/show_bug.cgi?id=201507 Reviewed by Carlos Garcia Campos. Ensure that EGL context and display creation failures are always logged using RELEASE_LOG_INFO(), even for intermediate failures for which a fallback will be tried next, in order to ease diagnosis of related issues. Failure to create contexts at the end of the public methods ::createContext() and ::createSharingContext() is still logged with WTFLogAlways() to write a notice to standard error, and let users/developers know that something failed and checking the complete logs (e.g. with "journalctl" on Linux) may reveal more information. This also replaces the chains of "if" statements with a single "switch" on the PlatformDisplay::Type enum, which makes the code easier to follow and should be more robust as well. No new tests needed. * platform/graphics/egl/GLContextEGL.cpp: (WebCore::GLContextEGL::getEGLConfig): (WebCore::GLContextEGL::createWindowContext): (WebCore::GLContextEGL::createSurfacelessContext): (WebCore::GLContextEGL::createContext): (WebCore::GLContextEGL::createSharingContext): 2020-07-28 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer] Use GST_PLUGIN_FEATURE_RANK env var to have Thunder ranked higher in runtime instead of current custom one https://bugs.webkit.org/show_bug.cgi?id=214826 * platform/graphics/gstreamer/GStreamerCommon.cpp: Unreviewed, added comment about delaying because of the dependency on GStreamer 1.16. 2020-07-28 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer] media/vp9.html failing since check-in in r263894 https://bugs.webkit.org/show_bug.cgi?id=213947 Reviewed by Philippe Normand. Test: media/vp9.html. * testing/Internals.cpp: (WebCore::Internals::usingGStreamer const): Added. * testing/Internals.h: * testing/Internals.idl: 2020-07-27 Carlos Garcia Campos <cgarcia@igalia.com> [GTK][WPE] Support for backdrop-filter https://bugs.webkit.org/show_bug.cgi?id=169988 Reviewed by Adrian Perez de Castro. Add initial support for backdrop filters to coordinated graphics. * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::CompositionLayer::flushState): Update the backdrop layer. * platform/graphics/texmap/TextureMapper.h: * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeTransformsRecursive): Call it on backdrop layer too. (WebCore::TextureMapperLayer::paintSelfAndChildren): Paint the backdrop layer before current layer to apply backdrop filters on previous contents, then the layer is painted on top. (WebCore::TextureMapperLayer::paintIntoSurface): In case of backdrop layer paint the root layer up to the target layer into the intermediate surface. (WebCore::TextureMapperLayer::setBackdropLayer): Set the bakdrop layer and mark it as such. (WebCore::TextureMapperLayer::applyAnimationsRecursively): Also call syncAnimations on backdrop layer to get the filters updated. * platform/graphics/texmap/TextureMapperLayer.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::didChangeBackdropFilters): (WebCore::CoordinatedGraphicsLayer::didChangeBackdropFiltersRect): (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect): Also call it for backdrop layer. (WebCore::CoordinatedGraphicsLayer::setContentsVisible): Ditto. (WebCore::CoordinatedGraphicsLayer::setBackdropFilters): (WebCore::CoordinatedGraphicsLayer::setBackdropFiltersRect): (WebCore::CoordinatedGraphicsLayer::flushCompositingState): Also call it for backdrop layer. (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): Handle the changes in backdrop filters and the rect, creating the backdrop layer or updating it. (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers): Also call it for backdrop layer. (WebCore::CoordinatedGraphicsLayer::addAnimation): Handle AnimatedPropertyWebkitBackdropFilter property. (WebCore::dumpInnerLayer): Dump internal layer info. (WebCore::CoordinatedGraphicsLayer::dumpAdditionalProperties const): Dump backdrop layer. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: 2020-07-28 Youenn Fablet <youenn@apple.com> ReadableStreamDefaultController should use private JS built-in methods https://bugs.webkit.org/show_bug.cgi?id=214819 Reviewed by Darin Adler. Call directly private buitl-in methods instead of getting close/error/enqueue methods from the controller. Test: http/wpt/fetch/readableStreamDefaultController-overwriting.html * bindings/js/ReadableStreamDefaultController.cpp: (WebCore::invokeReadableStreamDefaultControllerFunction): (WebCore::ReadableStreamDefaultController::close): (WebCore::ReadableStreamDefaultController::error): (WebCore::ReadableStreamDefaultController::enqueue): * bindings/js/ReadableStreamDefaultController.h: (WebCore::ReadableStreamDefaultController::enqueue): (WebCore::ReadableStreamDefaultController::error): 2020-07-27 Carlos Garcia Campos <cgarcia@igalia.com> REGRESSION(r230479): [TextureMapper] replica layer is not rendered https://bugs.webkit.org/show_bug.cgi?id=214827 Reviewed by Adrian Perez de Castro. Since r230479 the replica layer transform is not applied because m_layerTransforms.localTransform is never set for the replica layer. We need to call applyAnimationsRecursively() on the replica layer to initialize the localTransform (even when we know the replica layer won't have animations). * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::applyAnimationsRecursively): 2020-07-27 Alex Christensen <achristensen@webkit.org> Null check inlineStyle in StyledElement::invalidateStyleAttribute https://bugs.webkit.org/show_bug.cgi?id=214782 <rdar://problem/66052987> Reviewed by Geoffrey Garen. This fixes a reachable crash. Test: fast/dom/null-inline-style.html * dom/StyledElement.cpp: (WebCore::StyledElement::invalidateStyleAttribute): 2020-07-27 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Drag and drop does not preserve file names that contain periods https://bugs.webkit.org/show_bug.cgi?id=214701 <rdar://problem/66014009> Reviewed by Tim Horton. Cocoa documentation does not make it clear whether the `-suggestedName` property on `NSItemProvider` should or should not include the file extension. To avoid adding a redundant file extension, logic in `WebItemProviderPasteboard` attempts to deduce whether the suggested name already contains an extension, and only appends a file extension (taken from name of the original file) if the suggested name does not have one. Unfortunately, since this logic only checks whether or not there is a period in the filename, it will incorrectly avoid adding a file extension when the suggested name contains a period. To fix this, instead of checking for the presence of a period, check to see whether the file extension of the suggested name is the same, and append the extension if it isn't. Test: DragAndDropTests.SuggestedNameContainsDot * platform/ios/WebItemProviderPasteboard.mm: (linkTemporaryItemProviderFilesToDropStagingDirectory): 2020-07-27 Zalan Bujtas <zalan@apple.com> Extension is sized incorrectly, content is cut off. https://bugs.webkit.org/show_bug.cgi?id=214858 <rdar://problem/64135680> Reviewed by Simon Fraser. Autosizing uses an 1px tall viewport to layout the content initially. When the document renderer's height is set to a percent value, this 1px tall viewport will drive the available height for the descendants and we pretty much end up with overflow content. Autosizing takes the overflow into account when computing the final content size, however this overflow depends on the type of the layout context (e.g. flex vs. block). Let's replace percent height values on the document renderer with the initial "height: auto". Test: fast/dynamic/size-to-content-autosize-with-percent-document-height.html * page/FrameView.cpp: (WebCore::FrameView::performSizeToContentAutoSize): 2020-07-27 Chris Dumez <cdumez@apple.com> Update release*() functions on ExceptionOr() to always release the member https://bugs.webkit.org/show_bug.cgi?id=214835 Reviewed by Darin Adler. Update release*() functions on ExceptionOr() to always release the member instead of simply doing a cast to an rvalue reference and leaving it up to the caller. Also add assertions to make sure we don't release those members more than once and to make sure we don't try to access the member after releasing it. * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::doOpenCursor): (WebCore::IDBIndex::doOpenKeyCursor): (WebCore::IDBIndex::doGetAll): (WebCore::IDBIndex::doGetAllKeys): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::doOpenCursor): (WebCore::IDBObjectStore::doOpenKeyCursor): (WebCore::IDBObjectStore::doDelete): (WebCore::IDBObjectStore::doGetAll): (WebCore::IDBObjectStore::doGetAllKeys): Fix issues found in existing code by new assertions. * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::exception const): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::returnValue const): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): (WebCore::>::releaseException): (WebCore::ExceptionOr<void>::exception const): (WebCore::ExceptionOr<void>::releaseException): * dom/TreeWalker.cpp: Fix issues found in existing code by new assertions. 2020-07-27 Geoffrey Garen <ggaren@apple.com> WebCoreResourceHandleAsOperationQueueDelegate can use RunLoop::dispatch https://bugs.webkit.org/show_bug.cgi?id=214771 Reviewed by Darin Adler. Use the new helper function for consistency, and to remove a bit of code. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (scheduledWithCustomRunLoopMode): Deleted. (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]): Deleted. 2020-07-27 Chris Dumez <cdumez@apple.com> thisValue is not always set correctly when calling JS callbacks https://bugs.webkit.org/show_bug.cgi?id=214847 Reviewed by Darin Adler. thisValue was not always set correctly when calling JS callbacks. This was causing us to fail the last subtest on: http://w3c-test.org/dom/traversal/TreeWalker-acceptNode-filter.html The specification for TreeWalker is here: - https://dom.spec.whatwg.org/#concept-node-filter Step 6 refers to [call a user object’s operation] in the WebIDL specification: - https://heycam.github.io/webidl/#call-a-user-objects-operation Step 10.5 says: "Set thisArg to O (overriding the provided value)." We were missing this step in our implementation so thisValue ended up being undefined (as per earlier step 2). No new tests, resync'd existing test. * bindings/js/JSCallbackData.cpp: (WebCore::JSCallbackData::invokeCallback): 2020-07-27 Sihui Liu <sihui_liu@appe.com> Text manipulation should not extract non-breaking spaces https://bugs.webkit.org/show_bug.cgi?id=214839 <rdar://problem/64113531> Reviewed by Wenson Hsieh. Spaces are very likely to be dropped during translation. And non-breaking space, if dropped, is likely to affect layout of web page. API test: TextManipulation.StartTextManipulationIgnoresSpaces * editing/TextManipulationController.cpp: (WebCore::isNotSpace): (WebCore::TextManipulationController::parse): 2020-07-27 Chris Dumez <cdumez@apple.com> ASSERT([filteredCookies.get() count] <= 1) on imported/w3c/web-platform-tests/websockets/cookies/third-party-cookie-accepted.https.html https://bugs.webkit.org/show_bug.cgi?id=214222 <rdar://problem/65587120> Reviewed by Alex Christensen. Per the HTML specification [1], upon setting document.cookie, we should act as we would when receiving a Set-Cookie string [2]. This means that you can only set one cookie at a time (you cannot comma-separate several cookies). We were behaving correctly on macOS because we were using the [NSHTTPCookie _parsedCookiesWithResponseHeaderFields] SPI that was made specifically for this purpose. However, we would set multiple cookies (in release), and crash in debug on iOS because iOS was using a different API to parse the cookies ([NSHTTPCookie cookiesWithResponseHeaderFields:). Note that [NSHTTPCookie _parsedCookiesWithResponseHeaderFields] was deprecated in CFNetwork, in favor of [NSHTTPCookie _cookieForSetCookieString:]. As a result, I updated both macOS and iOS to use the same new CFNetwork SPI, which gives us the standard behavior. [1] https://html.spec.whatwg.org/#dom-document-cookie [2] https://tools.ietf.org/html/rfc6265#section-4.1 Test: http/tests/cookies/document-cookie-multiple-cookies.html * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::parseDOMCookie): (WebCore::NetworkStorageSession::setCookiesFromDOM const): 2020-07-27 Clark Wang <clark_wang@apple.com> Added Constructor method to OscillatorNode https://bugs.webkit.org/show_bug.cgi?id=214746 Reviewed by Chris Dumez. Re-baselined existing tests that now pass, or fail further along. Added ctor to OscillatorNode, added OscillatorOptions, OscillatorType files all according to spec: https://www.w3.org/TR/webaudio/#OscillatorNode-constructors. Updated createOscillator() method in BaseAudioContext. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioContextOptions.h: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createOscillator): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): (WebCore::OscillatorNode::OscillatorNode): (WebCore::OscillatorNode::setType): (WebCore::OscillatorNode::setPeriodicWave): * Modules/webaudio/OscillatorNode.h: (WTF::LogArgument<WebCore::OscillatorType>::toString): (WTF::LogArgument<WebCore::OscillatorNode::Type>::toString): Deleted. * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/OscillatorOptions.h: Copied from Source/WebCore/Modules/webaudio/PeriodicWaveConstraints.h. * Modules/webaudio/OscillatorOptions.idl: Copied from Source/WebCore/Modules/webaudio/PeriodicWaveConstraints.h. * Modules/webaudio/OscillatorType.h: Copied from Source/WebCore/Modules/webaudio/PeriodicWaveConstraints.h. * Modules/webaudio/OscillatorType.idl: Copied from Source/WebCore/Modules/webaudio/PeriodicWaveConstraints.h. * Modules/webaudio/PannerOptions.h: * Modules/webaudio/PeriodicWave.cpp: * Modules/webaudio/PeriodicWaveConstraints.h: * Modules/webaudio/PeriodicWaveOptions.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-27 Mark Lam <mark.lam@apple.com> DisallowVMEntry needs a copy assignment operator, detected by gcc's -Wdeprecated-copy warning https://bugs.webkit.org/show_bug.cgi?id=214809 Reviewed by Yusuke Suzuki. Added handling of a possible VMInquiry failure in JSDOMWindow::getOwnPropertySlot() after returning from Base::getOwnPropertySlot(). If a VMInquiry is requested and Base::getOwnPropertySlot() returns false with slot.isTaintedByOpaqueObject() set, then it means that Base::getOwnPropertySlot() failed to execute the VMInquiry, not that it successfully determined that the property doesn't exist. This issue was noticed while studying how JSDOMWindow::getOwnPropertySlot() uses copy assignment of JSC::PropertySlots. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlot): 2020-07-27 Dean Jackson <dino@apple.com> Repeatable WebContent crash: WebCore::jsWebGLRenderingContextPrototypeFunctionGetError https://bugs.webkit.org/show_bug.cgi?id=214814 rdar://59290537 Reviewed by Anders Carlsson. If a WebGL context was killed due to too many contexts in the page, we would get a null pointer crash if the page called getError() more than once on it. This is an edge case not covered by the WebGL conformance suite since the recyling behaviour is specific to our implementation. Test: fast/canvas/webgl/recycle-contexts.html * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::getError): Add a null check. 2020-07-27 Youenn Fablet <youenn@apple.com> scaleResolutionDownBy has no effect on RTCRtpSender https://bugs.webkit.org/show_bug.cgi?id=214783 <rdar://problem/66108346> Reviewed by Eric Carlson. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::updateRTCRtpSendParameters): Allow to change scaleResolutionDownBy. 2020-07-25 Simon Fraser <simon.fraser@apple.com> Scroll Snap broken when using RTL layout https://bugs.webkit.org/show_bug.cgi?id=193671 <rdar://problem/47457471> Reviewed by Wenson Hsieh. There were various places in the scroll snapping code which confused scroll offsets (zero-based) with scroll positions (relative to scroll origin, can be negative). This broke snapping in `direction: rtl` content. The computation of snap locations in updateSnapOffsetsForScrollableArea() was also broken in RTL; we need to snap the right edge of boxes to the right edge of the scroller for the 'start' alignment. (Snapping for LTR boxes in an RTL scroller is poorly defined; for now, follow Gecko.) Tests: css3/scroll-snap/scroll-snap-2d-change-axis-type-rtl.html css3/scroll-snap/scroll-snap-2d-offsets-computed-independently.rtl.html css3/scroll-snap/scroll-snap-elements-container-larger-than-children-rtl.html css3/scroll-snap/scroll-snap-iframe-rtl.html css3/scroll-snap/scroll-snap-offsets-mixed-rtl.html css3/scroll-snap/scroll-snap-offsets-rtl.html * page/scrolling/AxisScrollSnapOffsets.cpp: (WebCore::computeScrollSnapAlignOffset): (WebCore::updateSnapOffsetsForScrollableArea): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const): * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset): (WebCore::ScrollAnimator::scrollOffset const): * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::updateScrollSnapPoints): 2020-07-26 Michael Catanzaro <mcatanzaro@gnome.org> -Wunused-parameter in FilterEffectRenderer.cpp https://bugs.webkit.org/show_bug.cgi?id=214808 Unreviewed. * platform/graphics/filters/FilterEffectRenderer.cpp: (WebCore::FilterEffectRenderer::tryCreate): 2020-07-22 Darin Adler <darin@apple.com> Stop using live ranges in SpellChecker.h and TextCheckingHelper.h https://bugs.webkit.org/show_bug.cgi?id=214648 Reviewed by Sam Weinig. * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: Removed unneeded include of TextCheckingHelper.h. * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::removeMarkers): Updated for change to the argument type name. (WebCore::DocumentMarkerController::filterMarkers): Ditto. (WebCore::addMarker): Added. Convenience so call doesn't have to get the document to call this. (WebCore::removeMarkers): Ditto. * dom/DocumentMarkerController.h: Moved RemovePartiallyOverlappingMarker out of the DocumentMarkerController class, tweaked its name and changed it into an enum class. Added conveniences functions for add/removeMarker. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Use convenience versions of removeMarkers and addMarker. (WebCore::AlternativeTextController::handleAlternativeTextUIResult): Ditto. (WebCore::AlternativeTextController::respondToUnappliedEditing): Ditto. (WebCore::AlternativeTextController::markReversed): Ditto. (WebCore::AlternativeTextController::markCorrection): Ditto. (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection): Ditto. (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): Ditto. (WebCore::AlternativeTextController::applyAlternativeTextToRange): Ditto. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Ditto. * editing/Editor.cpp: (WebCore::Editor::ignoreSpelling): Ditto. (WebCore::Editor::learnSpelling): Ditto. (WebCore::Editor::advanceToNextMisspelling): Rewrote to not use a live range and for the changes to the TextCheckingHelper. (WebCore::Editor::isSelectionUngrammatical): Deleted. (WebCore::Editor::guessesForMisspelledOrUngrammatical): Changed to use a return value instead of out arguments. (WebCore::Editor::clearMisspellingsAndBadGrammar): Use convenience versions of removeMarkers. (WebCore::Editor::markMisspellingsAfterTypingToWord): Ditto. (WebCore::Editor::markMisspellingsOrBadGrammar): Updated for change to TextCheckingHelper. (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Do not use live ranges. (WebCore::correctSpellcheckingPreservingTextCheckingParagraph): Take a range that isn't a live range. (WebCore::Editor::markAndReplaceFor): Tweak for changes to text checking and to use convenience version of addMarker. (WebCore::Editor::changeBackToReplacedString): Use convenience versions of removeMarkers and addMarker. (WebCore::Editor::updateMarkersForWordsAffectedByEditing): Ditto. (WebCore::Editor::countMatchesForText): Ditto. (WebCore::Editor::scanSelectionForTelephoneNumbers): Ditto. (WebCore::Editor::editorUIUpdateTimerFired): Ditto. (WebCore::Editor::handleAcceptedCandidate): Ditto. * editing/Editor.h: Update for the above. * editing/SpellChecker.cpp: (WebCore::SpellCheckRequest::SpellCheckRequest): No longer take live ranges. (WebCore::SpellCheckRequest::create): Ditto. (WebCore::SpellChecker::canCheckAsynchronously const): Ditto. (WebCore::SpellChecker::isCheckable const): Ditto. (WebCore::SpellChecker::didCheckSucceed): Use convenience versions of removeMarkers. * editing/SpellChecker.h: Remove the use of live ranges. Removed many unneeded includes and forward declarations. * editing/TextCheckingHelper.cpp: (WebCore::expandToParagraphBoundary): Take and return non-live ranges. (WebCore::TextCheckingParagraph::TextCheckingParagraph): Ditto. (WebCore::TextCheckingParagraph::expandRangeToNextEnd): Updated to use non-live ranges. (WebCore::TextCheckingParagraph::invalidateParagraphRangeValues): Ditto. (WebCore::TextCheckingParagraph::paragraphRange const): Ditto. (WebCore::TextCheckingParagraph::subrange const): Ditto. (WebCore::TextCheckingParagraph::offsetTo const): Ditto. (WebCore::TextCheckingParagraph::offsetAsRange const): Ditto. (WebCore::TextCheckingParagraph::automaticReplacementStart const): Ditto. (WebCore::TextCheckingParagraph::automaticReplacementLength const): Ditto. (WebCore::TextCheckingHelper::~TextCheckingHelper): Deleted. (WebCore::TextCheckingHelper::findMispelledWords const): Renamed from findFirstMispelling, and made this private function since it has confusing argument and return types. Reimplemented to use non-live ranges and to use return values and the addMarker convenience function. Also changed this to not mark when called just to find the first mispelled word. The old version always marked, which didn't make logical sense, but was harmless because the caller always marked the same way. Now this does what it says. (WebCore::TextCheckingHelper::findFirstMisspelledWord const): Added. Replaces findFirstMispelling as a public function, and returns a structure instead of using out arguments. (WebCore::TextCheckingHelper::findFirstMisspelledWordOrUngrammaticalPhrase const): Renamed from findFirstMisspellingOrBadGrammar and changed to return a structure instead of using out arguments. (WebCore::TextCheckingHelper::findUngrammaticalPhrases const): Renamed from findFirstGrammarDetail and findFirstBadGrammar. Both functions are now private and use the new Operation enum class to distinguish the "find first" from "mark all" usage. Also use the convience version of addMarker and return results in a structure instead of using out arguments. (WebCore::TextCheckingHelper::findFirstUngrammaticalPhrase const): Added. Replaces findFirstBadGrammar as a public function, returns a structure instead of using out arguments. (WebCore::TextCheckingHelper::guessesForMisspelledWordOrUngrammaticalPhrase const): Renamed from guessesForMisspelledOrUngrammaticalRange and changed to return a structure instead of out arguments. (WebCore::TextCheckingHelper::markAllMisspelledWords const): Renamed from markAllMisspellings and changed to use a return value instead of an out argument. (WebCore::TextCheckingHelper::markAllUngrammaticalPhrases const): Renamed from markAllBadGrammar. * editing/TextCheckingHelper.h: Removed unneed include of "EditorClient.h". Use non-live ranges. Updated for the other changes above. * editing/ios/DictationCommandIOS.cpp: (WebCore::DictationCommandIOS::doApply): Use the convenience version of addMarker. * editing/ios/EditorIOS.mm: (WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::populate): Updated for the change to Editor::guessesForMisspelledOrUngrammatical. * platform/text/TextChecking.h: Added a TextCheckingGuesses structure here used both by Editor and TextCheckingHelper. 2020-07-26 Youenn Fablet <youenn@apple.com> Update capture MediaStreamTrack frameRate and aspectRatio capabilities https://bugs.webkit.org/show_bug.cgi?id=214741 Reviewed by Eric Carlson. We support frame decimation to decrease the frame rate. This allows to get a frame rate down to 1. We support resizing up to max width/height resolution. This allows very wide aspect ratios. Covered by updated tests. * platform/mediastream/RealtimeVideoCaptureSource.cpp: (WebCore::RealtimeVideoCaptureSource::updateCapabilities): 2020-07-24 Mark Lam <mark.lam@apple.com> pluginElementCustomGetOwnPropertySlot() should support VMInquiry requests. https://bugs.webkit.org/show_bug.cgi?id=214555 <rdar://problem/65855400> Reviewed by Yusuke Suzuki. 1. Add handling for VMInquiry failure in CodeGeneratorJS. 2. Fix pluginElementCustomGetOwnPropertySlot() to setIsTaintedByOpaqueObject(). 3. Fix pluginElementCustomGetOwnPropertySlot() handle a VMInquiry failure case and if so, to initialize the PropertySlot to a jsUndefined() value. The client shouldn't be reading the value if the VMInquiry failed, but as a defensive action, we'll initialize the slot to effectively return an undefined value. * bindings/js/JSPluginElementFunctions.cpp: (WebCore::pluginElementCustomGetOwnPropertySlot): * bindings/scripts/CodeGeneratorJS.pm: (GenerateGetOwnPropertySlot): (GenerateGetOwnPropertySlotByIndex): * bindings/scripts/test/JS/JSTestPluginInterface.cpp: (WebCore::JSTestPluginInterface::getOwnPropertySlot): (WebCore::JSTestPluginInterface::getOwnPropertySlotByIndex): 2020-07-25 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Crash under ValidationBubble::setAnchorRect when showing form validation UI in unparented view https://bugs.webkit.org/show_bug.cgi?id=214789 <rdar://problem/66104012> Reviewed by Tim Horton. On iOS, in the case where `WKWebView` is unparented (or is otherwise missing a root view controller, or the private WKUIDelegate method `-_presentingViewControllerForWebView:` returns `nil`), we end up crashing under `ValidationBubble::setAnchorRect` while attempting to add `presentingViewController.view` (which is `nil`) to an array of passthrough views. Since `fallbackViewController` is not guaranteed to successfully find a view controller anyways, make this scenario fail gracefully with a null check, instead of crashing the app. Test: FormValidation.PresentingFormValidationUIWithoutViewControllerDoesNotCrash * platform/ios/ValidationBubbleIOS.mm: (WebCore::ValidationBubble::setAnchorRect): 2020-07-25 Simon Fraser <simon.fraser@apple.com> Some scroll snap cleanup https://bugs.webkit.org/show_bug.cgi?id=214788 Reviewed by Wenson Hsieh. Mostly cleanup in updateSnapOffsetsForScrollableArea() related to getting the scroll limits, which changes behavior. updateSnapOffsetsForScrollableArea() was manually computing the scroll limits with scrollingElementBox.scrollWidth() - scrollingElementBox.contentWidth(), but needs to use the same computation that scrolling uses, namely scrollableArea.maximumScrollOffset(). This changes results, since the old code could compute offsets outside of the scroll limits. It can also get the scrollPosition from the scrollableArea, instead of going via Element. When computing scroll offsets, explicitly round now (which changes some test results). * page/scrolling/AxisScrollSnapOffsets.cpp: (WebCore::updateSnapOffsetsForScrollableArea): * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset): Explicitly round. * platform/ScrollTypes.h: * platform/ScrollableArea.h: * platform/cocoa/ScrollController.h: * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::setActiveScrollSnapIndicesForOffset): Use ScrollOffset instead of x,y. 2020-07-25 Kenneth Russell <kbr@chromium.org> [WebGL2] Context state updates https://bugs.webkit.org/show_bug.cgi?id=209513 Reviewed by Dean Jackson. Refactor a few methods related to context state to reduce duplicated code between WebGL 1.0 and 2.0. No behavioral changes. Covered by existing WebGL conformance tests. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::validateCapability): (WebCore::WebGL2RenderingContext::clear): Deleted. (WebCore::WebGL2RenderingContext::hint): Deleted. * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::hint): Deleted. (WebCore::WebGLRenderingContext::clear): Deleted. (WebCore::WebGLRenderingContext::validateCapability): Deleted. * html/canvas/WebGLRenderingContext.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::clear): (WebCore::WebGLRenderingContextBase::hint): (WebCore::WebGLRenderingContextBase::validateCapability): * html/canvas/WebGLRenderingContextBase.h: 2020-07-24 Brady Eidson <beidson@apple.com> Throw another one on the pile take 2. * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): Back to the NSString* trick now we know the function is declared. 2020-07-24 Brady Eidson <beidson@apple.com> Throw another one on the pile. * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (Actually include the SPI header) 2020-07-24 Brady Eidson <beidson@apple.com> Maybe the last build fix after r264874 * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: 2020-07-24 Brady Eidson <beidson@apple.com> Yet another (bizarre?) attempted build fix after r264874 * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): The last attempt revealed the real problem - missing declaration for this function. *sigh* 2020-07-24 Brady Eidson <beidson@apple.com> Another (bizarre?) attempted build fix after r264874 * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): The CFSTR macro was wonky for unknown reasons...? Let's try it this way. 2020-07-24 Brady Eidson <beidson@apple.com> Build fix after r264874 Remove all nullability specifiers because just having one goes viral. * platform/gamepad/cocoa/GameControllerSPI.h: 2020-07-24 Alex Christensen <achristensen@webkit.org> Null check frame in Document::dispatchDisabledAdaptationsDidChangeForMainFrame and a few other places https://bugs.webkit.org/show_bug.cgi?id=214715 <rdar://problem/65467702> Reviewed by Geoffrey Garen. Test: security/mutation-observer-frame-detach.html * dom/Document.cpp: (WebCore::Document::didBecomeCurrentDocumentInFrame): (WebCore::Document::initContentSecurityPolicy): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::commitData): Add some null checks and early returns if the frame detaches. * loader/SubframeLoader.cpp: (WebCore::FrameLoader::SubframeLoader::loadSubframe): Balance the call to incrementLoadEventDelayCount in the early return case or this test never finishes loading. 2020-07-24 Alex Christensen <achristensen@webkit.org> Fix assertion when highlighting in detached frames and make loads complete https://bugs.webkit.org/show_bug.cgi?id=214770 Reviewed by Geoffrey Garen. There's an assertion added in r53218 I think should be an early return. It can be triggered by an interesting test I found while looking into rdar://problem/65467702 I also needed to balance the call to incrementLoadEventDelayCount in an early return in order to get the test to finish loading. Test: fast/editing/frame-selection-is-not-caret.html * editing/FrameSelection.cpp: (WebCore::FrameSelection::caretBlinkTimerFired): * loader/SubframeLoader.cpp: (WebCore::FrameLoader::SubframeLoader::loadSubframe): 2020-07-24 Michael Saboff <msaboff@apple.com> Fixed exception check handling below ScheduledAction::executeFunctionInContext() https://bugs.webkit.org/show_bug.cgi?id=214774 Reviewed by Mark Lam. Test: js/dom/scheduled-action-exception-checks.html * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::executeFunctionInContext): 2020-07-24 Brady Eidson <beidson@apple.com> Hard code some MFi controller devices instead of dynamically managing HID vs GameController.framework. rdar://problem/65961406 and https://bugs.webkit.org/show_bug.cgi?id=214664 Reviewed by Tim Horton. Covered by API tests. I'd added code to dynamically tell whether a device would be handled by GameController.framework or IOHID. On macOS Big Sur, it works flawlessly. On Catalina, it doesn't. The key problem being that GameController.framework will try to handle some controllers it should not. Instead, we can use a hard coded list of the controllers that are most important to support using GCF. The GCF provider and HID provider coordinate on that list when deciding if they should handle a new device. The worst case scenario for that list missing an important controller is that it would be handled in HID instead of GCF, so some features may be missing. * Modules/gamepad/GamepadManager.cpp: (WebCore::GamepadManager::makeGamepadVisible): * platform/gamepad/cocoa/GameControllerGamepadProvider.h: (WebCore::GameControllerGamepadProvider::numberOfConnectedGamepads const): * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::willHandleVendorAndProduct): (WebCore::GameControllerGamepadProvider::controllerDidConnect): * platform/gamepad/cocoa/GameControllerSPI.h: * platform/gamepad/mac/HIDGamepadProvider.h: (WebCore::HIDGamepadProvider::numberOfConnectedGamepads const): * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::deviceAddedCallback): (WebCore::gameControllerFrameworkWillHandleHIDDevice): (WebCore::HIDGamepadProvider::deviceAdded): (WebCore::HIDGamepadProvider::deviceRemoved): (WebCore::HIDGamepadProvider::waitForManagementDecisionForDevice): Deleted. (WebCore::HIDGamepadProvider::removeDeviceWaitingForManagementDecision): Deleted. (WebCore::HIDGamepadProvider::gamePadServiceWasPublished): Deleted. 2020-07-24 Mark Lam <mark.lam@apple.com> Fix exception check handling below postMessage(). https://bugs.webkit.org/show_bug.cgi?id=214761 <rdar://problem/65932136> Reviewed by Yusuke Suzuki and Keith Miller. Test: js/dom/missing-exception-check-below-postMessage.html * bindings/js/JSDOMConvertSequences.h: (WebCore::Detail::SequenceConverter::convertArray): (WebCore::Detail::SequenceConverter::convert): 2020-07-24 Eric Carlson <eric.carlson@apple.com> [Cocoa] Tell AVAssetResourceLoadingContentInformationRequest that asset size is available immediately https://bugs.webkit.org/show_bug.cgi?id=214759 <rdar://problem/63751958> Reviewed by Jer Noble. * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: (WebCore::WebCoreAVFResourceLoader::responseReceived): 2020-07-23 Simon Fraser <simon.fraser@apple.com> steps() timing function on a transform animation triggers a render every frame https://bugs.webkit.org/show_bug.cgi?id=214712 <rdar://problem/62737868> Reviewed by Tim Horton. An animation of transform, with a steps() timing function, would schedule a rendering update on every frame. This happened because KeyframeEffect::updateAcceleratedActions() would keep trying, and failing to start the accelerated animation every frame, since GraphicsLayerCA refuses to run accelerated animations with steps timing functions. Fix by making m_isRunningAccelerated a tri-state enum, which gets a new value once we've tried to run the animation the first time. Also ensure that we re-try if the timing function changes, via animationDidChangeTimingProperties(). Test: animations/steps-transform-rendering-updates.html * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::isRunningAcceleratedAnimationForProperty const): (WebCore::KeyframeEffect::updateAcceleratedActions): (WebCore::KeyframeEffect::animationDidChangeTimingProperties): (WebCore::KeyframeEffect::animationWasCanceled): (WebCore::KeyframeEffect::willChangeRenderer): (WebCore::KeyframeEffect::animationSuspensionStateDidChange): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): * animation/KeyframeEffect.h: (WebCore::KeyframeEffect::isRunningAccelerated const): * page/Page.cpp: (WebCore::Page::startTrackingRenderingUpdates): (WebCore::Page::renderingUpdateCount const): (WebCore::Page::updateRendering): * page/Page.h: * testing/Internals.cpp: (WebCore::Internals::startTrackingRenderingUpdates): (WebCore::Internals::renderingUpdateCount): * testing/Internals.h: * testing/Internals.idl: 2020-07-24 Mark Lam <mark.lam@apple.com> Fix JS bindings code to DECLARE_THROW_SCOPE in the functions that can throw instead of passing a ThrowScope around. https://bugs.webkit.org/show_bug.cgi?id=214695 <rdar://problem/65927049> Reviewed by Yusuke Suzuki. There are a few exceptions where it makes sense to pass a ThrowScope&, but those are rare. Unless one has a very good reason to do so, the best practice is to always DECLARE_THROW_SCOPE in the functions that can throw. Test: js/dom/missing-exception-check-below-queueMicrotask.html * bindings/js/JSDOMAttribute.h: (WebCore::IDLAttribute::set): (WebCore::IDLAttribute::setStatic): (WebCore::IDLAttribute::get): (WebCore::IDLAttribute::getStatic): * bindings/js/JSDOMIterator.h: (WebCore::iteratorForEach): * bindings/js/JSDOMOperation.h: (WebCore::IDLOperation::call): (WebCore::IDLOperation::callStatic): * bindings/js/JSDOMOperationReturningPromise.h: (WebCore::IDLOperationReturningPromise::call): (WebCore::IDLOperationReturningPromise::callReturningOwnPromise): (WebCore::IDLOperationReturningPromise::callStatic): (WebCore::IDLOperationReturningPromise::callStaticReturningOwnPromise): * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowInstanceFunctionOpenDatabaseBody): * bindings/js/JSEventTargetCustom.h: (WebCore::IDLOperation<JSEventTarget>::call): * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GenerateAttributeGetterBodyDefinition): (GenerateAttributeSetterBodyDefinition): (GenerateOperationBodyDefinition): (GenerateSerializerDefinition): (GenerateWriteBarriersForArguments): (GenerateImplementationCustomFunctionCall): (GenerateIterableDefinition): (NativeToJSValueMayThrow): (NativeToJSValue): * bindings/scripts/test/JS/JSMapLike.cpp: (WebCore::jsMapLikeSizeGetter): (WebCore::jsMapLikePrototypeFunctionGetBody): (WebCore::jsMapLikePrototypeFunctionHasBody): (WebCore::jsMapLikePrototypeFunctionEntriesBody): (WebCore::jsMapLikePrototypeFunctionKeysBody): (WebCore::jsMapLikePrototypeFunctionValuesBody): (WebCore::jsMapLikePrototypeFunctionForEachBody): (WebCore::jsMapLikePrototypeFunctionSetBody): (WebCore::jsMapLikePrototypeFunctionClearBody): (WebCore::jsMapLikePrototypeFunctionDeleteBody): * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: (WebCore::jsReadOnlyMapLikeSizeGetter): (WebCore::jsReadOnlyMapLikePrototypeFunctionGetBody): (WebCore::jsReadOnlyMapLikePrototypeFunctionHasBody): (WebCore::jsReadOnlyMapLikePrototypeFunctionEntriesBody): (WebCore::jsReadOnlyMapLikePrototypeFunctionKeysBody): (WebCore::jsReadOnlyMapLikePrototypeFunctionValuesBody): (WebCore::jsReadOnlyMapLikePrototypeFunctionForEachBody): * bindings/scripts/test/JS/JSReadOnlySetLike.cpp: (WebCore::jsReadOnlySetLikeSizeGetter): (WebCore::jsReadOnlySetLikePrototypeFunctionHasBody): (WebCore::jsReadOnlySetLikePrototypeFunctionEntriesBody): (WebCore::jsReadOnlySetLikePrototypeFunctionKeysBody): (WebCore::jsReadOnlySetLikePrototypeFunctionValuesBody): (WebCore::jsReadOnlySetLikePrototypeFunctionForEachBody): * bindings/scripts/test/JS/JSSetLike.cpp: (WebCore::jsSetLikeSizeGetter): (WebCore::jsSetLikePrototypeFunctionHasBody): (WebCore::jsSetLikePrototypeFunctionEntriesBody): (WebCore::jsSetLikePrototypeFunctionKeysBody): (WebCore::jsSetLikePrototypeFunctionValuesBody): (WebCore::jsSetLikePrototypeFunctionForEachBody): (WebCore::jsSetLikePrototypeFunctionAddBody): (WebCore::jsSetLikePrototypeFunctionClearBody): (WebCore::jsSetLikePrototypeFunctionDeleteBody): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::jsTestActiveDOMObjectExcitingAttrGetter): (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunctionBody): (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessageBody): (WebCore::jsTestActiveDOMObjectPrototypeFunctionOverloadedMethod1Body): (WebCore::jsTestActiveDOMObjectPrototypeFunctionOverloadedMethod2Body): (WebCore::jsTestActiveDOMObjectPrototypeFunctionOverloadedMethodOverloadDispatcher): * bindings/scripts/test/JS/JSTestCEReactions.cpp: (WebCore::jsTestCEReactionsAttributeWithCEReactionsGetter): (WebCore::setJSTestCEReactionsAttributeWithCEReactionsSetter): (WebCore::jsTestCEReactionsReflectAttributeWithCEReactionsGetter): (WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsSetter): (WebCore::jsTestCEReactionsStringifierAttributeGetter): (WebCore::setJSTestCEReactionsStringifierAttributeSetter): (WebCore::jsTestCEReactionsAttributeWithCEReactionsNotNeededGetter): (WebCore::setJSTestCEReactionsAttributeWithCEReactionsNotNeededSetter): (WebCore::jsTestCEReactionsReflectAttributeWithCEReactionsNotNeededGetter): (WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsNotNeededSetter): (WebCore::jsTestCEReactionsStringifierAttributeNotNeededGetter): (WebCore::setJSTestCEReactionsStringifierAttributeNotNeededSetter): (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsBody): (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsNotNeededBody): * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: (WebCore::jsTestCEReactionsStringifierValueGetter): (WebCore::setJSTestCEReactionsStringifierValueSetter): (WebCore::jsTestCEReactionsStringifierValueWithoutReactionsGetter): (WebCore::setJSTestCEReactionsStringifierValueWithoutReactionsSetter): (WebCore::jsTestCEReactionsStringifierPrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestCallTracer.cpp: (WebCore::jsTestCallTracerTestAttributeInterfaceGetter): (WebCore::setJSTestCallTracerTestAttributeInterfaceSetter): (WebCore::jsTestCallTracerTestAttributeSpecifiedGetter): (WebCore::setJSTestCallTracerTestAttributeSpecifiedSetter): (WebCore::jsTestCallTracerTestAttributeWithVariantGetter): (WebCore::setJSTestCallTracerTestAttributeWithVariantSetter): (WebCore::jsTestCallTracerTestReadonlyAttributeGetter): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgumentBody): (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgumentBody): * bindings/scripts/test/JS/JSTestDOMJIT.cpp: (WebCore::jsTestDOMJITAnyAttrGetter): (WebCore::jsTestDOMJITBooleanAttrGetter): (WebCore::jsTestDOMJITByteAttrGetter): (WebCore::jsTestDOMJITOctetAttrGetter): (WebCore::jsTestDOMJITShortAttrGetter): (WebCore::jsTestDOMJITUnsignedShortAttrGetter): (WebCore::jsTestDOMJITLongAttrGetter): (WebCore::jsTestDOMJITUnsignedLongAttrGetter): (WebCore::jsTestDOMJITLongLongAttrGetter): (WebCore::jsTestDOMJITUnsignedLongLongAttrGetter): (WebCore::jsTestDOMJITFloatAttrGetter): (WebCore::jsTestDOMJITUnrestrictedFloatAttrGetter): (WebCore::jsTestDOMJITDoubleAttrGetter): (WebCore::jsTestDOMJITUnrestrictedDoubleAttrGetter): (WebCore::jsTestDOMJITDomStringAttrGetter): (WebCore::jsTestDOMJITByteStringAttrGetter): (WebCore::jsTestDOMJITUsvStringAttrGetter): (WebCore::jsTestDOMJITNodeAttrGetter): (WebCore::jsTestDOMJITBooleanNullableAttrGetter): (WebCore::jsTestDOMJITByteNullableAttrGetter): (WebCore::jsTestDOMJITOctetNullableAttrGetter): (WebCore::jsTestDOMJITShortNullableAttrGetter): (WebCore::jsTestDOMJITUnsignedShortNullableAttrGetter): (WebCore::jsTestDOMJITLongNullableAttrGetter): (WebCore::jsTestDOMJITUnsignedLongNullableAttrGetter): (WebCore::jsTestDOMJITLongLongNullableAttrGetter): (WebCore::jsTestDOMJITUnsignedLongLongNullableAttrGetter): (WebCore::jsTestDOMJITFloatNullableAttrGetter): (WebCore::jsTestDOMJITUnrestrictedFloatNullableAttrGetter): (WebCore::jsTestDOMJITDoubleNullableAttrGetter): (WebCore::jsTestDOMJITUnrestrictedDoubleNullableAttrGetter): (WebCore::jsTestDOMJITDomStringNullableAttrGetter): (WebCore::jsTestDOMJITByteStringNullableAttrGetter): (WebCore::jsTestDOMJITUsvStringNullableAttrGetter): (WebCore::jsTestDOMJITNodeNullableAttrGetter): (WebCore::jsTestDOMJITPrototypeFunctionGetAttributeBody): (WebCore::jsTestDOMJITPrototypeFunctionItemBody): (WebCore::jsTestDOMJITPrototypeFunctionHasAttributeBody): (WebCore::jsTestDOMJITPrototypeFunctionGetElementByIdBody): (WebCore::jsTestDOMJITPrototypeFunctionGetElementsByNameBody): * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::jsTestEnabledBySettingTestSubObjEnabledBySettingConstructorGetter): (WebCore::setJSTestEnabledBySettingTestSubObjEnabledBySettingConstructorSetter): (WebCore::jsTestEnabledBySettingEnabledBySettingAttributeGetter): (WebCore::setJSTestEnabledBySettingEnabledBySettingAttributeSetter): (WebCore::jsTestEnabledBySettingPrototypeFunctionEnabledBySettingOperationBody): * bindings/scripts/test/JS/JSTestEnabledForContext.cpp: (WebCore::jsTestEnabledForContextTestSubObjEnabledForContextConstructorGetter): (WebCore::setJSTestEnabledForContextTestSubObjEnabledForContextConstructorSetter): * bindings/scripts/test/JS/JSTestEventConstructor.cpp: (WebCore::jsTestEventConstructorAttr1Getter): (WebCore::jsTestEventConstructorAttr2Getter): (WebCore::jsTestEventConstructorAttr3Getter): * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::jsTestEventTargetPrototypeFunctionItemBody): * bindings/scripts/test/JS/JSTestException.cpp: (WebCore::jsTestExceptionNameGetter): * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: (WebCore::jsTestGenerateIsReachableASecretAttributeGetter): * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::jsTestGlobalObjectRegularAttributeGetter): (WebCore::setJSTestGlobalObjectRegularAttributeSetter): (WebCore::jsTestGlobalObjectPublicAndPrivateAttributeGetter): (WebCore::setJSTestGlobalObjectPublicAndPrivateAttributeSetter): (WebCore::jsTestGlobalObjectPublicAndPrivateConditionalAttributeGetter): (WebCore::setJSTestGlobalObjectPublicAndPrivateConditionalAttributeSetter): (WebCore::jsTestGlobalObjectEnabledAtRuntimeAttributeGetter): (WebCore::setJSTestGlobalObjectEnabledAtRuntimeAttributeSetter): (WebCore::jsTestGlobalObjectTestCEReactionsConstructorGetter): (WebCore::setJSTestGlobalObjectTestCEReactionsConstructorSetter): (WebCore::jsTestGlobalObjectTestCEReactionsStringifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestCEReactionsStringifierConstructorSetter): (WebCore::jsTestGlobalObjectTestCallTracerConstructorGetter): (WebCore::setJSTestGlobalObjectTestCallTracerConstructorSetter): (WebCore::jsTestGlobalObjectTestCallbackInterfaceConstructorGetter): (WebCore::setJSTestGlobalObjectTestCallbackInterfaceConstructorSetter): (WebCore::jsTestGlobalObjectTestClassWithJSBuiltinConstructorConstructorGetter): (WebCore::setJSTestGlobalObjectTestClassWithJSBuiltinConstructorConstructorSetter): (WebCore::jsTestGlobalObjectTestDOMJITConstructorGetter): (WebCore::setJSTestGlobalObjectTestDOMJITConstructorSetter): (WebCore::jsTestGlobalObjectTestDomainSecurityConstructorGetter): (WebCore::setJSTestGlobalObjectTestDomainSecurityConstructorSetter): (WebCore::jsTestGlobalObjectTestEnabledBySettingConstructorGetter): (WebCore::setJSTestGlobalObjectTestEnabledBySettingConstructorSetter): (WebCore::jsTestGlobalObjectTestEnabledForContextConstructorGetter): (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructorSetter): (WebCore::jsTestGlobalObjectTestEventConstructorConstructorGetter): (WebCore::setJSTestGlobalObjectTestEventConstructorConstructorSetter): (WebCore::jsTestGlobalObjectTestEventTargetConstructorGetter): (WebCore::setJSTestGlobalObjectTestEventTargetConstructorSetter): (WebCore::jsTestGlobalObjectTestExceptionConstructorGetter): (WebCore::setJSTestGlobalObjectTestExceptionConstructorSetter): (WebCore::jsTestGlobalObjectTestGenerateIsReachableConstructorGetter): (WebCore::setJSTestGlobalObjectTestGenerateIsReachableConstructorSetter): (WebCore::jsTestGlobalObjectTestGlobalObjectConstructorGetter): (WebCore::setJSTestGlobalObjectTestGlobalObjectConstructorSetter): (WebCore::jsTestGlobalObjectTestIndexedSetterNoIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestIndexedSetterNoIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestIndexedSetterThrowingExceptionConstructorGetter): (WebCore::setJSTestGlobalObjectTestIndexedSetterThrowingExceptionConstructorSetter): (WebCore::jsTestGlobalObjectTestIndexedSetterWithIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestIndexedSetterWithIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestInterfaceConstructorGetter): (WebCore::setJSTestGlobalObjectTestInterfaceConstructorSetter): (WebCore::jsTestGlobalObjectTestInterfaceLeadingUnderscoreConstructorGetter): (WebCore::setJSTestGlobalObjectTestInterfaceLeadingUnderscoreConstructorSetter): (WebCore::jsTestGlobalObjectTestIterableConstructorGetter): (WebCore::setJSTestGlobalObjectTestIterableConstructorSetter): (WebCore::jsTestGlobalObjectTestJSBuiltinConstructorConstructorGetter): (WebCore::setJSTestGlobalObjectTestJSBuiltinConstructorConstructorSetter): (WebCore::jsTestGlobalObjectTestMapLikeConstructorGetter): (WebCore::setJSTestGlobalObjectTestMapLikeConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedAndIndexedSetterNoIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedAndIndexedSetterNoIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedAndIndexedSetterThrowingExceptionConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedAndIndexedSetterThrowingExceptionConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedAndIndexedSetterWithIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedAndIndexedSetterWithIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedConstructorConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedConstructorConstructorSetter): (WebCore::jsTestGlobalObjectAudioConstructorGetter): (WebCore::setJSTestGlobalObjectAudioConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedDeleterNoIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedDeleterNoIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedDeleterThrowingExceptionConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedDeleterThrowingExceptionConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedDeleterWithIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedDeleterWithIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedDeleterWithIndexedGetterConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedDeleterWithIndexedGetterConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedGetterCallWithConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedGetterCallWithConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedGetterNoIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedGetterNoIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedGetterWithIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedGetterWithIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterNoIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterNoIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterThrowingExceptionConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterThrowingExceptionConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterWithIdentifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterWithIdentifierConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterWithIndexedGetterConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterWithIndexedGetterConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterWithIndexedGetterAndSetterConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterWithIndexedGetterAndSetterConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterWithOverrideBuiltinsConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterWithOverrideBuiltinsConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterWithUnforgablePropertiesConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterWithUnforgablePropertiesConstructorSetter): (WebCore::jsTestGlobalObjectTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructorGetter): (WebCore::setJSTestGlobalObjectTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructorSetter): (WebCore::jsTestGlobalObjectTestOperationConditionalConstructorGetter): (WebCore::setJSTestGlobalObjectTestOperationConditionalConstructorSetter): (WebCore::jsTestGlobalObjectTestOverloadedConstructorsConstructorGetter): (WebCore::setJSTestGlobalObjectTestOverloadedConstructorsConstructorSetter): (WebCore::jsTestGlobalObjectTestOverloadedConstructorsWithSequenceConstructorGetter): (WebCore::setJSTestGlobalObjectTestOverloadedConstructorsWithSequenceConstructorSetter): (WebCore::jsTestGlobalObjectTestOverrideBuiltinsConstructorGetter): (WebCore::setJSTestGlobalObjectTestOverrideBuiltinsConstructorSetter): (WebCore::jsTestGlobalObjectTestPluginInterfaceConstructorGetter): (WebCore::setJSTestGlobalObjectTestPluginInterfaceConstructorSetter): (WebCore::jsTestGlobalObjectTestReadOnlyMapLikeConstructorGetter): (WebCore::setJSTestGlobalObjectTestReadOnlyMapLikeConstructorSetter): (WebCore::jsTestGlobalObjectTestReadOnlySetLikeConstructorGetter): (WebCore::setJSTestGlobalObjectTestReadOnlySetLikeConstructorSetter): (WebCore::jsTestGlobalObjectTestReportExtraMemoryCostConstructorGetter): (WebCore::setJSTestGlobalObjectTestReportExtraMemoryCostConstructorSetter): (WebCore::jsTestGlobalObjectTestSerializationConstructorGetter): (WebCore::setJSTestGlobalObjectTestSerializationConstructorSetter): (WebCore::jsTestGlobalObjectTestSerializationIndirectInheritanceConstructorGetter): (WebCore::setJSTestGlobalObjectTestSerializationIndirectInheritanceConstructorSetter): (WebCore::jsTestGlobalObjectTestSerializationInheritConstructorGetter): (WebCore::setJSTestGlobalObjectTestSerializationInheritConstructorSetter): (WebCore::jsTestGlobalObjectTestSerializationInheritFinalConstructorGetter): (WebCore::setJSTestGlobalObjectTestSerializationInheritFinalConstructorSetter): (WebCore::jsTestGlobalObjectTestSerializedScriptValueInterfaceConstructorGetter): (WebCore::setJSTestGlobalObjectTestSerializedScriptValueInterfaceConstructorSetter): (WebCore::jsTestGlobalObjectTestSetLikeConstructorGetter): (WebCore::setJSTestGlobalObjectTestSetLikeConstructorSetter): (WebCore::jsTestGlobalObjectTestStringifierConstructorGetter): (WebCore::setJSTestGlobalObjectTestStringifierConstructorSetter): (WebCore::jsTestGlobalObjectTestStringifierAnonymousOperationConstructorGetter): (WebCore::setJSTestGlobalObjectTestStringifierAnonymousOperationConstructorSetter): (WebCore::jsTestGlobalObjectTestStringifierNamedOperationConstructorGetter): (WebCore::setJSTestGlobalObjectTestStringifierNamedOperationConstructorSetter): (WebCore::jsTestGlobalObjectTestStringifierOperationImplementedAsConstructorGetter): (WebCore::setJSTestGlobalObjectTestStringifierOperationImplementedAsConstructorSetter): (WebCore::jsTestGlobalObjectTestStringifierOperationNamedToStringConstructorGetter): (WebCore::setJSTestGlobalObjectTestStringifierOperationNamedToStringConstructorSetter): (WebCore::jsTestGlobalObjectTestStringifierReadOnlyAttributeConstructorGetter): (WebCore::setJSTestGlobalObjectTestStringifierReadOnlyAttributeConstructorSetter): (WebCore::jsTestGlobalObjectTestStringifierReadWriteAttributeConstructorGetter): (WebCore::setJSTestGlobalObjectTestStringifierReadWriteAttributeConstructorSetter): (WebCore::jsTestGlobalObjectTestTypedefsConstructorGetter): (WebCore::setJSTestGlobalObjectTestTypedefsConstructorSetter): (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperationBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1Body): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2Body): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperationOverloadDispatcher): (WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStaticBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabledBody): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeaturesEnabledBody): (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunctionBody): (WebCore::jsTestGlobalObjectInstanceFunctionCalculateSecretResultBody): (WebCore::jsTestGlobalObjectInstanceFunctionGetSecretBooleanBody): (WebCore::jsTestGlobalObjectInstanceFunctionTestFeatureGetSecretBooleanBody): * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: (WebCore::jsTestIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::jsTestInterfaceConstructorImplementsStaticReadOnlyAttrGetter): (WebCore::jsTestInterfaceConstructorImplementsStaticAttrGetter): (WebCore::setJSTestInterfaceConstructorImplementsStaticAttrSetter): (WebCore::jsTestInterfaceImplementsStr1Getter): (WebCore::jsTestInterfaceImplementsStr2Getter): (WebCore::setJSTestInterfaceImplementsStr2Setter): (WebCore::jsTestInterfaceImplementsStr3Getter): (WebCore::setJSTestInterfaceImplementsStr3Setter): (WebCore::jsTestInterfaceImplementsNodeGetter): (WebCore::setJSTestInterfaceImplementsNodeSetter): (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttrGetter): (WebCore::jsTestInterfaceConstructorSupplementalStaticAttrGetter): (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttrSetter): (WebCore::jsTestInterfaceSupplementalStr1Getter): (WebCore::jsTestInterfaceSupplementalStr2Getter): (WebCore::setJSTestInterfaceSupplementalStr2Setter): (WebCore::jsTestInterfaceSupplementalStr3Getter): (WebCore::setJSTestInterfaceSupplementalStr3Setter): (WebCore::jsTestInterfaceSupplementalNodeGetter): (WebCore::setJSTestInterfaceSupplementalNodeSetter): (WebCore::jsTestInterfaceReflectAttributeGetter): (WebCore::setJSTestInterfaceReflectAttributeSetter): (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod1Body): (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2Body): (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod3Body): (WebCore::jsTestInterfaceConstructorFunctionImplementsMethod4Body): (WebCore::jsTestInterfacePrototypeFunctionTakeNodesBody): (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1Body): (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2Body): (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod3Body): (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4Body): (WebCore::jsTestInterfacePrototypeFunctionEntriesCaller): (WebCore::jsTestInterfacePrototypeFunctionKeysCaller): (WebCore::jsTestInterfacePrototypeFunctionValuesCaller): (WebCore::jsTestInterfacePrototypeFunctionForEachCaller): * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: (WebCore::jsTestInterfaceLeadingUnderscoreReadonlyGetter): * bindings/scripts/test/JS/JSTestIterable.cpp: (WebCore::jsTestIterablePrototypeFunctionEntriesCaller): (WebCore::jsTestIterablePrototypeFunctionKeysCaller): (WebCore::jsTestIterablePrototypeFunctionValuesCaller): (WebCore::jsTestIterablePrototypeFunctionForEachCaller): * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp: (WebCore::jsTestJSBuiltinConstructorTestAttributeCustomGetter): (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustomGetter): (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustomSetter): (WebCore::jsTestJSBuiltinConstructorPrototypeFunctionTestCustomFunctionBody): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: (WebCore::jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetterBody): (WebCore::jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody): * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: (WebCore::jsTestNamedDeleterWithIdentifierPrototypeFunctionNamedDeleterBody): * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: (WebCore::jsTestNamedGetterWithIdentifierPrototypeFunctionGetterNameBody): * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: (WebCore::jsTestNamedSetterWithIdentifierPrototypeFunctionNamedSetterBody): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: (WebCore::jsTestNamedSetterWithIndexedGetterPrototypeFunctionNamedSetterBody): (WebCore::jsTestNamedSetterWithIndexedGetterPrototypeFunctionIndexedSetterBody): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionNamedSetterBody): (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionIndexedSetter1Body): (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionIndexedSetter2Body): (WebCore::jsTestNamedSetterWithIndexedGetterAndSetterPrototypeFunctionIndexedSetterOverloadDispatcher): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: (WebCore::jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttributeGetter): (WebCore::jsTestNamedSetterWithUnforgablePropertiesInstanceFunctionUnforgeableOperationBody): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttributeGetter): (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsInstanceFunctionUnforgeableOperationBody): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::jsTestNodeNameGetter): (WebCore::setJSTestNodeNameSetter): (WebCore::jsTestNodePrototypeFunctionTestWorkerPromiseBody): (WebCore::jsTestNodePrototypeFunctionCalculateSecretResultBody): (WebCore::jsTestNodePrototypeFunctionGetSecretBooleanBody): (WebCore::jsTestNodePrototypeFunctionTestFeatureGetSecretBooleanBody): (WebCore::jsTestNodePrototypeFunctionEntriesCaller): (WebCore::jsTestNodePrototypeFunctionKeysCaller): (WebCore::jsTestNodePrototypeFunctionValuesCaller): (WebCore::jsTestNodePrototypeFunctionForEachCaller): (WebCore::JSTestNode::serialize): (WebCore::jsTestNodePrototypeFunctionToJSONBody): * bindings/scripts/test/JS/JSTestNode.h: * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjReadOnlyLongAttrGetter): (WebCore::jsTestObjReadOnlyStringAttrGetter): (WebCore::jsTestObjReadOnlyTestObjAttrGetter): (WebCore::jsTestObjConstructorStaticReadOnlyLongAttrGetter): (WebCore::jsTestObjConstructorStaticStringAttrGetter): (WebCore::setJSTestObjConstructorStaticStringAttrSetter): (WebCore::jsTestObjConstructorTestSubObjGetter): (WebCore::jsTestObjConstructorTestStaticReadonlyObjGetter): (WebCore::jsTestObjEnumAttrGetter): (WebCore::setJSTestObjEnumAttrSetter): (WebCore::jsTestObjByteAttrGetter): (WebCore::setJSTestObjByteAttrSetter): (WebCore::jsTestObjOctetAttrGetter): (WebCore::setJSTestObjOctetAttrSetter): (WebCore::jsTestObjShortAttrGetter): (WebCore::setJSTestObjShortAttrSetter): (WebCore::jsTestObjClampedShortAttrGetter): (WebCore::setJSTestObjClampedShortAttrSetter): (WebCore::jsTestObjEnforceRangeShortAttrGetter): (WebCore::setJSTestObjEnforceRangeShortAttrSetter): (WebCore::jsTestObjUnsignedShortAttrGetter): (WebCore::setJSTestObjUnsignedShortAttrSetter): (WebCore::jsTestObjLongAttrGetter): (WebCore::setJSTestObjLongAttrSetter): (WebCore::jsTestObjLongLongAttrGetter): (WebCore::setJSTestObjLongLongAttrSetter): (WebCore::jsTestObjUnsignedLongLongAttrGetter): (WebCore::setJSTestObjUnsignedLongLongAttrSetter): (WebCore::jsTestObjStringAttrGetter): (WebCore::setJSTestObjStringAttrSetter): (WebCore::jsTestObjUsvstringAttrGetter): (WebCore::setJSTestObjUsvstringAttrSetter): (WebCore::jsTestObjTestObjAttrGetter): (WebCore::setJSTestObjTestObjAttrSetter): (WebCore::jsTestObjTestNullableObjAttrGetter): (WebCore::setJSTestObjTestNullableObjAttrSetter): (WebCore::jsTestObjLenientTestObjAttrGetter): (WebCore::setJSTestObjLenientTestObjAttrSetter): (WebCore::jsTestObjUnforgeableAttrGetter): (WebCore::jsTestObjStringAttrTreatingNullAsEmptyStringGetter): (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyStringSetter): (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyStringGetter): (WebCore::setJSTestObjUsvstringAttrTreatingNullAsEmptyStringSetter): (WebCore::jsTestObjByteStringAttrTreatingNullAsEmptyStringGetter): (WebCore::setJSTestObjByteStringAttrTreatingNullAsEmptyStringSetter): (WebCore::jsTestObjStringLongRecordAttrGetter): (WebCore::setJSTestObjStringLongRecordAttrSetter): (WebCore::jsTestObjUsvstringLongRecordAttrGetter): (WebCore::setJSTestObjUsvstringLongRecordAttrSetter): (WebCore::jsTestObjStringObjRecordAttrGetter): (WebCore::setJSTestObjStringObjRecordAttrSetter): (WebCore::jsTestObjStringNullableObjRecordAttrGetter): (WebCore::setJSTestObjStringNullableObjRecordAttrSetter): (WebCore::jsTestObjStringVoidCallbackRecordAttrGetter): (WebCore::setJSTestObjStringVoidCallbackRecordAttrSetter): (WebCore::jsTestObjDictionaryAttrGetter): (WebCore::setJSTestObjDictionaryAttrSetter): (WebCore::jsTestObjNullableDictionaryAttrGetter): (WebCore::setJSTestObjNullableDictionaryAttrSetter): (WebCore::jsTestObjAnnotatedTypeInUnionAttrGetter): (WebCore::setJSTestObjAnnotatedTypeInUnionAttrSetter): (WebCore::jsTestObjAnnotatedTypeInSequenceAttrGetter): (WebCore::setJSTestObjAnnotatedTypeInSequenceAttrSetter): (WebCore::jsTestObjImplementationEnumAttrGetter): (WebCore::setJSTestObjImplementationEnumAttrSetter): (WebCore::jsTestObjMediaDevicesGetter): (WebCore::jsTestObjXMLObjAttrGetter): (WebCore::setJSTestObjXMLObjAttrSetter): (WebCore::jsTestObjCreateGetter): (WebCore::setJSTestObjCreateSetter): (WebCore::jsTestObjReflectedStringAttrGetter): (WebCore::setJSTestObjReflectedStringAttrSetter): (WebCore::jsTestObjReflectedUSVStringAttrGetter): (WebCore::setJSTestObjReflectedUSVStringAttrSetter): (WebCore::jsTestObjReflectedIntegralAttrGetter): (WebCore::setJSTestObjReflectedIntegralAttrSetter): (WebCore::jsTestObjReflectedUnsignedIntegralAttrGetter): (WebCore::setJSTestObjReflectedUnsignedIntegralAttrSetter): (WebCore::jsTestObjReflectedBooleanAttrGetter): (WebCore::setJSTestObjReflectedBooleanAttrSetter): (WebCore::jsTestObjReflectedURLAttrGetter): (WebCore::setJSTestObjReflectedURLAttrSetter): (WebCore::jsTestObjReflectedUSVURLAttrGetter): (WebCore::setJSTestObjReflectedUSVURLAttrSetter): (WebCore::jsTestObjReflectedCustomIntegralAttrGetter): (WebCore::setJSTestObjReflectedCustomIntegralAttrSetter): (WebCore::jsTestObjReflectedCustomBooleanAttrGetter): (WebCore::setJSTestObjReflectedCustomBooleanAttrSetter): (WebCore::jsTestObjReflectedCustomURLAttrGetter): (WebCore::setJSTestObjReflectedCustomURLAttrSetter): (WebCore::jsTestObjEnabledAtRuntimeAttributeGetter): (WebCore::setJSTestObjEnabledAtRuntimeAttributeSetter): (WebCore::jsTestObjConstructorEnabledAtRuntimeAttributeStaticGetter): (WebCore::setJSTestObjConstructorEnabledAtRuntimeAttributeStaticSetter): (WebCore::jsTestObjTypedArrayAttrGetter): (WebCore::setJSTestObjTypedArrayAttrSetter): (WebCore::jsTestObjCustomAttrGetter): (WebCore::setJSTestObjCustomAttrSetter): (WebCore::jsTestObjOnfooGetter): (WebCore::setJSTestObjOnfooSetter): (WebCore::jsTestObjOnwebkitfooGetter): (WebCore::setJSTestObjOnwebkitfooSetter): (WebCore::jsTestObjWithExecStateAttributeGetter): (WebCore::setJSTestObjWithExecStateAttributeSetter): (WebCore::jsTestObjWithCallWithAndSetterCallWithAttributeGetter): (WebCore::setJSTestObjWithCallWithAndSetterCallWithAttributeSetter): (WebCore::jsTestObjWithScriptExecutionContextAttributeGetter): (WebCore::setJSTestObjWithScriptExecutionContextAttributeSetter): (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttributeGetter): (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttributeSetter): (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeGetter): (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeSetter): (WebCore::jsTestObjConditionalAttr1Getter): (WebCore::setJSTestObjConditionalAttr1Setter): (WebCore::jsTestObjConditionalAttr2Getter): (WebCore::setJSTestObjConditionalAttr2Setter): (WebCore::jsTestObjConditionalAttr3Getter): (WebCore::setJSTestObjConditionalAttr3Setter): (WebCore::jsTestObjConditionalAttr4ConstructorGetter): (WebCore::setJSTestObjConditionalAttr4ConstructorSetter): (WebCore::jsTestObjConditionalAttr5ConstructorGetter): (WebCore::setJSTestObjConditionalAttr5ConstructorSetter): (WebCore::jsTestObjConditionalAttr6ConstructorGetter): (WebCore::setJSTestObjConditionalAttr6ConstructorSetter): (WebCore::jsTestObjCachedAttribute1Getter): (WebCore::jsTestObjCachedAttribute2Getter): (WebCore::jsTestObjCachedAttribute3Getter): (WebCore::jsTestObjAnyAttributeGetter): (WebCore::setJSTestObjAnyAttributeSetter): (WebCore::jsTestObjObjectAttributeGetter): (WebCore::setJSTestObjObjectAttributeSetter): (WebCore::jsTestObjContentDocumentGetter): (WebCore::jsTestObjMutablePointGetter): (WebCore::setJSTestObjMutablePointSetter): (WebCore::jsTestObjStrawberryGetter): (WebCore::setJSTestObjStrawberrySetter): (WebCore::jsTestObjDescriptionGetter): (WebCore::jsTestObjIdGetter): (WebCore::setJSTestObjIdSetter): (WebCore::jsTestObjHashGetter): (WebCore::jsTestObjReplaceableAttributeGetter): (WebCore::setJSTestObjReplaceableAttributeSetter): (WebCore::jsTestObjNullableDoubleAttributeGetter): (WebCore::jsTestObjNullableLongAttributeGetter): (WebCore::jsTestObjNullableBooleanAttributeGetter): (WebCore::jsTestObjNullableStringAttributeGetter): (WebCore::jsTestObjNullableLongSettableAttributeGetter): (WebCore::setJSTestObjNullableLongSettableAttributeSetter): (WebCore::jsTestObjNullableStringSettableAttributeGetter): (WebCore::setJSTestObjNullableStringSettableAttributeSetter): (WebCore::jsTestObjNullableUSVStringSettableAttributeGetter): (WebCore::setJSTestObjNullableUSVStringSettableAttributeSetter): (WebCore::jsTestObjNullableByteStringSettableAttributeGetter): (WebCore::setJSTestObjNullableByteStringSettableAttributeSetter): (WebCore::jsTestObjAttributeGetter): (WebCore::jsTestObjAttributeWithReservedEnumTypeGetter): (WebCore::setJSTestObjAttributeWithReservedEnumTypeSetter): (WebCore::jsTestObjTestReadOnlyVoidPromiseAttributeGetter): (WebCore::jsTestObjTestReadOnlyPromiseAttributeGetter): (WebCore::jsTestObjPutForwardsAttributeGetter): (WebCore::setJSTestObjPutForwardsAttributeSetter): (WebCore::jsTestObjPutForwardsNullableAttributeGetter): (WebCore::setJSTestObjPutForwardsNullableAttributeSetter): (WebCore::jsTestObjStringifierAttributeGetter): (WebCore::setJSTestObjStringifierAttributeSetter): (WebCore::jsTestObjConditionallyReadWriteAttributeGetter): (WebCore::setJSTestObjConditionallyReadWriteAttributeSetter): (WebCore::jsTestObjConditionalAndConditionallyReadWriteAttributeGetter): (WebCore::setJSTestObjConditionalAndConditionallyReadWriteAttributeSetter): (WebCore::jsTestObjRuntimeConditionallyReadWriteAttributeGetter): (WebCore::setJSTestObjRuntimeConditionallyReadWriteAttributeSetter): (WebCore::jsTestObjRuntimeConditionallyReadWriteAttributeUnforgeableGetter): (WebCore::setJSTestObjRuntimeConditionallyReadWriteAttributeUnforgeableSetter): (WebCore::jsTestObjRuntimeConditionallyReadWriteAttributeUnforgeablePrivateGetter): (WebCore::setJSTestObjRuntimeConditionallyReadWriteAttributeUnforgeablePrivateSetter): (WebCore::jsTestObjRuntimeConditionallyReadWriteAttributePromiseGetter): (WebCore::setJSTestObjRuntimeConditionallyReadWriteAttributePromiseSetter): (WebCore::jsTestObjConditionallyExposedToWindowAttributeGetter): (WebCore::setJSTestObjConditionallyExposedToWindowAttributeSetter): (WebCore::jsTestObjConditionallyExposedToWorkerAttributeGetter): (WebCore::setJSTestObjConditionallyExposedToWorkerAttributeSetter): (WebCore::jsTestObjConditionallyExposedToWindowAndWorkerAttributeGetter): (WebCore::setJSTestObjConditionallyExposedToWindowAndWorkerAttributeSetter): (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1Body): (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2Body): (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperationOverloadDispatcher): (WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStaticBody): (WebCore::jsTestObjPrototypeFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabledBody): (WebCore::jsTestObjPrototypeFunctionWorldSpecificMethodBody): (WebCore::jsTestObjPrototypeFunctionCalculateSecretResultBody): (WebCore::jsTestObjPrototypeFunctionGetSecretBooleanBody): (WebCore::jsTestObjPrototypeFunctionTestFeatureGetSecretBooleanBody): (WebCore::jsTestObjPrototypeFunctionVoidMethodBody): (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgsBody): (WebCore::jsTestObjPrototypeFunctionByteMethodBody): (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgsBody): (WebCore::jsTestObjPrototypeFunctionOctetMethodBody): (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgsBody): (WebCore::jsTestObjPrototypeFunctionLongMethodBody): (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgsBody): (WebCore::jsTestObjPrototypeFunctionObjMethodBody): (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgsBody): (WebCore::jsTestObjInstanceFunctionUnforgeableMethodBody): (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameterBody): (WebCore::jsTestObjPrototypeFunctionNullableStringMethodBody): (WebCore::jsTestObjConstructorFunctionNullableStringStaticMethodBody): (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethodBody): (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithStandaloneEnumArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrowsBody): (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithByteStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNullableByteStringArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithByteStringArgTreatingNullAsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionSerializedValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithRecordBody): (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionReturningLongBody): (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionReturningObjectBody): (WebCore::jsTestObjPrototypeFunctionCustomMethodBody): (WebCore::jsTestObjPrototypeFunctionCustomMethodWithArgsBody): (WebCore::jsTestObjPrototypeFunctionPrivateMethodBody): (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethodBody): (WebCore::jsTestObjPrototypeFunctionAddEventListenerBody): (WebCore::jsTestObjPrototypeFunctionRemoveEventListenerBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateObjBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidExceptionBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateObjExceptionBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjExceptionBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpacesBody): (WebCore::jsTestObjPrototypeFunctionWithDocumentArgumentBody): (WebCore::jsTestObjPrototypeFunctionWithCallerDocumentArgumentBody): (WebCore::jsTestObjPrototypeFunctionWithCallerWindowArgumentBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgsBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringAndDefaultValueBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefinedBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringIsNullBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomStringIsEmptyStringBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaNBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaNBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZeroBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZeroBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmptyBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalseBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAnyBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalObjectBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperIsNullBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolverBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalRecordBody): (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalPromiseBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArgBody): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionAndOptionalArgBody): (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArgBody): (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArgBody): (WebCore::jsTestObjPrototypeFunctionConditionalMethod1Body): (WebCore::jsTestObjPrototypeFunctionConditionalMethod2Body): (WebCore::jsTestObjPrototypeFunctionConditionalMethod3Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod13Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameterOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnionOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnions1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnions2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnionsOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnionOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnionOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion2Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnionOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter1Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter2Body): (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameterOverloadDispatcher): (WebCore::jsTestObjConstructorFunctionClassMethodBody): (WebCore::jsTestObjConstructorFunctionClassMethodWithOptionalBody): (WebCore::jsTestObjConstructorFunctionClassMethod2Body): (WebCore::jsTestObjConstructorFunctionOverloadedMethod11Body): (WebCore::jsTestObjConstructorFunctionOverloadedMethod12Body): (WebCore::jsTestObjConstructorFunctionOverloadedMethod1OverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampBody): (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampOnOptionalBody): (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeBody): (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeOnOptionalBody): (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequenceBody): (WebCore::jsTestObjPrototypeFunctionStringArrayFunctionBody): (WebCore::jsTestObjPrototypeFunctionDomStringListFunctionBody): (WebCore::jsTestObjPrototypeFunctionOperationWithOptionalUnionParameterBody): (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequenceBody): (WebCore::jsTestObjPrototypeFunctionGetElementByIdBody): (WebCore::jsTestObjPrototypeFunctionGetSVGDocumentBody): (WebCore::jsTestObjPrototypeFunctionConvert1Body): (WebCore::jsTestObjPrototypeFunctionConvert2Body): (WebCore::jsTestObjPrototypeFunctionConvert3Body): (WebCore::jsTestObjPrototypeFunctionConvert4Body): (WebCore::jsTestObjPrototypeFunctionMutablePointFunctionBody): (WebCore::jsTestObjPrototypeFunctionOrangeBody): (WebCore::jsTestObjPrototypeFunctionVariadicStringMethodBody): (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethodBody): (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethodBody): (WebCore::jsTestObjPrototypeFunctionVariadicUnionMethodBody): (WebCore::jsTestObjPrototypeFunctionAnyBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentBody): (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Body): (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Body): (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunctionOverloadDispatcher): (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionBody): (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionTestCustomPromiseFunctionBody): (WebCore::jsTestObjConstructorFunctionTestStaticCustomPromiseFunctionBody): (WebCore::jsTestObjPrototypeFunctionTestCustomReturnsOwnPromiseFunctionBody): (WebCore::jsTestObjPrototypeFunctionTestReturnsOwnPromiseAndPromiseProxyFunctionBody): (WebCore::jsTestObjPrototypeFunctionConditionalOverload1Body): (WebCore::jsTestObjPrototypeFunctionConditionalOverload2Body): (WebCore::jsTestObjPrototypeFunctionConditionalOverloadOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1Body): (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2Body): (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverloadOverloadDispatcher): (WebCore::jsTestObjPrototypeFunctionAttachShadowRootBody): (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameterBody): (WebCore::jsTestObjPrototypeFunctionBufferSourceParameterBody): (WebCore::jsTestObjPrototypeFunctionLegacyCallerNamedBody): (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationBody): (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithExceptionBody): (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWindowFunctionBody): (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWorkerFunctionBody): (WebCore::jsTestObjPrototypeFunctionConditionallyExposedToWindowAndWorkerFunctionBody): (WebCore::jsTestObjPrototypeFunctionToStringBody): (WebCore::JSTestObj::serialize): (WebCore::jsTestObjPrototypeFunctionToJSONBody): * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestOperationConditional.cpp: (WebCore::jsTestOperationConditionalPrototypeFunctionNonConditionalOperationBody): (WebCore::jsTestOperationConditionalPrototypeFunctionConditionalOperationBody): * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItemBody): * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: (WebCore::jsTestPromiseRejectionEventPromiseGetter): (WebCore::jsTestPromiseRejectionEventReasonGetter): * bindings/scripts/test/JS/JSTestSerialization.cpp: (WebCore::jsTestSerializationFirstStringAttributeGetter): (WebCore::setJSTestSerializationFirstStringAttributeSetter): (WebCore::jsTestSerializationSecondLongAttributeGetter): (WebCore::setJSTestSerializationSecondLongAttributeSetter): (WebCore::jsTestSerializationThirdUnserializableAttributeGetter): (WebCore::setJSTestSerializationThirdUnserializableAttributeSetter): (WebCore::jsTestSerializationFourthUnrestrictedDoubleAttributeGetter): (WebCore::setJSTestSerializationFourthUnrestrictedDoubleAttributeSetter): (WebCore::jsTestSerializationFifthLongAttributeGetter): (WebCore::setJSTestSerializationFifthLongAttributeSetter): (WebCore::jsTestSerializationSixthTypedefAttributeGetter): (WebCore::setJSTestSerializationSixthTypedefAttributeSetter): (WebCore::jsTestSerializationSeventhDirectlySerializableAttributeGetter): (WebCore::setJSTestSerializationSeventhDirectlySerializableAttributeSetter): (WebCore::jsTestSerializationEighthIndirectlyAttributeGetter): (WebCore::setJSTestSerializationEighthIndirectlyAttributeSetter): (WebCore::jsTestSerializationNinthOptionalDirectlySerializableAttributeGetter): (WebCore::setJSTestSerializationNinthOptionalDirectlySerializableAttributeSetter): (WebCore::jsTestSerializationTenthFrozenArrayAttributeGetter): (WebCore::setJSTestSerializationTenthFrozenArrayAttributeSetter): (WebCore::jsTestSerializationEleventhSequenceAttributeGetter): (WebCore::setJSTestSerializationEleventhSequenceAttributeSetter): (WebCore::jsTestSerializationTwelfthInterfaceSequenceAttributeGetter): (WebCore::setJSTestSerializationTwelfthInterfaceSequenceAttributeSetter): (WebCore::JSTestSerialization::serialize): (WebCore::jsTestSerializationPrototypeFunctionToJSONBody): * bindings/scripts/test/JS/JSTestSerialization.h: * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: (WebCore::jsTestSerializationInheritInheritLongAttributeGetter): (WebCore::setJSTestSerializationInheritInheritLongAttributeSetter): (WebCore::JSTestSerializationInherit::serialize): (WebCore::jsTestSerializationInheritPrototypeFunctionToJSONBody): * bindings/scripts/test/JS/JSTestSerializationInherit.h: * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: (WebCore::jsTestSerializationInheritFinalFinalLongAttributeFooGetter): (WebCore::setJSTestSerializationInheritFinalFinalLongAttributeFooSetter): (WebCore::jsTestSerializationInheritFinalFinalLongAttributeBarGetter): (WebCore::setJSTestSerializationInheritFinalFinalLongAttributeBarSetter): (WebCore::JSTestSerializationInheritFinal::serialize): (WebCore::jsTestSerializationInheritFinalPrototypeFunctionToJSONBody): * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h: * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::jsTestSerializedScriptValueInterfaceValueGetter): (WebCore::setJSTestSerializedScriptValueInterfaceValueSetter): (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValueGetter): (WebCore::jsTestSerializedScriptValueInterfaceCachedValueGetter): (WebCore::setJSTestSerializedScriptValueInterfaceCachedValueSetter): (WebCore::jsTestSerializedScriptValueInterfacePortsGetter): (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValueGetter): (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionBody): (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionFunctionReturningBody): * bindings/scripts/test/JS/JSTestStringifier.cpp: (WebCore::jsTestStringifierPrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: (WebCore::jsTestStringifierAnonymousOperationPrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: (WebCore::jsTestStringifierNamedOperationPrototypeFunctionIdentifierBody): (WebCore::jsTestStringifierNamedOperationPrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: (WebCore::jsTestStringifierOperationImplementedAsPrototypeFunctionIdentifierBody): (WebCore::jsTestStringifierOperationImplementedAsPrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: (WebCore::jsTestStringifierOperationNamedToStringPrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: (WebCore::jsTestStringifierReadOnlyAttributeIdentifierGetter): (WebCore::jsTestStringifierReadOnlyAttributePrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: (WebCore::jsTestStringifierReadWriteAttributeIdentifierGetter): (WebCore::setJSTestStringifierReadWriteAttributeIdentifierSetter): (WebCore::jsTestStringifierReadWriteAttributePrototypeFunctionToStringBody): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::jsTestTypedefsUnsignedLongLongAttrGetter): (WebCore::setJSTestTypedefsUnsignedLongLongAttrSetter): (WebCore::jsTestTypedefsSerializedScriptValueGetter): (WebCore::setJSTestTypedefsSerializedScriptValueSetter): (WebCore::jsTestTypedefsConstructorTestSubObjGetter): (WebCore::jsTestTypedefsAttributeWithClampGetter): (WebCore::setJSTestTypedefsAttributeWithClampSetter): (WebCore::jsTestTypedefsAttributeWithClampInTypedefGetter): (WebCore::setJSTestTypedefsAttributeWithClampInTypedefSetter): (WebCore::jsTestTypedefsBufferSourceAttrGetter): (WebCore::setJSTestTypedefsBufferSourceAttrSetter): (WebCore::jsTestTypedefsDomTimeStampAttrGetter): (WebCore::setJSTestTypedefsDomTimeStampAttrSetter): (WebCore::jsTestTypedefsPrototypeFunctionFuncBody): (WebCore::jsTestTypedefsPrototypeFunctionSetShadowBody): (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArgBody): (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArgBody): (WebCore::jsTestTypedefsPrototypeFunctionSequenceOfNullablesArgBody): (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceOfNullablesArgBody): (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceOfUnionsArgBody): (WebCore::jsTestTypedefsPrototypeFunctionUnionArgBody): (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampBody): (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampInTypedefBody): (WebCore::jsTestTypedefsPrototypeFunctionPointFunctionBody): (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunctionBody): (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2Body): (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresIncludeBody): (WebCore::jsTestTypedefsPrototypeFunctionMethodWithExceptionBody): 2020-07-24 Jiewen Tan <jiewen_tan@apple.com> Propagating user gesture through Fetch API https://bugs.webkit.org/show_bug.cgi?id=214444 <rdar://problem/65980953> Reviewed by Youenn Fablet. This patch propagates media only user gestures through Fetch API, including Fetch and FetchResponse. Covered by new test contents. * Modules/fetch/DOMWindowFetch.cpp: (WebCore::DOMWindowFetch::fetch): Propagates media only user gestures through Fetch. * Modules/fetch/FetchBodyConsumer.cpp: (WebCore::FetchBodyConsumer::clean): (WebCore::FetchBodyConsumer::resolve): (WebCore::FetchBodyConsumer::setConsumePromise): (WebCore::FetchBodyConsumer::resetConsumePromise): (WebCore::FetchBodyConsumer::loadingFailed): (WebCore::FetchBodyConsumer::loadingSucceeded): * Modules/fetch/FetchBodyConsumer.h: (WebCore::FetchBodyConsumer::setMaximumIntervalForUserGestureForwarding): (WebCore::FetchBodyConsumer::FetchBodyConsumer): Propagates media only user gestures through FetchResponse. UserGestureIndicator is only set in the async promise resolving path. * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::queueMicrotaskToEventLoop): Propagates media only user gestures that was propagated through Fetch to the related promise executors. * dom/UserGestureIndicator.cpp: (WebCore::UserGestureIndicator::UserGestureIndicator): (WebCore::UserGestureIndicator::~UserGestureIndicator): * dom/UserGestureIndicator.h: (WebCore::UserGestureToken::setIsPropagatedFromFetch): (WebCore::UserGestureToken::resetIsPropagatedFromFetch): (WebCore::UserGestureToken::isPropagatedFromFetch const): Adds a flag to indicate the propagation source of a user gesture token. And makes pipelines from testing. * page/DOMTimer.cpp: (WebCore::DOMTimer::fired): Gathers some constants. * testing/Internals.cpp: (WebCore::Internals::setFetchMaximumIntervalForUserGestureForwarding): * testing/Internals.h: * testing/Internals.idl: Crafts a way to pass the maximum interval from layout tests. * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::XMLHttpRequest): Gathers some constants. 2020-07-24 Kenneth Russell <kbr@chromium.org> [WebGL2] Framebuffer and renderbuffer updates https://bugs.webkit.org/show_bug.cgi?id=126448 Reviewed by Dean Jackson. Implement, or finish implementing, the following WebGL 2.0 framebuffer and renderbuffer related APIs: framebufferTextureLayer getInternalformatParameter getRenderbufferParameter invalidateFramebuffer invalidateSubFramebuffer readBuffer renderbufferStorage renderbufferStorageMultisample Covered by existing WebGL 2.0 conformance tests. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::initializeNewContext): (WebCore::WebGL2RenderingContext::validateTexFuncLayer): (WebCore::WebGL2RenderingContext::maxTextureLevelForTarget): (WebCore::WebGL2RenderingContext::blitFramebuffer): (WebCore::WebGL2RenderingContext::framebufferTextureLayer): (WebCore::WebGL2RenderingContext::getInternalformatParameter): (WebCore::WebGL2RenderingContext::invalidateFramebuffer): (WebCore::WebGL2RenderingContext::invalidateSubFramebuffer): (WebCore::WebGL2RenderingContext::renderbufferStorageMultisample): (WebCore::WebGL2RenderingContext::renderbufferStorageImpl): (WebCore::WebGL2RenderingContext::renderbufferStorageHelper): (WebCore::WebGL2RenderingContext::checkAndTranslateAttachments): (WebCore::WebGL2RenderingContext::renderbufferStorage): Deleted. * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::setAttachmentForBoundFramebuffer): (WebCore::WebGLFramebuffer::attach): (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer): (WebCore::WebGLFramebuffer::setAttachmentInternal): (WebCore::WebGLFramebuffer::removeAttachmentInternal): * html/canvas/WebGLFramebuffer.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::renderbufferStorage): Deleted. * html/canvas/WebGLRenderingContext.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer): (WebCore::WebGLRenderingContextBase::framebufferTexture2D): (WebCore::WebGLRenderingContextBase::getRenderbufferParameter): (WebCore::WebGLRenderingContextBase::renderbufferStorage): (WebCore::WebGLRenderingContextBase::renderbufferStorageImpl): (WebCore::WebGLRenderingContextBase::validateTexFuncLevel): (WebCore::WebGLRenderingContextBase::maxTextureLevelForTarget): (WebCore::WebGLRenderingContextBase::validateFramebufferFuncParameters): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::framebufferTextureLayer): (WebCore::GraphicsContextGLOpenGL::invalidateFramebuffer): (WebCore::GraphicsContextGLOpenGL::invalidateSubFramebuffer): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: 2020-07-24 Jer Noble <jer.noble@apple.com> [Cocoa] Add PerformanceTest tool for measuring raw speed of a video decoder https://bugs.webkit.org/show_bug.cgi?id=214723 Reviewed by Darin Adler. Export classes used by the DecoderTest performance tool. Drive-by fix: allow the clients to enable or disable the hardware decoder for a given decompression session. * WebCore.xcodeproj/project.pbxproj: * platform/MediaSample.h: * platform/graphics/cocoa/SourceBufferParserWebM.h: * platform/graphics/cocoa/WebCoreDecompressionSession.h: * platform/graphics/cocoa/WebCoreDecompressionSession.mm: (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample): 2020-07-24 Youenn Fablet <youenn@apple.com> Monitor the case of a fetch event not able to register to the respondWith promise https://bugs.webkit.org/show_bug.cgi?id=214631 Reviewed by Alex Christensen. In some cases, the "Fetch event is destroyed" error is received. One possibility is that the fetch event is not able to register to its respondWith promise. Add a specific error message for that case. This is difficult to test as we would need to have a fetch event trying to register to the respondWith promise exactly at the time the service worker gets stopped. * bindings/js/JSDOMPromise.cpp: (WebCore::DOMPromise::whenSettled): (WebCore::DOMPromise::whenPromiseIsSettled): * bindings/js/JSDOMPromise.h: * workers/service/FetchEvent.cpp: (WebCore::FetchEvent::respondWith): Change from weakThis to makeRef. While this is not strictly needed since addExtendLifetimePromise ref the event while calling whenSettled, this is clearer and more robust. 2020-07-24 Youenn Fablet <youenn@apple.com> ASSERT(!m_peerConnection.isClosed()) on imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-operations.https.html https://bugs.webkit.org/show_bug.cgi?id=214189 <rdar://problem/65343941> Reviewed by Eric Carlson. Covered by unskipped tests. * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::addPendingTrackEvent): This can be called in case the connection is closed but should not be in case the connection is stopped. Update the ASSERT accordingly. 2020-07-24 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer] gst_buffer_unmap: assertion 'GST_IS_BUFFER (buffer)' failed https://bugs.webkit.org/show_bug.cgi?id=213364 Reviewed by Philippe Normand. The initial patch for this bug had good intentions but it failed in something basic and tests did not tackle the original issue. The problem was in that the destructor of the subclass was being called before the destructor of the superclass, hence the buffer was unreffed before unmapped. Now we finish what we started by adding an unmapEarly method that can be used as regular API if wanted and that it is used by the GstMappedOwnedBuffer destructor to instruct GstMappedBuffer superclass to actually unmap without having to wait for the destructor of the superclass to kick in. Tests: GStreamerTest::mappedOwnedBufferDestruction and GStreamerTest::mappedBufferValidityUnmapEarly API tests. * platform/graphics/gstreamer/GStreamerCommon.h: (WebCore::GstMappedBuffer::~GstMappedBuffer): (WebCore::GstMappedBuffer::unmapEarly): (WebCore::GstMappedOwnedBuffer::~GstMappedOwnedBuffer): 2020-07-23 Alex Christensen <achristensen@webkit.org> Split Windows parts from CFNetworkSPI.h to CFNetworkSPIWin.h https://bugs.webkit.org/show_bug.cgi?id=214719 Reviewed by Tim Horton. No change in behavior. Windows CFNetwork work is not actively developed, but Cocoa is. This makes it easier to find where to put new things. * platform/network/NetworkStorageSession.h: * platform/network/ResourceHandleClient.h: * platform/network/ResourceHandleInternal.h: * platform/network/cf/CookieStorageCFNet.cpp: * platform/network/cf/CredentialStorageCFNet.cpp: * platform/network/cf/NetworkStorageSessionCFNetWin.cpp: * platform/network/cf/ResourceErrorCF.cpp: * platform/network/cf/ResourceHandleCFNet.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp: * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: * platform/network/cf/ResourceRequestCFNet.cpp: * platform/network/cf/ResourceRequestCFNet.h: * platform/network/cf/ResourceResponse.h: * platform/network/cf/ResourceResponseCFNet.cpp: * platform/network/cf/SocketStreamHandleImplCFNet.cpp: 2020-07-23 Alex Christensen <achristensen@webkit.org> Remove dead code in ResourceHandleCFNet.cpp https://bugs.webkit.org/show_bug.cgi?id=214717 Reviewed by Darin Adler. ResourceHandleCFNet.cpp is not compiled on Cocoa platforms any more. Remove Cocoa-specific code in that file, which was used on iOS before adopting NSURLSession. * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::createCFURLConnection): (WebCore::ResourceHandle::start): (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication): (WebCore::ResourceHandle::receivedCredential): (WebCore::ResourceHandle::schedule): Deleted. (WebCore::ResourceHandle::unschedule): Deleted. 2020-07-23 James Darpinian <jdarpinian@chromium.org> [WebGL2] Query Objects https://bugs.webkit.org/show_bug.cgi?id=126940 Reviewed by Dean Jackson. Passes conformance tests webgl/2.0.0/conformance2/query/* * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::deleteQuery): (WebCore::WebGL2RenderingContext::isQuery): (WebCore::WebGL2RenderingContext::validateQueryTarget): (WebCore::WebGL2RenderingContext::beginQuery): (WebCore::WebGL2RenderingContext::endQuery): (WebCore::WebGL2RenderingContext::getQuery): (WebCore::WebGL2RenderingContext::getQueryParameter): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLQuery.cpp: (WebCore::WebGLQuery::deleteObjectImpl): * html/canvas/WebGLQuery.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::validateWebGLObject): * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::deleteQuery): (WebCore::GraphicsContextGLOpenGL::isQuery): (WebCore::GraphicsContextGLOpenGL::getQuery): 2020-07-23 Guowei Yang <guowei_yang@apple.com> Infrastructure Work for Integrating CoreImage for Accelerated CSS/SVG Filter Rendering https://bugs.webkit.org/show_bug.cgi?id=213672 Reviewed by Simon Fraser. This patch is the infrastructure work to enable filter rendering using CoreImage. The design of this code is as follows: 0) changing WebCore configuration for using CoreImage framework from iOS/mac only to unconditional, so watchOS and tvOS could also use CoreImage 1) adding a new API to obtain the IOSurface from an AcceleratedImageBuffer since CoreImage needs to render to an IOSurface 2) Instead of applying the filters inside FilterEffect, a new class, FilterEffectRendererCoreImage is designed to handle the rendering. We hide the implementation details by subclassing from a generic FilterEffectRenderer class. This also has the benefit of organizing CoreImage obj-c calls in one place. This class owns a FilterEffect node, that is the last FilterEffect of a given filter graph. The filter graph will be traversed backwards and filter parameters is gathered along the way. Then CIFilters will be created and connected to a larger CIFilter graph. The output of the CIFilter graph will be rendered to the IOSurface of a newly created AcceleratedImageBuffer. This image buffer will be returned to RenderLayerFilters and rendered to the screen 3) Inside CSSFilter::build, we first try to create a FilterEffectRenderer by passing in a renderer setting. A valid pointer will be returned only when the following two conditions are met: . CoreImage rendering is enabled in settings . All the filters inside the filter graph is implemented using CIFilters No new tests are required as this is the infrastructure code for integrating CoreImage This patch should pass all the existing css3/filters tests * Configurations/WebCore.xcconfig: modified flag definition so that CoreImage is used on all Apple Platforms, not only iPhone. * Sources.txt: Added the generic FilterEffectRenderer class file * SourcesCocoa.txt: added FilterEffectRendererCoreImage.mm * WebCore.xcodeproj/project.pbxproj: Reflecting newly added files, with some ordering changes * platform/graphics/ConcreteImageBuffer.h: overrides isAccelerated() function that returns true only if the backend is IOSurface * platform/graphics/ImageBuffer.h: defined virtual function isAccelerated() * platform/graphics/ImageBufferBackend.h: defined virtual function isAccelerated() that returns false in the base class (WebCore::ImageBufferBackend::isAccelerated const): returns false for the base class * platform/graphics/PlatformImageBuffer.h: added SPECIALIZE_TYPE_TRAITS to check what type of ImageBufferBackend is * platform/graphics/PlatformImageBuffer.h: Added API to obtain IOSurface from IOSurfaceBackend; added SPECIALIZE_TYPE_TRAITS (WebCore::AcceleratedImageBuffer::surface): Obtain the IOSurface pointer from ImageBufferIOSurfaceBackend (isType): check if a given ImageBuffer is type AcceleratedImageBuffer * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: (WebCore::ImageBufferIOSurfaceBackend::surface): added an API to get the IOSurface pointer (WebCore::ImageBufferIOSurfaceBackend::isAccelerated const): returns true because it is an accelerated image buffer * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: added function surface() and isAccelerated() * platform/graphics/coreimage/FilterEffectRendererCoreImage.h: Added. * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm: Added. (WebCore::FilterEffectRendererCoreImage::tryCreate): creates a FilterEffectRendererCoreImage unique pointer. If the filters inside the graph are not all implemented, we return nullptr (WebCore::FilterEffectRendererCoreImage::supportsCoreImageRendering): a function that takes in FilterEffect& and returns true if its a filter effect type that is implemented in CoreImage, false otherwise (WebCore::FilterEffectRendererCoreImage::applyEffects): takes in a FilterEffect pointer, calls FilterEffectRendererCoreImage::connectCIFilters to create the final output CIImage (WebCore::FilterEffectRendererCoreImage::connectCIFilters): recursive helper function that traverses the FilterEffect graph backwards, creates CIFilter graph based on the subclass type of current processing FilterEffect node. It will cache the CIFilter in a hashmap, whose key is the corresponding FilterEffect pointer. (WebCore::FilterEffectRendererCoreImage::canRenderUsingCIFilters): unction that takes in the last FilterEffect node and determines whether all of the filters inside the filter graph is already implemented using CIFilters. It returns false as long as there is one filter that hasn't been implemented. The rendering procedure will fallback to software mode if this function returns false (WebCore::FilterEffectRendererCoreImage::output const): returns the ImageBuffer that contains the data of the final output image (WebCore::FilterEffectRendererCoreImage::renderToImageBuffer): r enders CIImage* to an ImageBuffer (WebCore::FilterEffectRendererCoreImage::destRect const): calculates the destination bounding box (WebCore::FilterEffectRendererCoreImage::clearResult): clears all the saved results (WebCore::FilterEffectRendererCoreImage::FilterEffectRendererCoreImage): constructor * platform/graphics/filters/FEBlend.cpp: (WebCore::FEBlend::FEBlend): Pass an additional FilterEffect::Type argument to base class constructor * platform/graphics/filters/FEColorMatrix.cpp: (WebCore::FEColorMatrix::FEColorMatrix): ditto * platform/graphics/filters/FEComponentTransfer.cpp: (WebCore::FEComponentTransfer::FEComponentTransfer): ditto * platform/graphics/filters/FEComposite.cpp: (WebCore::FEComposite::FEComposite): ditto * platform/graphics/filters/FEConvolveMatrix.cpp: (WebCore::FEConvolveMatrix::FEConvolveMatrix): ditto * platform/graphics/filters/FEDiffuseLighting.cpp: (WebCore::FEDiffuseLighting::FEDiffuseLighting):ditto * platform/graphics/filters/FEDisplacementMap.cpp: (WebCore::FEDisplacementMap::FEDisplacementMap):ditto * platform/graphics/filters/FEDisplacementMap.h: * platform/graphics/filters/FEDropShadow.cpp: (WebCore::FEDropShadow::FEDropShadow):ditto * platform/graphics/filters/FEFlood.cpp: (WebCore::FEFlood::FEFlood):ditto * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::FEGaussianBlur):ditto * platform/graphics/filters/FELighting.cpp: (WebCore::FELighting::FELighting):ditto * platform/graphics/filters/FELighting.h: * platform/graphics/filters/FEMerge.cpp: (WebCore::FEMerge::FEMerge): ditto * platform/graphics/filters/FEMorphology.cpp: (WebCore::FEMorphology::FEMorphology): ditto * platform/graphics/filters/FEOffset.cpp: (WebCore::FEOffset::FEOffset): ditto * platform/graphics/filters/FESpecularLighting.cpp: (WebCore::FESpecularLighting::FESpecularLighting): ditto * platform/graphics/filters/FETile.cpp: (WebCore::FETile::FETile): ditto * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::FETurbulence): ditto * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::FilterEffect): ditto * platform/graphics/filters/FilterEffect.h: added a const member, m_filterEffectType (WebCore::FilterEffect::filterEffectClassType): returns the FilterEffect class type * platform/graphics/filters/FilterEffectRenderer.cpp: Added. (WebCore::FilterEffectRenderer::tryCreate): tries creates a new FilterEffectRenderer unique pointer. Here, we check whether the renderer setting has CoreImage accelerated filter rendering enabled; we also check if all the filters in the given FilterEffect graph is already implemented using CoreImage. If both conditions are satisfied, create a FilterEffectRendererCoreImage otherwise returns nullptr. * platform/graphics/filters/FilterEffectRenderer.h: Added. * platform/graphics/filters/SourceAlpha.cpp: (WebCore::SourceAlpha::SourceAlpha): Pass an additional FilterEffect::Type argument to base class constructor * platform/graphics/filters/SourceAlpha.h: * platform/graphics/filters/SourceGraphic.h: (WebCore::SourceGraphic::SourceGraphic): ditto * rendering/CSSFilter.cpp: (WebCore::CSSFilter::build): we try to create a FilterEffectRenderer here by passing in the state of the CoreImage Accelerated Rendering feature switch (WebCore::CSSFilter::apply): If we have a valid m_filterRenderer pointer, that means we can render the result image using CoreImage path, thus we don't call effect.apply() fall back to software mode if hasResult() returns false. (WebCore::CSSFilter::output const): if we have a valid m_filterRenderer, then we will obtain the ImageBuffer result from it, not FilterEffect (WebCore::CSSFilter::outputRect const): if we have a valid m_filterRenderer, then we will obtain the ImageBuffer result from it, not FilterEffect * rendering/CSSFilter.h: * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::FEImage): Pass an additional FilterEffect::Type argument to base class constructor 2020-07-23 Yusuke Suzuki <ysuzuki@apple.com> We should have exception check after promise operation https://bugs.webkit.org/show_bug.cgi?id=214610 <rdar://problem/65881794> Reviewed by Youenn Fablet and Mark Lam. Test: js/dom/promise-should-have-exception-check-on-operation.html Add exception check after promise operations. * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::DeferredPromise::reject): 2020-07-23 Jer Noble <jer.noble@apple.com> [Cocoa|WebM] Seeking can leave parser in hung state https://bugs.webkit.org/show_bug.cgi?id=214704 <rdar://problem/66009420> Reviewed by Eric Carlson. When the parser is explicitly reset, make sure to clear out all the tracks and initialization datas. Otherwise, a half-filled CMSampleBuffer can be left waiting around for more data, which may never arrive, and no further samples will ever be parsed. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::resetParserState): 2020-07-23 Jer Noble <jer.noble@apple.com> [Cocoa] RELEASE_ASSERT when calling registerSupplementalVP9Decoder() when VideoToolbox.framework is not present https://bugs.webkit.org/show_bug.cgi?id=214697 <rdar://problem/66010949> Reviewed by Eric Carlson. * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::registerSupplementalVP9Decoder): (WebCore::isVP9DecoderAvailable): 2020-07-23 Sihui Liu <sihui_liu@appe.com> Allow IndexedDB in third-party frames https://bugs.webkit.org/show_bug.cgi?id=214583 <rdar://problem/61278487> Reviewed by Geoffrey Garen. Match IndexedDB's behavior with localStorage. Third-party iframes now have access to IndexedDB with partitioned in-memory storage. The partitioning key is ClientOrigin, which consists of opening origin and top origin. API Test: IndexedDB.IndexedDBThirdPartyFrameHasAccess IndexedDB.IndexedDBThirdPartyDataRemoval IndexedDB.IndexedDBThirdPartyWorkerHasAccess * Modules/indexeddb/IDBDatabaseIdentifier.cpp: (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier): (WebCore::m_isTransient): (WebCore::IDBDatabaseIdentifier::isolatedCopy const): (WebCore::IDBDatabaseIdentifier::loggingString const): * Modules/indexeddb/IDBDatabaseIdentifier.h: (WebCore::IDBDatabaseIdentifier::hash const): (WebCore::IDBDatabaseIdentifier::operator== const): (WebCore::IDBDatabaseIdentifier::isTransient const): (WebCore::IDBDatabaseIdentifier::encode const): (WebCore::IDBDatabaseIdentifier::decode): * Modules/indexeddb/IDBFactory.cpp: (WebCore::shouldThrowSecurityException): (WebCore::IDBFactory::openInternal): (WebCore::IDBFactory::deleteDatabase): * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::createBackingStore): * Modules/webdatabase/DOMWindowWebDatabase.cpp: (WebCore::DOMWindowWebDatabase::openDatabase): * page/SecurityOrigin.h: (WebCore::SecurityOrigin::canAccessDatabase const): 2020-07-23 Chris Dumez <cdumez@apple.com> Add support for SVGAElement's rel / relList attributes https://bugs.webkit.org/show_bug.cgi?id=214690 Reviewed by Darin Adler. Add support for SVGAElement's rel / relList attributes: https://www.w3.org/TR/SVG/linking.html#InterfaceSVGAElement No new tests, rebaselined existing tests. * svg/SVGAElement.cpp: (WebCore::SVGAElement::parseAttribute): (WebCore::SVGAElement::relList const): * svg/SVGAElement.h: * svg/SVGAElement.idl: * svg/svgattrs.in: 2020-07-23 Yusuke Suzuki <ysuzuki@apple.com> Add exception check for WebCore createRejectedPromiseWithTypeError https://bugs.webkit.org/show_bug.cgi?id=214680 <rdar://problem/65925490> Reviewed by Mark Lam. Test: js/dom/rejected-promise-creation-should-check-exception.html Add missing exception checks in createRejectedPromiseWithTypeError. * bindings/js/JSDOMAttribute.h: (WebCore::IDLAttribute::get): * bindings/js/JSDOMOperationReturningPromise.h: (WebCore::IDLOperationReturningPromise::call): (WebCore::IDLOperationReturningPromise::callReturningOwnPromise): * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::createRejectedPromiseWithTypeError): 2020-07-23 Fujii Hironori <Hironori.Fujii@sony.com> [CMake][Win] Build StructuredExceptionHandlerSuppressor.cpp and makesafeseh.asm only for AppleWin https://bugs.webkit.org/show_bug.cgi?id=214671 Reviewed by Per Arne Vollan. StructuredExceptionHandlerSuppressor is used only by AppleWin port in platform/graphics/ca/win/LayerChangesFlusher.cpp. makesafeseh.asm causes a building problem for 32bit WinCairo because it is using OBJECT library type for WebCore. * PlatformAppleWin.cmake: Added build rules for them. * PlatformWin.cmake: Removed build rules for them. 2020-07-23 Andres Gonzalez <andresg_22@apple.com> Update the isolated tree even when there is no client request. https://bugs.webkit.org/show_bug.cgi?id=214692 Reviewed by Chris Fleizach. AXObjectCache::updateIsolatedTree was checking for isIsolatedTreeEnabled, which in turn checks for whether the clientSupportsIsolatedTree. Often at the time updateIsolatedTree is called, there is no client request since client requests and updates occur in separate threads, independently from each other. Thus the isolated tree wasn't being updated. This patch removes the check for isIsolatedTreeEnabled and rely on the presence of an isolated tree for the given PageID to perform the update. In addition, added an update of the isolated tree for AXLoadingEvent::AXLoadingFinished. This fixes several instance of dynamic content page changes that were not being reflected on the isolated tree. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::clientSupportsIsolatedTree): Some logging. (WebCore::AXObjectCache::isIsolatedTreeEnabled): Some logging. (WebCore::AXObjectCache::frameLoadingEventNotification): Calls updateIsolatedTree. (WebCore::AXObjectCache::updateIsolatedTree): Handles AXLoadingEvents. * accessibility/AXObjectCache.h: 2020-07-23 Clark Wang <clark_wang@apple.com> Added PeriodicWave constructor according to spec https://bugs.webkit.org/show_bug.cgi?id=214615 Reviewed by Chris Dumez. Re-baselined existing tests that now pass. Added PeriodicWave constructor according to spec: https://www.w3.org/TR/webaudio/#periodicwave. Added PeriodicWaveConstraints, PeriodicWaveOptions files. Updated PeriodicWave::createBandLimitedTables to normalize waveform based on spec: https://www.w3.org/TR/webaudio/#waveform-normalization. Added updated createPeriodicWave method in BaseAudioContext, and moved old createPeriodicWave method Into WebKitAudioContext. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createPeriodicWave): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::createPeriodicWave): * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/PeriodicWave.cpp: (WebCore::PeriodicWave::create): (WebCore::PeriodicWave::createBandLimitedTables): * Modules/webaudio/PeriodicWave.h: * Modules/webaudio/PeriodicWave.idl: * Modules/webaudio/PeriodicWaveConstraints.h: Added. * Modules/webaudio/PeriodicWaveConstraints.idl: Added. * Modules/webaudio/PeriodicWaveOptions.h: Added. * Modules/webaudio/PeriodicWaveOptions.idl: Added. * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::createPeriodicWave): * Modules/webaudio/WebKitAudioContext.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-23 David Kilzer <ddkilzer@apple.com> [IPC hardening] WebKit::ArgumentCoder<BlobPart>::decode() and encode() should use enum BlobPart::Type <https://webkit.org/b/214665> <rdar://problem/65777948> Reviewed by Darin Adler. * platform/network/BlobPart.h: (WebCore::BlobPart::Type): - Convert to an enum class of size `bool`. (WebCore::BlobPart::BlobPart): (WebCore::BlobPart::data const): (WebCore::BlobPart::moveData): (WebCore::BlobPart::url const): - Change BlobPart::Type enums to use fully qualified name. * platform/network/BlobRegistryImpl.cpp: (WebCore::BlobRegistryImpl::registerBlobURL): - Change BlobPart::Type enums to use fully qualified name. 2020-07-23 Simon Fraser <simon.fraser@apple.com> updateRendering trace point should exclude SVG https://bugs.webkit.org/show_bug.cgi?id=214649 Reviewed by Geoffrey Garen. Don't issue the trace point for SVGImage Pages. * page/Page.cpp: (WebCore::Page::updateRendering): 2020-07-23 Zalan Bujtas <zalan@apple.com> Unreviewed, reverting r262124. See REGRESSION(r262124) Overlapping text on Youtube's video upload page https://bugs.webkit.org/show_bug.cgi?id=214655 * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): 2020-07-23 Brady Eidson <beidson@apple.com> Add Gamepad tests that exercise the native frameworks <rdar://problem/65343674> and https://bugs.webkit.org/show_bug.cgi?id=214188 Reviewed by Tim Horton. * platform/gamepad/mac/MultiGamepadProvider.h: (WebCore::MultiGamepadProvider::setUsesOnlyHIDGamepadProvider): * platform/gamepad/mac/MultiGamepadProvider.mm: (WebCore::MultiGamepadProvider::startMonitoringGamepads): (WebCore::MultiGamepadProvider::stopMonitoringGamepads): 2020-07-23 Xabier Rodriguez Calvar <calvaris@igalia.com> Unreviewed, build fix after r264762. * platform/graphics/gstreamer/GStreamerCommon.cpp: Added include SharedBuffer.h. 2020-07-23 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer] gst_buffer_unmap: assertion 'GST_IS_BUFFER (buffer)' failed https://bugs.webkit.org/show_bug.cgi?id=213364 Reviewed by Philippe Normand. In some cases as in passing init datas around, the InitData that contains a SharedBuffer that contains a non-reffed mapped buffer can outlive the buffer itself, creating this problem. In this patch we make a new class called GstMappedOwnedBuffer that is to map read-only buffers and that is used for the InitData SharedBuffer. GstMappedBuffer does not support SharedBuffer anymore and is not ref counted anymore as it is intended for short term and quick usage. Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-to-multiple-video-elements.https.html * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::create): (WebCore::SharedBuffer::SharedBuffer): (WebCore::SharedBuffer::DataSegment::data const): (WebCore::SharedBuffer::DataSegment::size const): * platform/SharedBuffer.h: * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webKitWebAudioSrcAllocateBuffersAndRenderAudio): * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::GstMappedBuffer::createVector const): (WebCore::GstMappedOwnedBuffer::createSharedBuffer): * platform/graphics/gstreamer/GStreamerCommon.h: (WebCore::GstMappedBuffer::GstMappedBuffer): (WebCore::GstMappedBuffer::~GstMappedBuffer): (WebCore::GstMappedBuffer::isValid const): (WebCore::GstMappedBuffer::data): (WebCore::GstMappedBuffer::data const): (WebCore::GstMappedBuffer::size const): (WebCore::GstMappedBuffer::operator bool const): (WebCore::GstMappedBuffer::operator! const): (WebCore::GstMappedOwnedBuffer::create): (WebCore::GstMappedOwnedBuffer::GstMappedOwnedBuffer): (WebCore::operator==): * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp: (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample): * platform/graphics/gstreamer/eme/CDMProxyThunder.cpp: (WebCore::CDMProxyThunder::getDecryptionSession const): * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: (WebCore::InitData::InitData): * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (decrypt): * platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp: (WebCore::MockRealtimeAudioSourceGStreamer::render): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame): * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerVideoEncoder::Fragmentize): 2020-07-23 Mark Lam <mark.lam@apple.com> Fix missing exception checks below RTCPeerConnection.generateCertificate(). https://bugs.webkit.org/show_bug.cgi?id=214668 <rdar://problem/65929975> Reviewed by Yusuke Suzuki. Test: webrtc/missing-exception-checks-RTCPeerConnection-generateCertificate.html * bindings/js/JSCustomElementRegistryCustom.cpp: (WebCore::JSCustomElementRegistry::whenDefined): * bindings/js/JSDOMConvertUnion.h: * bindings/js/JSDOMOperationReturningPromise.h: (WebCore::IDLOperationReturningPromise::call): (WebCore::IDLOperationReturningPromise::callReturningOwnPromise): (WebCore::IDLOperationReturningPromise::callStatic): (WebCore::IDLOperationReturningPromise::callStaticReturningOwnPromise): * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::DeferredPromise::reject): (WebCore::rejectPromiseWithExceptionIfAny): * bindings/js/JSDOMPromiseDeferred.h: (WebCore::callPromiseFunction): 2020-07-22 Conrad Shultz <conrad_shultz@apple.com> Update macOS Version macros https://bugs.webkit.org/show_bug.cgi?id=214653 Reviewed by Tim Horton. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: 2020-07-22 Jer Noble <jer.noble@apple.com> [Cocoa|WebM] Decode error when seeking https://bugs.webkit.org/show_bug.cgi?id=214666 Reviewed by Eric Carlson. A decoder error is hit when seeking because we think all samples coming out of the SourceBufferParserWebM are sync-samples. This is because the attachment added with CMSetAttachment() is ignored; the correct way to set sample attachments is by getting the sample attachments array with CMSampleBufferGetSampleAttachmentsArray(), and then iterating over the attachments and adding keys to the underlying mutable CFDictionary. * platform/graphics/cocoa/SourceBufferParserWebM.cpp: (WebCore::SourceBufferParserWebM::OnFrame): 2020-07-22 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo][32bit] JPEG2000ImageDecoder.cpp: error C2664: 'std::unique_ptr<...>::unique_ptr(...)': cannot convert argument 2 from 'void (__stdcall *)(opj_codec_t *)' to 'const _Dx &' https://bugs.webkit.org/show_bug.cgi?id=214657 Reviewed by Darin Adler. __cdecl and __stdcall calling conventions don't match. <https://docs.microsoft.com/en-us/cpp/cpp/argument-passing-and-naming-conventions> * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp: (WebCore::JPEG2000ImageDecoder::decode): Use decltype for the second template argument of unique_ptr. 2020-07-22 Jon Davis <jond@apple.com> Add feature status for CSS Containment Module Level 1 https://bugs.webkit.org/show_bug.cgi?id=214663 Reviewed by Darin Adler. * features.json: 2020-07-22 Jon Davis <jond@apple.com> Add feature status for the focus-visible pseudo-selector https://bugs.webkit.org/show_bug.cgi?id=214662 Reviewed by Darin Adler. * features.json: 2020-07-22 Wenson Hsieh <wenson_hsieh@apple.com> Unreviewed, update feature status for async clipboard API * features.json: Move from "In Development" to "Supported". 2020-07-21 Mark Lam <mark.lam@apple.com> Disallow VM entry when doing a VMInquiry. https://bugs.webkit.org/show_bug.cgi?id=214624 <rdar://problem/65915314> Reviewed by Saam Barati. 1. Change binding to reset the DisallowVMEntry scope in PropertySlot after doing a VMInquiry. 2. Rebase bindings test results to match. * bindings/js/JSDOMAbstractOperations.h: (WebCore::isVisibleNamedProperty): (WebCore::accessVisibleNamedProperty): * bindings/scripts/CodeGeneratorJS.pm: (GeneratePut): (GeneratePutByIndex): (GenerateDefineOwnProperty): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::put): (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::putByIndex): (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: (WebCore::JSTestNamedAndIndexedSetterThrowingException::put): (WebCore::JSTestNamedAndIndexedSetterThrowingException::putByIndex): (WebCore::JSTestNamedAndIndexedSetterThrowingException::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::put): (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::putByIndex): (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: (WebCore::JSTestNamedSetterNoIdentifier::put): (WebCore::JSTestNamedSetterNoIdentifier::putByIndex): (WebCore::JSTestNamedSetterNoIdentifier::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: (WebCore::JSTestNamedSetterThrowingException::put): (WebCore::JSTestNamedSetterThrowingException::putByIndex): (WebCore::JSTestNamedSetterThrowingException::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: (WebCore::JSTestNamedSetterWithIdentifier::put): (WebCore::JSTestNamedSetterWithIdentifier::putByIndex): (WebCore::JSTestNamedSetterWithIdentifier::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetter::put): (WebCore::JSTestNamedSetterWithIndexedGetter::putByIndex): (WebCore::JSTestNamedSetterWithIndexedGetter::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::put): (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::putByIndex): (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::defineOwnProperty): * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: (WebCore::JSTestNamedSetterWithUnforgableProperties::put): (WebCore::JSTestNamedSetterWithUnforgableProperties::putByIndex): (WebCore::JSTestNamedSetterWithUnforgableProperties::defineOwnProperty): 2020-07-22 Eric Carlson <eric.carlson@apple.com> [Cocoa] canPlayType with 'codecs' parameter should never return "maybe" https://bugs.webkit.org/show_bug.cgi?id=214621 <rdar://problem/65146785> Reviewed by Jer Noble. No new tests, updated existing tests and results. * platform/graphics/MIMETypeCache.cpp: (WebCore::MIMETypeCache::canDecodeType): 2020-07-22 Kenneth Russell <kbr@chromium.org> [WebGL2] Implement multiple render target entry points https://bugs.webkit.org/show_bug.cgi?id=211156 Reviewed by Dean Jackson. Implement the drawBuffers and clearBuffer entry points. Integrate the clearBuffer APIs with preserveDrawingBuffer:false's auto-clearing. Move some auto-clearing state from WebGLRenderingContextBase to GraphicsContextGL and GraphicsContextGLOpenGL. Rename setPreserveDrawingBuffer to enablePreserveDrawingBuffer to make it clear that arbitrary changes of preserveDrawingBuffer are not supported. setPreserveDrawingBuffer was previously added for capture of preserveDrawingBuffer:false WebGL canvases. Covered by existing WebGL conformance tests and canvas capture layout tests. * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::drawBuffers): (WebCore::WebGL2RenderingContext::clearBufferiv): (WebCore::WebGL2RenderingContext::clearBufferuiv): (WebCore::WebGL2RenderingContext::clearBufferfv): (WebCore::WebGL2RenderingContext::clearBufferfi): (WebCore::WebGL2RenderingContext::validateClearBuffer): (WebCore::WebGL2RenderingContext::updateBuffersToAutoClear): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::drawBuffersIfNecessary): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::clearIfComposited): (WebCore::WebGLRenderingContextBase::enablePreserveDrawingBuffer): * html/canvas/WebGLRenderingContextBase.h: (WebCore::WebGLRenderingContextBase::setPreserveDrawingBuffer): Deleted. * platform/graphics/GraphicsContextGL.cpp: (WebCore::GraphicsContextGL::enablePreserveDrawingBuffer): * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::markLayerComposited): (WebCore::GraphicsContextGLOpenGL::drawBuffers): (WebCore::GraphicsContextGLOpenGL::clearBufferiv): (WebCore::GraphicsContextGLOpenGL::clearBufferuiv): (WebCore::GraphicsContextGLOpenGL::clearBufferfv): (WebCore::GraphicsContextGLOpenGL::clearBufferfi): * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: (WebCore::GraphicsContextGLOpenGL::resetBuffersToAutoClear): (WebCore::GraphicsContextGLOpenGL::setBuffersToAutoClear): (WebCore::GraphicsContextGLOpenGL::getBuffersToAutoClear const): (WebCore::GraphicsContextGLOpenGL::enablePreserveDrawingBuffer): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::markLayerComposited): (WebCore::GraphicsContextGLOpenGL::drawBuffers): 2020-07-22 Wenson Hsieh <wenson_hsieh@apple.com> Article headlines are split across multiple lines after translating tagesschau.de https://bugs.webkit.org/show_bug.cgi?id=214652 <rdar://problem/63995571> Reviewed by Tim Horton. Treat block-level heading elements (`h1` through `h6`) as item boundaries. On this website, we currently vend the main heading and sub-heading as separate tokens in the same item, which sometimes causes the machine translation framework to try and rearrange and split tokens, since it treats the combination of the main heading and sub-heading text as a single sentence to be translated. Test: TextManipulation.StartTextManipulationExtractsHeadingElementsAsSeparateItems * editing/TextManipulationController.cpp: (WebCore::isEnclosingItemBoundaryElement): 2020-07-22 Alex Christensen <achristensen@webkit.org> Safari does not present CertificateInfo for service-worker served documents https://bugs.webkit.org/show_bug.cgi?id=206403 <rdar://problem/65410875> Reviewed by Darin Adler and Youenn Fablet. When loading a service worker JavaScript resource, we need to tell the network process to include certificate info with the response. We then pass that response to the ServiceWorkerContextData for storage. When the service worker generates responses to fetches, use that certificate chain for WKWebView.serverTrust when the page is committed. Covered by updating a test I wrote in r264687. * platform/network/ResourceResponseBase.h: (WebCore::ResourceResponseBase::setCertificateInfo): * platform/network/cf/CertificateInfo.h: * platform/network/cf/CertificateInfoCFNet.cpp: (WebCore::CertificateInfo::isolatedCopy const): * platform/network/soup/CertificateInfo.h: (WebCore::CertificateInfo::isolatedCopy const): * workers/Worker.cpp: (WebCore::Worker::create): * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::loadAsynchronously): (WebCore::WorkerScriptLoader::didReceiveResponse): * workers/WorkerScriptLoader.h: (WebCore::WorkerScriptLoader::certificateInfo const): * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerContextData.cpp: (WebCore::ServiceWorkerContextData::isolatedCopy const): * workers/service/ServiceWorkerContextData.h: (WebCore::ServiceWorkerContextData::encode const): (WebCore::ServiceWorkerContextData::decode): * workers/service/ServiceWorkerFetchResult.h: (WebCore::ServiceWorkerFetchResult::isolatedCopy const): (WebCore::serviceWorkerFetchError): (WebCore::ServiceWorkerFetchResult::encode const): (WebCore::ServiceWorkerFetchResult::decode): * workers/service/ServiceWorkerGlobalScope.h: * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::fetchScriptWithContext): (WebCore::ServiceWorkerJob::notifyFinished): * workers/service/ServiceWorkerJobClient.h: * workers/service/context/ServiceWorkerFetch.cpp: (WebCore::ServiceWorkerFetch::processResponse): (WebCore::ServiceWorkerFetch::dispatchFetchEvent): * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::importRecords): * workers/service/server/SWServer.cpp: (WebCore::SWServer::addRegistrationFromStore): Also fix a possible use-after-move bug, depending on parameter evaluation order which is undefined behavior. (WebCore::SWServer::updateWorker): (WebCore::SWServer::installContextData): * workers/service/server/SWServer.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::scriptFetchFinished): * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::SWServerWorker): (WebCore::SWServerWorker::contextData const): * workers/service/server/SWServerWorker.h: 2020-07-22 David Kilzer <ddkilzer@apple.com> Unreviewed build fix after r264710, r264719, r264721: use more HAVE_AVPLAYER_VIDEORANGEOVERRIDE. * platform/PlatformScreen.h: * platform/mac/PlatformScreenMac.mm: (WebCore::collectScreenProperties): - Guard more code with HAVE(AVPLAYER_VIDEORANGEOVERRIDE). 2020-07-22 Fujii Hironori <Hironori.Fujii@sony.com> [Win][Uniscribe] Material icons containing underscore or numbers aren't shown because ScriptItemize splits them apart https://bugs.webkit.org/show_bug.cgi?id=201214 Reviewed by Don Olmstead. ScriptItemize split "3d_rotation" into "3", "d", "_" and "rotation". It has a option fMergeNeutralItems to control it. Test: fonts/ligature.html * platform/graphics/win/ComplexTextControllerUniscribe.cpp: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Set fMergeNeutralItems of SCRIPT_CONTROL true. 2020-07-22 Jer Noble <jer.noble@apple.com> Further unreviewed build fix after r264710; need more HAVE_AVPLAYER_VIDEORANGEOVERRIDE guards. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 2020-07-22 Jer Noble <jer.noble@apple.com> Unreviewed build fix after r264710; add a HAVE_AVPLAYER_VIDEORANGEOVERRIDE guard. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPreferredDynamicRangeMode): 2020-07-22 Myles C. Maxfield <mmaxfield@apple.com> REGRESSION(r205826): narrowNoBreakSpace (U+202F) has zero width, regardless of font https://bugs.webkit.org/show_bug.cgi?id=214626 <rdar://problem/65193790> Reviewed by Timothy Hatcher. There's no reason to overwrite narrowNoBreakSpace with zeroWidthSpace. This is becoming much more prominent now because a lot of the French unit formatting data in CLDR - and hence in e.g. NSMeasurementFormatter - uses 202F between numeric value and unit, e.g. "37 km" It works in native content on macOS, and in all other browsers on macOS, but not in WebKit. Test: fast/text/narrowNoBreakSpace.html * platform/graphics/Font.cpp: (WebCore::overrideControlCharacters): 2020-07-22 James Darpinian <jdarpinian@chromium.org> Fix validation of deleted WebGL objects https://bugs.webkit.org/show_bug.cgi?id=214622 Reviewed by Dean Jackson. Programs and shaders need to be validated differently than other WebGL objects. Using a deleted WebGL object should cause an INVALID_OPERATION error, except for programs and shaders which should be INVALID_VALUE. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getFragDataLocation): (WebCore::WebGL2RenderingContext::transformFeedbackVaryings): (WebCore::WebGL2RenderingContext::getTransformFeedbackVarying): (WebCore::WebGL2RenderingContext::getUniformIndices): (WebCore::WebGL2RenderingContext::getActiveUniforms): (WebCore::WebGL2RenderingContext::getUniformBlockIndex): (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter): (WebCore::WebGL2RenderingContext::getActiveUniformBlockName): (WebCore::WebGL2RenderingContext::uniformBlockBinding): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::attachShader): (WebCore::WebGLRenderingContextBase::bindAttribLocation): (WebCore::WebGLRenderingContextBase::compileShader): (WebCore::WebGLRenderingContextBase::detachShader): (WebCore::WebGLRenderingContextBase::validateWebGLObject): (WebCore::WebGLRenderingContextBase::validateWebGLProgramOrShader): (WebCore::WebGLRenderingContextBase::getActiveAttrib): (WebCore::WebGLRenderingContextBase::getActiveUniform): (WebCore::WebGLRenderingContextBase::getAttachedShaders): (WebCore::WebGLRenderingContextBase::getAttribLocation): (WebCore::WebGLRenderingContextBase::getProgramParameter): (WebCore::WebGLRenderingContextBase::getProgramInfoLog): (WebCore::WebGLRenderingContextBase::getShaderParameter): (WebCore::WebGLRenderingContextBase::getShaderInfoLog): (WebCore::WebGLRenderingContextBase::getShaderSource): (WebCore::WebGLRenderingContextBase::getUniform): (WebCore::WebGLRenderingContextBase::getUniformLocation): (WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations): (WebCore::WebGLRenderingContextBase::shaderSource): (WebCore::WebGLRenderingContextBase::validateProgram): * html/canvas/WebGLRenderingContextBase.h: 2020-07-22 Jon Davis <jond@apple.com> Update feature status to include the inert attribute https://bugs.webkit.org/show_bug.cgi?id=214644 Reviewed by Darin Adler. * features.json: 2020-07-22 Jer Noble <jer.noble@apple.com> [macOS] Adopt AVPlayer.videoRangeOverride https://bugs.webkit.org/show_bug.cgi?id=213902 <rdar://problem/63953509> Reviewed by Youenn Fablet. AVPlayer.videoRangeOverride and also +[AVPlayer preferredVideoRangeForDisplays:] are replacements for the process-global MTShouldPlayHDR() and MTOverrideShouldPlayHDRVideo() and should be used preferentially if present. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::createMediaPlayer): (WebCore::HTMLMediaElement::setPreferredDynamicRangeMode): * html/HTMLMediaElement.h: * page/Page.cpp: (WebCore::Page::screenPropertiesDidChange): (WebCore::Page::windowScreenDidChange): * page/Page.h: * platform/PlatformScreen.h: (WebCore::preferredDynamicRangeMode): * platform/ScreenProperties.h: (WebCore::ScreenData::encode const): (WebCore::ScreenData::decode): * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::setPreferredDynamicRangeMode): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::setPreferredDynamicRangeMode): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::convertDynamicRangeModeEnumToAVVideoRange): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPreferredDynamicRangeMode): * platform/mac/PlatformScreenMac.mm: (WebCore::convertAVVideoRangeToEnum): (WebCore::collectScreenProperties): (WebCore::preferredDynamicRangeMode): 2020-07-22 Jon Davis <jond@apple.com> Update status for Web App Manifest https://bugs.webkit.org/show_bug.cgi?id=204863 Reviewed by Dean Jackson. * features.json: 2020-07-21 Simon Fraser <simon.fraser@apple.com> Scrolling tesla.com on iPad is not smooth https://bugs.webkit.org/show_bug.cgi?id=214627 Reviewed by Tim Horton. This is the iOS equivalent of the fix in r264203; if the user is scrolling (or we're animating for scroll snap), layout should not trigger scroll position changes via computation of the current snap location. To fix this, we need to send data from the UI process to the web process about which scrolling tree nodes the user is scrolling. That's done via RemoteScrollingUIState, which will, in the long term, become a more general UI -> WebProcess scrolling state updating mechanism. For now, it just keeps track of nodes undergoing scroll snap and user scrolls (only the latter is hooked up for now). Test: fast/scrolling/ios/adjust-scroll-snap-during-gesture.html * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::scrollingTreeNodeWillStartPanGesture): (WebCore::ScrollingTree::scrollingTreeNodeWillStartScroll): (WebCore::ScrollingTree::scrollingTreeNodeDidEndScroll): 2020-07-22 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r264691. https://bugs.webkit.org/show_bug.cgi?id=214642 Regressed fast/mediastream/captureStream/canvas3d.html Reverted changeset: "[WebGL2] Implement multiple render target entry points" https://bugs.webkit.org/show_bug.cgi?id=211156 https://trac.webkit.org/changeset/264691 2020-07-22 Youenn Fablet <youenn@apple.com> KeepAlive fetch should not be blocked in pagehide event handlers https://bugs.webkit.org/show_bug.cgi?id=214630 <rdar://problem/65564772> Reviewed by Chris Dumez. Test: http/wpt/fetch/fetch-in-pagehide.html * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): Allow keep alive fetches to proceed similarly to ping loads. 2020-07-22 Geoffrey Garen <ggaren@apple.com> JSRunLoopTimer should use WTF::RunLoop rather than custom CF code https://bugs.webkit.org/show_bug.cgi?id=214102 Unreviewed, re-landing r264242 with crash fixed. Since I was here, I applied Darin's previous review feedback that I had missed. * bindings/js/CommonVM.cpp: (WebCore::commonVMSlow): 2020-07-19 Darin Adler <darin@apple.com> Remove live ranges from Editor.h and EditorClient.h https://bugs.webkit.org/show_bug.cgi?id=214261 Reviewed by Sam Weinig. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::misspellingRange const): Update since rangeForTextCheckingResult no longer returns a live range. (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): Update since rangeOfString no longer returns a live range. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (accessibilityTextOperationForParameterizedAttribute): Use makeSimpleRange. * dom/Document.cpp: (WebCore::acceptsEditingFocus): Use makeRangeSelectingNodeContents since shouldBeginEditing no longer takes a live range. * dom/Range.h: Exxported makeSimpleRange for use outside WebCore. * dom/SimpleRange.cpp: (WebCore::makeSimpleRange): Added. Takes two optional boundary points and returns an optional range. * dom/SimpleRange.h: Added the above. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::timerFired): Removed calls to crateLiveRange since markAllMisspellingsAndBadGrammarInRanges no longer takes live ranges. (WebCore::AlternativeTextController::applyDictationAlternative): Updates since shouldInsertText no longer takes a live range. * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::mergeParagraphs): Updated since shouldMoveRangeAfterDelete no longer takes live ranges. * editing/Editor.cpp: (WebCore::Editor::canDeleteRange const): Updated to not take a live range. (WebCore::Editor::deleteWithDirection): Updated since addRangeToKillRing no longer takes a live range. (WebCore::Editor::pasteAsPlainTextWithPasteboard): Updated since shouldInsertText no longer takes a live range. (WebCore::Editor::shouldInsertFragment): No longer take a live range. (WebCore::Editor::replaceSelectionWithText): Updated since selectedRange no longer returns a live range. (WebCore::Editor::selectedRange): Do not return a live range. (WebCore::Editor::shouldDeleteRange const): Do not take a live range. (WebCore::Editor::shouldInsertText const): Ditto. (WebCore::Editor::shouldApplyStyle): Ditto. Also take a const& to the style instead of a non-const*. (WebCore::Editor::applyStyleToSelection): Pass a style reference and a non-live range. (WebCore::Editor::applyParagraphStyleToSelection): Updated for the change above. (WebCore::Editor::insertTextWithoutSendingTextEvent): No need to pass a live range any more. (WebCore::Editor::insertLineBreak): Ditto. (WebCore::Editor::insertParagraphSeparator): Ditto. (WebCore::Editor::performCutOrCopy): Updated to not use live range. (WebCore::Editor::performDelete): Ditto. (WebCore::Editor::shouldEndEditing): Do not take a live range. (WebCore::Editor::shouldBeginEditing): Ditto. (WebCore::Editor::willWriteSelectionToPasteboard): Ditto. (WebCore::Editor::selectComposition): Update since compositionRange is not a live range. (WebCore::Editor::markMisspellingsAfterTypingToWord): Update since we don't need to pass live ranges to markAllMisspellingsAndBadGrammarInRanges. (WebCore::Editor::markMisspellingsOrBadGrammar): Don't return a live range in tthe out argument. (WebCore::Editor::markMisspellings): Ditto. (WebCore::Editor::markBadGrammar): Update for the above. (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Do not take live ranges for the arguments. (WebCore::Editor::replaceRangeForSpellChecking): Do not take a live range. (WebCore::Editor::markAndReplaceFor): Update since shouldInsertText does not take a live range any more. (WebCore::Editor::changeBackToReplacedString): Update to not use live ranges as much. (WebCore::Editor::markMisspellingsAndBadGrammar): Updae since we don't need to pass live ranges to markAllMisspellingsAndBadGrammarInRanges. (WebCore::Editor::rangeForPoint): Don't return a live range. (WebCore::Editor::compositionRange const): Ditto. (WebCore::Editor::transpose): Updated since we don't pass a live range. (WebCore::Editor::firstRectForRange const): Don't take a live range. (WebCore::Editor::shouldChangeSelection const): Updated since we don't need to pass a live range. (WebCore::Editor::findString): Ditto. (WebCore::start): Added. Helper to make rangeOfString easier to read. (WebCore::end): Ditto. (WebCore::makeBoundaryPointAfterNodeContents): Ditto. (WebCore::makeBoundaryPointAfterNode): Ditto. (WebCore::collapseIfRootsDiffer): Ditto. (WebCore::Editor::rangeOfString): Updated to not take or return a live range and not use it internally either. (WebCore::isFrameInRange): Don't take a live range. (WebCore::Editor::countMatchesForText): Don't take or return live ranges. (WebCore::Editor::contextRangeForCandidateRequest const): Don't return a live range. (WebCore::Editor::rangeForTextCheckingResult const): Ditto. (WebCore::Editor::handleAcceptedCandidate): Update for the above. (WebCore::Editor::adjustedSelectionRange): Don't return a live range. * editing/Editor.h: Updated for all the chagnes above. * editing/EditorCommand.cpp: (WebCore::expandSelectionToGranularity): Updated to reduce the use of live ranges. (WebCore::unionRanges): Updated to no longer take or return a live range. Still uses live ranges in the algorithm for now. (WebCore::executeDeleteToMark): Updated since selectedRange no longer returns a live range. (WebCore::executeSelectToMark): Update to use the new unionRanges. * editing/FrameSelection.cpp: (WebCore::FrameSelection::shouldDeleteSelection const): Updated since shouldDeleteRange no longer requires a live range. * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::getPasteboardTypesAndDataForAttachment): Updated for changes to use fewer live ranges. (WebCore::Editor::writeSelectionToPasteboard): Ditto. (WebCore::Editor::writeSelection): Ditto. (WebCore::Editor::replaceSelectionWithAttributedString): Ditto. * editing/gtk/EditorGtk.cpp: (WebCore::Editor::pasteWithPasteboard): Ditto. * editing/ios/EditorIOS.mm: (WebCore::Editor::writeImageToPasteboard): Ditto. (WebCore::Editor::pasteWithPasteboard): Ditto. * editing/libwpe/EditorLibWPE.cpp: (WebCore::createFragmentFromPasteboardData): Ditto. (WebCore::Editor::pasteWithPasteboard): Ditto. * editing/mac/EditorMac.mm: (WebCore::Editor::pasteWithPasteboard): Ditto. (WebCore::Editor::replaceNodeFromPasteboard): Ditto. (WebCore::Editor::dataSelectionForPasteboard): Ditto. * editing/win/EditorWin.cpp: (WebCore::Editor::pasteWithPasteboard): Ditto. * html/FTPDirectoryDocument.cpp: (WebCore::FTPDirectoryDocumentParser::createTDForFilename): Removed a WTFMove that messes up the return value optimization. Noticed while fixing errors caused by live range changes. * loader/EmptyClients.cpp: Updated for changes to EditorClient. * page/ContextMenuController.cpp: (WebCore::insertUnicodeCharacter): Updated to use fewer live ranges. (WebCore::ContextMenuController::contextMenuItemSelected): DItto. * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): Ditto. (WebCore::DragController::startDrag): Ditto. * page/EditorClient.h: Don't take or return live ranges. * page/EventHandler.cpp: (WebCore::EventHandler::sendContextMenuEventForKey): Simplified since we don't need to use a live range. * page/FocusController.cpp: (WebCore::relinquishesEditingFocus): Changed argument type to be more specific, and changed to not use a live range. (WebCore::FocusController::setFocusedElement): Updated for the above. * page/Frame.cpp: (WebCore::Frame::rangeForPoint): Updated to not use live ranges. * page/Page.cpp: (WebCore::Page::findStringMatchingRanges): Updated to not use live ranges as much. (WebCore::Page::rangeOfString): Ditto. (WebCore::Page::findMatchesForText): Ditto. * testing/Internals.cpp: (WebCore::Internals::rangeOfString): Updated since return value of the Editor member function is no longer a live range. (WebCore::Internals::countMatchesForText): Ditto. 2020-07-21 Kenneth Russell <kbr@chromium.org> [WebGL2] Implement multiple render target entry points https://bugs.webkit.org/show_bug.cgi?id=211156 Reviewed by Myles C. Maxfield. Implement the drawBuffers and clearBuffer entry points. Integrate the clearBuffer APIs with preserveDrawingBuffer:false's auto-clearing. Covered by existing WebGL conformance tests. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::drawBuffers): (WebCore::WebGL2RenderingContext::clearBufferiv): (WebCore::WebGL2RenderingContext::clearBufferuiv): (WebCore::WebGL2RenderingContext::clearBufferfv): (WebCore::WebGL2RenderingContext::clearBufferfi): (WebCore::WebGL2RenderingContext::validateClearBuffer): (WebCore::WebGL2RenderingContext::updateBuffersToAutoClear): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::drawBuffersIfNecessary): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::clearIfComposited): * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::markLayerComposited): (WebCore::GraphicsContextGLOpenGL::drawBuffers): (WebCore::GraphicsContextGLOpenGL::clearBufferiv): (WebCore::GraphicsContextGLOpenGL::clearBufferuiv): (WebCore::GraphicsContextGLOpenGL::clearBufferfv): (WebCore::GraphicsContextGLOpenGL::clearBufferfi): * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: (WebCore::GraphicsContextGLOpenGL::resetBuffersToAutoClear): (WebCore::GraphicsContextGLOpenGL::setBuffersToAutoClear): (WebCore::GraphicsContextGLOpenGL::getBuffersToAutoClear const): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::markLayerComposited): (WebCore::GraphicsContextGLOpenGL::drawBuffers): 2020-07-21 Wenson Hsieh <wenson_hsieh@apple.com> REGRESSION (r258871): Shift + click to extend selection loses currently selected text https://bugs.webkit.org/show_bug.cgi?id=214617 <rdar://problem/64980223> Reviewed by Megan Gardner. After the changes in r258871, shift clicking sometimes fails to preserve the existing selected text range on macOS and iOS. The logic in `EventHandler::handleMousePressEventSingleClick` uses the `textDistance` helper method to count the number of characters between the start of the current selection to the newly selected extent, as well as the number of characters between the end of the current selection and the newly selected extent position. It compares these two character counts, and attempts to choose the new selection extents in such a way that maximizes the amount of selected text. However, after r258871, `textDistance` uses `characterCount` instead of `TextIterator::rangeLength`. Unlike the former, `rangeLength` is robust in the case where the start position comes after the end position (in document order), since the process of creating a live `Range` object swaps the start and end if needed. This isn't the case when using `SimpleRange`. Instead, when given a simple range where the start comes after the end, `characterCount` will iterate text in the DOM, starting from the start position and ending at the end of the document rather than the end position. The result is that `characterCount` actually counts the number of characters between the start position and the end of the document, rather than the number of characters between the two positions. In the context of this bug, if the start of the current selection is "far away" (in terms of character count) from the end of the document and the new extent position comes after end of the current selection, we will end up choosing the end (instead of the start) as one of the new extents of the updated selection. To fix this (as well as other similar issues that might've arisen when replacing uses of `TextIterator::rangeLength` with `characterCount`), simply teach `characterCount` to flip the start and end positions if the end position of the `SimpleRange` comes before the start. Test: editing/selection/shift-click-includes-existing-selection.html * editing/TextIterator.cpp: (WebCore::characterCount): 2020-07-21 Alex Christensen <achristensen@webkit.org> Fix Windows build. https://bugs.webkit.org/show_bug.cgi?id=214623 * platform/network/curl/CertificateInfo.h: * platform/network/curl/CertificateInfoCurl.cpp: (WebCore::CertificateInfo::summary const): (WebCore::CertificateInfo::summaryInfo const): Deleted. 2020-07-21 Alex Christensen <achristensen@webkit.org> Remove unneeded CertificateInfoBase https://bugs.webkit.org/show_bug.cgi?id=214623 Reviewed by Brady Eidson. I need to make CertificateInfo::isolatedCopy and this class was making it messy. It has no shared functionality, so I removed it. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse): * platform/network/CertificateInfoBase.h: Removed. * platform/network/CertificateSummary.h: Copied from Source/WebCore/platform/network/CertificateInfoBase.h. (WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const): Deleted. (WebCore::CertificateInfoBase::summaryInfo const): Deleted. (WebCore::CertificateInfoBase::isEmpty const): Deleted. * platform/network/cf/CertificateInfo.h: * platform/network/cf/CertificateInfoCFNet.cpp: (WebCore::CertificateInfo::summary const): (WebCore::CertificateInfo::summaryInfo const): Deleted. * platform/network/curl/CertificateInfo.h: * platform/network/soup/CertificateInfo.h: (WebCore::CertificateInfo::summary const): (WebCore::CertificateInfo::summaryInfo const): Deleted. 2020-07-21 Jer Noble <jer.noble@apple.com> [Cocoa] Add experimental MSE WebM parser https://bugs.webkit.org/show_bug.cgi?id=214529 Reviewed by Eric Carlson. Test: media/media-source/media-source-webm.html Add an experimental MSE WebM parser to SourceBufferPrivateAVFObjC. This will require extensive refactoring of SourceBufferPrivateAVFObjC, to extract out the parser into a new, virtualized class. This new parser can take advantage of new C++>11 features such as lambdas to clean up some problematic existing code. The new virtualized SourceBufferParser class uses passed-in Function objects, rather than pure-virtual Client classes to notify it's parent object when the parser encounters initialization- or media-data. Because SourceBufferPrivateAVFObjC will now have to deal with AudioTrackPrivate and VideoTrackPrivate objects that are not necessarily Audio- and VideoTrackPrivateMediaSourceAVFObjC subclasses, move those classes notification features up into Audio- and VideoTrackPrivate, again using a Function object rather than a client class. Add a new SourceBufferParserWebM and associated AudioTrackPrivateWebM and VideoTrackPrivateWebM classes, which use libwebm via libwebrtc to parse appended buffers. SourceBufferParserWebM feeds passed-in data into a libwebm-provided parser of its own. It then builds up tracks and samples based on callbacks from that same parser, constructing CMSampleBuffers and VideoTrackPrivate objects out of the underlying libwebm primitives. Because WebM uses a UUID as its track identifier, the representation of a "trackID" inside WebCore must be increased from an int to a uint64_t, or trackIDs will be truncated or zeroed when passed between classes and when converted to and from AtomStrings. This early implementation is not yet able to pass the WebM WPT media-source/ tests, as we only have a VP9 decoder available, and those tests use both VP8 and Vorbis. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebMParserEnabled): (WebCore::RuntimeEnabledFeatures::webMParserEnabled const): * platform/graphics/AudioTrackPrivate.h: (WebCore::AudioTrackPrivate::setEnabled): (WebCore::AudioTrackPrivate::setEnabledChangedCallback): * platform/graphics/VP9Utilities.cpp: (WebCore::isValidVPColorPrimaries): (WebCore::isValidVPTransferCharacteristics): (WebCore::isValidVPMatrixCoefficients): (WebCore::parseVPCodecParameters): * platform/graphics/VP9Utilities.h: * platform/graphics/VideoTrackPrivate.h: (WebCore::VideoTrackPrivate::setSelected): (WebCore::VideoTrackPrivate::setSelectedChangedCallback): * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp: (WebCore::AudioTrackPrivateMediaSourceAVFObjC::AudioTrackPrivateMediaSourceAVFObjC): (WebCore::AudioTrackPrivateMediaSourceAVFObjC::setEnabled): * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: (WebCore::CDMSessionAVContentKeySession::update): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: (WebCore::MediaSampleAVFObjC::create): (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.h: Added. (isType): * platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm: Added. (-[WebAVStreamDataParserListener initWithParser:parent:]): (-[WebAVStreamDataParserListener dealloc]): (-[WebAVStreamDataParserListener invalidate]): (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]): (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]): (-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]): (-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]): (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]): (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]): (WebCore::SourceBufferParserAVFObjC::isContentTypeSupported): (WebCore::SourceBufferParserAVFObjC::SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::~SourceBufferParserAVFObjC): (WebCore::SourceBufferParserAVFObjC::appendData): (WebCore::SourceBufferParserAVFObjC::flushPendingMediaData): (WebCore::SourceBufferParserAVFObjC::setShouldProvideMediaDataForTrackID): (WebCore::SourceBufferParserAVFObjC::shouldProvideMediadataForTrackID): (WebCore::SourceBufferParserAVFObjC::resetParserState): (WebCore::SourceBufferParserAVFObjC::didParseStreamDataAsAsset): (WebCore::SourceBufferParserAVFObjC::didFailToParseStreamDataWithError): (WebCore::SourceBufferParserAVFObjC::didProvideMediaDataForTrackID): (WebCore::SourceBufferParserAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferParserAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::create): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData): (WebCore::SourceBufferPrivateAVFObjC::didEncounterErrorDuringParsing): (WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::append): (WebCore::SourceBufferPrivateAVFObjC::appendCompleted): (WebCore::SourceBufferPrivateAVFObjC::abort): (WebCore::SourceBufferPrivateAVFObjC::resetParserState): (WebCore::SourceBufferPrivateAVFObjC::destroyParser): (WebCore::SourceBufferPrivateAVFObjC::clearTracks): (WebCore::SourceBufferPrivateAVFObjC::hasSelectedVideo const): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeSelected): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::SourceBufferPrivateAVFObjC::parser const): (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt): (WebCore::SourceBufferPrivateAVFObjC::flush): (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): (WebCore::SourceBufferPrivateAVFObjC::canSetMinimumUpcomingPresentationTime const): * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm: (WebCore::VideoTrackPrivateMediaSourceAVFObjC::VideoTrackPrivateMediaSourceAVFObjC): * platform/graphics/cocoa/AudioTrackPrivateWebM.cpp: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. (WebCore::AudioTrackPrivateWebM::create): (WebCore::AudioTrackPrivateWebM::AudioTrackPrivateWebM): (WebCore::AudioTrackPrivateWebM::id const): (WebCore::AudioTrackPrivateWebM::label const): (WebCore::AudioTrackPrivateWebM::language const): (WebCore::AudioTrackPrivateWebM::trackIndex const): * platform/graphics/cocoa/AudioTrackPrivateWebM.h: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. * platform/graphics/cocoa/SourceBufferParser.cpp: Copied from Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.h. (WebCore::SourceBufferParser::isContentTypeSupported): (WebCore::SourceBufferParser::create): * platform/graphics/cocoa/SourceBufferParser.h: Added. (WebCore::SourceBufferParser::setDidParseInitializationDataCallback): (WebCore::SourceBufferParser::setDidEncounterErrorDuringParsingCallback): (WebCore::SourceBufferParser::setDidProvideMediaDataCallback): (WebCore::SourceBufferParser::setWillProvideContentKeyRequestInitializationDataForTrackIDCallback): (WebCore::SourceBufferParser::setDidProvideContentKeyRequestInitializationDataForTrackIDCallback): * platform/graphics/cocoa/SourceBufferParserWebM.cpp: Added. (WebCore::isWebmParserAvailable): (WebCore::SourceBufferParserWebM::isContentTypeSupported): (WebCore::SourceBufferParserWebM::SourceBufferParserWebM): (WebCore::SourceBufferParserWebM::appendData): (WebCore::SourceBufferParserWebM::flushPendingMediaData): (WebCore::SourceBufferParserWebM::setShouldProvideMediaDataForTrackID): (WebCore::SourceBufferParserWebM::shouldProvideMediadataForTrackID): (WebCore::SourceBufferParserWebM::resetParserState): (WebCore::SourceBufferParserWebM::trackDataForTrackNumber): (WebCore::SourceBufferParserWebM::OnElementBegin): (WebCore::SourceBufferParserWebM::OnEbml): (WebCore::SourceBufferParserWebM::OnSegmentBegin): (WebCore::SourceBufferParserWebM::OnInfo): (WebCore::SourceBufferParserWebM::OnClusterBegin): (WebCore::SourceBufferParserWebM::OnTrackEntry): (WebCore::SourceBufferParserWebM::OnBlockBegin): (WebCore::SourceBufferParserWebM::OnBlockEnd): (WebCore::SourceBufferParserWebM::OnSimpleBlockBegin): (WebCore::SourceBufferParserWebM::OnSimpleBlockEnd): (WebCore::SourceBufferParserWebM::OnBlockGroupBegin): (WebCore::SourceBufferParserWebM::OnBlockGroupEnd): (WebCore::convertToColorPrimaries): (WebCore::convertToTransferCharacteristics): (WebCore::convertToMatrixCoefficients): (WebCore::convertSubsamplingXYToChromaSubsampling): (WebCore::createFormatDescriptionFromVP9HeaderParser): (WebCore::SourceBufferParserWebM::OnFrame): * platform/graphics/cocoa/SourceBufferParserWebM.h: Added. (WebCore::SourceBufferParserWebM::status const): (WebCore::SourceBufferParserWebM::type const): (isType): * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::isVP9DecoderAvailable): (WebCore::validateVPParameters): * platform/graphics/cocoa/VideoTrackPrivateWebM.cpp: (WebCore::VideoTrackPrivateWebM::create): (WebCore::VideoTrackPrivateWebM::VideoTrackPrivateWebM): (WebCore::VideoTrackPrivateWebM::id const): (WebCore::VideoTrackPrivateWebM::label const): (WebCore::VideoTrackPrivateWebM::language const): (WebCore::VideoTrackPrivateWebM::trackIndex const): * platform/graphics/cocoa/VideoTrackPrivateWebM.h: 2020-07-21 Peng Liu <peng.liu6@apple.com> Safari is unresponsive after playing a video of youtube.com playlist in picture-in-picture mode https://bugs.webkit.org/show_bug.cgi?id=214616 Reviewed by Eric Carlson. Remove the function setPreparedToReturnVideoLayerToInline() from MediaControlsHost.idl and replace all the calls to that function in Javascript code with a call in HTMLVideoElement::fullscreenModeChanged(). Calling setPreparedToReturnVideoLayerToInline() in the Javascript code of modern media controls can be problematic because the host object might have been destroyed when the webkitpresentationmodechanged event is fired. During the exit fullscreen/picture-in-picture transaction, missing a call to setPreparedToReturnVideoLayerToInline() will block the transaction, and the UI process will be stuck in a bad state. * Modules/mediacontrols/MediaControlsHost.cpp: (WebCore::MediaControlsHost::setPreparedToReturnVideoLayerToInline): Deleted. * Modules/mediacontrols/MediaControlsHost.h: * Modules/mediacontrols/MediaControlsHost.idl: * Modules/mediacontrols/mediaControlsApple.js: (Controller.prototype.handlePresentationModeChange): * Modules/modern-media-controls/media/media-controller.js: (MediaController.prototype.handleEvent): (MediaController.prototype._returnMediaLayerToInlineIfNeeded): Deleted. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::fullscreenModeChanged): 2020-07-21 Tim Horton <timothy_horton@apple.com> REGRESSION (WebSQL disablement): Fudget app is unresponsive on launch https://bugs.webkit.org/show_bug.cgi?id=214620 <rdar://problem/65443085> Reviewed by Geoffrey Garen. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isFudget): 2020-07-21 Michael Catanzaro <mcatanzaro@gnome.org> Update Chrome and Firefox versions in user agent quirks https://bugs.webkit.org/show_bug.cgi?id=214595 Reviewed by Adrian Perez de Castro. * platform/UserAgentQuirks.cpp: (WebCore::UserAgentQuirks::stringForQuirk): 2020-07-21 Yusuke Suzuki <ysuzuki@apple.com> Use CatchScope in microtask execution https://bugs.webkit.org/show_bug.cgi?id=214600 <rdar://problem/65881165> Reviewed by Mark Lam. Test: js/dom/microtask-drain-should-use-catch-scope.html Use CatchScope to suppress JSC_validateExceptionChecks. * bindings/js/JSMicrotaskCallback.h: (WebCore::JSMicrotaskCallback::call): 2020-07-21 Eric Carlson <eric.carlson@apple.com> Use AVRoutePickerView when available for choosing AirPlay devices https://bugs.webkit.org/show_bug.cgi?id=213497 <rdar://problem/58610662> Reviewed by Jer Noble. Use an AVRoutePickerView, the replacement for AVOutputDeviceMenuController, when it is available to allow a user to pick an AirPlay device. To do this, create an AVPlaybackTargetPicker abstract base and create a concrete class from the AVOutputDeviceMenuController-specific code from MediaPlaybackTargetPickerMac, and create a new concrete class using AVRoutePickerView. Tested manually because these changes require an AirPlay device. * Modules/mediasession/WebMediaSessionManager.cpp: (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Pass the view to the target picker. * Modules/mediasession/WebMediaSessionManagerClient.h: * Modules/remoteplayback/RemotePlayback.cpp: (WebCore::RemotePlayback::playbackTargetPickerWasDismissed): Drive-by fix: return early if there are no pending promises. * SourcesCocoa.txt: Add new files. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/graphics/MediaPlaybackTargetPicker.cpp: (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker): Add new parameter. * platform/graphics/MediaPlaybackTargetPicker.h: * platform/graphics/avfoundation/objc/AVOutputDeviceMenuControllerTargetPicker.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h. * platform/graphics/avfoundation/objc/AVOutputDeviceMenuControllerTargetPicker.mm: Copied from Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm. (WebCore::AVOutputDeviceMenuControllerTargetPicker::AVOutputDeviceMenuControllerTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::~AVOutputDeviceMenuControllerTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::devicePicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::availableDevicesDidChange): (WebCore::AVOutputDeviceMenuControllerTargetPicker::currentDeviceDidChange): (WebCore::AVOutputDeviceMenuControllerTargetPicker::showPlaybackTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::startingMonitoringPlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::stopMonitoringPlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::invalidatePlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::externalOutputDeviceAvailable): (WebCore::AVOutputDeviceMenuControllerTargetPicker::outputContext): (-[WebAVOutputDeviceMenuControllerHelper initWithCallback:]): (-[WebAVOutputDeviceMenuControllerHelper clearCallback]): (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): * platform/graphics/avfoundation/objc/AVPlaybackTargetPicker.h: Added. (WebCore::AVPlaybackTargetPicker::AVPlaybackTargetPicker): (WebCore::AVPlaybackTargetPicker::client const): * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.h: Added. * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.mm: Added. (WebCore::AVRoutePickerViewTargetPicker::isAvailable): (WebCore::AVRoutePickerViewTargetPicker::AVRoutePickerViewTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::~AVRoutePickerViewTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::outputContextInternal): (WebCore::AVRoutePickerViewTargetPicker::devicePicker): (WebCore::AVRoutePickerViewTargetPicker::routeDetector): (WebCore::AVRoutePickerViewTargetPicker::showPlaybackTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::startingMonitoringPlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::stopMonitoringPlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::externalOutputDeviceAvailable): (WebCore::AVRoutePickerViewTargetPicker::outputContext): (WebCore::AVRoutePickerViewTargetPicker::invalidatePlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::availableDevicesDidChange): (WebCore::AVRoutePickerViewTargetPicker::currentDeviceDidChange): (WebCore::AVRoutePickerViewTargetPicker::devicePickerWasDismissed): (-[WebAVRoutePickerViewHelper initWithCallback:]): (-[WebAVRoutePickerViewHelper dealloc]): (-[WebAVRoutePickerViewHelper clearCallback]): (-[WebAVRoutePickerViewHelper routePickerViewDidEndPresentingRoutes:]): (-[WebAVRoutePickerViewHelper notificationHandler:]): * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac): (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac): (WebCore::MediaPlaybackTargetPickerMac::externalOutputDeviceAvailable): (WebCore::MediaPlaybackTargetPickerMac::playbackTarget): (WebCore::MediaPlaybackTargetPickerMac::routePicker): (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): (WebCore::MediaPlaybackTargetPickerMac::startingMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::invalidatePlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::pickerWasDismissed): (WebCore::MediaPlaybackTargetPickerMac::availableDevicesChanged): (WebCore::MediaPlaybackTargetPickerMac::currentDeviceChanged): (WebCore::MediaPlaybackTargetPickerMac::devicePicker): Deleted. (-[WebAVOutputDeviceMenuControllerHelper initWithCallback:]): Deleted. (-[WebAVOutputDeviceMenuControllerHelper clearCallback]): Deleted. (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): Deleted. * platform/mock/MediaPlaybackTargetPickerMock.cpp: (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker): * platform/mock/MediaPlaybackTargetPickerMock.h: 2020-07-21 James Darpinian <jdarpinian@chromium.org> webgl/2.0.0/conformance2/state/gl-object-get-calls.html results appears to show an out of bounds access bug. https://bugs.webkit.org/show_bug.cgi?id=214557 Reviewed by Myles C. Maxfield. The WebGL 2 function getActiveUniformBlockName was accidentally untested because an unrelated bug caused the test to exit before reaching the part that tested it. The other bug is fixed now, and this change fixes getActiveUniformBlockName to actually work. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getActiveUniformBlockName): * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockName): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockName): 2020-07-21 Sihui Liu <sihui_liu@appe.com> REGRESSION(r264486): ASSERTION FAILED: ASSERT_NOT_REACHED() in NetworkProcessPlatformStrategies::createBlobRegistry https://bugs.webkit.org/show_bug.cgi?id=214425 Reviewed by Youenn Fablet. In SerializedScriptValue.cpp, some kind of wrappers will not be created when global object is not JSDOMGlobalObject, so they would not be created for IDB before r264486. After r264486, IDB uses JSIDBSerializationGlobalObject, which is JSDOMGlobalObject, so those wrappers start to be created. To restore the old behavior, adding checks for JSIDBSerializationGlobalObject in SerializedScriptValue.cpp. Modify and re-enable test: LayoutTests/storage/indexeddb/structured-clone.html * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::CloneDeserializer::readFile): (WebCore::CloneDeserializer::readRTCCertificate): (WebCore::CloneDeserializer::readTerminal): 2020-07-21 Jer Noble <jer.noble@apple.com> [Cocoa] Adopt VTRegisterSupplementalVideoDecoderIfAvailable https://bugs.webkit.org/show_bug.cgi?id=214585 <rdar://problem/65863651> Reviewed by Youenn Fablet. * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/VideoToolboxSoftLink.cpp: * platform/cocoa/VideoToolboxSoftLink.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.h: * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: (WebCore::registerSupplementalVP9Decoder): 2020-07-21 Zalan Bujtas <zalan@apple.com> [UI Events] Make mousemove cancelable https://bugs.webkit.org/show_bug.cgi?id=214513 <rdar://problem/64267520> Reviewed by Simon Fraser. This patch makes the mousemove event cancelable. The event was initially specified to be non-cancelable in DOM Level 2 Events, but was changed to reflect existing interoperability between browsers. The most user facing behavior change here is that when the mousemove event is prevent-defaulted (canceled) content selection is not possible. Chrome is aligned with the latest version of the spec, the mousemove event is cancelable. However they also have a TODO right at where the drag would happen: // TODO(crbug.com/346473): Since there is no default action for the mousemove // event we should consider doing drag&drop even when js cancels the // mouse move event. Firefox preforms the drag(select) operation but not sure if it’s because their mousemove event is still non-cancelable or whether they already went ahead with what the TODO says. Test: fast/text/selection-is-prevent-defaulted.html * dom/MouseEvent.cpp: (WebCore::MouseEvent::create): 2020-07-21 Clark Wang <clark_wang@apple.com> Added OfflineAudioContext constructor https://bugs.webkit.org/show_bug.cgi?id=214577 Reviewed by Chris Dumez. Added OfflineAudioContext constructor and OfflineAudioContextOptions files. Re-baselined existing tests. Lots of failures that fail because of unsupported sampleRate range. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::create): * Modules/webaudio/OfflineAudioContext.h: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webaudio/OfflineAudioContextOptions.h: Added. * Modules/webaudio/OfflineAudioContextOptions.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-21 Rob Buis <rbuis@igalia.com> Make AnyStepHandling an enum class https://bugs.webkit.org/show_bug.cgi?id=214423 Reviewed by Darin Adler. Correct some post commit comments. * html/HTMLInputElement.h: * html/InputType.h: * html/StepRange.h: 2020-07-21 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer][1.18] mediastreamsrc element hits assert in gst -core https://bugs.webkit.org/show_bug.cgi?id=214150 Reviewed by Philippe Normand. Removed track pointers from observers cause the object was self-referencing a couple of times. Observers are 1-1 with the source so there is no need to keep an owned reference and there is no danger of incorrect dereferencing. Turned finalize into dispose as the work is doing is more removing the references with other objects, which what the dispose is about. Called the parent on that, which as missing as well. * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (WebKitMediaStreamTrackObserver::WebKitMediaStreamTrackObserver): (WebKitMediaStreamObserver::WebKitMediaStreamObserver): (webkitMediaStreamSrcConstructed): (webkitMediaStreamSrcDispose): (webkit_media_stream_src_class_init): 2020-07-21 Carlos Garcia Campos <cgarcia@igalia.com> [FreeType] Add support for text-underline-offset and text-decoration-thickness https://bugs.webkit.org/show_bug.cgi?id=214550 Reviewed by Adrian Perez de Castro. Get the underline position and thickness from the font if it's scalable and set them in font metrics. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::scaledFontScaleFactor): (WebCore::fontUnitsPerEm): (WebCore::Font::platformInit): 2020-07-21 Carlos Garcia Campos <cgarcia@igalia.com> [GTK][WPE] imported blink large gradient tests are crashing on debug builds https://bugs.webkit.org/show_bug.cgi?id=214192 Reviewed by Žan Doberšek. The assert is: ASSERT(cairo_surface_status(m_surface.get()) == CAIRO_STATUS_SUCCESS); and the status we are getting is CAIRO_STATUS_INVALID_SIZE, because we are reaching the cairo image size limit. We should check the size before trying to create the image surface. This patch fixes the crash, but not the tests themselves that will still fail due to the cairo limitation. * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp: (WebCore::ImageBufferCairoImageSurfaceBackend::create): Return early if the image size is bigger than the maximum allowed by cairo. 2020-07-20 Alex Christensen <achristensen@webkit.org> Revert r262776 for existing apps using UIWebView/WebView https://bugs.webkit.org/show_bug.cgi?id=214528 <rdar://problem/65468982> Reviewed by Tim Horton. r262776 removed Content-Type: application/x-www-form-urlencoded from POST requests with unspecified content type. This matches the behavior of Chrome, Firefox, and WKWebView and is a change we want to make. This doesn't match behavior of iOS 13 UIWebView, though, and given its state of being supported for compatibility until removed, we are going to keep it behaving as it always has. Updated WK1 test expectations. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]): 2020-07-20 Peng Liu <peng.liu6@apple.com> An airplaying video can enter picture-in-picture https://bugs.webkit.org/show_bug.cgi?id=214556 Reviewed by Eric Carlson. WebAVPlayerController replaces the AVPlayerController used by AVKit. Its property "pictureInPicturePossible" will always be YES after VideoFullscreenInterfaceAVKit::doSetup() sets it, even after the video enters picture-in-picture. This patch fixes the issue by checking whether the video is airplaying (isExternalPlaybackActive) in -[WebAVPlayerController isPictureInPicturePossible]. AVPlayerController has the logic to change the property "pictureInPicturePossible" to NO after a video enters picture-in-picture, but we cannot use AVPlayerController's value of "pictureInPicturePossible" as the property value of WebAVPlayerController. Because the value of "-[AVPlayerController isPictureInPicturePossible]" depends on the value of "[[AVAudioSession sharedInstance] isPiPAvailable]", which is always NO in the UI process. (AVAudioSession related code is in the web process). * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::doSetup): * platform/ios/WebAVPlayerController.h: * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController setAllowsPictureInPicture:]): (-[WebAVPlayerController isPictureInPicturePossible]): 2020-07-20 Megan Gardner <megan_gardner@apple.com> Add OK button to Date/Time form controls. https://bugs.webkit.org/show_bug.cgi?id=214195 Reviewed by Darin Adler. * en.lproj/Localizable.strings: 2020-07-20 Geoffrey Garen <ggaren@apple.com> REGRESSION (r264242): [ macOS ] imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate.any.html is a flaky crash https://bugs.webkit.org/show_bug.cgi?id=214572 Unreviewed, reverting r264242. * bindings/js/CommonVM.cpp: (WebCore::commonVMSlow): 2020-07-20 Adrian Perez de Castro <aperez@igalia.com> Non unified build fixes, midsummer 2020 edition https://bugs.webkit.org/show_bug.cgi?id=213616 Unreviewed build fix. No new tests needed. * inspector/InspectorInstrumentationWebKit.h: Forward-declare ResourceLoader class. 2020-07-20 Wenson Hsieh <wenson_hsieh@apple.com> REGRESSION (r261874): Typing near the bottom of a scrollable document causes the scroll position to jump https://bugs.webkit.org/show_bug.cgi?id=214426 <rdar://problem/65302701> Reviewed by Simon Fraser. After the changes in r261874, any content size changes that trigger `FrameView::adjustViewSize` cause the scroll position to be clamped to its minimum and maximum limits after the next layout pass. In the context of edit commands, this means that the scroll position may jump erratically, since many edit commands can temporarily leave the DOM in a state where the content size is unstable. For example, in the test case below, deleting the only character in a div element on its own line first involves emptying the text node underneath the div (causing it to have no height), before inserting a BR element in its place (which restores a nonzero height). After the text node is emptied (but before we insert the BR element), the content size of view changes due to a layout update while creating visible positions (under `VisiblePosition::canonicalPosition`). If we happen to be scrolled all the way to the bottom of the main frame, this means we'll scroll up, due to the maximum scroll position temporarily decreasing. A similar effect happens when inserting the first character on a line, wherein the div is empty after BR element is removed but before it is replaced with a text node. To mitigate this, introduce a mechanism to temporarily avoid updating the scroll position, and use it when executing edit commands. See below for more details. Test: editing/execCommand/typing-should-not-trigger-scrolling-when-selection-is-visible.html * editing/CompositeEditCommand.cpp: (WebCore::EditCommandComposition::unapply): (WebCore::EditCommandComposition::reapply): (WebCore::CompositeEditCommand::apply): * editing/Editor.cpp: (WebCore::Editor::willApplyEditing const): (WebCore::Editor::appliedEditing): Add logic to specifically handle typing commands here, since we handle typing commands by adding them to the latest "open" typing command, rather than go through the more standard codepaths in EditCommandComposition above. * editing/Editor.h: * page/FrameView.cpp: (WebCore::FrameView::reset): (WebCore::FrameView::topContentDirectionDidChange): (WebCore::FrameView::handleDeferredScrollbarsUpdate): (WebCore::FrameView::handleDeferredPositionScrollbarLayers): Split existing logic for handling deferred scrollbar updates and deferred calls to `positionScrollbarLayers` into two separate methods, with separate boolean flags. `topContentDirectionDidChange` sets both of these flags (which preserves existing behavior), while `decrementProhibitsScrollingWhenChangingContentSizeCount` just requests a scrollbar update. (WebCore::FrameView::didLayout): (WebCore::FrameView::didFinishProhibitingScrollingWhenChangingContentSize): After decrementing `m_prohibitsScrollingWhenChangingContentSizeCount` back to zero, ensure that the scroll position ultimately remains clamped to the minimum and maximum values by either immediately calling `updateScrollbars` with the current scroll position if layout and style are up to date, or by scheduling a deferred scrollbar update if that is not the case. (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange): Deleted. Rename this to just `handleDeferredScrollbarsUpdate`. * page/FrameView.h: * platform/ScrollView.cpp: (WebCore::ScrollView::setContentsSize): (WebCore::ScrollView::prohibitScrollingWhenChangingContentSizeForScope): (WebCore::ScrollView::ProhibitScrollingWhenChangingContentSizeForScope::ProhibitScrollingWhenChangingContentSizeForScope): (WebCore::ScrollView::ProhibitScrollingWhenChangingContentSizeForScope::~ProhibitScrollingWhenChangingContentSizeForScope): Introduce a new token object, `ProhibitScrollingWhenChangingContentSizeForScope`, which increments a count on `ScrollView` when created and decrements the count when destroyed. While this counter is greater than zero, we will avoid scrolling as a result of changing content size. * platform/ScrollView.h: (WebCore::ScrollView::incrementProhibitsScrollingWhenChangingContentSizeCount): (WebCore::ScrollView::decrementProhibitsScrollingWhenChangingContentSizeCount): 2020-07-20 Said Abou-Hallawa <sabouhallawa@apple.com> CSS clip-path is applied to the <svg> root element in the view-box coordinates https://bugs.webkit.org/show_bug.cgi?id=214418 Reviewed by Darin Adler. We need to transfer the bounding box of the SVG element renderer from the SVG coordinates system to the CSS coordinates before calculating the clip path. Then we need to transfer the clip path back to the SVG coordinates before applying it to the GraphicsContext. The GraphicsContext is already transformed by the localToPrentTransform. Test: svg/in-html/svg-view-box-css-clip-path.html * rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::clipContextToCSSClippingArea): 2020-07-20 Clark Wang <clark_wang@apple.com> Fixes to match BaseAudioContext.idl to spec https://bugs.webkit.org/show_bug.cgi?id=214487 Reviewed by Chris Dumez. Removed unrestricted keyword from certain attributes and parameters in BaseAudioContext. Changed createPanner to call new PannerNode constructor, removed old PannerNode constructor. Re-baselined existing tests that now pass. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::createPanner): * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/PannerNode.cpp: * Modules/webaudio/PannerNode.h: 2020-07-20 Keith Miller <keith_miller@apple.com> Add support for FinalizationRegistries https://bugs.webkit.org/show_bug.cgi?id=199888 Reviewed by Yusuke Suzuki. Refactor things for changing PromiseDeferredTimer to DeferredWorkTimer. Also, add globalObject hook for reporting uncaught exceptions from JSC's runloop callbacks. * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::reportUncaughtExceptionAtEventLoop): * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::compileStreaming): (WebCore::JSDOMWindowBase::instantiateStreaming): * bindings/js/JSWorkerGlobalScopeBase.cpp: * bindings/js/JSWorkletGlobalScopeBase.cpp: * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::addTimerSetNotification): (WebCore::WorkerScriptController::removeTimerSetNotification): * workers/WorkerRunLoop.cpp: * worklets/WorkletScriptController.cpp: 2020-07-20 Said Abou-Hallawa <sabouhallawa@apple.com> [CG] Flushing ImageBuffer IOSurface cached image can happen when creating an image for encoding only https://bugs.webkit.org/show_bug.cgi?id=214515 <rdar://problem/65735991> Reviewed by Simon Fraser. Drawing an empty rectangle after changing the bytes of the IOSurface was a hack to force CG to regenerate the IOSurface cached image. This hack was added to solve the bug in which we were getting stale data url from the ImageBuffer after calling its putImageData() function. Drawing the ImageBuffer to a GraphicsContext or getting its data url starts by getting a native image from the IOSurface. The stale cached image problem was seen only in getting the data url but when not drawing the ImageBuffer. So to save the cost of flushing the cached image, we will delay doing the empty rectangle hack till toCFData() is called. toCFData() is called for all ImageBuffer data retrieval functions including toDataURL(). This gives a 15% progression to the Images test on MacBookPro15,2 because the Images test does not call toDataURL() so it does not require flushing the IOSurface cached image. It calls getImageData(), alter the image data and then calls putImageData(). * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: (WebCore::ImageBufferIOSurfaceBackend::toCFData const): (WebCore::ImageBufferIOSurfaceBackend::putImageData): * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: 2020-07-20 Darin Adler <darin@apple.com> Streamline URLDecomposition::setHash https://bugs.webkit.org/show_bug.cgi?id=214561 Reviewed by Anders Carlsson. * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setHash): No need to cast to StringView since we already have a StringView. Also don't need a local variable. 2020-07-20 Darin Adler <darin@apple.com> [Cocoa] MediaSampleAVFObjC::createImageSample depends on function argument evaluation order https://bugs.webkit.org/show_bug.cgi?id=214560 Reviewed by Anders Carlsson. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::deallocateVectorBuffer): Renamed from releaseUint8Vector. (WebCore::MediaSampleAVFObjC::createImageSample): Rearranged code so that we don't call both data() and releaseBuffer() on the same vector in the same function call; that isn't safe because the order of argument evaluation is not guaranteed, and so data() could be called after the buffer is released. Also added code to deallocate the buffer if CVPixelBufferCreateWithBytes fails. The old code would have leaked it in that case. Also made some style tweaks to use adoptCF more consistently to handle reference counting, and slightly optimized a loop to only get the array count once. 2020-07-20 Philippe Normand <pnormand@igalia.com> [GStreamer] Add support for canvas captureStream, tests failing since they were added in r213598 https://bugs.webkit.org/show_bug.cgi?id=169811 Reviewed by Darin Adler. Hook captureStream support in GStreamer ports. The only missing bits were: 1. create a MediaSample from a BGRA buffer 2. convert a MediaSample to a RGBA buffer (used only for layout tests) 3. set video width and height tags not only on video capture tracks (tracks created from captureStream are not GStreamer capture device tracks) * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::toMediaSample): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: Refactor createImageSample to use unsigned for dimensions. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: * platform/graphics/gstreamer/MediaSampleGStreamer.cpp: (WebCore::MediaSampleGStreamer::createImageSample): (WebCore::MediaSampleGStreamer::getRGBAImageData const): * platform/graphics/gstreamer/MediaSampleGStreamer.h: * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (mediaStreamTrackPrivateGetTags): 2020-07-20 Youenn Fablet <youenn@apple.com> GenerateCertificateAsync should be called on signaling thread https://bugs.webkit.org/show_bug.cgi?id=214447 Reviewed by Geoffrey Garen. As per debug assert, GenerateCertificateAsync is expected to be called in the signaling thread. Covered by unskipped test. * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp: (WebCore::LibWebRTCCertificateGenerator::generateCertificate): * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::LibWebRTCProvider::prepareCertificateGenerator): We can pass generator to a background thread as it is allocated once and does not get freed. * platform/mediastream/libwebrtc/LibWebRTCProvider.h: 2020-07-20 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r264596. https://bugs.webkit.org/show_bug.cgi?id=214551 hits Debug asserts Reverted changeset: "[GStreamer] Add support for canvas captureStream, tests failing since they were added in r213598" https://bugs.webkit.org/show_bug.cgi?id=169811 https://trac.webkit.org/changeset/264596 2020-07-20 Rob Buis <rbuis@igalia.com> Make AnyStepHandling an enum class https://bugs.webkit.org/show_bug.cgi?id=214423 Reviewed by Youenn Fablet. Make AnyStepHandling an enum class since this is more readable and allows us to have less includes in header files. * html/BaseDateAndTimeInputType.cpp: * html/DateInputType.cpp: * html/DateTimeLocalInputType.cpp: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setupDateTimeChooserParameters): * html/HTMLInputElement.h: * html/InputType.cpp: (WebCore::InputType::rangeUnderflow const): (WebCore::InputType::rangeOverflow const): (WebCore::InputType::minimum const): (WebCore::InputType::maximum const): (WebCore::InputType::isInRange const): (WebCore::InputType::isOutOfRange const): (WebCore::InputType::stepMismatch const): (WebCore::InputType::validationMessage const): (WebCore::InputType::getAllowedValueStep const): (WebCore::InputType::stepUp): (WebCore::InputType::stepUpFromRenderer): * html/InputType.h: * html/MonthInputType.cpp: * html/NumberInputType.cpp: * html/RangeInputType.cpp: (WebCore::RangeInputType::handleKeydownEvent): (WebCore::RangeInputType::fallbackValue const): (WebCore::RangeInputType::sanitizeValue const): * html/StepRange.cpp: (WebCore::StepRange::parseStep): * html/StepRange.h: * html/TimeInputType.cpp: * html/WeekInputType.cpp: * html/shadow/SliderThumbElement.cpp: (WebCore::sliderPosition): (WebCore::SliderThumbElement::setPositionFromPoint): 2020-07-20 Rob Buis <rbuis@igalia.com> Setting URL.hash to '#' should set empty fragment https://bugs.webkit.org/show_bug.cgi?id=214318 Reviewed by Youenn Fablet. Setting URL.hash to '#' should set empty fragment identifier [1], unlike setting it to the empty string which drops the fragment identifier. Behavior matches Chrome and Firefox. [1] https://html.spec.whatwg.org/#dom-hyperlink-hash Test: imported/w3c/web-platform-tests/url/url-setters.html * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setHash): 2020-07-20 Philippe Normand <pnormand@igalia.com> [GStreamer] Add support for canvas captureStream, tests failing since they were added in r213598 https://bugs.webkit.org/show_bug.cgi?id=169811 Reviewed by Darin Adler. Hook captureStream support in GStreamer ports. The only missing bits were: 1. create a MediaSample from a BGRA buffer 2. convert a MediaSample to a RGBA buffer (used only for layout tests) 3. set video width and height tags not only on video capture tracks (tracks created from captureStream are not GStreamer capture device tracks) * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::toMediaSample): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: Refactor createImageSample to use unsigned for dimensions. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: * platform/graphics/gstreamer/MediaSampleGStreamer.cpp: (WebCore::MediaSampleGStreamer::createImageSample): (WebCore::MediaSampleGStreamer::getRGBAImageData const): * platform/graphics/gstreamer/MediaSampleGStreamer.h: * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (mediaStreamTrackPrivateGetTags): 2020-07-20 Philippe Normand <pnormand@igalia.com> [GStreamer] ImageDecoder hits more Debug ASSERTs https://bugs.webkit.org/show_bug.cgi?id=214191 Reviewed by Xabier Rodriguez-Calvar. Process decoded video samples from the decoder parent thread, in order to guarantee the underlying RefPtrs stored in the ImageDecoderGStreamerSample keep a consistent owning runloop. * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::InnerDecoder::connectDecoderPad): (WebCore::ImageDecoderGStreamer::setHasEOS): (WebCore::ImageDecoderGStreamer::notifySample): (WebCore::ImageDecoderGStreamer::InnerDecoder::handleMessage): (WebCore::ImageDecoderGStreamer::pushEncodedData): * platform/graphics/gstreamer/ImageDecoderGStreamer.h: 2020-07-20 Fujii Hironori <Hironori.Fujii@sony.com> Use forward template declarations for ColorComponents instead of including ColorComponents.h https://bugs.webkit.org/show_bug.cgi?id=214540 Reviewed by Darin Adler. * platform/graphics/ColorMatrix.h: * platform/graphics/ColorTypes.h: 2020-07-19 Lauro Moura <lmoura@igalia.com> Unreviewed, fix GTK build in Debian/LTS Like r264279, include functional to provide std::invoke. * platform/graphics/ColorUtilities.h: 2020-07-19 Fujii Hironori <Hironori.Fujii@sony.com> Unreviewed, reverting r264588. It broke Mac port. Reverted changeset: "Use forward template declarations for ColorComponents instead of including ColorComponents.h as much as possible" https://bugs.webkit.org/show_bug.cgi?id=214204 https://trac.webkit.org/changeset/264588 2020-07-19 Fujii Hironori <Hironori.Fujii@sony.com> Use forward template declarations for ColorComponents instead of including ColorComponents.h as much as possible https://bugs.webkit.org/show_bug.cgi?id=214204 <rdar://problem/65414170> Unreviewed follow-up for the review feedback of r264289. * platform/graphics/ColorConversion.cpp: * platform/graphics/ColorMatrix.h: * platform/graphics/ColorTypes.h: * platform/graphics/ColorUtilities.h: 2020-07-19 Fujii Hironori <Hironori.Fujii@sony.com> Unreviewed non-unified source build fix * html/canvas/WebGLSync.cpp: * html/canvas/WebGLSync.h: 2020-07-19 Geoffrey Garen <ggaren@apple.com> There should be only one RunLoop Timer class https://bugs.webkit.org/show_bug.cgi?id=214340 Reviewed by Darin Adler. RunLoop::Timer wins. RunLoopTimer loses. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::DocumentLoader): (WebCore::DocumentLoader::tryLoadingSubstituteData): (WebCore::DocumentLoader::cancelMainResourceLoad): (WebCore::DocumentLoader::startDataLoadTimer): Deleted. Use RunLoop::dispatch instead of a timer because we have no need to control the time period or to fire more than once. Use an explicit token so that we can still cancel. * loader/DocumentLoader.h: (WebCore::DocumentLoader::DataLoadToken::clear): Added an explicit token class to we can cancel a data load. * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::loadDataURL): page->scheduledRunLoopPairs() is never null; and if it were null, data loads would always fail. * platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::decode): (WebCore::DataURLDecoder::DecodingResultDispatcher::dispatch): Deleted. (WebCore::DataURLDecoder::DecodingResultDispatcher::DecodingResultDispatcher): Deleted. (WebCore::DataURLDecoder::DecodingResultDispatcher::startTimer): Deleted. (WebCore::DataURLDecoder::DecodingResultDispatcher::timerFired): Deleted. No need for two code paths, now that we can just call RunLoop::dispatch. * platform/network/DataURLDecoder.h: 2020-07-19 Sam Weinig <weinig@apple.com> Rename Color::transparent to Color::transparentBlack to more clearly state what it is https://bugs.webkit.org/show_bug.cgi?id=214522 Reviewed by Darin Adler. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::colorValue const): * accessibility/AccessibilityObject.h: * css/CSSValuePool.cpp: (WebCore::StaticCSSValuePool::StaticCSSValuePool): (WebCore::CSSValuePool::createColorValue): * editing/EditingStyle.cpp: (WebCore::cssValueToColor): * html/HTMLInputElement.cpp: (WebCore::autoFillStrongPasswordMaskImage): * html/InputType.cpp: (WebCore::InputType::valueAsColor const): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::State::State): (WebCore::CanvasRenderingContext2DBase::clearRect): (WebCore::CanvasRenderingContext2DBase::setShadow): (WebCore::CanvasRenderingContext2DBase::clearShadow): (WebCore::CanvasRenderingContext2DBase::applyShadow): * inspector/InspectorOverlay.cpp: (WebCore::drawShapeHighlight): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::parseColor): * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::paintBoxDecoration): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsWindowCSS const): * page/DebugPageOverlays.cpp: (WebCore::drawRightAlignedText): * page/FrameSnapshotting.cpp: (WebCore::snapshotNode): * page/FrameView.cpp: (WebCore::FrameView::recalculateBaseBackgroundColor): * page/PageOverlay.h: * page/TextIndicator.cpp: (WebCore::estimatedBackgroundColorForRange): * page/animation/CSSPropertyAnimation.cpp: (WebCore::shadowForBlending): * platform/graphics/Color.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/cg/ColorCG.cpp: (WebCore::cachedCGColor): * platform/graphics/cg/NativeImageCG.cpp: (WebCore::nativeImageSinglePixelSolidColor): * platform/graphics/filters/FilterOperation.cpp: (WebCore::DropShadowFilterOperation::blend): * platform/graphics/mac/ColorMac.mm: (WebCore::nsColor): * platform/graphics/nicosia/NicosiaPaintingEngineBasic.cpp: (Nicosia::PaintingEngineBasic::paint): * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp: (Nicosia::paintLayer): * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::requestVideoContentLayer): (VideoFullscreenControllerContext::returnVideoContentLayer): (VideoFullscreenControllerContext::didSetupFullscreen): * rendering/RenderImage.cpp: (WebCore::RenderImage::paintIncompleteImageOutline const): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintResizer): * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::paint): * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::platformActiveSelectionBackgroundColor const): (WebCore::RenderThemeIOS::platformInactiveSelectionBackgroundColor const): * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): * rendering/mathml/RenderMathMLMenclose.cpp: (WebCore::RenderMathMLMenclose::paint): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::visitedDependentColor const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialStrokeColor): (WebCore::RenderStyle::initialBackgroundColor): * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyTextOrBoxShadowValue): * style/StyleBuilderState.cpp: (WebCore::Style::BuilderState::createFilterOperations): * svg/SVGStopElement.cpp: (WebCore::SVGStopElement::stopColorIncludingOpacity const): * testing/Internals.cpp: (WebCore::Internals::setViewIsTransparent): (WebCore::Internals::setViewBaseBackgroundColor): Color::transparent to Color::transparentBlack. 2020-07-19 Sam Weinig <weinig@apple.com> Remove ColorBuilder https://bugs.webkit.org/show_bug.cgi?id=214521 Reviewed by Darin Adler. ColorBuilder is unnecessary and just makes deduction contexts more complicated. Instead, we can get the same behavior by having color types inherit from a shared base class ColorType that uses the curiously recurring template pattern, which exposes the colorWithAlphaByte function (renamed from colorWithAlpha for clarity of the parameter). * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: Remove ColorBuilder. * platform/graphics/ColorBuilder.h: Removed. * platform/graphics/Color.cpp: (WebCore::Color::lightened const): * platform/graphics/Color.h: (WebCore::Color::alphaByte const): (WebCore::Color::alpha const): Deleted. Stop using ColorBuilder for color named color types and rename Color::alpha to Color:alphaByte() for consistency with colorWithAlphaByte(). * platform/graphics/ColorTypes.h: (WebCore::ColorType::colorWithAlphaByte const): (WebCore::LinearSRGBA::LinearSRGBA): (WebCore::DisplayP3::DisplayP3): (WebCore::LinearDisplayP3::LinearDisplayP3): (WebCore::HSLA::HSLA): (WebCore::CMYKA::CMYKA): (WebCore::XYZA::XYZA): Switch each color type to inheriting from new ColorWithAlphaHelper struct. Use the opertunity to give each color type the same construction interface as well. Now that each type has constructors, the deduction guides are no longer necessary. * platform/graphics/ColorBlending.cpp: (WebCore::blendSourceOver): Switch from !color.alpha() to !color.isVisible() to more clearly indicate the intent. * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::isDataTable const): Update to call alphaByte() and add FIXME indicating that it is probably incorrect and filed https://bugs.webkit.org/show_bug.cgi?id=214537 to track things further. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::createInnerTextStyle): * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::drawPaintRects): (WebCore::InspectorOverlay::drawBounds): (WebCore::InspectorOverlay::drawRulers): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsBackgroundCSS const): * page/DebugPageOverlays.cpp: (WebCore::NonFastScrollableRegionOverlay::drawRect): * page/DragController.cpp: (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret): * page/linux/ResourceUsageOverlayLinux.cpp: (WebCore::ResourceUsageOverlay::platformInitialize): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::draw): * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::getDebugBorderInfo const): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::recursiveCommitChanges): * platform/graphics/ca/PlatformCALayer.cpp: (WebCore::PlatformCALayer::drawRepaintIndicator): * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::TileCoverageMap): * platform/mock/ScrollbarThemeMock.cpp: (WebCore::ScrollbarThemeMock::paintTrackBackground): * platform/win/DragImageWin.cpp: (WebCore::createDragImageForLink): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::resolveStyleForMarkedText): * rendering/RenderEmbeddedObject.cpp: * rendering/RenderLayerBacking.cpp: (WebCore::patternForTouchAction): (WebCore::patternForEventListenerRegionType): (WebCore::RenderLayerBacking::paintDebugOverlays): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::platformTapHighlightColor const): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintMenuListButtonDecorations): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): * testing/cocoa/WebViewVisualIdentificationOverlay.mm: (-[WebViewVisualIdentificationOverlay initWithWebView:kind:deprecated:]): Update to call colorWithAlphaByte rather than colorWithAlpha. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::addRoundedBorderClip): (WebCore::RenderThemeIOS::paintCheckboxDecorations): (WebCore::RenderThemeIOS::paintRadioDecorations): (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): (WebCore::RenderThemeIOS::paintSystemPreviewBadge): Update to use colorWithAlphaByte rather than colorWithAlpha and alphaByte rather than alpha. 2020-07-19 Rob Buis <rbuis@igalia.com> Remove findCharsetInMediaType https://bugs.webkit.org/show_bug.cgi?id=214523 Reviewed by Darin Adler. Remove findCharsetInMediaType (by moving its code into extractCharsetFromMediaType) since there are no users for findCharsetInMediaType anymore. * platform/network/HTTPParsers.cpp: (WebCore::extractCharsetFromMediaType): (WebCore::findCharsetInMediaType): Deleted. * platform/network/HTTPParsers.h: 2020-07-19 Sam Weinig <weinig@apple.com> Additional Color related cleanups https://bugs.webkit.org/show_bug.cgi?id=214514 Reviewed by Darin Adler. * platform/graphics/ColorBuilder.h: Remove redundant "public" and use decltype() rather than more wordy typename for static_assert. * platform/graphics/ColorUtilities.h: (WebCore::clampToComponentByte): (WebCore::clampToComponentFloat): Templatize to support any input. (WebCore::clampToComponentBytes): (WebCore::clampToComponentFloats): Templatize using variadic templates to support any input and prepare for color types with more than four components. (WebCore::colorByModifingEachNonAlphaComponent): Use std::invoke to support more types of functors. (WebCore::colorWithOverridenAlpha): (WebCore::invertedColorWithOverridenAlpha): Use auto more consistently. (WebCore::invertComponent): Deleted. Replace invertComponent functions with ComponentTraits::maxValue - value inline at callsite. 2020-07-18 Philippe Normand <pnormand@igalia.com> Unreviewed, fix build warnings in the WebXR backend * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::Instance::Impl::enumerateInstanceExtensionProperties const): Guard log loop with LOG_DISABLED macro, to avoid unused variable warnings in release builds. * testing/WebFakeXRDevice.h: Remove unused private class member. 2020-07-18 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r264563. https://bugs.webkit.org/show_bug.cgi?id=214518 Broke the watchOS build Reverted changeset: "Add OK button to Date/Time form controls." https://bugs.webkit.org/show_bug.cgi?id=214195 https://trac.webkit.org/changeset/264563 2020-07-18 Rob Buis <rbuis@igalia.com> Only use enum classes in HTTPParsers https://bugs.webkit.org/show_bug.cgi?id=214451 Reviewed by Darin Adler. Only use enum classes in HTTPParsers by converting XFrameOptionsSameOrigin and ContentTypeOptionsDisposition. Remove HTTPVersion enum since its only use is by parseHTTPRequestLine, but this method is unused. * loader/FrameLoader.cpp: (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions): * loader/cache/CachedCSSStyleSheet.cpp: (WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff const): * platform/network/HTTPParsers.cpp: (WebCore::parseContentTypeOptionsHeader): (WebCore::parseXFrameOptionsHeader): (WebCore::parseHTTPRequestLine): Deleted. * platform/network/HTTPParsers.h: (): Deleted. * platform/network/ResourceResponseBase.cpp: (WebCore::isScriptAllowedByNosniff): 2020-07-17 Sam Weinig <weinig@apple.com> Remove final vestigates of SimpleColor https://bugs.webkit.org/show_bug.cgi?id=214439 Reviewed by Simon Fraser. Replace remaining makeSimpleColor uses: - Literal / constant colors switched to using SRGBA<uint8_t> { ... }. - Direct construction from uint8_t values also switched to SRGBA<uint8_t> { ... } - Where possible switched to using of named colors (e.g. Color::yellow) both directly and where an override alpha was needed. To aid this, new named colors were added for red, magenta, blue, green, darkGreen and orange. - Remaining callers switched to directly calling clampToComponentBytes, which was all that makeSimpleColor did. An overload of clampToComponentBytes that doesn't require the alpha parameter was added to simplify calls. To make construction of SRGBA<uint8_t> values nicer, callers no longer need to specify the alpha explicitly if the color is opaque. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/SimpleColor.h: Removed. Remove SimpleColor.h * css/parser/CSSParserFastPaths.cpp: (WebCore::parseNumericColor): Switch to clampToComponentBytes, but leave a FIXME indicating this should be switched to direct SRGBA<uint8_t> when hepler functions are fixed to return uint8_ts rather than ints. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::parseColor): Switched to clampToComponentBytes and removed existing unnecessary additional clamping of the alpha component. * page/DebugPageOverlays.cpp: (WebCore::NonFastScrollableRegionOverlay::drawRect): Restructure HashMap construction to use the HashMap std::intializer_list constructor. This takes advantage of a change to WTF::KeyValuePair that allows it deduce in this context. * platform/graphics/Color.h: Remove SimpleColor.h include, but add ColorBuilder.h and ColorUtilities.h which SimpleColor was including on its behalf. Add new named colors for red, magenta, blue, green, darkGreen and orange. For all named colors, use ColorBuilder<SRGBA<uint8_t>> rather than SRGBA<uint8_t> alone to allow for callers to do things like Color::yellow.colorWithAlpha(...). In the future, it might make more sense to merge ColorBuilder's functionality directly into the color types, but for now this preserves that functionality. * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: (WebCore::SVGAnimationColorFunction::animate): (WebCore::SVGAnimationColorFunction::roundAndClampColorChannel): Deleted. Replace bespoke rounding/clamping functions in favor of ColorUtilities.h aggregate ones and directly calling std::lround. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseRGBParameters): * editing/CompositionHighlight.h: * html/ColorInputType.cpp: (WebCore::parseSimpleColorValue): * html/HTMLElement.cpp: (WebCore::parseLegacyColorValue): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::createInnerTextStyle): * inspector/InspectorOverlay.cpp: (WebCore::drawOutlinedQuadWithClip): (WebCore::drawShapeHighlight): (WebCore::InspectorOverlay::paint): (WebCore::InspectorOverlay::drawPaintRects): (WebCore::InspectorOverlay::drawBounds): (WebCore::InspectorOverlay::drawRulers): (WebCore::InspectorOverlay::drawElementTitle): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::debugTextShadow): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsBackgroundCSS const): * page/FrameView.cpp: (WebCore::FrameView::paintContents): * page/PrintContext.cpp: (WebCore::PrintContext::spoolAllPagesWithBoundaries): * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::HistoricResourceUsageData::HistoricResourceUsageData): * page/linux/ResourceUsageOverlayLinux.cpp: (WebCore::ResourceUsageOverlay::platformInitialize): * platform/adwaita/ScrollbarThemeAdwaita.cpp: * platform/adwaita/ThemeAdwaita.cpp: (WebCore::ThemeAdwaita::activeSelectionForegroundColor const): (WebCore::ThemeAdwaita::activeSelectionBackgroundColor const): (WebCore::ThemeAdwaita::inactiveSelectionForegroundColor const): * platform/graphics/Color.cpp: * platform/graphics/ColorBlending.cpp: (WebCore::blendSourceOver): (WebCore::blendWithWhite): * platform/graphics/ColorBuilder.h: (WebCore::ColorBuilder::colorWithAlpha const): (WebCore::ColorBuilder::ColorBuilder): Deleted. * platform/graphics/ColorTypes.h: (WebCore::SRGBA::SRGBA): * platform/graphics/ColorUtilities.h: (WebCore::clampToComponentBytes): (WebCore::clampToComponentFloats): * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::getDebugBorderInfo const): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::recursiveCommitChanges): (WebCore::contentsLayerDebugBorderColor): (WebCore::cloneLayerDebugBorderColor): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/PlatformCALayer.cpp: (WebCore::PlatformCALayer::drawRepaintIndicator): * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::TileCoverageMap): (WebCore::TileCoverageMap::update): * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: (PlatformCALayerWinInternal::drawRepaintCounters): * platform/graphics/cg/NativeImageCG.cpp: (WebCore::nativeImageSinglePixelSolidColor): * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::colorForMarkerLineStyle): * platform/graphics/mac/ColorMac.mm: (WebCore::makeSimpleColorFromNSColor): * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper): * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::drawDotsForDocumentMarker): * platform/ios/DragImageIOS.mm: (WebCore::createDragImageForLink): * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::colorForGridTileBorder const): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::defaultDevices): * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawBoxes): * platform/mock/ScrollbarThemeMock.cpp: (WebCore::ScrollbarThemeMock::paintTrackBackground): * platform/playstation/ScrollbarThemePlayStation.cpp: (WebCore::ScrollbarThemePlayStation::paintTrackBackground): * platform/win/DragImageWin.cpp: (WebCore::createDragImageForLink): * rendering/RenderEmbeddedObject.cpp: * rendering/RenderFrameSet.cpp: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::beginTransparencyLayers): (WebCore::RenderLayer::paintResizer): * rendering/RenderLayerBacking.cpp: (WebCore::patternForTouchAction): (WebCore::patternForEventListenerRegionType): (WebCore::RenderLayerBacking::paintDebugOverlays): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::platformActiveSelectionBackgroundColor const): (WebCore::RenderTheme::platformInactiveSelectionBackgroundColor const): (WebCore::RenderTheme::systemColor const): (WebCore::RenderTheme::paintSystemPreviewBadge): (WebCore::RenderTheme::platformTapHighlightColor const): * rendering/RenderThemeAdwaita.cpp: * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintSliderTrack): (WebCore::RenderThemeIOS::paintProgressBar): * rendering/RenderThemeMac.mm: (WebCore::menuBackgroundColor): (WebCore::RenderThemeMac::systemColor const): (WebCore::RenderThemeMac::paintMenuListButtonDecorations): * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::platformActiveSelectionBackgroundColor const): (WebCore::RenderThemeWin::platformInactiveSelectionBackgroundColor const): (WebCore::RenderThemeWin::platformActiveSelectionForegroundColor const): (WebCore::RenderThemeWin::systemColor const): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::paint): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::colorResolvingCurrentColor const): * rendering/style/SVGRenderStyle.h: (WebCore::SVGRenderStyle::initialStopColor): (WebCore::SVGRenderStyle::initialFloodColor): (WebCore::SVGRenderStyle::initialLightingColor): * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::drawRect): * testing/cocoa/WebViewVisualIdentificationOverlay.mm: (-[WebViewVisualIdentificationOverlay initWithWebView:kind:deprecated:]): Replace makeSimpleColor uses with appropriate alternative. 2020-07-17 Megan Gardner <megan_gardner@apple.com> Add OK button to Date/Time form controls. https://bugs.webkit.org/show_bug.cgi?id=214195 Reviewed by Darin Adler. * en.lproj/Localizable.strings: 2020-07-17 Wenson Hsieh <wenson_hsieh@apple.com> Followup to r264531 https://bugs.webkit.org/show_bug.cgi?id=214488 <rdar://problem/64531754> Reviewed by Darin Adler. Elide a null check by grabbing `RenderStyle` from the renderer instead of the element, and also limit overflow hidden to the X axis. * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::completeManipulation): 2020-07-17 Clark Wang <clark_wang@apple.com> Added Fixes for AudioScheduledSourceNode https://bugs.webkit.org/show_bug.cgi?id=214381 Reviewed by Chris Dumez. Added in IDL file for AudioScheduledSourceNode, according to spec: https://www.w3.org/TR/webaudio/#AudioScheduledSourceNode Re-baselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioScheduledSourceNode.idl: Added. * Modules/webaudio/OscillatorNode.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-17 Kenneth Russell <kbr@chromium.org> [WebGL2] ReadPixels updates https://bugs.webkit.org/show_bug.cgi?id=209516 Reviewed by Dean Jackson. Upgrade readPixels to WebGL 2.0 functionality. Handle both WebGL 2.0 pack/unpack parameters correctly. Fix preexisting bugs in texture uploads from pixel unpack buffers. Remove entry points from GraphicsContextGL that will never be used by the WebGL 2.0 implementation. Covered by existing WebGL 2.0 conformance tests. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::initializeNewContext): (WebCore::WebGL2RenderingContext::sliceArrayBufferView): (WebCore::WebGL2RenderingContext::pixelStorei): (WebCore::WebGL2RenderingContext::texImage2D): (WebCore::WebGL2RenderingContext::texImage3D): (WebCore::WebGL2RenderingContext::texSubImage2D): (WebCore::WebGL2RenderingContext::texSubImage3D): (WebCore::WebGL2RenderingContext::getPackPixelStoreParams const): (WebCore::WebGL2RenderingContext::getUnpackPixelStoreParams const): (WebCore::WebGL2RenderingContext::readPixels): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::readPixels): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/ExtensionsGL.h: * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::readnPixelsRobustANGLE): * platform/graphics/angle/ExtensionsGLANGLE.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::readRenderingResults): (WebCore::GraphicsContextGLOpenGL::texImage3D): Deleted. (WebCore::GraphicsContextGLOpenGL::texSubImage3D): Deleted. * platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp: (WebCore::ExtensionsGLOpenGLCommon::readnPixelsRobustANGLE): * platform/graphics/opengl/ExtensionsGLOpenGLCommon.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::texImage3D): Deleted. (WebCore::GraphicsContextGLOpenGL::texSubImage3D): Deleted. 2020-07-17 James Darpinian <jdarpinian@chromium.org> [WebGL2] Sync objects https://bugs.webkit.org/show_bug.cgi?id=126942 Reviewed by Dean Jackson. Passes WebGL conformance tests webgl/2.0.0/conformance2/sync/sync-webgl-specific.html and webgl/2.0.0/deqp/functional/gles3/sync.html although the latter times out in the layout test harness. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::fenceSync): (WebCore::WebGL2RenderingContext::isSync): (WebCore::WebGL2RenderingContext::deleteSync): (WebCore::WebGL2RenderingContext::clientWaitSync): (WebCore::WebGL2RenderingContext::waitSync): (WebCore::WebGL2RenderingContext::getSyncParameter): * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLSync.cpp: (WebCore::WebGLSync::WebGLSync): (WebCore::WebGLSync::deleteObjectImpl): (WebCore::WebGLSync::updateCache): (WebCore::WebGLSync::getCachedResult const): (WebCore::WebGLSync::isSignaled const): (WebCore::WebGLSync::scheduleAllowCacheUpdate): * html/canvas/WebGLSync.h: * platform/graphics/GraphicsContextGL.h: * platform/graphics/GraphicsTypesGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::fenceSync): (WebCore::GraphicsContextGLOpenGL::isSync): (WebCore::GraphicsContextGLOpenGL::deleteSync): (WebCore::GraphicsContextGLOpenGL::clientWaitSync): (WebCore::GraphicsContextGLOpenGL::waitSync): (WebCore::GraphicsContextGLOpenGL::getSynciv): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::fenceSync): (WebCore::GraphicsContextGLOpenGL::isSync): (WebCore::GraphicsContextGLOpenGL::deleteSync): (WebCore::GraphicsContextGLOpenGL::clientWaitSync): (WebCore::GraphicsContextGLOpenGL::waitSync): (WebCore::GraphicsContextGLOpenGL::getSynciv): 2020-07-17 Lauro Moura <lmoura@igalia.com> Fix -Wformat= warnings when passing enum to integer specifiers https://bugs.webkit.org/show_bug.cgi?id=214441 Reviewed by Darin Adler. Covered by existing tests. * platform/mediastream/MediaConstraints.cpp: (WebCore::MediaConstraint::log const): (WebCore::BooleanConstraint::logAsBoolean const): (WebCore::DoubleConstraint::logAsDouble const): (WebCore::IntConstraint::logAsInt const): * platform/mediastream/MediaConstraints.h: Made uint8_t the underlying type for MediaConstraints::DataType. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::selectSettings): * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h: Made uint8_t the underlying type for MediaConstraintType. 2020-07-17 Fujii Hironori <Hironori.Fujii@sony.com> Don't include <wtf/text/WTFString.h> in SVGParserUtilities.h https://bugs.webkit.org/show_bug.cgi?id=214320 Reviewed by Darin Adler. r264332 mistakenly added #include <wtf/text/WTFString.h> in ColorSerialization.h and SVGParserUtilities.h. It should be <wtf/Forward.h>. See <https://lists.webkit.org/pipermail/webkit-dev/2020-July/031274.html> for the discussion. * platform/graphics/ColorSerialization.h: * svg/SVGParserUtilities.h: 2020-07-17 Wenson Hsieh <wenson_hsieh@apple.com> Recommended article titles on csdn.net are clipped after translating to English https://bugs.webkit.org/show_bug.cgi?id=214488 <rdar://problem/64531754> Reviewed by Tim Horton. On csdn.net, the translation of the "荐" pill into English is "Recommended". This increase in the size of the text node after translation breaks the layout of the page by clipping content below the pill, since the page expects the element containing this text to have a fixed width and height. Add a heuristic to detect and mitigate this exact scenario by applying `overflow: hidden;` onto containers after translation, in the case where the container: 1. Did not have any visual overflow before translation. 2. Has visual overflow after translation. 3. Has both fixed width and fixed height. 4. Does not have any overflow clip. 5. Is not out-of-flow (i.e. fixed or absolute position). While it does mean that the text inside the fixed-dimension container will be clipped, this will at least prevent this overflow from breaking the rest of the page. Test: TextManipulation.CompleteTextManipulationAddsOverflowHiddenToAvoidBreakingLayout * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::completeManipulation): (WebCore::TextManipulationController::replace): While replacing content, keep track of nodes under which we're inserting content that didn't have any visual overflow prior to replacement. * editing/TextManipulationController.h: 2020-07-17 Simon Fraser <simon.fraser@apple.com> Make ScrollbarControlSize an enum class https://bugs.webkit.org/show_bug.cgi?id=199325 Reviewed by Sam Weinig. Make ScrollbarControlSize an enum class, and make some RenderScrollbar methods const. * platform/ScrollTypes.h: * platform/ScrollView.cpp: (WebCore::ScrollView::createScrollbar): * platform/ScrollbarTheme.h: (WebCore::ScrollbarTheme::scrollbarThickness): * platform/ios/ScrollbarThemeIOS.h: * platform/mac/ScrollbarThemeMac.h: * platform/mac/ScrollbarThemeMac.mm: (WebCore::scrollbarControlSizeToNSControlSize): (WebCore::scrollbarSizeToIndex): (WebCore::ScrollbarThemeMac::hasButtons): (WebCore::buttonRepaintRect): (WebCore::ScrollbarThemeMac::backButtonRect): (WebCore::ScrollbarThemeMac::forwardButtonRect): (WebCore::ScrollbarThemeMac::trackRect): * platform/mock/ScrollbarThemeMock.cpp: (WebCore::ScrollbarThemeMock::scrollbarThickness): * platform/mock/ScrollbarThemeMock.h: * platform/playstation/ScrollbarThemePlayStation.h: * platform/win/PopupMenuWin.cpp: (WebCore::PopupMenuWin::show): (WebCore::PopupMenuWin::calculatePositionAndSize): * platform/win/ScrollbarThemeWin.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::createScrollbar): * rendering/RenderScrollbar.cpp: (WebCore::RenderScrollbar::RenderScrollbar): (WebCore::RenderScrollbar::buttonRect const): (WebCore::RenderScrollbar::trackRect const): (WebCore::RenderScrollbar::trackPieceRectWithMargins const): (WebCore::RenderScrollbar::minimumThumbLength const): (WebCore::RenderScrollbar::opacity const): (WebCore::RenderScrollbar::buttonRect): Deleted. (WebCore::RenderScrollbar::trackRect): Deleted. (WebCore::RenderScrollbar::trackPieceRectWithMargins): Deleted. (WebCore::RenderScrollbar::minimumThumbLength): Deleted. (WebCore::RenderScrollbar::opacity): Deleted. * rendering/RenderScrollbar.h: * rendering/RenderTheme.h: (WebCore::RenderTheme::scrollbarControlSizeForPart): * rendering/RenderThemeMac.h: 2020-07-17 Rob Buis <rbuis@igalia.com> Changing URL.host should not override port https://bugs.webkit.org/show_bug.cgi?id=151613 Reviewed by Alex Christensen. When setting host, empty/incorrect port strings should not change the existing port [1, 2]. Behavior matches Chrome and Firefox. [1] https://url.spec.whatwg.org/#host-state Step 2.4 [2] https://url.spec.whatwg.org/#port-state Step 2.2 Test: imported/w3c/web-platform-tests/url/url-setters.html * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setHost): 2020-07-17 Truitt Savell <tsavell@apple.com> Unreviewed, reverting r264477. Broke the internal build Reverted changeset: "Use AVRoutePickerView when available for choosing AirPlay devices" https://bugs.webkit.org/show_bug.cgi?id=213497 https://trac.webkit.org/changeset/264477 2020-07-17 Truitt Savell <tsavell@apple.com> Unreviewed, reverting r264482. Part of an attempted fix for the build Reverted changeset: "Use AVRoutePickerView when available for choosing AirPlay devices" https://bugs.webkit.org/show_bug.cgi?id=213497 https://trac.webkit.org/changeset/264482 2020-07-17 Joonghun Park <jh718.park@samsung.com> Unreviewed. Remove the build warning below since r264280. warning: redundant move in return statement [-Wredundant-move] No new tests, no new behaviors. * platform/graphics/Gradient.h: (WebCore::Gradient::decode): 2020-07-17 Joonghun Park <jh718.park@samsung.com> Unreviewed. Remove the build warning below and redundant spaces since r264381. warning: this statement may fall through [-Wimplicit-fallthrough=] No new tests, no new behaviors. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::vertexAttribI4iv): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::getVertexAttrib): (WebCore::WebGLRenderingContextBase::vertexAttribfvImpl): 2020-07-17 Joonghun Park <jh718.park@samsung.com> Remove the build warning below and redundant spaces since r263985. warning: redundant move in return statement [-Wredundant-move] No new tests, no new behaviors. * Modules/webaudio/AudioNode.h: * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::create): (WebCore::PannerNode::PannerNode): * Modules/webaudio/PannerNode.h: 2020-07-16 Rob Buis <rbuis@igalia.com> Make DocumentParser.ParserState an enum class https://bugs.webkit.org/show_bug.cgi?id=214416 Reviewed by Darin Adler. Make DocumentParser.ParserState an enum class since it is more readable. * dom/DocumentParser.cpp: (WebCore::DocumentParser::DocumentParser): (WebCore::DocumentParser::startParsing): (WebCore::DocumentParser::prepareToStopParsing): (WebCore::DocumentParser::stopParsing): (WebCore::DocumentParser::detach): * dom/DocumentParser.h: (WebCore::DocumentParser::isParsing const): (WebCore::DocumentParser::isStopping const): (WebCore::DocumentParser::isStopped const): (WebCore::DocumentParser::isDetached const): (): Deleted. 2020-07-16 Xabier Rodriguez Calvar <calvaris@igalia.com> Rename createBoxPtr into adoptBoxPtr https://bugs.webkit.org/show_bug.cgi?id=214171 Reviewed by Darin Adler. No new tests, just a rename. * platform/graphics/gstreamer/eme/CDMProxyThunder.cpp: (WebCore::CDMProxyThunder::getDecryptionSession const): Used the renamed function. 2020-07-16 Fujii Hironori <Hironori.Fujii@sony.com> [WTF] Remove the unnecessary inner class DefaultHash<T>::Hash https://bugs.webkit.org/show_bug.cgi?id=214389 Reviewed by Darin Adler. * Modules/indexeddb/IDBDatabaseIdentifier.h: * Modules/indexeddb/shared/IDBResourceIdentifier.h: * Modules/webgpu/WHLSL/AST/WHLSLUnnamedTypeHash.h: * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: (WebCore::WHLSL::matchResources): (WebCore::WHLSL::matchVertexAttributes): (WebCore::WHLSL::matchColorAttachments): * accessibility/AccessibilityObject.cpp: * accessibility/AccessibilityObject.h: * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::serializeActions): * contentextensions/ContentExtensionRule.h: (WebCore::ContentExtensions::TriggerHash::hash): * contentextensions/ContentExtensionStyleSheet.h: * contentextensions/DFA.cpp: (WebCore::ContentExtensions::printTransitions): * contentextensions/DFABytecodeInterpreter.h: * contentextensions/DFACombiner.cpp: (WebCore::ContentExtensions::DFAMerger::getOrCreateCombinedNode): * contentextensions/DFANode.cpp: (WebCore::ContentExtensions::DFANode::bestFallbackTarget const): * contentextensions/ImmutableNFANodeBuilder.h: * contentextensions/NFA.cpp: (WebCore::ContentExtensions::NFA::debugPrintDot const): * contentextensions/NFANode.h: * contentextensions/NFAToDFA.cpp: (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource): (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate): * css/makeprop.pl: * css/parser/CSSParserContext.h: * dom/GCReachableRef.h: * dom/MessagePortIdentifier.h: * dom/NodeRareData.h: (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::hash): (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::equal): * dom/QualifiedName.h: * history/BackForwardItemIdentifier.h: * html/canvas/WebGLRenderingContextBase.h: * layout/LayoutUnits.h: * loader/AdClickAttribution.h: * loader/ResourceCryptographicDigest.h: (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::hash): (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::equal): (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::Hash::hash): Deleted. (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::Hash::equal): Deleted. * page/ClientOrigin.h: * page/GlobalWindowIdentifier.h: * page/SecurityOriginData.h: * page/SecurityOriginHash.h: * platform/Cookie.h: * platform/RegistrableDomain.h: * platform/graphics/ColorHash.h: * platform/graphics/FloatSizeHash.h: (WTF::FloatHash<WebCore::FloatSize>::hash): * platform/graphics/FontGenericFamilies.h: * platform/graphics/IntPointHash.h: * platform/graphics/IntRectHash.h: (WTF::IntHash<WebCore::IntRect>::hash): (WTF::IntHash<WebCore::IntRect>::equal): * platform/graphics/IntSizeHash.h: * platform/graphics/WidthCache.h: * platform/graphics/freetype/FontCacheFreeType.cpp: (WebCore::FallbackFontDescriptionKey::computeHash const): * platform/network/HTTPParsers.h: * platform/network/ProtectionSpaceHash.h: * platform/win/COMPtr.h: * platform/win/WindowsKeyNames.h: * rendering/CSSValueKey.h: * rendering/GridBaselineAlignment.h: * rendering/GridTrackSizingAlgorithm.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid const): * rendering/RenderTheme.h: * style/RuleSet.cpp: (WebCore::Style::RuleSet::evaluateDynamicMediaQueryRules): * svg/SVGElement.h: (WebCore::SVGAttributeHashTranslator::hash): * workers/service/ServiceWorkerClientIdentifier.h: * workers/service/ServiceWorkerRegistrationKey.h: 2020-07-16 Sihui Liu <sihui_liu@appe.com> IDB serialization of some DOM object types crashes the Networking process due to incorrect global object type (WPT IndexedDB/structured-clone.any tests fail) https://bugs.webkit.org/show_bug.cgi?id=210735 <rdar://problem/62045703> Reviewed by Yusuke Suzuki. In r239746, IDB went back to use JSGlobalObject for serialization and deserialization. However, in our current implementation, there is a strong assumption that DOM JS objects are tied to JSDOMGlobalObject, which is derived from JSGlobalObject. For example, in SerializedScriptValue.cpp, we cast the global object to JSDOMGlobalObject in many places. We recently notice this issue when we enable some wpt test, which has been disabled since it was imported as some types were not supported. The test fails as DOMMatrix object requires its global object to be JSDOMGlobalObject. To fix this, introduce a new Class JSIDBSerializationGlobalObject, derived from JSDOMGlobalObject, and use it for IDB serialization. Tests: LayoutTests/storage/indexeddb/structured-clone.html LayoutTests/storage/indexeddb/structured-clone-private.html * Modules/indexeddb/server/IDBSerializationContext.cpp: (WebCore::IDBServer::IDBSerializationContext::initializeVM): * Modules/indexeddb/server/IDBSerializationContext.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::scriptExecutionContext const): * bindings/js/JSIDBSerializationGlobalObject.cpp: Added. (WebCore::JSIDBSerializationGlobalObject::JSIDBSerializationGlobalObject): (WebCore::JSIDBSerializationGlobalObject::create): (WebCore::JSIDBSerializationGlobalObject::finishCreation): (WebCore::JSIDBSerializationGlobalObject::subspaceForImpl): (WebCore::JSIDBSerializationGlobalObject::destroy): * bindings/js/JSIDBSerializationGlobalObject.h: Added. * bindings/js/WebCoreJSClientData.cpp: (WebCore::JSVMClientData::JSVMClientData): * bindings/js/WebCoreJSClientData.h: (WebCore::JSVMClientData::idbSerializationSpace): * dom/EmptyScriptExecutionContext.h: Added. * worklets/WorkletScriptController.h: 2020-07-16 Eric Carlson <eric.carlson@apple.com> Use AVRoutePickerView when available for choosing AirPlay devices https://bugs.webkit.org/show_bug.cgi?id=213497 <rdar://problem/58610662> Unreviewed build fix. * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.mm: * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: (WebCore::MediaPlaybackTargetPickerMac::routePicker): Use HAVE_AVROUTEPICKERVIEW. 2020-07-16 Eric Carlson <eric.carlson@apple.com> Use AVRoutePickerView when available for choosing AirPlay devices https://bugs.webkit.org/show_bug.cgi?id=213497 <rdar://problem/58610662> Reviewed by Jer Noble. Use an AVRoutePickerView, the replacement for AVOutputDeviceMenuController, when it is available to allow a user to pick an AirPlay device. To do this, create an AVPlaybackTargetPicker abstract base and create a concrete class from the AVOutputDeviceMenuController-specific code from MediaPlaybackTargetPickerMac, and create a new concrete class using AVRoutePickerView. Tested manually because these changes require an AirPlay device. * Modules/mediasession/WebMediaSessionManager.cpp: (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Pass the view to the target picker. * Modules/mediasession/WebMediaSessionManagerClient.h: * Modules/remoteplayback/RemotePlayback.cpp: (WebCore::RemotePlayback::playbackTargetPickerWasDismissed): Drive-by fix: return early if there are no pending promises. * SourcesCocoa.txt: Add new files. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/graphics/MediaPlaybackTargetPicker.cpp: (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker): Add new parameter. * platform/graphics/MediaPlaybackTargetPicker.h: * platform/graphics/avfoundation/objc/AVOutputDeviceMenuControllerTargetPicker.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h. * platform/graphics/avfoundation/objc/AVOutputDeviceMenuControllerTargetPicker.mm: Copied from Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm. (WebCore::AVOutputDeviceMenuControllerTargetPicker::AVOutputDeviceMenuControllerTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::~AVOutputDeviceMenuControllerTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::devicePicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::availableDevicesDidChange): (WebCore::AVOutputDeviceMenuControllerTargetPicker::currentDeviceDidChange): (WebCore::AVOutputDeviceMenuControllerTargetPicker::showPlaybackTargetPicker): (WebCore::AVOutputDeviceMenuControllerTargetPicker::startingMonitoringPlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::stopMonitoringPlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::invalidatePlaybackTargets): (WebCore::AVOutputDeviceMenuControllerTargetPicker::externalOutputDeviceAvailable): (WebCore::AVOutputDeviceMenuControllerTargetPicker::outputContext): (-[WebAVOutputDeviceMenuControllerHelper initWithCallback:]): (-[WebAVOutputDeviceMenuControllerHelper clearCallback]): (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): * platform/graphics/avfoundation/objc/AVPlaybackTargetPicker.h: Added. (WebCore::AVPlaybackTargetPicker::AVPlaybackTargetPicker): (WebCore::AVPlaybackTargetPicker::client const): * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.h: Added. * platform/graphics/avfoundation/objc/AVRoutePickerViewTargetPicker.mm: Added. (WebCore::AVRoutePickerViewTargetPicker::isAvailable): (WebCore::AVRoutePickerViewTargetPicker::AVRoutePickerViewTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::~AVRoutePickerViewTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::outputContextInternal): (WebCore::AVRoutePickerViewTargetPicker::devicePicker): (WebCore::AVRoutePickerViewTargetPicker::routeDetector): (WebCore::AVRoutePickerViewTargetPicker::showPlaybackTargetPicker): (WebCore::AVRoutePickerViewTargetPicker::startingMonitoringPlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::stopMonitoringPlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::externalOutputDeviceAvailable): (WebCore::AVRoutePickerViewTargetPicker::outputContext): (WebCore::AVRoutePickerViewTargetPicker::invalidatePlaybackTargets): (WebCore::AVRoutePickerViewTargetPicker::availableDevicesDidChange): (WebCore::AVRoutePickerViewTargetPicker::currentDeviceDidChange): (WebCore::AVRoutePickerViewTargetPicker::devicePickerWasDismissed): (-[WebAVRoutePickerViewHelper initWithCallback:]): (-[WebAVRoutePickerViewHelper dealloc]): (-[WebAVRoutePickerViewHelper clearCallback]): (-[WebAVRoutePickerViewHelper routePickerViewDidEndPresentingRoutes:]): (-[WebAVRoutePickerViewHelper notificationHandler:]): * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac): (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac): (WebCore::MediaPlaybackTargetPickerMac::externalOutputDeviceAvailable): (WebCore::MediaPlaybackTargetPickerMac::playbackTarget): (WebCore::MediaPlaybackTargetPickerMac::routePicker): (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): (WebCore::MediaPlaybackTargetPickerMac::startingMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::invalidatePlaybackTargets): (WebCore::MediaPlaybackTargetPickerMac::pickerWasDismissed): (WebCore::MediaPlaybackTargetPickerMac::availableDevicesChanged): (WebCore::MediaPlaybackTargetPickerMac::currentDeviceChanged): (WebCore::MediaPlaybackTargetPickerMac::devicePicker): Deleted. (-[WebAVOutputDeviceMenuControllerHelper initWithCallback:]): Deleted. (-[WebAVOutputDeviceMenuControllerHelper clearCallback]): Deleted. (-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): Deleted. * platform/mock/MediaPlaybackTargetPickerMock.cpp: (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker): * platform/mock/MediaPlaybackTargetPickerMock.h: 2020-07-16 Jer Noble <jer.noble@apple.com> [Cocoa] Add MediaCapabilities support for SW VP9 decoder. https://bugs.webkit.org/show_bug.cgi?id=214316 Reviewed by Eric Carlson. Test: platform/mac/media/mediacapabilities/vp9-decodingInfo-sw.html Add some foundational support for SW VP9, which due to policy decisions will need information both on the system battery status and the power adapter status, and these need to be shipped into the WebContent process from the UIProcess. Add some Internal override settings to allow the policies to be effectively tested through LayouTests. This includes overrides for system battery and AC state, as well as overrides for screen size and resolution. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/PlatformScreen.cpp: (WebCore::getScreenProperties): * platform/PlatformScreen.h: * platform/ScreenProperties.h: (WebCore::ScreenData::encode const): (WebCore::ScreenData::decode): * platform/cocoa/PowerSourceNotifier.h: * platform/cocoa/PowerSourceNotifier.mm: (WebCore::PowerSourceNotifier::PowerSourceNotifier): (WebCore::PowerSourceNotifier::~PowerSourceNotifier): (WebCore::PowerSourceNotifier::notifyPowerSourceChanged): * platform/cocoa/SystemBattery.h: * platform/cocoa/SystemBattery.mm: (WebCore::systemHasBattery): (WebCore::resetSystemHasAC): (WebCore::setSystemHasAC): (WebCore::systemHasAC): (WebCore::setOverrideSystemHasBatteryForTesting): (WebCore::setOverrideSystemHasACForTesting): * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: (WebCore::videoCodecTypeFromRFC4281Type): (WebCore::createMediaPlayerDecodingConfigurationCocoa): * platform/graphics/cocoa/VP9UtilitiesCocoa.h: Copied from Source/WebCore/PAL/pal/spi/cocoa/IOPSLibSPI.h. * platform/graphics/cocoa/VP9UtilitiesCocoa.mm: Added. (WebCore::setOverrideVP9HardwareDecoderDisabledForTesting): (WebCore::setOverrideVP9ScreenSizeAndScaleForTesting): (WebCore::resetOverrideVP9ScreenSizeAndScaleForTesting): (WebCore::validateVPParameters): * platform/ios/PlatformScreenIOS.mm: (WebCore::collectScreenProperties): * platform/mac/PlatformScreenMac.mm: (WebCore::collectScreenProperties): * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::setSystemHasBattery): (WebCore::Internals::setSystemHasAC): (WebCore::Internals::setHardwareVP9DecoderDisabledForTesting): (WebCore::Internals::setVP9ScreenSizeAndScale): * testing/Internals.h: * testing/Internals.idl: 2020-07-16 Brady Eidson <beidson@apple.com> Remove (entirely unused) hat switch dpad support in HIDGamepad. https://bugs.webkit.org/show_bug.cgi?id=214419 Reviewed by Andy Estes. Turns out these devices simply don't exist in the wild. * platform/gamepad/mac/HIDGamepad.cpp: (WebCore::HIDGamepad::initElements): (WebCore::HIDGamepad::initElementsFromArray): (WebCore::HIDGamepad::valueChanged): (WebCore::HIDGamepad::maybeAddDPad): Deleted. (WebCore::fillInButtonValues): Deleted. * platform/gamepad/mac/HIDGamepad.h: (WebCore::HIDGamepadElement::isAxis const): (WebCore::HIDGamepadElement::isDPad const): Deleted. (WebCore::HIDGamepadDPad::HIDGamepadDPad): Deleted. (WebCore::HIDGamepadDPad::normalizedValue): Deleted. 2020-07-16 Peng Liu <peng.liu6@apple.com> Double tapping to zoom out a fullscreen video will zoom in slightly before zooming out https://bugs.webkit.org/show_bug.cgi?id=214400 Reviewed by Jer Noble. When changing the video gravity of a fullscreen video from AVLayerVideoGravityResizeAspectFill to AVLayerVideoGravityResizeAspect, the implicit animation of the AVPlayerLayer in the web process will conflict with the implicit animation of the _videoSublayer in the WebAVPlayerLayer in the UI process. To avoid the implicit animation in the web process because of the video gravity change, we have to let the remote hosting layer and the corresponding AVPlayerLayer in the web process to include the whole video, even when the video gravity is AVLayerVideoGravityResizeAspectFill and the video will be clipped by the superlayer. When the AVPlayerLayer has the whole video, changing the video gravity from AVLayerVideoGravityResizeAspectFill to AVLayerVideoGravityResizeAspect will not generate an implicit animation in the web process. This patch also adds an instance variable _previousVideoGravity to make sure the transform is correctly calculated when video gravity is changing. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerLayer init]): (-[WebAVPlayerLayer layoutSublayers]): (-[WebAVPlayerLayer resolveBounds]): (-[WebAVPlayerLayer setVideoGravity:]): 2020-07-16 Andres Gonzalez <andresg_22@apple.com> Crash caused by clients that don't support isolated tree mode calling on the secondary thread. https://bugs.webkit.org/show_bug.cgi?id=214409 Reviewed by Chris Fleizach. In isolated tree mode, isIsolatedTreeEnabled should return true whenever is called off of the main thread, even if the client doesn’t support isolated tree mode. Once the secondary AX thread is initialized due to a call from a client that supports isolated tree mode like VoiceOver, all calls into the accessibility API will happen on the secondary thread, including calls from clients that don't support isolated tree mode. At this point, we need to handle those clients as if they supported isolated tree mode. In other words, one client that supports isolated tree mode makes all other clients to be treated as such. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::isIsolatedTreeEnabled): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper lineTextMarkerRangeForTextMarker:forUnit:]): Minor cleanup, the cache is already in a local varriable. 2020-07-16 Oriol Brufau <obrufau@igalia.com> [css-grid] Fix line name positions after implicit tracks https://bugs.webkit.org/show_bug.cgi?id=214315 Reviewed by Manuel Rego Casasnovas. When serializing grid-template-rows/columns of a grid container, we get the list of used track sizes, and then insert line names at the corresponding indices. Before this patch, these indices were simply taken from the computed value. However, leading implicit tracks appear in the used value but not in the computed one. Therefore, we have to offset the indices so that the line names appear at the proper positions. This patch is a port of https://crrev.com/777829 Tests: imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-implicit-track.html imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-implicit-track.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::populateGridTrackList): (WebCore::valueForGridTrackList): * rendering/RenderGrid.h: 2020-07-16 Andres Gonzalez <andresg_22@apple.com> [webAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange]needs to autorelease the return value from the main thread. https://bugs.webkit.org/show_bug.cgi?id=214404 <rdar://problem/65627156> Reviewed by Chris Fleizach. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]): Call retrieveAutoreleasedValueFromMainthread instead of retrieveValueFromMainThread. The autorelease call inside the lambda doesn't do the job. 2020-07-16 Carlos Garcia Campos <cgarcia@igalia.com> REGRESSION(r264280) [GTK][WPE] fast/gradients/conic-gradient-alpha.html is failing https://bugs.webkit.org/show_bug.cgi?id=214259 Reviewed by Darin Adler. * platform/graphics/ColorBlending.cpp: (WebCore::blendWithoutPremultiply): Use 'to' instead of 'from' when converting to SRGBA. * platform/graphics/cairo/GradientCairo.cpp: (WebCore::createConic): Use blendWithoutPremultiply() instead of blend() for the color stops interpolation. 2020-07-16 Carlos Garcia Campos <cgarcia@igalia.com> REGRESSION(r264272) [GTK][WPE] css3/color/composited-solid-backgrounds.html is failing https://bugs.webkit.org/show_bug.cgi?id=214260 Reviewed by Darin Adler. The problem is that clampToComponentFloat is returning a uint8_t instead of a float, so we always end up returning 0. * platform/graphics/ColorUtilities.h: (WebCore::clampToComponentFloat): 2020-07-15 Yusuke Suzuki <ysuzuki@apple.com> Should clear exception after microtask draining https://bugs.webkit.org/show_bug.cgi?id=214391 <rdar://problem/65536227> Reviewed by Mark Lam. Test: js/dom/microtask-drain-should-clear-exceptions.html Since microtask draining involves JS calls, potentially it can cause exception. We should clear exceptions after microtask draining since we do not handle it and suppress exception-check validation. And we also should not create ThrowScope in canAccessDocument when parameter says it never throws an error. Both cases are handled in the attached test. * bindings/js/JSDOMBindingSecurity.cpp: (WebCore::canAccessDocument): * bindings/js/JSExecState.h: (WebCore::JSExecState::~JSExecState): 2020-07-15 Devin Rousso <drousso@apple.com> Unreviewed followup, use `objectReplacementCharacter` instead of `0xFFFC` <https://webkit.org/b/214331> <rdar://problem/64779558> * editing/TextIterator.cpp: (WebCore::TextIterator::representNodeOffsetZero): 2020-07-15 Simon Fraser <simon.fraser@apple.com> Flip the sense of the return value for processWheelEventForScrollSnap() https://bugs.webkit.org/show_bug.cgi?id=214328 Reviewed by Wenson Hsieh. All the other functions return "true" to mean "handled". Make this one the same. * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): (WebCore::ScrollController::processWheelEventForScrollSnap): 2020-07-15 Devin Rousso <drousso@apple.com> should represent `TextPlaceholderElement` as an `NSTextAttachmentCharacter` instead of a `\n` https://bugs.webkit.org/show_bug.cgi?id=214331 <rdar://problem/64779558> Reviewed by Wenson Hsieh. * editing/TextIterator.cpp: (WebCore::shouldEmitReplacementInsteadOfNode): Added. (WebCore::shouldEmitNewlinesBeforeAndAfterNode): (WebCore::TextIterator::representNodeOffsetZero): Placeholders should eventually be removed, so stringifying them as a newline doesn't make sense as they should be treated as a "slot" in the existing flow of the surrounding content without changing the characteristics of the content (e.g. a sentence with a placeholder should remain as a sentence, not suddenly become two paragraphs separated by a placeholder). 2020-07-15 Stephan Szabo <stephan.szabo@sony.com> [PlayStation] Build fix after r264213 https://bugs.webkit.org/show_bug.cgi?id=214373 Unreviewed build fix No new tests, build fix only * PlatformPlayStation.cmake: Stop compiling UserAgentQuirks 2020-07-15 Daniel Bates <dabates@apple.com> [iOS] Caret should be before text placeholder instead of after it https://bugs.webkit.org/show_bug.cgi?id=214319 <rdar://problem/65295523> Reviewed by Wenson Hsieh. Move the caret to before the text placeholder to match UIKit. Tests: editing/text-placeholder/caret-before-zero-width-placeholder-in-content-editable-end-of-word.html editing/text-placeholder/caret-before-zero-width-placeholder-in-content-editable-start-of-word.html editing/text-placeholder/insert-into-content-editable-and-remove-via-mutation-event.html * editing/Editor.cpp: (WebCore::Editor::insertTextPlaceholder): Compute the position before the placeholder in its parent. This computation can only be done if the placeholder still has a parent. It may not after insertion because arbitrary JavaScript code can run. If this happens then bail out and return nullptr. Otherwise, set the new selection. 2020-07-15 Simon Fraser <simon.fraser@apple.com> itsnicethat.com page is sometimes non-scrollable https://bugs.webkit.org/show_bug.cgi?id=214362 <rdar://problem/65431127> Reviewed by Tim Horton. This page uses 'clip-path: inset(1px); on a 1px x 1px element to hit descendants from hit-testing and compositing code turns this into a layer mask using a CAShapeLayer. Our layer/view hit-testing code failed to check for masking; if a layer has a mask, it needs to be handled like -masksToBounds, in that points outside the mask should never hit descendant layers. Make a -_web_maskContainsPoint: to test whether the point is inside the mask layer, and _web_maskMayIntersectRect: which does approximate testing using path bounds intersection (this is used for editable regions). Also convert some hard-coded winding rule strings to use the CA constants. Tests: fast/scrolling/ios/clip-path-hit-test.html fast/scrolling/mac/clip-path-hit-test.html * page/scrolling/mac/ScrollingTreeMac.mm: (collectDescendantLayersAtPoint): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::shapeWindRule const): (WebCore::PlatformCALayerCocoa::setShapeWindRule): * platform/graphics/cocoa/WebCoreCALayerExtras.h: * platform/graphics/cocoa/WebCoreCALayerExtras.mm: (-[CALayer _web_maskContainsPoint:]): (-[CALayer _web_maskMayIntersectRect:]): 2020-07-15 Mark Lam <mark.lam@apple.com> Add handling of out of memory handling while adding a worklet module. https://bugs.webkit.org/show_bug.cgi?id=214354 <rdar://problem/65271931> Reviewed by Yusuke Suzuki and Keith Miller. Test: fast/css-custom-paint/out-of-memory-while-adding-worklet-module.html * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::createDOMException): * dom/ExceptionCode.h: * worklets/PaintWorkletGlobalScope.cpp: (WebCore::PaintWorkletGlobalScope::tryCreate): (WebCore::PaintWorkletGlobalScope::PaintWorkletGlobalScope): (WebCore::PaintWorkletGlobalScope::create): Deleted. * worklets/PaintWorkletGlobalScope.h: * worklets/Worklet.cpp: (WebCore::Worklet::addModule): * worklets/Worklet.h: * worklets/Worklet.idl: * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): * worklets/WorkletGlobalScope.h: * worklets/WorkletScriptController.cpp: (WebCore::WorkletScriptController::WorkletScriptController): * worklets/WorkletScriptController.h: 2020-07-15 Oriol Brufau <obrufau@igalia.com> [css-grid] Rename SmallestTrackStart to ExplicitGridStart https://bugs.webkit.org/show_bug.cgi?id=214347 Reviewed by Manuel Rego Casasnovas. The SmallestTrackStart method used to return a signed int which was never positive, representing the smallest untranslated start among all grid items, clamped by 0 as a maximum. In practice, though, what we usually want is the index of the first explicit track/line among all tracks/lines, or equivalently, the number of leading implicit tracks/lines. That number is precisely minus the return value of SmallestTrackStart. Thus, in grid layout there were various std::abs() to invert the value. But it's a bit confusing to have an API which returns a non-positive integer, which then needs to be made non-negative. Therefore, this patch renames SmallestTrackStart to ExplicitGridStart, and makes it return the unsigned which is usually desired. This patch should have no effect in practice. This patch is a port of https://crrev.com/777768 * rendering/Grid.cpp: (WebCore::Grid::setExplicitGridStart): (WebCore::Grid::explicitGridStart const): (WebCore::Grid::setNeedsItemsPlacement): * rendering/Grid.h: * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::rawGridTrackSize const): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat const): (WebCore::RenderGrid::placeItemsOnGrid const): (WebCore::RenderGrid::populateExplicitGridAndOrderIterator const): (WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild): 2020-07-15 Chris Dumez <cdumez@apple.com> Unreviewed atttempt to fix build after r264389. * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::HIDGamepadProvider::deviceRemoved): 2020-07-15 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Remove Display::LineBox::isConsideredEmpty https://bugs.webkit.org/show_bug.cgi?id=214335 Reviewed by Antti Koivisto. Display classes should not have layout related bits. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const): * layout/displaytree/DisplayLineBox.h: (WebCore::Display::LineBox::baselineOffset const): (WebCore::Display::LineBox::LineBox): (WebCore::Display::LineBox::isConsideredEmpty const): Deleted. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine): 2020-07-15 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Break circular reference between SourceBufferPrivateGStreamer and AppendPipeline https://bugs.webkit.org/show_bug.cgi?id=214345 Reviewed by Xabier Rodriguez-Calvar. SourceBufferPrivate is ref counted. AppendPipeline is owned exclusively by SourceBufferPrivateGStreamer: it's born and destroyed with it, managed by a never-moved unique_ptr. AppendPipeline needs a reference to SourceBufferPrivateGStreamer to notify it of essential events like samples having been parsed. This used to be a Ref<>, thus creating a circular reference leak: AppendPipeline is only destroyed in SourceBufferPrivateGStreamer destructor. AppendPipeline holds ref counted reference to SourceBufferPrivateGStreamer, therefore neither are destroyed. This patch breaks the cycle by replacing the Ref<> in AppendPipeline with a plain old reference. This is safe because SourceBufferPrivateGStreamer owns, and therefore is alive at least just as long as AppendPipeline. As a consequence of not using Ref<>, the SourceBufferPrivateGStreamer constructor does no longer need to relax the adoption requirements and unique_ptr<AppendPipeline> can be replaced by a UniqueRef<>. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::AppendPipeline): (WebCore::AppendPipeline::handleErrorConditionFromStreamingThread): (WebCore::AppendPipeline::handleStateChangeMessage): (WebCore::AppendPipeline::handleEndOfAppend): (WebCore::AppendPipeline::appsinkNewSample): (WebCore::AppendPipeline::didReceiveInitializationSegment): (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink): * platform/graphics/gstreamer/mse/AppendPipeline.h: (WebCore::AppendPipeline::sourceBufferPrivate): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: 2020-07-15 Brady Eidson <beidson@apple.com> Resolve race between IOHIDManager and GameController framework. <rdar://problem/65554490> and https://bugs.webkit.org/show_bug.cgi?id=214245 Reviewed by Tim Horton. No automated testing available. IOHIDDevices and IOHIDServices are two separate things. An IOHIDDevice and IOHIDService often have a 1-to-1 correlation, but the IOHIDDevice might be published to the application before the IOHIDService is. WebKit's HID gamepad manager uses IOHIDDevice. GameController.framework uses IOHIDServices. When we added the ability for WebKit to switch between HID and GCF, the following happens: - Sometimes the IOHIDServiceClient will get published first. Then when the IOHIDDevice is published, and WebKit was deciding which gamepad manager to use, the device's services are available, and we get the right answer. - Sometimes, the IOHIDDevice is published first. Then when WebKit is deciding which gamepad manager to use, it can't check the IOHIDServiceClient against GameController framework. So we have the HID manager handle the device... but then GCF comes along a split second later and ALSO handles it. The "device before service" scenario results in the same gamepad showing up twice. To resolve this, we do the following: 1 - If an IOHIDDevice attaches and its services aren't available yet, we delay managing it. 2 - When we delay managing a device, we start listening for IOHIDServiceClient additions. 3 - Each time a GamePad service is published, we once again try to determine if GCF will handle the device. 4 - As long as the answer is "Maybe" - instead of "Yes" or "No" - we refuse to manage the device. 5 - After a brief delay (currently 1 second), we will give up waiting for published services and manage the device with the HID gamepad provider. In my testing, when the service publishes after the devices, it's always within 50ms, (and usually just a spin or two of the runloop) so the 1s delay seems sufficient. NOTE: The above all holds true with the "MultiGamepadProvider" on Catalina. On Big Sur, there's brand new GameController framework API that makes this much easier. 👍 * platform/gamepad/mac/HIDGamepadProvider.h: * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::deviceAddedCallback): (WebCore::gameControllerFrameworkWillHandleHIDDevice): (WebCore::HIDGamepadProvider::waitForManagementDecisionForDevice): (WebCore::HIDGamepadProvider::removeDeviceWaitingForManagementDecision): (WebCore::HIDGamepadProvider::newGamePadServicePublished): (WebCore::HIDGamepadProvider::deviceAdded): (WebCore::HIDGamepadProvider::deviceRemoved): 2020-07-14 Zalan Bujtas <zalan@apple.com> Caret leaves trails behind when the editable content is subpixel positioned https://bugs.webkit.org/show_bug.cgi?id=214333 <rdar://problem/61914738> Reviewed by Simon Fraser. Replace integral rounding with pixelsnapping when painting the caret. The paint invalidation uses device pixel snapping and the actual painting needs to match it in order to not paint outside of the invalidated region. * editing/Editing.cpp: (WebCore::caretRendersInsideNode): (WebCore::rendererForCaretPainting): * editing/Editing.h: * editing/FrameSelection.cpp: (WebCore::FrameSelection::paintCaret): (WebCore::CaretBase::computeCaretColor): (WebCore::CaretBase::paintCaret const): (WebCore::DragCaretController::paintDragCaret const): * editing/FrameSelection.h: 2020-07-14 James Darpinian <jdarpinian@chromium.org> [WebGL2] vertexAttribI* and getFragDataLocation https://bugs.webkit.org/show_bug.cgi?id=214211 Reviewed by Dean Jackson. Passes all relevant WebGL 2 conformance tests. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getFragDataLocation): (WebCore::WebGL2RenderingContext::vertexAttribI4i): (WebCore::WebGL2RenderingContext::vertexAttribI4iv): (WebCore::WebGL2RenderingContext::vertexAttribI4ui): (WebCore::WebGL2RenderingContext::vertexAttribI4uiv): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::getVertexAttrib): (WebCore::WebGLRenderingContextBase::vertexAttribfImpl): (WebCore::WebGLRenderingContextBase::vertexAttribfvImpl): (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): * html/canvas/WebGLRenderingContextBase.h: (WebCore::WebGLRenderingContextBase::VertexAttribValue::initValue): * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::getFragDataLocation): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4i): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4iv): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4ui): (WebCore::GraphicsContextGLOpenGL::vertexAttribI4uiv): 2020-07-14 Kenneth Russell <kbr@chromium.org> [WebGL2] Implement compressedTex{Sub}Image*, copyTexSubImage3D https://bugs.webkit.org/show_bug.cgi?id=126449 Reviewed by Dean Jackson. Implement WebGL 2.0 entry points compressedTex{Sub}Image[23]D and copyTexSubImage3D. These require and use the ANGLE_robust_client_memory extension for size checking. Remove the associated entry points from GraphicsContextGL and subclasses, since they will never be used. Add needed pixel buffer object validation to the WebGL 1.0 versions of these APIs as well as to texImage2D and texSubImage2D. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::texImage2D): (WebCore::WebGL2RenderingContext::texSubImage2D): (WebCore::WebGL2RenderingContext::copyTexSubImage3D): (WebCore::WebGL2RenderingContext::compressedTexImage2D): (WebCore::WebGL2RenderingContext::compressedTexImage3D): (WebCore::WebGL2RenderingContext::compressedTexSubImage2D): (WebCore::WebGL2RenderingContext::compressedTexSubImage3D): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLRenderingContextBase.cpp: * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::copyTexSubImage3D): (WebCore::GraphicsContextGLOpenGL::compressedTexImage3D): Deleted. (WebCore::GraphicsContextGLOpenGL::compressedTexSubImage3D): Deleted. * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::compressedTexImage3D): Deleted. (WebCore::GraphicsContextGLOpenGL::compressedTexSubImage3D): Deleted. 2020-07-14 Chris Dumez <cdumez@apple.com> Drop cache of subframe count on the Page https://bugs.webkit.org/show_bug.cgi?id=214312 <rdar://problem/65433615> Reviewed by Geoffrey Garen. Drop cache of subframe count on the Page as it is error-prone to keep it up to date and it is not performance sensitive. We only need the subframe count when trying to load a new iframe to see if we reached the maximum number of subframes (1000). Calculating this count is also not very expensive since we merely need to iterate the frame tree, which is composed of at most 1000 frames. * history/CachedFrame.cpp: (WebCore::CachedFrame::CachedFrame): (WebCore::CachedFrame::open): * loader/FrameLoader.cpp: (WebCore::FrameLoader::closeAndRemoveChild): * page/Frame.cpp: (WebCore::Frame::Frame): (WebCore::Frame::disconnectOwnerElement): * page/FrameTree.cpp: (WebCore::FrameTree::childCount const): (WebCore::FrameTree::descendantCount const): * page/FrameTree.h: * page/Page.cpp: (WebCore::Page::subframeCount const): * page/Page.h: 2020-07-14 James Darpinian <jdarpinian@chromium.org> Implement uniform* and getUniform for WebGL 2 types https://bugs.webkit.org/show_bug.cgi?id=214116 Reviewed by Dean Jackson. Passes all relevant WebGL conformance tests. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getFragDataLocation): (WebCore::WebGL2RenderingContext::uniform1ui): (WebCore::WebGL2RenderingContext::uniform2ui): (WebCore::WebGL2RenderingContext::uniform3ui): (WebCore::WebGL2RenderingContext::uniform4ui): (WebCore::WebGL2RenderingContext::uniform1uiv): (WebCore::WebGL2RenderingContext::uniform2uiv): (WebCore::WebGL2RenderingContext::uniform3uiv): (WebCore::WebGL2RenderingContext::uniform4uiv): (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv): (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv): (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv): (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv): (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv): (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv): (WebCore::WebGL2RenderingContext::uniform1fv): (WebCore::WebGL2RenderingContext::uniform2fv): (WebCore::WebGL2RenderingContext::uniform3fv): (WebCore::WebGL2RenderingContext::uniform4fv): (WebCore::WebGL2RenderingContext::uniform1iv): (WebCore::WebGL2RenderingContext::uniform2iv): (WebCore::WebGL2RenderingContext::uniform3iv): (WebCore::WebGL2RenderingContext::uniform4iv): (WebCore::WebGL2RenderingContext::uniformMatrix2fv): (WebCore::WebGL2RenderingContext::uniformMatrix3fv): (WebCore::WebGL2RenderingContext::uniformMatrix4fv): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::getUniform): (WebCore::WebGLRenderingContextBase::uniform1fv): (WebCore::WebGLRenderingContextBase::uniform2fv): (WebCore::WebGLRenderingContextBase::uniform3fv): (WebCore::WebGLRenderingContextBase::uniform4fv): (WebCore::WebGLRenderingContextBase::uniform1iv): (WebCore::WebGLRenderingContextBase::uniform2iv): (WebCore::WebGLRenderingContextBase::uniform3iv): (WebCore::WebGLRenderingContextBase::uniform4iv): (WebCore::WebGLRenderingContextBase::uniformMatrix2fv): (WebCore::WebGLRenderingContextBase::uniformMatrix3fv): (WebCore::WebGLRenderingContextBase::uniformMatrix4fv): (WebCore::WebGLRenderingContextBase::validateUniformParameters): (WebCore::WebGLRenderingContextBase::validateUniformMatrixParameters): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::getUniformuiv): (WebCore::GraphicsContextGLOpenGL::getFragDataLocation): (WebCore::GraphicsContextGLOpenGL::uniform1ui): (WebCore::GraphicsContextGLOpenGL::uniform2ui): (WebCore::GraphicsContextGLOpenGL::uniform3ui): (WebCore::GraphicsContextGLOpenGL::uniform4ui): (WebCore::GraphicsContextGLOpenGL::uniform1uiv): (WebCore::GraphicsContextGLOpenGL::uniform2uiv): (WebCore::GraphicsContextGLOpenGL::uniform3uiv): (WebCore::GraphicsContextGLOpenGL::uniform4uiv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2x3fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3x2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2x4fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4x2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3x4fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4x3fv): (WebCore::GraphicsContextGLOpenGL::uniform1fv): (WebCore::GraphicsContextGLOpenGL::uniform2fv): (WebCore::GraphicsContextGLOpenGL::uniform3fv): (WebCore::GraphicsContextGLOpenGL::uniform4fv): (WebCore::GraphicsContextGLOpenGL::uniform1iv): (WebCore::GraphicsContextGLOpenGL::uniform2iv): (WebCore::GraphicsContextGLOpenGL::uniform3iv): (WebCore::GraphicsContextGLOpenGL::uniform4iv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix2fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix3fv): (WebCore::GraphicsContextGLOpenGL::uniformMatrix4fv): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::getUniformuiv): 2020-07-14 Per Arne Vollan <pvollan@apple.com> [iOS] Avoid loading media libraries in Document::visibilityStateChanged() if not needed https://bugs.webkit.org/show_bug.cgi?id=214304 <rdar://problem/65005038> Unreviewed, address additional review comments. * dom/Document.cpp: (WebCore::Document::visibilityStateChanged): 2020-07-14 Jer Noble <jer.noble@apple.com> Add support for parsing VP-style codec strings. https://bugs.webkit.org/show_bug.cgi?id=214270 Reviewed by Eric Carlson. Test: media/vp-codec-parameters.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/VP9Utilities.cpp: Added. (WebCore::validVPLevels): (WebCore::validColorPrimaries): (WebCore::parseVPCodecParameters): * platform/graphics/VP9Utilities.h: Added. * testing/Internals.cpp: (WebCore::Internals::parseVPCodecParameters): * testing/Internals.h: * testing/Internals.idl: 2020-07-14 Said Abou-Hallawa <sabouhallawa@apple.com> When invalidating the clients of an SVG resource we should not go beyond the RenderSVGRoot https://bugs.webkit.org/show_bug.cgi?id=211804 <rdar://problem/60308199> Reviewed by Zalan Bujtas. ComplexLineLayout::layoutLineBoxes() walks through the renderers of a line. The order of this walk may include a node and its children. For example the layout of a RenderInline may be run first, then it is followed by the layout for a RenderSVGRoot which happens to be a child of the RenderInline. If the RenderSVGRoot has a dirty RenderSVGResource, e.g. RenderSVGResourceClipper, this resource will call RenderSVGResource::markForLayoutAndParentResourceInvalidation() which will invalidate its ancestors including RenderSVGRoot and RenderInline by setting the normalChildNeedsLayoutBit() for each of them. The layout of SVG is hierarchical which means RenderSVGRoot will finish its layout after finishing the layout of all its descendants including this RenderSVGResource. So dirtying the RenderSVGRoot is this scenario is okay since RenderSVGRoot will do another SVGRenderSupport::layoutChildren() and will clear its needsLayout bits before it returns. The problem happens because we set normalChildNeedsLayoutBit for the containing RenderInline and this leaves the render tree dirty. Later Document::resolveStyle() may called to invalidate an SVG element e.g. RenderSVGPath. So setNeedsLayout() is called for this object. Because the normalChildNeedsLayoutBit() is set for the RenderInline, RenderObject::markContainingBlocksForLayout() stops in the middle and do not mark the containing RenderBlock. So we end up with a render tree like this: + RenderView + HTML RenderBlock + BODY RenderBody - RenderBlock + ANY-ELEMENT RenderInline + svg RenderSVGRoot - clipPath RenderSVGResourceClipper + polygon RenderSVGPath where the '+' means needsLayout() is true and '-' means needsLayout() is false. So the layout will not run for RenderBlock with '-' sign. And we end up with dirty RenderSVGPath or even worse RenderSVGPath with uninitialized m_path. So a null pointer deref may happen. The fix is to prevent mutating the render tree while running the layout of the SVG resource. This can be done by making the RenderSVGResource not dirtying any renderer beyond the RenderSVGRoot when it finishes its layout. The SVG resource layout should not affect the intrinsic size of the SVG if it is embedded in an HTML document. In RenderObject::markContainingBlocksForLayout(), we do something similar when we break if the ancestor is objectIsRelayoutBoundary(). Test: svg/in-html/inline-svg-resource-dynamic-update.html * rendering/svg/RenderSVGResource.cpp: (WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation): * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::layout): * rendering/svg/RenderSVGRoot.h: 2020-07-14 Per Arne Vollan <pvollan@apple.com> [iOS] Avoid loading media libraries in Document::visibilityStateChanged() if not needed https://bugs.webkit.org/show_bug.cgi?id=214304 <rdar://problem/65005038> Reviewed by Darin Adler. When the shared PlatformMediaSessionManager is created and accessed for the first time, some media libraries are loaded. There should be no need to access the shared PlatformMediaSessionManager if no manager has been created in Document::visibilityStateChanged(). No new tests, since this patch does not change behavior. * dom/Document.cpp: (WebCore::Document::visibilityStateChanged): 2020-07-14 Jonathan Bedard <jbedard@apple.com> [watchOS] Support armv7k build https://bugs.webkit.org/show_bug.cgi?id=214306 <rdar://problem/65549901> Reviewed by Aakash Jain. No new tests, build fix. * Configurations/Base.xcconfig: Disable 64 to 32 bit conversion warning for armv7k. 2020-07-14 Eric Carlson <eric.carlson@apple.com> [macOS] Do not update ScreenTime when in private browsing mode https://bugs.webkit.org/show_bug.cgi?id=214288 <rdar://problem/63735067> Reviewed by Jer Noble. Test: media/media-usage-state-private-browsing.html * html/MediaElementSession.cpp: (WebCore::MediaElementSession::updateMediaUsageIfChanged): Return early if the page is in private mode. 2020-07-14 Clark Wang <clark_wang@apple.com> Updated AudioContext constructor according to spec https://bugs.webkit.org/show_bug.cgi?id=214267 Reviewed by Chris Dumez. Updated AudioContext constructor according to spec: https://www.w3.org/TR/webaudio/#AudioContext-constructors. Added in files accordingly to support AudioContextOptions. Re-baselined existing tests. One new test case passes, and one fails due to current accepted range for sampleRate. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::create): (WebCore::AudioContext::AudioContext): * Modules/webaudio/AudioContext.h: (WebCore::AudioContext::create): * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioContextLatencyCategory.h: Added. * Modules/webaudio/AudioContextLatencyCategory.idl: Added. * Modules/webaudio/AudioContextOptions.h: Added. * Modules/webaudio/AudioContextOptions.idl: Added. * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): * Modules/webaudio/BaseAudioContext.h: * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode): * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::PannerNode): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-14 Justin Fan <justin_fan@apple.com> [WebGL] REGRESSION (r262366): Google search photos do not render, black images https://bugs.webkit.org/show_bug.cgi?id=214156 <rdar://problem/64964922> Reviewed by Dean Jackson. http://trac.webkit.org/changeset/262366 separated WebGL canvas contents swapping and presentation into two steps. This Google search page was only running the presentation code without the swapping step, as it removes canvases from the observer Document before the Document is able to swap its canvas' contents. Ensure that re-inserted canvas elements properly register their new Documents as observers. Covered by existing tests. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::insertedIntoAncestor): * html/HTMLCanvasElement.h: 2020-07-14 Fujii Hironori <Hironori.Fujii@sony.com> Unreviewed non-unified build fixes * bindings/js/CommonVM.cpp: * html/canvas/CanvasRenderingContext2DBase.cpp: * html/canvas/CanvasStyle.cpp: * platform/graphics/GradientImage.cpp: * rendering/svg/RenderSVGPath.cpp: 2020-07-13 Fujii Hironori <Hironori.Fujii@sony.com> Unreviewed non-unified build fixes * animation/CSSTransition.cpp: * html/HTMLFormControlElement.cpp: * html/ImageData.cpp: * inspector/InspectorInstrumentationWebKit.h: * layout/FormattingContextGeometry.cpp: * layout/floats/FloatingContext.cpp: * layout/floats/FloatingState.cpp: * layout/tableformatting/TableFormattingContext.cpp: * loader/MediaResourceLoader.cpp: * platform/FrameRateMonitor.h: * platform/graphics/ColorSerialization.cpp: * platform/graphics/ColorSerialization.h: * svg/SVGNumber.h: * svg/SVGParserUtilities.h: * svg/SVGTransformList.cpp: * svg/SVGZoomAndPan.cpp: 2020-07-13 Peng Liu <peng.liu6@apple.com> Keyboard remains on full screen video view after back from PiP https://bugs.webkit.org/show_bug.cgi?id=214287 Reviewed by Daniel Bates. Make the window for video fullscreen and picture-in-picture support the key window after the video returns to fullscreen from the picture-in-picture mode. Otherwise, the WebAVPlayerViewController cannot become the first responder. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::didStopPictureInPicture): 2020-07-13 Zalan Bujtas <zalan@apple.com> [RenderTreeNeedsLayoutChecker] imported/w3c/web-platform-tests/html/rendering/replaced-elements/embedded-content/video-controls-vertical-writing-mode.html asserts https://bugs.webkit.org/show_bug.cgi?id=214281 <rdar://problem/56740133> Reviewed by Simon Fraser. While percentage height descendant computation runs on the containing block chain, when we mark the ancestors for layout, we need to traverse the parent (container) chain rather than the containing block chain. Containing block traversal skips certain non-block renderers which leaves gap between dirty renderers. Renderer[A] + dirty Renderer[B] - not dirty Renderer[C] + dirty During layout this gap (Renderer[B]) makes us exit early, resulting dirty leftover renderers (Renderer[C]). This is similar to what we do in RenderObject::markContainingBlocksForLayout. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants): 2020-07-13 Andres Gonzalez <andresg_22@apple.com> REGRESSION: (r257915?) [ Mac ] accessibility/accessibility-node-memory-management.html is flaky failing. https://bugs.webkit.org/show_bug.cgi?id=208930 Reviewed by Chris Fleizach. Test: accessibility/accessibility-node-memory-management.html In some cases, such as the empty canvas in this test, the algorithm in AXIsolatedTree::updateChildren to only update the children that are added or removed does not work. In those cases, fallback to updating the entire subtree. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateChildren): 2020-07-13 Keith Miller <keith_miller@apple.com> ScriptController needs to SetForScope m_sourceURL after Refing its Frame https://bugs.webkit.org/show_bug.cgi?id=214276 Reviewed by Chris Dumez. The SetForScopes in ScriptController need to be constructed after the Frame is retained otherwise the Ref to the frame may be destroyed before m_sourceURL is restored. Since the Frame owns the ScriptController we end up writing the SourceURL after the ScriptController has been freed. No new tests because my recent code change already caused ASAN failures. * bindings/js/ScriptController.cpp: (WebCore::ScriptController::evaluateInWorld): (WebCore::ScriptController::evaluateModule): (WebCore::ScriptController::callInWorld): 2020-07-13 Geoffrey Garen <ggaren@apple.com> Unreviewed, re-landing r264242 with crash fixed. Re-landed changeset: "JSRunLoopTimer should use WTF::RunLoop rather than custom CF code" https://bugs.webkit.org/show_bug.cgi?id=214102 https://trac.webkit.org/changeset/264242 * bindings/js/CommonVM.cpp: (WebCore::commonVMSlow): 2020-07-13 Eric Carlson <eric.carlson@apple.com> Impossible to pause playback of MediaStream video track https://bugs.webkit.org/show_bug.cgi?id=214262 <rdar://problem/65483729> Reviewed by Jer Noble. These changes were tested manually because they don't change the behavior when snapshotting or rendering to canvas. * platform/graphics/avfoundation/SampleBufferDisplayLayer.h: Add pure virtual play and pause methods. * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h: (WebCore::LocalSampleBufferDisplayLayer::play): New, toggle m_paused. (WebCore::LocalSampleBufferDisplayLayer::pause): Ditto. * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm: (WebCore::LocalSampleBufferDisplayLayer::enqueueSample): Return early if paused. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Pause the display layer if necessary. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Start display layer. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Pause display layer. 2020-07-13 Sam Weinig <weinig@apple.com> Replace single argument makeSimpleColor uses with their implementation https://bugs.webkit.org/show_bug.cgi?id=214240 Reviewed by Darin Adler. Remove makeSimpleColor overloads that took SRGBA<uint8_t> and SRGBA<float>: - makeSimpleColor(SRGBA<uint8_t>) was a no-op, so is replaced with nothing. - makeSimpleColor(SRGBA<float>) is replaced by the function it called, convertToComponentBytes(). * css/StyleColor.cpp: (WebCore::StyleColor::colorFromKeyword): * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseHSLParameters): * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::setShadow): * html/canvas/CanvasStyle.cpp: (WebCore::CanvasStyle::CanvasStyle): (WebCore::CanvasStyle::isEquivalent const): * platform/graphics/Color.cpp: (WebCore::Color::lightened const): (WebCore::Color::darkened const): * platform/graphics/SimpleColor.h: * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::makeSimpleColorFromARGBCFArray): * platform/graphics/filters/FilterOperations.cpp: (WebCore::FilterOperations::transformColor const): (WebCore::FilterOperations::inverseTransformColor const): * platform/graphics/mac/ColorMac.mm: (WebCore::makeSimpleColorFromNSColor): (WebCore::colorFromNSColor): (WebCore::semanticColorFromNSColor): * platform/graphics/win/PlatformContextDirect2D.cpp: (WebCore::PlatformContextDirect2D::brushWithColor): * platform/ios/ColorIOS.mm: (WebCore::colorFromUIColor): 2020-07-13 Sihui Liu <sihui_liu@appe.com> Text manipulation does not observe manipulated text after update https://bugs.webkit.org/show_bug.cgi?id=213318 <rdar://problem/63766703> Reviewed by Geoffrey Garen. Make TextManipulationController be aware of content replacement on Text and extract the new content. Test: TextManipulation.CompleteTextManipulationForManipulatedTextWithNewContent * dom/CharacterData.h: * dom/Text.cpp: (WebCore::Text::setDataAndUpdate): * dom/Text.h: * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::didCreateRendererForElement): (WebCore::TextManipulationController::didUpdateContentForText): (WebCore::TextManipulationController::scheduleObservationUpdate): * editing/TextManipulationController.h: * editing/markup.cpp: 2020-07-13 Keith Miller <keith_miller@apple.com> Clean up SourceProvider and add caller relative load script to jsc.cpp https://bugs.webkit.org/show_bug.cgi?id=214205 Reviewed by Yusuke Suzuki. Refactor WebCore <-> JSC binding layer now that JSC uses WTF::URLs for SourceOrigins. Also, improve module loading error messages to include the specifier and referrer when producing errors around bare-name specifiers. New error message behavior is already tested so existing tests have been updated. * bindings/js/CachedScriptSourceProvider.h: (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider): * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent): * bindings/js/JSEventListener.h: (WebCore::JSEventListener::sourceURL const): * bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::JSLazyEventListener): (WebCore::JSLazyEventListener::initializeJSFunction const): (WebCore::JSLazyEventListener::create): * bindings/js/JSLazyEventListener.h: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::evaluateInWorld): (WebCore::ScriptController::evaluateModule): (WebCore::ScriptController::callInWorld): * bindings/js/ScriptController.h: (WebCore::ScriptController::sourceURL const): * bindings/js/ScriptModuleLoader.cpp: (WebCore::resolveModuleSpecifier): (WebCore::rejectPromise): * bindings/js/ScriptSourceCode.h: (WebCore::ScriptSourceCode::ScriptSourceCode): (WebCore::ScriptSourceCode::url const): 2020-07-13 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Discard PTS-less samples https://bugs.webkit.org/show_bug.cgi?id=214252 Reviewed by Philippe Normand. In some cases GStreamer demuxers emit PTS-less samples with metadata at the beginning of the container. These are fortunately not necessary for playback, and in fact incompatible with the way MSE works, where you should be able to start playing a stream from the middle. This patch skips these frames in the AppendPipeline so they don't pollute other parts of the MSE codebase. Since these frames were not necessary and were later overwritten, this patch is just a cleanup introducing no notable behavior changes. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::appsinkNewSample): 2020-07-13 Carlos Garcia Campos <cgarcia@igalia.com> [WPE][GTK4] Form controls are not painted when using threaded rendering https://bugs.webkit.org/show_bug.cgi?id=214178 Reviewed by Žan Doberšek. Which is the default for GTK4 since r263888. The problem is that RenderTheme::paint() returns early if the given GraphicsContext doesn't have a platform context, assuming all RenderTheme implementations paint directly to the platform context. This patch adds a pure virtual canPaint() to RenderTheme to be used as the early return. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::paint): * rendering/RenderTheme.h: * rendering/RenderThemeAdwaita.h: * rendering/RenderThemeCocoa.h: * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::canPaint const): * rendering/RenderThemePlayStation.h: * rendering/RenderThemeWin.h: 2020-07-13 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer] Unreviewed, remove private debug code When I landed the OpenCDM code I accidentally landed a couple of things that were internal debug that is not useful upstream. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): (WebCore::MediaPlayerPrivateGStreamer::handleMessage): 2020-07-12 Darin Adler <darin@apple.com> Some further streamlining of Gradient handling code https://bugs.webkit.org/show_bug.cgi?id=214239 Reviewed by Sam Weinig. * platform/graphics/cairo/GradientCairo.cpp: (WebCore::interpolateColorStop): Deleted. (WebCore::createConic): Rewrite the interpolation code to create a new vector rather than edit the existing one and to use a more straightforward idiom, and a lambda rather than a helper function. Also removed an explicit conversion to Gradient::ColorStop, no longer needed because of the overload added to Vector::insert. * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::applyResource): Use ensure rather than add to initialize gradient data in the gradient map. Change the #if for USE(CG) so it doesn't confuse brace matching from the syntax handling of text editors like the one in Xcode. Update for the changes to the buildGradient and gradientTransform functions. Use auto a bit more. (WebCore::RenderSVGResourceGradient::postApplyResource): Update since the map now contains GradientData rather than unique_ptr<GradientData>. Use std::exchange when fetching m_savedContext and a local variable to make the gradient-related code a bit less wordy. (WebCore::RenderSVGResourceGradient::addStops): Updated to take Gradient& rather than GradientData* and made this a static member function. (WebCore::RenderSVGResourceGradient::platformSpreadMethodFromSVGType): Made this a static member function. * rendering/svg/RenderSVGResourceGradient.h: Made more functions private. Converted addStops and platformSpreadMethodFromSVGType to static member functions. Made GradientData a member class, and put directly into the HashMap rather than putting unique_ptr into the map. Changed calculateGradientTransform to gradientTransform, which uses a return value rather than an out argument. Changed buildGradient to return Ref<Gradient> rather than taking a GradientData* to store it in. * rendering/svg/RenderSVGResourceLinearGradient.cpp: (WebCore::RenderSVGResourceLinearGradient::buildGradient const): Changed to return the gradient instead of modifying an argument and updated for the change to addStops. * rendering/svg/RenderSVGResourceLinearGradient.h: Made more functions private and updated for changes to gradientTransform and buildGradient. * rendering/svg/RenderSVGResourceRadialGradient.cpp: (WebCore::RenderSVGResourceRadialGradient::buildGradient const): Changed to return the gradient instead of modifying an argument and updated for the change to addStops. * rendering/svg/RenderSVGResourceRadialGradient.h: Made more functions private and updated for changes to gradientTransform and buildGradient. * svg/GradientAttributes.h: Removed the stopsSet boolean since the stops vector is empty if and only if it's not set. Made the setStops function take an rvalue reference so it doesn't always copy a vector. Also use the ColorStopVector type, sharing the same inline capacity policy with the Gradient class; both are optimizing the same thing. * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::buildStops): Use the ColorStopVector type. * svg/SVGGradientElement.h: Update for the above. * svg/SVGLinearGradientElement.cpp: (WebCore::setGradientAttributes): Update for changes to buildStops and removed an unnecessary check for an empty vector now that an empty vector has the same semantics as "no stops". * svg/SVGRadialGradientElement.cpp: (WebCore::setGradientAttributes): Ditto. 2020-07-12 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo][Clang] Unreviewed build fix for r264272 https://bugs.webkit.org/show_bug.cgi?id=214204 <rdar://problem/65414170> clang-cl reported: > ..\..\Source\WebCore\platform\graphics/ColorUtilities.h(200,26): error: no template named 'ComponentTraits' > constexpr auto min = ComponentTraits<typename ColorType::ComponentType>::minValue; > ^ * platform/graphics/ColorUtilities.cpp: Removed #include "ColorTypes.h". * platform/graphics/ColorUtilities.h: Added #include "ColorTypes.h". 2020-07-12 Said Abou-Hallawa <sabouhallawa@apple.com> [macOS]: A HEIF image, selected from the OpenPanel, should be converted to an accepted MIME type https://bugs.webkit.org/show_bug.cgi?id=213347 <rdar://problem/57258464> Reviewed by Darin Adler. Tests: fast/forms/file/entries-api/image-no-transcode-open-panel.html fast/forms/file/entries-api/image-transcode-open-panel.html * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::allowedMIMETypes): Make sure this function returns lowercase MIME types. * platform/MIMETypeRegistry.h: * platform/graphics/NativeImage.h: * platform/graphics/cg/NativeImageCG.cpp: (WebCore::drawNativeImage): 2020-07-12 Sam Weinig <weinig@apple.com> Tidy up color usage in accessibility code https://bugs.webkit.org/show_bug.cgi?id=214226 Reviewed by Darin Adler. Rather than passing around r, g, b components as out-parameters, use SRGBA<uint8_t> return values. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::colorValue const): * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (webkitAccessibleTextGetText): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): (WebCore::AXIsolatedObject::colorValue const): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 2020-07-12 Rob Buis <rbuis@igalia.com> Improve IPv6 detection when setting host/hostname https://bugs.webkit.org/show_bug.cgi?id=214218 Reviewed by Darin Adler. Improve IPv6 detection when setting host/hostname by checking for '[' and ']' as well as using reverse find for ':' separators, to ensure we are not finding a separator within the IPv6 section of the url. Behavior matches Chrome and Firefox. Test: imported/w3c/web-platform-tests/url/url-setters.html * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setHost): 2020-07-12 Zalan Bujtas <zalan@apple.com> [LFC][BFC][Min-Max width] Regular block level box resets the horizontal stacking https://bugs.webkit.org/show_bug.cgi?id=214225 Reviewed by Antti Koivisto. Non-floating block level boxes reset the current horizontal float stacking. e.g. with a shrink-to-fit width container: <div style="float: left; width: 10px;"></div> <div></div> <div style="float: left; width: 40px;"></div> will produce a max width of 40px which makes the floats vertically stacked. Test: fast/layoutformattingcontext/min-max-content-width-with-nested-floats-simple.html * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): 2020-07-12 Darin Adler <darin@apple.com> Simplify and improve Gradient, some other small color-related removals https://bugs.webkit.org/show_bug.cgi?id=214221 Reviewed by Sam Weinig. * css/CSSGradientValue.cpp: Removed some unneeded includes. * html/ColorInputType.cpp: (WebCore::ColorInputType::currentColor): Deleted. (WebCore::ColorInputType::shouldShowSuggestions const): Deleted. * html/ColorInputType.h: Updated for the above. * html/HTMLDocument.cpp: Removed unneeded include of HashTools.h. * html/canvas/CanvasGradient.cpp: (WebCore::CanvasGradient::create): Moved these functions out of the header since inlining should be the same or better with them here. (WebCore::CanvasGradient::~CanvasGradient): Moved this out of the header so we don't need to include Gradient.h in the header. (WebCore::CanvasGradient::addColorStop): Updated for change to Gradient::addColorStop and move Color rather than copying it. * html/canvas/CanvasGradient.h: Removed include of Gradient.h. Moved things out of the header to make that work. * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildArrayForCanvasGradient): Removed use of Gradient::type and instead unify the type string code with the code that interprets the data for the different types. * page/FrameView.cpp: (WebCore::FrameView::recalculateScrollbarOverlayStyle): Refactored to eliminate the multiple redundant code paths, otherwising leaving the logic unchanged. * platform/ColorChooserClient.h: Remove unneeded includes and unused currentColor and shouldShowSuggestions functions. * platform/graphics/Gradient.cpp: (WebCore::Gradient::create): Replaced create functions that take type-specific data structure with one that takes the variant Data. (WebCore::Gradient::Gradient): Ditto. Also removed platformInit. (WebCore::Gradient::~Gradient): Removed platformDestroy. (WebCore::Gradient::type const): Deleted. (WebCore::Gradient::addColorStop): Take an rvalue reference to cut down a little bit on reference count churn. Replaced the platformDestroy function with a new stopsChanged function. Removed an unneeded overload that takes the two parts of a ColorStop separately. (WebCore::Gradient::setSortedColorStops): Use stopsChanged. (WebCore::Gradient::sortStops const): Simplify a bit, using a lambda. Also gave this a shorter name; it still optimizes by not sorting if the vector is already sorted. (WebCore::Gradient::hasAlpha const): Deleted. (WebCore::Gradient::setSpreadMethod): Removed some slightly overzealous code checking this isn't used after creating the platform-specific gradient. Decided not to bother with this for now. (WebCore::Gradient::setGradientSpaceTransform): Tweaked formatting. (WebCore::add): Added overloads to add(Hasher&) so we can use computeHash. (WebCore::Gradient::hash const): Use computeHash instead of hashMemory. * platform/graphics/Gradient.h: Use RetainPtr, COMPtr, and RefPtr instead of manually managing the lifetimes of the platform-specific underlying gradient objects. Also removed the unhelpful PlatformGradient type. This pattern, all too common in our platform library, provides no useful abstraction here. Removed unneeded constructors from ColorStop. Updated for changes above. Added platform-specific functions createBrush, createPattern, and createCGGradient. Simplify encoding and decoding by taking advantage of the support for encoding/decoding variants. Remove the enum Gradient::Type entirely. Removed the invalidateHash function because it's only used in a few setters and setting the hash to 0 is a fine way to write it there. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContextState::GraphicsContextState): Moved here from the header so we don't need to include Gradient.h in the header. (WebCore::GraphicsContextState::~GraphicsContextState): Ditto. (WebCore::GraphicsContextState::operator=): Ditto. * platform/graphics/GraphicsContext.h: Removed include of Gradient.h. Moved things out of the header to make that work. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::FillSource::FillSource): Use createPattern instead of createPlatformGradient. (WebCore::Cairo::StrokeSource::StrokeSource): Ditto. * platform/graphics/cairo/GradientCairo.cpp: (WebCore::Gradient::stopsChanged): Renamed from platformDestroy. (WebCore::interpolateColorStop): Rewrote to use existing blend functions. (WebCore::createConic): Changed return type to RefPtr. Tweaked to match WebKit coding style a bit better, use auto, use Vector::first/last, and updated for removal of the Gradient::ColorStop constructor. (WebCore::Gradient::createPattern): Renamed from createPlatformGradient. Changed to return a RefPtr instead of a raw pointer the caller needs to adopt at each call site. Refactored so it no longer uses Gradient::type. (WebCore::Gradient::fill): Use createPattern. * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::fillRect): Ditto. * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::stopsChanged): Renamed from platformDestroy, and simplified implementation now that we use RetainPtr. (WebCore::Gradient::createCGGradient): Renamed from platformGradient, got rid of the return value, and made it caller responsibility to only call this when a gradeitn needs to be allocated. (WebCore::Gradient::paint): Updated to use the above. * platform/graphics/cg/GraphicsContextCG.cpp: Add include of Gradient.h. * platform/graphics/displaylists/DisplayListItems.h: Added include of Gradient.h since the function templates in this file encode and decode gradients. * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: (Nicosia::CairoOperationRecorder::fillRect): Use createPattern. * platform/graphics/win/Direct2DOperations.cpp: (WebCore::Direct2D::FillSource::FillSource): Use createBrush (WebCore::Direct2D::StrokeSource::StrokeSource): Ditto. * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::stopsChanged): Renamed from platformDestroy and simplified implementation now that we use COMPtr. (WebCore::Gradient::platformGradient): Deleted. (WebCore::Gradient::createPlatformGradientIfNecessary): Deleted. (WebCore::Gradient::createBrush): Renamed from generateGradient and added a return value. Simplified now that we use COMPtr, optimized the code a bit, and added some FIXME about mistakes I noticed. (WebCore::Gradient::fill): Use createBrush and m_brush. * platform/graphics/win/GraphicsContextImplDirect2D.cpp: (WebCore::GraphicsContextImplDirect2D::fillRect): Use createBrush. * platform/mac/ScrollAnimatorMac.mm: Added include of Gradient.h. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintProgressBar): Updated for changes to addColorStop. Also remove a lot of unnecessary conversion from float to double and back to float. * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::addStops): Update to make and move a new color stop instead of copying it, modifying it in place, and then copying it again. * rendering/svg/RenderSVGResourceGradient.cpp: Removed include of Gradient.h. * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::buildStops): Use std::clamp to convert the offsets into monotonically increasing ones in a more direct way, using variable names instead of comments to clarify what we are doing. 2020-07-12 Yusuke Suzuki <ysuzuki@apple.com> Unreviewed, fix GTK debian builds Include <functional> in ExtendedColor.h since it uses std::invoke. * platform/graphics/ExtendedColor.h: 2020-07-11 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] Conic gradients support https://bugs.webkit.org/show_bug.cgi?id=214216 Reviewed by Sam Weinig. * platform/graphics/cairo/GradientCairo.cpp: (WebCore::addConicSector): Replaced M_PI with piDouble of WTF. (WebCore::Gradient::createPlatformGradient): Don't use C++20 designated initializers. 2020-07-11 Sam Weinig <weinig@apple.com> Reduce surface area of the ExtendedColor class to a bare minimum https://bugs.webkit.org/show_bug.cgi?id=214204 Reviewed by Darin Adler. - Add helper function to Color to operate on the underlying color type and reimplement a bunch of functionality using it, reducing the need for duplicate implementations in ExtendedColor. - Add constructors to Color that take extended color types, replacing the makeExtendedColor helper function. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Remove ExtenedColor.cpp * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters): Use new Color constructor taking ColorComponents and ColorSpace. * platform/graphics/Color.cpp: (WebCore::Color::colorWithAlpha const): Reimpliment using callOnUnderlyingType. (WebCore::Color::invertedColorWithAlpha const): Reimpliment using callOnUnderlyingType. * platform/graphics/Color.h: (WebCore::Color::Color): (WebCore::Color::hash const): (WebCore::Color::callOnUnderlyingType const): (WebCore::Color::toSRGBALossy const): (WebCore::Color::setColor): (WebCore::Color::isBlackColor): (WebCore::Color::isWhiteColor): - Add new constructors taking extended color types: SRGBA<float>, LinearSRGBA<float> and DiplayP3<float>. - Add new function, callOnUnderlyingType, to make working with any underlying type more streamlined. * platform/graphics/ColorConversion.h: (WebCore::toSRGBA): (WebCore::toLinearSRGBA): (WebCore::toDisplayP3): (WebCore::toLinearDisplayP3): (WebCore::toHSLA): Add identity conversion functions to make implementing generic functions like Color::toSRGBALossy more straigtforward. * platform/graphics/ColorSerialization.cpp: (WebCore::serialization): (WebCore::serializationForCSS): (WebCore::serializationForHTML): (WebCore::serializationForRenderTreeAsText): * platform/graphics/ColorSerialization.h: Replace serialization of the ExtendedColor type itself, with serialization for the underlying color types. Use callOnUnderlyingType to dispatch to the right one. * platform/graphics/ColorTypes.h: - Adds ComponentTraits struct to get information like min/max value of the component types. - Adds `using ComponentType = T;` to each color type, to allow easy access to the type in deduced contexts. - Adds static constexpr ColorSpace to each color type that currently has a ColorSpace mapping. * platform/graphics/ColorUtilities.h: (WebCore::isBlack): (WebCore::isWhite): Add helpers to implement Color::isBlack/Color::isWhiteColor for each color type. * platform/graphics/ExtendedColor.cpp: Removed. * platform/graphics/ExtendedColor.h: (WebCore::ExtendedColor::create): (WebCore::ExtendedColor::ExtendedColor): (WebCore::ExtendedColor::callOnUnderlyingType const): (WebCore::ExtendedColor::toSRGBALossy const): Deleted. Reduce down to just construction, member access and the callOnUnderlyingType helper. In future revisions, ExtendedColor should be converted to an internal class of Color. * platform/graphics/gtk/ColorGtk.cpp: (WebCore::Color::Color): * platform/graphics/win/ColorDirect2D.cpp: (WebCore::Color::Color): Update to use constructor delegation. 2020-07-11 Darin Adler <darin@apple.com> Remove live ranges from AccessibilityObject.h, AccessibilityObjectInterface.h, AccessibilityRenderObject.h, AXIsolatedObject.h https://bugs.webkit.org/show_bug.cgi?id=214215 Reviewed by Sam Weinig. Also use the IntPoint and LayoutPoint center() functions instead of rolling our own. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::misspellingRange const): Return SimpleRange. Also renamed from getMisspellingRange. (WebCore::rangeClosestToRange): Take and return SimpleRange. (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): Ditto. (WebCore::AccessibilityObject::elementRange const): Return SimpleRange. (WebCore::AccessibilityObject::findTextRange const): Take and return SimpleRange. (WebCore::AccessibilityObject::findTextRanges const): Ditto. (WebCore::AccessibilityObject::performTextOperation): Use SimpleRange. (WebCore::AccessibilityObject::clickPoint): Use center(). (WebCore::AccessibilityObject::rangeForPlainTextRange const): Return SimpleRange. (WebCore::AccessibilityObject::stringForRange const): Take SimpleRange. (WebCore::AccessibilityObject::stringForVisiblePositionRange): Use SimpleRange. (WebCore::AccessibilityObject::lengthForVisiblePositionRange const): Ditto. (WebCore::AccessibilityObject::replaceTextInRange): Use SimpleRange. * accessibility/AccessibilityObject.h: Update for above. * accessibility/AccessibilityObjectInterface.h: Take and return SimpleRange. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::linkClickPoint): Use SimpleRange. (WebCore::AccessibilityRenderObject::clickPoint): Ditto. (WebCore::AccessibilityRenderObject::setSelectedTextRange): Ditto. (WebCore::AccessibilityRenderObject::boundsForRange const): Take SimpleRange. (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange const): Use SimpleRange. (WebCore::AccessibilityRenderObject::doAXBoundsForRangeUsingCharacterOffset const): Use SimpleRange. * accessibility/AccessibilityRenderObject.h: Update for above. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: Include Range.h. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper stringForTextMarkers:]): Use SimpleRange. (-[WebAccessibilityObjectWrapper textMarkerRange]): Ditto. (-[WebAccessibilityObjectWrapper stringForRange:]): Ditto. (-[WebAccessibilityObjectWrapper misspellingTextMarkerRange:forward:]): Ditto. (-[WebAccessibilityObjectWrapper frameForTextMarkers:]): Ditto. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::stringForRange const): Take SimpleRange. (WebCore::AXIsolatedObject::findTextRanges const): Return SimpleRange. * accessibility/isolatedtree/AXIsolatedObject.h: Update for above. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (accessibilityTextOperationForParameterizedAttribute): Use SimpleRange. (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]): Ditto. (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): Ditto. * dom/Range.cpp: (WebCore::makeSimpleRange): Added. * dom/Range.h: Added makeSimpleRange so we can explicitly convert from live ranges to simple ranges. * editing/Editing.cpp: (WebCore::indexForVisiblePosition): Use separate returns for start and end. * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingParagraph::offsetTo const): Ditto. (WebCore::TextCheckingParagraph::automaticReplacementStart const): Ditto. * page/FocusController.cpp: (WebCore::updateFocusCandidateIfNeeded): Use center(). 2020-07-11 Simon Fraser <simon.fraser@apple.com> REGRESSION(r260276): Overflow scrolling layers misplaced inside SVG foreign object https://bugs.webkit.org/show_bug.cgi?id=213788 <rdar://problem/65039637> Reviewed by Zalan Bujtas. RenderLayers inside SVG <foreignObject> don't display correctly, so don't use accelerated overflow scroll (which requires layers) inside <foreignObject>. This reverts behavior to macOS Catalina behavior (i.e. as soon as the overflow becomes scrollable, rendering problems appear), and to pre-iOS 13 behavior. Test: fast/scrolling/overflow-inside-foreignobject.html * dom/Document.h: (WebCore::Document::mayHaveRenderedSVGForeignObjects const): (WebCore::Document::setMayHaveRenderedSVGForeignObjects): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::addChild): (WebCore::RenderLayer::updateAncestorDependentState): (WebCore::RenderLayer::canUseCompositedScrolling const): * rendering/RenderLayer.h: * rendering/svg/RenderSVGForeignObject.h: * svg/SVGForeignObjectElement.cpp: (WebCore::SVGForeignObjectElement::createElementRenderer): 2020-07-11 Zalan Bujtas <zalan@apple.com> [LFC][BFC][Min-Max width] Add support for float avoiders https://bugs.webkit.org/show_bug.cgi?id=214220 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/min-max-content-width-with-floats-simple.html Float avoiders (including the float boxes) with infinite constraint form a horizontal float stack. (This does not yet support clear property/non-direct children.) * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): 2020-07-10 Chris Dumez <cdumez@apple.com> Unreviewed, reverting r264242. Caused many crashes on iOS bots Reverted changeset: "JSRunLoopTimer should use WTF::RunLoop rather than custom CF code" https://bugs.webkit.org/show_bug.cgi?id=214102 https://trac.webkit.org/changeset/264242 2020-07-10 Brady Eidson <beidson@apple.com> Cleanup GameController framework button binding with some constants https://bugs.webkit.org/show_bug.cgi?id=214210 Reviewed by Darin Adler. No new tests (No behavior change) * platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::GameControllerGamepad::setupAsExtendedGamepad): Use named constants instead of magic numbers. 2020-07-10 Darin Adler <darin@apple.com> Fix build for PLATFORM(IOS_FAMILY) && !ENABLE(REVEAL), for example, tvOS * editing/cocoa/DictionaryLookup.mm: Added include of "SimpleRange.h". 2020-07-10 Darin Adler <darin@apple.com> Fix build for PLATFORM(IOS_FAMILY) && !ENABLE(REVEAL), for example, tvOS * editing/cocoa/DictionaryLookup.mm: (WebCore::DictionaryLookup::rangeForSelection): Update to return SimpleRange. (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto. 2020-07-08 Darin Adler <darin@apple.com> Remove live ranges from Document.h, AlternativeTextController.h, DictionaryLookup.h, and WebPage.h https://bugs.webkit.org/show_bug.cgi?id=214109 Reviewed by Sam Weinig. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::characterOffsetForPoint): Updated to call caretPositionFromPoint, internal function, instead of caretRangeFromPoint, public DOM function. * dom/Document.cpp: (WebCore::Document::Document): Changed documentClasses argument to DocumentClassFlags. (WebCore::Document::caretRangeFromPoint): Refactored so this calls createLiveRange, since it's a DOM function that returns a live range. (WebCore::Document::caretPositionFromPoint): Renamed so this is not just an overload and changed to return a BoundaryPoint rather than a live range. * dom/Document.h: Simplified forward declarations by getting rid of all the conditionals. Tweaked a few typedef things. Updated for the changes above. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::startAlternativeTextUITimer): Updated since m_rangeWithAlternative is an Optional<SimpleRange>. (WebCore::AlternativeTextController::stopAlternativeTextUITimer): Ditto. (WebCore::AlternativeTextController::applyPendingCorrection): Ditto. (WebCore::AlternativeTextController::hasPendingCorrection const): Ditto. (WebCore::AlternativeTextController::isSpellingMarkerAllowed const): Take SimpleRange. (WebCore::AlternativeTextController::show): Ditto. (WebCore::AlternativeTextController::applyAutocorrectionBeforeTypingIfAppropriate): Updated since m_rangeWithAlternative is an Optional<SimpleRange>. (WebCore::AlternativeTextController::timerFired): Ditto. (WebCore::AlternativeTextController::handleAlternativeTextUIResult): Ditto. (WebCore::AlternativeTextController::markReversed): Take SimpleRange. (WebCore::AlternativeTextController::markCorrection): Ditto. (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection): Ditto. (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult): Ditto. (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): Use SimpleRange instead of a live range. (WebCore::AlternativeTextController::applyAlternativeTextToRange): Take SimpleRange. * editing/AlternativeTextController.h: Use SimpleRange instead of live ranges. * editing/cocoa/DictionaryLookup.mm: (WebCore::DictionaryLookup::rangeForSelection): Return SimpleRange. (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto. (WebCore::showPopupOrCreateAnimationController): Renamed type from RevealView to CocoaView. (WebCore::DictionaryLookup::showPopup): Ditto. * editing/mac/DictionaryLookup.h: Simplified header since it is included only from Objective-C files. Use SimpleRange instead of live ranges. * editing/mac/DictionaryLookupLegacy.mm: (WebCore::DictionaryLookup::rangeForSelection): Return SimpleRange. (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto. * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup): Updated since DictionaryLookup::rangeAtHitTestResult returns SimpleRange. (WebCore::autoscrollAdjustmentFactorForScreenBoundaries): Use constexpr instead of macros for constants. * testing/Internals.mm: (WebCore::Internals::rangeForDictionaryLookupAtLocation): Updated since DictionaryLookup::rangeAtHitTestResult returns SimpleRange. (WebCore::Internals::encodedPreferenceValue): Removed unneeded error local, and fixed formatting. 2020-07-10 Brady Eidson <beidson@apple.com> GameController.framework gamepads should support Home buttons. <rdar://problem/63500696> and https://bugs.webkit.org/show_bug.cgi?id=212933 Reviewed by Tim Horton. No new tests (Cannot yet drive GameController framework directly in tests) * platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::homeButtonFromExtendedGamepad): Try a few different techniques of extracting the home button from a GCExtendedGamepad. (WebCore::GameControllerGamepad::setupAsExtendedGamepad): If there's a home button, put it at button index 16, defined by the spec as "Center button in center cluster" * platform/gamepad/cocoa/GameControllerSoftLink.h: * platform/gamepad/cocoa/GameControllerSoftLink.mm: 2020-07-10 Chris Fleizach <cfleizach@apple.com> AX: Build failure for catalyst https://bugs.webkit.org/show_bug.cgi?id=214202 <rdar://problem/65366125> Reviewed by Zalan Bujtas. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityIsInDescriptionListTerm]): (-[WebAccessibilityObjectWrapper accessibilityIsInDescriptionListDefinition]): 2020-07-10 Geoffrey Garen <ggaren@apple.com> JSRunLoopTimer should use WTF::RunLoop rather than custom CF code https://bugs.webkit.org/show_bug.cgi?id=214102 Reviewed by Darin Adler. * bindings/js/CommonVM.cpp: (WebCore::commonVMSlow): Supply a RunLoop at construction time since JSC requires that now. 2020-07-10 Guowei Yang <guowei_yang@apple.com> Removing usage of "using namespace WebCore" from TextTrackRepresentationCocoa.mm https://bugs.webkit.org/show_bug.cgi?id=214196 Reviewed by Tim Horton. The line "using namespace WebCore" will cause problems when compiling unified source. Removing this line and replace it with WebCore::prefix and namespace WebCore{ } to enclose C++ calls. No new tests are requied as this is a code style fix * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm: removed usage of "using namespace WebCore" to avoid future errors while compiling (-[WebCoreTextTrackRepresentationCocoaHelper initWithParent:]): added "WebCore::" prefix (-[WebCoreTextTrackRepresentationCocoaHelper setParent:]): ditto (-[WebCoreTextTrackRepresentationCocoaHelper parent]): ditto (TextTrackRepresentation::create): enclosed inside namespace WebCore{ } (TextTrackRepresentationCocoa::TextTrackRepresentationCocoa): Deleted. enclosed inside namespace WebCore{ } (TextTrackRepresentationCocoa::~TextTrackRepresentationCocoa): ditto (TextTrackRepresentationCocoa::update): ditto (TextTrackRepresentationCocoa::setContentScale): ditto (TextTrackRepresentationCocoa::setHidden const): ditto (TextTrackRepresentationCocoa::bounds const): ditto (TextTrackRepresentationCocoa::boundsChanged): ditto 2020-07-10 Peng Liu <peng.liu6@apple.com> MobileSafari rotates its scene to portrait upside down if it has a PiP on screen https://bugs.webkit.org/show_bug.cgi?id=214169 Reviewed by Jer Noble. The UIViewController for video fullscreen/picture-in-picture should not ignore the App's supported orientations when the video element is in picture-in-picture. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::doSetup): 2020-07-10 Don Olmstead <don.olmstead@sony.com> and Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] WOFF2 font support https://bugs.webkit.org/show_bug.cgi?id=214174 Reviewed by Per Arne Vollan. * PlatformWinCairo.cmake: Added additional libraries for static WOFF2 library to WebCore_LIBRARIES. * platform/graphics/win/FontCustomPlatformDataCairo.cpp: (WebCore::FontCustomPlatformData::supportsFormat): Added woff2. 2020-07-10 Chris Fleizach <cfleizach@apple.com> AX: iOS VoiceOver should support definition lists https://bugs.webkit.org/show_bug.cgi?id=210214 <rdar://problem/61478299> Reviewed by Darin Adler. Expose bits to make definition lists accessibility on iOS. Test: accessibility/ios-simulator/definition-list.html * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilityDescriptionListAncestor]): (-[WebAccessibilityObjectWrapper accessibilityIsInDescriptionListTerm]): (-[WebAccessibilityObjectWrapper accessibilityIsInDescriptionListDefinition]): 2020-07-10 Brady Eidson <beidson@apple.com> Limit MultiGamepadProvider to Catalina and Big Sur. https://bugs.webkit.org/show_bug.cgi?id=214190 Unreviewed build fix. * platform/gamepad/cocoa/GameControllerSPI.h: * platform/gamepad/cocoa/GameControllerSoftLink.h: * platform/gamepad/cocoa/GameControllerSoftLink.mm: * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::HIDGamepadProvider::deviceAdded): * platform/gamepad/mac/MultiGamepadProvider.h: * platform/gamepad/mac/MultiGamepadProvider.mm: 2020-07-10 Sam Weinig <weinig@apple.com> Part 4 of SimpleColor and SRGBA<uint8_t> are essentially the same - let's converge them https://bugs.webkit.org/show_bug.cgi?id=214158 Reviewed by Darin Adler. Removes SimpleColor! Alas, makeSimpleColor() remains for now, seeking a new name in a follow up. * platform/graphics/SimpleColor.h: (WebCore::SimpleColor::SimpleColor): Deleted. (WebCore::SimpleColor::alphaComponent const): Deleted. (WebCore::SimpleColor::alphaComponentAsFloat const): Deleted. (WebCore::SimpleColor::isOpaque const): Deleted. (WebCore::SimpleColor::isVisible const): Deleted. (WebCore::SimpleColor::colorWithAlpha const): Deleted. (WebCore::SimpleColor::invertedColorWithAlpha const): Deleted. (WebCore::SimpleColor::asSRGBA const): Deleted. (WebCore::SimpleColor::get const): Deleted. (): Deleted. (WebCore::operator==): Deleted. (WebCore::operator!=): Deleted. Remove the SimpleColor class. * platform/graphics/Color.cpp: (WebCore::Color::operator=): (WebCore::Color::lightened const): (WebCore::Color::darkened const): (WebCore::Color::colorWithAlpha const): (WebCore::Color::invertedColorWithAlpha const): (WebCore::Color::colorSpaceAndComponents const): * platform/graphics/Color.h: (WebCore::Color::isHashTableDeletedValue const): (WebCore::Color::isValid const): (WebCore::Color::isSemantic const): (WebCore::Color::isOpaque const): (WebCore::Color::isVisible const): (WebCore::Color::alpha const): (WebCore::Color::alphaAsFloat const): (WebCore::Color::isExtended const): (WebCore::Color::isInline const): (WebCore::Color::tagAsSemantic): (WebCore::Color::tagAsValid): (WebCore::operator==): (WebCore::equalIgnoringSemanticColor): (WebCore::Color::Color): (WebCore::Color::~Color): (WebCore::Color::hash const): (WebCore::Color::toSRGBALossy const): (WebCore::Color::asInline const): (WebCore::Color::setInlineColor): (WebCore::Color::setExtendedColor): (WebCore::Color::isBlackColor): (WebCore::Color::isWhiteColor): (WebCore::Color::encode const): (WebCore::Color::isSimple const): Deleted. (WebCore::Color::asSimple const): Deleted. (WebCore::Color::setSimpleColor): Deleted. - Rename existing uses of Simple with Inline, denoting the inline SRGBA<uint8_t>. - Move multiline functions out of line in the header. - Adds new constructor functions taking Optional<SRGBA<uint8_t>> to make Color(CGColorRef) constructors more straightforward. - Replaces uses of SimpleColor's interface with use of ColorUtilities.h helpers. e.g. Color::invertedColorWithAlpha() now uses the new invertedColorWithOverridenAlpha() helper function. Use of these utilities will be expanded to ExtendedColor in a follow up, allowing us to have just one implementation of these algorithms. * platform/graphics/ColorSerialization.cpp: (WebCore::serializationForCSS): (WebCore::serializationForHTML): (WebCore::serializationForRenderTreeAsText): * platform/graphics/ColorSerialization.h: Replace serialization of SimpleColor with serialization of SRGBA<uint8_t>. * platform/graphics/ColorTypes.h: (WebCore::forEachNonAlphaComponent): Deleted. Removed forEachNonAlphaComponent. Uses replaced by new colorByModifingEachNonAlphaComponent function in ColorUtilities.h * platform/graphics/ColorUtilities.h: (WebCore::colorByModifingEachNonAlphaComponent): (WebCore::convertComponentByteTo<uint8_t>): (WebCore::convertComponentByteTo<float>): (WebCore::convertComponentFloatTo<uint8_t>): (WebCore::convertComponentFloatTo<float>): (WebCore::colorWithOverridenAlpha): (WebCore::invertComponent): (WebCore::invertedColorWithOverridenAlpha): Added heplers to implement color mutation behaviors. * platform/graphics/cg/ColorCG.cpp: (WebCore::makeSimpleColorFromCGColor): (WebCore::Color::Color): (WebCore::cachedCGColor): Switch makeSimpleColorFromCGColor to return an Optional<SRGBA<uint8_t>> to streamline the constructors. Update to use is/asInline functions. * platform/graphics/mac/ColorMac.mm: (WebCore::nsColor): Update to use is/asInline functions. * platform/graphics/filters/FilterOperation.cpp: (WebCore::BasicComponentTransferFilterOperation::transformColor const): Switch to using colorByModifingEachNonAlphaComponent(). 2020-07-10 Philippe Normand <pnormand@igalia.com> [GStreamer] Unreviewed, prospective API test bot fix... * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::setVolume): I suppose changing the audio volume to 0 wasn't intended :) 2020-07-10 Philippe Normand <pnormand@igalia.com> Unreviewed, remove debug printf after r264219. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): 2020-07-10 Zalan Bujtas <zalan@apple.com> [LFC][Floats] Normal flow element that establishes a new block formatting context must not overlap the margin box of any floats https://bugs.webkit.org/show_bug.cgi?id=214185 Reviewed by Antti Koivisto. BFCs in general should avoid floats. This code was confusing the cases where the block container box (not necessarily a BFC) establishes an IFC. <div>The div establishes an IFC only. It should not avoid floats.</div> <div style="overflow: hidden">The div establishes both a new BFC and an IFC. It should avoid floats.</div> Test: fast/layoutformattingcontext/float-avoider-with-inline-content.html * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::isFloatAvoider const): 2020-07-10 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer][EME][OpenCDM] Implement OpenCDM support https://bugs.webkit.org/show_bug.cgi?id=213550 Reviewed by Philippe Normand. Implemented the OpenCDM support in the CDMOpenCDM and CDMProxyOpenCDM related classes. CDMOpenCDM classes check for Widevine support in OpenCDM and glues the JavaScript API to the OpenCDM/Thunder framework. Building this is optional and --opencdm parameter needs to be passed to build-webkit to get it. CDMProxy related needed changes because of several reasons. First is that Key was considering only a Vector<uint8_t> as a type and OpenCDM has session objects. Key is also renamed to KeyHandle as this name reflects in a better way the purpose of the class. This bleeds out to all CDMProxy related classes. CDMInstanceSessionProxy gets support to remove itself from the CDMSessionProxy. Regarding ClearKey, we adapt the changes to the CDMProxy classes and de-cable protection system from the decryptors as the OpenCDM decryptor could handle more than one system. No new tests. YouTube TV 2019 tests are green. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/GStreamer.cmake: * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::dataAsUInt8Ptr const): * platform/SharedBuffer.h: * platform/encryptedmedia/CDMInstance.h: * platform/encryptedmedia/CDMOpenCDMTypes.h: Copied from Source/WebCore/platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp. * platform/encryptedmedia/CDMProxy.cpp: (WebCore::KeyHandle::idAsString const): (WebCore::KeyHandle::takeValueIfDifferent): (WebCore::KeyStore::containsKeyID const): (WebCore::KeyStore::merge): (WebCore::KeyStore::allKeysAs const): (WebCore::KeyStore::addKeys): (WebCore::KeyStore::add): (WebCore::KeyStore::remove): (WebCore::KeyStore::keyHandle const): (WebCore::CDMProxy::keyHandle const): (WebCore::CDMProxy::tryWaitForKeyHandle const): (WebCore::CDMProxy::keyAvailableUnlocked const): (WebCore::CDMProxy::keyAvailable const): (WebCore::CDMProxy::getOrWaitForKeyHandle const): (WebCore::CDMProxy::getOrWaitForKeyValue const): (WebCore::CDMInstanceSessionProxy::CDMInstanceSessionProxy): (WebCore::CDMInstanceSessionProxy::removeFromInstanceProxy): * platform/encryptedmedia/CDMProxy.h: (WebCore::KeyHandle::create): (WebCore::KeyHandle::id const): (WebCore::KeyHandle::value const): (WebCore::KeyHandle::value): (WebCore::KeyHandle::isStatusCurrentlyValid): (WebCore::KeyHandle::operator==): (WebCore::KeyHandle::operator<): (WebCore::KeyHandle::KeyHandle): (WebCore::KeyStore::isEmpty const): (WebCore::CDMProxy::instance const): (WebCore::CDMInstanceSessionProxy::releaseDecryptionResources): (WebCore::CDMInstanceSessionProxy::cdmInstanceProxy const): (WebCore::CDMInstanceProxy::proxy const): (WebCore::CDMInstanceProxy::removeSession): * platform/encryptedmedia/CDMUtilities.cpp: Copied from Source/WebCore/platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp. (WebCore::CDMUtilities::parseJSONObject): * platform/encryptedmedia/CDMUtilities.h: Copied from Source/WebCore/platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp. * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::parseLicenseFormat): (WebCore::CDMPrivateClearKey::supportsInitData const): (WebCore::CDMPrivateClearKey::sanitizeResponse const): (WebCore::CDMInstanceSessionClearKey::updateLicense): (WebCore::CDMInstanceSessionClearKey::removeSessionData): (WebCore::CDMInstanceSessionClearKey::parentInstance const): * platform/encryptedmedia/clearkey/CDMClearKey.h: * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::isOpenCDMRanked): (WebCore::initializeGStreamerAndRegisterWebKitElements): (WebCore::GstMappedBuffer::createVector): * platform/graphics/gstreamer/GStreamerCommon.h: (WebCore::GstMappedBuffer::create): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): (WebCore::MediaPlayerPrivateGStreamer::waitForCDMAttachment): * platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp: (WebCore::CDMFactory::platformRegisterFactories): * platform/graphics/gstreamer/eme/CDMOpenCDM.cpp: Added. (openCDMLicenseType): (WebCore::initDataMD5): (WebCore::sessionLoadFailureFromOpenCDM): (WebCore::OpenCDM::destructOpenCDMSession): (WebCore::OpenCDM::createSharedOpenCDMSession): (WebCore::CDMFactoryOpenCDM::singleton): (WebCore::CDMFactoryOpenCDM::createCDM): (WebCore::CDMFactoryOpenCDM::createCDMProxy): (WebCore::CDMFactoryOpenCDM::supportedKeySystems const): (WebCore::CDMFactoryOpenCDM::supportsKeySystem): (WebCore::CDMPrivateOpenCDM::supportedInitDataTypes const): (WebCore::CDMPrivateOpenCDM::supportsConfiguration const): (WebCore::CDMPrivateOpenCDM::supportedRobustnesses const): (WebCore::CDMPrivateOpenCDM::distinctiveIdentifiersRequirement const): (WebCore::CDMPrivateOpenCDM::persistentStateRequirement const): (WebCore::CDMPrivateOpenCDM::distinctiveIdentifiersAreUniquePerOriginAndClearable const): (WebCore::CDMPrivateOpenCDM::createInstance): (WebCore::CDMPrivateOpenCDM::loadAndInitialize): (WebCore::CDMPrivateOpenCDM::supportsServerCertificates const): (WebCore::CDMPrivateOpenCDM::supportsSessions const): (WebCore::CDMPrivateOpenCDM::supportsInitData const): (WebCore::CDMPrivateOpenCDM::sanitizeResponse const): (WebCore::CDMPrivateOpenCDM::sanitizeSessionId const): (WebCore::CDMInstanceOpenCDM::CDMInstanceOpenCDM): (WebCore::CDMInstanceOpenCDM::initializeWithConfiguration): (WebCore::CDMInstanceOpenCDM::setServerCertificate): (WebCore::CDMInstanceOpenCDM::setStorageDirectory): (WebCore::CDMInstanceSessionOpenCDM::CDMInstanceSessionOpenCDM): (WebCore::CDMInstanceOpenCDM::createSession): (WebCore::ParsedResponseMessage::ParsedResponseMessage): (WebCore::ParsedResponseMessage::hasPayload const): (WebCore::ParsedResponseMessage::payload const): (WebCore::ParsedResponseMessage::payload): (WebCore::ParsedResponseMessage::hasType const): (WebCore::ParsedResponseMessage::type const): (WebCore::ParsedResponseMessage::typeOr const): (WebCore::CDMInstanceSessionOpenCDM::challengeGeneratedCallback): (WebCore::toString): (WebCore::CDMInstanceSessionOpenCDM::status const): (WebCore::CDMInstanceSessionOpenCDM::keyUpdatedCallback): (WebCore::CDMInstanceSessionOpenCDM::keysUpdateDoneCallback): (WebCore::CDMInstanceSessionOpenCDM::errorCallback): (WebCore::CDMInstanceSessionOpenCDM::requestLicense): (WebCore::CDMInstanceSessionOpenCDM::sessionFailure): (WebCore::CDMInstanceSessionOpenCDM::updateLicense): (WebCore::CDMInstanceSessionOpenCDM::loadSession): (WebCore::CDMInstanceSessionOpenCDM::closeSession): (WebCore::CDMInstanceSessionOpenCDM::removeSessionData): (WebCore::CDMInstanceSessionOpenCDM::storeRecordOfKeyUsage): (WebCore:: const): * platform/graphics/gstreamer/eme/CDMOpenCDM.h: Added. (WebCore::OpenCDM::OpenCDMSystemDeleter::operator() const): (WebCore::OpenCDM::OpenCDMSessionDeleter::operator() const): * platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp: (WebCore::CDMProxyClearKey::cencSetDecryptionKey): * platform/graphics/gstreamer/eme/CDMProxyOpenCDM.cpp: Added. (WebCore::CDMProxyOpenCDM::getDecryptionSession const): (WebCore::CDMProxyOpenCDM::decrypt): * platform/graphics/gstreamer/eme/CDMProxyOpenCDM.h: Copied from Source/WebCore/platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp. * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: (WebCore::InitData::InitData): (WebCore::InitData::payload const): (WebCore::GStreamerEMEUtilities::isWidevineKeySystem): (WebCore::GStreamerEMEUtilities::keySystemToUuid): * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (webkit_media_clear_key_decrypt_class_init): (protectionSystemId): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (transformCaps): (transformInPlace): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: * platform/graphics/gstreamer/eme/WebKitOpenCDMDecryptorGStreamer.cpp: Added. (webkit_media_opencdm_decrypt_class_init): (webkit_media_opencdm_decrypt_init): (finalize): (protectionSystemId): (cdmProxyAttached): (decrypt): * platform/graphics/gstreamer/eme/WebKitOpenCDMDecryptorGStreamer.h: Added. 2020-07-10 Zalan Bujtas <zalan@apple.com> [LFC][TreeConstruction] Create block level container for unsupported renderer https://bugs.webkit.org/show_bug.cgi?id=214182 Reviewed by Antti Koivisto. It makes full LFC rendering on random pages less crashy. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createLayoutBox): 2020-07-02 Sergio Villar Senin <svillar@igalia.com> [WebXR] Retrieve WebGL framebuffer resolution from XR devices https://bugs.webkit.org/show_bug.cgi?id=213886 Reviewed by Carlos Garcia Campos. The recommended WebGL framebuffer resolution should be retrieved from the actual XR device being used. Implemented the OpenXR machinery to retrieve it from the XR system. We are also moving the methods that call the platform code to the XRSession as specs define, instead of having them inside the XRWebGLLayer. Finally this patch is also removing a unused definition in OpenXR plaform code and properly initializing a OpenXR struct. The missing initialization was the source of errors when querying api layer properties. The patch is also properly setting the SessionMode::Inline when XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONO is found. It used to set SessionMode::ImmersiveAr instead, but that's wrong, we should only care about ImmersiveAr session mode once the WebXR AR module is implemented. * Modules/webxr/WebXRRenderState.cpp: (WebCore::WebXRRenderState::outputCanvas const): Return render state's canvas. * Modules/webxr/WebXRRenderState.h: Added a m_outputCanvas member with its getter. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::nativeWebGLFramebufferResolution const): Moved from WebXRWebGLLayer and reimplemented. (WebCore::WebXRSession::recommendedWebGLFramebufferResolution const): Ditto. * Modules/webxr/WebXRSession.h: * Modules/webxr/WebXRWebGLLayer.cpp: (WebCore::WebXRWebGLLayer::WebXRWebGLLayer): (WebCore::WebXRWebGLLayer::getNativeFramebufferScaleFactor): Call the session to get native and recommended resolutions. (WebCore::WebXRWebGLLayer::computeNativeWebGLFramebufferResolution): Deleted. (WebCore::WebXRWebGLLayer::computeRecommendedWebGLFramebufferResolution): Ditto. * platform/xr/PlatformXR.h: (PlatformXR::Device::recommendedResolution): New virtual method with default implementation. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::Instance::Impl::enumerateApiLayerProperties const): Added initialization of the XrApiLayerProperties objects. The call to xrEnumerateApiLayerProperties succeeds now. (PlatformXR::OpenXRDevice::OpenXRDevice): Call enumerateConfigurationViews(). (PlatformXR::OpenXRDevice::collectSupportedSessionModes): Fill in the m_viewConfigurationProperties map. (PlatformXR::OpenXRDevice::enumerateConfigurationViews): New method that retrieves the XR device views for each supported configuration. (PlatformXR::OpenXRDevice::recommendedResolution): Return the recommended resolution for a given SessionMode. * platform/xr/openxr/PlatformXROpenXR.h: Added some new methods and attributes. 2020-07-10 Zalan Bujtas <zalan@apple.com> [LFC][MarginCollapsing] Margins do not collapse through when the box has clearance. https://bugs.webkit.org/show_bug.cgi?id=214172 Reviewed by Antti Koivisto. https://www.w3.org/TR/CSS22/box.html#collapsing-margins "Two margins are adjoining if and only if: no line boxes, no clearance, no padding and no border separate them" Only adjoining margins can collapse through. Test: fast/layoutformattingcontext/empty-block-level-box-with-clearance.html * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const): 2020-07-10 Jan-Michael Brummer <jan.brummer@tabos.org> [GTK][WPE] Use mobile user-agent on tablet https://bugs.webkit.org/show_bug.cgi?id=149496 Reviewed by Carlos Garcia Campos. * platform/UserAgentQuirks.cpp: (WebCore::urlRequiresMacintoshPlatform): (WebCore::urlRequiresLinuxDesktopPlatform): (WebCore::UserAgentQuirks::quirksForURL): * platform/UserAgentQuirks.h: * platform/glib/UserAgentGLib.cpp: (WebCore::getChassisType): (WebCore::platformForUAString): (WebCore::platformVersionForUAString): (WebCore::buildUserAgentString): (WebCore::standardUserAgent): (WebCore::standardUserAgentForURL): 2020-07-10 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Inline MediaSourceClientGStreamerMSE away https://bugs.webkit.org/show_bug.cgi?id=214140 Reviewed by Xabier Rodriguez-Calvar. MediaSourceClientGStreamerMSE is a superfluous class that adds a layer of indirection and complexity to the GStreamer MSE codebase for no gain. This patch gets rid of it. This also gets rid of the friend access layer violations that MediaSourceClientGStreamerMSE relied upon. This patch is a refactor that doesn't introduce behavior changes and it's covered by existing tests. * platform/GStreamer.cmake: * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::AppendPipeline): * platform/graphics/gstreamer/mse/AppendPipeline.h: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged): (WebCore::MediaPlayerPrivateGStreamerMSE::setMediaSourceClient): Deleted. (WebCore::MediaPlayerPrivateGStreamerMSE::mediaSourceClient): Deleted. * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: (WebCore::MediaPlayerPrivateGStreamerMSE::playbackPipeline const): * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: Removed. * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: Removed. * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp: (WebCore::MediaSourcePrivateGStreamer::MediaSourcePrivateGStreamer): (WebCore::MediaSourcePrivateGStreamer::addSourceBuffer): (WebCore::MediaSourcePrivateGStreamer::durationChanged): (WebCore::MediaSourcePrivateGStreamer::markEndOfStream): * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h: * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::create): (WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer): (WebCore::SourceBufferPrivateGStreamer::finishCreation): (WebCore::SourceBufferPrivateGStreamer::append): (WebCore::SourceBufferPrivateGStreamer::abort): (WebCore::SourceBufferPrivateGStreamer::resetParserState): (WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource): (WebCore::SourceBufferPrivateGStreamer::flush): (WebCore::SourceBufferPrivateGStreamer::enqueueSample): (WebCore::SourceBufferPrivateGStreamer::allSamplesInTrackEnqueued): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: 2020-07-09 Brady Eidson <beidson@apple.com> Multiplex the HID and GameController gamepad providers on Mac. <rdar://problem/63192532> and https://bugs.webkit.org/show_bug.cgi?id=214126 Reviewed by Tim Horton. Mac has already supported both the HID provider and GameController provider. By adding an intermediate provider to multiplex both and tweaking a few other things, it can support both at the same time. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/gamepad/PlatformGamepad.h: (WebCore::PlatformGamepad::lastUpdateTime const): (WebCore::PlatformGamepad::source const): * platform/gamepad/cocoa/GameControllerGamepad.h: * platform/gamepad/cocoa/GameControllerGamepadProvider.h: * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): (WebCore::GameControllerGamepadProvider::gamepadHadInput): (WebCore::GameControllerGamepadProvider::makeInvisibleGamepadsVisible): (WebCore::GameControllerGamepadProvider::inputNotificationTimerFired): (WebCore::GameControllerGamepadProvider::makeInvisibileGamepadsVisible): Deleted. * platform/gamepad/cocoa/GameControllerSPI.h: * platform/gamepad/cocoa/GameControllerSoftLink.h: * platform/gamepad/cocoa/GameControllerSoftLink.mm: * platform/gamepad/mac/HIDGamepad.h: * platform/gamepad/mac/HIDGamepadProvider.h: (WebCore::HIDGamepadProvider::ignoreGameControllerFrameworkDevices): * platform/gamepad/mac/HIDGamepadProvider.mm: Renamed from Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.cpp. (WebCore::deviceMatchingDictionary): (WebCore::deviceAddedCallback): (WebCore::deviceRemovedCallback): (WebCore::deviceValuesChangedCallback): (WebCore::HIDGamepadProvider::singleton): (WebCore::HIDGamepadProvider::HIDGamepadProvider): (WebCore::HIDGamepadProvider::stopMonitoringInput): (WebCore::HIDGamepadProvider::startMonitoringInput): (WebCore::HIDGamepadProvider::indexForNewlyConnectedDevice): (WebCore::HIDGamepadProvider::initialGamepadsConnectedTimerFired): (WebCore::HIDGamepadProvider::openAndScheduleManager): (WebCore::HIDGamepadProvider::closeAndUnscheduleManager): (WebCore::HIDGamepadProvider::startMonitoringGamepads): (WebCore::HIDGamepadProvider::stopMonitoringGamepads): (WebCore::gameControllerFrameworkWillHandleHIDDevice): (WebCore::HIDGamepadProvider::deviceAdded): (WebCore::HIDGamepadProvider::deviceRemoved): (WebCore::HIDGamepadProvider::valuesChanged): (WebCore::HIDGamepadProvider::inputNotificationTimerFired): (WebCore::HIDGamepadProvider::removeGamepadForDevice): * platform/gamepad/mac/MultiGamepadProvider.h: Added. (WebCore::MultiGamepadProvider::isMockGamepadProvider const): (WebCore::MultiGamepadProvider::PlatformGamepadWrapper::PlatformGamepadWrapper): * platform/gamepad/mac/MultiGamepadProvider.mm: Added. (WebCore::MultiGamepadProvider::singleton): (WebCore::MultiGamepadProvider::startMonitoringGamepads): (WebCore::MultiGamepadProvider::stopMonitoringGamepads): (WebCore::MultiGamepadProvider::indexForNewlyConnectedDevice): (WebCore::MultiGamepadProvider::platformGamepadConnected): (WebCore::MultiGamepadProvider::platformGamepadDisconnected): (WebCore::MultiGamepadProvider::platformGamepadInputActivity): 2020-07-09 Tim Horton <timothy_horton@apple.com> "ESPN Fantasy Sports" does not respond to mouse events, only touch events https://bugs.webkit.org/show_bug.cgi?id=214165 <rdar://problem/64671543> Reviewed by Wenson Hsieh. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isESPNFantasySports): 2020-07-09 Simon Fraser <simon.fraser@apple.com> [macOS] Stuttery scrolling on tesla.com https://bugs.webkit.org/show_bug.cgi?id=214159 <rdar://problem/64555500> Reviewed by Wenson Hsieh. tesla.com uses scroll snapping, and also triggers layout during scrolling that could cause scroll snap to yank the scroll position. This manifested as a change that affected getBoundingClientRect which is used an an input to some transform math, causing the images to move around. Fix by ensuring that layout-triggered scroll snap does not happen if a user scroll is in progress, when that scroll occurs via the scrolling thread. ScrollingTreeScrollingNodeDelegateMac has a ScrollController that tracks when a gesture is in progress; push this state to the ScrollingTree so it can be consulted from the main thread. The two subclasses of ScrollableArea, RenderLayer and FrameView, then consult the ScrollingCoordinator to ask whether a user scroll is in progress for their scrolling tree node. Test: fast/scrolling/mac/adjust-scroll-snap-during-gesture.html * page/FrameView.cpp: (WebCore::FrameView::isUserScrollInProgress const): * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::isUserScrollInProgress const): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::isUserScrollInProgress const): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::handleWheelEvent): (WebCore::ScrollingTree::isUserScrollInProgressForNode): (WebCore::ScrollingTree::setUserScrollInProgressForNode): (WebCore::ScrollingTree::clearNodesWithUserScrollInProgress): * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::isUserScrollProgress const): (WebCore::ScrollingTreeScrollingNode::setUserScrollInProgress): (WebCore::ScrollingTreeScrollingNode::setScrollSnapInProgress): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::isUserScrollInProgress const): 2020-07-09 Chris Dumez <cdumez@apple.com> [Bindings] Add default value support for union types in dictionary members https://bugs.webkit.org/show_bug.cgi?id=214160 Reviewed by Sam Weinig. Add default value support for union types in dictionary members. This is needed for the WebAudio specification: - https://www.w3.org/TR/webaudio/#AudioContextOptions """ (AudioContextLatencyCategory or double) latencyHint = "interactive"; """ * bindings/scripts/CodeGeneratorJS.pm: (GenerateDefaultValue): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjPrototypeFunctionOverloadWithOptionalUnion1Body): * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: (WebCore::convertDictionary<DictionaryImplName>): (WebCore::convertDictionaryToJS): * bindings/scripts/test/TestStandaloneDictionary.idl: 2020-07-09 Per Arne Vollan <pvollan@apple.com> Move XPCEndpoint and XPCEndpointClient classes from WebCore to WebKit https://bugs.webkit.org/show_bug.cgi?id=214099 Reviewed by Alex Christensen. These classes should not be in WebCore, but in WebKit, since they are only expected to be used there. No new tests, since this patch is only moving source files. * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/XPCEndpoint.h: Removed. * platform/cocoa/XPCEndpoint.mm: Removed. * platform/cocoa/XPCEndpointClient.h: Removed. * platform/cocoa/XPCEndpointClient.mm: Removed. 2020-07-09 Simon Fraser <simon.fraser@apple.com> After a scroll gesture, content changes don't trigger re-snapping with scroll snap https://bugs.webkit.org/show_bug.cgi?id=214123 Reviewed by Wenson Hsieh. ScrollController::m_inScrollGesture could get stuck as true after a scroll gesture, because ScrollAnimatorMac::handleWheelEvent() didn't reliably call m_scrollController.handleWheelEvent() for the event event based on the hokey shouldForwardWheelEventsToParent() code. Fix by explicitly calling m_scrollController.updateGestureInProgressState() which maintains m_inScrollGesture. When m_inScrollGesture was stuck as true, ScrollableArea::updateScrollSnapState() would return early because isScrollSnapInProgress() would return true. In addition, ScrollController::isScrollSnapInProgress() was a lie for non-scroll-snapping scrollable areas, so explicitly check for snap points there, using an explicit usesScrollSnap() function. Rename some WheelEventStatus values to use "momentum" rather than "inertia". Test: fast/scrolling/mac/adjust-scroll-snap-after-gesture.html * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent): * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::usesScrollSnap const): (WebCore::ScrollableArea::updateScrollSnapState): * platform/ScrollableArea.h: * platform/cocoa/ScrollController.h: * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): (WebCore::ScrollController::usesScrollSnap const): (WebCore::ScrollController::isScrollSnapInProgress const): (WebCore::ScrollController::snapRubberBand): (WebCore::toWheelEventStatus): (WebCore::operator<<): (WebCore::ScrollController::shouldOverrideMomentumScrolling const): (WebCore::ScrollController::scheduleStatelessScrollSnap): (WebCore::ScrollController::statelessSnapTransitionTimerFired): (WebCore::ScrollController::processWheelEventForScrollSnap): (WebCore::ScrollController::updateGestureInProgressState): (WebCore::ScrollController::scrollSnapTimerFired): (WebCore::ScrollController::activeScrollSnapIndexForAxis const): (WebCore::ScrollController::setActiveScrollSnapIndexForAxis): (WebCore::ScrollController::setNearestScrollSnapIndexForAxisAndOffset): (WebCore::ScrollController::setActiveScrollSnapIndicesForOffset): (WebCore::ScrollController::shouldOverrideInertialScrolling const): Deleted. * platform/mac/ScrollAnimatorMac.mm: (WebCore::ScrollAnimatorMac::handleWheelEvent): 2020-07-09 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo][MediaFoundation] Use /DELAYLOAD for mf.dll https://bugs.webkit.org/show_bug.cgi?id=213330 Reviewed by Per Arne Vollan. WinCairo failed to start up due to a missing dependency on some versions of Windows in which Media Foundation is not available such like Windows 10 N. Use delay load for Media Foundation. And, check the availability. * PlatformWinCairo.cmake: Link with delayimp.lib. Added /DELAYLOAD linker options. * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: (WebCore::MediaPlayerPrivateMediaFoundation::isAvailable): Check mf.dll is available. 2020-07-09 Eric Carlson <eric.carlson@apple.com> Reset AVSystemController_PIDToInheritApplicationStateFrom when mediaserverd dies https://bugs.webkit.org/show_bug.cgi?id=214112 <rdar://problem/65229214> Reviewed by Jer Noble. Tested manually because this can only be tested by killing a system process while capturing on iOS hardware. * platform/audio/cocoa/MediaSessionManagerCocoa.h: Add task queue accessor. (WebCore::MediaSessionManagerCocoa::taskQueue): * platform/audio/ios/MediaSessionHelperIOS.h: (WebCore::MediaSessionHelperClient::mediaServerConnectionDied): * platform/audio/ios/MediaSessionHelperIOS.mm: (MediaSessionHelperiOS::mediaServerConnectionDied): Renamed from carPlayServerDied. Inform clients if we previously set the PID proxy. (-[WebMediaSessionHelper initWithCallback:]): Call mediaServerConnectionDied. (-[WebMediaSessionHelper mediaServerConnectionDied:]): Ditto. (MediaSessionHelperiOS::carPlayServerDied): Deleted. (-[WebMediaSessionHelper carPlayServerDied:]): Deleted. * platform/audio/ios/MediaSessionManagerIOS.h: * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::mediaServerConnectionDied): Call providePresentingApplicationPID if we previously set the PID proxy. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::captureSessionRuntimeError): Don't try to restart the session immediately since this is called directly from the notification handler. 2020-07-09 Clark Wang <clark_wang@apple.com> Set Restrictions for channelCount, channelCountMode for PannerNode https://bugs.webkit.org/show_bug.cgi?id=213992 Reviewed by Chris Dumez. Added setter methods to PannerNode that handle exceptions for channelCount, channelCountMode, according to spec: https://www.w3.org/TR/webaudio/#dom-audionode-channelcount. Moved ChannelCount, ChannelCountMode enums into their own files. Re-baselined tests that now pass. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::AudioNode): (WebCore::AudioNode::setChannelCount): (WebCore::AudioNode::setChannelCountMode): (WebCore::AudioNode::setChannelInterpretation): (WebCore::AudioNode::channelCount): Deleted. (WebCore::AudioNode::channelCountMode): Deleted. (WebCore::AudioNode::channelInterpretation): Deleted. * Modules/webaudio/AudioNode.h: (WebCore::AudioNode::channelCount const): (WebCore::AudioNode::channelCountMode const): (WebCore::AudioNode::channelInterpretation const): (WebCore::AudioNode::internalChannelCountMode const): Deleted. (WebCore::AudioNode::internalChannelInterpretation const): Deleted. * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioNodeInput.cpp: (WebCore::AudioNodeInput::numberOfChannels const): (WebCore::AudioNodeInput::bus): (WebCore::AudioNodeInput::sumAllConnections): (WebCore::AudioNodeInput::pull): * Modules/webaudio/AudioNodeOptions.h: * Modules/webaudio/AudioNodeOptions.idl: * Modules/webaudio/ChannelCountMode.h: Copied from Source/WebCore/Modules/webaudio/AudioNodeOptions.h. * Modules/webaudio/ChannelCountMode.idl: Copied from Source/WebCore/Modules/webaudio/AudioNodeOptions.idl. * Modules/webaudio/ChannelInterpretation.h: Copied from Source/WebCore/Modules/webaudio/AudioNodeOptions.h. * Modules/webaudio/ChannelInterpretation.idl: Copied from Source/WebCore/Modules/webaudio/AudioNodeOptions.idl. * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::ConvolverNode): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::PannerNode): (WebCore::PannerNode::create): (WebCore::PannerNode::setChannelCount): (WebCore::PannerNode::setChannelCountMode): * Modules/webaudio/PannerNode.h: * Modules/webaudio/WebKitAudioPannerNode.cpp: (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/AudioBus.cpp: (WebCore::AudioBus::copyFrom): (WebCore::AudioBus::sumFrom): * platform/audio/AudioBus.h: 2020-07-09 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Remove m_appendPipelinesMap https://bugs.webkit.org/show_bug.cgi?id=214132 Reviewed by Xabier Rodriguez-Calvar. m_appendPipelinesMap was owned by MediaPlayerPrivateGStreamerMSE but was only used by MediaPlayerPrivateGStreamerMSE to clear it during destruction, while the other uses were in MediaSourceClientGStreamerMSE. After analysis, it was found keeping a HashMap of AppendPipelines is not necessary. An AppendPipeline only needs to be used by the SourceBuffer receiving the muxed data: making AppendPipeline a member of SourceBufferPrivateGStreamer reflects this dependency in a much clearer way. No need for a HashMap of AppendPipeline's. Moreso, there are no other users of AppendPipeline, which means AppendPipeline doesn't need to be ref counted. This patch removes that feature, using std::unique_ptr<AppendPipeline> for ownership instead. This patch is a refactor: it doesn't introduce behavior changes and it's covered by existing tests. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::appsinkCapsChanged): (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink): * platform/graphics/gstreamer/mse/AppendPipeline.h: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE): (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer): (WebCore::MediaSourceClientGStreamerMSE::abort): (WebCore::MediaSourceClientGStreamerMSE::resetParserState): (WebCore::MediaSourceClientGStreamerMSE::append): (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource): * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp: (WebCore::MediaSourcePrivateGStreamer::addSourceBuffer): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::create): (WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer): (WebCore::SourceBufferPrivateGStreamer::finishCreation): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: 2020-07-09 Zalan Bujtas <zalan@apple.com> [LFC][Verification] Use the table wrapper box's margin when checking the table box https://bugs.webkit.org/show_bug.cgi?id=214119 Reviewed by Darin Adler. Table margins are propagated to the table wrapper box. Test: fast/layoutformattingcontext/table-with-margin-simple.html * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): 2020-07-09 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Don't cache duration in MediaSourceClientGStreamerMSE https://bugs.webkit.org/show_bug.cgi?id=214128 Reviewed by Xabier Rodriguez-Calvar. MediaSource should be the single source of truth for the duration of the MediaSource, and querying it to MediaSource is efficient enough (trivial getter). There is no reason for MediaSourceClientGStreamerMSE to store a separate m_duration field. This patch introduces no behavior changes. * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: (WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE): (WebCore::MediaSourceClientGStreamerMSE::duration): (WebCore::MediaSourceClientGStreamerMSE::durationChanged): * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: 2020-07-09 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Make duration changes one way https://bugs.webkit.org/show_bug.cgi?id=214083 Reviewed by Xabier Rodriguez-Calvar. Until now, AppendPipeline emitted duration changes for the MediaSource. This was done with MediaSourcePrivateClient::durationChanged(const MediaTime&), a method which was added to MediaSource in r207889 just to implement this in the GStreamer port. This is not necessary though. AppendPipeline only needs to inform MediaSource of the duration of the initialization segment, and MediaSource will in turn set duration from the multi-platform code. This patch removes MediaSourcePrivateClient::durationChanged(const MediaTime&) from the multi-platform API, along with its usages in the GStreamer port, giving the multi-platform code sole responsibility on duration changes. This is a code cleanup and it's covered by existing tests. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::durationChanged): Deleted. * Modules/mediasource/MediaSource.h: * platform/graphics/MediaSourcePrivateClient.h: * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::didReceiveInitializationSegment): (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged): 2020-07-09 Philippe Normand <pnormand@igalia.com> [GStreamer][MSE] AV1 support https://bugs.webkit.org/show_bug.cgi?id=207547 Reviewed by Xabier Rodriguez-Calvar. If only the av1dec decoder is available, consider AV1 decoding support as disabled, because this plugin performs really badly. However, if any other AV1 decoder is present, such as the dav1d-based Rust decoder for instance, consider AV1 support as enabled. These checks are now performed by both RegistryScanner instances, for MSE and non-MSE players. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::hasElementForMediaType const): (WebCore::GStreamerRegistryScanner::initialize): * platform/graphics/gstreamer/GStreamerRegistryScanner.h: 2020-07-09 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Remove orphan code in SourceBufferPrivateGStreamer::append() https://bugs.webkit.org/show_bug.cgi?id=214086 Reviewed by Xabier Rodriguez-Calvar. A refactor in r240784 missed this line, which was unreachable code before and should have removed. Instead, it has been run every time after sending an append to the AppendPipeline, and it just happens it doesn't have visible consequences. This patch cleans that up removing that line. No visible behavior changes are introduced. * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::append): 2020-07-09 Carlos Garcia Campos <cgarcia@igalia.com> [SOUP] Initialize m_allowCookies and m_acceptEncoding in ResourceRequest::updateFromSoupMessage https://bugs.webkit.org/show_bug.cgi?id=214077 Reviewed by Michael Catanzaro. Check if SOUP_TYPE_CONTENT_DECODER and SOUP_TYPE_COOKIE_JAR are disabled in the given message. * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateFromSoupMessage): 2020-07-09 Carlos Garcia Campos <cgarcia@igalia.com> [SOUP] Add support for HTTPCookieAcceptPolicy::OnlyFromMainDocumentDomain https://bugs.webkit.org/show_bug.cgi?id=213954 Reviewed by Michael Catanzaro. Handle both OnlyFromMainDocumentDomain and ExclusivelyFromMainDocumentDomain. * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::NetworkStorageSession::NetworkStorageSession): (WebCore::NetworkStorageSession::setCookieAcceptPolicy): (WebCore::NetworkStorageSession::cookieAcceptPolicy const): (WebCore::NetworkStorageSession::setResourceLoadStatisticsEnabled): 2020-07-08 Simon Fraser <simon.fraser@apple.com> Allow ScrollableArea to ask if a user scroll is in progress https://bugs.webkit.org/show_bug.cgi?id=214121 Reviewed by Wenson Hsieh. Work towards fixing scrolling stutters on layouting pages using scroll snap, like tesla.com. ScrollableArea::updateScrollSnapState(), which happens as a result of layout, should not set a new scroll position if a user scroll is in progress. ScrollController already tracks m_inScrollGesture, so in the first instance just refactor the code to return that. Future changes will check for scrolling thread activity. * page/FrameView.cpp: (WebCore::FrameView::isUserScrollInProgress const): (WebCore::FrameView::isRubberBandInProgress const): * page/FrameView.h: * platform/ScrollAnimator.h: (WebCore::ScrollAnimator::ScrollAnimator::isUserScrollInProgress const): * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::updateScrollSnapState): * platform/ScrollableArea.h: (WebCore::ScrollableArea::isUserScrollInProgress const): * platform/cocoa/ScrollController.h: * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::isUserScrollInProgress const): * platform/mac/ScrollAnimatorMac.h: * platform/mac/ScrollAnimatorMac.mm: (WebCore::ScrollAnimatorMac::isUserScrollInProgress const): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::isUserScrollInProgress const): (WebCore::RenderLayer::isRubberBandInProgress const): * rendering/RenderLayer.h: 2020-07-08 Andres Gonzalez <andresg_22@apple.com> Implementation of AXIsolatedObject::setSelectedVisiblePositionRange. https://bugs.webkit.org/show_bug.cgi?id=214118 Reviewed by Chris Fleizach. Covered by test: accessibility/mac/selected-visible-position-range.html. Implemented AXIsolatedObject::setSelectedVisiblePositionRange() and selection() by forwarding the call to the associated AX object. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::selection const): (WebCore::AXIsolatedObject::setSelectedVisiblePositionRange const): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]): call to the backing object should happen on the main thread since it takes a VisiblePositionRange parameter. 2020-07-08 Simon Fraser <simon.fraser@apple.com> Clean up time values in ScrollController https://bugs.webkit.org/show_bug.cgi?id=214117 Reviewed by Wenson Hsieh. ScrollController used a mixture of [NSDate timeIntervalSinceReferenceDate], [NSProcessInfo processInfo].systemUptime and wheelEvent.timestamp().secondsSinceEpoch(). Standardize on Seconds/MonotonicTime/WallTime. * platform/cocoa/ScrollController.h: * platform/cocoa/ScrollController.mm: (WebCore::elasticDeltaForTimeDelta): (WebCore::ScrollController::handleWheelEvent): (WebCore::ScrollController::snapRubberBandTimerFired): (WebCore::ScrollController::snapRubberBand): 2020-07-08 Brady Eidson <beidson@apple.com> Aggressively prime GameController.framework gamepad provider. https://bugs.webkit.org/show_bug.cgi?id=214094 Reviewed by Darin Adler. GameController.framework gets itself going by listening for application activation, assuming that it is hard linked. Soft linking breaks this. There's an SPI to manually kickstart it. Also add some logging I'd added while exploring issues around this. * platform/gamepad/cocoa/GameControllerGamepadProvider.h: * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): (WebCore::GameControllerGamepadProvider::prewarmGameControllerDevicesIfNecessary): (WebCore::GameControllerGamepadProvider::startMonitoringGamepads): * platform/gamepad/cocoa/GameControllerSPI.h: 2020-07-08 Sam Weinig <weinig@apple.com> Part 3 of SimpleColor and SRGBA<uint8_t> are essentially the same - let's converge them https://bugs.webkit.org/show_bug.cgi?id=214082 Reviewed by Darin Adler. - Replaces all uses of SimpleColor that are not implementation details of Color, with SRGBA<uint8_t>. - Adds ColorBuilder<T> to allow maintaining the syntax SimpleColor for constant colors. e.g: Color color = Color::yellow.colorWithAlpha(128); * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: Add ColorBuilder.h * platform/graphics/Color.cpp: (WebCore::Color::lightened const): (WebCore::Color::darkened const): (WebCore::Color::semanticColor const): * platform/graphics/Color.h: (WebCore::Color::Color): (WebCore::Color::asSimple const): (WebCore::Color::setSimpleColor): (WebCore::Color::isBlackColor): (WebCore::Color::isWhiteColor): (WebCore::Color::encode const): (WebCore::Color::decode): - Make constructor taking a SimpleColor private. - Add / modifiy constructors to take SRGBA<uint8_t>. - Make setSimpleColor() take a SRGBA<uint8_t> (this will be renamed along with other aspects of Color's internals in a subsequent change). - Update calls that still need SimpleColor to use an explicit construction from SRGBA<uint8_t>. * platform/graphics/ColorBuilder.h: Added. (WebCore::ColorBuilder::ColorBuilder): (WebCore::ColorBuilder::color const): (WebCore::ColorBuilder::colorWithAlpha const): Added to help maintain current syntax why constructing colors. Currently it only supports color type with uint8_t components, but can be expanded to support more. * platform/graphics/ColorUtilities.h: (WebCore::clampToComponentByte): Remove unnecessary cast. * platform/graphics/SimpleColor.h: (WebCore::SimpleColor::SimpleColor): Restrict to explicit construction via a SRGBA<uint8_t>. (WebCore::makeSimpleColor): Update to return ColorBuilder<SRGBA<uint8_t>>. A future change will update the function name, but kept the same here to limit the size of the change. * platform/graphics/mac/ColorMac.mm: (WebCore::makeSimpleColorFromNSColor): (WebCore::nsColor): * platform/graphics/cg/ColorCG.cpp: (WebCore::makeSimpleColorFromCGColor): (WebCore::cachedCGColor): Replace direct SimpleColor usage with SRGBA<uint8_t> and simplify Packed construction now that .asSRGBA<uint8_t>() is not needed for color constants. * css/DeprecatedCSSOMRGBColor.h: * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseNamedColor): (WebCore::CSSParser::parseHexColor): * css/parser/CSSParser.h: * css/parser/CSSParserFastPaths.cpp: (WebCore::finishParsingHexColor): (WebCore::parseHexColorInternal): (WebCore::parseNumericColor): (WebCore::finishParsingNamedColor): (WebCore::parseNamedColorInternal): (WebCore::parseSimpleColorInternal): (WebCore::CSSParserFastPaths::parseSimpleColor): (WebCore::CSSParserFastPaths::parseHexColor): (WebCore::CSSParserFastPaths::parseNamedColor): * css/parser/CSSParserFastPaths.h: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseHexColor): * html/ColorInputType.cpp: (WebCore::parseSimpleColorValue): * html/HTMLElement.cpp: (WebCore::parseLegacyColorValue): * page/DebugPageOverlays.cpp: (WebCore::touchEventRegionColors): * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::HistoricMemoryCategoryInfo::HistoricMemoryCategoryInfo): * platform/graphics/ColorBlending.cpp: (WebCore::blendWithWhite): (WebCore::blend): (WebCore::blendWithoutPremultiply): * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::makeSimpleColorFromARGBCFArray): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::cloneLayerDebugBorderColor): * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawBoxes): * rendering/RenderLayerBacking.cpp: * rendering/RenderThemeMac.mm: (WebCore::menuBackgroundColor): Replace direct SimpleColor usage with SRGBA<uint8_t>. 2020-07-08 Simon Fraser <simon.fraser@apple.com> Make a logging channel for ScrollSnap and improve its logging https://bugs.webkit.org/show_bug.cgi?id=214096 Reviewed by Wenson Hsieh. Pull existing scroll snap logging out of the Scrolling log channel into a new ScrollSnap channel, add more logging, and make better use of TextStream-based logging. * page/scrolling/AxisScrollSnapOffsets.cpp: (WebCore::operator<<): (WebCore::updateSnapOffsetsForScrollableArea): (WebCore::snapOffsetsToString): Deleted. (WebCore::snapOffsetRangesToString): Deleted. (WebCore::snapPortOrAreaToString): Deleted. * platform/Logging.h: * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::updateScrollSnapState): * platform/cocoa/ScrollController.mm: (WebCore::operator<<): (WebCore::ScrollController::processWheelEventForScrollSnap): (WebCore::ScrollController::startScrollSnapTimer): (WebCore::ScrollController::stopScrollSnapTimer): (WebCore::ScrollController::scrollSnapTimerFired): (WebCore::ScrollController::updateScrollSnapState): * platform/cocoa/ScrollSnapAnimatorState.h: * platform/cocoa/ScrollSnapAnimatorState.mm: (WebCore::operator<<): 2020-07-08 Per Arne Vollan <pvollan@apple.com> [Cocoa] Make it possible to establish direct XPC connections between WebKit processes https://bugs.webkit.org/show_bug.cgi?id=214079 Reviewed by Brent Fulgham. Add abstract classes XPCEndpoint and XPCEndpointClient to handle the creation of direct xpc connections between WebKit processes. In order to create a direct xpc connection between two processes, these two classes can be subclassed, and the xpc endpoint created by the XPCEndpoint object, can be sent via the UI process over the bootstrap xpc connection. The UI process can then forward this endpoint to another WebKit process by sending it over the bootstrap xpc connection. The receiving process can then initialize an XPCEndpointClient object with this endpoint, and a new direct connection will then be available, over which the two processes can communicate. API test: WebKit.XPCEndpoint * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/XPCEndpoint.h: Added. * platform/cocoa/XPCEndpoint.mm: Added. (WebCore::XPCEndpoint::XPCEndpoint): (WebCore::XPCEndpoint::sendEndpointToConnection): (WebCore::XPCEndpoint::endpoint const): * platform/cocoa/XPCEndpointClient.h: Added. (WebCore::XPCEndpointClient::~XPCEndpointClient): * platform/cocoa/XPCEndpointClient.mm: Added. (WebCore::XPCEndpointClient::setEndpoint): (WebCore::XPCEndpointClient::connection): 2020-07-08 Stephan Szabo <stephan.szabo@sony.com> [PlayStation] Build fix after r264050 https://bugs.webkit.org/show_bug.cgi?id=214091 Unreviewed build fix No new tests, only build fix. * platform/playstation/ScrollbarThemePlayStation.cpp: 2020-07-08 Sihui Liu <sihui_liu@appe.com> Text manipulation should ignore white spaces between nodes https://bugs.webkit.org/show_bug.cgi?id=213907 Reviewed by Wenson Hsieh. Text returned by TextIterator contains white spaces (including tabs and line breaks) that do not belong to content of nodes. Those spaces are emitted based on style of nodes. For example, line breaks can be emitted before and after block-level element. These spaces should not be extracted as part of the content, because they could change based on the style of nodes or range of TextIterator, and manipulation fails if content is changed. We want to make sure TextManipulationController monitors the real content of nodes. r262778 tried solving this issue by excluding text with empty node from TextIterator's result. That worked with line break, but not space and tab. See radar and new test. To solve this, now we exclude text with zero-length range. This patch does not change the behavior of line breaks, which is covered by: TextManipulation.StartTextManipulationExtractsVisibleLineBreaksInTextAsExcludedTokens TextManipulation.CompleteTextManipulationCanMergeContentAndPreserveLineBreaks TextManipulation.CompleteTextManipulationReplaceTwoSimpleParagraphs New test: TextManipulation.CompleteTextManipulationIgnoreWhiteSpacesBetweenParagraphs Modified existing tests: TextManipulation.StartTextManipulationExtractsValuesByNode * editing/TextManipulationController.cpp: (WebCore::ParagraphContentIterator::ParagraphContentIterator): (WebCore::ParagraphContentIterator::shouldAdvanceIteratorPastCurrentNode const): (WebCore::ParagraphContentIterator::advanceIteratorNodeAndUpdateText): 2020-07-08 Darin Adler <darin@apple.com> Remove use of live ranges from AXObject.h https://bugs.webkit.org/show_bug.cgi?id=214053 Reviewed by Sam Weinig. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::traverseToOffsetInRange): Take SimpleRange. (WebCore::AXObjectCache::lengthForRange): Take Optional<SimpleRange>. (WebCore::AXObjectCache::rangeForNodeContents): Return SimpleRange, take reference rather than pointer. (WebCore::characterOffsetsInOrder): Use SimpleRange. (WebCore::resetNodeAndOffsetForReplacedNode): Take a reference to the node rather than a pointer. (WebCore::boundaryPoint): Added. Could be used to replace calls to setRangeStartOrEndWithCharacterOffset. (WebCore::setRangeStartOrEndWithCharacterOffset): Take SimpleRange. Also use the new boundaryPoint function above. (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets): Return Optional<SimpleRange>. (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange): Take SimpleRange. (WebCore::AXObjectCache::startOrEndTextMarkerDataForRange): Take SimpleRange. (WebCore::AXObjectCache::characterOffsetForNodeAndOffset): Use SimpleRange. (WebCore::AXObjectCache::textMarkerDataForNextCharacterOffset): Ditto. (WebCore::AXObjectCache::textMarkerDataForPreviousCharacterOffset): Ditto. (WebCore::AXObjectCache::visiblePositionFromCharacterOffset): (WebCore::AXObjectCache::characterOffsetFromVisiblePosition): (WebCore::AXObjectCache::leftWordRange): Return Optional<SimpleRange>. (WebCore::AXObjectCache::rightWordRange): Ditto. (WebCore::AXObjectCache::nextBoundary): Ditto. (WebCore::AXObjectCache::previousBoundary): Ditto. (WebCore::AXObjectCache::startCharacterOffsetOfParagraph): Use SimpleRange. (WebCore::AXObjectCache::endCharacterOffsetOfParagraph): Ditto. (WebCore::AXObjectCache::paragraphForCharacterOffset): Ditto. (WebCore::AXObjectCache::sentenceForCharacterOffset): Ditto. (WebCore::AXObjectCache::localCaretRectForCharacterOffset): Ditto. (WebCore::AXObjectCache::characterOffsetForPoint): Ditto. (WebCore::AXObjectCache::characterOffsetForIndex): Ditto. (WebCore::AXObjectCache::indexForCharacterOffset): Ditto. * accessibility/AXObjectCache.h: Remove uses of Range and include of "Range.h". * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::elementRange const): Call createLiveRange. (WebCore::AccessibilityObject::rangeForPlainTextRange const): Ditto. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::boundsForRange const): Pass SimpleRange. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (+[WebAccessibilityTextMarker startOrEndTextMarkerForRange:isStart:cache:]): Pass SimpleRange. (-[WebAccessibilityObjectWrapper positionForTextMarker:]): Call createLiveRange. (-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]): Pass SimpleRange. (-[WebAccessibilityObjectWrapper textMarkerForPosition:]): Ditto. (-[WebAccessibilityObjectWrapper rangeForTextMarkers:]): Call createLiveRange. (-[WebAccessibilityObjectWrapper lengthForTextMarkers:]): Pass SimpleRange. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (startOrEndTextmarkerForRange): (-[WebAccessibilityObjectWrapper rangeForTextMarkerRange:]): Pass SimpleRange. (-[WebAccessibilityObjectWrapper _indexForTextMarker:]): Call createLiveRange. (-[WebAccessibilityObjectWrapper textMarkerRangeAtTextMarker:forUnit:]): Ditto. (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): Ditto. * dom/BoundaryPoint.h: Added makeBoundaryPointBefore/AfterNode. * dom/SimpleRange.cpp: (WebCore::makeBoundaryPointBeforeNode): Added. (WebCore::makeBoundaryPointAfterNode): Ditto. 2020-07-08 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Do not use the initial strut baseline values when the text content is inside an inline container https://bugs.webkit.org/show_bug.cgi?id=214069 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/line-heigt-when-text-is-inside-inline-container.html * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::close): (WebCore::Layout::LineBuilder::adjustBaselineAndLineHeight): * layout/inlineformatting/InlineLineBuilder.h: 2020-07-08 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Table width is computed as if box-sizing was border-box https://bugs.webkit.org/show_bug.cgi?id=214070 Reviewed by Antti Koivisto. Apparently the width property of the <table> works as if box-sizing were set to border-box (and <div style="display: table" does not). Test: fast/layoutformattingcontext/table-with-padding-and-border-simple.html * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::buildTableStructure): 2020-07-07 Antoine Quint <graouts@webkit.org> [iOS] Sharing an <img> element with a base64-encoded URL shares the URL as raw text instead of an image https://bugs.webkit.org/show_bug.cgi?id=214042 <rdar://problem/56669102> Reviewed by Wenson Hsieh. * en.lproj/Localizable.strings: 2020-07-08 Philippe Normand <pnormand@igalia.com> REGRESSION(r263836): [GStreamer] Debug ASSERT hits https://bugs.webkit.org/show_bug.cgi?id=214047 Reviewed by Xabier Rodriguez-Calvar. Reduce the element dependency on RefPtr<MediaStreamTrackPrivate> which is not MT-safe. The data we need from it are its ID and the contents required to build a GstTagList. So we now create this tag-list upfront and keep track of the trackID as well. * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (webkitMediaStreamSrcAddPad): (ProbeData::ProbeData): (webkitMediaStreamSrcPadProbeCb): (webkitMediaStreamSrcSetupSrc): 2020-07-07 Andy Estes <aestes@apple.com> [Apple Pay] Fix the build on Catalina internal SDKs https://bugs.webkit.org/show_bug.cgi?id=214066 Unreviewed build fix for the 10.15.0 Internal SDK. * Modules/applepay/ApplePaySetupFeature.mm: (WebCore::ApplePaySetupFeature::supportsInstallments const): 2020-07-07 Alex Christensen <achristensen@webkit.org> Allow WebCoreNSURLSession sendH2Ping:pongHandler: to be called from any thread like the rest of WebCoreNSURLSession methods https://bugs.webkit.org/show_bug.cgi?id=214065 Reviewed by Jer Noble. Otherwise horrible crashes happen. The WebCore function calls and loading IPC calls need to happen on the main thread, and the callback should happen on the NSOperationQueue given when constructing the WebCoreNSURLSession. * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSession sendH2Ping:pongHandler:]): 2020-07-07 Sam Weinig <weinig@apple.com> Part 2 of SimpleColor and SRGBA<uint8_t> are essentially the same - let's converge them https://bugs.webkit.org/show_bug.cgi?id=213981 Reviewed by Darin Adler. - Replaces internal representation of SimpleColor based on an ARGB uint32_t with SRGBA<uint8_t>. - Removes SimpleColor constructor taking a uint32_t. Callers that still need to convert from ARGB now do makeSimpleColor(asSRGBA(Packed::ARGB { value })). - Removes value() and valueAsARGB() member functions from SimpleColor. Callers that need a packed representation now do Packed::ARGB { simpleColor.asSRGBA<uint8_t>() }.value. * css/StyleColor.cpp: (WebCore::StyleColor::colorFromKeyword): Use asSRGBA(Packed::ARGB{...}) to constuct the color. * css/parser/CSSParserFastPaths.cpp: (WebCore::finishParsingNamedColor): Use asSRGBA(Packed::ARGB{...}) (or in one case, Packed::RGBA) to constuct the color. These can almost certainly be simplified, but in the interest of keeping things smallish, I have left that for a subsequent change. * editing/CompositionHighlight.h: Switch to using auto/makeSimpleColor. * page/cocoa/ResourceUsageOverlayCocoa.mm: Switch to using makeSimpleColor. (WebCore::HistoricMemoryCategoryInfo::HistoricMemoryCategoryInfo): (WebCore::HistoricResourceUsageData::HistoricResourceUsageData): Switch to using auto/makeSimpleColor. * platform/adwaita/ScrollbarThemeAdwaita.cpp: Switch to using auto/makeSimpleColor. * platform/graphics/Color.cpp: * platform/graphics/Color.h: - Switch to using auto/makeSimpleColor for named colors. - Switch to storing/encoding the inline SimpleColor as a Packed::RGBA value. * platform/graphics/ColorBlending.cpp: (WebCore::blend): Update for new name of clampToComponentBytes. * platform/graphics/ColorTypes.h: (WebCore::Packed::RGBA::RGBA): (WebCore::Packed::ARGB::ARGB): (WebCore::asSRGBA): Rename WebCore::ARGB to WebCore::Packed::ARGB. Adds companion, WebCore::Packed::RGBA. And adds constructors which make a packed type from an SRGBA<uint8_t>. * platform/graphics/ColorUtilities.h: (WebCore::clampToComponentByte): (WebCore::clampToComponentFloat): Extract out helper functions which just do the clamping for the type. (WebCore::clampToComponentBytes): (WebCore::clampToComponentFloats): Rename conversion functions that just clamp to use "clamp" prefix rather than "convert". Make use of extracted helpers. * platform/graphics/ImageBackingStore.h: (WebCore::ImageBackingStore::blendPixel): (WebCore::ImageBackingStore::pixelValue const): Update using new packed color types and funtions. * platform/graphics/SimpleColor.h: (WebCore::SimpleColor::SimpleColor): (WebCore::SimpleColor::alphaComponent const): (WebCore::SimpleColor::alphaComponentAsFloat const): (WebCore::SimpleColor::isOpaque const): (WebCore::SimpleColor::isVisible const): (WebCore::SimpleColor::colorWithAlpha const): (WebCore::SimpleColor::invertedColorWithAlpha const): (WebCore::SimpleColor::asSRGBA const): (WebCore::SimpleColor::get const): (WebCore::makeSimpleColor): (WebCore::SimpleColor::valueAsARGB const): Deleted. (WebCore::SimpleColor::value const): Deleted. (WebCore::SimpleColor::redComponent const): Deleted. (WebCore::SimpleColor::greenComponent const): Deleted. (WebCore::SimpleColor::blueComponent const): Deleted. - Removes constructor taking an ARGB uint32_t. - Removes valueAsARGB()/value() functions (can use Packed::ARGB directly if needed). - Switches internal representation to SRGBA<uint8_t>. - Streamline makeSimpleColor functions to use shared helpers from ColorUtilities.h * platform/graphics/cg/ColorCG.cpp: (WebCore::cachedCGColor): * platform/graphics/mac/ColorMac.mm: (WebCore::nsColor): Use Packed::RGBA to extract uint32_t for quick lookup of transparent/white/black SimpleColors. Despite the length of the calls, SimpleColor is fully constexpr, so these actually collapse down to the uint32_t representation at compile time. * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::drawDotsForDocumentMarker): Switch to using auto/makeSimpleColor. * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::defaultDevices): Switch to using makeSimpleColor. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawBoxes): Switch to using auto/makeSimpleColor. * platform/mock/ScrollbarThemeMock.cpp: (WebCore::ScrollbarThemeMock::paintTrackBackground): Switch to using makeSimpleColor. * rendering/RenderObject.cpp: (WebCore::RenderObject::calculateBorderStyleColor): Update comment to use per-component values. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::systemColor const): Switch to using makeSimpleColor. * rendering/RenderThemeAdwaita.cpp: Switch to using auto/makeSimpleColor. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintProgressBar): Switch to using auto/makeSimpleColor. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::systemColor const): Switch to using auto/makeSimpleColor. 2020-07-07 Andres Gonzalez <andresg_22@apple.com> Web content process hangs in AccessibilityRenderObject::setSelectedVisiblePositionRange in some corner cases. https://bugs.webkit.org/show_bug.cgi?id=214017 <rdar://problem/63000006> Reviewed by Chris Fleizach. Ensures that in the case of collapsed ranges, the VisiblePosition that the selection is being set to, is contained in the Element object. Test: accessibility/mac/selected-visible-position-range.html * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange const): 2020-07-07 Youenn Fablet <youenn@apple.com> Fix potential pixel buffer leak in ImageRotationSessionVT::rotate https://bugs.webkit.org/show_bug.cgi?id=213922 Reviewed by Eric Carlson. Fix a potential memory leak in an error case. Add more logging to be able to see errors. Remove the kCVPixelBufferIOSurfacePropertiesKey key on iOS from the buffer pool to revert part of https://trac.webkit.org/changeset/258504/webkit that seems problematic in iOS. * platform/graphics/cv/ImageRotationSessionVT.mm: (WebCore::ImageRotationSessionVT::initialize): (WebCore::ImageRotationSessionVT::rotate): 2020-07-07 Simon Fraser <simon.fraser@apple.com> Unable to scroll elcomerico.pe page until the page finishes loading https://bugs.webkit.org/show_bug.cgi?id=214027 <rdar://problem/64646259> Reviewed by Antti Koivisto. <https://elcomercio.pe/mundo/eeuu/que-visas-para-estados-unidos-fueron-suspendidas-por-orden-de-donald-trump-hasta-fin-de-ano-y-a-quien-afecta-la-medida-noticia/> had a scaleX(0) element as an ancestor of an overflow:scroll. The CALayer hit-testing code failed to take non-invertible transforms into account, causing the overflow:scroll to intercept scrolling events. Fix by explicitly testing for non-invertible transforms, and, when found, bailing from the sublayer walk. A non-invertible layer transform makes all its descendants non hit-testable. Tests: fast/scrolling/ios/non-invertible-transformed-scroller-ancestor.html fast/scrolling/mac/non-invertible-transform-hit-testing.html * page/scrolling/mac/ScrollingTreeMac.mm: (collectDescendantLayersAtPoint): * platform/graphics/transforms/TransformationMatrix.h: 2020-07-07 Peng Liu <peng.liu6@apple.com> Function didCleanupFullscreencreen() should be called at the end of VideoFullscreenInterfaceAVKit::cleanupFullscreen() https://bugs.webkit.org/show_bug.cgi?id=214032 Reviewed by Eric Carlson. VideoFullscreenManagerProxy::didCleanupFullscreen() may destroy an instance of VideoFullscreenInterfaceAVKit. So we should not access member variables of VideoFullscreenInterfaceAVKit after calling didCleanupFullscreen() in VideoFullscreenInterfaceAVKit::cleanupFullscreen(). Fix a flaky test crash: media/video-autoplay.html * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::cleanupFullscreen): 2020-07-07 Tim Horton <timothy_horton@apple.com> <attachment> layout does not scale with Dynamic Type size changes https://bugs.webkit.org/show_bug.cgi?id=214023 <rdar://problem/64914762> Reviewed by Sam Weinig. Test: fast/attachment/attachment-dynamic-type.html * rendering/RenderThemeIOS.mm: (WebCore::shortCaptionPointSizeWithContentSizeCategory): (WebCore::attachmentDynamicTypeScaleFactor): (WebCore::RenderAttachmentInfo::buildWrappedLines): (WebCore::RenderThemeIOS::attachmentIntrinsicSize const): Scale the <attachment> overall size and text line width by the Dynamic Type scaling factor, determined by dividing the resolved point size of two font descriptors created with the Large (default) category and the Current category. * rendering/RenderAttachment.cpp: (WebCore::RenderAttachment::layout): * rendering/RenderTheme.h: (WebCore::RenderTheme::attachmentShouldAllowWidthToShrink const): * rendering/RenderThemeIOS.h: Add a RenderTheme bit controlling the behavior introduced in r202117. After r202117, <attachment> elements are never allowed to shrink. This is fine for macOS, where we don't vary the Dynamic Type size, only the content, but undesirable on iOS, where the size of the <attachment> is based solely on Dynamic Type size (and thus can shrink when the size is reduced), and not the content. * Configurations/WebCoreTestSupport.xcconfig: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setContentSizeCategory): * testing/Internals.h: * testing/Internals.idl: Add a Internals method to change the current Dynamic Type category. 2020-07-07 Alex Christensen <achristensen@webkit.org> Add WebCoreNSURLSession SPI to send HTTP/2 ping https://bugs.webkit.org/show_bug.cgi?id=214030 <rdar://problem/64495827> Reviewed by Jer Noble. Add lots of plumbing, move internalError from WebKit to WebCore. Covered by an API test that requires some future CFNetwork behavior. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMPromiseDeferred.h: * loader/FrameLoaderClient.cpp: Added. (WebCore::FrameLoaderClient::sendH2Ping): * loader/FrameLoaderClient.h: * loader/MediaResourceLoader.cpp: (WebCore::MediaResourceLoader::sendH2Ping): * loader/MediaResourceLoader.h: * platform/graphics/PlatformMediaResourceLoader.cpp: Added. (WebCore::PlatformMediaResourceLoader::sendH2Ping): * platform/graphics/PlatformMediaResourceLoader.h: * platform/network/ResourceErrorBase.cpp: (WebCore::internalError): * platform/network/ResourceErrorBase.h: * platform/network/cocoa/WebCoreNSURLSession.h: * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSession sendH2Ping:pongHandler:]): * testing/Internals.cpp: (WebCore::Internals::sendH2Ping): * testing/Internals.h: * testing/Internals.idl: 2020-07-07 Tomoki Imai <Tomoki.Imai@sony.com> [Win] Implement Pasteboard::writeCustomData for Web Inspector Console tab https://bugs.webkit.org/show_bug.cgi?id=213986 Reviewed by Fujii Hironori. Implement Pasteboard::writeCustomData and Pasteboard::typesSafeForBindings. This fixes the issue which we cannot copy text in WebInspector's Console tab. We enable some existing testcases for pasteboard. * platform/Pasteboard.h: * platform/PasteboardCustomData.cpp: (WebCore::PasteboardCustomData::fromPersistenceDecoder): Construct PasteboardCustomData from WTF::Persistence::Decoder. (WebCore::PasteboardCustomData::fromSharedBuffer): Use fromPersistenceDecoder function to implement. * platform/PasteboardCustomData.h: * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::createGlobalData): Add uint8_t* variant. * platform/win/ClipboardUtilitiesWin.h: * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::finishCreatingPasteboard): Register new clipboard format CustomDataClipboardFormat. (WebCore::Pasteboard::readPasteboardCustomData): Helper function to read PasteboardCustomData from the pasteboard. (WebCore::Pasteboard::typesSafeForBindings): Implemented. (WebCore::Pasteboard::readOrigin): Implemented. (WebCore::Pasteboard::readStringInCustomData): Implemented. (WebCore::Pasteboard::writeCustomData): Implemented. 2020-07-06 Simon Fraser <simon.fraser@apple.com> High CPU usage on Stash search results pages https://bugs.webkit.org/show_bug.cgi?id=214018 <rdar://problem/64832917> Reviewed by Tim Horton. Stash search results pages can contain a lot of overflow:scroll areas, so scrolling thread CA commits would take a long time because ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters() would open and close a CA commit for each scroller. Fix by not explicitly starting a CA commit, and only entering this code if a gesture is active and in the momentum phase. Also sprinkle BEGIN_BLOCK_OBJC_EXCEPTIONS/END_BLOCK_OBJC_EXCEPTIONS in more places that call into Core Animation. * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers): (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent): (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters): 2020-07-06 Simon Fraser <simon.fraser@apple.com> BEGIN_BLOCK_OBJC_EXCEPTIONS/END_BLOCK_OBJC_EXCEPTIONS should not have trailing semicolons https://bugs.webkit.org/show_bug.cgi?id=214019 Reviewed by Tim Horton. These macros are defined as: #define BEGIN_BLOCK_OBJC_EXCEPTIONS @try { #define END_BLOCK_OBJC_EXCEPTIONS } @catch(NSException *localException) { ReportBlockedObjCException(localException); } so they should not be used with trailing semicolons. * editing/cocoa/DictionaryLookup.mm: (WebCore::expandSelectionByCharacters): (WebCore::showPopupOrCreateAnimationController): * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::dataInRTFDFormat): (WebCore::Editor::dataInRTFFormat): * editing/mac/DictionaryLookupLegacy.mm: (WebCore::tokenRange): (WebCore::expandSelectionByCharacters): (WebCore::showPopupOrCreateAnimationController): (WebCore::DictionaryLookup::hidePopup): * page/ios/EventHandlerIOS.mm: (WebCore::EventHandler::keyEvent): (WebCore::lastEventIsMouseUp): (WebCore::EventHandler::passMouseDownEventToWidget): (WebCore::findViewInSubviews): (WebCore::EventHandler::eventLoopHandleMouseUp): (WebCore::EventHandler::passSubframeEventToSubframe): (WebCore::EventHandler::passWheelEventToWidget): (WebCore::EventHandler::mouseDown): (WebCore::EventHandler::mouseUp): (WebCore::EventHandler::mouseMoved): * page/mac/ChromeMac.mm: (WebCore::Chrome::focusNSView): * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::keyEvent): (WebCore::lastEventIsMouseUp): (WebCore::EventHandler::passMouseDownEventToWidget): (WebCore::findViewInSubviews): (WebCore::EventHandler::eventLoopHandleMouseDragged): (WebCore::EventHandler::eventLoopHandleMouseUp): (WebCore::EventHandler::passSubframeEventToSubframe): (WebCore::EventHandler::passWheelEventToWidget): (WebCore::EventHandler::mouseDown): (WebCore::EventHandler::mouseDragged): (WebCore::EventHandler::mouseUp): (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking): (WebCore::EventHandler::mouseMoved): (WebCore::EventHandler::pressureChange): (WebCore::EventHandler::passMouseMovedEventToScrollbars): * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm: (WebCore::ContentFilterUnblockHandler::encode const): (WebCore::ContentFilterUnblockHandler::decode): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): * platform/graphics/gpu/cocoa/GPUBindGroupAllocatorMetal.mm: (WebCore::GPUBindGroupAllocator::allocateAndSetEncoders): (WebCore::GPUBindGroupAllocator::reallocate): * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: (WebCore::appendArgumentToArray): (WebCore::tryCreateMtlArgumentEncoder): (WebCore::argumentDescriptor): (WebCore::GPUBindGroupLayout::tryCreate): * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: (WebCore::setBufferOnEncoder): (WebCore::setSamplerOnEncoder): (WebCore::setTextureOnEncoder): * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: (WebCore::GPUBuffer::tryCreate): (WebCore::GPUBuffer::commandBufferCommitted): (WebCore::GPUBuffer::copyStagingBufferToGPU): * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: (WebCore::GPUCommandBuffer::tryCreate): (WebCore::GPUCommandBuffer::endBlitEncoding): (WebCore::GPUCommandBuffer::copyBufferToBuffer): (WebCore::GPUCommandBuffer::copyBufferToTexture): (WebCore::GPUCommandBuffer::copyTextureToBuffer): (WebCore::GPUCommandBuffer::copyTextureToTexture): * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: (WebCore::GPUComputePassEncoder::tryCreate): (WebCore::GPUComputePassEncoder::setPipeline): (WebCore::GPUComputePassEncoder::dispatch): (WebCore::GPUComputePassEncoder::useResource): (WebCore::GPUComputePassEncoder::setComputeBuffer): * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: (WebCore::trySetMetalFunctions): (WebCore::trySetFunctions): (WebCore::convertComputePipelineDescriptor): (WebCore::tryCreateMTLComputePipelineState): * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm: (WebCore::GPUDevice::tryCreate): * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: (WebCore::GPUProgrammablePassEncoder::endPass): * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: (WebCore::GPUQueue::tryCreate): (WebCore::GPUQueue::submit): * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: (WebCore::populateMtlColorAttachmentsArray): (WebCore::populateMtlDepthStencilAttachment): (WebCore::GPURenderPassEncoder::tryCreate): (WebCore::GPURenderPassEncoder::setPipeline): (WebCore::GPURenderPassEncoder::setBlendColor): (WebCore::GPURenderPassEncoder::setViewport): (WebCore::GPURenderPassEncoder::setScissorRect): (WebCore::GPURenderPassEncoder::setVertexBuffers): (WebCore::GPURenderPassEncoder::draw): (WebCore::GPURenderPassEncoder::drawIndexed): (WebCore::GPURenderPassEncoder::useResource): (WebCore::GPURenderPassEncoder::setVertexBuffer): (WebCore::GPURenderPassEncoder::setFragmentBuffer): * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: (WebCore::tryCreateMtlDepthStencilState): (WebCore::trySetVertexInput): (WebCore::trySetColorStates): (WebCore::trySetMetalFunctions): (WebCore::trySetFunctions): (WebCore::convertRenderPipelineDescriptor): (WebCore::tryCreateMtlRenderPipelineState): * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm: (WebCore::tryCreateMtlSamplerState): * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: (WebCore::GPUShaderModule::tryCreate): * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: (WebCore::tryCreateWebGPULayer): (WebCore::GPUSwapChain::tryGetCurrentTexture): * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: (WebCore::tryCreateMtlTextureDescriptor): (WebCore::GPUTexture::tryCreate): (WebCore::GPUTexture::tryCreateDefaultTextureView): * platform/graphics/mac/ColorMac.mm: (WebCore::makeSimpleColorFromNSColor): * platform/ios/ScrollViewIOS.mm: (WebCore::ScrollView::documentView const): (WebCore::ScrollView::platformSetScrollbarModes): (WebCore::ScrollView::platformScrollbarModes const): (WebCore::ScrollView::platformSetCanBlitOnScroll): (WebCore::ScrollView::platformUnobscuredContentRect const): (WebCore::ScrollView::platformExposedContentRect const): (WebCore::ScrollView::setActualScrollPosition): (WebCore::ScrollView::platformVisibleContentRect const): (WebCore::ScrollView::platformVisibleContentSize const): (WebCore::ScrollView::legacyTileCache): (WebCore::ScrollView::platformSetContentsSize): (WebCore::ScrollView::platformSetScrollbarsSuppressed): (WebCore::ScrollView::platformSetScrollPosition): (WebCore::ScrollView::platformRepaintContentRectangle): (WebCore::ScrollView::platformContentsToScreen const): (WebCore::ScrollView::platformScreenToContents const): (WebCore::ScrollView::platformSetScrollOrigin): * platform/ios/WidgetIOS.mm: (WebCore::Widget::show): (WebCore::Widget::hide): (WebCore::Widget::frameRect const): (WebCore::Widget::setFrameRect): (WebCore::Widget::paint): (WebCore::Widget::addToSuperview): (WebCore::Widget::removeFromSuperview): (WebCore::Widget::convertFromRootToContainingWindow): (WebCore::Widget::convertFromContainingWindowToRoot): * platform/mac/CursorMac.mm: (WebCore::createCustomCursor): * platform/mac/ScrollAnimatorMac.mm: (-[WebScrollbarPartAnimation invalidate]): (-[WebScrollerImpDelegate cancelAnimations]): (-[WebScrollerImpDelegate invalidate]): (WebCore::ScrollAnimatorMac::~ScrollAnimatorMac): * platform/mac/ScrollViewMac.mm: (WebCore::ScrollView::documentView const): (WebCore::ScrollView::platformAddChild): (WebCore::ScrollView::platformSetScrollbarModes): (WebCore::ScrollView::platformScrollbarModes const): (WebCore::ScrollView::platformSetCanBlitOnScroll): (WebCore::ScrollView::platformTopContentInset const): (WebCore::ScrollView::platformSetTopContentInset): (WebCore::ScrollView::platformVisibleContentRect const): (WebCore::ScrollView::platformVisibleContentRectIncludingObscuredArea const): (WebCore::ScrollView::platformSetContentsSize): (WebCore::ScrollView::platformSetScrollbarsSuppressed): (WebCore::ScrollView::platformSetScrollPosition): (WebCore::ScrollView::platformRepaintContentRectangle): (WebCore::ScrollView::platformContentsToScreen const): (WebCore::ScrollView::platformScreenToContents const): (WebCore::ScrollView::platformSetScrollOrigin): * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::scrollbarThickness): (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle): (WebCore::ScrollbarThemeMac::minimumThumbLength): (WebCore::ScrollbarThemeMac::updateEnabledState): (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar): (WebCore::scrollerImpPaint): (WebCore::linenBackgroundColor): * platform/mac/WidgetMac.mm: (WebCore::Widget::setFocus): (WebCore::Widget::show): (WebCore::Widget::hide): (WebCore::Widget::frameRect const): (WebCore::Widget::setFrameRect): (WebCore::Widget::paint): (WebCore::Widget::setIsSelected): (WebCore::Widget::removeFromSuperview): (WebCore::Widget::convertFromRootToContainingWindow): (WebCore::Widget::convertFromContainingWindowToRoot): * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::setCookie): (WebCore::NetworkStorageSession::setCookies): (WebCore::NetworkStorageSession::setAllCookiesToSameSiteStrict): (WebCore::NetworkStorageSession::cookiesForSession const): (WebCore::NetworkStorageSession::setCookiesFromDOM const): (WebCore::NetworkStorageSession::cookieAcceptPolicy const): (WebCore::NetworkStorageSession::getRawCookies const): (WebCore::NetworkStorageSession::deleteCookie const): (WebCore::NetworkStorageSession::getHostnamesWithCookies): (WebCore::NetworkStorageSession::deleteCookiesForHostnames): * platform/network/mac/ResourceErrorMac.mm: (WebCore::ResourceError::platformLazyInit): * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::start): * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration): 2020-07-06 Chris Fleizach <cfleizach@apple.com> AX: Add ability for AX objects to output html in debug https://bugs.webkit.org/show_bug.cgi?id=214020 Reviewed by Darin Adler. * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase innerHTML]): (-[WebAccessibilityObjectWrapperBase outerHTML]): 2020-07-06 Brady Eidson <beidson@apple.com> Get rid of concept of "initial connected gamepads" https://bugs.webkit.org/show_bug.cgi?id=214010 Reviewed by Tim Horton. No new tests (Refactor, no behavior change) When a page starts using gamepads and some were already connected, this concept was meant to manage when the already-connected gamepads could be revealed to the page. It obviously wasn't needed, as only the HID provider used them (GameController provider didn't) Instead, we should just always include a "does this event make gamepads visible?" bit. This cleans up a lot of weird code gets both providers working closer to each other. * Modules/gamepad/GamepadManager.cpp: (WebCore::GamepadManager::platformGamepadConnected): (WebCore::GamepadManager::platformGamepadInputActivity): * Modules/gamepad/GamepadManager.h: * platform/gamepad/GamepadProvider.cpp: (WebCore::GamepadProvider::dispatchPlatformGamepadInputActivity): * platform/gamepad/GamepadProviderClient.h: (WebCore::GamepadProviderClient::setInitialConnectedGamepads): Deleted. * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::controllerDidConnect): (WebCore::GameControllerGamepadProvider::makeInvisibileGamepadsVisible): * platform/gamepad/mac/HIDGamepadProvider.cpp: (WebCore::HIDGamepadProvider::HIDGamepadProvider): (WebCore::HIDGamepadProvider::initialGamepadsConnectedTimerFired): (WebCore::HIDGamepadProvider::openAndScheduleManager): (WebCore::HIDGamepadProvider::closeAndUnscheduleManager): (WebCore::HIDGamepadProvider::deviceAdded): (WebCore::HIDGamepadProvider::deviceRemoved): (WebCore::HIDGamepadProvider::inputNotificationTimerFired): (WebCore::HIDGamepadProvider::connectionDelayTimerFired): Deleted. * platform/gamepad/mac/HIDGamepadProvider.h: * testing/MockGamepadProvider.cpp: (WebCore::MockGamepadProvider::connectMockGamepad): 2020-07-06 Wenson Hsieh <wenson_hsieh@apple.com> Web process sometimes crashes when translating an article on spiegel.de https://bugs.webkit.org/show_bug.cgi?id=214014 <rdar://problem/65099253> Reviewed by Tim Horton. The crash happens because we try to make a BoundaryPoint (using `makeBoundaryPoint`) out of an orphaned `Position` that is anchored before or after the anchor node (more specifically, either `PositionIsBeforeAnchor` or `PositionIsAfterAnchor`). In `makeBoundaryPoint`, we'll avoid the early `WTF::nullopt` return since the position is non-null, but then try to access the container node, which is null in this case because the anchor node has been unparented. Fix this by not attempting to observe orphaned DOM positions when extracting content for translation. Test: TextManipulation.StartTextManipulationAvoidCrashWhenExtractingOrphanedPositions * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::observeParagraphs): 2020-07-06 John Wilander <wilander@apple.com> Follow-up to r263992: Make isKinjaLoginAvatarElement() a free function https://bugs.webkit.org/show_bug.cgi?id=214015 <rdar://problem/65153632> Unreviewed follow-up to a quirk. Just changing isKinjaLoginAvatarElement() from member to free function. As requested in https://bugs.webkit.org/show_bug.cgi?id=213910#c10. * page/Quirks.cpp: (WebCore::isKinjaLoginAvatarElement): (WebCore::Quirks::isKinjaLoginAvatarElement const): Deleted. * page/Quirks.h: 2020-07-06 Chris Fleizach <cfleizach@apple.com> AX: Implement user action spec for Escape action https://bugs.webkit.org/show_bug.cgi?id=213875 <rdar://problem/65022980> Reviewed by Darin Adler. Implement the Escape action for the user action events. https://github.com/WICG/aom/blob/gh-pages/explainer.md#user-action-events-from-assistive-technology Test: accessibility/keyevents-posted-for-dismiss-action.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::performEscape): (WebCore::AccessibilityNodeObject::dispatchSimulatedKeyboardUpDownEvent): (WebCore::AccessibilityNodeObject::postKeyboardKeysForValueChange): * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityPerformEscape]): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::performEscape): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]): 2020-07-06 James Darpinian <jdarpinian@chromium.org> Fix transform feedback tests https://bugs.webkit.org/show_bug.cgi?id=213906 Reviewed by Dean Jackson. Fix transform feedback conformance tests by implementing missing functionality such as: - Transform feedback object state tracking - Validation for all GL errors that can affect state tracking before calling ANGLE - Default transform feedback object - Pause/resume - Fix vertexAttribDivisor in WebGL 2 (unrelated to transform feedback) After this, all related tests pass except for a few that also fail in Chrome, and one that uses PIXEL_PACK_BUFFER which is not yet supported. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::~WebGL2RenderingContext): (WebCore::WebGL2RenderingContext::initializeNewContext): (WebCore::WebGL2RenderingContext::deleteTransformFeedback): (WebCore::WebGL2RenderingContext::bindTransformFeedback): (WebCore::ValidateTransformFeedbackPrimitiveMode): (WebCore::WebGL2RenderingContext::beginTransformFeedback): (WebCore::WebGL2RenderingContext::endTransformFeedback): (WebCore::WebGL2RenderingContext::transformFeedbackVaryings): (WebCore::WebGL2RenderingContext::pauseTransformFeedback): (WebCore::WebGL2RenderingContext::resumeTransformFeedback): (WebCore::WebGL2RenderingContext::setIndexedBufferBinding): (WebCore::WebGL2RenderingContext::getIndexedParameter): (WebCore::WebGL2RenderingContext::getMaxTransformFeedbackSeparateAttribs): (WebCore::WebGL2RenderingContext::getParameter): (WebCore::WebGL2RenderingContext::uncacheDeletedBuffer): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLProgram.cpp: (WebCore::WebGLProgram::cacheInfoIfNeeded): * html/canvas/WebGLProgram.h: * html/canvas/WebGLTransformFeedback.cpp: (WebCore::WebGLTransformFeedback::create): (WebCore::WebGLTransformFeedback::WebGLTransformFeedback): (WebCore::WebGLTransformFeedback::setProgram): (WebCore::WebGLTransformFeedback::setBoundIndexedTransformFeedbackBuffer): (WebCore::WebGLTransformFeedback::getBoundIndexedTransformFeedbackBuffer): (WebCore::WebGLTransformFeedback::hasEnoughBuffers const): (WebCore::WebGLTransformFeedback::usesBuffer): (WebCore::WebGLTransformFeedback::unbindBuffer): (WebCore::WebGLTransformFeedback::validateProgramForResume const): * html/canvas/WebGLTransformFeedback.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::vertexAttribDivisor): 2020-07-06 Myles C. Maxfield <mmaxfield@apple.com> Locale-specific quotes infrastructure needs to compare locale strings properly https://bugs.webkit.org/show_bug.cgi?id=213827 Reviewed by Darin Adler. Before this patch, WebKit is selecting which quotes to display on <q> elements by doing a raw strcmp() on the locale string with a big table of locale strings. strcmp() is the wrong way to compare locale strings. The HTML spec has a list of locales and their associated quotes[1]. It is formulated in terms of CSS using the "lang()" pseudoclass. The spec of the lang() pseudoclass[2] describes that locale comparison needs to be done according to section 3.3.2 in RFC4647[3]. This algorithm is a pretty general algorithm, and implementing it naively would mean turning our O(log(n)) algorithm into a O(n) algorithm, which would be unfortunate. Instead, we can use a few observations about the set of locale strings we are comparing against, in order to preserve the O(log(n)) runtime: - All the locales have either 1 or 2 subtags - None of the subtags in any of the ranges are wildcards - The list is sorted, so a locale string that is a prefix of another one is listed before it. [1] https://html.spec.whatwg.org/multipage/rendering.html#quotes [2] https://drafts.csswg.org/selectors-4/#the-lang-pseudo [3] https://tools.ietf.org/html/rfc4647#page-10 Test: fast/css-generated-content/quotes-lang-2.html * WebCore.xcodeproj/xcshareddata/xcschemes/WebCore.xcscheme: * rendering/RenderQuote.cpp: (WebCore::subtagCompare): (WebCore::quoteTableLanguageComparisonFunction): (WebCore::quotesForLanguage): (WebCore::RenderQuote::computeText const): 2020-07-06 Daniel Bates <dabates@apple.com> [iOS] WAKWindow should override -resignFirstResponder and clear state https://bugs.webkit.org/show_bug.cgi?id=214011 <rdar://problem/65152410> Reviewed by Tim Horton. This is part of the fix for <rdar://problem/62615273>. Override -resignFirstResponder to clear out internal state that tracks the first responder in the iOS Legacy WebKit world. * platform/ios/wak/WAKWindow.mm: (-[WAKWindow resignFirstResponder]): 2020-07-06 Sam Weinig <weinig@apple.com> REGRESSION: (r263977): [ iOS Debug WK2 ] 36 fast form and web-platform test consistently crashing https://bugs.webkit.org/show_bug.cgi?id=214009 <rdar://problem/65151752> * rendering/RenderTheme.cpp: (WebCore::RenderTheme::weekInputStyleSheet const): Replace ""_s with emptyString() to fix crashing tests. 2020-07-06 John Wilander <wilander@apple.com> Storage Access API: Add the capability to open a popup and get user interaction so we can call the Storage Access API as a quirk, on behalf of websites that should be doing it themselves https://bugs.webkit.org/show_bug.cgi?id=213910 <rdar://problem/65058017> Reviewed by Darin Adler. This patch not only adds the capability but also adds a site-specific quirk for the family of Kinja sites so that no previous user interaction with kinja.com results in a login popup for kinja.com. No new tests. This is for site-specific quirks. * dom/Element.cpp: (WebCore::Element::dispatchMouseEvent): Just a change in the call into the quirk function. * page/Quirks.cpp: (WebCore::Quirks::isKinjaLoginAvatarElement const): Convenience function for telling if the given element is the Kinja login avatar. (WebCore::Quirks::triggerOptionalStorageAccessQuirk const): Now takes the whole Element to be able to look at both classes and attributes. * page/Quirks.h: 2020-07-06 Peng Liu <peng.liu6@apple.com> Cleanup WebVideoFullscreenControllerAVKit.mm and PlaybackSessionInterfaceAVKit.mm https://bugs.webkit.org/show_bug.cgi?id=214005 Reviewed by Daniel Bates. No new tests, no behavior change. * platform/ios/PlaybackSessionInterfaceAVKit.mm: * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::setUpFullscreen): Remove a redundant line. 2020-07-06 Clark Wang <clark_wang@apple.com> Added PannerNode constructor according to spec https://bugs.webkit.org/show_bug.cgi?id=213801 Reviewed by Chris Dumez. Added in new PannerNode constructor to match spec: https://www.w3.org/TR/webaudio/#dom-pannernode-pannernode. Added in AudioNodeOptions and PannerOptions files. Modified some previous code in order to pass compilation. Re-baselined existing tests now that new ones are passing. New ones that fail are due to accepted range of values that attributes can take on, which are to be implemented in a future patch. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::AudioNode): * Modules/webaudio/AudioNode.h: * Modules/webaudio/AudioNodeOptions.h: Added. * Modules/webaudio/AudioNodeOptions.idl: Added. * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::PannerNode): (WebCore::PannerNodeBase::PannerNodeBase): (WebCore::PannerNode::create): * Modules/webaudio/PannerNode.h: * Modules/webaudio/PannerNode.idl: * Modules/webaudio/PannerOptions.h: Added. * Modules/webaudio/PannerOptions.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2020-07-06 Simon Fraser <simon.fraser@apple.com> ASSERT_NOT_REACHED() in EventRegionContext::popClip() https://bugs.webkit.org/show_bug.cgi?id=213905 Reviewed by Daniel Bates. Fix an assertion seen on bing.com, tesla.com etc where event region painting would have mismatched push/pop because of an obvious code error. I spent too long trying to make a testcase and gave up. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::restoreClip): 2020-07-06 Sam Weinig <weinig@apple.com> Compile-time enable (but leave disabled at runtime by default) date/time input types on macOS to allow testing of cross platform (e.g. DOM) aspects of the controls https://bugs.webkit.org/show_bug.cgi?id=213949 Reviewed by Darin Adler. Enable date/time related input element types on all Cocoa platforms, but disable them at runtime. To make runtime disabling work completely, the user agent style for these element types was extracted from html.css and is now only added when needed via UserAgentStyle::ensureDefaultStyleSheetsForElement. This is the first step to allowing us to run a subset of the date/time related input element tests on more platforms. If this is successful, we should consider do this for all platforms, not just Cocoa. * css/html.css: Move to RenderTheme accessors for conditional inclusion based on Settings. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::isDateTimeField const): Deleted. * html/HTMLInputElement.h: Removed dead isDateTimeField() code. This should have been removed when datetime was removed. * html/InputType.cpp: (WebCore::createInputTypeFactoryMap): (WebCore::InputType::create): Switch from using RuntimeEnabledFeatures to Settings for checking for enabling (Settings allows us to write less boilerplate code and is more versatile for testing) and switch to checking the condition on each InputType construction, rather than just on map's creation (again, this allows us to have more flexibility in testing). * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::inputTypeColorEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputTypeColorEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::inputTypeDateEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputTypeDateEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::inputTypeDateTimeLocalEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputTypeDateTimeLocalEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::inputTypeMonthEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputTypeMonthEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::inputTypeTimeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputTypeTimeEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::inputTypeWeekEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputTypeWeekEnabled): Deleted. Remove hand written code infavor of code genreated from Settings.yaml. * page/Settings.yaml: Moved from RuntimeEnabledFeatures. * platform/LocalizedStrings.h: Remove weekFormatInLDML() declaration, which had not implementation. * platform/text/PlatformLocale.cpp: (WebCore::Locale::formatDateTime): * platform/text/PlatformLocale.h: Simplify code by marking formatDateTime() virtual on all platforms and un-#ifdefing the base implementation. Platforms that wish to override it still can. * platform/text/cocoa/LocaleCocoa.h: * platform/text/cocoa/LocaleCocoa.mm: * platform/text/ios/LocalizedDateCache.h: * platform/text/ios/LocalizedDateCache.mm: Remove iOS specific #ifdefs around code that should work on all Cocoa platforms. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::colorInputStyleSheet const): (WebCore::RenderTheme::dateInputStyleSheet const): (WebCore::RenderTheme::dateTimeLocalInputStyleSheet const): (WebCore::RenderTheme::monthInputStyleSheet const): (WebCore::RenderTheme::timeInputStyleSheet const): (WebCore::RenderTheme::weekInputStyleSheet const): * rendering/RenderTheme.h: Add default user agent stylesheet strings for input types. All moved from html.css. * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement): * style/UserAgentStyle.h: Conditionally add the input type specific user agent stylesheets only if the actual input type is being passed in. Since creation of the input types is guarded by a Setting, this can only happen if the type has been enabled. 2020-07-06 Rob Buis <rbuis@igalia.com> Allow setting empty host/hostname on URLs if they use file scheme https://bugs.webkit.org/show_bug.cgi?id=213983 Reviewed by Alex Christensen. Allow setting empty host/hostname on URLs if they use file scheme [1, 2, 3]. Behavior matches Firefox. [1] https://url.spec.whatwg.org/#dom-url-host [2] https://url.spec.whatwg.org/#dom-url-hostname [3] https://url.spec.whatwg.org/#host-state Step 1 Test: imported/w3c/web-platform-tests/url/url-setters.html * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setHost): (WebCore::URLDecomposition::setHostname): 2020-07-06 Matt Gilligan <matthew_gilligan@apple.com> Update the user agent on iPadOS to use 11 to match macOS Safari https://bugs.webkit.org/show_bug.cgi?id=213753 Reviewed by Alex Christensen. Update the version number in the desktop user agent string to 11_0. * platform/ios/UserAgentIOS.mm: (WebCore::standardUserAgentWithApplicationName): 2020-07-06 Daniel Bates <dabates@apple.com> Use RenderObject::positionForPoint instead of hit testing the entire view in closestEditablePositionInElementForAbsolutePoint https://bugs.webkit.org/show_bug.cgi?id=213975 Reviewed by Wenson Hsieh. The target renderer is known a priori so it is more efficient to hit test this directly instead of indirectly by hit testing the entire view. * editing/Editing.cpp: (WebCore::closestEditablePositionInElementForAbsolutePoint): 2020-07-06 Carlos Garcia Campos <cgarcia@igalia.com> [GTK][WPE] Change the cookies accept policy when ITP is enabled https://bugs.webkit.org/show_bug.cgi?id=213502 Reviewed by Michael Catanzaro. Set the accept policy to always when ITP is enabled and no-third-party is set, otherwise cookies access granted by request storage access would still be rejected by libsoup if policy is set to no-third-party. * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::setResourceLoadStatisticsEnabled): Move here the implementation for ports not using soup. * platform/network/NetworkStorageSession.h: * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::NetworkStorageSession::NetworkStorageSession): Initialize cookie accept policy. (WebCore::NetworkStorageSession::setCookieStorage): Set here the accept policy of the new jar. (WebCore::NetworkStorageSession::setCookieAcceptPolicy): Set the cookie accept policy taking into account that if ITP is enabled and no-third-party is set we save the policy but use always instead. (WebCore::NetworkStorageSession::cookieAcceptPolicy const): Remove the default case of the switch. (WebCore::NetworkStorageSession::setResourceLoadStatisticsEnabled): When enabled, save current policy and set always if no-third-party is set. When disabled, restore the saved policy. 2020-07-06 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Don't skip samples past media duration in AppendPipeline https://bugs.webkit.org/show_bug.cgi?id=213888 Reviewed by Xabier Rodriguez-Calvar. appsinkNewSample() contained code to skip samples whose presentation time starts after media duration. This is paradoxical, because later sourceBufferPrivateDidReceiveSample() extends media duration whenever the presentation end time of the sample is past the original one. It does not sound reasonable that samples extending the duration are okay on one case but outright rejected in the other. Also, if it was about skipping samples, sourceBufferPrivateDidReceiveSample() could do it itself, and already does in other cases. For all these reasons I was very doubtful of the need for this if() and indeed removing this condition didn't cause any new test failure. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::appsinkNewSample): 2020-07-05 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r263960. https://bugs.webkit.org/show_bug.cgi?id=213980 Re-land, because r263959 somehow fixed the build issue caused by r263953 Reverted changeset: "Unreviewed, reverting r263953 and r263959." https://bugs.webkit.org/show_bug.cgi?id=213979 https://trac.webkit.org/changeset/263960 2020-07-05 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r263953 and r263959. https://bugs.webkit.org/show_bug.cgi?id=213979 Broke internal build Reverted changesets: "[Cocoa] Move almost all features from FeatureDefines.xcconfig to PlatformEnableCocoa.h" https://bugs.webkit.org/show_bug.cgi?id=212542 https://trac.webkit.org/changeset/263953 "[Cocoa] Remove FEATURE_DEFINES from the Cocoa/Xcode build system" https://bugs.webkit.org/show_bug.cgi?id=213976 https://trac.webkit.org/changeset/263959 2020-07-05 Darin Adler <darin@apple.com> [Cocoa] Remove FEATURE_DEFINES from the Cocoa/Xcode build system https://bugs.webkit.org/show_bug.cgi?id=213976 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: Removed everything except for ENABLE_WEB_RTC. * Configurations/WebCore.xcconfig: Removed FEATURE_DEFINES. * DerivedSources-input.xcfilelist: Removed FeatureDefines.xcconfig. * DerivedSources.make: Removed FEATURE_DEFINES, FEATURE_DEFINE_FLAGS, and the dependency on FeatureDefines.xcconfig. 2020-07-05 Sihui Liu <sihui_liu@appe.com> Text manipulation: add a new heuristic to decide paragraph boundary https://bugs.webkit.org/show_bug.cgi?id=213918 Reviewed by Wenson Hsieh. Modified test: TextManipulation.StartTextManipulationTreatsInlineBlockLinksAndButtonsAndSpansAsParagraphs. * editing/TextManipulationController.cpp: (WebCore::isEnclosingItemBoundaryElement): 2020-07-05 Darin Adler <darin@apple.com> [Cocoa] REGRESSION (r263914): Non-Apple-Pay Cocoa builds failing https://bugs.webkit.org/show_bug.cgi?id=213977 * Modules/applepay/cocoa/PaymentMethodCocoa.mm: Fixed messed up #endif and unnecessary #undef at end of file. 2020-07-05 Andy Estes <aestes@apple.com> [iOS] La Banque Postale app does not respect safe area insets on iOS 14 https://bugs.webkit.org/show_bug.cgi?id=213974 <rdar://problem/65109197> Reviewed by Darin Adler. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isLaBanquePostale): Added. 2020-07-05 Darin Adler <darin@apple.com> [Cocoa] Move almost all features from FeatureDefines.xcconfig to PlatformEnableCocoa.h https://bugs.webkit.org/show_bug.cgi?id=212542 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: Delete everything except ENABLE_EXPERIMENTAL_FEATURES and ENABLE_WEBRTC. 2020-07-05 Wenson Hsieh <wenson_hsieh@apple.com> [macOS 11] Indeterminate progress bar animation periodically jumps https://bugs.webkit.org/show_bug.cgi?id=213967 Reviewed by Sam Weinig. The animation for an indeterminate progress bar occasionally jumps to the starting frame on macOS 11. This is because the indeterinate progress bar animation only lasts for 120 frames on macOS 11, so our current hard-coded value of 256 frames results in 16 extra frames of animation, before abruptly looping back to the starting frame. To fix this, instead of specifying the animation frame index when painting progress bars on macOS, specify the starting time and current time for the animation, and let CoreUI determine which frame to use. * rendering/RenderProgress.cpp: (WebCore::RenderProgress::animationProgress): Assert that this never gets called with a zero animation duration. (WebCore::RenderProgress::updateAnimationState): Instead of checking for the animation duration to determine whether or not we should try and animate progress bar painting, check for the animation repeat interval instead. This is because on macOS, we no longer hard-code the animation duration, but still want to be able to animate progress bars. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::animationRepeatIntervalForProgressBar const): Deleted. (WebCore::RenderThemeIOS::animationDurationForProgressBar const): Deleted. Drive-by fix: remove some unnecessary overridden method implementations on RenderThemeIOS. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintProgressBar): (WebCore::RenderThemeMac::animationDurationForProgressBar const): Deleted. Stop overriding this method, and remove the `progressAnimationNumFrames` constant declared in this file. 2020-07-05 Said Abou-Hallawa <sabouhallawa@apple.com> [macOS] Allow selecting HEIF images if the 'accept' attribute includes an image MIME type that the platform can transcode the HEIF to https://bugs.webkit.org/show_bug.cgi?id=212489 Reviewed by Darin Adler. Add some utility functions to MIMETypeRegistry. These new functions will deal with a list of MIME types combined with a list of file extensions. They are going to be used the FileChooserSettings which reflects the 'accept' attribute of the <input> file element. * platform/MIMETypeRegistry.cpp: (WebCore::trimmedExtension): (WebCore::MIMETypeRegistry::preferredImageMIMETypeForEncoding): (WebCore::MIMETypeRegistry::containsImageMIMETypeForEncoding): (WebCore::MIMETypeRegistry::allowedMIMETypes): It returns the set of mime types which is stated by a list of mime types and a list of file extensions. (WebCore::MIMETypeRegistry::allowedFileExtensions): It returns the set of extensions which is stated by a list of mime types and a list of file extensions. * platform/MIMETypeRegistry.h: 2020-07-04 Darin Adler <darin@apple.com> [Cocoa] Remove all features from FeatureDefines.xcconfig that are already mentioned in PlatformEnableCocoa.h https://bugs.webkit.org/show_bug.cgi?id=213962 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: Removed all features that were mentioned in PlatformEnableCocoa.h; the rules in that file now define whether they are enabled. 2020-07-04 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Move PositiveAndNegativeVerticalMargin to UsedVerticalMargin https://bugs.webkit.org/show_bug.cgi?id=213963 Reviewed by Antti Koivisto. Now that UsedVerticalMargin is not used in Display::Box, we can merged these 2 layout structures. * layout/MarginTypes.h: (WebCore::Layout::UsedVerticalMargin::PositiveAndNegativePair::Values::isNonZero const): (WebCore::Layout::PositiveAndNegativeVerticalMargin::Values::isNonZero const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingState.h: (WebCore::Layout::BlockFormattingState::hasUsedVerticalMargin const): (WebCore::Layout::BlockFormattingState::setPositiveAndNegativeVerticalMargin): Deleted. (WebCore::Layout::BlockFormattingState::hasPositiveAndNegativeVerticalMargin const): Deleted. (WebCore::Layout::BlockFormattingState::positiveAndNegativeVerticalMargin const): Deleted. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedPositiveAndNegativeMargin const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginValue const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling): (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues): * layout/blockformatting/PrecomputedBlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeValues const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeMarginBefore const): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): 2020-07-04 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Remove redundant out-of-flow height-and-margin handling https://bugs.webkit.org/show_bug.cgi?id=213959 Reviewed by Antti Koivisto. We will never end up here with an out-of-flow box. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): 2020-07-04 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Store used vertical margin values in the formatting state https://bugs.webkit.org/show_bug.cgi?id=213958 Reviewed by Antti Koivisto. Layout related vertical margin values (collapsed vs. non-collapsed) should all go to the FormattingState, while Display::Box should only have the final values. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const): * layout/MarginTypes.h: (WebCore::Layout::marginBefore): (WebCore::Layout::marginAfter): (WebCore::Layout::UsedVerticalMargin::before const): Deleted. (WebCore::Layout::UsedVerticalMargin::after const): Deleted. (WebCore::Layout::UsedVerticalMargin::isCollapsedThrough const): Deleted. (WebCore::Layout::UsedVerticalMargin::nonCollapsedValues const): Deleted. (WebCore::Layout::UsedVerticalMargin::collapsedValues const): Deleted. (WebCore::Layout::UsedVerticalMargin::hasCollapsedValues const): Deleted. (WebCore::Layout::UsedVerticalMargin::setCollapsedValues): Deleted. (WebCore::Layout::UsedVerticalMargin::UsedVerticalMargin): Deleted. * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockFormattingState.h: (WebCore::Layout::BlockFormattingState::setUsedVerticalMargin): (WebCore::Layout::BlockFormattingState::usedVerticalMargin const): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): (WebCore::Display::Box::nonCollapsedMarginBox const): Deleted. * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::rectWithMargin const): (WebCore::Display::Box::setHasValidVerticalMargin): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::marginBefore const): (WebCore::Display::Box::marginAfter const): (WebCore::Display::Box::VerticalMargin::before const): Deleted. (WebCore::Display::Box::VerticalMargin::after const): Deleted. (WebCore::Display::Box::VerticalMargin::isCollapsedThrough const): Deleted. (WebCore::Display::Box::VerticalMargin::nonCollapsedValues const): Deleted. (WebCore::Display::Box::VerticalMargin::collapsedValues const): Deleted. (WebCore::Display::Box::VerticalMargin::hasCollapsedValues const): Deleted. (WebCore::Display::Box::VerticalMargin::setCollapsedValues): Deleted. (WebCore::Display::Box::hasCollapsedThroughMargin const): Deleted. (WebCore::Display::Box::setHasValidVerticalNonCollapsedMargin): Deleted. (WebCore::Display::Box::VerticalMargin::VerticalMargin): Deleted. (WebCore::Display::Box::VerticalMargin::NonCollapsedValues::NonCollapsedValues): Deleted. (WebCore::Display::Box::VerticalMargin::CollapsedValues::CollapsedValues): Deleted. (WebCore::Display::Box::nonCollapsedMarginBefore const): Deleted. (WebCore::Display::Box::nonCollapsedMarginAfter const): Deleted. * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): (WebCore::Layout::TableFormattingContext::layoutCell): 2020-07-04 Darin Adler <darin@apple.com> [Cocoa] Remove unconditional features from FeatureDefines.xcconfig, making sure they are covered in PlatformEnableCocoa.h https://bugs.webkit.org/show_bug.cgi?id=212418 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: Removed features that are either unconditionally not enabled, or unconditionally enabled. Double checked that all the enabled ones are either in PlatformEnable.h or PlatformEnableCocoa.h. 2020-07-04 Sam Weinig <weinig@apple.com> Part 1 of SimpleColor and SRGBA<uint8_t> are essentially the same - let's converge them https://bugs.webkit.org/show_bug.cgi?id=213948 Reviewed by Darin Adler. Begin converging SimpleColor and SRGBA<uint8_t>, starting with removing usages that were getting SimpleColors to access or operate on the color's components. - Replace toSRGBASimpleColorLossy() with toSRGBALossy<uint8_t> - Replace toSRGBALossy() with toSRGBALossy<float>(). - Remove direct color component accessors from SimpleColor. - Add new ARGB type to support explicit conversion from packed ARGB bits to a color type. - Update premulitplication functions to operate on SRGBA<uint8_t> and rename them to match existing function operating on SRGBA<float>. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Removes SimpleColor.cpp * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::colorValue const): Replace toSRGBASimpleColorLossy() with toSRGBALossy<uint8_t>. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (getAttributeSetForAccessibilityObject): Replace toSRGBASimpleColorLossy() with toSRGBALossy<uint8_t>. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::colorValue const): Replace toSRGBASimpleColorLossy() with toSRGBALossy<uint8_t>. * css/DeprecatedCSSOMRGBColor.h: Replace toSRGBASimpleColorLossy() with toSRGBALossy<uint8_t>. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): Replace toSRGBALossy() with toSRGBALossy<float>(). * platform/graphics/Color.cpp: (WebCore::Color::lightened const): (WebCore::Color::darkened const): (WebCore::Color::lightness const): (WebCore::Color::luminance const): (WebCore::Color::semanticColor const): (WebCore::Color::toSRGBASimpleColorLossy const): Deleted. (WebCore::Color::toSRGBALossy const): Deleted. * platform/graphics/Color.h: Remove toSRGBASimpleColorLossy() and templatize toSRGBALossy() to support both lossy conversion to byte based components as well. * platform/graphics/ColorBlending.cpp: (WebCore::blendSourceOver): (WebCore::blendWithWhite): Replace toSRGBASimpleColorLossy() with toSRGBALossy<uint8_t>. (WebCore::blend): (WebCore::blendWithoutPremultiply): Replace toSRGBASimpleColorLossy() with toSRGBALossy<uint8_t>. Adopt new premultipliedCeiling and unpremultiplied functions that operate on SRGBA<uint8_t> (rather than SimpleColor) and clamping conversion to SRGBA<uint8_t> via convertToComponentBytes<SRGBA>. premultipliedCeiling now works correctly for 0 alpha, so no workaround is needed anymore. * platform/graphics/ColorTypes.h: (WebCore::asARGB): (WebCore::asSRGBA): Add new type of color struct representing a format packing. The initial one is ARGB to support the few places using SimpleColor to manipulate ARGB pixel data. * platform/graphics/ColorUtilities.cpp: (WebCore::unpremultiplied): (WebCore::premultipliedFlooring): (WebCore::premultipliedCeiling): (WebCore::unpremultipliedComponentByte): * platform/graphics/ColorUtilities.h: (WebCore::convertToComponentBytes): (WebCore::convertToComponentFloats): Move remaining premultiplication functions here (from SimpleColor.h/cpp) and reimplement to operate on SRGBA<uint8_t>. Also slightly rename, premultiply -> premultiplied, to match existing premultiplied functions. While moving them, also fix the premultiplied functions to better support 0 alpha to avoid workarounds in callers. Additional, this adds convertToComponentBytes/convertToComponentFloats helper functions which convert to/from uint8_t/float based color types, and support creating color types from values potentially outside of their supported value range. Right now, that value range is always considerer to be 0-255 for uint8_t and 0-1 for float, but that can be chnaged in the future by allowing color type structs to indicate their supported ranges. * platform/graphics/ExtendedColor.cpp: (WebCore::ExtendedColor::toSRGBAFloatComponentsLossy const): (WebCore::ExtendedColor::toSRGBALossy const): Deleted. * platform/graphics/ExtendedColor.h: (WebCore::ExtendedColor::toSRGBALossy const): Rename existing toSRGBALossy() to toSRGBAFloatComponentsLossy() and replace templatize toSRGBALossy(), with the uint8_t case just down converting via new convertToComponentBytes. * platform/graphics/ImageBackingStore.h: (WebCore::ImageBackingStore::fillRect): (WebCore::ImageBackingStore::setPixel): (WebCore::ImageBackingStore::blendPixel): (WebCore::ImageBackingStore::pixelValue const): Replace usage of SimpleColor with new ARGB type for conversion from ARGB to SRGBA<uint8_t>. Update to use new premulitplication functions. Also, update the interface to take pixel components as uint8_t, rather than unsigned, as that is what the callers are passing anyway, and it avoids us having to clamp/cast manually all over the case. * platform/graphics/SimpleColor.cpp: Removed. * platform/graphics/SimpleColor.h: (WebCore::SimpleColor::alphaComponent const): (WebCore::SimpleColor::asSRGBA const): (WebCore::SimpleColor::redComponent const): (WebCore::SimpleColor::greenComponent const): (WebCore::SimpleColor::blueComponent const): (WebCore::operator==): (WebCore::makeSimpleColor): Simplify interface, making red, green and blue component accessors private and having callers all use SRGBA directly. Remove premultiplication functions in favor of new ones in ColorUtilities. * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: (WebCore::PlatformCAAnimationCocoa::setFromValue): (WebCore::PlatformCAAnimationCocoa::setToValue): (WebCore::PlatformCAAnimationCocoa::setValues): Replace toSRGBASimpleColorLossy() with toSRGBALossy<uint8_t>. * platform/graphics/ca/win/PlatformCAAnimationWin.cpp: (PlatformCAAnimationWin::setFromValue): (PlatformCAAnimationWin::setToValue): (PlatformCAAnimationWin::setValues): Replace toSRGBASimpleColorLossy() with toSRGBALossy<uint8_t>. * platform/graphics/cairo/CairoUtilities.cpp: (WebCore::setSourceRGBAFromColor): Replace toSRGBALossy() with toSRGBALossy<float>(). * platform/graphics/cairo/GradientCairo.cpp: (WebCore::addColorStopRGBA): (WebCore::setCornerColorRGBA): (WebCore::interpolateColorStop): Replace toSRGBALossy() with toSRGBALossy<float>(). * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp: (WebCore::ImageBufferCairoImageSurfaceBackend::platformTransformColorSpace): Replace usage of SimpleColor with new ARGB type for conversion from ARGB to SRGBA<uint8_t>. Update to use new premulitplication functions. * platform/graphics/cairo/NativeImageCairo.cpp: (WebCore::nativeImageSinglePixelSolidColor): Replace usage of SimpleColor with new ARGB type for conversion from ARGB to SRGBA<uint8_t>. Update to use new premulitplication functions. * platform/graphics/cpu/arm/filters/FELightingNEON.h: (WebCore::FELighting::platformApplyNeon): Replace toSRGBASimpleColorLossy() with toSRGBALossy<uint8_t>. * platform/graphics/filters/FELighting.cpp: (WebCore::FELighting::drawLighting): Replace toSRGBALossy() with toSRGBALossy<float>(). * platform/graphics/filters/FilterOperations.cpp: (WebCore::FilterOperations::transformColor const): (WebCore::FilterOperations::inverseTransformColor const): Replace toSRGBALossy() with toSRGBALossy<float>(). * platform/graphics/gtk/ColorGtk.cpp: (WebCore::Color::operator GdkRGBA const): Replace toSRGBALossy() with toSRGBALossy<float>(). * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::drawBorder): (WebCore::TextureMapperGL::drawNumber): (WebCore::prepareFilterProgram): (WebCore::TextureMapperGL::drawSolidColor): (WebCore::TextureMapperGL::clearColor): Replace toSRGBALossy() with toSRGBALossy<float>(). * platform/graphics/win/ColorDirect2D.cpp: (WebCore::Color::operator D2D1_COLOR_F const): (WebCore::Color::operator D2D1_VECTOR_4F const): Replace toSRGBALossy() with toSRGBALossy<float>(). * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::generateGradient): Replace toSRGBALossy() with toSRGBALossy<float>(). * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::drawDotsForDocumentMarker): Replace direct usage component access from SimpleColor with usage of accessed SRGBA<uint8_t>. * platform/graphics/win/GraphicsContextDirect2D.cpp: (WebCore::GraphicsContext::colorWithGlobalAlpha const): Replace toSRGBALossy() with toSRGBALossy<float>(). * rendering/RenderTheme.cpp: (WebCore::RenderTheme::disabledTextColor const): Replace toSRGBALossy() with toSRGBALossy<float>(). * rendering/RenderThemeIOS.mm: (WebCore::shouldUseConvexGradient): Replace toSRGBALossy() with toSRGBALossy<float>(). * rendering/TextPaintStyle.cpp: (WebCore::textColorIsLegibleAgainstBackgroundColor): Replace toSRGBALossy() with toSRGBALossy<float>(). * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: (WebCore::SVGAnimationColorFunction::animate): Replace toSRGBASimpleColorLossy() with toSRGBALossy<uint8_t>. 2020-07-04 Zalan Bujtas <zalan@apple.com> [LFC] Remove redundant Display::Box::HorizontalMargin c'tors https://bugs.webkit.org/show_bug.cgi?id=213957 Reviewed by Antti Koivisto. Let's just have a very simple Display::Box:HorizontalMargin struct. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::HorizontalMargin::HorizontalMargin): Deleted. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin): 2020-07-04 Zalan Bujtas <zalan@apple.com> [LFC] Do not cache computed horizontal margin values https://bugs.webkit.org/show_bug.cgi?id=213956 Reviewed by Antti Koivisto. Outside of the width + margin computation, computed horizontal margin values are only required by float positioning. Let's just re-computed them on demand (which is basically just a style.marginStart/end resolve). * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layout): * layout/LayoutUnits.h: * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats): (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setHasValidVerticalNonCollapsedMargin): (WebCore::Display::Box::setHasValidHorizontalComputedMargin): Deleted. (WebCore::Display::Box::ComputedHorizontalMargin::ComputedHorizontalMargin): Deleted. (WebCore::Display::Box::setHorizontalComputedMargin): Deleted. (WebCore::Display::Box::computedMarginStart const): Deleted. (WebCore::Display::Box::computedMarginEnd const): Deleted. * layout/floats/FloatingContext.cpp: (WebCore::Layout::computedHorizontalMargin): (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): * layout/floats/FloatingContext.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin): (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): (WebCore::Layout::TableFormattingContext::layoutCell): 2020-07-04 Darin Adler <darin@apple.com> Make generate-unified-sources.sh not depend on features being listed in FEATURE_DEFINES environment variable https://bugs.webkit.org/show_bug.cgi?id=212420 Reviewed by Don Olmstead. * Scripts/generate-unified-sources.sh: Added code to include sources from SourcesCocoaInternalSDK.txt, only if USE_INTERNAL_SDK is YES. Removed --feature-flags argument from invocation of generate-unified-source-bundles.rb. Removed many unnecessary quotes. * SourcesCocoa.txt: Removed the names of the files from the internal SDK. * SourcesCocoaInternalSDK.txt: Added. Moved those names here. * html/MediaElementSession.cpp: Added some includes, apparently needed because of different groupings of unified sources. 2020-07-04 Zalan Bujtas <zalan@apple.com> [LFC] Used dedicated paint margin structures https://bugs.webkit.org/show_bug.cgi?id=213955 Reviewed by Antti Koivisto. This is in preparation for having only final margin values in Display::Box. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::VerticalMargin::before const): (WebCore::Display::Box::VerticalMargin::after const): (WebCore::Display::Box::VerticalMargin::isCollapsedThrough const): (WebCore::Display::Box::VerticalMargin::nonCollapsedValues const): (WebCore::Display::Box::VerticalMargin::collapsedValues const): (WebCore::Display::Box::VerticalMargin::hasCollapsedValues const): (WebCore::Display::Box::VerticalMargin::setCollapsedValues): (WebCore::Display::Box::VerticalMargin::VerticalMargin): (WebCore::Display::Box::VerticalMargin::NonCollapsedValues::NonCollapsedValues): (WebCore::Display::Box::VerticalMargin::CollapsedValues::CollapsedValues): (WebCore::Display::Box::ComputedHorizontalMargin::ComputedHorizontalMargin): (WebCore::Display::Box::HorizontalMargin::HorizontalMargin): (WebCore::Display::Box::setHorizontalMargin): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::setHorizontalComputedMargin): (WebCore::Display::Box::verticalMargin const): (WebCore::Display::Box::horizontalMargin const): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::horizontalMargin const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin): (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin): 2020-07-04 Darin Adler <darin@apple.com> Update comment in FeatureDefines.xcconfig since PlatformEnableCocoa.h should be used instead https://bugs.webkit.org/show_bug.cgi?id=213952 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: Updated comment. 2020-07-04 Youenn Fablet <youenn@apple.com> Enable VTB required low latency code path https://bugs.webkit.org/show_bug.cgi?id=210609 <rdar://problem/61890332> Reviewed by Darin Adler. Add new runtime flag for the low latency code path. Call webrtc newly introduced setter whenever creating a new encoder factory. Manually tested. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCH264LowLatencyEncoderEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCH264LowLatencyEncoderEnabled): * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): 2020-07-03 Youenn Fablet <youenn@apple.com> MediaRecorder should support peer connection remote video tracks https://bugs.webkit.org/show_bug.cgi?id=213924 Reviewed by Darin Adler. Previsouly we were checking whether width and height are given for a video track. This is not always available, for instance for remote tracks. And this can change over time. Instead, pass a simple boolean (whether there is a video track or not). Minor simplifications to stop storing unneeded members. Tests: imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-bitrate.https.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-creation.https.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-detached-context.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-disabled-tracks.https.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-events-and-exceptions.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-mimetype.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-no-sink.https.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-pause-resume.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-peerconnection.https.html imported/w3c/web-platform-tests/mediacapture-record/passthrough/MediaRecorder-passthrough.https.html * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::create): 2020-07-03 Darin Adler <darin@apple.com> WebCore/Sources.txt: Remove all remaining #if (ENABLE_WEBGL and ENABLE_WEBXR) https://bugs.webkit.org/show_bug.cgi?id=213946 Reviewed by Sam Weinig. * CMakeLists.txt: Move IDL-related ENABLE_WEBGL and ENABLE_WEBXR items out of if blocks. Longer term, I think our direction should be to remove most feature conditionals from CMakeLists.txt too, just like I am doing for Sources.txt. But for now, doing just enough of this to keep the build working. Someone can tidy this later as desired. * Sources.txt: Remove all remaining #if, and sort files, getting rid of paragraphing per directory to just turn this into three sorted lists of filenames (separate ones for derived sources and generated bindings at the end). The source files themselves have the appropriate conditionals and soon we will not need to support #if in Sources.txt files. 2020-07-03 Fujii Hironori <Hironori.Fujii@sony.com> [Win] Unreviewed stack-overflow crash fix for r263890 https://bugs.webkit.org/show_bug.cgi?id=213912 <rdar://problem/65069686> Renamed mimeTypeForExtension to mimeTypeForExtensionFromRegistry. * platform/win/MIMETypeRegistryWin.cpp: (WebCore::mimeTypeForExtensionFromRegistry): (WebCore::MIMETypeRegistry::mimeTypeForExtension): (WebCore::mimeTypeForExtension): Deleted. 2020-07-03 Fujii Hironori <Hironori.Fujii@sony.com> [Win] Unreviewed build fix for r263913 https://bugs.webkit.org/show_bug.cgi?id=213939 <rdar://problem/65084185> * CMakeLists.txt: Process encrypted media IDL files even if ENABLE_ENCRYPTED_MEDIA is off. 2020-07-03 Darin Adler <darin@apple.com> WebCore/Sources.txt: Remove #if ENABLE_WIRELESS_PLAYBACK_TARGET https://bugs.webkit.org/show_bug.cgi?id=213945 Reviewed by Sam Weinig. * CMakeLists.txt: Moved items from the pictureinpicture and remoteplayback module here from PlatformMac.cmake. Even if these are currently only implemented on Mac, they are not intrinsically Mac-specific, so they belong here. * PlatformMac.cmake: Ditto. * Sources.txt: Remove #if ENABLE_WIRELESS_PLAYBACK_TARGET and sort files in with the others. The source files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Sam Weinig <weinig@apple.com> Remove support for ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE https://bugs.webkit.org/show_bug.cgi?id=213932 Reviewed by Darin Adler. Removes support for non-standard <input type="datetime">, currently being guarded by the macro ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE. This macro, was added back in 2013 as a temporary measure to support some engines who shipped support for <input type="datetime">. It is currently not enabled for any ports so now seems like as good a time as any to remove it. * Configurations/FeatureDefines.xcconfig: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/html.css: (#endif): * html/DateTimeInputType.cpp: Removed. * html/DateTimeInputType.h: Removed. * html/InputType.cpp: (WebCore::createInputTypeFactoryMap): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::inputTypeDateTimeEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setInputTypeDateTimeEnabled): Deleted. * platform/DateComponents.cpp: (WebCore::DateComponents::setMillisecondsSinceEpochForDateTimeLocal): (WebCore::DateComponents::millisecondsSinceEpoch const): (WebCore::DateComponents::toString const): (WebCore::DateComponents::fromParsingDateTime): Deleted. (WebCore::DateComponents::parseDateTime): Deleted. (WebCore::DateComponents::fromMillisecondsSinceEpochForDateTime): Deleted. (WebCore::DateComponents::setMillisecondsSinceEpochForDateTime): Deleted. * platform/DateComponents.h: * platform/text/PlatformLocale.cpp: (WebCore::Locale::formatDateTime): * platform/text/ios/LocalizedDateCache.mm: (WebCore::LocalizedDateCache::createFormatterForType): 2020-07-03 Darin Adler <darin@apple.com> WebCore/Sources.txt: Remove #if ENABLE_USER_MESSAGE_HANDLERS https://bugs.webkit.org/show_bug.cgi?id=213944 Reviewed by Sam Weinig. * CMakeLists.txt: Move IDL-related ENABLE_USER_MESSAGE_HANDLERS items out of if blocks. Longer term, I think our direction should be to remove most feature conditionals from CMakeLists.txt too, just like I am doing for Sources.txt. But for now, doing just enough of this to keep the build working. Someone can tidy this later as desired. * Sources.txt: Remove #if ENABLE_USER_MESSAGE_HANDLERS and sort files in with the others. The source files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Darin Adler <darin@apple.com> WebCore/SourcesCocoa.txt: Remove #if ENABLE_APPLE_PAY https://bugs.webkit.org/show_bug.cgi?id=213943 Reviewed by Sam Weinig. * SourcesCocoa.txt: Remove #if ENABLE_APPLE_PAY and sort files in with the others. The source files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. Also, sort the files and remove the separate per-directory paragraphs, making this closer to just a sorted list of filenames with less "editorial" content. Also added comments about the USE_INTERNAL_SDK part of the file. 2020-07-03 Darin Adler <darin@apple.com> WebCore/Sources.txt: Remove #if ENABLE_ENCRYPTED_MEDIA https://bugs.webkit.org/show_bug.cgi?id=213939 Reviewed by Sam Weinig. * CMakeLists.txt: Move IDL-related ENABLE_ENCRYPTED_MEDIA items out of if blocks. Longer term, I think our direction should be to remove most feature conditionals from CMakeLists.txt too, just like I am doing for Sources.txt. But for now, doing just enough of this to keep the build working. Someone can tidy this later as desired. * Sources.txt: Remove #if ENABLE_LEGACY_ENCRYPTED_MEDIA and sort files in with the others. The IDL files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Darin Adler <darin@apple.com> WebCore/Sources.txt: Remove #if ENABLE_LEGACY_ENCRYPTED_MEDIA https://bugs.webkit.org/show_bug.cgi?id=213937 Reviewed by Sam Weinig. * CMakeLists.txt: Move IDL-related ENABLE_LEGACY_ENCRYPTED_MEDIA items out of if blocks. Longer term, I think our direction should be to remove most feature conditionals from CMakeLists.txt too, just like I am doing for Sources.txt. But for now, doing just enough of this to keep the build working. Someone can tidy this later as desired. * Sources.txt: Remove #if ENABLE_LEGACY_ENCRYPTED_MEDIA and sort files in with the others. The IDL files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Darin Adler <darin@apple.com> WebCore/Sources.txt: Remove #if ENABLE_QUOTA https://bugs.webkit.org/show_bug.cgi?id=213941 Reviewed by Sam Weinig. * CMakeLists.txt: Move IDL-related ENABLE_QUOTA items out of "if (ENABLE_QUOTA)". Longer term, I think our direction should be to remove most feature conditionals from CMakeLists.txt too, just like I am doing for Sources.txt. But for now, doing just enough of this to keep the build working. Someone can tidy this later as desired. * Sources.txt: Remove #if ENABLE_QUOTA and sort files in with the others. The source files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Darin Adler <darin@apple.com> WebCore/Sources.txt: Remove #if ENABLE_GAMEPAD https://bugs.webkit.org/show_bug.cgi?id=213936 Reviewed by Sam Weinig. * CMakeLists.txt: Move IDL-related ENABLE_GAMEPAD items out of "if (ENABLE_GAMEPAD)". Longer term, I think our direction should be to remove most feature conditionals from CMakeLists.txt too, just like I am doing for Sources.txt. But for now, doing just enough of this to keep the build working. Someone can tidy this later as desired. * Sources.txt: Remove #if ENABLE_GAMEPAD and sort files in with the others. The IDL files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Darin Adler <darin@apple.com> WebCore/Sources.txt: Remove #if ENABLE_MEDIA_SOURCE https://bugs.webkit.org/show_bug.cgi?id=213940 Reviewed by Sam Weinig. * Sources.txt: Remove #if ENABLE_MEDIA_SOURCE and sort files in with the others. The IDL files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Lauro Moura <lmoura@igalia.com> [WPE] Fix build with clang after r263898 https://bugs.webkit.org/show_bug.cgi?id=213942 Unreviewed build fix. * loader/appcache/ApplicationCacheManifestParser.cpp: 2020-07-03 Darin Adler <darin@apple.com> WebCore/Sources.txt: Remove #if ENABLE_APPLICATION_MANIFEST https://bugs.webkit.org/show_bug.cgi?id=213935 Reviewed by Sam Weinig. * Sources.txt: Remove #if ENABLE_APPLICATION_MANIFEST and sort files in with the others. The source files themselves have conditionals, we don't need conditionals in Sources.txt, and we are moving towards removing the capability for #if ENABLE in the Sources.txt file. 2020-07-03 Sam Weinig <weinig@apple.com> Add "-Wliteral-conversion" warning to Xcode based builds and fix the issues it finds https://bugs.webkit.org/show_bug.cgi?id=213931 Reviewed by Darin Adler. * Configurations/Base.xcconfig: Add -Wliteral-conversion. * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::draw): Fix error due to passing a double when a uint8_t was expected. This probably means that the debug borders looked wrong for a little bit, but should now be back to their transparent splendor. 2020-07-03 Zalan Bujtas <zalan@apple.com> [LFC][TFC][Quirk] Inflow child box quirk vertical margins should collapse with table cell. https://bugs.webkit.org/show_bug.cgi?id=213926 Reviewed by Antti Koivisto. The BFC rootd (table cell box in this case) nornally do not collapse their margins with the first/last inflow child. However in quirks mode, cell boxes collapse their (non-existing)margins with inflow quirk margins. <table><tr><td><p>text content</td></tr></table> <- <p> box's top position is at 0px in quirks mode, while at 16px (1em) in strict mode. This patch ensures that we collapse the quirk margins and take them into account when computing the cell's content height. Test: fast/layoutformattingcontext/table-quirk-vertical-margin-simple.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::shouldCollapseMarginBeforeWithParentMarginBefore const): (WebCore::Layout::BlockFormattingContext::Quirks::shouldCollapseMarginAfterWithParentMarginAfter const): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter const): (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues): * layout/tableformatting/TableFormattingContext.h: (WebCore::Layout::TableFormattingContext::Quirks::Quirks): * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const): * layout/tableformatting/TableFormattingContextQuirks.cpp: Added. (WebCore::Layout::TableFormattingContext::Quirks::shouldIgnoreChildContentVerticalMargin const): 2020-07-03 Sam Weinig <weinig@apple.com> Split color conversion functions out of ColorUtilities.h/cpp into their own file. https://bugs.webkit.org/show_bug.cgi?id=213803 Reviewed by Simon Fraser. Moves color conversion functions (both between color spaces like toDisplayP3(const SRGBA&) and between different representations like toHSLA(const SRGBA&)) to their own files. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add new files. * css/parser/CSSPropertyParserHelpers.cpp: * editing/cocoa/DataDetection.mm: * html/canvas/CanvasRenderingContext2DBase.cpp: * html/canvas/CanvasStyle.cpp: Add include of ColorConversion.h * platform/graphics/ColorConversion.cpp: Added. * platform/graphics/ColorConversion.h: Added. * platform/graphics/ColorUtilities.cpp: * platform/graphics/ColorUtilities.h: Move functions to the new files. * platform/graphics/ExtendedColor.cpp: * platform/graphics/cairo/ImageBufferCairoBackend.cpp: * platform/graphics/filters/FELighting.cpp: Add include of ColorConversion.h, remove unncessary include of ColorUtilities.h * platform/graphics/cairo/ImageBufferCairoSurfaceBackend.cpp: * platform/graphics/filters/FEDisplacementMap.cpp: * platform/graphics/filters/FEMorphology.cpp: * platform/graphics/filters/FilterOperations.cpp: Remove unncessary include of ColorUtilities.h * platform/graphics/filters/FilterOperation.cpp: Add include of ColorConversion.h and ColorTypes.h, remove unncessary include of ColorUtilities.h. * platform/graphics/gtk/ColorGtk.cpp: * platform/graphics/win/ColorDirect2D.cpp: Remove unncessary include of ColorUtilities.h. Update to use standard float -> SimpleColor idiom using SRGBA<float>. 2020-07-03 Sam Weinig <weinig@apple.com> Convert DateComponents parsing code to use Optional based return values rather than out-parameters https://bugs.webkit.org/show_bug.cgi?id=213440 Reviewed by Darin Adler. Rework DateComponents and Date/Time related InputTypes to use Optional based programming for parsing results. Also take the opportunity to remove unicode upconversion from DateComponent parsing and instead separate UChar and LChar variants via templates. * html/BaseDateAndTimeInputType.cpp: * html/BaseDateAndTimeInputType.h: * html/DateInputType.cpp: * html/DateInputType.h: * html/DateTimeInputType.cpp: * html/DateTimeInputType.h: * html/DateTimeLocalInputType.cpp: * html/DateTimeLocalInputType.h: * html/HTMLInputElement.cpp: * html/HTMLInputElement.h: * html/InputType.cpp: * html/InputType.h: * html/MonthInputType.cpp: * html/MonthInputType.h: * html/TimeInputType.cpp: * html/TimeInputType.h: * html/WeekInputType.cpp: * html/WeekInputType.h: - Removes parseToDateComponentsInternal. No need it and parseToDateComponents. - Makes parseToDateComponents pure virtual. The old code had a default implementations down in InputType, but it had no callers. - Remove iOS vs. non-iOS difference for dateType(). It is now available on InputType on all platforms. - Make setMillisecondToDateComponents and parseToDateComponents return an Optional. * platform/DateComponents.cpp: * platform/DateComponents.h: - Replace member function based interfaces for parsing/setting explicit time offsets with new factory functions that return Optional<DateComponents>. - These factories are implemented using the existing member functions, which are now private. - Make max/min constants constexpr. - Make parse* member functions templates to allow factory parse functions to call them without upconverting. - Replace header guard with #pragma once. 2020-07-03 Sam Weinig <weinig@apple.com> Cleanup ApplicationCacheManifestParser.h/cpp https://bugs.webkit.org/show_bug.cgi?id=213844 Reviewed by Alex Christensen. Address some post review comments. * loader/appcache/ApplicationCacheManifestParser.cpp: (WebCore::parseApplicationCacheManifest): Fix typos: manfest -> manifest. * loader/appcache/ApplicationCacheManifestParser.h: Stop including ApplicationCache.h, and only include / declare what's needed. 2020-07-03 Youenn Fablet <youenn@apple.com> Support MediaRecorder.onstart https://bugs.webkit.org/show_bug.cgi?id=213720 Reviewed by Darin Adler. Fire start event if MediaRecorder.start is successful. Do some WebIDL clean-up, in particular change timeSlice from long to unsigned long, as per spec. Covered by added test. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::startRecording): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: 2020-07-03 Youenn Fablet <youenn@apple.com> MediaRecorder.start() Method is Ignoring the "timeslice" Parameter https://bugs.webkit.org/show_bug.cgi?id=202233 <rdar://problem/55720555> Reviewed by Eric Carlson. Use a timer to implement timeSlice parameter. Schedule timer either when start is called or as part of requestData callback. This should ensure that, if requestData is called by the application, the timer will be rescheduled appropriately. Test: http/wpt/mediarecorder/MediaRecorder-start-timeSlice.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): (WebCore::MediaRecorder::requestData): * Modules/mediarecorder/MediaRecorder.h: 2020-07-03 Youenn Fablet <youenn@apple.com> MediaRecorder stopRecorder() returns empty Blob after first use https://bugs.webkit.org/show_bug.cgi?id=212274 <rdar://problem/63601298> Reviewed by Eric Carlson. Refactor code to create/destroy MediaRecorderPrivate on MediaRecorder start/stop. This allows reusing a MediaRecorder after a stop and restarting with a clean state. We introduce MediaRecorderPrivate::startRecording to do the initialization, which allows to fix a potential ref cycle as part of the error callback handling. Make some improvements to the platform implementation, in particular add default initialization to all fields. Align the code using AudioConverterRef to what is done in AudioSampleDataSource. Also call VTCompressionSessionInvalidate when destroying the VideoSampleBufferCompressor. Test: http/wpt/mediarecorder/MediaRecorder-multiple-start-stop.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::requestData): * Modules/mediarecorder/MediaRecorder.h: * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::fetchData): * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::startRecording): * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded): (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount): (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets): (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::stopRecording): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor): 2020-07-03 Said Abou-Hallawa <sabouhallawa@apple.com> Change the names of MIMETypeRegistry methods to comply with webkit naming style https://bugs.webkit.org/show_bug.cgi?id=213912 Reviewed by Youenn Fablet. Remove the verb 'get' from the name of some of the methods of MIMETypeRegistry. * editing/cocoa/WebArchiveResourceFromNSAttributedString.mm: (WebCore::if): * fileapi/File.cpp: (WebCore::File::computeNameAndContentType): * html/HTMLPlugInElement.cpp: (WebCore::pluginReplacementForType): * loader/mac/LoaderNSURLExtras.mm: (suggestedFilenameWithMIMEType): * platform/MIMETypeRegistry.cpp: (WebCore::commonMimeTypesMap): (WebCore::MIMETypeRegistry::mediaMIMETypeForExtension): (WebCore::MIMETypeRegistry::mimeTypeForPath): (WebCore::MIMETypeRegistry::isSupportedImageMIMEType): (WebCore::MIMETypeRegistry::normalizedMIMEType): (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary): (WebCore::MIMETypeRegistry::getMediaMIMETypeForExtension): Deleted. (WebCore::MIMETypeRegistry::getMediaMIMETypesForExtension): Deleted. Delete this function since it is not used. (WebCore::MIMETypeRegistry::getMIMETypeForPath): Deleted. (WebCore::MIMETypeRegistry::getNormalizedMIMEType): Deleted. * platform/MIMETypeRegistry.h: * platform/cocoa/MIMETypeRegistryCocoa.mm: (WebCore::MIMETypeRegistry::mimeTypeForExtension): (WebCore::MIMETypeRegistry::extensionsForMIMEType): (WebCore::MIMETypeRegistry::preferredExtensionForMIMEType): (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Deleted. (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Deleted. (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Deleted. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::load): * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::ImageDecoderAVFObjC::filenameExtension const): * platform/graphics/gstreamer/ImageDecoderGStreamer.h: * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::invokeDidReceiveResponseForFile): * platform/playstation/MIMETypeRegistryPlayStation.cpp: (WebCore::MIMETypeRegistry::mimeTypeForExtension): (WebCore::MIMETypeRegistry::preferredExtensionForMIMEType): (WebCore::MIMETypeRegistry::extensionsForMIMEType): (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Deleted. (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Deleted. (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Deleted. * platform/win/MIMETypeRegistryWin.cpp: (WebCore::MIMETypeRegistry::preferredExtensionForMIMEType): (WebCore::MIMETypeRegistry::mimeTypeForExtension): (WebCore::MIMETypeRegistry::extensionsForMIMEType): (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Deleted. (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Deleted. (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Deleted. * platform/xdg/MIMETypeRegistryXdg.cpp: (WebCore::MIMETypeRegistry::mimeTypeForExtension): (WebCore::MIMETypeRegistry::preferredExtensionForMIMEType): (WebCore::MIMETypeRegistry::extensionsForMIMEType): (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Deleted. (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Deleted. (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): Deleted. 2020-07-03 Carlos Garcia Campos <cgarcia@igalia.com> [GTK4] Enable threaded rendering by default https://bugs.webkit.org/show_bug.cgi?id=213883 Reviewed by Adrian Perez de Castro. When building with GTK4 we no longer use the cairo context to render directly, so we can always enable the threaded rendering. In WPE port threaded rendering is only enabled when env var WEBKIT_NICOSIA_PAINTING_THREADS is present. This patch changes a bit the meaning of the env var, so that when 0 is passed the feature is disabled too, instead of setting the number of threads to 4. * platform/graphics/nicosia/NicosiaPaintingEngine.cpp: (Nicosia::PaintingEngine::create): 2020-07-02 Mark Lam <mark.lam@apple.com> ReadableStream::create() should handle any exceptions that may be thrown during construction. https://bugs.webkit.org/show_bug.cgi?id=213819 Reviewed by Youenn Fablet and Yusuke Suzuki. Win EWS detected that ReadableStream::create() can throw exceptions, and we were failing to handle it. This patch fixes that. * Modules/cache/DOMCache.cpp: (WebCore::DOMCache::put): * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::readableStream): (WebCore::FetchBodyOwner::createReadableStream): * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::clone): * bindings/js/ReadableStream.cpp: (WebCore::ReadableStream::create): * bindings/js/ReadableStream.h: 2020-07-02 Alex Christensen <achristensen@webkit.org> Update Mac CMake build * PlatformMac.cmake: 2020-07-02 Said Abou-Hallawa <sabouhallawa@apple.com> MIMETypeRegistry::getExtensionsForMIMEType() needs to handle wildcard MIME types https://bugs.webkit.org/show_bug.cgi?id=213826 Reviewed by Darin Adler. Addressing post commit review comments for r263832. * platform/cocoa/MIMETypeRegistryCocoa.mm: (WebCore::extensionsForMIMETypeMap): 2020-07-02 Brady Eidson <beidson@apple.com> GameController.framework soft linking refactoring https://bugs.webkit.org/show_bug.cgi?id=213909 Reviewed by Tim Horton. No new tests (No behavior changes) * WebCore.xcodeproj/project.pbxproj: * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: (WebCore::GameControllerGamepadProvider::startMonitoringGamepads): * platform/gamepad/cocoa/GameControllerSPI.h: Added. * platform/gamepad/cocoa/GameControllerSoftLink.h: Added. * platform/gamepad/cocoa/GameControllerSoftLink.mm: Added. 2020-07-02 Simon Fraser <simon.fraser@apple.com> REGRESSION(r260276): menu items in footer of https://salo.ai are invisible until you hover or resize https://bugs.webkit.org/show_bug.cgi?id=213712 <rdar://problem/64893190> Reviewed by Zalan Bujtas. A negative z-index child triggers a foreground layer inside overflow scroll. This foreground layer gets the PaintingOverflowContents flag but not the PaintingCompositingScrollingPhase flag, but we still need to avoid the clip check that happens in RenderBlock::paint(), so change RenderLayer::paintLayerContents() to just check for isPaintingOverflowContents. Test: compositing/scrolling/async-overflow-scrolling/foreground-layer-paint-phase.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerContents): 2020-07-02 Antoine Quint <graouts@webkit.org> visualViewport.addEventListener("scroll"*** fires permanently after zoom or orientation change https://bugs.webkit.org/show_bug.cgi?id=211522 <rdar://problem/62939371> Reviewed by Simon Fraser. Correctly set the flag indicating that a scroll event has been dispatched on the visual viewport. Test: fast/visual-viewport/scroll-event-fired-during-scroll-alone.html * dom/Document.cpp: (WebCore::Document::runScrollSteps): 2020-07-02 Zalan Bujtas <zalan@apple.com> Overlapping content on earny.co https://bugs.webkit.org/show_bug.cgi?id=213864 <rdar://problem/61011802> Reviewed by Simon Fraser. Do not use a 1px value for initial min/max content width. * rendering/AutoTableLayout.cpp: (WebCore::AutoTableLayout::recalcColumn): (WebCore::AutoTableLayout::calcEffectiveLogicalWidth): (WebCore::AutoTableLayout::layout): I found 2 places where we rely on the initial 1px value for min/max width. This might cause some "regression". 2020-07-02 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r263633, r263651, and r263671. Still seeing MediaRecorder test crashes after re-landing r263633 Reverted changesets: "MediaRecorder stopRecorder() returns empty Blob after first use" https://bugs.webkit.org/show_bug.cgi?id=212274 https://trac.webkit.org/changeset/263633 "MediaRecorder.start() Method is Ignoring the "timeslice" Parameter" https://bugs.webkit.org/show_bug.cgi?id=202233 https://trac.webkit.org/changeset/263651 "Support MediaRecorder.onstart" https://bugs.webkit.org/show_bug.cgi?id=213720 https://trac.webkit.org/changeset/263671 2020-07-02 Antti Koivisto <antti@apple.com> REGRESSION: Comments section at dpreview has overlapping names with comment on phone https://bugs.webkit.org/show_bug.cgi?id=213890 <rdar://problem/64693599> Reviewed by Simon Fraser. Test: fast/text-autosizing/ios/float-miscomputed-line-height.html * rendering/TextAutoSizing.cpp: (WebCore::TextAutoSizingValue::adjustTextNodeSizes): Negative value is used to indicate unset line-height. We shouldn't make adjustments in this case. This matches Style::BuilderCustom code. 2020-07-02 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Remove redundant margin-border-padding when computing the intrinsic width https://bugs.webkit.org/show_bug.cgi?id=213882 Reviewed by Antti Koivisto. The child intrinsic width already includes the margin-border-padding values. Test: fast/layoutformattingcontext/table-with-margin-content-simple.html * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): 2020-07-02 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Use <tr> computed height as minimum height for the row https://bugs.webkit.org/show_bug.cgi?id=213880 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-fixed-row-height-simple.html * layout/tableformatting/TableLayout.cpp: (WebCore::Layout::TableFormattingContext::TableLayout::distributedVerticalSpace): 2020-07-02 Youenn Fablet <youenn@apple.com> getUserMedia returns OverConstrained on Jitsi https://bugs.webkit.org/show_bug.cgi?id=210932 <rdar://problem/64403675> Reviewed by Philippe Normand. We compute the max width, max height and max frame rate across all presets. In case a preset for the max resolution is different from the preset for the max frame rate, we were selecting capture parameters that no preset can match. To fix the issue, in case the frame rate constraint is not mandatory, and we do not find a preset when starting to capture, we remove the frame rate constraint, pick the preset and choose the max frame rate from that preset. Update mock sources to have a high resolution preset with low frame rate to enable writing a test. Test: fast/mediastream/get-user-media-ideal-constraints.html * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): * platform/mediastream/RealtimeVideoCaptureSource.cpp: (WebCore::RealtimeVideoCaptureSource::bestSupportedSizeAndFrameRate): (WebCore::RealtimeVideoCaptureSource::setSizeAndFrameRate): * platform/mediastream/VideoPreset.h: (WebCore::VideoPreset::maxFrameRate const): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::defaultDevices): 2020-07-02 Carlos Garcia Campos <cgarcia@igalia.com> Unreviewed. Fix GTK4 build * platform/gtk/GtkVersioning.h: (gtk_scrolled_window_new): 2020-07-02 Rob Buis <rbuis@igalia.com> Fragment navigation involving fragment identifiers does not match specification https://bugs.webkit.org/show_bug.cgi?id=83930 Reviewed by Darin Adler. Implement step 5 and 6 of [1] to allow fragment identifier lookup using percent-decoding, after normal lookup failed. Behavior matches Chrome and Firefox. [1] https://html.spec.whatwg.org/multipage/browsing-the-web.html#the-indicated-part-of-the-document Tests: imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding-2.html imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding.html imported/w3c/web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document.html * page/FrameView.cpp: (WebCore::FrameView::scrollToFragmentInternal): 2020-07-02 Alexander Mikhaylenko <alexm@gnome.org> [GTK] Kinetic scrolling is still triggered if you wait before lifting fingers https://bugs.webkit.org/show_bug.cgi?id=213789 Reviewed by Carlos Garcia Campos. The intended behavior for kinetic scrolling is that it's possible to not trigger it by stopping moving fingers before lifting them, as opposed to doing a fling/swipe. However, right now it's broken and trying to do this triggers kinetic scrolling as well. Currently, the last scroll event with (0, 0) deltas isn't added to the scroll history for kinetic scrolling. However, this is wrong, because the last event, or rather the timespan between it and the previous scroll event, actually determines the kinetic scrolling velocity: if this event follows the previous one quickly, the velocity is large, but if there was a long pause, the velocity would be close to 0. See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1902 and https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1903 for the equivalent GTK fixes. * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent): * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent): * platform/generic/ScrollAnimatorGeneric.cpp: (WebCore::ScrollAnimatorGeneric::handleWheelEvent): 2020-07-02 Philippe Normand <pnormand@igalia.com> [GStreamer] Rewrite mediastreamsrc element https://bugs.webkit.org/show_bug.cgi?id=213777 Reviewed by Xabier Rodriguez-Calvar. The underlying functionality remains the same, design-wise. This is mostly a refactoring switching to smart pointers as much as possible and trying to comply with WebKit code style guidelines. The previous version of this element was leaking pad templates and sticky stream-start events (in webkitMediaStreamSrcTrackEnded). The LIBWEBRTC ifdef guards were removed as well, because there's no actual libwebrtc dependency involved in this code. No new tests, existing webrtc and fast/mediastream tests cover this patch. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (mediaStreamTrackPrivateGetTags): (webkitMediaStreamNew): (WebKitMediaStreamTrackObserver::WebKitMediaStreamTrackObserver): (WebKitMediaStreamObserver::WebKitMediaStreamObserver): (InternalSource::InternalSource): (InternalSource::~InternalSource): (InternalSource::src const): (InternalSource::pushSample): (webkitMediaStreamSrcUriGetType): (webkitMediaStreamSrcUriGetProtocols): (webkitMediaStreamSrcUriGetUri): (webkitMediaStreamSrcUriSetUri): (webkitMediaStreamSrcUriHandlerInit): (webkitMediaStreamSrcSetProperty): (webkitMediaStreamSrcGetProperty): (webkitMediaStreamSrcConstructed): (stopObservingTracks): (webkitMediaStreamSrcFinalize): (webkitMediaStreamSrcChangeState): (webkit_media_stream_src_class_init): (webkitMediaStreamSrcChain): (webkitMediaStreamSrcAddPad): (ProbeData::ProbeData): (webkitMediaStreamSrcPadProbeCb): (webkitMediaStreamSrcSetupSrc): (webkitMediaStreamSrcPostStreamCollection): (webkitMediaStreamSrcAddTrack): (webkitMediaStreamSrcRemoveTrackByType): (webkitMediaStreamSrcSetStream): (webkitMediaStreamSrcPushVideoSample): (webkitMediaStreamSrcPushAudioSample): (webkitMediaStreamSrcTrackEnded): (webkitMediaStreamSrcNew): * platform/mediastream/gstreamer/GStreamerMediaStreamSource.h: 2020-07-01 Said Abou-Hallawa <sabouhallawa@apple.com> MIMETypeRegistry::getExtensionsForMIMEType() needs to handle wildcard MIME types https://bugs.webkit.org/show_bug.cgi?id=213826 Reviewed by Darin Adler. Working towards webkit.org/b/213347, it needs to be possible for WebCore to get the file extensions for wildcard MIME types, e.g. "image/*" or "video/*". For Cocoa platforms, we will enumerate the UTIs of the system. Get the MIMEType and the extensions of each UTI. Add the following pairs to a singleton HashMap: { MIMEType, extension } { Type(MIMEType)/*, extension } Change MIMETypeRegistry::getExtensionsForMIMEType() such that it calls extensionsForWildcardMIMEType() if the MIMEType ends with "*". * platform/MIMETypeRegistry.h: * platform/cocoa/MIMETypeRegistryCocoa.mm: (WebCore::extensionsForMIMETypeMap): (WebCore::extensionsForWildcardMIMEType): (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): * platform/playstation/MIMETypeRegistryPlayStation.cpp: (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): * platform/win/MIMETypeRegistryWin.cpp: (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): * platform/xdg/MIMETypeRegistryXdg.cpp: (WebCore::MIMETypeRegistry::getExtensionsForMIMEType): 2020-07-01 Said Abou-Hallawa <sabouhallawa@apple.com> Allow the File object to be created with a replacement file https://bugs.webkit.org/show_bug.cgi?id=213825 Reviewed by Darin Adler. Working towards webkit.org/b/213347, it needs to be possible to create the File object with an optional replacement file. Only the registered BlobDataFileReference will be created with both the original file path and the replacement file path. So it can delete the replacement file when it is destroyed. Otherwise BlobDataFileReference will be created with the replacement file path. It is important to create the File object with the replacement file because it needs to get the meta-data and the bytes of the replacement file not the original file. * fileapi/File.cpp: (WebCore::File::create): * fileapi/File.h: * fileapi/ThreadableBlobRegistry.cpp: (WebCore::ThreadableBlobRegistry::registerFileBlobURL): * fileapi/ThreadableBlobRegistry.h: * html/DirectoryFileListCreator.cpp: (WebCore::createFileList): * html/FileInputType.cpp: (WebCore::FileInputType::filesFromFormControlState): When the Files are created from a FormControlState, they will be created without replacement files since they might have been deleted. (WebCore::FileInputType::filesChosen): (WebCore::FileInputType::receiveDroppedFiles): * platform/FileChooser.cpp: (WebCore::FileChooser::chooseFiles): (WebCore::FileChooser::chooseMediaFiles): * platform/FileChooser.h: (WebCore::FileChooserFileInfo::isolatedCopy const): (WebCore::FileChooser::chooseFiles): (WebCore::FileChooserFileInfo::FileChooserFileInfo): Deleted. * platform/network/BlobDataFileReference.cpp: (WebCore::BlobDataFileReference::BlobDataFileReference): (WebCore::BlobDataFileReference::~BlobDataFileReference): (WebCore::BlobDataFileReference::path): (WebCore::BlobDataFileReference::startTrackingModifications): * platform/network/BlobDataFileReference.h: * platform/network/BlobRegistry.h: 2020-07-01 Don Olmstead <don.olmstead@sony.com> [CMake] Add WOFF2 targets https://bugs.webkit.org/show_bug.cgi?id=213865 Reviewed by Fujii Hironori. Use the WOFF:: targets when USE_WOFF2 is set. * CMakeLists.txt: 2020-07-01 Chris Fleizach <cfleizach@apple.com> AX: Implement relevant simulated key presses for custom ARIA widgets for increment/decrement https://bugs.webkit.org/show_bug.cgi?id=213744 Reviewed by Darin Adler. In order to allow custom ARIA widgets to work, we can post keyboard events for specific ax actions that are not handled natively. Spec: https://github.com/WICG/aom/blob/gh-pages/explainer.md#user-action-events-from-assistive-technology Test: accessibility/keyevents-posted-for-increment-actions.html accessibility/keyevents-for-increment-actions-with-node-removal.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::postKeyboardKeysForValueChange): (WebCore::AccessibilityNodeObject::setNodeValue): (WebCore::AccessibilityNodeObject::changeValueByStep): (WebCore::AccessibilityNodeObject::changeValueByPercent): * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::setValue): * accessibility/AccessibilityRenderObject.h: * accessibility/AccessibilityScrollbar.cpp: (WebCore::AccessibilityScrollbar::setValue): * accessibility/AccessibilityScrollbar.h: * accessibility/AccessibilitySlider.cpp: (WebCore::AccessibilitySlider::setValue): * accessibility/AccessibilitySlider.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::setValue): * accessibility/isolatedtree/AXIsolatedObject.h: 2020-07-01 Wenson Hsieh <wenson_hsieh@apple.com> Fix the WebKit build after <rdar://problem/64288191> https://bugs.webkit.org/show_bug.cgi?id=213832 Reviewed by Tim Horton. Upcoming changes to <UIKit/UIWebDocumentView.h> will cause the WebKit build to break, due to conflicting declarations of WKObject in both WebCore (WAK) code and the WebKit API. Avoid this by renaming the WAK version to WAKObject, rather than WKObject. Additionally, fix some minor style issues along the way. * platform/ios/wak/WKTypes.h: * platform/ios/wak/WKUtilities.c: (WKRetain): (WKRelease): (_WAKObjectDealloc): (WKGetClassInfo): (_WKObjectDealloc): Deleted. * platform/ios/wak/WKUtilities.h: * platform/ios/wak/WKView.h: * platform/ios/wak/WKView.mm: (_WKViewDealloc): 2020-07-01 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add support for non-baseline aligned cell height https://bugs.webkit.org/show_bug.cgi?id=213845 Reviewed by Antti Koivisto. Adjust max ascent/descent only when the cell is basline aligned. Test: fast/layoutformattingcontext/table-cell-height-middle-align-simple.html * layout/tableformatting/TableLayout.cpp: (WebCore::Layout::TableFormattingContext::TableLayout::distributedVerticalSpace): 2020-07-01 Antoine Quint <graouts@webkit.org> [Media Controls] Tracks panel can show text tracks with mode "hidden" as selected https://bugs.webkit.org/show_bug.cgi?id=213839 <rdar://problem/57989325> Reviewed by Jer Noble. We only considered text tracks that had their "mode" set to "disabled" as tracks that weren't selected, but there is also the "hidden" mode which should share the same UI state. We now check for "mode" to be set to "showing" to consider a text track as selected in the tracks panel. Test: media/modern-media-controls/tracks-support/tracks-support-hidden-tracks.html * Modules/modern-media-controls/media/tracks-support.js: (TracksSupport.prototype.tracksPanelIsTrackInSectionSelected): 2020-07-01 Sam Weinig <weinig@apple.com> Regression (r263788): Windows build broken: nameForRenderTreeAsText is not a member of WebCore::Color https://bugs.webkit.org/show_bug.cgi?id=213841 <rdar://problem/64985276> Fix Windows build. * platform/graphics/ca/win/PlatformCALayerWin.cpp: (printColor): 2020-07-01 Youenn Fablet <youenn@apple.com> Make NetworkSendQueue use CString instead of String for UTF-8 data https://bugs.webkit.org/show_bug.cgi?id=213714 Reviewed by Darin Adler. Use CString instead of String in NetworkSendQueue as all data is to be encoded as UTF-8. This allows converting and allocating the UTF-8 string only once. Covered by existing tests. * Modules/mediastream/RTCDataChannel.cpp: (WebCore::RTCDataChannel::createMessageQueue): (WebCore::RTCDataChannel::send): * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: (WebCore::LibWebRTCDataChannelHandler::sendStringData): (WebCore::LibWebRTCDataChannelHandler::sendRawData): * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: * fileapi/NetworkSendQueue.cpp: (WebCore::NetworkSendQueue::enqueue): (WebCore::NetworkSendQueue::processMessages): * fileapi/NetworkSendQueue.h: * platform/mediastream/RTCDataChannelHandler.h: * platform/mock/RTCDataChannelHandlerMock.cpp: (WebCore::RTCDataChannelHandlerMock::sendStringData): * platform/mock/RTCDataChannelHandlerMock.h: 2020-07-01 Alexey Shvayka <shvaikalesh@gmail.com> Use more efficient makeString() instead of StringBuilder https://bugs.webkit.org/show_bug.cgi?id=213708 Reviewed by Sam Weinig. This patch refactors throwRequiredMemberTypeError() and throwArgument*Error() methods, replacing all StringBuilder usages with more efficient makeString(). Extracts makeArgumentTypeErrorMessage(), similiar to existing helpers, which can be reused if neccessary. No new tests, no behavior change. * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::makeArgumentTypeErrorMessage): (WebCore::throwArgumentMustBeEnumError): (WebCore::throwArgumentMustBeFunctionError): (WebCore::throwArgumentMustBeObjectError): (WebCore::throwArgumentTypeError): (WebCore::throwRequiredMemberTypeError): (WebCore::appendArgumentMustBe): Deleted. 2020-06-29 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] Don't include scrollbar extents when computing sizes for percentage resolution https://bugs.webkit.org/show_bug.cgi?id=213739 Reviewed by Javier Fernandez. Content override sizes do include scrollbars so they must be substracted when using the override size to compute percentages. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution): Remove scrollbars. (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): Ditto. 2020-06-30 Sergio Villar Senin <svillar@igalia.com> [css-flex] Remove death code paths when evaluating percentage resolution https://bugs.webkit.org/show_bug.cgi?id=213809 Reviewed by Manuel Rego Casasnovas. Both crossSizeForPercentageResolution() and mainSizeForPercentageResolution() are only called from childLogicalHeightForPercentageResolution(). The former is called whenever hasOrthogonalFlow(child) is false and the latter when it's true. However crossSizeForPercentageResolution() has a path for hasOrthogonalFlow(child)==true which is impossible to reach. The same happens to mainSizeForPercentageResolution() which has a path for hasOrthogonalFlow(child)==false which is also impossible to reach. Remove both death code paths and replace them by assertions. We're also making both methods private since are not meant to be used from the outside. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution): Remove death code path. (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): Ditto. * rendering/RenderFlexibleBox.h: Make both calls private. 2020-06-30 Sam Weinig <weinig@apple.com> Split Color serialization out of Color classes https://bugs.webkit.org/show_bug.cgi?id=213820 Reviewed by Darin Adler. Move all color serialization related functions out of the Color family of classes, and into a standalone ColorSerialization.h Now all color serialization calls one of the following three functions, depending on need: - serializationForCSS(...) - serializationForHTML(...) - serializationForRenderTreeAsText(...) These are overload for all three Color classes (Color, SimpleColor and ExtendedColor) to allow easy use without necessarily needing to construct another type. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add new files. * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): * editing/EditingStyle.cpp: (WebCore::EditingStyle::inverseTransformColorIfNeeded): (WebCore::StyleChange::extractTextStyles): * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): * html/ColorInputType.cpp: (WebCore::ColorInputType::didChooseColor): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::shadowColor const): * html/canvas/CanvasStyle.h: (WebCore::CanvasStyle::color const): * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): (WebCore::TextTrackCueGeneric::toJSON const): * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildArrayForCanvasGradient): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::colorPropertyCSS const): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret): * platform/graphics/Color.cpp: (WebCore::operator<<): (WebCore::Color::serialized const): Deleted. (WebCore::Color::cssText const): Deleted. (WebCore::Color::nameForRenderTreeAsText const): Deleted. * platform/graphics/Color.h: * platform/graphics/ColorSerialization.cpp: Added. (WebCore::decimalDigit): (WebCore::fractionDigitsForFractionalAlphaValue): (WebCore::serializationForCSS): (WebCore::serializationForHTML): (WebCore::serializationForRenderTreeAsText): (WebCore::serialization): * platform/graphics/ColorSerialization.h: Added. * platform/graphics/ExtendedColor.cpp: (WebCore::ExtendedColor::cssText const): Deleted. * platform/graphics/ExtendedColor.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::dumpProperties const): * platform/graphics/InbandGenericCue.cpp: (WebCore::InbandGenericCue::toJSONString const): * platform/graphics/SimpleColor.cpp: (WebCore::SimpleColor::serializationForHTML const): Deleted. (WebCore::decimalDigit): Deleted. (WebCore::fractionDigitsForFractionalAlphaValue): Deleted. (WebCore::SimpleColor::serializationForCSS const): Deleted. (WebCore::SimpleColor::serializationForRenderTreeAsText const): Deleted. * platform/graphics/SimpleColor.h: * platform/graphics/filters/FEDropShadow.cpp: (WebCore::FEDropShadow::externalRepresentation const): * platform/graphics/filters/FEFlood.cpp: (WebCore::FEFlood::externalRepresentation const): * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): * rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::writeRenderSVGTextBox): * svg/properties/SVGPropertyTraits.h: (WebCore::SVGPropertyTraits<Color>::toString): * testing/Internals.cpp: (WebCore::Internals::viewBaseBackgroundColor): (WebCore::Internals::highlightPseudoElementColor): (WebCore::Internals::systemColorForCSSValue): (WebCore::Internals::focusRingColor): Adopt new serialization functions. 2020-06-30 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] Unreviewed build fix after r263776 > WebCore\platform\graphics\ColorUtilities.h(67): error C2039: 'lround': is not a member of 'std' * platform/graphics/ColorUtilities.h: Include <cmath> for std::lround. 2020-06-30 Andres Gonzalez <andresg_22@apple.com> Code cleanup in AccessibilityMenuList.cpp and AXIsolatedTree.h. https://bugs.webkit.org/show_bug.cgi?id=213806 Reviewed by Darin Adler. No change in functionality. Minor code cleanup pointed out by Darin Adler in reviews for bug 209169 and bug 213575. * accessibility/AccessibilityMenuList.cpp: (WebCore::AccessibilityMenuList::isCollapsed const): * accessibility/isolatedtree/AXIsolatedTree.h: 2020-06-30 Sam Weinig <weinig@apple.com> Move Color blending related functions to their own files https://bugs.webkit.org/show_bug.cgi?id=213742 Reviewed by Dean Jackson. - Moves Color::blend(const Color&), Color::blendWithWhite(), blend(const Color&, const Color&, double) and blendWithoutPremultiply(const Color&, const Color&, double) to their own files: ColorBlending.h/cpp - Renames Color::blend(const Color&) to blendSourceOver(const Color&, const Color&) - Renames Color::blendWithWhite() to blendWithWhite(const Color&). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add new files. * platform/graphics/Color.cpp: (WebCore::Color::blend const): Deleted. (WebCore::Color::blendWithWhite const): Deleted. (WebCore::blend): Deleted. (WebCore::blendWithoutPremultiply): Deleted. * platform/graphics/Color.h: * platform/graphics/ColorBlending.cpp: Copied from Source/WebCore/platform/graphics/Color.cpp. * platform/graphics/ColorBlending.h: Added. Move declarations / implementations from Color.h/cpp to ColorBlending.h/cpp. * css/CSSGradientValue.cpp: * editing/FrameSelection.cpp: (WebCore::CaretBase::computeCaretColor): * page/FrameView.cpp: (WebCore::FrameView::documentBackgroundColor const): * page/TextIndicator.cpp: (WebCore::estimatedBackgroundColorForRange): * page/animation/CSSPropertyAnimation.cpp: * platform/graphics/filters/FilterOperation.cpp: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintFillLayerExtended): * rendering/RenderMenuList.cpp: (RenderMenuList::getItemBackgroundColor const): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::transformSelectionBackgroundColor const): Update for new signatures and #include ColorBlending.h as neeeded. 2020-06-30 Sam Weinig <weinig@apple.com> Rename ManifestParser.h/cpp to ApplicationCacheManifestParser.h/cpp to make it clear its not the ApplicationManifestParser (a different thing entirely) https://bugs.webkit.org/show_bug.cgi?id=213815 Reviewed by Darin Adler. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * loader/appcache/ApplicationCacheGroup.cpp: * loader/appcache/ApplicationCacheManifestParser.cpp: Copied from Source/WebCore/loader/appcache/ManifestParser.cpp. * loader/appcache/ApplicationCacheManifestParser.h: Copied from Source/WebCore/loader/appcache/ManifestParser.h. * loader/appcache/ManifestParser.cpp: Removed. * loader/appcache/ManifestParser.h: Removed. 2020-06-30 Brady Eidson <beidson@apple.com> App-bound JavaScript and Navigation failures should have specific error codes. <rdar://problem/64940268> and https://bugs.webkit.org/show_bug.cgi?id=213808 Reviewed by Tim Hatcher. (Informally by Kate Cheney) Covered by API tests. * bindings/js/ExceptionDetails.h: 2020-06-30 Mark Lam <mark.lam@apple.com> Add handling for a case of OOME in CSSTokenizer and CSSParser. https://bugs.webkit.org/show_bug.cgi?id=213702 <rdar://problem/64808889> Reviewed by Darin Adler. We add a bool* constructionSuccess feedback argument to the private CSSTokenizer constructor. If construction fails and constructionSuccess is provided, the constructor will set *constructionSuccess to false. If construction fails and constructionSuccess is not provided, the constructor will crash with a failed RELEASE_ASSERT. In other words, the client may opt in to handle the failure to construct if it doesn't want the default behavior of crashing on failure. We also provide 2 convenience factory methods for CSSTokenizer which will return a null std::unique_ptr<CSSTokenizer> if construction fails. This is currently only used by CSSParserImpl, and ensures that its m_tokenizer is null if we fail to construct. This ensures that there isn't a pointer to a partially constructed tokenizer that some code may unknowingly use. The reason we don't force all clients of CSSTokenizer to use the factory methods instead is because there are clients that currently use on-stack instantiations of CSSTokenizer to do their work. We don't want to force them to switch to using a malloc instance. Currently, the constructors used by those clients do not provide a constructionSuccess argument to the underlying private constructor. Hence, for them, the CSSTokenizer constructor will crash if construction fails, which is how things work in pre-existing code. The only difference is that the crash is deferred till the client attempts to use the tokenizer instead of at construction time. As of this patch, only CSSParser::parseSupportsCondition() makes use of the new feedback mechanism, and handles OOME during CSSTokenizer construction by interpreting it as CSS not supporting the passed in condition string. Test: css3/out-of-memory-in-css-tokenizer.html * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseSupportsCondition): * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::CSSParserImpl): (WebCore::CSSParserImpl::failed const): * css/parser/CSSParserImpl.h: * css/parser/CSSTokenizer.cpp: (WebCore::CSSTokenizer::CSSTokenizer): * css/parser/CSSTokenizer.h: (WebCore::CSSTokenizer::failed const): 2020-06-30 Peng Liu <peng.liu6@apple.com> Enable the support of FULLSCREEN_API in WebKitTestRunner https://bugs.webkit.org/show_bug.cgi?id=213774 Reviewed by Youenn Fablet. Replace the definition of ENABLE_FULLSCREEN_API in FeatureDefines.xcconfig with the one in PlatformEnableCocoa.h. We have to do that because WebKitTestRunner does not have a FeatureDefines.xcconfig but it uses "ENABLE(FULLSCREEN_API)" to conditionally compile code to test the element fullscreen API. WebKitTestRunner can use the macro defined in PlatformEnableCocoa.h. * Configurations/FeatureDefines.xcconfig: 2020-06-30 Daniel Bates <dabates@apple.com> [iOS] Editable regions causes ~1% slowdown in PLT5 https://bugs.webkit.org/show_bug.cgi?id=213659 <rdar://problem/64361390> Reviewed by Simon Fraser. Fix the slowdown by only enabling editable region when Page::editableElementsInRect is called. There are two parts that make computing the editable region expensive: 1. Requires traversing descendents during painting when a normal paint may be able to avoid this. 2. Can cause more event region invalidations because it extends the invalidation criterion to include changes to element editability. Tests: editing/editable-region/hit-test-basic-without-editable-region.html editing/editable-region/iframe-without-editable-region.html editing/editable-region/text-field-basic-without-editable-region.html Tests: editing/editable-region/hit-test-basic-without-editable-region.html editing/editable-region/iframe-without-editable-region.html editing/editable-region/text-field-basic-without-editable-region.html * page/Frame.cpp: (WebCore::Frame::invalidateContentEventRegionsIfNeeded): Check if editable region is enabled. If it is then do what we do now. Otherwise, don't invalidate the region unless we were going to do so anyway. * page/Page.cpp: (WebCore::Page::setEditableRegionEnabled): Added. Update state and then invalidate the event region in all layers. (WebCore::Page::shouldBuildEditableRegion const): Added. Returns whether to build the editable region: either when Page::isEditableRegionEnabled() is true or the editable region debug overlay is enabled. (WebCore::Page::didFinishLoad): Turn off editable region as it may not be needed on the new page. * page/Page.h: (WebCore::Page::isEditableRegionEnabled const): Added. * rendering/EventRegion.cpp: (WebCore::EventRegion::unite): (WebCore::EventRegion::translate): (WebCore::EventRegion::containsEditableElementsInRect const): (WebCore::EventRegion::dump const): * rendering/EventRegion.h: (WebCore::EventRegion::hasEditableRegion const): (WebCore::EventRegion::rectsForEditableElements const): (WebCore::EventRegion::decode): (WebCore::EventRegion::ensureEditableRegion): The editable region is now an Optional<>. There will only be one if ensureEditableRegion was called, which is only when Page::isEditableRegionEnabled() returns true. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintObject): * rendering/RenderElement.cpp: (WebCore::RenderElement::styleWillChange): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::maintainsEventRegion const): Only do what we do now if Page::shouldBuildEditableRegion() returns true. (WebCore::RenderLayerBacking::updateEventRegion): Instantiate the editable region, if needed. Painting will then populate it. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::applyToCompositedLayerIncludingDescendants): Added. (WebCore::RenderLayerCompositor::invalidateEventRegionForAllLayers): Added. (WebCore::RenderLayerCompositor::clearBackingForAllLayers): Wrote in terms of applyToCompositedLayerIncludingDescendants. (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants): Deleted. * rendering/RenderLayerCompositor.h: * testing/InternalSettings.cpp: (WebCore::InternalSettings::setEditableRegionEnabled): * testing/InternalSettings.h: * testing/InternalSettings.idl: Add a new internal setting for testing purposes to toggle enabling/disabling editable region. 2020-06-30 Peng Liu <peng.liu6@apple.com> Scrunching a video to PiP can result in broken animation and leave Safari in a bad state https://bugs.webkit.org/show_bug.cgi?id=213175 Reviewed by Jer Noble. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setVideoFullscreenStandby): (WebCore::HTMLMediaElement::setVideoFullscreenStandby): The "standby" state is relevant to a video element only when its presentation mode is VideoFullscreenModeNone. * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::exitFullscreen): (VideoFullscreenInterfaceAVKit::cleanupFullscreen): Add a flag m_enteringPictureInPicture. Function exitFullscreen() and cleanupFullscreen() will check m_enteringPictureInPicture and they will abort the process to exit fullscreen/picture-in-picture if the flag is true. However, VideoFullscreenManager will retry to exit fullscreen/picture-in-picture after it confirms that the previous starting picture-in-picture process is completed. (VideoFullscreenInterfaceAVKit::willStartPictureInPicture): Set the flag m_enteringPictureInPicture. (VideoFullscreenInterfaceAVKit::didStartPictureInPicture): Call m_fullscreenChangeObserver->didEnterFullscreen() if the entering picture-in-picture process is started by the UI process (e.g., swipe-up gesture). Clear m_standby and m_enteringPictureInPicture after the video element enters picture-in-picture. 2020-06-30 Alex Christensen <achristensen@webkit.org> Remove WTF::MD5 https://bugs.webkit.org/show_bug.cgi?id=213766 Reviewed by Youenn Fablet. * Modules/websockets/WebSocketHandshake.cpp: * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::generateBaseFilename): 2020-06-30 Youenn Fablet <youenn@apple.com> Set runtime flag m_isWebRTCPlatformCodecsInGPUProcessEnabled to false by default https://bugs.webkit.org/show_bug.cgi?id=213779 Reviewed by Alex Christensen. No change of behavior since this flag is WebKit 2 only and off by default. Move off by default WebRTC flags at the end of the section. * page/RuntimeEnabledFeatures.h: 2020-06-30 Jason Lawrence <lawrence.j@apple.com> Unreviewed, reverting r263753. This commit caused build failures across multiple platforms. Reverted changeset: "Move Color blending related functions to their own files" https://bugs.webkit.org/show_bug.cgi?id=213742 https://trac.webkit.org/changeset/263753 2020-06-30 Sam Weinig <weinig@apple.com> Move Color blending related functions to their own files https://bugs.webkit.org/show_bug.cgi?id=213742 Reviewed by Dean Jackson. - Moves Color::blend(const Color&), Color::blendWithWhite(), blend(const Color&, const Color&, double) and blendWithoutPremultiply(const Color&, const Color&, double) to their own files: ColorBlending.h/cpp - Renames Color::blend(const Color&) to blendSourceOver(const Color&, const Color&) - Renames Color::blendWithWhite() to blendWithWhite(const Color&). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add new files. * platform/graphics/Color.cpp: (WebCore::Color::blend const): Deleted. (WebCore::Color::blendWithWhite const): Deleted. (WebCore::blend): Deleted. (WebCore::blendWithoutPremultiply): Deleted. * platform/graphics/Color.h: * platform/graphics/ColorBlending.cpp: Copied from Source/WebCore/platform/graphics/Color.cpp. * platform/graphics/ColorBlending.h: Added. Move declarations / implementations from Color.h/cpp to ColorBlending.h/cpp. * css/CSSGradientValue.cpp: * editing/FrameSelection.cpp: (WebCore::CaretBase::computeCaretColor): * page/FrameView.cpp: (WebCore::FrameView::documentBackgroundColor const): * page/TextIndicator.cpp: (WebCore::estimatedBackgroundColorForRange): * page/animation/CSSPropertyAnimation.cpp: * platform/graphics/filters/FilterOperation.cpp: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintFillLayerExtended): * rendering/RenderMenuList.cpp: (RenderMenuList::getItemBackgroundColor const): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::transformSelectionBackgroundColor const): Update for new signatures and #include ColorBlending.h as neeeded. 2020-06-30 Andy Estes <aestes@apple.com> [Xcode] Enable the "My Mac (Mac Catalyst)" destination in WebKit Xcode projects https://bugs.webkit.org/show_bug.cgi?id=213740 Reviewed by Darin Adler. * Configurations/Base.xcconfig: Set SUPPORTS_MACCATALYST to YES to tell Xcode that this project supports building for Mac Catalyst. 2020-06-30 Michael Catanzaro <mcatanzaro@gnome.org> [WPE][GTK] Update stale comment in UserAgentGLib.cpp https://bugs.webkit.org/show_bug.cgi?id=213749 Reviewed by Adrian Perez de Castro. Remove outdated comment. * platform/glib/UserAgentGLib.cpp: (WebCore::platformVersionForUAString): 2020-06-30 Youenn Fablet <youenn@apple.com> Add VP9 WebRTC codec runtime flag https://bugs.webkit.org/show_bug.cgi?id=213724 Reviewed by Eric Carlson. Add binding code to switch on/off VP9 in WebRTC factories based on runtime flag. Test: webrtc/vp9.html * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::setWebRTCH265Support): (WebCore::Internals::setWebRTCVP9Support): * testing/Internals.h: * testing/Internals.idl: 2020-06-29 Antoine Quint <graouts@webkit.org> [Web Animations] REGRESSION: Bootstrap Carousel component v4.1 regressed with Web Animations https://bugs.webkit.org/show_bug.cgi?id=213376 <rdar://problem/64531242> Reviewed by Dean Jackson. An older version of the Bootstrap CSS and JS library had a rather odd way to implement a completion callback for a transition: it would register a "transitionend" event but also set a timeout of the transition's duration and use whichever came first as a callback to run completion tasks for the transition. Additionally, in that callback, it would set the transitioned value to the same computed value but using a different specified value, for instance setting the "transform" CSS property to "translateX(0)" instead of "translateY(0)". In our implementation this would make the completed transition repeat. Indeed, we would first incorrectly assume that the transition was still "running" and not "finished", per the CSS Transitions spec terminology as we only update that status when we update animations under Page::updateRendering(). We now update an existing transition's status first in AnimationTimeline::updateCSSTransitionsForElementAndProperty(). Another issue is that when we considered the existing transition to be running, even though it was finished, we would use the "timeline time at creation" to compute its current progress, which would yield situations where we computed the before-change style to be the existing transition's current computed value, except that transition's progress was 0 since the "timeline time at creation" happens before the transition's resolved start time. We now only use the "timeline time at creation" in the situations it was designed to be used: either when the transition has not yet had a resolved start time, or its resolved start time is the current timeline time (ie. it was just set). To be able to compare the transition's resolved start time and the current timeline time, we also updated the internal start time getter and setter methods to use Seconds instead of double which is only needed for the JS bindings. Test: webanimations/css-transition-retargeting-to-same-value-upon-completion-with-timeout.html * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty): * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::bindingsStartTime const): (WebCore::DeclarativeAnimation::setBindingsStartTime): * animation/WebAnimation.cpp: (WebCore::WebAnimation::bindingsStartTime const): (WebCore::WebAnimation::setBindingsStartTime): (WebCore::WebAnimation::setStartTime): (WebCore::WebAnimation::startTime const): Deleted. * animation/WebAnimation.h: (WebCore::WebAnimation::startTime const): (WebCore::WebAnimation::bindingsStartTime const): Deleted. 2020-06-29 Brady Eidson <beidson@apple.com> JavaScript cannot be injected into iframes <rdar://problem/54168946> and https://bugs.webkit.org/show_bug.cgi?id=213556 Reviewed by Geoff Garen. Covered by API tests. * bindings/js/ExceptionDetails.h: Start a collection of "exception types" that will grow quickly, beginning with the specialized "missing frame" type. 2020-06-29 Sam Weinig <weinig@apple.com> Convert AppCache manifest parser over to using StringParsingBuffer https://bugs.webkit.org/show_bug.cgi?id=213680 Reviewed by Darin Adler. - Renames parseManifest to parseApplicationCacheManifest to differentiate between the manifest for the application cache and the "application manifest", which is a different thing entirely. Also renames the container struct from being called Manifest to ApplicationCacheManifest. (The file should be renamed as well, but will do that in a seperate pass). - Update parser to return an Optional<ApplicationCacheManifest> rather than using bool + out parameter. - Adopt readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). - Adopt StringParsingBuffer and ParsingUtilities along with some refinements to the code to make the intent more clear. * html/parser/ParsingUtilities.h: (WebCore::skipUntil): Fix formatting, putting the whole signature on one line. * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): Update for new parser function name and Optional return type. * loader/appcache/ManifestParser.cpp: (WebCore::isManifestWhitespace): (WebCore::isManifestNewline): (WebCore::isManifestWhitespaceOrNewline): (WebCore::makeManifestURL): (WebCore::parseApplicationCacheManifest): * loader/appcache/ManifestParser.h: Update parsing logic to use readCharactersForParsing (to avoid upconvesion) and rework using StringParsingBuffer/ParsingUtilities to make things more clear. 2020-06-29 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Adjust baseline when the table cell itself establishes an IFC https://bugs.webkit.org/show_bug.cgi?id=213735 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-cell-baseline-offset-simple2.html * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell): 2020-06-29 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Adjust baseline offset for continuation https://bugs.webkit.org/show_bug.cgi?id=213732 Reviewed by Antti Koivisto. Skip empty IFC generated for the "pre" part of the continuation (e.g. <span><div>text content</div></span>). Test: fast/layoutformattingcontext/table-cell-baseline-offset-simple.html * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell): 2020-06-29 Guowei Yang <guowei_yang@apple.com> Adding Experimental Feature Flags for CoreImage backed SVG/CSS Filters https://bugs.webkit.org/show_bug.cgi?id=213578 Reviewed by Darin Adler, Simon Fraser, Myles C. Maxfield. Preparing to implement CoreImage backed filter rendering Needs Compiler guards and experimental feature guard. No tests are required because this is just a feature flag set up * page/Settings.yaml: added default settings for the feature flag. Default value of the feature switch is off 2020-06-29 Stephan Szabo <stephan.szabo@sony.com> Fix build when !ENABLE(ACCESSIBILITY) after r263673 https://bugs.webkit.org/show_bug.cgi?id=213759 Reviewed by Chris Fleizach. No new tests, build fix. * accessibility/AXObjectCache.h: 2020-06-29 Sam Weinig <weinig@apple.com> Simplify Color's interface by removing isDark() https://bugs.webkit.org/show_bug.cgi?id=213707 Reviewed by Darin Adler. - Move Color::isDark to RenderThemeIOS.mm, its one client and rename it to useConvexGradient() to indicate what it is actually determining. * platform/graphics/Color.cpp: (WebCore::Color::isDark const): Deleted. * platform/graphics/Color.h: * rendering/RenderThemeIOS.mm: (WebCore::useConvexGradient): (WebCore::RenderThemeIOS::paintPushButtonDecorations): (WebCore::RenderThemeIOS::paintFileUploadIconDecorations): 2020-06-29 Peng Liu <peng.liu6@apple.com> Video spills over PiP screen a little when using Picture in Picture https://bugs.webkit.org/show_bug.cgi?id=213658 Reviewed by Eric Carlson. We need to provide video content dimensions instead of video element sizes to AVPlayerController to make sure that the Picture-in-Picture window will have the correct aspect ratio. Test: media/picture-in-picture/picture-in-picture-window-aspect-ratio.html * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::setupFullscreen): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::setUpFullscreen): 2020-06-29 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Remove ENABLE_STREAMS_API compilation flag https://bugs.webkit.org/show_bug.cgi?id=213728 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: * Modules/fetch/FetchBody.cpp: * Modules/fetch/FetchBody.h: * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::isDisturbed const): (WebCore::FetchBodyOwner::isDisturbedOrLocked const): (WebCore::FetchBodyOwner::blobLoadingSucceeded): (WebCore::FetchBodyOwner::blobLoadingFailed): (WebCore::FetchBodyOwner::blobChunk): * Modules/fetch/FetchBodyOwner.h: (WebCore::FetchBodyOwner::cancel): * Modules/fetch/FetchBodySource.cpp: * Modules/fetch/FetchBodySource.h: * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::BodyLoader::didSucceed): (WebCore::FetchResponse::BodyLoader::didFail): (WebCore::FetchResponse::BodyLoader::didReceiveData): * Modules/fetch/FetchResponse.h: * Modules/streams/ByteLengthQueuingStrategy.idl: * Modules/streams/ByteLengthQueuingStrategy.js: * Modules/streams/CountQueuingStrategy.idl: * Modules/streams/CountQueuingStrategy.js: * Modules/streams/ReadableByteStreamController.idl: * Modules/streams/ReadableByteStreamController.js: * Modules/streams/ReadableByteStreamInternals.js: * Modules/streams/ReadableStream.idl: * Modules/streams/ReadableStream.js: * Modules/streams/ReadableStreamBYOBReader.idl: * Modules/streams/ReadableStreamBYOBReader.js: * Modules/streams/ReadableStreamBYOBRequest.idl: * Modules/streams/ReadableStreamBYOBRequest.js: * Modules/streams/ReadableStreamDefaultController.idl: * Modules/streams/ReadableStreamDefaultController.js: * Modules/streams/ReadableStreamDefaultReader.idl: * Modules/streams/ReadableStreamDefaultReader.js: * Modules/streams/ReadableStreamInternals.js: * Modules/streams/ReadableStreamSink.cpp: * Modules/streams/ReadableStreamSink.h: * Modules/streams/ReadableStreamSink.idl: * Modules/streams/ReadableStreamSource.cpp: * Modules/streams/ReadableStreamSource.h: * Modules/streams/ReadableStreamSource.idl: * Modules/streams/StreamInternals.js: * Modules/streams/WritableStream.idl: * Modules/streams/WritableStream.js: * Modules/streams/WritableStreamInternals.js: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::isReadableByteStreamAPIEnabled): (WebCore::JSDOMGlobalObject::addBuiltinGlobals): * bindings/js/JSReadableStreamSourceCustom.cpp: * bindings/js/ReadableStreamDefaultController.cpp: * bindings/js/ReadableStreamDefaultController.h: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::writableStreamAPIEnabled const): * testing/Internals.cpp: * testing/Internals.h: * testing/Internals.idl: 2020-06-29 Sam Weinig <weinig@apple.com> Remove remaining makeSimpleColorFrom* variants https://bugs.webkit.org/show_bug.cgi?id=213706 Reviewed by Darin Adler. Removed makeSimpleColorFromFloats and makeSimpleColorFromCMYKA. - Updated callers that need to pass floats to use makeSimpleColor(SRGBA { ... }); - Updated callers that don't need to pass floats, mostly compile time constant SimpleColors to use makeSimpleColor(...), passing in 0-255 based component values. - Updated callers of makeSimpleColorFromCMYKA to use makeSimpleColor(toSRGBA(CMYKA { ... })). This required adding CMYKA type to ColorTypes.h and moving conversion SRGBA to ColorUtilities with the other color conversion code. - Added deduction guides for color types to allow component type deduction. This allows us to write: function(SRGBA { redFloat, greenFloat, blueFloat, alphaFloat }) reather than the more cumbersome: function(SRGBA<float> { redFloat, greenFloat, blueFloat, alphaFloat }) - Added operator==/operator!= for each color type. Only used by CMYKA at the moment, but generally useful, so added for all of them. For all types convertable to ColorComponents, the implementation uses the conversion to ColorComponents to avoid redundancy. * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::setStrokeColor): (WebCore::CanvasRenderingContext2DBase::setFillColor): Update to call new typed color based CanvasStyle functions. (WebCore::CanvasRenderingContext2DBase::setShadow): Use makeSimpleColor rather than makeSimpleColorFromFloats/makeSimpleColorFromCMYKA. * html/canvas/CanvasStyle.cpp: (WebCore::CanvasStyle::CanvasStyle): Replace constructors taking raw floats with ones taking typed colors (SRGBA<float>/CMYKA<float>) to make it more clear what the parameters mean. (WebCore::CanvasStyle::isEquivalentColor const): Compare the cmyka components using new operator== implementation for CMYKA<float>. (WebCore::CanvasStyle::isEquivalent const): (WebCore::CanvasStyle::isEquivalentRGBA const): Deleted. (WebCore::CanvasStyle::isEquivalentCMYKA const): Deleted. Replace isEquivalentRGBA/isEquivalentCMYKA with overloaded isEquivalent. (WebCore::CanvasStyle::applyStrokeColor const): (WebCore::CanvasStyle::applyFillColor const): Update for new names of CMYKA members. * html/canvas/CanvasStyle.h: Use SRGBA<float> and CMYKA<float> to simplify interfaces * page/DebugPageOverlays.cpp: * page/linux/ResourceUsageOverlayLinux.cpp: (WebCore::ResourceUsageOverlay::platformInitialize): Use makeSimpleColor rather than makeSimpleColorFromFloats, allowing for constant expression creation of SimpleColors. * platform/graphics/Color.cpp: (WebCore::Color::lightened const): (WebCore::Color::darkened const): Use makeSimpleColor(SRGBA { ... }) rather than makeSimpleColorFromFloats. (WebCore::Color::luminance const): Fix comment. (WebCore::blendWithoutPremultiply): Use makeSimpleColor(...) rather than makeSimpleColorFromFloats. * platform/graphics/ColorTypes.h: (WebCore::operator==): (WebCore::operator!=): - Add deduction guides and operator==/operator!= for each color type. - Add CMYKA type. No conversion to ColorComponents yet, as ColorComponents only works with 4 component colors, not ones with 5 like CMYKA. * platform/graphics/ColorUtilities.cpp: (WebCore::toSRGBA): Move conversion from CMYKA to SRGBA from makeSimpleColorFromCMYKA to here. * platform/graphics/ColorUtilities.h: (WebCore::convertPrescaledToComponentByte): (WebCore::convertToComponentByte): Use std::round rather than std::lroundf, since it will have the same result and it reads nicer. * platform/graphics/SimpleColor.cpp: (WebCore::makeSimpleColorFromCMYKA): Deleted. * platform/graphics/SimpleColor.h: (WebCore::makeSimpleColor): (WebCore::makeSimpleColorFromFloats): Deleted. - Removed makeSimpleColorFromFloats and makeSimpleColorFromCMYKA. - Added constexpr overload of makeSimpleColor taking a const SRGBA<uint8_t>&. - Fixed forward declaration of makeSimpleColor that was taking ColorComponents to actually take an SRGBA<float>, which is what the inline implementation actually takes. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::makeSimpleColorFromARGBCFArray): * platform/graphics/cairo/GradientCairo.cpp: (WebCore::interpolateColorStop): * platform/graphics/cg/ColorCG.cpp: (WebCore::makeSimpleColorFromCGColor): * platform/graphics/win/PlatformContextDirect2D.cpp: (WebCore::PlatformContextDirect2D::brushWithColor): Use makeSimpleColor(SRGBA { ... }) rather than makeSimpleColorFromFloats. * platform/graphics/mac/ColorMac.mm: (WebCore::makeSimpleColorFromNSColor): * platform/ios/ColorIOS.mm: (WebCore::colorFromUIColor): Use makeSimpleColor(SRGBA { ... }) rather than makeSimpleColorFromFloats. Casting to float is needed, as the input types are CGFloat which is double in 64-bit environments and won't automatically narrow with the new types. * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::colorForGridTileBorder const): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::beginTransparencyLayers): Use makeSimpleColor rather than makeSimpleColorFromFloats, allowing for constant expression creation of SimpleColors. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintCheckboxDecorations): (WebCore::RenderThemeIOS::paintRadioDecorations): (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): (WebCore::RenderThemeIOS::paintSystemPreviewBadge): Use Color::black/Color::white.colorWithAlpha(...) rather than makeSimpleColorFromFloats, allowing for constant expression creation of SimpleColors. 2020-06-29 Chris Fleizach <cfleizach@apple.com> AX: aria-modal nodes wrapped in aria-hidden are not honored https://bugs.webkit.org/show_bug.cgi?id=212849 <rdar://problem/64047019> Reviewed by Zalan Bujtas. Test: accessibility/aria-modal-in-aria-hidden.html If aria-modal was wrapped inside aria-hidden, we were still processing that as the modal node. Fixing that uncovered a host of very finicky issues related to aria-modal. 1. We were processing modal status immediately instead of after a delay, so visibility requirements were not correct. 2. In handleModalChange: We were processing multiple modal nodes perhaps incorrectly (the spec doesn't account for multiple modal nodes). - had to update a test to turn off modal status before adding a new modal node 3. Changed the modal node to a WeakPtr 4. In isNodeAriaVisible: We stopped processing for visibile with aria-hidden as soon as we hit a renderable block, but that means it won't account for nodes higher in the tree with aria-hidden. 5. In handleAttributeChange: if aria-hidden changes, we should update modal status if needed. 6. In focusModalNodeTimerFired: we need to verify the element is still live, otherwise it can lead to a crash. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::AXObjectCache): (WebCore::AXObjectCache::findModalNodes): (WebCore::AXObjectCache::currentModalNode): (WebCore::AXObjectCache::modalNode): (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::deferModalChange): (WebCore::AXObjectCache::focusModalNodeTimerFired): (WebCore::AXObjectCache::handleAttributeChange): (WebCore::AXObjectCache::handleModalChange): (WebCore::AXObjectCache::prepareForDocumentDestruction): (WebCore::AXObjectCache::performDeferredCacheUpdate): (WebCore::isNodeAriaVisible): * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::handleModalChange): (WebCore::AXObjectCache::deferModalChange): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::firstChild const): (WebCore::AccessibilityRenderObject::lastChild const): 2020-06-29 Youenn Fablet <youenn@apple.com> Support MediaRecorder.onstart https://bugs.webkit.org/show_bug.cgi?id=213720 Reviewed by Darin Adler. Fire start event if MediaRecorder.start is successful. Do some WebIDL clean-up, in particular change timeSlice from long to unsigned long, as per spec. Covered by added test. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::startRecording): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: 2020-06-29 Chris Dumez <cdumez@apple.com> On load from back/forward cache, call checkCompleted() for ALL frames inside FrameLoader::commitProvisionalLoad() https://bugs.webkit.org/show_bug.cgi?id=213657 Reviewed by Youenn Fablet. On load from back/forward cache, call checkCompleted() for ALL frames inside FrameLoader::commitProvisionalLoad(). Previously, we were doing it for the main frame in FrameLoader::commitProvisionalLoad() and for subframes in FrameLoader::open(). Doing it all in one place results in more understandable code and is less error-prone. Note that calling checkCompleted() for subframes was new in r262221 and is covered by: fast/history/multiple-back-forward-navigations.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::commitProvisionalLoad): (WebCore::FrameLoader::open): 2020-06-09 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] WebKit mistakenly lets pointer events (click/hover/etc) pass through flex items, if they have negative margin https://bugs.webkit.org/show_bug.cgi?id=185771 Reviewed by Javier Fernandez. When multiple child elements of a flexbox overlap (for example, due to negative margins), the element drawn in the foreground may not actually capture the hit if the element underneath it is hit-tested despite being occluded. This is because painting of flexbox children is done in order modified document order instead of raw document order. In order to achieve this we should inspect flex items in reverse order modified document order. As the OrderIterator cannot go backwards, we cache the reverse order of items when doing the layout in order to have fast hit testing in flexbox containers. As this behaviour is different to the one implemented in RenderBlock a new virtual method to perform hit testing of children was extracted from RenderBlock:nodeAtPoint() to a new method called RenderBlock::hitTestChildren. The RenderBlock implementation is identical to the current one but flexbox containers overwrite it. Two WPT flexbox hittests are passing now thanks to this patch. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::hitTestChildren): Implementation of the new virtual method extracted from nodeAtPoint. (WebCore::RenderBlock::nodeAtPoint): Moved code to hit test children to hitTestChildren() * rendering/RenderBlock.h: Added hitTestChildren new virtual method. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::hitTestChildren): Implemented. (WebCore::RenderFlexibleBox::layoutFlexItems): Cache the reverse of the order iterator to be used by hit testing. * rendering/RenderFlexibleBox.h: Added hitTestChildren. 2020-06-29 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer] imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-immediately.https.html is a flaky crash https://bugs.webkit.org/show_bug.cgi?id=213385 Reviewed by Philippe Normand. Add a way to release the decryption resources when the player private is destroyed. That way we can release the secure memory allocated by libgcrypt and allow for more tests to get, which caused the crash. Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-immediately.https.html. * platform/encryptedmedia/CDMProxy.h: (WebCore::CDMProxy::releaseDecryptionResources): (WebCore::CDMInstanceSessionProxy::releaseDecryptionResources): (WebCore::CDMInstanceProxy::releaseDecryptionResources): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): * platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp: (WebCore::CDMProxyClearKey::~CDMProxyClearKey): (WebCore::CDMProxyClearKey::releaseDecryptionResources): (WebCore::CDMProxyClearKey::closeGCryptHandle): * platform/graphics/gstreamer/eme/CDMProxyClearKey.h: 2020-06-29 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Rename MediaSourceGStreamer to MediaSourcePrivateGStreamer https://bugs.webkit.org/show_bug.cgi?id=213722 Reviewed by Xabier Rodriguez-Calvar. It's about time to remove this FIXME: // FIXME: Should this be called MediaSourcePrivateGStreamer? Yes, it should. Because it's a MediaSourcePrivate, and that is an important fact. The MSE class diagram is confusing enough already, let's fix this. To rebase commits after this change use `git format-patch` first to get them in a patch format and then run: sed -i 's|\<MediaSourceGStreamer\>|MediaSourcePrivateGStreamer|g' *.patch This patch is a refactor that produces no behavior changes. * platform/GStreamer.cmake: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::sourceSetup): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h: * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp. (WebCore::MediaSourcePrivateGStreamer::open): (WebCore::MediaSourcePrivateGStreamer::MediaSourcePrivateGStreamer): (WebCore::MediaSourcePrivateGStreamer::~MediaSourcePrivateGStreamer): (WebCore::MediaSourcePrivateGStreamer::addSourceBuffer): (WebCore::MediaSourcePrivateGStreamer::removeSourceBuffer): (WebCore::MediaSourcePrivateGStreamer::durationChanged): (WebCore::MediaSourcePrivateGStreamer::markEndOfStream): (WebCore::MediaSourcePrivateGStreamer::unmarkEndOfStream): (WebCore::MediaSourcePrivateGStreamer::readyState const): (WebCore::MediaSourcePrivateGStreamer::setReadyState): (WebCore::MediaSourcePrivateGStreamer::waitForSeekCompleted): (WebCore::MediaSourcePrivateGStreamer::seekCompleted): (WebCore::MediaSourcePrivateGStreamer::sourceBufferPrivateDidChangeActiveState): (WebCore::MediaSourcePrivateGStreamer::buffered): (WebCore::MediaSourcePrivateGStreamer::logChannel const): * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceGStreamer.h. * platform/graphics/gstreamer/mse/PlaybackPipeline.h: * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::create): (WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: 2020-06-29 Youenn Fablet <youenn@apple.com> RTCDataChannel.bufferedAmount should stay the same even if channel is closed https://bugs.webkit.org/show_bug.cgi?id=213698 Reviewed by Darin Adler. bufferedAmount was set back to zero when closing. Instead, we should keep the value in RTCDataChannel and update it either when sending data or being notified or some data getting sent. Test: webrtc/datachannel/bufferedAmount-afterClose.html * Modules/mediastream/RTCDataChannel.cpp: (WebCore::RTCDataChannel::bufferedAmountIsDecreasing): * platform/mock/RTCDataChannelHandlerMock.h: 2020-06-29 Antti Koivisto <antti@apple.com> checked overflow in WebCore::findClosestFont https://bugs.webkit.org/show_bug.cgi?id=213719 <rdar://47765225> Reviewed by David Kilzer. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::findClosestFont): If indexOfBestCapabilities doesn't find anything it returns notFound and indexing to the vector overflows. 2020-06-29 David Kilzer <ddkilzer@apple.com> REGRESSION (r262776): Leak of NSMutableURLRequest in -[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:] <https://webkit.org/b/213690> <rdar://problem/64853619> Reviewed by Anders Carlsson. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]): - Use RetainPtr<> for the mutable copy and autorelease the return value. 2020-06-29 Youenn Fablet <youenn@apple.com> MediaRecorder.start() Method is Ignoring the "timeslice" Parameter https://bugs.webkit.org/show_bug.cgi?id=202233 <rdar://problem/55720555> Reviewed by Eric Carlson. Use a timer to implement timeSlice parameter. Schedule timer either when start is called or as part of requestData callback. This should ensure that, if requestData is called by the application, the timer will be rescheduled appropriately. Test: http/wpt/mediarecorder/MediaRecorder-start-timeSlice.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): (WebCore::MediaRecorder::requestData): * Modules/mediarecorder/MediaRecorder.h: 2020-06-29 Rob Buis <rbuis@igalia.com> window.location.replace with invalid urls should throw https://bugs.webkit.org/show_bug.cgi?id=153121 Reviewed by Darin Adler. Throw SyntaxError if the url resulting from the location.replace operation is not valid. Behavior matches Firefox and Chrome. Tests: imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location_replace.html [1] https://html.spec.whatwg.org/multipage/history.html#dom-location-replace * page/Location.cpp: (WebCore::Location::replace): * page/Location.h: * page/Location.idl: 2020-06-28 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Adjust table content vertical position to match vertical-align https://bugs.webkit.org/show_bug.cgi?id=213692 Reviewed by Antti Koivisto. Child boxes (and runs) are always in the coordinate system of the containing block's border box. The content box (where the child content lives) is inside the padding box, which is inside the border box. In order to compute the child box top/left position, we need to know both the padding and the border offsets. <div style="border: 2px solid green; padding-top: 10px;"><div></div></div> The inner div's top left position is at [12px, 2px] (let's ignore margin collapsing for now). Normally by the time we start positioning the child content, we already have computed borders and paddings for the containing block. This is different with table cells where the final padding offset depends on the content height as we use the padding box to vertically align the table cell content. Let's adjust the child boxes and runs to match the new content box position. Test: fast/layoutformattingcontext/table-cell-vertical-alignment-simple.html * layout/displaytree/DisplayLineBox.h: (WebCore::Display::LineBox::moveVertically): * layout/displaytree/DisplayRun.h: (WebCore::Display::Run::moveVertically): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): 2020-06-28 Zalan Bujtas <zalan@apple.com> [LFC][Painting] Use the table section as the paint container for table cells https://bugs.webkit.org/show_bug.cgi?id=213693 Reviewed by Antti Koivisto. The cell's containing block is the table box (skipping both the row and the section), but it's positioned relative to the table section. Let's skip the row and go right to the section box when painting the cells. * layout/displaytree/DisplayPainter.cpp: (WebCore::Display::absoluteDisplayBox): 2020-06-28 Alexey Shvayka <shvaikalesh@gmail.com> Improve error message for primitive callback interfaces https://bugs.webkit.org/show_bug.cgi?id=213684 Reviewed by Darin Adler. This patch rewords TypeError message for non-object callback interfaces because apart from function, an object with certain method is also allowed. New error message matches Chrome and Firefox. Tests: fast/dom/createNodeIterator-parameters.html fast/dom/createTreeWalker-parameters.html * bindings/js/JSDOMExceptionHandling.cpp: (WebCore::throwArgumentMustBeObjectError): * bindings/js/JSDOMExceptionHandling.h: * bindings/scripts/CodeGeneratorJS.pm: (GetArgumentExceptionFunction): * bindings/scripts/test/*: Updated. 2020-06-28 Rob Buis <rbuis@igalia.com> Setting url.search="??" (two questionmarks) has incorrect behavior https://bugs.webkit.org/show_bug.cgi?id=170452 Reviewed by Darin Adler. There is no need to strip leading "?" character since URLParser expects it to be there. This differs from the specification algorithm [1], which relies on state override, which URLParser does not support. Behavior matches Firefox and Chrome. Test: imported/w3c/web-platform-tests/url/url-setters.html [1] https://url.spec.whatwg.org/#dom-url-search * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setSearch): 2020-06-28 Geoffrey Garen <ggaren@apple.com> Rename initializeThreading to initialize https://bugs.webkit.org/show_bug.cgi?id=213674 Reviewed by Mark Lam. * Modules/webdatabase/DatabaseManager.cpp: (WebCore::DatabaseManager::openDatabase): * WebCore.order: * bindings/js/CommonVM.cpp: (WebCore::commonVMSlow): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::initializeMainThread): (WebCore::ScriptController::initializeThreading): Deleted. * bindings/js/ScriptController.h: * bridge/objc/WebScriptObject.mm: (+[WebScriptObject initialize]): * platform/cocoa/SharedBufferCocoa.mm: (+[WebCoreSharedBufferData initialize]): * platform/ios/wak/WebCoreThread.mm: (RunWebThread): 2020-06-28 Youenn Fablet <youenn@apple.com> MediaRecorder stopRecorder() returns empty Blob after first use https://bugs.webkit.org/show_bug.cgi?id=212274 <rdar://problem/63601298> Reviewed by Eric Carlson. Refactor code to create/destroy MediaRecorderPrivate on MediaRecorder start/stop. This allows reusing a MediaRecorder after a stop and restarting with a clean state. We introduce MediaRecorderPrivate::startRecording to do the initialization, which allows to fix a potential ref cycle as part of the error callback handling. Make some improvements to the platform implementation, in particular add default initialization to all fields. Align the code using AudioConverterRef to what is done in AudioSampleDataSource. Also call VTCompressionSessionInvalidate when destroying the VideoSampleBufferCompressor. Test: http/wpt/mediarecorder/MediaRecorder-multiple-start-stop.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::requestData): * Modules/mediarecorder/MediaRecorder.h: * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::fetchData): * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::startRecording): * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded): (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount): (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets): (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::stopRecording): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor): 2020-06-27 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Replaced inline boxes sit on the baseline with their margins https://bugs.webkit.org/show_bug.cgi?id=213679 Reviewed by Antti Koivisto. Take the margin box into account when computing the top position of a baseline aligned replaced inline box. Test: fast/layoutformattingcontext/replaced-box-with-margin-on-baseline.html * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::alignContentVertically): 2020-06-27 Mark Lam <mark.lam@apple.com> Fix missing exception check in createIDBKeyFromValue(). https://bugs.webkit.org/show_bug.cgi?id=213681 <rdar://problem/64804893> Reviewed by Chris Dumez. Test: storage/indexeddb/missing-exception-check-in-IDBKey.html Also fixed up miscellaneous other exception check related code to enable the new test to run with exception check validation. * bindings/js/IDBBindingUtilities.cpp: (WebCore::createIDBKeyFromValue): * bindings/js/JSDOMBindingSecurity.cpp: (WebCore::BindingSecurity::shouldAllowAccessToDOMWindow): * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::updateDocument): * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::put): (WebCore::JSDOMWindow::defineOwnProperty): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::initScriptForWindowProxy): * bindings/scripts/CodeGeneratorJS.pm: (GenerateAttributeGetterBodyDefinition): (GenerateAttributeSetterBodyDefinition): (GenerateOperationBodyDefinition): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::jsTestActiveDOMObjectExcitingAttrGetter): (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunctionBody): (WebCore::jsTestActiveDOMObjectPrototypeFunctionOverloadedMethodOverloadDispatcher): * bridge/objc/WebScriptObject.mm: (-[WebScriptObject _isSafeScript]): * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::injectInternalsObject): 2020-06-27 Jer Noble <jer.noble@apple.com> iOS Safari incorrectly reports "AppleCoreMedia" as UA string https://bugs.webkit.org/show_bug.cgi?id=213245 <rdar://problem/64471582> Reviewed by Youenn Fablet. Tests: TestWebKitAPI.MediaLoading.UserAgentStringCRABS TestWebKitAPI.MediaLoading.UserAgentStringHLS * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]): 2020-06-27 Rob Buis <rbuis@igalia.com> Require <form> to be connected https://bugs.webkit.org/show_bug.cgi?id=177356 Reviewed by Sam Weinig. Implement step 1 of [1], i.e. do not submit form if it is not connected. Test: imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/submission-checks.html [1] https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-form-submit * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::submit): 2020-06-27 Youenn Fablet <youenn@apple.com> Log capture device information in case of getUserMedia failing to select a device https://bugs.webkit.org/show_bug.cgi?id=213643 Reviewed by Eric Carlson. Log constraints and device in case of a failing getUserMedia call. No obserable change, logging addition. * platform/mediastream/mac/CoreAudioCaptureDevice.cpp: (WebCore::getDeviceInfo): (WebCore::CoreAudioCaptureDevice::deviceClock): * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: (WebCore::isValidCaptureDevice): * platform/mediastream/MediaConstraints.cpp: (WebCore::MediaConstraint::log const): (WebCore::BooleanConstraint::logAsBoolean const): (WebCore::DoubleConstraint::logAsDouble const): (WebCore::IntConstraint::logAsInt const): * platform/mediastream/MediaConstraints.h: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): (WebCore::RealtimeMediaSource::selectSettings): * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): * platform/mediastream/RealtimeVideoCaptureSource.cpp: (WebCore::RealtimeVideoCaptureSource::bestSupportedSizeAndFrameRate): * platform/mediastream/VideoPreset.h: (WebCore::VideoPreset::log const): 2020-06-27 Youenn Fablet <youenn@apple.com> Protect SWServer::claim from a registration without active worker https://bugs.webkit.org/show_bug.cgi?id=213597 Reviewed by Chris Dumez. SWServerWorker might be active while being terminated. If terminated as part of SWServerRegistration::clear, the registration no longer has a service worker. SWServer::claim should therefore check for registration active worker. This is difficult to test as one needs to claim at the time the service worker is being terminated but not yet terminated. * workers/service/server/SWServer.cpp: (WebCore::SWServer::claim): 2020-06-27 Sam Weinig <weinig@apple.com> Convert SVG related parsers over to using StringParsingBuffer https://bugs.webkit.org/show_bug.cgi?id=213635 Reviewed by Darin Adler. - Adopt StringParsingBuffer across SVG code. - Remove UTF-16 upconversions in SVGAnimationElement, SVGFitToViewBox, SVGLengthList, SVGLengthValue, SVGNumberList, SVGParserUtilities, SVGPointList, SVGPreserveAspectRatioValue, SVGStringList, SVGTransformList, SVGTransformable and SVGViewSpec. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: Export ParsingUtilities.h, which is now included by SVGParserUtilities.h * Sources.txt: Add implementation files for SVGLengthList, SVGNumberList, SVGPointList, SVGStringList and SVGTransformList to hold large functions are unlikely to benefit from inlining. * html/parser/ParsingUtilities.h: (WebCore::skipCharactersExactly): Add new skipCharactersExactly, which takes a c-array (NOT null-terminated) of characters to compare against. * svg/SVGAngleValue.cpp: (WebCore::parseAngleType): (WebCore::SVGAngleValue::setValueAsString): Adopt StringParsingBuffer. * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::parseAttribute): Adapt to new shared parseTransformType, which now returns an Optional and default to SVG_TRANSFORM_UNKNOWN on parse failure as the old parseTransformType did. * svg/SVGAnimationElement.cpp: (WebCore::parseKeySplines): Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters() * svg/SVGFitToViewBox.cpp: (WebCore::SVGFitToViewBox::parseViewBox): (WebCore::SVGFitToViewBox::parseViewBoxGeneric): * svg/SVGFitToViewBox.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters() * svg/SVGLengthList.cpp: Added. (WebCore::SVGLengthList::parse): (WebCore::SVGLengthList::valueAsString const): * svg/SVGLengthList.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Move parse and valueAsString out of line. * svg/SVGLengthValue.cpp: (WebCore::parseLengthType): (WebCore::SVGLengthValue::construct): (WebCore::SVGLengthValue::setValueAsString): * svg/SVGLengthValue.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters() * svg/SVGNumberList.cpp: Added. (WebCore::SVGNumberList::parse): (WebCore::SVGNumberList::valueAsString const): * svg/SVGNumberList.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Move parse and valueAsString out of line. * svg/SVGParserUtilities.cpp: (WebCore::genericParseNumber): (WebCore::parseNumber): (WebCore::genericParseArcFlag): (WebCore::parseArcFlag): (WebCore::parseNumberOptionalNumber): (WebCore::parsePoint): (WebCore::parseRect): (WebCore::parseGlyphName): (WebCore::parseUnicodeRange): (WebCore::parseKerningUnicodeString): (WebCore::genericParseFloatPoint): (WebCore::parseFloatPoint): * svg/SVGParserUtilities.h: (WebCore::isSVGSpaceOrComma): (WebCore::skipOptionalSVGSpaces): (WebCore::skipOptionalSVGSpacesOrDelimiter): (WebCore::skipString): Deleted. Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Move parse and valueAsString out of line. * svg/SVGPathSource.h: Add missing include, which is now needed do to removing unncessary includes in other files. * svg/SVGPathStringSource.cpp: (WebCore::SVGPathStringSource::SVGPathStringSource): (WebCore::SVGPathStringSource::hasMoreData const): (WebCore::SVGPathStringSource::moveToNextToken): (WebCore::nextCommandHelper): (WebCore::SVGPathStringSource::nextCommand): (WebCore::SVGPathStringSource::parse): (WebCore::SVGPathStringSource::parseSVGSegmentType): (WebCore::SVGPathStringSource::parseMoveToSegment): (WebCore::SVGPathStringSource::parseLineToSegment): (WebCore::SVGPathStringSource::parseLineToHorizontalSegment): (WebCore::SVGPathStringSource::parseLineToVerticalSegment): (WebCore::SVGPathStringSource::parseCurveToCubicSegment): (WebCore::SVGPathStringSource::parseCurveToCubicSmoothSegment): (WebCore::SVGPathStringSource::parseCurveToQuadraticSegment): (WebCore::SVGPathStringSource::parseCurveToQuadraticSmoothSegment): (WebCore::SVGPathStringSource::parseArcToSegment): (WebCore::parseSVGSegmentTypeHelper): Deleted. * svg/SVGPathStringSource.h: Adopt StringParsingBuffer. Replace existing set of unions with a single union of StringParsingBuffers. * svg/SVGPointList.cpp: Added. (WebCore::SVGPointList::parse): (WebCore::SVGPointList::valueAsString const): * svg/SVGPointList.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Move parse and valueAsString out of line. * svg/SVGPreserveAspectRatioValue.cpp: (WebCore::SVGPreserveAspectRatioValue::SVGPreserveAspectRatioValue): (WebCore::SVGPreserveAspectRatioValue::parse): (WebCore::SVGPreserveAspectRatioValue::parseInternal): (WebCore::SVGPreserveAspectRatioValue::valueAsString const): * svg/SVGPreserveAspectRatioValue.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). * svg/SVGStringList.cpp: Added. (WebCore::SVGStringList::parse): (WebCore::SVGStringList::valueAsString const): * svg/SVGStringList.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Move parse and valueAsString out of line. * svg/SVGTransformList.cpp: Added. (WebCore::SVGTransformList::consolidate): (WebCore::SVGTransformList::concatenate const): (WebCore::SVGTransformList::parseGeneric): (WebCore::SVGTransformList::parse): (WebCore::SVGTransformList::valueAsString const): * svg/SVGTransformList.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Move parse, valueAsString, consolidate and concatenate out of line. * svg/SVGTransformable.cpp: (WebCore::parseTransformParamList): (WebCore::parseTransformValueGeneric): (WebCore::SVGTransformable::parseTransformValue): (WebCore::parseTransformTypeGeneric): (WebCore::SVGTransformable::parseTransformType): (WebCore::SVGTransformable::parseAndSkipType): Deleted. * svg/SVGTransformable.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Unify parseTransformType implementations to all use a single implementation and return an Optional<SVGTransformType>. * svg/SVGViewSpec.cpp: (WebCore::SVGViewSpec::parseViewSpec): * svg/SVGViewSpec.h: Adopt StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). * svg/SVGZoomAndPan.cpp: (WebCore::parseZoomAndPanGeneric): (WebCore::SVGZoomAndPan::parseZoomAndPan): * svg/SVGZoomAndPan.h: Adopt StringParsingBuffer. 2020-06-26 Jer Noble <jer.noble@apple.com> CRASH: incompatible downcast<> operation in SourceBufferPrivateAVFObjC::setCDMInstance() https://bugs.webkit.org/show_bug.cgi?id=213660 <rdar://problem/63831593> Reviewed by Eric Carlson. Test: platform/mac/media/encrypted-media/fps-clearkey-crash.html * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance): 2020-06-26 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Add support for <center> https://bugs.webkit.org/show_bug.cgi?id=213649 Reviewed by Antti Koivisto. Adjust the margin box to center the block content (this is very similar to [style="margin-left: auto; margin-right: auto;"]). Test: fast/layoutformattingcontext/center-alignment-with-block-content-simple.html * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): 2020-06-26 Jason Lawrence <lawrence.j@apple.com> Unreviewed, reverting r263511, r263514, and r263565. r263511 caused MediaRecorder test crashes on internal testers. Reverted changesets: "MediaRecorder stopRecorder() returns empty Blob after first use" https://bugs.webkit.org/show_bug.cgi?id=212274 https://trac.webkit.org/changeset/263511 "Unreviewed iOS build fix after r263511." https://trac.webkit.org/changeset/263514 "MediaRecorder.start() Method is Ignoring the "timeslice" Parameter" https://bugs.webkit.org/show_bug.cgi?id=202233 https://trac.webkit.org/changeset/263565 2020-06-26 Sam Weinig <weinig@apple.com> Convert ContentSecurityPolicy related parsers over to using StringParsingBuffer https://bugs.webkit.org/show_bug.cgi?id=213631 Reviewed by Darin Adler. - Adopt StringParsingBuffer across CSP code. - Remove UTF-16 upconversions in ContentSecurityPolicy, ContentSecurityPolicyDirectiveList, ContentSecurityPolicyMediaListDirective and ContentSecurityPolicySourceList. * html/parser/ParsingUtilities.h: (WebCore::isNotASCIISpace): (WebCore::skipExactly): (WebCore::characterPredicate): (WebCore::skipUntil): (WebCore::skipExactlyIgnoringASCIICase): Add overloads for each helper that take a StringParsingBuffer. * loader/ResourceCryptographicDigest.cpp: (WebCore::parseHashAlgorithmAdvancingPosition): Convert to use an Optional return value rather than outparameter + bool. (WebCore::parseCryptographicDigestImpl): (WebCore::parseCryptographicDigest): (WebCore::parseEncodedCryptographicDigestImpl): (WebCore::parseEncodedCryptographicDigest): * loader/ResourceCryptographicDigest.h: Use StringParsingBuffer rather than raw pointers for parsing. * loader/SubresourceIntegrity.cpp: (WebCore::splitOnSpaces): (WebCore::parseIntegrityMetadata): Use StringParsingBuffer and readCharactersForParsing rather than raw pointers for parsing. * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::didReceiveHeader): Use StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). * page/csp/ContentSecurityPolicyDirectiveList.cpp: (WebCore::isDirectiveNameCharacter): (WebCore::isDirectiveValueCharacter): (WebCore::ContentSecurityPolicyDirectiveList::parse): (WebCore::ContentSecurityPolicyDirectiveList::parseDirective): (WebCore::ContentSecurityPolicyDirectiveList::parseReportURI): (WebCore::ContentSecurityPolicyDirectiveList::setCSPDirective): (WebCore::ContentSecurityPolicyDirectiveList::applySandboxPolicy): (WebCore::ContentSecurityPolicyDirectiveList::setUpgradeInsecureRequests): (WebCore::ContentSecurityPolicyDirectiveList::setBlockAllMixedContentEnabled): (WebCore::ContentSecurityPolicyDirectiveList::addDirective): * page/csp/ContentSecurityPolicyDirectiveList.h: Use StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Also switch to using Optional for return values rather than outparameter + bool. To make things read more cleanly, package up name and value pair into a new ParsedDirective struct that can be passed around more easily. * page/csp/ContentSecurityPolicyMediaListDirective.cpp: (WebCore::isMediaTypeCharacter): (WebCore::ContentSecurityPolicyMediaListDirective::parse): Use StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::isSourceCharacter): (WebCore::isHostCharacter): (WebCore::isPathComponentCharacter): (WebCore::isSchemeContinuationCharacter): (WebCore::isNotColonOrSlash): (WebCore::isSourceListNone): (WebCore::ContentSecurityPolicySourceList::parse): (WebCore::ContentSecurityPolicySourceList::parseSource): (WebCore::ContentSecurityPolicySourceList::parseScheme): (WebCore::ContentSecurityPolicySourceList::parseHost): (WebCore::ContentSecurityPolicySourceList::parsePath): (WebCore::ContentSecurityPolicySourceList::parsePort): (WebCore::isNonceCharacter): (WebCore::ContentSecurityPolicySourceList::parseNonceSource): (WebCore::ContentSecurityPolicySourceList::parseHashSource): * page/csp/ContentSecurityPolicySourceList.h: Use StringParsingBuffer and readCharactersForParsing to replace unnecessary call to StringView::upconvertedCharacters(). Also switch to using Optional for return values rather than outparameter + bool. To make things read more cleanly, package up source return values into structs that can be more easily returned / passed around. 2020-06-26 Simon Fraser <simon.fraser@apple.com> Content sometimes missing in nested scrollers with border-radius https://bugs.webkit.org/show_bug.cgi?id=213580 <rdar://problem/64460373> Reviewed by Zalan Bujtas. RenderLayer::clipToRect() has a special case for clips involving border-radius, involving an ancestor tree walk which applies the rounded clips. When inside composited overflow, don't include the border-radius from the scroller since that does its own clipping. Test: compositing/clipping/nested-overflow-with-border-radius.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::clipToRect): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: 2020-06-26 Geoffrey Garen <ggaren@apple.com> Initializing the main thread should initialize the main run loop https://bugs.webkit.org/show_bug.cgi?id=213637 Reviewed by Anders Carlsson. * platform/ios/wak/WebCoreThread.mm: (RunWebThread): Removed call to initializeMainThread() because the main thread calls it before starting the web thread, so it's a no-op. (And if it were an op, it would be broken.) (StartWebThread): Merged RunLoop::initializeMain and initializeThreading into initializeMainThread. 2020-06-26 Andres Gonzalez <andresg_22@apple.com> Fix for crash in AXIsolatedObject::relativeFrame. https://bugs.webkit.org/show_bug.cgi?id=213363 Reviewed by Chris Fleizach. Covered by existing testss. Between the time an isolated object dispatches the method to the main thread and the time the lambda is executed, the isolated object is detached and hence its object ID becomes invalid. Thus, trying to get the associated AX object results in an assert/crash. * accessibility/isolatedtree/AXIsolatedObject.h: 2020-06-26 Andres Gonzalez <andresg_22@apple.com> Access to AXIsolatedTree:m_readerThreadNodeMap should happen only on the secondary AX thread. https://bugs.webkit.org/show_bug.cgi?id=213575 Reviewed by Chris Fleizach. After calling AXObjectCache::initializeSecondaryAXThread, there may still be some client requests coming in on the main thread. Thus AXIsolatedTree::applyPendingchanges and nodeForID can be called on the main thread. Since these two methods access the member variable m_readerThreadNodeMap which should be accessed only on the secondary AX thread, we now check for this condition and bail out if needed. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::applyPendingChanges): * accessibility/isolatedtree/AXIsolatedTree.h: Reordered private methods above member variables to comply with WebKit coding conventions, pointed out by Darin Adler in review for https://bugs.webkit.org/show_bug.cgi?id=213435. 2020-06-26 Andres Gonzalez <andresg_22@apple.com> Fix for crash in accessibility/roles-exposed.html in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=213648 Reviewed by Chris Fleizach. LayoutTest: accessibility/roles-exposed.html. - In layout tests, when AXObjectCache::notificationPostTimerFired is triggered, and we try to update the isolated tree, some of the underlying objects may already be gone. So this change ensure we don't try to update an isolated object that corresponds to an already detached live object. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::cacheAndInitializeWrapper): Sanity check. * accessibility/AccessibilityListBox.cpp: (WebCore::AccessibilityListBox::addChildren): m_renderer can be null when trying to update the isolated tree. * accessibility/AccessibilityListBoxOption.cpp: (WebCore::AccessibilityListBoxOption::computeAccessibilityIsIgnored const): Parent object may be gone when trying to update the isolated tree. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateChildrenIDs): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::updateChildren): 2020-06-26 Youenn Fablet <youenn@apple.com> MediaRecorder.start() Method is Ignoring the "timeslice" Parameter https://bugs.webkit.org/show_bug.cgi?id=202233 <rdar://problem/55720555> Reviewed by Eric Carlson. Use a timer to implement timeSlice parameter. Schedule timer either when start is called or as part of requestData callback. This should ensure that, if requestData is called by the application, the timer will be rescheduled appropriately. Test: http/wpt/mediarecorder/MediaRecorder-start-timeSlice.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): (WebCore::MediaRecorder::requestData): * Modules/mediarecorder/MediaRecorder.h: 2020-06-26 Jack Lee <shihchieh_lee@apple.com> ASSERTION FAILED: (it != m_map.end()) in TreeScopeOrderedMap::remove https://bugs.webkit.org/show_bug.cgi?id=213611 <rdar://problem/64493506> Reviewed by Geoffrey Garen. In function HTMLImageElement::parseAttribute(), empty name attribute is considered valid which makes the function skip handling of subsequent name changes. Modified the check of name attribute so only non-empty name is considered valid. This code change is to match <https://trac.webkit.org/changeset/262360>. Test: fast/images/img-change-name-assert.html * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): 2020-06-26 Sihui Liu <sihui_liu@apple.com> Text manipulation should observe adjacent elements with new renderer together https://bugs.webkit.org/show_bug.cgi?id=213333 Reviewed by Geoffrey Garen. TextManipulationController only keeps track of manipulated Elements. For other types of Node, like Text, TextManipulationController does not mark them as manipulated and may manipulate it again. r263132 tried to solve the problem by marking Element with only manipulated children as manipulated, but it did not iterate all children of Element. So, if one Element has children in different paragraphs, it may fail to mark the Element manipulated. See updated test. To fix this issue completely, TextManipulationController now tracks all manipulated Nodes, so it can skip the manipulated Nodes during observation. For elements with new renderer, TextManipulationController observes them one by one. However, adjacent elements can be in the same paragraph, if there is no delimiter in their text, and should be observed together. To solve this problem, TextManipulationController now starts observing from the common ancestor of these elements. If a Node in range is manipulated, split the paragrph there. This makes sure content in paragraph is not manipulated. Relevant test is updated for this new behavior. Tests: TextManipulation.StartTextManipulationFindNewlyDisplayedParagraph TextManipulation.CompleteTextManipulationAvoidExtractingManipulatedTextAfterManipulation * dom/Node.cpp: (WebCore::Node::~Node): * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::observeParagraphs): (WebCore::TextManipulationController::didCreateRendererForElement): (WebCore::TextManipulationController::scheduleObservationUpdate): (WebCore::TextManipulationController::updateInsertions): (WebCore::TextManipulationController::replace): (WebCore::TextManipulationController::removeNode): (WebCore::makePositionTuple): Deleted. (WebCore::makeHashablePositionRange): Deleted. * editing/TextManipulationController.h: 2020-06-26 Simon Fraser <simon.fraser@apple.com> Clean up some PaintBehavior-related code in RenderLayer https://bugs.webkit.org/show_bug.cgi?id=213634 Reviewed by Sam Weinig. Move the computation of paintBehavior into a lambda, and share the flags between normal painting and mask painting. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: 2020-06-26 Alicia Boya García <aboya@igalia.com> [GStreamer] Initialize m_currentState and m_oldState https://bugs.webkit.org/show_bug.cgi?id=213604 Reviewed by Eric Carlson. MediaPlayerPrivateGStreamer was not initializing m_currentState and m_oldState, causing them to be checked e.g. updateStates() while they still contain garbage. Because the biggest uninitialized usage is a != comparison, in practice things still worked, but that's still a bug. I detected the bug after seeing this in the logs: playbin3SendSelectStreamsIfAppropriate:<media-player-0> Checking if to send SELECT_STREAMS, m_waitingForStreamsSelectedEvent = false, haveDifferentStreamIds = false, m_currentState = UNKNOWN!(-8421505)... shouldSendSelectStreams = false This patch fixes a slight memory error which doesn't alter TestExpectations. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 2020-06-25 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r263537. https://bugs.webkit.org/show_bug.cgi?id=213640 Broke watchOS and tvOS builds Reverted changeset: "iOS Safari incorrectly reports "AppleCoreMedia" as UA string" https://bugs.webkit.org/show_bug.cgi?id=213245 https://trac.webkit.org/changeset/263537 2020-06-25 Zalan Bujtas <zalan@apple.com> [Inline] Overlapping content when margin-right is present https://bugs.webkit.org/show_bug.cgi?id=213629 <rdar://problem/64391403> Reviewed by Simon Fraser. 1. computeInlineDirectionPositionsForSegment loops through the Bidi runs and computes their logical widths. 2. Text measuring needs the current logical left position in order to compute the run width properly (e.g tab size) 3. The current logical left includes margins, boders and paddings (e.g <span style="margin: 100px;">text content</span> 'text content' starts at 100px -ignore the line offset for now) 4. The BiDi loop jumps over empty inline containers (e.g. text<span style="border: 10px solid green"></span>content) and it lacks the information to be able to resolve nested inline containers. This patch pre-computes the spacing offset for each InlineTextBox so that we could use it later to compute the logical left position for the text measuring. <span style="margin-right: 1px">[1]<span style="margin: 2px">[2]</span>[3]</span>[4] [1] -> 0px offset [2] -> 2px offset [3] -> 4px offset [4] -> 5px offset Test: fast/inline/incorrect-tab-position.html * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::computeInlineDirectionPositionsForSegment): 2020-06-25 Alex Christensen <achristensen@webkit.org> REGRESSION(r256166, r260596) WKNavigationAction.request.allHTTPHeaderFields needs to contain User-Agent and Accept https://bugs.webkit.org/show_bug.cgi?id=213626 <rdar://problem/62374208> Reviewed by Darin Adler. Those two revisions seemed to just subtly move things around, but they caused API-breaking changes that caused real problems. This effectively reverts the parts of those changes that caused the breakages. * loader/FrameLoader.cpp: (WebCore::FrameLoader::addExtraFieldsToRequest): * loader/cache/CachedResourceRequest.cpp: (WebCore::CachedResourceRequest::acceptHeaderValueFromType): (WebCore::acceptHeaderValueFromType): Deleted. * loader/cache/CachedResourceRequest.h: 2020-06-25 Simon Fraser <simon.fraser@apple.com> Convert the PaintLayerFlag enum to an enum class https://bugs.webkit.org/show_bug.cgi?id=213624 Reviewed by Zalan Bujtas. Convert enum PaintLayerFlag to an enum class. * html/shadow/MediaControlTextTrackContainerElement.cpp: (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paint): (WebCore::RenderLayer::paintOverlayScrollbars): (WebCore::paintForFixedRootBackground): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerWithEffects): (WebCore::RenderLayer::paintLayerContentsAndReflection): (WebCore::RenderLayer::filtersForPainting const): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::updatePaintingInfoForFragments): (WebCore::RenderLayer::paintTransformedLayerIntoFragments): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintFlagsForLayer const): * rendering/RenderReplica.cpp: (WebCore::RenderReplica::paint): 2020-06-25 Daniel Bates <dabates@apple.com> [iOS] Event region briefly missing editable element after typing second character in question field on discussions.apple.com https://bugs.webkit.org/show_bug.cgi?id=213618 <rdar://problem/62656131> Reviewed by Simon Fraser. Ensure the event region is updated for the foreground layer, if there is one. The foreground layer paints into a different backing and so will not be included in normal layer paint (i.e. RenderLayer::paintLayer() will bail out). A "z-index: -1" can create such a layer. An element with "z-index: -1" is above the background, but below other content. Although the original reported bug was only concerned about the editable region the fix is applicable to all regions tracked by EventRegion. I included a test for touch-action region too. Tests: editing/editable-region/text-field-inside-composited-negative-z-index-layer.html pointerevents/ios/touch-action-none-relative-inside-composited-negative-z-index-layer.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateEventRegion): 2020-06-25 Jer Noble <jer.noble@apple.com> iOS Safari incorrectly reports "AppleCoreMedia" as UA string https://bugs.webkit.org/show_bug.cgi?id=213245 <rdar://problem/64471582> Reviewed by Youenn Fablet. Tests: TestWebKitAPI.MediaLoading.UserAgentStringCRABS TestWebKitAPI.MediaLoading.UserAgentStringHLS * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]): 2020-06-25 Megan Gardner <megan_gardner@apple.com> Unreviewed. Fixing misspellings of 'position'. * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::smartDeleteParagraphSpacers): * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::scrollToOffsetWithoutAnimation): * rendering/line/BreakingContext.h: (WebCore::BreakingContext::handleText): 2020-06-25 Daniel Bates <dabates@apple.com> [iOS] -_requestTextInputContextsInRect cannot find empty Quip spreadsheet title https://bugs.webkit.org/show_bug.cgi?id=213564 <rdar://problem/59355847> Reviewed by Simon Fraser. Special case for a focused editable inline element that has no line box, which is what the Quip spreadsheet title can become if its contents are deleted. The engine optimizes to avoid creating lines and line boxes for empty inlines, hit testing, and painting them. It's complicated to patch all this up with a 100% correct solution without forcing more line box creation. So, just add a special case. * page/Page.cpp: (WebCore::Page::editableElementsInRect const): Add the root editable element of the focused element to the result set if its rect intersects the search rect. Note that its rect can be empty e.g. <span contenteditable="true"></span>. So, I use a new function on FloatRect to perform the intersection test. I also updated the ASSERT() to also use this new function. This was not necessary, but I did it to future the proof this code should hit testing one day return empty inlines. * platform/graphics/FloatRect.cpp: (WebCore::FloatRect::inclusivelyIntersects const): Added. (WebCore::FloatRect::intersects const): While I was in this file I fixed up a comment in this function to be more precise. * platform/graphics/FloatRect.h: 2020-06-25 Wenson Hsieh <wenson_hsieh@apple.com> Unreviewed, fix the macOS 11 build after r263519 * rendering/RenderThemeMac.mm: (WebCore::createAttachmentPlaceholderImage): 2020-06-25 Megan Gardner <megan_gardner@apple.com> Cannot delete last line of Mail Message https://bugs.webkit.org/show_bug.cgi?id=213536 <rdar://problem/63420928> Reviewed by Wenson Hsieh. LayoutTests/editing/deleting/smart-delete-paragraph-005.html The smart paragraph deletion code did not take into account that the previous blank line could be the start of editable content without a paragraph before it. If this was the case, the deletion code backed up too far, and the delete command failed. This case should be handled in the same way that the deleting the last paragraph in editable content is handled, by checking if we are already at the beginning of the editable content when expanding the selection for smart paragraph deletion. * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::smartDeleteParagraphSpacers): 2020-06-25 Wenson Hsieh <wenson_hsieh@apple.com> Text manipulation should exclude text rendered using icon-only fonts https://bugs.webkit.org/show_bug.cgi?id=213446 <rdar://problem/63734298> Reviewed by Myles Maxfield. See below for more details. Test: TextManipulation.StartTextManipulationExcludesTextRenderedAsIcons * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::shouldExcludeNodeBasedOnStyle): (WebCore::TextManipulationController::parse): Augment token exclusion rules so that we're able to exclude certain text nodes from text manipulation, based on their style (more specifically, based on their font family). Ask the text node's primary font if it is likely to be used only for rendering icons, and cache the result in TextManipulationController to avoid running the heuristic an excessive number of times for each font that appears in the document. We currently only run this for the node's primary font when initiating translation, though we may want to change this in the future so that node exclusion is recomputed when the primary font of a node changes. Note that in the case where an icon font fails to load, we won't exclude the text node from translation, since the primary font will be a fallback. This is intentional, since the node would appear in the document as normally rendered text (rather than icons), which should be translated. * editing/TextManipulationController.h: * platform/graphics/Font.cpp: (WebCore::Font::isProbablyOnlyUsedToRenderIcons const): * platform/graphics/Font.h: * platform/graphics/FontPlatformData.cpp: (WebCore::FontPlatformData::familyName const): * platform/graphics/FontPlatformData.h: * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::isProbablyOnlyUsedToRenderIcons const): Add a heuristic to detect whether a platform font should be excluded from text manipulation. For now, we only return true if we suspect that this font is an "icon-only" font (for instance, the "Material Icons" font). We guess that a font is *probably* an icon-only font if the font supports only characters from the basic or PUA unicode planes, and the glyph bounds for the set of supported non-control basic latin characters are all empty. * platform/graphics/cocoa/FontPlatformDataCocoa.mm: (WebCore::FontPlatformData::familyName const): Add a platform `familyName()` helper method on `FontPlatformData`. On Cocoa platforms, this wraps a call to `CTFontCopyFamilyName`. 2020-06-25 Kate Cheney <katherine_cheney@apple.com> App-bound domain service worker registrations should be limited https://bugs.webkit.org/show_bug.cgi?id=213601 <rdar://problem/64717589> Reviewed by Brent Fulgham. Limit number of service worker registrations for app-bound domains. The current proposal is 3, but this could be changed in the future. No new tests, currently TestWebKitAPI is unable to test failed service worker registration (test will timeout). Confirmed behavior manually. * workers/service/server/SWServer.cpp: (WebCore::SWServer::validateRegistrationDomain): 2020-06-25 Wenson Hsieh <wenson_hsieh@apple.com> Upstream macOS 11 additions to RenderThemeMac.mm and ThemeMac.mm https://bugs.webkit.org/show_bug.cgi?id=213608 <rdar://problem/64758299> Reviewed by Darin Adler. Replace WebKitAdditions imports with the imported code. No change in behavior. * css/html.css: (input::-webkit-contacts-auto-fill-button): * platform/mac/ThemeMac.mm: (WebCore::ThemeMac::supportsLargeFormControls): * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::createAttachmentPlaceholderImage): (WebCore::RenderThemeMac::extraDefaultStyleSheet): Deleted. Remove the override for extraDefaultStyleSheet altogether, since this was only used to temporarily hide the new contact AutoFill button appearance from open source WebKit. 2020-06-25 Sergio Villar Senin <svillar@igalia.com> Unreviewed build fix for WebXR enabled non-OpenXR builds. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::Instance::Impl::enumerateApiLayerProperties const): Guard method with USE_OPENXR. (PlatformXR::Instance::Impl::enumerateInstanceExtensionProperties const): Ditto. (PlatformXR::Instance::Impl::Impl): Guard method body with USE_OPENXR. (PlatformXR::Instance::Impl::~Impl): Ditto. 2020-06-25 Chris Dumez <cdumez@apple.com> Unreviewed iOS build fix after r263511. * platform/mediastream/MediaStreamPrivate.h: 2020-06-25 Youenn Fablet <youenn@apple.com> MediaRecorder stopRecorder() returns empty Blob after first use https://bugs.webkit.org/show_bug.cgi?id=212274 <rdar://problem/63601298> Reviewed by Eric Carlson. Refactor code to create/destroy MediaRecorderPrivate on MediaRecorder start/stop. This allows reusing a MediaRecorder after a stop and restarting with a clean state. We introduce MediaRecorderPrivate::startRecording to do the initialization, which allows to fix a potential ref cycle as part of the error callback handling. Make some improvements to the platform implementation, in particular add default initialization to all fields. Align the code using AudioConverterRef to what is done in AudioSampleDataSource. Also call VTCompressionSessionInvalidate when destroying the VideoSampleBufferCompressor. Test: http/wpt/mediarecorder/MediaRecorder-multiple-start-stop.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::startRecording): (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::requestData): * Modules/mediarecorder/MediaRecorder.h: * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::startRecording): * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded): (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount): (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets): (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::stopRecording): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor): 2020-06-25 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Use the flexing value as the base for the available horizontal space distribution https://bugs.webkit.org/show_bug.cgi?id=213599 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-min-max-flex-distribution-simple.html * layout/tableformatting/TableLayout.cpp: (WebCore::Layout::TableFormattingContext::TableLayout::distributedHorizontalSpace): 2020-06-25 Antoine Quint <graouts@webkit.org> REGRESSION (r260360): easing curves are broken on JS-originated animations https://bugs.webkit.org/show_bug.cgi?id=213495 <rdar://problem/64649747> Reviewed by Darin Adler. Prior to Web Animations, there was no way for an animation to set an animation-wide timing function while also setting a per-keyframe timing function. As such GraphicsLayerCA would sometimes decide to set the timing function on keyframes or on the entire CAAnimation. However, we can no longer do this with Web Animations where an animation can set an animation-wide timing function and also keyframe-specific timing functions. In this patch we create CAKeyframeAnimation objects for any animation that has at least two keyframes if Web Animations are enabled, whereas the legacy code path requires at least three keyframes. We allow PlatformCAAnimation::setTimingFunction() to be called in the Web Animations code path only under GraphicsLayerCA::setupAnimation() while leaving the only call sites in place only for the legacy code path. Finally, we modify GraphicsLayerCA::timingFunctionForAnimationValue() to only ever return a keyframe- specific timing function or fall back to a default linear timing function in the Web Animations code path, leaving the function to behave the same way as it used to in the legacy code path. Test: webanimations/accelerated-animation-with-easing.html * platform/animation/TimingFunction.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::isKeyframe): (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): 2020-06-25 Sergio Villar Senin <svillar@igalia.com> Unreviewed, WPE Debug build fix after r263503. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::OpenXRDevice::OpenXRDevice): Use m_instance instead of m_impl->xrInstance(). 2020-06-25 Alicia Boya García <aboya@igalia.com> [GStreamer] Don't invalidate MainThreadNotifier until the streaming threads are joined https://bugs.webkit.org/show_bug.cgi?id=213197 Reviewed by Xabier Rodriguez-Calvar. ~MediaPlayerPrivateGStreamer() used to call m_notifier->invalidate() before setting the pipeline to NULL state. This caused a race where the streaming threads could post a task to the MainThreadNotifier between these two events and cause a crash in ASSERT(m_isValid.load()) -- that is, the notifier was used while invalidated. Fixing this is actually easy. ~MediaPlayerPrivateGStreamer() is always run from the main thread, so no MainThreadNotifier tasks will be run before the destructor is complete. By moving the m_notifier->invalidate() call to after the pipeline has been set to NULL (and therefore all streaming threads torn down) we are ensuring no more taks will be posted, and since the MainThreadNotifier is invalidated by that point, already posted tasks will not be run. The race fixed by this patch is rare and wide-arching, so this patch doesn't introduce TestExpectations changes, but it should avoid further crashes like the ones reported in the Bugzilla issue attached. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): 2020-06-23 Sergio Villar Senin <svillar@igalia.com> [WebXR] Check device orientation support when requesting a reference space https://bugs.webkit.org/show_bug.cgi?id=213519 Reviewed by Carlos Garcia Campos. When requesting a local reference space the specs mandate us to check whether or not the device supports orientation tracking. This was not implemented in the OpenXR backend, so we were unconditionally returning true. The OpenXR devices now properly check whether or not orientation tracking is initialized. We took the chance to refactor a bit the OpenXR backend moving all the device initialization code to the OpenXRDevice class. The current tests already check this functionality. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::referenceSpaceIsSupported const): Call supportsOrientationTracking() on device. * platform/xr/PlatformXR.h: (PlatformXR::Device::supportsOrientationTracking const): Added. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::Instance::enumerateImmersiveXRDevices): Just create the OpenXR device, it will automatically initialize itself. (PlatformXR::OpenXRDevice::OpenXRDevice): Get XrSystem and XrInstance as parametters. (PlatformXR::OpenXRDevice::collectSupportedSessionModes): Moved from Instance::Impl. (PlatformXR::Instance::Impl::collectSupportedSessionModes): Deleted. * platform/xr/openxr/PlatformXROpenXR.h: * testing/WebFakeXRDevice.h: Mark the SimulatedXRDevice as supporting orientation tracking. 2020-06-24 James Savage <james.savage@apple.com> Upstream iPadOS 13.0 multi-window support https://bugs.webkit.org/show_bug.cgi?id=213590 Reviewed by Alexey Proskuryakov. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::doSetup): Always construct a UIWindow using the expected UIWindowScene. (makeWindowFromView): Deleted. 2020-06-24 Wenson Hsieh <wenson_hsieh@apple.com> Running spellcheck on https://developer.apple.com/forums/thread/650317 hangs the web process https://bugs.webkit.org/show_bug.cgi?id=213585 <rdar://problem/64681632> Reviewed by Simon Fraser. In `TextCheckingHelper::findFirstMisspellingOrBadGrammar`, we attempt to find the first misspelled piece of text by iterating over the current paragraph range; when we exhaust the current paragraph range, we try to move on to the next paragraph range by setting the current paragraph range to the start and end of the next paragraph, using `startOfNextParagraph`. However, `startOfNextParagraph` may return the null position in some cases (as seen in this bug, and the associated layout test). This logic isn't robust against this possibility, and will end up looping infinitely in the while loop, since `setStart` and `setEnd` are no-ops when given a null position, and so the current paragraph remains the same. Make this logic for finding the next misspelled word more robust by allowing us to bail out of the while loop in the case where setStart or setEnd failed to advance the paragraph range (e.g. due to a null position, or DOM exception). Test: editing/mac/spelling/advance-to-next-misspelling.html * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): * testing/Internals.cpp: (WebCore::Internals::advanceToNextMisspelling): Add an internal testing hook to advance to the next misspelling. * testing/Internals.h: * testing/Internals.idl: 2020-06-24 David Kilzer <ddkilzer@apple.com> Use ObjectIdentifier<>instead of WebCore::nextPlaybackTargetClientContextId() in Document.cpp <https://webkit.org/b/213546> <rdar://problem/61803576> Reviewed by Youenn Fablet. Switch from uint64_t to WebCore::PlaybackTargetClientContextIdentifier for contextId values. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: - Add PlaybackTargetClientContextIdentifier.h to the project. * Modules/mediasession/PlaybackTargetClientContextIdentifier.h: Add. * Modules/mediasession/WebMediaSessionManager.cpp: (WebCore::ClientState::ClientState): (WebCore::WebMediaSessionLogger::logAlways const): (WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient): (WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient): (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): (WebCore::WebMediaSessionManager::clientStateDidChange): (WebCore::WebMediaSessionManager::find): * Modules/mediasession/WebMediaSessionManager.h: * Modules/mediasession/WebMediaSessionManagerClient.h: * dom/Document.cpp: (WebCore::Document::addPlaybackTargetPickerClient): (WebCore::Document::removePlaybackTargetPickerClient): (WebCore::Document::playbackTargetAvailabilityDidChange): (WebCore::Document::setPlaybackTarget): (WebCore::Document::setShouldPlayToPlaybackTarget): (WebCore::Document::playbackTargetPickerWasDismissed): (WebCore::nextPlaybackTargetClientContextId): Delete. - Replace with PlaybackTargetClientContextIdentifier::generate(). * dom/Document.h: * page/ChromeClient.h: (WebCore::ChromeClient::addPlaybackTargetPickerClient): (WebCore::ChromeClient::removePlaybackTargetPickerClient): (WebCore::ChromeClient::showPlaybackTargetPicker): (WebCore::ChromeClient::playbackTargetPickerClientStateDidChange): * page/Page.cpp: (WebCore::Page::addPlaybackTargetPickerClient): (WebCore::Page::removePlaybackTargetPickerClient): (WebCore::Page::showPlaybackTargetPicker): (WebCore::Page::playbackTargetPickerClientStateDidChange): (WebCore::Page::setPlaybackTarget): (WebCore::Page::playbackTargetAvailabilityDidChange): (WebCore::Page::setShouldPlayToPlaybackTarget): (WebCore::Page::playbackTargetPickerWasDismissed): * page/Page.h: 2020-06-24 Clark Wang <clark_wang@apple.com> Removed unrestricted keyword from attributes in PannerNode https://bugs.webkit.org/show_bug.cgi?id=213523 Updated refDistance, maxDistance, rolloffFactor, coneOuterGain, coneInnerAngle, coneOuterAngle attributes according to spec: https://www.w3.org/TR/webaudio/#PannerNode-attributes. Reviewed by Darin Adler. Test: webaudio/prefixed-pannernode-basic.html * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::setRefDistance): (WebCore::PannerNode::setMaxDistance): (WebCore::PannerNode::setRolloffFactor): (WebCore::PannerNode::setConeOuterGain): * Modules/webaudio/PannerNode.h: * Modules/webaudio/PannerNode.idl: 2020-06-24 Peng Liu <peng.liu6@apple.com> Black rectangle appears when closing PIP on iPhone https://bugs.webkit.org/show_bug.cgi?id=213570 Reviewed by Eric Carlson. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::willStopPictureInPicture): Don't unhide the window and view of WebAVPlayerViewController before exiting Picture-in-Picture. 2020-06-24 Simon Fraser <simon.fraser@apple.com> REGRESSION (r260276): Scrolling through shelves on music.apple.com is not smooth https://bugs.webkit.org/show_bug.cgi?id=213572 Reviewed by Wenson Hsieh. The scroll position for an overflow:scroll element with scroll-snap could jump around during scrolling, if layout triggered a call to ScrollableArea::updateScrollSnapState(). The crux of the issue is that isScrollSnapInProgress() returned false for overflow:scrollers which are scrolling asynchronously. Fix by extending the existing ScrollingTree::isScrollSnapInProgress() to track all scrolling nodes by storing a HashSet<ScrollingNodeID> rather than just a flag for the main frame. RenderLayer::isScrollSnapInProgress() then consults the ScrollingCoordinator, which consults the scrolling tree for this state. Add the ability to test via internals.isScrollSnapInProgress(). Test: fast/scrolling/mac/scroll-snapping-in-progress.html * dom/Document.h: * page/FrameView.cpp: (WebCore::FrameView::isScrollSnapInProgress const): The main thread can run snapping logic even for async-scrollable frames, so consult the ScrollingCoordinator and FrameView's ScrollAnimator. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::isScrollSnapInProgress const): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::isScrollSnapInProgress const): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::isScrollSnapInProgressForNode): (WebCore::ScrollingTree::setNodeScrollSnapInProgress): (WebCore::ScrollingTree::isScrollSnapInProgress): Deleted. (WebCore::ScrollingTree::setMainFrameIsScrollSnapping): Deleted. * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::setScrollSnapInProgress): (WebCore::ScrollingTreeScrollingNode::isScrollSnapInProgress const): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::willStartScrollSnapAnimation): (WebCore::ScrollingTreeScrollingNodeDelegateMac::didStopScrollSnapAnimation): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::requestScrollPositionUpdate): (WebCore::RenderLayer::isScrollSnapInProgress const): (WebCore::RenderLayer::setupFontSubpixelQuantization): * testing/Internals.cpp: (WebCore:: const): (WebCore::Internals::scrollSnapOffsets): (WebCore::Internals::isScrollSnapInProgress): * testing/Internals.h: * testing/Internals.idl: 2020-06-24 Jason Lawrence <lawrence.j@apple.com> Unreviewed, reverting r263466. This commit caused 50+ crashes on multiple queues internally. Reverted changeset: "REGRESSION (r260360): easing curves are broken on JS- originated animations" https://bugs.webkit.org/show_bug.cgi?id=213495 https://trac.webkit.org/changeset/263466 2020-06-24 Wenson Hsieh <wenson_hsieh@apple.com> Allow the async clipboard API to write data when copying via menu action or key binding https://bugs.webkit.org/show_bug.cgi?id=213568 <rdar://problem/64711653> Reviewed by Darin Adler. Makes a couple of minor adjustments to allow `clipboard.write` and `clipboard.writeText` to work during a user- triggered copy event (that is, from menu or key binding). See below for more details. Test: editing/async-clipboard/clipboard-write-in-copy-event-handler.html * Modules/async-clipboard/Clipboard.cpp: (WebCore::shouldProceedWithClipboardWrite): Add a mechanism to keep track of when Editor is handling a copy or cut event that is the result of interacting with a key binding or menu action. Use this mechanism to grant write access via the async clipboard API. * editing/Editor.cpp: (WebCore::dispatchClipboardEvent): Only attempt to commit the static pasteboard to the platform pasteboard during a copy event when preventing default if the StaticPasteboard-backed DataTransfer actually contains data. This fixes a race condition when writing to the pasteboard using the async clipboard API during the "copy" event, where the changeCount when beginning to write is incremented due to the pasteboard getting cleared. This change will also make it so that calling `preventDefault()` on the copy event will result in no change to the system pasteboard, instead of clearing out any existing content on the pasteboard. (WebCore::Editor::cut): (WebCore::Editor::copy): * editing/Editor.h: (WebCore::Editor::isCopyingFromMenuOrKeyBinding const): * editing/EditorCommand.cpp: (WebCore::executeCopy): (WebCore::executeCut): 2020-06-24 Umar Iqbal <uiqbal@apple.com> We should resurrect the older patch that collects some statistics of web API calls https://bugs.webkit.org/show_bug.cgi?id=213319 Reviewed by Brent Fulgham. No new tests. Enabled existing tests. Enabled http/tests/webAPIStatistics that test the functionality behind WEB_API_STATISTICS flag. + Brought back WebCore::encodeHashSet(KeyedEncoder& encoder, const String& label, const String& key, const HashSet<String>& hashSet) because it was needed by WebCore::encodeFontHashSet(KeyedEncoder& encoder, const String& label, const HashSet<String>& hashSet) + Changed the type of HashCountedSet to HashSet because of earlier patch (https://bugs.webkit.org/attachment.cgi?id=363033) updated other HashCountedSet to HashSet, stating that the counted statistics were never used (see change log in the mentioned patch). + Also changed the type of topFrameRegistrableDomainsWhichAccessedWebAPIs HashSet from String to RegistrableDomain. See the earlier bug (https://bugs.webkit.org/show_bug.cgi?id=194791) that explains the switch from String to RegistrableDomain for eTLD+1's + Enabled WEB_API_STATISTICS flag in FeatureDefines.xcconfig and PlatformEnableCocoa.h + Added WTF::EnumTraits<> for OptionSet<> enum in ResourceLoadStatistics.h due to an earlier change. * loader/ResourceLoadStatistics.h: * Configurations/FeatureDefines.xcconfig: * loader/CanvasActivityRecord.h: * loader/ResourceLoadStatistics.cpp: (WebCore::encodeHashSet): (WebCore::ResourceLoadStatistics::encode const): (WebCore::decodeHashSet): (WebCore::decodeCanvasActivityRecord): (WebCore::ResourceLoadStatistics::decode): (WebCore::appendHashSet): (WebCore::ResourceLoadStatistics::toString const): 2020-06-24 Pinki Gyanchandani <pgyanchandani@apple.com> Null Ptr Deref READ @ WTF::Optional<WTF::Seconds>::clear https://bugs.webkit.org/show_bug.cgi?id=213543 Reviewed by Geoffrey Garen. While performing an animation request, the callback functions modifies the iframe's srcdoc attribute, leading to domWindow being null during rendering, and resulting into crash. Test: fast/rendering/iframe-window-animation-modifies-iframe-srcdoc-crash.html * page/Page.cpp: (WebCore::Page::updateRendering): 2020-06-24 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] -webkit-font-smoothing:antialiased makes fonts blurry https://bugs.webkit.org/show_bug.cgi?id=206573 Reviewed by Alex Christensen. After -webkit-font-smoothing support was added to Cairo port in r254506 (Bug 54763), fonts looks jaggy and faint in WinCairo port in some web sites using -webkit-font-smoothing:antialiased, for example Google News, GMail, https://apple.com. 'antialiased' of -webkit-font-smoothing was mapped to CAIRO_ANTIALIAS_GRAY. And, CAIRO_ANTIALIAS_GRAY is mapped to ANTIALIASED_QUALITY in cairo-win32-font.c. ANTIALIASED_QUALITY makes fonts jaggy and faint. Use CAIRO_ANTIALIAS_SUBPIXEL instead of CAIRO_ANTIALIAS_GRAY for 'antialiased' as well as 'subpixel-antialiased' does. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::drawGlyphsToContext): Don't use CAIRO_ANTIALIAS_GRAY for Win32 Cairo. 2020-06-24 Antoine Quint <graouts@webkit.org> REGRESSION (r260360): easing curves are broken on JS-originated animations https://bugs.webkit.org/show_bug.cgi?id=213495 <rdar://problem/64649747> Reviewed by Darin Adler. Prior to Web Animations, there was no way for an animation to set an animation-wide timing function while also setting a per-keyframe timing function. As such GraphicsLayerCA would sometimes decide to set the timing function on keyframes or on the entire CAAnimation. However, we can no longer do this with Web Animations where an animation can set an animation-wide timing function and also keyframe-specific timing functions. In this patch we create CAKeyframeAnimation objects for any animation that has at least two keyframes if Web Animations are enabled, whereas the legacy code path requires at least three keyframes. We allow PlatformCAAnimation::setTimingFunction() to be called in the Web Animations code path only under GraphicsLayerCA::setupAnimation() while leaving the only call sites in place only for the legacy code path. Finally, we modify GraphicsLayerCA::timingFunctionForAnimationValue() to only ever return a keyframe- specific timing function or fall back to a default linear timing function in the Web Animations code path, leaving the function to behave the same way as it used to in the legacy code path. Test: webanimations/accelerated-animation-with-easing.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::isKeyframe): (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): 2020-06-24 Antoine Quint <graouts@webkit.org> REGRESSION: Delayed updating of the parallax images on pacificvoyages.net/posts https://bugs.webkit.org/show_bug.cgi?id=212213 <rdar://problem/63497946> Reviewed by Simon Fraser. Test: webanimations/css-transition-retargeting-during-ready-promise.html When a transition's ready promise is resolved, its start time is the same as the timeline's current time. This means that retargeting a transition at that moment will yield a progress of zero even though the transition was started before the current animation frame. This means that retargeting a property on each page rendering may start a new transition with the same from value, which can have an undesirable effect such as on the website reported in this bug. We now keep track of the timeline time when a transition is created and use this time as a start time override when applying the animation to compute the before-change style in AnimationTimeline::updateCSSTransitionsForElementAndProperty(). To do so, we pass an optional start time all the way from WebAnimation::resolve() through to WebAnimation::currentTime() and via the animation effect timing computation. * animation/AnimationEffect.cpp: (WebCore::AnimationEffect::getBasicTiming const): (WebCore::AnimationEffect::getComputedTiming const): * animation/AnimationEffect.h: * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty): * animation/CSSTransition.cpp: (WebCore::CSSTransition::CSSTransition): (WebCore::CSSTransition::resolve): * animation/CSSTransition.h: * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::apply): * animation/KeyframeEffect.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::currentTime const): (WebCore::WebAnimation::resolve): * animation/WebAnimation.h: 2020-06-24 Eric Carlson <eric.carlson@apple.com> Don't claim to support fullscreen mode unless fullScreenEnabled setting is enabled https://bugs.webkit.org/show_bug.cgi?id=213142 <rdar://63753327> Reviewed by Jer Noble. Test: media/video-supports-fullscreen.html * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::supportsFullscreen const): Check settings.fullScreenEnabled. 2020-06-24 Philippe Normand <pnormand@igalia.com> [GStreamer] webrtc/disable-encryption.html is a crashing flaky https://bugs.webkit.org/show_bug.cgi?id=211166 <rdar://problem/63223973> Reviewed by Xabier Rodriguez-Calvar. Simplify the process to create internal appsrc elements. I suspect something bad was ongoing with these moves of GRefPtr. * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (WebCore::_WebKitMediaStreamSrc::SourceData::ensureAppSrc): (WebCore::webkitMediaStreamSrcSetupAppSrc): (WebCore::_WebKitMediaStreamSrc::SourceData::setSrc): Deleted. 2020-06-24 Antti Koivisto <antti@apple.com> Style resolution sometimes fails to create all style resolvers for shadow trees. https://bugs.webkit.org/show_bug.cgi?id=212946 <rdar://problem/60916215>> Reviewed by Anders Carlsson. This can cause problems later. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::Scope::Scope): Ensure all style resolvers are constructed before traversing. 2020-06-24 Youenn Fablet <youenn@apple.com> Add logging to WebRTC video pipeline to check for frame rate stability https://bugs.webkit.org/show_bug.cgi?id=213369 Reviewed by Eric Carlson. Add a FrameRateMonitor class to compute frame stability. Use this class at end of the video pipeline (LocalSampleBufferDisplayLayer). Log messages in case a frame gets frozen at LocalSampleBufferDisplayLayer time. We compute that a frame takes too long by checking whether it is delayed by more than three expected frames. This logging is complemented with encoded frame reception logging (at the beginning of the video pipeline) and WebRTC stats logging (freezeCount, totalFreezeDuration, shortly after decoding the frames). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/FrameRateMonitor.cpp: Added. (WebCore::FrameRateMonitor::newFrame): * platform/FrameRateMonitor.h: Added. (WebCore::FrameRateMonitor::frameRate const): (WebCore::FrameRateMonitor::frameCount const): (WebCore::FrameRateMonitor::FrameRateMonitor): * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h: * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm: (WebCore::LocalSampleBufferDisplayLayer::LocalSampleBufferDisplayLayer): (WebCore::LocalSampleBufferDisplayLayer::enqueueSample): (WebCore::LocalSampleBufferDisplayLayer::enqueueSampleBuffer): (WebCore::LocalSampleBufferDisplayLayer::onFrameRateNotification): * platform/mediastream/mac/AudioMediaStreamTrackRendererUnit.h: Unified build fix. 2020-06-24 Alexey Shvayka <shvaikalesh@gmail.com> Remove [CallbackNeedsOperatorEqual] extended attribute https://bugs.webkit.org/show_bug.cgi?id=213538 Reviewed by Chris Dumez. This change removes now unused [CallbackNeedsOperatorEqual] extended attribute. It was added to accommodate MediaQueryListListener, which was removed in r260243. We are safe to remove [CallbackNeedsOperatorEqual] since its implementation expects certain constructor signature, and callback interfaces are considered legacy by spec authors anyway. Also, this patch removes 2 resolved FIXMEs: 1. OrdinaryDefineOwnProperty() is performed correctly, no dynamic dispatch there. 2. Set() is performed correctly, with `false` as last argument. (changed in https://github.com/heycam/webidl/pull/832, covered by WPT) No new tests, no behavior change. * bindings/scripts/CodeGeneratorJS.pm: (GenerateDefineOwnProperty): (GenerateAttributeSetterBodyDefinition): (GenerateCallbackHeaderContent): (GenerateCallbackImplementationContent): * bindings/scripts/IDLAttributes.json: 2020-06-23 Sergio Villar Senin <svillar@igalia.com> [WebXR] Fix PlatformXR initialization/destruction https://bugs.webkit.org/show_bug.cgi?id=213509 Reviewed by Youenn Fablet. There were two different issues, one at creation time and the other one at destruction. At creation time we were not calling construct() for the LazyNeverDestroyed object. That was making the WebProcess crash in Debug builds. At destruction time we were calling xrDestroyInstance() without checking that the passed instance was a valid one, although OpenXR implementations deal with it the spec is pretty clear. * platform/xr/PlatformXR.h: Mark LazyNeverDestroyed as friend and default constructor&destructor. * platform/xr/openxr/PlatformXROpenXR.cpp: (PlatformXR::Instance::Impl::~Impl): Check that instance is not XR_NULL_HANDLE before destroying. (PlatformXR::Instance::singleton): Call construct() on the Lazy instance. 2020-06-24 Youenn Fablet <youenn@apple.com> Use signalling thread as worker thread instead of network thread https://bugs.webkit.org/show_bug.cgi?id=213512 Reviewed by Eric Carlson. This is probably better since network thread is always busy while the siganlling thread is mostly busy at negotiation time. This also aligns with Chromium current setup. No change of behavior. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::LibWebRTCProvider::createPeerConnectionFactory): 2020-06-24 Rob Buis <rbuis@igalia.com> Add referrerpolicy attribute support for <link> https://bugs.webkit.org/show_bug.cgi?id=213342 Reviewed by Darin Adler. Give the referrer policy member a clear default. * loader/LinkLoader.h: 2020-06-23 Zalan Bujtas <zalan@apple.com> [Multicol] Reset the childrenInline state on the RenderBlockFlow when destroying the multicolumn context https://bugs.webkit.org/show_bug.cgi?id=213535 <rdar://problem/64541835> Reviewed by Simon Fraser. The "childrenInline" flags tells the tree builder whether a newly inserted inline content needs an anonymous block wrapper or not. RenderBlockFlows with multicolumn content have this flag set to false as the RenderMultiColumnFlowThread is a block renderer. As part of the mulicolumn context destruction, we move all the descendants from RenderMultiColumnFlowThread back to the original parent (the parent of the RenderMultiColumnFlowThread renderer). This patch sets this flag back to the initial value of true so that we don't end up constructing redundant wrappers for the incoming inline content. * rendering/updating/RenderTreeBuilderMultiColumn.cpp: (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow): 2020-06-23 Geoffrey Garen <ggaren@apple.com> Remove WTF::setMainThreadCallbacksPaused https://bugs.webkit.org/show_bug.cgi?id=213112 Reviewed by Tim Horton. * inspector/PageScriptDebugServer.cpp: (WebCore::PageScriptDebugServer::setJavaScriptPaused): 2020-06-23 Chris Dumez <cdumez@apple.com> Unreviewed, update xcfilelist files after some recent WebXR changes. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: 2020-06-23 Chris Dumez <cdumez@apple.com> Remove a lot of unnecessary calls to Ref::copyRef() https://bugs.webkit.org/show_bug.cgi?id=213533 Reviewed by Darin Adler. Remove a lot of unnecessary calls to Ref::copyRef() now that Ref is copyable. * Modules/cache/DOMCache.cpp: (WebCore::DOMCache::addAll): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::doRequestOpenCursor): (WebCore::IDBTransaction::requestGetAllObjectStoreRecords): (WebCore::IDBTransaction::requestGetAllIndexRecords): (WebCore::IDBTransaction::requestGetRecord): (WebCore::IDBTransaction::requestIndexRecord): (WebCore::IDBTransaction::requestCount): (WebCore::IDBTransaction::requestDeleteRecord): (WebCore::IDBTransaction::requestClearObjectStore): (WebCore::IDBTransaction::requestPutOrAdd): * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::create): * Modules/webdatabase/Database.cpp: (WebCore::Database::scheduleTransactionCallback): * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: (WebCore::WorkerThreadableWebSocketChannel::Peer::send): (WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount): (WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect): (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage): (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData): (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount): (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake): (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose): (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError): (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpgradeURL): (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize): (WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::executeAsynchronousUserAgentScriptInWorld): * crypto/SubtleCrypto.cpp: (WebCore::SubtleCrypto::wrapKey): * loader/DocumentWriter.cpp: (WebCore::DocumentWriter::begin): * loader/NetscapePlugInStreamLoader.cpp: (WebCore::NetscapePlugInStreamLoader::create): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::create): * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::startAsyncDecodingQueue): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp: (WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::wrapCryptoKey): (WebCore::WorkerGlobalScope::unwrapCryptoKey): * workers/service/WorkerSWClientConnection.cpp: (WebCore::WorkerSWClientConnection::matchRegistration): (WebCore::WorkerSWClientConnection::getRegistrations): (WebCore::WorkerSWClientConnection::whenRegistrationReady): (WebCore::WorkerSWClientConnection::scheduleUnregisterJobInServer): * workers/service/context/ServiceWorkerFetch.cpp: (WebCore::ServiceWorkerFetch::dispatchFetchEvent): * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::queueTaskToFireFetchEvent): (WebCore::ServiceWorkerThread::queueTaskToPostMessage): (WebCore::ServiceWorkerThread::queueTaskToFireInstallEvent): (WebCore::ServiceWorkerThread::queueTaskToFireActivateEvent): 2020-06-23 Chris Dumez <cdumez@apple.com> Drop AudioContextBase class https://bugs.webkit.org/show_bug.cgi?id=213522 Reviewed by Geoffrey Garen. Drop AudioContextBase class and have WebKitAudioContext subclass the new BaseAudioContext class instead. We recently introduced BaseAudioContext to match the specification and keeping AudioContextBase is now confusing. No new tests, this simplifies our code but there is no Web-facing behavior change. * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::AnalyserNode): * Modules/webaudio/AnalyserNode.h: * Modules/webaudio/AudioBasicInspectorNode.cpp: (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode): * Modules/webaudio/AudioBasicInspectorNode.h: * Modules/webaudio/AudioBasicProcessorNode.cpp: (WebCore::AudioBasicProcessorNode::AudioBasicProcessorNode): * Modules/webaudio/AudioBasicProcessorNode.h: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::create): (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): (WebCore::AudioBufferSourceNode::setBuffer): * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioContext.cpp: * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::AudioDestinationNode): * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::AudioNode): (WebCore::AudioNode::connect): (WebCore::AudioNode::disconnect): (WebCore::AudioNode::setChannelCount): (WebCore::AudioNode::setChannelCountMode): (WebCore::AudioNode::setChannelInterpretation): (WebCore::AudioNode::enableOutputsIfNecessary): * Modules/webaudio/AudioNode.h: (WebCore::AudioNode::context): (WebCore::AudioNode::context const): * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioNodeOutput.h: (WebCore::AudioNodeOutput::context): * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::AudioParam): * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valueForContextTime): * Modules/webaudio/AudioParamTimeline.h: * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode): * Modules/webaudio/AudioScheduledSourceNode.h: * Modules/webaudio/AudioSummingJunction.cpp: (WebCore::AudioSummingJunction::AudioSummingJunction): * Modules/webaudio/AudioSummingJunction.h: (WebCore::AudioSummingJunction::context): * Modules/webaudio/BaseAudioContext.cpp: (WebCore::BaseAudioContext::BaseAudioContext): (WebCore::BaseAudioContext::document const): (WebCore::BaseAudioContext::scriptExecutionContext const): * Modules/webaudio/BaseAudioContext.h: (WebCore::BaseAudioContext::isOfflineContext const): (WebCore::BaseAudioContext::isWebKitAudioContext const): (WebCore::BaseAudioContext::currentSampleFrame const): (WebCore::BaseAudioContext::currentTime const): (WebCore::BaseAudioContext::sampleRate const): (WebCore::BaseAudioContext::incrementConnectionCount): (WebCore::BaseAudioContext::setAudioThread): (WebCore::BaseAudioContext::isAudioThreadFinished): (WebCore::BaseAudioContext::behaviorRestrictions const): (WebCore::BaseAudioContext::addBehaviorRestriction): (WebCore::BaseAudioContext::removeBehaviorRestriction): (WebCore::BaseAudioContext::nextAudioNodeLogIdentifier): (WebCore::BaseAudioContext::nextAudioParameterLogIdentifier): (WebCore::BaseAudioContext::isStopped const): (WebCore::BaseAudioContext::AutoLocker::AutoLocker): (WebCore::BaseAudioContext::AutoLocker::~AutoLocker): * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::BiquadFilterNode): * Modules/webaudio/BiquadFilterNode.h: * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::BiquadProcessor): * Modules/webaudio/BiquadProcessor.h: * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): (WebCore::ChannelMergerNode::ChannelMergerNode): * Modules/webaudio/ChannelMergerNode.h: * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): (WebCore::ChannelSplitterNode::ChannelSplitterNode): * Modules/webaudio/ChannelSplitterNode.h: * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::ConvolverNode): * Modules/webaudio/ConvolverNode.h: * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode): * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::DelayNode): (WebCore::DelayNode::create): * Modules/webaudio/DelayNode.h: * Modules/webaudio/DelayProcessor.cpp: (WebCore::DelayProcessor::DelayProcessor): * Modules/webaudio/DelayProcessor.h: * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): * Modules/webaudio/DynamicsCompressorNode.h: * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::GainNode): * Modules/webaudio/GainNode.h: * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::create): (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode): (WebCore::MediaElementAudioSourceNode::setFormat): * Modules/webaudio/MediaElementAudioSourceNode.h: * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: (WebCore::MediaStreamAudioDestinationNode::create): (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode): * Modules/webaudio/MediaStreamAudioDestinationNode.h: * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::create): (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode): * Modules/webaudio/MediaStreamAudioSourceNode.h: * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode): * Modules/webaudio/OfflineAudioDestinationNode.h: * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): (WebCore::OscillatorNode::OscillatorNode): * Modules/webaudio/OscillatorNode.h: * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNodeBase::PannerNodeBase): * Modules/webaudio/PannerNode.h: * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::create): (WebCore::ScriptProcessorNode::ScriptProcessorNode): * Modules/webaudio/ScriptProcessorNode.h: * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::WaveShaperNode): * Modules/webaudio/WaveShaperNode.h: * Modules/webaudio/WebKitAudioContext.cpp: (WebCore::WebKitAudioContext::WebKitAudioContext): (WebCore::WebKitAudioContext::createMediaElementSource): (WebCore::WebKitAudioContext::createMediaStreamSource): (WebCore::WebKitAudioContext::createMediaStreamDestination): (WebCore::WebKitAudioContext::createWebKitPanner): (WebCore::WebKitAudioContext::close): * Modules/webaudio/WebKitAudioContext.h: (isType): * Modules/webaudio/WebKitAudioContext.idl: * dom/EventTargetFactory.in: * testing/Internals.cpp: (WebCore::Internals::setAudioContextRestrictions): * testing/Internals.h: * testing/Internals.idl: 2020-06-22 Sergio Villar Senin <svillar@igalia.com> [WebXR] Introducing XRLayer https://bugs.webkit.org/show_bug.cgi?id=213462 Reviewed by Youenn Fablet. The most recent drafts of the WebXR spec have added a new object called XRLayer which is the base class of the already known XRWebGLLayer. The spec only defines the latter but future extensions might define some other layer subclasses. This patch fixes several checks in the IDL tests. * CMakeLists.txt: Added new files. * DerivedSources.make: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * Modules/webxr/WebXRLayer.cpp: Added. (WebCore::WebXRLayer::WebXRLayer): * Modules/webxr/WebXRLayer.h: Ditto. * Modules/webxr/WebXRLayer.idl: Ditto. * Modules/webxr/WebXRSession.h: Export scriptExecutionContext() so it could be used from the outside. * Modules/webxr/WebXRWebGLLayer.cpp: (WebCore::WebXRWebGLLayer::WebXRWebGLLayer): Call the superclass. * Modules/webxr/WebXRWebGLLayer.h: Inherit from WebXRLayer. * Modules/webxr/WebXRWebGLLayer.idl: Ditto. * Sources.txt: Added new files. * bindings/js/WebCoreBuiltinNames.h: Added XRLayer. * dom/EventTargetFactory.in: Ditto. 2020-06-23 Devin Rousso <drousso@apple.com> Keyframe animation doesn't 't show up in the Animations timeline https://bugs.webkit.org/show_bug.cgi?id=213441 Reviewed by Brian Burg. Test: inspector/animation/lifecycle-css-animation.html * inspector/agents/InspectorAnimationAgent.cpp: (WebCore::buildObjectForEffect): 2020-06-23 Sergio Villar Senin <svillar@igalia.com> [css-flex] Allow indefinite size flex items to be definite wrt resolving percentages inside them https://bugs.webkit.org/show_bug.cgi?id=212264 Reviewed by Manuel Rego Casasnovas. Implement https://github.com/w3c/csswg-drafts/commit/5b5db39d21f3658ae2f4d7992daaf822aca178d8 which modified the way percentages were resolved in flexible items with indefinite sizes. From now on we can pretend that they're really definite. This allows us to mark 3 tests which were testing percentages in flex items as correct. Based on Blink's crrev.com/1247184 by <cbiesinger@chromium.org> This is a reland of r262124 which got reverted due to the bug fixed in r263389. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): Do only check flex container main size definiteness when computing the main size for percentage resolution, no need to check flex basis at all. 2020-06-18 Sergio Villar Senin <svillar@igalia.com> REGRESSION (r262124): Twitter videos go blank after exiting fullscreen https://bugs.webkit.org/show_bug.cgi?id=213110 Reviewed by Darin Adler. Test: fullscreen/video-inside-flex-item.html Setting/unsetting position:absolute on a flex/grid item can potentially create/remove flex/grid items because absolutely positioned children of those containers are out-of-flow and thus, do not generate flex/grid items. Flex/grid items are potentially stretched by their containers so the style recalculation is not enough to get a correct layout because the override size set by flex/grid containers is not reset. In the particular case of this bug we had this hierarchy (highly simplified from twitter page): Flexbox container |___DIV (absolutelly positioned) |___<video> (height: 100% width: 100%) When the <video> goes fullscreen the FullscreenManager replaces the style of the DIV because it inserts a RenderFullScreen object in between the DIV and the <video> (along with some anonymous blocks). This means that the DIV which was not a flex item (as it was absolutely positioned) became a flex item and thus its size is stretched as the flexbox container mandates. When exiting fullscreen, the original style is restored (and thus the position absolute). The DIV is then no longer a flex item but the stretched size (overrideContentSize) is still set, causing issues with the sizes of the <video>. Note that it isn't possible to reproduce this bug with the current trunk because there is a bug in the flexbox implementation (see bug 212264) preventing this to happen. However it becomes 100% reproducible with the patch for bug 212264 which is correct and fixes several tests related to wrapping in flexbox. It's also reproducible when the FULLSCREEN_API is enabled, otherwise the codepath for full screen is totally different (there are no placeholders). * rendering/RenderBox.cpp: (WebCore::RenderBox::styleDidChange): clear the override sizes for grid/flex when flex/grid items become out-of-flow, for example by changing position to absolute. 2020-06-22 Carlos Garcia Campos <cgarcia@igalia.com> REGRESSION(r258741): [GTK] anchor-file-blob-download-includes-backslash.html is failing https://bugs.webkit.org/show_bug.cgi?id=209329 Reviewed by Adrian Perez de Castro. Sanitize the suggested filename. We replace characters that can be problematic in filenames with '_' to match what Chromium and Firefox do. * platform/network/soup/ResourceResponseSoup.cpp: (WebCore::sanitizeFilename): (WebCore::ResourceResponse::platformSuggestedFilename const): 2020-06-22 John Wilander <wilander@apple.com> Storage Access API: Add the capability to call the Storage Access API as a quirk, on behalf of websites that should be doing it themselves https://bugs.webkit.org/show_bug.cgi?id=213418 <rdar://problem/64549429> Reviewed by Alex Christensen. No new tests. This patch adds quirks for specific websites. The general functionality that's touched has tests under LayoutTests/http/tests/storageAccess/. * dom/Document.h: (WebCore::Document::isTopDocument const): New convenience function. (WebCore::Document::setUserDidInteractWithPage): Use of the new convenience function. (WebCore::Document::userDidInteractWithPage const): Use of the new convenience function. * dom/DocumentStorageAccess.cpp: (WebCore::DocumentStorageAccess::hasStorageAccessQuickCheck): (WebCore::DocumentStorageAccess::hasStorageAccess): (WebCore::DocumentStorageAccess::hasStorageAccessForDocumentQuirk): (WebCore::DocumentStorageAccess::requestStorageAccess): (WebCore::DocumentStorageAccess::requestStorageAccessQuickCheck): (WebCore::DocumentStorageAccess::requestStorageAccessForDocumentQuirk): (WebCore::DocumentStorageAccess::requestStorageAccessForNonDocumentQuirk): (WebCore::DocumentStorageAccess::requestStorageAccessQuirk): These functions are split up to allow quirks to call directly into the implementation of the Storage Access API without the JavaScript promise that goes with the web API. It also allows for quirks to call the API without an iframe document. * dom/DocumentStorageAccess.h: * dom/Element.cpp: (WebCore::Element::dispatchMouseEvent): The two existing quirks are for click events. * loader/ResourceLoadObserver.h: (WebCore::ResourceLoadObserver::setDomainsWithUserInteraction): (WebCore::ResourceLoadObserver::hasHadUserInteraction const): These two new functions allow the Storage Access API quirks to synchronously check if it's worth calling the API or not. If there has been no user interaction for the requesting domain, there is no need to call the API. * page/Quirks.cpp: (WebCore::Quirks::triggerOptionalStorageAccessQuirk const): This is the new quirks function, hiding the specifics of certain elements clicked and for which websites. It also calls the Storage Access API. * page/Quirks.h: 2020-06-22 Chris Dumez <cdumez@apple.com> Introduce BaseAudioContext interface https://bugs.webkit.org/show_bug.cgi?id=213491 Reviewed by Geoffrey Garen. Introduce BaseAudioContext interface as per W3C WebAudio specification: - https://www.w3.org/TR/webaudio/#BaseAudioContext No new tests, rebaselined existing test. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::AudioContext): (WebCore::AudioContext::close): (WebCore::AudioContext::createMediaElementSource): (WebCore::AudioContext::createMediaStreamSource): (WebCore::AudioContext::createMediaStreamDestination): * Modules/webaudio/AudioContext.h: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::contextForBindings const): * Modules/webaudio/AudioNode.h: * Modules/webaudio/AudioNode.idl: * Modules/webaudio/BaseAudioContext.cpp: Copied from Source/WebCore/Modules/webaudio/AudioContext.cpp. (WebCore::BaseAudioContext::isSampleRateRangeGood): (WebCore::AudioContextBase::AudioContextBase): (WebCore::BaseAudioContext::BaseAudioContext): (WebCore::BaseAudioContext::constructCommon): (WebCore::BaseAudioContext::~BaseAudioContext): (WebCore::BaseAudioContext::lazyInitialize): (WebCore::BaseAudioContext::clear): (WebCore::BaseAudioContext::uninitialize): (WebCore::BaseAudioContext::isInitialized const): (WebCore::BaseAudioContext::addReaction): (WebCore::BaseAudioContext::setState): (WebCore::BaseAudioContext::stop): (WebCore::BaseAudioContext::suspend): (WebCore::BaseAudioContext::resume): (WebCore::BaseAudioContext::activeDOMObjectName const): (WebCore::AudioContextBase::document const): (WebCore::BaseAudioContext::hostingDocumentIdentifier const): (WebCore::BaseAudioContext::isSuspended const): (WebCore::BaseAudioContext::visibilityStateChanged): (WebCore::BaseAudioContext::wouldTaintOrigin const): (WebCore::BaseAudioContext::createBuffer): (WebCore::BaseAudioContext::decodeAudioData): (WebCore::BaseAudioContext::createBufferSource): (WebCore::BaseAudioContext::createScriptProcessor): (WebCore::BaseAudioContext::createBiquadFilter): (WebCore::BaseAudioContext::createWaveShaper): (WebCore::BaseAudioContext::createPanner): (WebCore::BaseAudioContext::createConvolver): (WebCore::BaseAudioContext::createDynamicsCompressor): (WebCore::BaseAudioContext::createAnalyser): (WebCore::BaseAudioContext::createGain): (WebCore::BaseAudioContext::createDelay): (WebCore::BaseAudioContext::createChannelSplitter): (WebCore::BaseAudioContext::createChannelMerger): (WebCore::BaseAudioContext::createOscillator): (WebCore::BaseAudioContext::createPeriodicWave): (WebCore::BaseAudioContext::notifyNodeFinishedProcessing): (WebCore::BaseAudioContext::derefFinishedSourceNodes): (WebCore::BaseAudioContext::refNode): (WebCore::BaseAudioContext::derefNode): (WebCore::BaseAudioContext::derefUnfinishedSourceNodes): (WebCore::BaseAudioContext::lock): (WebCore::BaseAudioContext::tryLock): (WebCore::BaseAudioContext::unlock): (WebCore::BaseAudioContext::isAudioThread const): (WebCore::BaseAudioContext::isGraphOwner const): (WebCore::BaseAudioContext::addDeferredFinishDeref): (WebCore::BaseAudioContext::handlePreRenderTasks): (WebCore::BaseAudioContext::handlePostRenderTasks): (WebCore::BaseAudioContext::handleDeferredFinishDerefs): (WebCore::BaseAudioContext::markForDeletion): (WebCore::BaseAudioContext::scheduleNodeDeletion): (WebCore::BaseAudioContext::deleteMarkedNodes): (WebCore::BaseAudioContext::markSummingJunctionDirty): (WebCore::BaseAudioContext::removeMarkedSummingJunction): (WebCore::BaseAudioContext::eventTargetInterface const): (WebCore::BaseAudioContext::markAudioNodeOutputDirty): (WebCore::BaseAudioContext::handleDirtyAudioSummingJunctions): (WebCore::BaseAudioContext::handleDirtyAudioNodeOutputs): (WebCore::BaseAudioContext::addAutomaticPullNode): (WebCore::BaseAudioContext::removeAutomaticPullNode): (WebCore::BaseAudioContext::updateAutomaticPullNodes): (WebCore::BaseAudioContext::processAutomaticPullNodes): (WebCore::AudioContextBase::scriptExecutionContext const): (WebCore::BaseAudioContext::nodeWillBeginPlayback): (WebCore::shouldDocumentAllowWebAudioToAutoPlay): (WebCore::BaseAudioContext::willBeginPlayback): (WebCore::BaseAudioContext::willPausePlayback): (WebCore::BaseAudioContext::startRendering): (WebCore::BaseAudioContext::mediaCanStart): (WebCore::BaseAudioContext::mediaState const): (WebCore::BaseAudioContext::pageMutedStateDidChange): (WebCore::BaseAudioContext::isPlayingAudioDidChange): (WebCore::BaseAudioContext::finishedRendering): (WebCore::BaseAudioContext::dispatchEvent): (WebCore::BaseAudioContext::incrementActiveSourceCount): (WebCore::BaseAudioContext::decrementActiveSourceCount): (WebCore::BaseAudioContext::suspendRendering): (WebCore::BaseAudioContext::resumeRendering): (WebCore::BaseAudioContext::suspendPlayback): (WebCore::BaseAudioContext::mayResumePlayback): (WebCore::BaseAudioContext::postTask): (WebCore::BaseAudioContext::origin const): (WebCore::BaseAudioContext::addConsoleMessage): (WebCore::BaseAudioContext::clearPendingActivity): (WebCore::BaseAudioContext::makePendingActivity): (WebCore::BaseAudioContext::logChannel const): * Modules/webaudio/BaseAudioContext.h: Copied from Source/WebCore/Modules/webaudio/AudioContext.h. (WebCore::AudioContextBase::AutoLocker::AutoLocker): (WebCore::AudioContextBase::AutoLocker::~AutoLocker): (WebCore::BaseAudioContext::destination): (WebCore::BaseAudioContext::activeSourceCount const): (WebCore::BaseAudioContext::listener): (WebCore::BaseAudioContext::state const): (WebCore::BaseAudioContext::isClosed const): (WebCore::BaseAudioContext::connectionCount const): (WebCore::BaseAudioContext::audioThread const): (WebCore::BaseAudioContext::maxNumberOfChannels): (WebCore::BaseAudioContext::destinationNode const): (WebCore::BaseAudioContext::userGestureRequiredForAudioStart const): (WebCore::BaseAudioContext::pageConsentRequiredForAudioStart const): (isType): * Modules/webaudio/BaseAudioContext.idl: Copied from Source/WebCore/Modules/webaudio/AudioContext.idl. * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::OfflineAudioContext): * Modules/webaudio/OfflineAudioContext.h: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::PannerNode): * Modules/webaudio/PannerNode.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/EventTargetFactory.in: * testing/Internals.cpp: (WebCore::Internals::setAudioContextRestrictions): * testing/Internals.h: * testing/Internals.idl: 2020-06-22 Andres Gonzalez <andresg_22@apple.com> AXIsolatedTree::generateSubtree should properly assign the generated subtree to its parent node. https://bugs.webkit.org/show_bug.cgi?id=213435 Reviewed by Darin Adler. AXIsolatedTree::generateSubtree now properly updates the children IDs of the parent node of the subtree being generated. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::generateIsolatedTree): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateChildrenIDs): (WebCore::AXIsolatedTree::generateSubtree): Takes the parent object instead of the parent ID. This allows to retrieve the children IDs of the parent object. (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateSubtree): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::setRootNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::appendNodeChanges): R-value parameter instead of by reference. * accessibility/isolatedtree/AXIsolatedTree.h: 2020-06-22 Tim Horton <timothy_horton@apple.com> Update macOS version macros https://bugs.webkit.org/show_bug.cgi?id=213484 Reviewed by Alexey Proskuryakov. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebKitTargetConditionals.xcconfig: 2020-06-22 Clark Wang <clark_wang@apple.com> Added getFloatTimeDomainData method to AnalyserNode https://bugs.webkit.org/show_bug.cgi?id=213393 Reviewed by Chris Dumez. Added getFloatTimeDomainData method, as per spec: https://www.w3.org/TR/webaudio/#analysernode. Implementation of RealtimeAnalyser::getFloatTimeDomainData(Float32Array* destinationArray) is based on: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/webaudio/realtime_analyser.cc. Removed nullable option from some AnalyserNode methods. Re-baselined existing tests to show new passing test. * Modules/webaudio/AnalyserNode.h: * Modules/webaudio/AnalyserNode.idl: * Modules/webaudio/RealtimeAnalyser.cpp: (WebCore::RealtimeAnalyser::getFloatFrequencyData): (WebCore::RealtimeAnalyser::getByteFrequencyData): (WebCore::RealtimeAnalyser::getFloatTimeDomainData): (WebCore::RealtimeAnalyser::getByteTimeDomainData): * Modules/webaudio/RealtimeAnalyser.h: 2020-06-22 Rob Buis <rbuis@igalia.com> Add referrerpolicy attribute support for <link> https://bugs.webkit.org/show_bug.cgi?id=213342 Reviewed by Darin Adler. Add support for referrerpolicy attribute handling on link prefetch/preload/stylesheet. Tests: http/tests/security/referrer-policy-attribute-style-no-referrer.html http/wpt/preload/refferer-policy.html * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::process): (WebCore::HTMLLinkElement::setReferrerPolicyForBindings): (WebCore::HTMLLinkElement::referrerPolicyForBindings const): (WebCore::HTMLLinkElement::referrerPolicy const): * html/HTMLLinkElement.h: * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): * html/parser/HTMLResourcePreloader.cpp: (WebCore::PreloadRequest::resourceRequest): * loader/LinkLoader.cpp: (WebCore::LinkLoader::loadLinksFromHeader): (WebCore::LinkLoader::preloadIfNeeded): (WebCore::LinkLoader::prefetchIfNeeded): * loader/LinkLoader.h: 2020-06-22 Simon Fraser <simon.fraser@apple.com> Fix build error with release build and "#define LOG_DISABLED 0" https://bugs.webkit.org/show_bug.cgi?id=213420 Reviewed by Sam Weinig. AnimationBase::updateStateMachine() uses LOG_ERROR so needs to test ERROR_DISABLED not LOG_DISABLED. * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::updateStateMachine): 2020-06-22 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Fix the case of "null type Blob slice" in wpt/FileAPI/blob/Blob-slice.html https://bugs.webkit.org/show_bug.cgi?id=213370 Reviewed by Darin Adler. * fileapi/Blob.h: (WebCore::Blob::slice const): Remove unnecessary default arguments These default arguments are introduced in r83873 but we don't need them because WebIDL binding handles them. * fileapi/Blob.idl: - Update the definition of `Blob.slice()` to match the latest spec. https://w3c.github.io/FileAPI/#blob-section - We should use empty string as a default value by step 4-a of https://w3c.github.io/FileAPI/#dfn-slice - In the previous code, we use `optional DOMString?` for the _contentType_ arguments for `Blob.slice()`. Then, our codegen generates a code which uses `convert<IDLNullable<IDLDOMString>>` and it returns `String()` if the JS value is `null`. This caused the failure case in this change. 2020-06-22 Andres Gonzalez <andresg_22@apple.com> Code cleanup in WebAccessibilityObjectWrapper updateObjectBackingStore and position. https://bugs.webkit.org/show_bug.cgi?id=213438 Reviewed by Darin Adler. * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]): Removed unnecessary call to axBackingObject. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper position]): Check for isIsolatedTreeEnabled instead of for the request thread, since isolated tree mode = 1 runs on the main thread. 2020-06-22 Youenn Fablet <youenn@apple.com> [WebRTC] Add support for freeze/pause receiver stats https://bugs.webkit.org/show_bug.cgi?id=212938 <rdar://problem/64141493> Reviewed by Eric Carlson. Covered by updated tests. Receiver stats are useful to check for freezes. Let's introduce it in 'track' stats for now, we will later on move all 'receiver' stats to its own object once we fully align with spec. * Modules/mediastream/RTCStatsReport.h: * Modules/mediastream/RTCStatsReport.idl: * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::fillRTCMediaStreamTrackStats): 2020-06-22 Rob Buis <rbuis@igalia.com> Image `crossorigin` mutations should be considered "relevant mutations" https://bugs.webkit.org/show_bug.cgi?id=213335 Reviewed by Darin Adler. As follow up to r263345, this check is not needed after all since the for loop already does the same check. * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): 2020-06-22 Jason Lawrence <lawrence.j@apple.com> Unreviewed, reverting r263331. This commit was causing 50+ iOS debug tests to crash. Reverted changeset: "Convert DateComponents parsing code to use Optional based return values rather than out-parameters" https://bugs.webkit.org/show_bug.cgi?id=213440 https://trac.webkit.org/changeset/263331 2020-06-10 Sergio Villar Senin <svillar@igalia.com> [WebXR] Add a preliminary implementation of XRWebGLLayer https://bugs.webkit.org/show_bug.cgi?id=213022 Reviewed by Carlos Garcia Campos. Added a preliminary implementation of XRWebGLLayer. It does not have any functionality at the moment so it cannot be used to render WebXR stuff. This patch adds all the machinery required to create and properly initialize the layer according to the spec. Two new wpt tests are passing now. * Modules/webxr/WebXRSession.h: Expose session mode. * Modules/webxr/WebXRWebGLLayer.cpp: (WebCore::WebXRWebGLLayer::create): Implemented spec for XRWebGLLayer creation. (WebCore::WebXRWebGLLayer::computeNativeWebGLFramebufferResolution): Added with mock implementation. (WebCore::WebXRWebGLLayer::computeRecommendedWebGLFramebufferResolution): Added. (WebCore::WebXRWebGLLayer::WebXRWebGLLayer): (WebCore::WebXRWebGLLayer::framebuffer const): Returned type should be a pointer. (WebCore::WebXRWebGLLayer::framebufferWidth const): Return framebuffer width if available, otherwise return the base context width. (WebCore::WebXRWebGLLayer::framebufferHeight const): Ditto but with heights. (WebCore::WebXRWebGLLayer::getNativeFramebufferScaleFactor): Implemented. * Modules/webxr/WebXRWebGLLayer.h: New methods and type adjustments. 2020-06-22 Rob Buis <rbuis@igalia.com> Image `crossorigin` mutations should be considered "relevant mutations" https://bugs.webkit.org/show_bug.cgi?id=213335 Reviewed by Darin Adler. Make crossorigin attribute's state changes relevant mutations [1]. This change also fixes several picture related mutations to be relevant [2]. Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html [1] https://html.spec.whatwg.org/#reacting-to-dom-mutations:attr-img-crossorigin [2] https://html.spec.whatwg.org/#reacting-to-dom-mutations * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): (WebCore::HTMLImageElement::evaluateDynamicMediaQueryDependencies): (WebCore::HTMLImageElement::selectImageSource): (WebCore::parseCrossoriginState): (WebCore::HTMLImageElement::attributeChanged): (WebCore::HTMLImageElement::parseAttribute): (WebCore::HTMLImageElement::insertedIntoAncestor): (WebCore::HTMLImageElement::removedFromAncestor): * html/HTMLImageElement.h: * html/HTMLPictureElement.cpp: (WebCore::HTMLPictureElement::sourcesChanged): * html/HTMLSourceElement.cpp: (WebCore::HTMLSourceElement::insertedIntoAncestor): (WebCore::HTMLSourceElement::removedFromAncestor): (WebCore::HTMLSourceElement::parseAttribute): * html/HTMLSourceElement.h: * loader/ImageLoader.h: 2020-06-21 Sam Weinig <weinig@apple.com> Convert much of the SVG string parsing code to use Optional based return values rather than out-parameters https://bugs.webkit.org/show_bug.cgi?id=213416 Reviewed by Darin Adler. Update SVG parsers to use Optional style return programming rather than out parameters. To make things even nicer, SVGPathSource based parsers now have a type per-parse function, which makes working with them much easier. In the future, we should consider exanding these new types to be used by SVGPathConsumer family of classes as well. * WebCore.xcodeproj/project.pbxproj: Add SVGPathSegValue.h, which was missing from the Xcode project. * svg/SVGAngleValue.cpp: (WebCore::parseAngleType): (WebCore::SVGAngleValue::setValueAsString): Adopt updated parseNumber() function, and do a drive by removal of an easy to remove upconvertedCharacters. * svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateMotionElement::calculateFromAndToValues): (WebCore::SVGAnimateMotionElement::calculateFromAndByValues): (WebCore::SVGAnimateMotionElement::calculateDistance): Now uses new parsePoint() function. Using Optional.valueOr() where the old code would have had parsePoint() doing the clearing. * svg/SVGAnimationElement.cpp: (WebCore::parseKeySplines): Now returns an Optional<Vector<UnitBezier>>. (WebCore::SVGAnimationElement::parseAttribute): Now uses new parseKeySplines, and does an explicit clear on parse failure (old code did it implicitly in the parse function). * svg/SVGFEConvolveMatrixElement.cpp: (WebCore::SVGFEConvolveMatrixElement::parseAttribute): * svg/SVGFEDiffuseLightingElement.cpp: (WebCore::SVGFEDiffuseLightingElement::parseAttribute): * svg/SVGFEDropShadowElement.cpp: (WebCore::SVGFEDropShadowElement::parseAttribute): * svg/SVGFEGaussianBlurElement.cpp: (WebCore::SVGFEGaussianBlurElement::parseAttribute): * svg/SVGFEMorphologyElement.cpp: (WebCore::SVGFEMorphologyElement::parseAttribute): * svg/SVGFESpecularLightingElement.cpp: (WebCore::SVGFESpecularLightingElement::parseAttribute): * svg/SVGFETurbulenceElement.cpp: (WebCore::SVGFETurbulenceElement::parseAttribute): Adopt Optional based parseNumberOptionalNumber. * svg/SVGImageElement.cpp: (WebCore::SVGImageElement::parseAttribute): * svg/SVGFEImageElement.cpp: (WebCore::SVGFEImageElement::parseAttribute): Simplify by using the SVGPreserveAspectRatioValue constructor which calls parse. No need for three lines. * svg/SVGFitToViewBox.cpp: (WebCore::SVGFitToViewBox::parseAttribute): Adopt new Optional based parseViewBox. Simplify by using the SVGPreserveAspectRatioValue constructor which calls parse. No need for three lines. (WebCore::SVGFitToViewBox::parseViewBox): Convert to be Optional based, and adopt new parseNumber functions. * svg/SVGFitToViewBox.h: Updated signatures for new Optional based functions. * svg/SVGGlyphRefElement.cpp: (WebCore::parseFloat): Adopt Optional based parseNumber. * svg/SVGHKernElement.cpp: (WebCore::SVGHKernElement::buildHorizontalKerningPair const): * svg/SVGHKernElement.h: * svg/SVGVKernElement.cpp: (WebCore::SVGVKernElement::buildVerticalKerningPair const): * svg/SVGVKernElement.h: Convert to be Optional based. Update a few callers to use makeString. * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::addKerningPair const): (WebCore::SVGToOTFFontConverter::appendKERNSubtable): Adopt new Optional based kerning pair builders. Add some moves to avoid some copies. * svg/SVGLengthValue.cpp: (WebCore::SVGLengthValue::setValueAsString): Adopt Optional based parseNumber. * svg/SVGNumberList.h: (WebCore::SVGNumberList::parse): Adopt Optional based parseNumber. * svg/SVGParserUtilities.cpp: (WebCore::genericParseNumber): (WebCore::parseNumber): (WebCore::genericParseArcFlag): (WebCore::parseArcFlag): (WebCore::parseNumberOptionalNumber): (WebCore::parsePoint): (WebCore::parseRect): (WebCore::parseGlyphName): (WebCore::parseUnicodeRange): (WebCore::parseKerningUnicodeString): (WebCore::genericParseFloatPoint): (WebCore::parseFloatPoint): (WebCore::parseSVGNumber): Deleted. (WebCore::parseNumberFromString): Deleted. (WebCore::parseDelimitedString): Deleted. (WebCore::parseFloatPoint2): Deleted. (WebCore::parseFloatPoint3): Deleted. * svg/SVGParserUtilities.h: (WebCore::isSVGSpace): (WebCore::skipOptionalSVGSpaces): (WebCore::skipOptionalSVGSpacesOrDelimiter): - Converts parse* functions to return Optional values rather than using outparameters. - Removes unused parseSVGNumber and parseDelimitedString. - Removes parseFloatPoint2 and parseFloatPoint3. They weren't useful enough to keep around. - Renames parseNumberFromString to parseNumber. The argument is a String, it's clear enough. - Replace boolean skip parameters with new enum SuffixSkippingPolicy. - Make parseFloatPoint have two overloads rather than being templatized to be consistent. * svg/SVGPathBlender.cpp: (WebCore::pullFromSources): (WebCore::SVGPathBlender::blendMoveToSegment): (WebCore::SVGPathBlender::blendLineToSegment): (WebCore::SVGPathBlender::blendLineToHorizontalSegment): (WebCore::SVGPathBlender::blendLineToVerticalSegment): (WebCore::SVGPathBlender::blendCurveToCubicSegment): (WebCore::SVGPathBlender::blendCurveToCubicSmoothSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSegment): (WebCore::SVGPathBlender::blendCurveToQuadraticSmoothSegment): (WebCore::SVGPathBlender::blendArcToSegment): (WebCore::SVGPathBlender::canBlendPaths): (WebCore::SVGPathBlender::blendAnimatedPath): Update to adopt new SVGPathSource interface. Added pullFromSources helper which substantially simplifies pulling from both the from and to source at the same time and is now possible due to all the SVGPathSource functions returning the segment types rather than taking them as out parameters. * svg/SVGPathByteStreamSource.cpp: (WebCore::SVGPathByteStreamSource::nextCommand): (WebCore::SVGPathByteStreamSource::parseSVGSegmentType): (WebCore::SVGPathByteStreamSource::parseMoveToSegment): (WebCore::SVGPathByteStreamSource::parseLineToSegment): (WebCore::SVGPathByteStreamSource::parseLineToHorizontalSegment): (WebCore::SVGPathByteStreamSource::parseLineToVerticalSegment): (WebCore::SVGPathByteStreamSource::parseCurveToCubicSegment): (WebCore::SVGPathByteStreamSource::parseCurveToCubicSmoothSegment): (WebCore::SVGPathByteStreamSource::parseCurveToQuadraticSegment): (WebCore::SVGPathByteStreamSource::parseCurveToQuadraticSmoothSegment): (WebCore::SVGPathByteStreamSource::parseArcToSegment): * svg/SVGPathByteStreamSource.h: Adopt new SVGPathSource interface. * svg/SVGPathParser.cpp: (WebCore::SVGPathParser::parseMoveToSegment): (WebCore::SVGPathParser::parseLineToSegment): (WebCore::SVGPathParser::parseLineToHorizontalSegment): (WebCore::SVGPathParser::parseLineToVerticalSegment): (WebCore::SVGPathParser::parseCurveToCubicSegment): (WebCore::SVGPathParser::parseCurveToCubicSmoothSegment): (WebCore::SVGPathParser::parseCurveToQuadraticSegment): (WebCore::SVGPathParser::parseCurveToQuadraticSmoothSegment): (WebCore::SVGPathParser::parseArcToSegment): (WebCore::SVGPathParser::parsePathData): Adapt to new SVGPathSource interface. Code reads a bit nicer now that we don't have a ton of local variables in each method. Could be made nicer in the future by adopting Segment types in the path consumer code. * svg/SVGPathSegListSource.cpp: (WebCore::SVGPathSegListSource::nextCommand): (WebCore::SVGPathSegListSource::parseSVGSegmentType): (WebCore::SVGPathSegListSource::parseMoveToSegment): (WebCore::SVGPathSegListSource::parseLineToSegment): (WebCore::SVGPathSegListSource::parseLineToHorizontalSegment): (WebCore::SVGPathSegListSource::parseLineToVerticalSegment): (WebCore::SVGPathSegListSource::parseCurveToCubicSegment): (WebCore::SVGPathSegListSource::parseCurveToCubicSmoothSegment): (WebCore::SVGPathSegListSource::parseCurveToQuadraticSegment): (WebCore::SVGPathSegListSource::parseCurveToQuadraticSmoothSegment): (WebCore::SVGPathSegListSource::parseArcToSegment): * svg/SVGPathSegListSource.h: Adopt new SVGPathSource interface. * svg/SVGPathSource.h: Update interface to return Optionals, with a specific type for segment kind that be parsed. * svg/SVGPathStringSource.cpp: (WebCore::nextCommandHelper): (WebCore::SVGPathStringSource::nextCommand): (WebCore::parseSVGSegmentTypeHelper): (WebCore::SVGPathStringSource::parseSVGSegmentType): (WebCore::SVGPathStringSource::parseMoveToSegment): (WebCore::SVGPathStringSource::parseLineToSegment): (WebCore::SVGPathStringSource::parseLineToHorizontalSegment): (WebCore::SVGPathStringSource::parseLineToVerticalSegment): (WebCore::SVGPathStringSource::parseCurveToCubicSegment): (WebCore::SVGPathStringSource::parseCurveToCubicSmoothSegment): (WebCore::SVGPathStringSource::parseCurveToQuadraticSegment): (WebCore::SVGPathStringSource::parseCurveToQuadraticSmoothSegment): (WebCore::SVGPathStringSource::parseArcToSegment): (WebCore::parseArcToSegmentHelper): Deleted. * svg/SVGPathStringSource.h: Adopt new SVGPathSource interface. Replace out of line helpers (or use of things like parseFloatPoint2) with generic lambda helpers, helping to keep the code more localized. * svg/SVGPointList.h: (WebCore::SVGPointList::parse): Adopt Optional based parseNumber. * svg/SVGTransformList.h: * svg/SVGTransformable.cpp: (WebCore::parseTransformParamList): (WebCore::SVGTransformable::parseTransformValue): (WebCore::SVGTransformable::parseAndSkipType): (WebCore::SVGTransformable::parseTransformType): * svg/SVGTransformable.h: Convert parseTransformValue/parseAndSkipType to be Optional based. * svg/SVGViewSpec.cpp: (WebCore::SVGViewSpec::parseViewSpec): Adopt Optional based parseViewBox. * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: Adopt Optional based parseNumber. * svg/properties/SVGPropertyTraits.h: (WebCore::SVGPropertyTraits<float>::fromString): (WebCore::SVGPropertyTraits<float>::parse): (WebCore::SVGPropertyTraits<FloatPoint>::fromString): (WebCore::SVGPropertyTraits<FloatPoint>::parse): (WebCore::SVGPropertyTraits<FloatRect>::fromString): (WebCore::SVGPropertyTraits<FloatRect>::parse): Adopt Optional based parsers. 2020-06-21 Sam Weinig <weinig@apple.com> Convert DateComponents parsing code to use Optional based return values rather than out-parameters https://bugs.webkit.org/show_bug.cgi?id=213440 Reviewed by Darin Adler. Rework DateComponents and Date/Time related InputTypes to use Optional based programming for parsing results. Also take the opportunity to remove unicode upconversion from DateComponent parsing and instead separate UChar and LChar variants via templates. * html/BaseDateAndTimeInputType.cpp: * html/BaseDateAndTimeInputType.h: * html/DateInputType.cpp: * html/DateInputType.h: * html/DateTimeInputType.cpp: * html/DateTimeInputType.h: * html/DateTimeLocalInputType.cpp: * html/DateTimeLocalInputType.h: * html/HTMLInputElement.cpp: * html/HTMLInputElement.h: * html/InputType.cpp: * html/InputType.h: * html/MonthInputType.cpp: * html/MonthInputType.h: * html/TimeInputType.cpp: * html/TimeInputType.h: * html/WeekInputType.cpp: * html/WeekInputType.h: - Removes parseToDateComponentsInternal. No need it and parseToDateComponents. - Makes parseToDateComponents pure virtual. The old code had a default implementations down in InputType, but it had no callers. - Remove iOS vs. non-iOS difference for dateType(). It is now available on InputType on all platforms. - Make setMillisecondToDateComponents and parseToDateComponents return an Optional. * platform/DateComponents.cpp: * platform/DateComponents.h: - Replace member function based interfaces for parsing/setting explicit time offsets with new factory functions that return Optional<DateComponents>. - These factories are implemented using the existing member functions, which are now private. - Make max/min constants constexpr. - Make parse* member functions templates to allow factory parse functions to call them without upconverting. - Replace header guard with #pragma once. 2020-06-21 Zalan Bujtas <zalan@apple.com> [LFC] Add basic support for width: fit-content https://bugs.webkit.org/show_bug.cgi?id=213444 Reviewed by Antti Koivisto. At this point this is just a shrink-to-fit sizing (missing the case when the available horizontal space is not specified). Test: fast/layoutformattingcontext/fit-content-width-simple.html * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedWidthValue): 2020-06-21 Jer Noble <jer.noble@apple.com> WebKit fails to leave audio routing arbitration during navigation, closing. https://bugs.webkit.org/show_bug.cgi?id=213426 <rdar://problem/64395051> Reviewed by Eric Carlson. When setting the AudioSession category, make sure to leave routing arbitration before bailing out early. Also, HTMLMediaElement::canProduceAudio() should return `false` when the element's document is suspended or stopped. Otherwise, the AudioSession will continue in the `MediaPlayback` category indefinitely, and routing arbitration will remain active. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::canProduceAudio const): * platform/audio/mac/AudioSessionMac.mm: (WebCore::AudioSession::setCategory): 2020-06-21 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add support for percentage min/max-width https://bugs.webkit.org/show_bug.cgi?id=213436 Reviewed by Antti Koivisto. 1. The table generates a principal block container box called the table wrapper box that contains the table box itself and any caption boxes. 2. The table wrapper box establishes a block formatting context, and the table box establishes a table formatting context. 3. The computed values of properties 'position', 'float', 'margin-*', 'top', 'right', 'bottom', and 'left' on the table element are used on the table wrapper box and not the table box; all other values of non-inheritable properties are used on the table box and not the table wrapper box. 4. In a block formatting context, each box's left outer edge touches the left edge of the containing block. This is true even in the presence of floats, unless the box establishes a new block formatting context (in which case the box itself may become narrower due to the floats) Now consider the following case: <div style="display: block; width: 500px;"> <div style="float: left; width: 100px;"></div> <div style="display: table; width: 10%;"></div> </div> 1. We create a table wrapper box to wrap the "display: table" block level box (#1). 2. The table wrapper box's width property is set to auto (#3). 3. Since it establishes a new block formatting context, the available horizontal space gets shrunk by the float (#4) 4. The table wrapper box's used width computes to 500px - 100px -> 400px; Now we are inside the BFC established by the table wrapper box and try to resolve the table's width -> %10. According to the normal BFC rules, it should compute to 10% of the containing block's logical width: 400px -> 40px. However in practice it computes to 50px (10% of 500px). Similar setup with non-table content would resolve the inner block level box's width to 40px; <div style="display: block; width: 500px"> <div style="float: left; width: 100px;"></div> <div style="display: block; overflow: hidden;"> <div style="display: block; width: 10%"></div> </div> </div> This needs clarification. Test: fast/layoutformattingcontext/float-avoider-available-horizontal-space3.html * layout/FormattingContext.h: (WebCore::Layout::FormattingContext::isTableWrapperBlockFormattingContext const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutInFlowContent): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h: 2020-06-20 Jer Noble <jer.noble@apple.com> RecoveryOS: PAL::getAVPlayerLayerClass() will crash when AVFoundation is missing https://bugs.webkit.org/show_bug.cgi?id=213437 <rdar://problem/64563064> Reviewed by Eric Carlson. Check PAL::isAVFoundationAvailable() before calling PAL::getAVPlayerLayerClass(); * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm: (WebCore::VideoLayerManagerObjC::setVideoLayer): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer): (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa): (WebCore::PlatformCALayerCocoa::clone const): (WebCore::PlatformCALayerCocoa::avPlayerLayer const): 2020-06-20 Simon Fraser <simon.fraser@apple.com> Crash under ScrollController::startSnapRubberbandTimer() firing https://bugs.webkit.org/show_bug.cgi?id=213439 <rdar://problem/63986013> Reviewed by Tim Horton. A wholesale destruction of the ScrollingTree (e.g. via ScrollingCoordinatorMac::pageDestroyed()) never ran the code to stop CFRunLoopTimers in ScrollController, which could lead to this crash. Fix by calling removeAllNodes() in ThreadedScrollingTree::invalidate(). Add an assertion in ScrollController's destructor that stopAllTimers() has been called, and have ScrollAnimator's destructor call stopAllTimers() too. * page/scrolling/ScrollingTree.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::invalidate): * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::~ScrollAnimator): * platform/cocoa/ScrollController.h: * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::~ScrollController): (WebCore::ScrollController::stopAllTimers): 2020-06-20 Zalan Bujtas <zalan@apple.com> [LFC][TFC][Quirk] Table height needs quirk handling https://bugs.webkit.org/show_bug.cgi?id=213430 Reviewed by Antti Koivisto. In quirks mode the used table height of an empty table is 0, while in standards mode we take the specified value into account and size the table accordingly. Tests: fast/layoutformattingcontext/empty-table-with-specified-height-quirk-simple.html fast/layoutformattingcontext/empty-table-with-specified-height-standards-simple.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.h: * layout/blockformatting/BlockFormattingContext.h: (WebCore::Layout::BlockFormattingContext::Quirks::geometry const): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h: (WebCore::Layout::TableWrapperBlockFormattingContext::Quirks::Quirks): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContextQuirks.cpp: Copied from Source/WebCore/layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h. (WebCore::Layout::TableWrapperBlockFormattingContext::Quirks::usedTableHeight const): 2020-06-19 Chris Dumez <cdumez@apple.com> [Cocoa] Delay issuing ManagedSession & Network Extension sandbox extensions until a load is actually issued https://bugs.webkit.org/show_bug.cgi?id=213414 <rdar://problem/64548684> Reviewed by Per Arne Vollan. setHasConsumedSandboxExtensions() can now get called several times, every time a WebPage is created. Once a sandbox extension has been consumed, there is no going back so return early if the state is already "Consumed". * platform/cocoa/NetworkExtensionContentFilter.mm: (WebCore::NetworkExtensionContentFilter::setHasConsumedSandboxExtensions): * platform/cocoa/ParentalControlsContentFilter.mm: (WebCore::ParentalControlsContentFilter::setHasConsumedSandboxExtension): 2020-06-19 Zalan Bujtas <zalan@apple.com> [AutoSizing] Resolve viewport units against the preferred content size https://bugs.webkit.org/show_bug.cgi?id=213408 <rdar://problem/64267539> Reviewed by Tim Horton. Instead of resolving the viewport units against the maximum content size constraints, let's use the preferred content size. It ensures that content with vw, vh units does not grow beyond the preferred content size. Test: fast/dynamic/size-to-content-autosize-with-viewport-units.html * page/FrameView.cpp: (WebCore::FrameView::performSizeToContentAutoSize): (WebCore::FrameView::enableAutoSizeMode): Let's "ignore" viewport units during the initial pass and use the preferred width to finalize the vw vh unit values (we don't really ignore them, but they are resolved against a [ 1, 1 ] viewport). This approach fails if the main content has 100vw with overflow hidden. Such content would end up with a [ 1, 1 ] size (we might want to detect it and resolved the values against the horizontal constraint). (WebCore::FrameView::overrideViewportWidthForCSSViewportUnits): (WebCore::FrameView::resetOverriddenViewportWidthForCSSViewportUnits): * page/FrameView.h: * testing/Internals.cpp: (WebCore::Internals::enableSizeToContentAutoSizeMode): * testing/Internals.h: * testing/Internals.idl: 2020-06-19 Wenson Hsieh <wenson_hsieh@apple.com> [macOS] Move progress bar painting code off of Carbon API https://bugs.webkit.org/show_bug.cgi?id=213405 <rdar://problem/63958537> Reviewed by Tim Horton. Adopts CoreUI constants and AppKit SPI (`-[NSAppearance _drawInRect:context:options:]`) when painting progress elements. This is being done in light of recent changes around how `HIThemeDrawTrack` draws progress bars on recent versions of macOS; it has been recommended to us that we move away from using Carbon, and instead use AppKit. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintProgressBar): The `NSControlSize` to `CUISize` mapping here looks counterintuitive, but matches our current behavior. This is because `kThemeLargeProgressBar` and `kThemeLargeIndeterminateBar` both map to `kCUISizeRegular`, while `kThemeMediumIndeterminateBar` and `kThemeMediumProgressBar` map to `kCUISizeSmall`. 2020-06-19 Clark Wang <clark_wang@apple.com> Remove setVelocity() from PannerNode https://bugs.webkit.org/show_bug.cgi?id=213360 Reviewed by Chris Dumez. Removed setVelocity() and other velocity dependencies, as per spec: https://www.w3.org/TR/webaudio/#pannernode. Simplified dopplerRate, since sourceVelocity is always zero. Re-baselined previous test that now passes with velocity removed. * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::PannerNode): (WebCore::PannerNode::dopplerRate): * Modules/webaudio/PannerNode.h: * Modules/webaudio/PannerNode.idl: 2020-06-19 Wenson Hsieh <wenson_hsieh@apple.com> REGRESSION (r263253): Search field results and cancel buttons have their own focus rings https://bugs.webkit.org/show_bug.cgi?id=213413 <rdar://problem/64548419> Reviewed by Tim Horton. After r263253, `paintCellAndSetFocusedElementNeedsRepaintIfNecessary` is used when painting the buttons in a search field's shadow root. However, the renderer that is passed in (which is used to determine whether we should additionally draw focus rings) is the input element's renderer rather than the renderers of the results and cancel buttons themselves. This means that when the search field is focused, we will draw focus rings around each of the buttons in the shadow root as well. Address this by using `box` (the buttons' RenderBoxes) instead. Test: fast/forms/search-field-buttons-do-not-have-focus-rings.html * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintSearchFieldCancelButton): (WebCore::RenderThemeMac::paintSearchFieldResultsButton): 2020-06-19 Pinki Gyanchandani <pgyanchandani@apple.com> Crash in WebCore::Range::borderAndTextRects https://bugs.webkit.org/show_bug.cgi?id=209379 Reviewed by Darin Adler. When a parentless node is moved to a new document, then all ranges associated with this node and its children also should be updated with new document information. Test woould be submitted later. * dom/Document.cpp: (WebCore::Document::parentlessNodeMoveToNewDocument): * dom/Document.h: * dom/Node.cpp: (WebCore::Node::moveNodeToNewDocument): * dom/Range.cpp: (WebCore::Range::parentlessNodeMoveToNewDocumentAffectsRange): (WebCore::Range::updateRangeForParentlessNodeMoveToNewDocument): * dom/Range.h: 2020-06-19 Truitt Savell <tsavell@apple.com> Unreviewed, reverting r263121. Broke media/video-fullscreen-only-playback.html on Catalina Debug Reverted changeset: "Don't claim to support fullscreen mode unless fullScreenEnabled setting is enabled" https://bugs.webkit.org/show_bug.cgi?id=213142 https://trac.webkit.org/changeset/263121 2020-06-19 Said Abou-Hallawa <sabouhallawa@apple.com> [CG] REGRESSION (r256892): Luminance SVG mask is not applied when accelerated drawing is enabled https://bugs.webkit.org/show_bug.cgi?id=213403 <rdar://problem/64489419> Reviewed by Simon Fraser. Test: svg/masking/mask-css-luminance.html If the ImageBuffer is backed by an IOSurface, its context has to be flushed out before convertToLuminanceMask() can access its data. * platform/graphics/ConcreteImageBuffer.h: 2020-06-19 Chris Dumez <cdumez@apple.com> Avoid initializing RenderTheme singleton unnecessarily in the UIProcess https://bugs.webkit.org/show_bug.cgi?id=213406 Reviewed by Per Arne Vollan. Avoid initializing RenderTheme singleton unnecessarily in the UIProcess. Instead, introduce a static function to get the focus ring color on iOS. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::systemFocusRingColor): (WebCore::RenderThemeIOS::platformFocusRingColor const): 2020-06-19 Andres Gonzalez <andresg_22@apple.com> AX: web process crash in AXObjectCache::postNotification. https://bugs.webkit.org/show_bug.cgi?id=213398 Reviewed by Chris Fleizach. AXObjectCache was being instantiated on the AX secondary thread. Therefore the timers for the different delayed notifications where initialized with the secondary thread. When postNotification was triggered on the main thread as it should, and the timer was accessed, the timer would assert/crash for being accessed in a thread different than where it was created. This change guaranties that AXObjectCache is always created on the main thread. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::enableAccessibility): (WebCore::AXObjectCache::AXObjectCache): (WebCore::AXObjectCache::postNotification): 2020-06-19 Chris Dumez <cdumez@apple.com> [iOS] RenderThemeIOS::cssValueToSystemColorMap() does an unnecessary linear search under systemColorFromCSSValueID() https://bugs.webkit.org/show_bug.cgi?id=213396 Reviewed by Timothy Hatcher. RenderThemeIOS::cssValueToSystemColorMap() does an unnecessary linear search under systemColorFromCSSValueID(). cssValueToSystemColorMap() already has the selector, yet it passes a CSSValueID to systemColorFromCSSValueID() which then does a linear search to match the CSSValueID to a selector. This was very inefficient / unfortunate. This patch introduces a systemColorFromCSSValueIDSelector() which takes in a selector instead of a CSSValueID. I have also moved the constructor of the LocalCurrentTraitCollection variable to the call site so that we don't keep constructing / destroying it for each loop iteration. The traces show us spending a lot of time in its constructor / destructor. * rendering/RenderThemeIOS.mm: (WebCore::systemColorFromCSSValueIDSelector): (WebCore::RenderThemeIOS::cssValueToSystemColorMap): 2020-06-19 James Darpinian <jdarpinian@chromium.org> [WebGL2] Uniform Buffer Objects https://bugs.webkit.org/show_bug.cgi?id=209518 Reviewed by Dean Jackson. All uniform buffer object conformance tests pass. Implemented Uniform Buffer Object related functions: bindBufferBase, bindBufferRange, getUniformIndices, getActiveUniforms, getUniformBlockIndex, getActiveUniformBlockParameter, getActiveUniformBlockName, uniformBlockBinding Additionally, fixed many tangentially related issues: getIntegeri_v and getInteger64i_v were not present. drawArraysInstances and drawElementsInstanced did not work for WebGL 2. drawRangeElements was not implemented. WebGLAny did not support Vector<unsigned>, so Uint32Arrays could not be returned from WebGL functions. The maximum uniform location length was wrong for WebGL 2. Transform feedback indexed binding points weren't being tracked. Some functions in ExtensionsGLANGLE didn't call makeContextCurrent. New WebGL 2 buffer usage types COPY and READ weren't supported in bufferData. pause/resumeTransformFeedback were unimplemented. getParameter(READ_BUFFER) was unimplemented. readBuffer conformance test was incorrect. * bindings/js/JSDOMConvertWebGL.cpp: (WebCore::convertToJSValue): * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::~WebGL2RenderingContext): (WebCore::WebGL2RenderingContext::initializeNewContext): (WebCore::WebGL2RenderingContext::drawRangeElements): (WebCore::WebGL2RenderingContext::setIndexedBufferBinding): (WebCore::WebGL2RenderingContext::bindBufferBase): (WebCore::WebGL2RenderingContext::bindBufferRange): (WebCore::WebGL2RenderingContext::getIndexedParameter): (WebCore::WebGL2RenderingContext::getUniformIndices): (WebCore::WebGL2RenderingContext::getActiveUniforms): (WebCore::WebGL2RenderingContext::getUniformBlockIndex): (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter): (WebCore::WebGL2RenderingContext::getActiveUniformBlockName): (WebCore::WebGL2RenderingContext::uniformBlockBinding): * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLAny.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::validateLocationLength): (WebCore::WebGLRenderingContextBase::validateBufferDataParameters): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didFinishLoading): * platform/graphics/GraphicsContextGL.h: * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::getTranslatedShaderSourceANGLE): (WebCore::ExtensionsGLANGLE::blitFramebuffer): (WebCore::ExtensionsGLANGLE::renderbufferStorageMultisample): (WebCore::ExtensionsGLANGLE::drawBuffersEXT): (WebCore::ExtensionsGLANGLE::getBooleanvRobustANGLE): (WebCore::ExtensionsGLANGLE::getBufferParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getFloatvRobustANGLE): (WebCore::ExtensionsGLANGLE::getFramebufferAttachmentParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getIntegervRobustANGLE): (WebCore::ExtensionsGLANGLE::getProgramivRobustANGLE): (WebCore::ExtensionsGLANGLE::getRenderbufferParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getShaderivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getUniformfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getUniformivRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribivRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribPointervRobustANGLE): (WebCore::ExtensionsGLANGLE::readPixelsRobustANGLE): (WebCore::ExtensionsGLANGLE::texImage2DRobustANGLE): (WebCore::ExtensionsGLANGLE::texParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::texParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::texSubImage2DRobustANGLE): (WebCore::ExtensionsGLANGLE::compressedTexImage2DRobustANGLE): (WebCore::ExtensionsGLANGLE::compressedTexSubImage2DRobustANGLE): (WebCore::ExtensionsGLANGLE::compressedTexImage3DRobustANGLE): (WebCore::ExtensionsGLANGLE::compressedTexSubImage3DRobustANGLE): (WebCore::ExtensionsGLANGLE::texImage3DRobustANGLE): (WebCore::ExtensionsGLANGLE::texSubImage3DRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryivRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryObjectuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getBufferPointervRobustANGLE): (WebCore::ExtensionsGLANGLE::getIntegeri_vRobustANGLE): (WebCore::ExtensionsGLANGLE::getInternalformativRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribIivRobustANGLE): (WebCore::ExtensionsGLANGLE::getVertexAttribIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getUniformuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getActiveUniformBlockivRobustANGLE): (WebCore::ExtensionsGLANGLE::getInteger64vRobustANGLE): (WebCore::ExtensionsGLANGLE::getInteger64i_vRobustANGLE): (WebCore::ExtensionsGLANGLE::getBufferParameteri64vRobustANGLE): (WebCore::ExtensionsGLANGLE::samplerParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::samplerParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getSamplerParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getSamplerParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getFramebufferParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getProgramInterfaceivRobustANGLE): (WebCore::ExtensionsGLANGLE::getBooleani_vRobustANGLE): (WebCore::ExtensionsGLANGLE::getMultisamplefvRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getPointervRobustANGLERobustANGLE): (WebCore::ExtensionsGLANGLE::readnPixelsRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformfvRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformivRobustANGLE): (WebCore::ExtensionsGLANGLE::getnUniformuivRobustANGLE): (WebCore::ExtensionsGLANGLE::texParameterIivRobustANGLE): (WebCore::ExtensionsGLANGLE::texParameterIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexParameterIivRobustANGLE): (WebCore::ExtensionsGLANGLE::getTexParameterIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::samplerParameterIivRobustANGLE): (WebCore::ExtensionsGLANGLE::samplerParameterIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getSamplerParameterIivRobustANGLE): (WebCore::ExtensionsGLANGLE::getSamplerParameterIuivRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryObjectivRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryObjecti64vRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryObjectui64vRobustANGLE): * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::getIntegeri_v): (WebCore::GraphicsContextGLOpenGL::getInteger64v): (WebCore::GraphicsContextGLOpenGL::getInteger64i_v): (WebCore::GraphicsContextGLOpenGL::drawArraysInstanced): (WebCore::GraphicsContextGLOpenGL::drawElementsInstanced): (WebCore::GraphicsContextGLOpenGL::getUniformBlockIndex): (WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockiv): (WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockName): (WebCore::GraphicsContextGLOpenGL::uniformBlockBinding): (WebCore::GraphicsContextGLOpenGL::drawRangeElements): (WebCore::GraphicsContextGLOpenGL::pauseTransformFeedback): (WebCore::GraphicsContextGLOpenGL::resumeTransformFeedback): (WebCore::GraphicsContextGLOpenGL::bindBufferRange): (WebCore::GraphicsContextGLOpenGL::getUniformIndices): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp: (WebCore::GraphicsContextGLOpenGL::getIntegeri_v): * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::getInteger64v): (WebCore::GraphicsContextGLOpenGL::getInteger64i_v): 2020-06-19 Chris Dumez <cdumez@apple.com> [iOS] Drop std::call_once() from RenderThemeIOS::cssValueToSystemColorMap() https://bugs.webkit.org/show_bug.cgi?id=213392 Reviewed by Geoffrey Garen. Drop std::call_once() from RenderThemeIOS::cssValueToSystemColorMap() since this function is always called from the main thread. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::cssValueToSystemColorMap): 2020-06-19 Rob Buis <rbuis@igalia.com> Enable referrer policy attribute support by default https://bugs.webkit.org/show_bug.cgi?id=213285 Reviewed by Youenn Fablet. Enable referrer policy attribute support by default by flipping the switch. * page/RuntimeEnabledFeatures.h: 2020-06-19 Chris Dumez <cdumez@apple.com> Move Prefixed WebAudio interfaces behind their own feature flag https://bugs.webkit.org/show_bug.cgi?id=213356 Reviewed by Darin Adler. Move Prefixed WebAudio interfaces behind their own feature flag, on by default. This will allow us to easily disable the prefixed API and will also allow it to live independently from the unprefixed API. * Modules/webaudio/AudioContext.idl: * Modules/webaudio/WebKitAudioContext.idl: * Modules/webaudio/WebKitAudioPannerNode.idl: * Modules/webaudio/WebKitOfflineAudioContext.idl: * bindings/js/WebCoreBuiltinNames.h: * page/Settings.yaml: 2020-06-19 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Do not special-case empty tables https://bugs.webkit.org/show_bug.cgi?id=213378 Reviewed by Antti Koivisto. Now that min/max-width support is added, empty tables can just go through the normal width computation path. Test: fast/layoutformattingcontext/table-min-max-width-empty-content-simple.html * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): 2020-06-10 Sergio Villar Senin <svillar@igalia.com> REGRESSION(r262254?): [WPE] imported/w3c/web-platform-tests/webxr/idlharness.https.window.html is failing https://bugs.webkit.org/show_bug.cgi?id=212897 Reviewed by Youenn Fablet. WPT tests were updated in r262254 and they already include the latest changes in the specs. Among others the XR interface was renamed to XRSystem. We were already using that name in the C++ code but not in the JS interface. The WPT update brings in another set of changes like the new XRLayer which is already not supported (I am adding it soon in another patch). Last but not least, the new tests include checks for the XRPermissionStatus interface which is not going to be implemented soon as it requires the Permission API which is not supported in WebKit yet. All in all, this patch renames XR to XRSystem and marks as failing the XRLayer (temporarily) and XRPermissionStatus checks. No new tests as there is no change in functionality. * Modules/webxr/WebXRSystem.idl: Rename XR to XRSystem. * bindings/js/WebCoreBuiltinNames.h: Ditto. 2020-06-19 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Min/max-width should always be resolved against the containing block width https://bugs.webkit.org/show_bug.cgi?id=213365 Reviewed by Antti Koivisto. Even when neighboring floats shrink the available horizontal space, the min/max(normal) widths should be resolved against the containing block's logical width. Test: fast/layoutformattingcontext/float-avoider-available-horizontal-space2.html * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::computedWidthAndMargin): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): 2020-06-10 Sergio Villar Senin <svillar@igalia.com> [WebXR] unsigned long in IDL should be translated as unsigned in C++ code https://bugs.webkit.org/show_bug.cgi?id=213020 Reviewed by Darin Adler. The "unsigned long" type definition in IDL must be translated to unsigned in C++ code. I'm also replacing the very long XRFrameRequestCallback::Identifier by simply unsigned as it isn't adding anything. No new test required as there is no change in functionality, just removing an alias. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::requestAnimationFrame): (WebCore::WebXRSession::cancelAnimationFrame): * Modules/webxr/WebXRSession.h: * Modules/webxr/XRFrameRequestCallback.h: (WebCore::XRFrameRequestCallback::callbackId): (WebCore::XRFrameRequestCallback::setCallbackId): 2020-06-19 Myles C. Maxfield <mmaxfield@apple.com> [Cocoa] Unify "font:" CSS shorthand values between macOS and iOS family https://bugs.webkit.org/show_bug.cgi?id=213332 <rdar://problem/64479189> Reviewed by Tim Horton and Darin Adler. They exist on all Cocoa platforms, so we might as well hook them up. This unifies the shorthand CSS value handling from RenderThemeMac and RenderThemeIOS into RenderThemeCocoa. This has two effects: - It hooks up the -apple-system keywords on macOS (they previously were only implemented for the iOS family). - It hooks up the CSS2 keywords (caption, menu, etc.) on the iOS family (they previously were only implemented on Mac). All these fonts have been around since Mojave, so there is no need to introduce any new platform guards. Tests: fast/text/text-styles/-apple-system/-apple-system-body.html fast/text/text-styles/-apple-system/-apple-system-caption1.html fast/text/text-styles/-apple-system/-apple-system-caption2.html fast/text/text-styles/-apple-system/-apple-system-footnote.html fast/text/text-styles/-apple-system/-apple-system-headline.html fast/text/text-styles/-apple-system/-apple-system-short-body.html fast/text/text-styles/-apple-system/-apple-system-short-caption1.html fast/text/text-styles/-apple-system/-apple-system-short-footnote.html fast/text/text-styles/-apple-system/-apple-system-short-headline.html fast/text/text-styles/-apple-system/-apple-system-short-subheadline.html fast/text/text-styles/-apple-system/-apple-system-subheadline.html fast/text/text-styles/-apple-system/-apple-system-tall-body.html fast/text/text-styles/-apple-system/-apple-system-title0.html fast/text/text-styles/-apple-system/-apple-system-title1.html fast/text/text-styles/-apple-system/-apple-system-title2.html fast/text/text-styles/-apple-system/-apple-system-title3.html fast/text/text-styles/-apple-system/-apple-system-title4.html fast/text/text-styles/-webkit-control.html fast/text/text-styles/-webkit-mini-control.html fast/text/text-styles/-webkit-small-control.html fast/text/text-styles/bogus.html fast/text/text-styles/caption.html fast/text/text-styles/icon.html fast/text/text-styles/menu.html fast/text/text-styles/message-box.html fast/text/text-styles/small-caption.html fast/text/text-styles/status-bar.html * css/CSSValueKeywords.in: All Cocoa ports should be able to parse these values * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::fontWithFamilySpecialCase): Move code that used to be in the Mac and iOS implementations of platformFontWithFamilySpecialCase() (inside FontCacheMac.mm and FontCacheIOS.mm) to be shared to be shared inside fontWithFamilySpecialCase(). * platform/graphics/cocoa/FontDescriptionCocoa.cpp: Remove platform guards. (WebCore::convertArray): (WebCore::matchSystemFontUse): * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: Ditto. (WebCore::SystemFontDatabaseCoreText::createTextStyleFont): * platform/graphics/ios/FontCacheIOS.mm: Move code from here into FontCacheCoreText. (WebCore::platformFontWithFamilySpecialCase): * platform/graphics/mac/FontCacheMac.mm: Ditto. (WebCore::platformFontWithFamilySpecialCase): * platform/mac/ThemeMac.h: Delete systemFontSizeFor(NSControlSize) because <rdar://problem/60350699> is fixed. * platform/mac/ThemeMac.mm: Ditto. (WebCore::ThemeMac::controlFont const): (WebCore::ThemeMac::systemFontSizeFor): Deleted. * rendering/RenderThemeCocoa.h: Previously, code was calling RenderThemeIOS::contentSizeCategory(), which was a static function. Now, both Mac and iOS need to be able to call this. However, the implementation of this function is different between Mac and iOS. So, turn it from a static function in RenderThemeIOS into a method in RenderThemeCocoa, and give RenderThemeCocoa a singleton() function that downcasts the return of RenderTheme::singleton(). This way, instead of calling RenderThemeIOS::contentSizeCategory(), code can call RenderThemeCocoa::singleton().contentSizeCategory(). * rendering/RenderThemeCocoa.mm: Move code from RenderThemeIOS and RenderThemeMac into RenderThemeCocoa. (WebCore::RenderThemeCocoa::singleton): (WebCore::RenderThemeCocoa::cachedSystemFontDescription const): (WebCore::cssWeightOfSystemFont): (WebCore::RenderThemeCocoa::updateCachedSystemFontDescription const): * rendering/RenderThemeIOS.h: Ditto. * rendering/RenderThemeIOS.mm: Ditto. (WebCore::RenderThemeIOS::contentSizeCategory const): (WebCore::attachmentActionFont): (WebCore::attachmentTitleFont): (WebCore::RenderThemeIOS::contentSizeCategory): Deleted. (WebCore::RenderThemeIOS::cachedSystemFontDescription const): Deleted. (WebCore::cssWeightOfSystemFont): Deleted. (WebCore::RenderThemeIOS::updateCachedSystemFontDescription const): Deleted. * rendering/RenderThemeMac.h: Ditto. * rendering/RenderThemeMac.mm: Ditto. (WebCore::RenderThemeMac::contentSizeCategory const): (WebCore::RenderThemeMac::setFontFromControlSize const): (WebCore::RenderThemeMac::controlSizeForSystemFont const): (WebCore::toFontWeight): Deleted. (WebCore::RenderThemeMac::updateCachedSystemFontDescription const): Deleted. 2020-06-18 Doug Kelly <dougk@apple.com> Use paintCellAndSetFocusedElementNeedsRepaintIfNecessary() for search field buttons https://bugs.webkit.org/show_bug.cgi?id=213352 <rdar://problem/57129008> Reviewed by Simon Fraser. The search fields cancel and results buttons should use the common paintCellAndSetFocusedElementNeedsRepaintIfNecessary() function instead of directly painting the cell. This allows for an image buffer to be used for drawing specifically in cases when it becomes needed, when a scale (either via zoom or CSS transform) is applied. This also moves the logic for determining if an image buffer should be used into ThemeMac::drawCellOrFocusRingWithViewIntoContext(), which uses the current user-defined CTM (inverting the base CTM to negate the effect of a device-specific scale factor). This also negates the need for the page scale factor and the effective zoom applied to the renderer style, since it is computed into the CTM already. * platform/mac/ThemeMac.h: * platform/mac/ThemeMac.mm: (WebCore::paintToggleButton): (WebCore::paintButton): (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext): (WebCore::paintColorWell): (WebCore::ThemeMac::paint): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary): (WebCore::RenderThemeMac::paintSliderThumb): (WebCore::RenderThemeMac::paintSearchFieldCancelButton): (WebCore::RenderThemeMac::paintSearchFieldResultsButton): 2020-06-18 Devin Rousso <drousso@apple.com> Web Inspector: ASSERTION FAILED: decodedLength >= dataLength at WebCore::NetworkResourcesData::ResourceData::decodeDataToContent() https://bugs.webkit.org/show_bug.cgi?id=213271 <rdar://problem/64168350> Reviewed by Brian Burg. Remove the invalid `ASSERT(decodedLength >= dataLength)` as it's very possible for decoded content to be smaller than encoded content (e.g. something gzipped). Use `String::sizeInBytes` instead of `StringImpl::sizeInBytes` as the latter also includes `sizeof(*this)`, which is not really part of the resource's size, as it's really more of an implementation detail. * inspector/NetworkResourcesData.h: * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::ResourceData::removeContent): (WebCore::NetworkResourcesData::ResourceData::decodeDataToContent): (WebCore::NetworkResourcesData::setResourceContent): (WebCore::NetworkResourcesData::maybeDecodeDataToContent): (WebCore::contentSizeInBytes): Deleted. 2020-06-18 Andy Estes <aestes@apple.com> [Apple Pay] Fix a log message typo in PaymentCoordinator::didAuthorizePayment Rubber-stamped by Beth Dakin. * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::didAuthorizePayment): Logged the correct function name. 2020-06-18 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Available space computation for the float avoider needs coordinate mapping https://bugs.webkit.org/show_bug.cgi?id=213339 Reviewed by Antti Koivisto. The FloatConstraints position values are in formatting root coordinates but the available space requires containing block coordinates. Test: fast/layoutformattingcontext/float-avoider-available-horizontal-space.html * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider): 2020-06-18 Stephan Szabo <stephan.szabo@sony.com> [PlayStation] Build fix for errors with structured bindings to const structure https://bugs.webkit.org/show_bug.cgi?id=213323 Reviewed by Fujii Hironori. Our system seems to have trouble with these structured bindings, similar to what was previously seen for clang-cl. No new tests, build fix. * inspector/agents/InspectorNetworkAgent.cpp: 2020-06-18 Youenn Fablet <youenn@apple.com> REGRESSION (r263098): [Win10] http/tests/security/cross-origin-clean-css-resource-timing.html and http/tests/security/cross-origin-css-resource-timing.html are failing https://bugs.webkit.org/show_bug.cgi?id=213303 <rdar://problem/64452203> Reviewed by Alex Christensen. Covered by existing tests. * loader/ResourceLoaderOptions.h: Reverting part of https://trac.webkit.org/changeset/263098/webkit that might have broken win10 bots. 2020-06-18 Víctor Manuel Jáquez Leal <vjaquez@igalia.com> [GStreamer] Avoid setting GstContext twice in GLVideoSinkGStreamer https://bugs.webkit.org/show_bug.cgi?id=213029 Reviewed by Xabier Rodriguez-Calvar. There is a reported issued in GStrearGL < 1.17 for GLBaseFilter can't handle its GLContext and Display reassignation. This patch aims to to avoid setting Display or GL Context in GL video sink multiple times by checking if the video sink bin already has those contexts. Also, instead of relying on an assert if something goes wrong at fetching the GL parameters, it returns an error at state change. No new tests required. * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp: (requestGLContext): (setGLContext): new function. (webKitGLVideoSinkChangeState): 2020-06-18 Doug Kelly <dougk@apple.com> Clamp text run width to zero https://bugs.webkit.org/show_bug.cgi?id=212655 <rdar://problem/61462335> Reviewed by Said Abou-Hallawa. It's possible to end up with a text run with negative width, if the text run is relatively short and the character spacing is relatively large (but negative). If this occurs, clamp the value to zero. This also adds additional asserts and checks to ensure the value remains non-negative. * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::drawLinesForText): * rendering/ComplexLineLayout.cpp: (WebCore::setLogicalWidthForTextRun): * rendering/RenderText.cpp: (WebCore::RenderText::width const): 2020-06-18 David Kilzer <ddkilzer@apple.com> Fix misspellings of "namespace" in comments * page/SpatialNavigation.h: * platform/gtk/RenderThemeScrollbar.cpp: 2020-06-18 David Kilzer <ddkilzer@apple.com> [IPC hardening] OptionSet<> values should be validated <https://webkit.org/b/213199> <rdar://problem/64369963> Reviewed by Anders Carlsson. Summary: - Add WTF::EnumTraits<> for all OptionSet<> enums. - Specify unsigned backing types for enum classes. * loader/CrossOriginAccessControl.h: * page/ActivityState.h: * page/AutoplayEvent.h: * page/CrossSiteNavigationDataTransfer.h: * page/LayoutMilestone.h: * page/TextIndicator.h: * platform/PlatformEvent.h: * platform/graphics/GraphicsContext.h: 2020-06-17 Clark Wang <clark_wang@apple.com> Added missing orientation attributes to PannerNode https://bugs.webkit.org/show_bug.cgi?id=213301 Reviewed by Chris Dumez. Implemented orientation attributes in PannerNode interface, as per spec: https://www.w3.org/TR/webaudio/#pannernode. Added FIXME comments for removing velocity later. Re-baselined previous tests that now have passing test cases. * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::PannerNode): (WebCore::PannerNode::orientation const): (WebCore::PannerNode::setOrientation): (WebCore::PannerNode::distanceConeGain): * Modules/webaudio/PannerNode.h: * Modules/webaudio/PannerNode.idl: 2020-06-17 Chris Dumez <cdumez@apple.com> Add experimental feature flag for modern & unprefixed WebAudio API https://bugs.webkit.org/show_bug.cgi?id=213268 Reviewed by Jer Noble. Add experimental feature flag for modern & unprefixed WebAudio API, off by default. This patch split the AudioContext, OfflineAudioContext and PannerNode IDL interfaces into their prefixed and unprefixed versions. The unprefixed versions are behind the new experimental feature flag that is currently off by default but automatically gets turned on in the context of layout tests. This will give us more flexibility when working on the modern and unprefixed WebAudio API as we will not have to worry about backward compatibility. This also allows us to easily turn it on or off via the experimental features menu in Safari. No new tests, rebaselined existing tests. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/webaudio/AnalyserNode.cpp: (WebCore::AnalyserNode::AnalyserNode): * Modules/webaudio/AnalyserNode.h: * Modules/webaudio/AudioBasicInspectorNode.cpp: (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode): * Modules/webaudio/AudioBasicInspectorNode.h: * Modules/webaudio/AudioBasicProcessorNode.cpp: (WebCore::AudioBasicProcessorNode::AudioBasicProcessorNode): * Modules/webaudio/AudioBasicProcessorNode.h: * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::create): (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): (WebCore::AudioBufferSourceNode::setBuffer): (WebCore::AudioBufferSourceNode::setPannerNode): * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContextBase::AudioContextBase): (WebCore::AudioContext::AudioContext): (WebCore::AudioContextBase::document const): (WebCore::AudioContextBase::scriptExecutionContext const): * Modules/webaudio/AudioContext.h: (WebCore::AudioContextBase::AutoLocker::AutoLocker): (WebCore::AudioContextBase::AutoLocker::~AutoLocker): (WebCore::AudioContext::maxNumberOfChannels): (isType): * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioContextState.h: Copied from Source/WebCore/Modules/webaudio/OfflineAudioContext.idl. * Modules/webaudio/AudioContextState.idl: Copied from Source/WebCore/Modules/webaudio/OfflineAudioContext.idl. * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::AudioDestinationNode): * Modules/webaudio/AudioDestinationNode.h: * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::AudioNode): (WebCore::AudioNode::connect): (WebCore::AudioNode::disconnect): (WebCore::AudioNode::setChannelCount): (WebCore::AudioNode::setChannelCountMode): (WebCore::AudioNode::setChannelInterpretation): (WebCore::AudioNode::enableOutputsIfNecessary): (WebCore::AudioNode::deref): (WebCore::AudioNode::contextForBindings const): * Modules/webaudio/AudioNode.h: (WebCore::AudioNode::context): (WebCore::AudioNode::context const): * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioNodeOutput.h: (WebCore::AudioNodeOutput::context): * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::AudioParam): * Modules/webaudio/AudioParam.h: * Modules/webaudio/AudioParamTimeline.cpp: (WebCore::AudioParamTimeline::valueForContextTime): * Modules/webaudio/AudioParamTimeline.h: * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode): * Modules/webaudio/AudioScheduledSourceNode.h: * Modules/webaudio/AudioSummingJunction.cpp: (WebCore::AudioSummingJunction::AudioSummingJunction): * Modules/webaudio/AudioSummingJunction.h: (WebCore::AudioSummingJunction::context): * Modules/webaudio/BiquadFilterNode.cpp: (WebCore::BiquadFilterNode::BiquadFilterNode): * Modules/webaudio/BiquadFilterNode.h: * Modules/webaudio/BiquadProcessor.cpp: (WebCore::BiquadProcessor::BiquadProcessor): * Modules/webaudio/BiquadProcessor.h: * Modules/webaudio/ChannelMergerNode.cpp: (WebCore::ChannelMergerNode::create): (WebCore::ChannelMergerNode::ChannelMergerNode): * Modules/webaudio/ChannelMergerNode.h: * Modules/webaudio/ChannelSplitterNode.cpp: (WebCore::ChannelSplitterNode::create): (WebCore::ChannelSplitterNode::ChannelSplitterNode): * Modules/webaudio/ChannelSplitterNode.h: * Modules/webaudio/ConvolverNode.cpp: (WebCore::ConvolverNode::ConvolverNode): * Modules/webaudio/ConvolverNode.h: * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode): * Modules/webaudio/DefaultAudioDestinationNode.h: * Modules/webaudio/DelayNode.cpp: (WebCore::DelayNode::DelayNode): (WebCore::DelayNode::create): * Modules/webaudio/DelayNode.h: * Modules/webaudio/DelayProcessor.cpp: (WebCore::DelayProcessor::DelayProcessor): * Modules/webaudio/DelayProcessor.h: * Modules/webaudio/DistanceModelType.h: Copied from Source/WebCore/Modules/webaudio/OfflineAudioContext.idl. * Modules/webaudio/DistanceModelType.idl: Copied from Source/WebCore/Modules/webaudio/OfflineAudioContext.idl. * Modules/webaudio/DynamicsCompressorNode.cpp: (WebCore::DynamicsCompressorNode::DynamicsCompressorNode): * Modules/webaudio/DynamicsCompressorNode.h: * Modules/webaudio/GainNode.cpp: (WebCore::GainNode::GainNode): * Modules/webaudio/GainNode.h: * Modules/webaudio/MediaElementAudioSourceNode.cpp: (WebCore::MediaElementAudioSourceNode::create): (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode): (WebCore::MediaElementAudioSourceNode::setFormat): * Modules/webaudio/MediaElementAudioSourceNode.h: * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: (WebCore::MediaStreamAudioDestinationNode::create): (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode): * Modules/webaudio/MediaStreamAudioDestinationNode.h: * Modules/webaudio/MediaStreamAudioSourceNode.cpp: (WebCore::MediaStreamAudioSourceNode::create): (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode): * Modules/webaudio/MediaStreamAudioSourceNode.h: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode): * Modules/webaudio/OfflineAudioDestinationNode.h: * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::create): (WebCore::OscillatorNode::OscillatorNode): * Modules/webaudio/OscillatorNode.h: * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNodeBase::PannerNodeBase): (WebCore::PannerNode::PannerNode): * Modules/webaudio/PannerNode.h: * Modules/webaudio/PannerNode.idl: * Modules/webaudio/PanningModelType.h: Copied from Source/WebCore/Modules/webaudio/OfflineAudioContext.idl. * Modules/webaudio/PanningModelType.idl: Copied from Source/WebCore/Modules/webaudio/OfflineAudioContext.idl. * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::create): (WebCore::ScriptProcessorNode::ScriptProcessorNode): * Modules/webaudio/ScriptProcessorNode.h: * Modules/webaudio/WaveShaperNode.cpp: (WebCore::WaveShaperNode::WaveShaperNode): * Modules/webaudio/WaveShaperNode.h: * Modules/webaudio/WebKitAudioContext.cpp: Copied from Source/WebCore/Modules/webaudio/AudioContext.cpp. (WebCore::WebKitAudioContext::isSampleRateRangeGood): (WebCore::WebKitAudioContext::create): (WebCore::WebKitAudioContext::WebKitAudioContext): (WebCore::WebKitAudioContext::constructCommon): (WebCore::WebKitAudioContext::~WebKitAudioContext): (WebCore::WebKitAudioContext::lazyInitialize): (WebCore::WebKitAudioContext::clear): (WebCore::WebKitAudioContext::uninitialize): (WebCore::WebKitAudioContext::isInitialized const): (WebCore::WebKitAudioContext::addReaction): (WebCore::WebKitAudioContext::setState): (WebCore::WebKitAudioContext::stop): (WebCore::WebKitAudioContext::suspend): (WebCore::WebKitAudioContext::resume): (WebCore::WebKitAudioContext::activeDOMObjectName const): (WebCore::WebKitAudioContext::hostingDocumentIdentifier const): (WebCore::WebKitAudioContext::isSuspended const): (WebCore::WebKitAudioContext::visibilityStateChanged): (WebCore::WebKitAudioContext::wouldTaintOrigin const): (WebCore::WebKitAudioContext::createBuffer): (WebCore::WebKitAudioContext::decodeAudioData): (WebCore::WebKitAudioContext::createBufferSource): (WebCore::WebKitAudioContext::createMediaElementSource): (WebCore::WebKitAudioContext::createMediaStreamSource): (WebCore::WebKitAudioContext::createMediaStreamDestination): (WebCore::WebKitAudioContext::createScriptProcessor): (WebCore::WebKitAudioContext::createBiquadFilter): (WebCore::WebKitAudioContext::createWaveShaper): (WebCore::WebKitAudioContext::createPanner): (WebCore::WebKitAudioContext::createConvolver): (WebCore::WebKitAudioContext::createDynamicsCompressor): (WebCore::WebKitAudioContext::createAnalyser): (WebCore::WebKitAudioContext::createGain): (WebCore::WebKitAudioContext::createDelay): (WebCore::WebKitAudioContext::createChannelSplitter): (WebCore::WebKitAudioContext::createChannelMerger): (WebCore::WebKitAudioContext::createOscillator): (WebCore::WebKitAudioContext::createPeriodicWave): (WebCore::WebKitAudioContext::notifyNodeFinishedProcessing): (WebCore::WebKitAudioContext::derefFinishedSourceNodes): (WebCore::WebKitAudioContext::refNode): (WebCore::WebKitAudioContext::derefNode): (WebCore::WebKitAudioContext::derefUnfinishedSourceNodes): (WebCore::WebKitAudioContext::lock): (WebCore::WebKitAudioContext::tryLock): (WebCore::WebKitAudioContext::unlock): (WebCore::WebKitAudioContext::isAudioThread const): (WebCore::WebKitAudioContext::isGraphOwner const): (WebCore::WebKitAudioContext::addDeferredFinishDeref): (WebCore::WebKitAudioContext::handlePreRenderTasks): (WebCore::WebKitAudioContext::handlePostRenderTasks): (WebCore::WebKitAudioContext::handleDeferredFinishDerefs): (WebCore::WebKitAudioContext::markForDeletion): (WebCore::WebKitAudioContext::scheduleNodeDeletion): (WebCore::WebKitAudioContext::deleteMarkedNodes): (WebCore::WebKitAudioContext::markSummingJunctionDirty): (WebCore::WebKitAudioContext::removeMarkedSummingJunction): (WebCore::WebKitAudioContext::markAudioNodeOutputDirty): (WebCore::WebKitAudioContext::handleDirtyAudioSummingJunctions): (WebCore::WebKitAudioContext::handleDirtyAudioNodeOutputs): (WebCore::WebKitAudioContext::addAutomaticPullNode): (WebCore::WebKitAudioContext::removeAutomaticPullNode): (WebCore::WebKitAudioContext::updateAutomaticPullNodes): (WebCore::WebKitAudioContext::processAutomaticPullNodes): (WebCore::WebKitAudioContext::nodeWillBeginPlayback): (WebCore::shouldDocumentAllowWebAudioToAutoPlay): (WebCore::WebKitAudioContext::willBeginPlayback): (WebCore::WebKitAudioContext::willPausePlayback): (WebCore::WebKitAudioContext::startRendering): (WebCore::WebKitAudioContext::mediaCanStart): (WebCore::WebKitAudioContext::mediaState const): (WebCore::WebKitAudioContext::pageMutedStateDidChange): (WebCore::WebKitAudioContext::isPlayingAudioDidChange): (WebCore::WebKitAudioContext::finishedRendering): (WebCore::WebKitAudioContext::dispatchEvent): (WebCore::WebKitAudioContext::incrementActiveSourceCount): (WebCore::WebKitAudioContext::decrementActiveSourceCount): (WebCore::WebKitAudioContext::suspendRendering): (WebCore::WebKitAudioContext::resumeRendering): (WebCore::WebKitAudioContext::close): (WebCore::WebKitAudioContext::suspendPlayback): (WebCore::WebKitAudioContext::mayResumePlayback): (WebCore::WebKitAudioContext::postTask): (WebCore::WebKitAudioContext::origin const): (WebCore::WebKitAudioContext::addConsoleMessage): (WebCore::WebKitAudioContext::clearPendingActivity): (WebCore::WebKitAudioContext::makePendingActivity): (WebCore::WebKitAudioContext::logChannel const): * Modules/webaudio/WebKitAudioContext.h: Copied from Source/WebCore/Modules/webaudio/AudioContext.h. (WebCore::WebKitAudioContext::destination): (WebCore::WebKitAudioContext::activeSourceCount const): (WebCore::WebKitAudioContext::listener): (WebCore::WebKitAudioContext::isClosed const): (WebCore::WebKitAudioContext::connectionCount const): (WebCore::WebKitAudioContext::audioThread const): (WebCore::WebKitAudioContext::maxNumberOfChannels): (WebCore::WebKitAudioContext::userGestureRequiredForAudioStart const): (WebCore::WebKitAudioContext::pageConsentRequiredForAudioStart const): (WebCore::WebKitAudioContext::state const): (isType): * Modules/webaudio/WebKitAudioContext.idl: Copied from Source/WebCore/Modules/webaudio/AudioContext.idl. * Modules/webaudio/WebKitAudioPannerNode.cpp: Copied from Source/WebCore/Modules/webaudio/PannerNode.cpp. (WebCore::fixNANs): (WebCore::WebKitAudioPannerNode::WebKitAudioPannerNode): (WebCore::WebKitAudioPannerNode::~WebKitAudioPannerNode): (WebCore::WebKitAudioPannerNode::pullInputs): (WebCore::WebKitAudioPannerNode::process): (WebCore::WebKitAudioPannerNode::reset): (WebCore::WebKitAudioPannerNode::initialize): (WebCore::WebKitAudioPannerNode::uninitialize): (WebCore::WebKitAudioPannerNode::listener): (WebCore::WebKitAudioPannerNode::setPanningModel): (WebCore::WebKitAudioPannerNode::distanceModel const): (WebCore::WebKitAudioPannerNode::setDistanceModel): (WebCore::WebKitAudioPannerNode::getAzimuthElevation): (WebCore::WebKitAudioPannerNode::dopplerRate): (WebCore::WebKitAudioPannerNode::distanceConeGain): (WebCore::WebKitAudioPannerNode::notifyAudioSourcesConnectedToNode): * Modules/webaudio/WebKitAudioPannerNode.h: Copied from Source/WebCore/Modules/webaudio/PannerNode.h. * Modules/webaudio/WebKitAudioPannerNode.idl: Copied from Source/WebCore/Modules/webaudio/PannerNode.idl. * Modules/webaudio/WebKitOfflineAudioContext.cpp: Copied from Source/WebCore/Modules/webaudio/DelayNode.cpp. (WebCore::WebKitOfflineAudioContext::WebKitOfflineAudioContext): (WebCore::WebKitOfflineAudioContext::create): * Modules/webaudio/WebKitOfflineAudioContext.h: Copied from Source/WebCore/Modules/webaudio/DelayNode.h. * Modules/webaudio/WebKitOfflineAudioContext.idl: Copied from Source/WebCore/Modules/webaudio/OfflineAudioContext.idl. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/EventTargetFactory.in: * page/Settings.yaml: * testing/Internals.cpp: (WebCore::Internals::setAudioContextRestrictions): * testing/Internals.h: * testing/Internals.idl: 2020-06-17 Wenson Hsieh <wenson_hsieh@apple.com> [macOS] Shift-tab in a bullet list in Mail Compose jumps back to Subject field https://bugs.webkit.org/show_bug.cgi?id=213320 <rdar://problem/63831962> Reviewed by Tim Horton. After the changes in r262051, pressing shift-tab in a bulleted list in Mail compose on macOS no longer triggers an outdent command. This is because the default behavior of the "keydown" event will now relinquish focus to the embedding client (i.e. the "chrome"). In this case, Mail makes the Subject field above the compose web view the first responder. This is necessary on iOS, where Mail does not attempt to intercept shift+tab and move focus to the subject line. However, Mail on macOS intercepts the keypress event, and either triggers outdent (if the selection is inside a list or blockquote) or focuses the Subject line. Since focus is relinquished during "keydown", this logic no longer runs, and hitting shift+tab in a list always relinquishes focus. To address this, refactor the changes made in r262051 so that we treat the default behavior of the "keypress" event (rather than "keydown") as relinquishing focus. See WebKit/ChangeLog for more details. Test: WebKit.ShiftTabDoesNotTakeFocusFromEditableWebViewWhenPreventingKeyPress * page/EventHandler.cpp: (WebCore::EventHandler::defaultTabEventHandler): Remove a call to relinquish focus when handling tab. * page/FocusController.h: 2020-06-16 Antoine Quint <graouts@webkit.org> quikr.com: unable to select item from dropdown https://bugs.webkit.org/show_bug.cgi?id=213260 <rdar://problem/58106011> Reviewed by Zalan Bujtas. Only account for box-shadow when computing the background rect if the clipping element itself has non-zero used width and height. Tests: fast/box-shadow/hit-test-box-shadow-and-margin-on-zero-height-clipping-container.html fast/box-shadow/hit-test-box-shadow-and-margin-on-zero-width-clipping-container.html fast/box-shadow/hit-test-box-shadow-on-zero-height-clipping-container.html fast/box-shadow/hit-test-box-shadow-on-zero-width-clipping-container.html * rendering/RenderBox.cpp: (WebCore::RenderBox::addVisualEffectOverflow): 2020-06-17 David Kilzer <ddkilzer@apple.com> Replace OptionSetTraits/OptionSetValues with EnumTraits/EnumValues <https://webkit.org/b/213264> Reviewed by Brent Fulgham. * page/DragActions.h: (EnumTraits<WebCore::DragDestinationAction>): - Rename from OptionSetTraits<WebCore::DragDestinationAction>. (OptionSetTraits<WebCore::DragOperation>): (OptionSetTraits<WebCore::DragSourceAction>): - Remove since EnumTraits<> already exist for both. 2020-06-17 Geoffrey Garen <ggaren@apple.com> media/remoteplayback-target-availability.html was a flaky failure after r262904 https://bugs.webkit.org/show_bug.cgi?id=213294 Reviewed by Sam Weinig. AirPlay availability is a global that depends on a timer (and/or an external piece of hardware). Therefore, the first value RemotePlayback sees for AirPlay availability, while usually 'unavailable', is sometimes 'available'. Flaky! In this case, media/remoteplayback-prompt.html triggered an AirPlay availability check, and then media/remoteplayback-target-availability.html, if run in the same process, sometimes saw 'available' as its initial availability state. Make RemotePlayback's initial availability state deterministic by recording availability state at the time we enqueue our task, rather than at the time we dequeue our task. (By specification and implementation, RemotePlayback's initial availability state is always 'unavailable', regardless of AirPlay state.) This is OK to do because, if the state ever changes after we enqueue our task, we'll get an update notification and enqueue a new task. * Modules/remoteplayback/RemotePlayback.cpp: (WebCore::RemotePlayback::watchAvailability): Copy the availability state when we enqueue our task, and do not update it when we dequeue our task. This is the heart of the bug fix. Make sure to manually update availability state when we first register to monitor availability, since we never got an update notification for the current state. (WebCore::RemotePlayback::prompt): For consistency with watchAvailability, do not update availability state when we dequeue our task. (This means that prompting before watching availability is always an error, which is fine, and consistent with the spec, which says, "If the user agent stops monitoring the list of available remote playback devices... It SHOULD also set the availability value for all media elements to false.") Make sure to manually update availability state when we first register to monitor availability, since we never got an update notification for the current state. (WebCore::RemotePlayback::availabilityChanged): For consistency with watchAvailability, do not update availability state when we dequeue our task. (WebCore::RemotePlayback::updateAvailability): Deleted. We never synchronously update our state anymore. All state changes are queued and processed in order. * Modules/remoteplayback/RemotePlayback.h: 2020-06-17 Rob Buis <rbuis@igalia.com> Image `referrerpolicy` mutations should be considered "relevant mutations" https://bugs.webkit.org/show_bug.cgi?id=209970 Reviewed by Youenn Fablet. Make referrerpolicy state changes a relevant mutation [1]. In order to indicate that we are dealing with a relevant mutation add an enum to updateFromElement, in order to run "update the image data" algorithm [2] in case it is a relevant mutation. Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-referrerpolicy-change.sub.html [1] https://html.spec.whatwg.org/#reacting-to-dom-mutations:attr-img-referrerpolicy [2] https://html.spec.whatwg.org/#when-to-obtain-images * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::attributeChanged): * html/HTMLImageElement.h: * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): (WebCore::ImageLoader::updateFromElementIgnoringPreviousError): (WebCore::ImageLoader::loadDeferredImage): * loader/ImageLoader.h: 2020-06-17 Chris Dumez <cdumez@apple.com> Unreviewed attempt to fix internal macOS build after r263157. * rendering/RenderThemeMac.mm: 2020-06-17 Sam Weinig <weinig@apple.com> Use constructor operations in WebIDL https://bugs.webkit.org/show_bug.cgi?id=201397 Reviewed by Eric Carlson. Add support for constructor syntax in WebIDL (https://heycam.github.io/webidl/#idl-constructors) - [Constructor(...)] extended attributes become constructor(...) operations - [JSBuiltinConstructor] becomes [JSBuiltin] constructor(...) - [CustomConstructor] becomes [Custom] constructor(...) - [ConstructorMayThrowException] becomes [MayThrowException] constructor(...) and can now be unique per-overload - [ConstructorCallWith=Foo] becomes [CallWith=Foo] constructor(...) and can now also be unique per-overload This change leaves NamedConstructor as is, but a subsequent change will replace it with the specified LegacyFactoryFunction extended attribute. * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl: * Modules/applepay/ApplePayError.idl: * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePaySetup.idl: * Modules/async-clipboard/ClipboardItem.idl: * Modules/encryptedmedia/MediaKeyMessageEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: * Modules/fetch/FetchHeaders.idl: * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchResponse.idl: * Modules/gamepad/GamepadEvent.idl: * Modules/highlight/HighlightMap.idl: * Modules/highlight/HighlightRangeGroup.idl: * Modules/indexeddb/IDBVersionChangeEvent.idl: * Modules/mediarecorder/BlobEvent.idl: * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediarecorder/MediaRecorderErrorEvent.idl: * Modules/mediasession/MediaRemoteControls.idl: * Modules/mediasession/MediaSession.idl: * Modules/mediasource/MediaSource.idl: * Modules/mediastream/MediaStream.idl: * Modules/mediastream/MediaStreamTrackEvent.idl: * Modules/mediastream/OverconstrainedError.idl: * Modules/mediastream/OverconstrainedErrorEvent.idl: * Modules/mediastream/RTCDTMFToneChangeEvent.idl: * Modules/mediastream/RTCDataChannelEvent.idl: * Modules/mediastream/RTCIceCandidate.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCPeerConnectionIceEvent.idl: * Modules/mediastream/RTCSessionDescription.idl: * Modules/mediastream/RTCTrackEvent.idl: * Modules/notifications/Notification.idl: * Modules/paymentrequest/MerchantValidationEvent.idl: * Modules/paymentrequest/PaymentMethodChangeEvent.idl: * Modules/paymentrequest/PaymentRequest.idl: * Modules/paymentrequest/PaymentRequestUpdateEvent.idl: * Modules/pictureinpicture/EnterPictureInPictureEvent.idl: * Modules/speech/SpeechSynthesisUtterance.idl: * Modules/streams/ByteLengthQueuingStrategy.idl: * Modules/streams/CountQueuingStrategy.idl: * Modules/streams/ReadableByteStreamController.idl: * Modules/streams/ReadableStream.idl: * Modules/streams/ReadableStreamBYOBReader.idl: * Modules/streams/ReadableStreamBYOBRequest.idl: * Modules/streams/ReadableStreamDefaultController.idl: * Modules/streams/ReadableStreamDefaultReader.idl: * Modules/streams/WritableStream.idl: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webgpu/GPUOutOfMemoryError.idl: * Modules/webgpu/GPUUncapturedErrorEvent.idl: * Modules/webgpu/GPUValidationError.idl: * Modules/websockets/CloseEvent.idl: * Modules/websockets/WebSocket.idl: * Modules/webxr/WebXRRigidTransform.idl: * Modules/webxr/WebXRWebGLLayer.idl: * Modules/webxr/XRInputSourceEvent.idl: * Modules/webxr/XRInputSourcesChangeEvent.idl: * Modules/webxr/XRReferenceSpaceEvent.idl: * Modules/webxr/XRSessionEvent.idl: * animation/AnimationPlaybackEvent.idl: * animation/DocumentTimeline.idl: * animation/KeyframeEffect.idl: * animation/WebAnimation.idl: * bindings/scripts/CodeGeneratorJS.pm: (ShouldGenerateToJSDeclaration): (GetFullyQualifiedImplementationCallName): (GenerateParametersCheck): (GetConstructorTemplateClassName): (GenerateConstructorDefinition): (GenerateConstructorHelperMethods): (HasCustomConstructor): (IsConstructable): (HasJSBuiltinConstructor): (AddJSBuiltinIncludesIfNeeded): (IsJSBuiltinConstructor): Deleted. * bindings/scripts/IDLAttributes.json: * bindings/scripts/IDLParser.pm: (assertExtendedAttributesValidForContext): (copyExtendedAttributes): (cloneOperation): (applyTypedefs): (parseInterfaceMember): (parseConstructor): (parseExtendedAttributeRest): (applyMemberList): (applyExtendedAttributeList): * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: (WebCore::JSTestNamedConstructorConstructor::initializeProperties): (WebCore::JSTestNamedConstructorNamedConstructor::construct): (WebCore::JSTestNamedConstructorNamedConstructor::initializeProperties): * bindings/scripts/test/TestClassWithJSBuiltinConstructor.idl: * bindings/scripts/test/TestEventConstructor.idl: * bindings/scripts/test/TestInterface.idl: * bindings/scripts/test/TestJSBuiltinConstructor.idl: * bindings/scripts/test/TestNamedConstructor.idl: * bindings/scripts/test/TestNode.idl: * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestOverloadedConstructors.idl: * bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl: * bindings/scripts/test/TestPromiseRejectionEvent.idl: * bindings/scripts/test/TestTypedefs.idl: * css/DOMMatrix.idl: * css/DOMMatrixReadOnly.idl: * css/FontFace.idl: * css/FontFaceSet.idl: * css/MediaQueryListEvent.idl: * css/WebKitCSSMatrix.idl: * css/typedom/TypedOMCSSUnitValue.idl: * css/typedom/TypedOMCSSUnparsedValue.idl: * dom/AbortController.idl: * dom/AnimationEvent.idl: * dom/BeforeLoadEvent.idl: * dom/ClipboardEvent.idl: * dom/Comment.idl: * dom/CompositionEvent.idl: * dom/CustomEvent.idl: * dom/DOMException.idl: * dom/DOMPoint.idl: * dom/DOMPointReadOnly.idl: * dom/DOMQuad.idl: * dom/DOMRect.idl: * dom/DOMRectReadOnly.idl: * dom/Document.idl: * dom/DocumentFragment.idl: * dom/DragEvent.idl: * dom/ErrorEvent.idl: * dom/Event.idl: * dom/EventTarget.idl: * dom/FocusEvent.idl: * dom/HashChangeEvent.idl: * dom/InputEvent.idl: * dom/KeyboardEvent.idl: * dom/MessageChannel.idl: * dom/MessageEvent.idl: * dom/MouseEvent.idl: * dom/MutationObserver.idl: * dom/OverflowEvent.idl: * dom/PageTransitionEvent.idl: * dom/PointerEvent.idl: * dom/PopStateEvent.idl: * dom/ProgressEvent.idl: * dom/PromiseRejectionEvent.idl: * dom/Range.idl: * dom/SecurityPolicyViolationEvent.idl: * dom/StaticRange.idl: * dom/Text.idl: * dom/TextDecoder.idl: * dom/TextEncoder.idl: * dom/TransitionEvent.idl: * dom/UIEvent.idl: * dom/WebKitAnimationEvent.idl: * dom/WebKitTransitionEvent.idl: * dom/WheelEvent.idl: * fileapi/Blob.idl: * fileapi/File.idl: * fileapi/FileReader.idl: * fileapi/FileReaderSync.idl: * html/DOMFormData.idl: * html/DOMURL.idl: * html/HTMLElement.idl: * html/HTMLOptionElement.idl: * html/ImageData.idl: * html/MediaController.idl: * html/MediaEncryptedEvent.idl: * html/OffscreenCanvas.idl: * html/URLSearchParams.idl: * html/canvas/Path2D.idl: * html/canvas/WebGLContextEvent.idl: * html/track/DataCue.idl: * html/track/TextTrackCue.idl: * html/track/TrackEvent.idl: * html/track/VTTCue.idl: * html/track/VTTRegion.idl: * page/EventSource.idl: * page/IntersectionObserver.idl: * page/IntersectionObserverEntry.idl: * page/PerformanceObserver.idl: * page/ResizeObserver.idl: * page/UndoItem.idl: * page/WebKitPoint.idl: * storage/StorageEvent.idl: * workers/Worker.idl: * workers/service/ExtendableEvent.idl: * workers/service/ExtendableMessageEvent.idl: * workers/service/FetchEvent.idl: * xml/DOMParser.idl: * xml/XMLHttpRequest.idl: * xml/XMLSerializer.idl: * xml/XPathEvaluator.idl: * xml/XSLTProcessor.idl: 2020-06-17 Darryl Pogue <darryl@dpogue.ca> IndexedDB: Support IDBFactory databases method https://bugs.webkit.org/show_bug.cgi?id=211043 Reviewed by Youenn Fablet. Add support for fetching the list of IDB database names and versions from the IDBServer, and expose the functionality as `IDBFactory.prototype.databases()`. Spec: https://w3c.github.io/IndexedDB/#dom-idbfactory-databases * Headers.cmake: * Modules/indexeddb/IDBActiveDOMObject.h: (WebCore::IDBActiveDOMObject::performCallbackOnOriginThread): * Modules/indexeddb/IDBDatabaseNameAndVersionRequest.cpp: Added. (WebCore::IDBDatabaseNameAndVersionRequest::create): (WebCore::IDBDatabaseNameAndVersionRequest::IDBDatabaseNameAndVersionRequest): (WebCore::IDBDatabaseNameAndVersionRequest::~IDBDatabaseNameAndVersionRequest): (WebCore::IDBDatabaseNameAndVersionRequest::complete): (WebCore::IDBDatabaseNameAndVersionRequest::activeDOMObjectName const): (WebCore::IDBDatabaseNameAndVersionRequest::virtualHasPendingActivity const): (WebCore::IDBDatabaseNameAndVersionRequest::stop): * Modules/indexeddb/IDBDatabaseNameAndVersionRequest.h: Added. * Modules/indexeddb/IDBFactory.cpp: (WebCore::IDBFactory::databases): (WebCore::IDBFactory::getAllDatabaseNames): * Modules/indexeddb/IDBFactory.h: * Modules/indexeddb/IDBFactory.idl: * Modules/indexeddb/client/IDBConnectionProxy.cpp: (WebCore::IDBClient::IDBConnectionProxy::connectionToServerLost): (WebCore::IDBClient::IDBConnectionProxy::getAllDatabaseNamesAndVersions): (WebCore::IDBClient::IDBConnectionProxy::didGetAllDatabaseNamesAndVersions): (WebCore::IDBClient::IDBConnectionProxy::forgetActivityForCurrentThread): (WebCore::IDBClient::IDBConnectionProxy::getAllDatabaseNames): Deleted. * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/client/IDBConnectionToServer.cpp: (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNamesAndVersions): (WebCore::IDBClient::IDBConnectionToServer::didGetAllDatabaseNamesAndVersions): (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames): Deleted. (WebCore::IDBClient::IDBConnectionToServer::didGetAllDatabaseNames): Deleted. * Modules/indexeddb/client/IDBConnectionToServer.h: * Modules/indexeddb/client/IDBConnectionToServerDelegate.h: * Modules/indexeddb/server/IDBConnectionToClient.cpp: (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNamesAndVersions): (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNames): Deleted. * Modules/indexeddb/server/IDBConnectionToClient.h: * Modules/indexeddb/server/IDBConnectionToClientDelegate.h: * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::getAllDatabaseNamesAndVersions): (WebCore::IDBServer::IDBServer::getAllDatabaseNames): Deleted. * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameAndVersionFromFile): (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile): Deleted. * Modules/indexeddb/server/SQLiteIDBBackingStore.h: * Modules/indexeddb/shared/IDBDatabaseNameAndVersion.h: Added. (WebCore::IDBDatabaseNameAndVersion::encode const): (WebCore::IDBDatabaseNameAndVersion::decode): (WebCore::IDBDatabaseNameAndVersion::isolatedCopy const): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * inspector/agents/InspectorIndexedDBAgent.cpp: (WebCore::InspectorIndexedDBAgent::requestDatabaseNames): * loader/EmptyClients.cpp: 2020-06-17 Sam Weinig <weinig@apple.com> [WPT] infrastructure/assumptions/html-elements.html fails due to changes in style when all: initial is used https://bugs.webkit.org/show_bug.cgi?id=213171 Reviewed by Antti Koivisto. Update existing test results that now pass. * css/CSSProperties.json: Use initialStrokeColor (the default) rather than hardcoding the incorrect currentColor. The spec (and initialStrokeColor) say this should be transparent. * style/StyleBuilderCustom.h: (WebCore::Style::ApplyPropertyBorderImageModifier::applyInitialValue): Match the mask image NinePieceImage constructor, and set fill to true for mask image slices. 2020-06-17 Zalan Bujtas <zalan@apple.com> [LFC][Float] Move float avoiders' final position compute next to when the static position is computed https://bugs.webkit.org/show_bug.cgi?id=213250 Reviewed by Antti Koivisto. Now that the float avoider's final position has no dependecy on the computed height, we can move it all the way up, next to where we computed the static position. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutInFlowContent): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForAncestors): Deleted. * layout/blockformatting/BlockFormattingContext.h: 2020-06-17 Antoine Quint <graouts@webkit.org> [Modern Media Controls] CSS "cursor" property shoud be respected in media controls shadow root https://bugs.webkit.org/show_bug.cgi?id=213295 <rdar://problem/61911638> Reviewed by Timothy Hatcher. Allow the "cursor" property to be inherited in the media controls shadow root, but still overriden for interactive objects in the media controls as well as placard text. Test: media/modern-media-controls/css/cursor.html * Modules/modern-media-controls/controls/controls-bar.css: (.controls-bar): * Modules/modern-media-controls/controls/media-controls.css: (.media-controls-container): (.media-controls): * Modules/modern-media-controls/controls/placard.css: (.placard .title,): 2020-06-08 Andy Estes <aestes@apple.com> [Apple Pay] Enable layout tests on more platforms https://bugs.webkit.org/show_bug.cgi?id=212955 <rdar://problem/64174156> Reviewed by Alex Christensen. Added runtime checks to determine the Apple Pay API version when installments are enabled. Enabled tests in http/tests/ssl/applepay on iOS. * Modules/applepay/ApplePayInstallmentConfiguration.idl: * Modules/applepay/ApplePayInstallmentConfigurationWebCore.h: * Modules/applepay/ApplePayInstallmentItem.h: * Modules/applepay/ApplePayInstallmentItem.idl: * Modules/applepay/ApplePayInstallmentItemType.h: * Modules/applepay/ApplePayInstallmentItemType.idl: * Modules/applepay/ApplePayInstallmentRetailChannel.h: * Modules/applepay/ApplePayInstallmentRetailChannel.idl: Removed uses of APPLE_PAY_INSTALLMENT_IDENTIFIERS and APPLE_PAY_INSTALLMENT_ITEMS (or replaced with APPLE_PAY_INSTALLMENTS). * Modules/applepay/PaymentAPIVersion.h: * Modules/applepay/cocoa/PaymentAPIVersionCocoa.mm: (WebCore::PaymentAPIVersion::current): Moved the computation of current API version from PaymentCoordinatorClient::supportsVersion to here. Added runtime checks to determine the level of PassKit installments support since we don't have enough information to tell at compile time. * Modules/applepay/PaymentCoordinatorClient.cpp: (WebCore::PaymentCoordinatorClient::supportsVersion): Changed to call PaymentAPIVersion::current. * Modules/applepay/PaymentInstallmentConfiguration.mm: (WebCore::makeNSArrayElement): (WebCore::createPlatformConfiguration): (WebCore::PaymentInstallmentConfiguration::create): (WebCore::PaymentInstallmentConfiguration::applePayInstallmentConfiguration const): Removed uses of HAVE_PASSKIT_INSTALLMENT_ITEMS and HAVE_PASSKIT_INSTALLMENT_IDENTIFIERS. Used runtime checks to determine support for PKPaymentInstallmentConfiguration and PKPaymentInstallmentItem. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Added source files for PaymentAPIVersion. 2020-06-17 Zalan Bujtas <zalan@apple.com> [LFC][Floats] Remove redundant mapping functions https://bugs.webkit.org/show_bug.cgi?id=213249 Reviewed by Antti Koivisto. It's incorrect to map the entire display box when the height is no even computed yet. * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): (WebCore::Layout::FloatingContext::append): (WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const): (WebCore::Layout::FloatingContext::mapTopLeftToFloatingStateRoot const): (WebCore::Layout::FloatingContext::mapToFloatingStateRoot const): Deleted. (WebCore::Layout::FloatingContext::mapTopToFloatingStateRoot const): Deleted. * layout/floats/FloatingContext.h: 2020-06-17 Zalan Bujtas <zalan@apple.com> [LFC]Floats] Cleanup FloatAvoider interface https://bugs.webkit.org/show_bug.cgi?id=213195 Reviewed by Antti Koivisto. Remove redundant functions/parameters. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats): * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::FloatAvoider): (WebCore::Layout::FloatAvoider::topLeftInContainingBlock const): Deleted. * layout/floats/FloatAvoider.h: * layout/floats/FloatingContext.cpp: (WebCore::Layout::findAvailablePosition): (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const): (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const): Deleted. (WebCore::Layout::FloatingContext::findPositionForFloatBox const): Deleted. * layout/floats/FloatingContext.h: 2020-06-17 Zalan Bujtas <zalan@apple.com> [LFC][Floats] Remove FloatBox class https://bugs.webkit.org/show_bug.cgi?id=213184 Reviewed by Antti Koivisto. Apparently the only difference between a non-floating float avoider (regular formatting context root) and a float box is that while float boxes intersect their margin box, simple float avoiders use their border box. We can do that without subclassing FloatAvoider. This patch is also in preparation for moving "computeFloatPosition" next to the static position computation when the height value is not computed yet. So instead of passing in the display box, let's just pass in top/left and width. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::FloatAvoider): (WebCore::Layout::FloatAvoider::setHorizontalPosition): (WebCore::Layout::FloatAvoider::setVerticalPosition): (WebCore::Layout::FloatAvoider::initialHorizontalPosition const): (WebCore::Layout::FloatAvoider::overflowsContainingBlock const): (WebCore::Layout::FloatAvoider::topLeftInContainingBlock const): (WebCore::Layout::FloatAvoider::setHorizontalConstraints): Deleted. (WebCore::Layout::FloatAvoider::setVerticalConstraint): Deleted. (WebCore::Layout::FloatAvoider::horizontalPositionCandidate): Deleted. (WebCore::Layout::FloatAvoider::verticalPositionCandidate): Deleted. (WebCore::Layout::FloatAvoider::rectInContainingBlock const): Deleted. * layout/floats/FloatAvoider.h: (WebCore::Layout::FloatAvoider::resetHorizontalPosition): (WebCore::Layout::FloatAvoider::isLeftAligned const): (WebCore::Layout::FloatAvoider::borderBoxWidth const): (WebCore::Layout::FloatAvoider::marginBefore const): (WebCore::Layout::FloatAvoider::marginAfter const): (WebCore::Layout::FloatAvoider::marginStart const): (WebCore::Layout::FloatAvoider::marginEnd const): (WebCore::Layout::FloatAvoider::marginBoxWidth const): (WebCore::Layout::FloatAvoider::isFloatingBox const): (WebCore::Layout::FloatAvoider::layoutBox const): (WebCore::Layout::FloatAvoider::top const): (WebCore::Layout::FloatAvoider::left const): (WebCore::Layout::FloatAvoider::right const): (WebCore::Layout::FloatAvoider::rect const): Deleted. (WebCore::Layout::FloatAvoider::displayBox const): Deleted. (WebCore::Layout::FloatAvoider::displayBox): Deleted. * layout/floats/FloatBox.cpp: Removed. * layout/floats/FloatBox.h: Removed. * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const): (WebCore::Layout::findAvailablePosition): (WebCore::Layout::FloatingContext::findPositionForFloatBox const): (WebCore::Layout::FloatingContext::findPositionForFormattingContextRoot const): (WebCore::Layout::FloatPair::intersects const): (WebCore::Layout::FloatPair::horizontalConstraints const): * layout/floats/FloatingContext.h: 2020-06-17 Youenn Fablet <youenn@apple.com> Make ReadableStream robust against user code https://bugs.webkit.org/show_bug.cgi?id=212915 <rdar://problem/64133221> Reviewed by Darin Adler. Create tee source with private slots instead of public ones. When source has one of this private slot, we directly go to the creation of a ReadableStream. Covered by existing tests. * Modules/streams/ReadableStream.js: (initializeReadableStream): * Modules/streams/ReadableStreamInternals.js: (setupReadableStreamDefaultController): (readableStreamTee): (readableStreamDefaultControllerCallPullIfNeeded): (readableStreamDefaultControllerCancel): * Modules/streams/StreamInternals.js: (promiseInvokeOrNoopMethodNoCatch): (promiseInvokeOrNoopNoCatch): (promiseInvokeOrNoopMethod): (promiseInvokeOrNoop): * bindings/js/WebCoreBuiltinNames.h: 2020-06-17 Antti Koivisto <antti@apple.com> Fix spelling of evaluteDynamicMediaQueryRules https://bugs.webkit.org/show_bug.cgi?id=213287 Unreviewed. * style/RuleSet.cpp: (WebCore::Style::RuleSet::addRulesFromSheet): (WebCore::Style::RuleSet::evaluateDynamicMediaQueryRules): (WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules): Deleted. * style/RuleSet.h: * style/StyleResolver.cpp: (WebCore::Style::Resolver::evaluateDynamicMediaQueries): * style/StyleScopeRuleSets.cpp: (WebCore::Style::ScopeRuleSets::evaluateDynamicMediaQueryRules): (WebCore::Style::ScopeRuleSets::evaluteDynamicMediaQueryRules): Deleted. * style/StyleScopeRuleSets.h: 2020-06-17 Diego Pino Garcia <dpino@igalia.com> REGRESSION(r262994): [GTK] More than 100 tests are failing https://bugs.webkit.org/show_bug.cgi?id=213173 Unreviewed gardening. Add default initialization for WebCore::PluginInfo::clientLoadPolicy and WebCore::PluginInfo::isApplicationPlugin. * plugins/PluginData.h: 2020-06-16 Simon Fraser <simon.fraser@apple.com> REGRESSION (r255037): Broken position while comparing watch bands on www.apple.com/shop/studio/apple-watch https://bugs.webkit.org/show_bug.cgi?id=213282 Reviewed by Antti Koivisto. Test: fast/scrolling/ios/user-then-programmatic-scroll.html * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::applyLayerPositionsAfterCommit): * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::setNeedsApplyLayerPositionsAfterCommit): (WebCore::ScrollingTree::didScrollByDelegatedScrolling): Deleted. * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling): 2020-06-16 Zalan Bujtas <zalan@apple.com> [Subpixel] Replaced content bleeds over content box when border radius is set https://bugs.webkit.org/show_bug.cgi?id=213275 <rdar://problem/64320995> Reviewed by Simon Fraser. Snap the border to device pixels on the replaced box when border radius is set. * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::paint): 2020-06-16 Wenson Hsieh <wenson_hsieh@apple.com> Text manipulation should not re-extract elements whose children have been manipulated https://bugs.webkit.org/show_bug.cgi?id=213276 <rdar://problem/64193446> Reviewed by Tim Horton. After an element has undergone text manipulation, we have a mechanism for not extracting that element again, if the element is later hidden and shown, or relocated in the DOM. This works by adding the inserted text manipulation node to a weak element map (`m_manipulatedElements`) if the inserted node is an element. However, this mechanism is bypassed in the case where text nodes are inserted, since these child nodes are not elements. This means that if the element containing this manipulated text is hidden and later shown, we'll attempt to re- extract its contents, which is problematic for text manipulation clients. To mitigate this, when inserting content during text manipulation, if a new parent of the inserted content contains _only_ manipulated child nodes, then avoid trying to manipulate it in the future by adding it to `m_manipulatedElements`. Test: TextManipulation.CompleteTextManipulationAvoidExtractingManipulatedTextAfterManipulation * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::updateInsertions): Drive-by style fix: add a space after the assignment operator. (WebCore::TextManipulationController::replace): If the parent node that we're inserting a text manipulation node underneath has only 1 child (i.e. the node that we've just inserted), then flag it as having only manipulated children. This parent may be un-flagged later when applying `NodeInsertion`s, if the `NodeInsertion`'s child has not been manipulated. 2020-06-16 Andy Estes <aestes@apple.com> FileListCreator should only be used for resolving directories https://bugs.webkit.org/show_bug.cgi?id=213259 <rdar://problem/64375709> Reviewed by David Kilzer. Depending on whether directories should be resolved, FileListCreator::create would either synchronously execute its completion handler then return nullptr or asynchronously dispatch its completion handler then return a non-null RefPtr. Interfaces with sometimes-synchronous callbacks can be hard to use correctly; e.g., r262962 fixes a problem where FileInputType::m_fileListCreator was being modified in an unexpected order. This patch makes the interface between FileInputType and FileListCreator less error-prone and more explicit by renaming FileListCreator to DirectoryFileListCreator, making its job solely to create directory FileLists on a background queue, and giving it an explicit start member function. For non-directories, FileInputType::filesChosen now bypasses DirectoryFileListCreator and directly converts from Vector<FileChooserFileInfo> to FileList. Covered by existing tests. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * html/DirectoryFileListCreator.cpp: Renamed from html/FileListCreator.cpp. (WebCore::createFileList): Removed the template and ShouldResolveDirectories parameter. (WebCore::DirectoryFileListCreator::DirectoryFileListCreator): Moved the work queue dispatching to DirectoryFileListCreator::start. (WebCore::DirectoryFileListCreator::start): Added; moved the work queue dispatching here from the ctor. * html/DirectoryFileListCreator.h: Renamed from html/FileListCreator.h. (WebCore::DirectoryFileListCreator::create): Stopped performing non-directory creation and changed the return value back to Ref<>. * html/FileInputType.cpp: (WebCore::FileInputType::filesChosen): Moved most of the work done in the FileListCreator completion handler to didCreateFileList. When !FileInputType::allowsDirectories, used Vector::map to convert paths to a Vector<Ref<File>>, used that to create a FileList, then called didCreateFileList. Otherwise, created and started a DirectoryFileListCreator that calls didCreateFileList in its completion handler. (WebCore::FileInputType::didCreateFileList): Added; sets the new file list and icon and clears m_directoryFileListCreator. * html/FileInputType.h: 2020-06-16 Dean Jackson <dino@apple.com> REGRESSION (r262643): DumpRenderTree at com.apple.WebCore: WebCore::Document::prepareCanvasesForDisplayIfNeeded https://bugs.webkit.org/show_bug.cgi?id=213221 rdar://64260400 Reviewed by Simon Fraser. A Document could still be holding a pointer to an HTMLCanvasElement after the canvas had been deleted because the CanvasObserver protocol was disconnected too early. The fix is to explicitly clear the canvas from the Document as it stops observing. Test: webgl/preparation-removed-from-document.html * dom/Document.cpp: (WebCore::Document::prepareCanvasesForDisplayIfNeeded): Copy the HashSet to a Vector just in case something weird happens to the set during iteration. (WebCore::Document::clearCanvasPreparation): Remove the canvas from the list of of elements that need preparation. * dom/Document.h: Add the new clearCanvasPreparation method. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::~HTMLCanvasElement): Clear the document. (WebCore::HTMLCanvasElement::didMoveToNewDocument): Ditto. (WebCore::HTMLCanvasElement::removedFromAncestor): Ditto. 2020-06-16 Dean Jackson <dino@apple.com> [WebGL] Lose the context if IOSurface allocation fails https://bugs.webkit.org/show_bug.cgi?id=213265 <rdar://problem/64424742> Reviewed by Simon Fraser. If we are unable to allocate the backing store for the WebGL content, we should immediately lose the context. * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): Lose the context if the call to allocateIOSurfaceBackingStore didn't work. * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::allocateIOSurfaceBackingStore): * platform/graphics/cocoa/WebGLLayer.h: * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): Return a boolean so that we can detect if the allocation failed. * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp: (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): 2020-06-16 Eric Carlson <eric.carlson@apple.com> Don't claim to support fullscreen mode unless fullScreenEnabled setting is enabled https://bugs.webkit.org/show_bug.cgi?id=213142 <rdar://63753327> Reviewed by Jer Noble. Test: media/video-supports-fullscreen.html * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::supportsFullscreen const): Check settings.fullScreenEnabled. 2020-06-16 Andres Gonzalez <andresg_22@apple.com> Fix for accessibility/textarea-selected-text-range.html in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=213257 Reviewed by Chris Fleizach. accessibility/textarea-selected-text-range.html. Implementation of AXIsolatedObject::selectedTextRange. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::selectedTextRange const): * accessibility/isolatedtree/AXIsolatedObject.h: 2020-06-16 Pavel Feldman <pavel.feldman@gmail.com> Web Inspector: replace completion handler with a function in interception. https://bugs.webkit.org/show_bug.cgi?id=213252 Reviewed by Devin Rousso. Don't use a `CompletionHandler` as it asserts that it's been called when it's destroyed. Both `Network.interceptRequestWithResponse` and `Network.interceptRequestWithError` essentially "skip" the network pipeline, so the `CompletionHandler` is not invoked for those commands. * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::interceptRequestImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::interceptRequest): * inspector/InspectorInstrumentationWebKit.cpp: (WebCore::InspectorInstrumentationWebKit::interceptRequestInternal): * inspector/InspectorInstrumentationWebKit.h: (WebCore::InspectorInstrumentationWebKit::interceptRequest): * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::interceptRequest): (WebCore::InspectorNetworkAgent::interceptRequestWithResponse): (WebCore::InspectorNetworkAgent::interceptRequestWithError): * inspector/agents/InspectorNetworkAgent.h: (WebCore::InspectorNetworkAgent::PendingInterceptRequest::PendingInterceptRequest): (WebCore::InspectorNetworkAgent::PendingInterceptRequest::continueAsHandled): 2020-06-16 Clark Wang <clark_wang@apple.com> Added missing position attributes to PannerNode https://bugs.webkit.org/show_bug.cgi?id=213151 Reviewed by Chris Dumez. Implemented position attributes in PannerNode interface, as per spec: https://www.w3.org/TR/webaudio/#pannernode. Re-baselined tests previous tests that either now pass, or fail at a further stage than before. * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::PannerNode): (WebCore::PannerNode::position const): (WebCore::PannerNode::setPosition): (WebCore::PannerNode::getAzimuthElevation): (WebCore::PannerNode::dopplerRate): (WebCore::PannerNode::distanceConeGain): * Modules/webaudio/PannerNode.h: * Modules/webaudio/PannerNode.idl: 2020-06-16 Mark Lam <mark.lam@apple.com> Make Options::useJIT() be the canonical source of truth on whether we should use the JIT. https://bugs.webkit.org/show_bug.cgi?id=212556 <rdar://problem/63780436> Reviewed by Saam Barati. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::compileSelector): 2020-06-16 Sam Weinig <weinig@apple.com> [WPT] form.action does not return document.url when unset (part of https://wpt.live/html/dom/reflection-forms.html) https://bugs.webkit.org/show_bug.cgi?id=213205 Reviewed by David Kilzer. Update existing test results that now pass. * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::formAction const): Call document.completeURL() directly rather than getURLAttribute() as that will cause the attribute to have to be looked up again. * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::action const): Match HTMLFormControlElement::formAction (and the spec) and return the document's url if the attribute value is missing. * html/HTMLFormElement.idl: Remove Reflect/URL extended attributes, as we need custom handling for the empty case. 2020-06-16 David Kilzer <ddkilzer@apple.com> REGRESSION (r262994): Web Inspector is killed when context-clicking anywhere <https://webkit.org/b/213224> <rdar://problem/64383320> Reviewed by Darin Adler. Test: TestWebKitAPI.WebCore.ContextMenuAction_IsValidEnum The issue is that using WTF::isValidEnum() with WTF::EnumTraits<WebCore::ContextMenuAction> didn't explicitly list all 1000 custom tags, or any application tags (besides the base), so the unlisted tags were marked as invalid during enum validation. The fix is to define a custom validation function for WebCore::ContextMenuAction enum values. * platform/ContextMenuItem.h: (WTF::isValidEnum): * platform/ContextMenuItem.cpp: (WebCore::isValidContextMenuAction): Add. - Validates CustomTag and ApplicationTag ranges. * platform/ContextMenuItem.h: (WebCore::isValidContextMenuAction): Add declaration. (WTF::EnumTraits<WebCore::ContextMenuAction>): Delete. (WTF::HasCustomIsValidEnum<WebCore::ContextMenuAction>): Add. (WTF::isValidEnum): Add. - Call WebCore::isValidContextMenuAction() to validate all enum values. 2020-06-16 Fujii Hironori <Hironori.Fujii@sony.com> [CMake][Visual Studio] CSSPropertyNames.h is generated twice in WebCore.vcxproj and WebCore_CopyPrivateHeaders.vcxproj https://bugs.webkit.org/show_bug.cgi?id=213226 Reviewed by Don Olmstead. WebCore_CopyPrivateHeaders needs to have a direct or indirect dependency of WebCore target for CMake Visual Studio generator to eliminate duplicated custom commands. * CMakeLists.txt: Added add_dependencies(WebCore_CopyPrivateHeaders WebCore). 2020-06-16 Wenson Hsieh <wenson_hsieh@apple.com> Text manipulation should handle nested item boundary elements https://bugs.webkit.org/show_bug.cgi?id=213251 <rdar://problem/63371514> Reviewed by Sihui Liu. In the case where there are nested item boundary elements (e.g. block-level list items or links), text manipulation will currently only observe that we've crossed the top-level item boundary, and proceed to extract text from the nested boundary elements as tokens in the same item. Address this by maintaining a stack of boundary elements rather than just a single item. Additionally, create and add an item when crossing into a new item boundary, rather than only when we exit a boundary; this handles the case where we descend from one boundary element into another boundary element that is a child. Test: TextManipulation.StartTextManipulationTreatsNestedInlineBlockListItemsAndLinksAsParagraphs * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::observeParagraphs): 2020-06-16 Youenn Fablet <youenn@apple.com> Loads triggered by an opaque stylesheet should not be visible to service workers https://bugs.webkit.org/show_bug.cgi?id=213246 Reviewed by Alex Christensen. Test: http/wpt/service-workers/no-cors-css-with-subresources.https.html * loader/ResourceLoaderOptions.h: Move it to boolean 2020-06-16 Chris Fleizach <cfleizach@apple.com> AX: <address> element should no longer map to ARIA `contentinfo` role https://bugs.webkit.org/show_bug.cgi?id=212617 <rdar://problem/63848604> Reviewed by Joanmarie Diggs. Change the mapping of <address> to be a basic group. Update tests. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::determineAccessibilityRole): 2020-06-16 Truitt Savell <tsavell@apple.com> Unreviewed, reverting r263079. Broke Internal builds. Reverted changeset: "IndexedDB: Support IDBFactory databases method" https://bugs.webkit.org/show_bug.cgi?id=211043 https://trac.webkit.org/changeset/263079 2020-06-16 Antti Koivisto <antti@apple.com> O(n^2) behavior in media query resolution https://bugs.webkit.org/show_bug.cgi?id=213243 Reviewed by Anders Carlsson. We were traversing all rules in a RuleSet inside a loop over all media queries that change value. This becomes problematic when you have thousands of media queries. * style/RuleSet.cpp: (WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules): Instead collect the rule positions that need flipping into a map and then traverse only once to do the actual flipping. Longer term we should maintain a data stucture that can map directly from a position to RuleDatas. This will require some data structure rethink so this patch takes a simpler approach. (WebCore::Style::RuleSet::MediaQueryCollector::pop): * style/RuleSet.h: 2020-06-16 Per Arne Vollan <pvollan@apple.com> [iOS] Collecting screen properties in the UI process introduced a Safari launch time regression. https://bugs.webkit.org/show_bug.cgi?id=213217 <rdar://problem/64374461> Reviewed by Brent Fulgham. Calling collectScreenProperties() in WebProcessPool::platformInitializeWebProcess() introduced a Safari launch time regression on iOS. It turns out that calling screenIsMonochrome on iOS is expensive, but this call can still be done in the WebContent process, since there are no sandbox restrictions making that call fail in the WebContent process. Call this function in the WebContent process instead of in the UI process. No new tests, since this change should not introduce a change in behavior. It goes back to calling the screenIsMonochrome function in the WebContent process. * platform/ScreenProperties.h: (WebCore::ScreenData::encode const): (WebCore::ScreenData::decode): * platform/ios/PlatformScreenIOS.mm: (WebCore::screenIsMonochrome): (WebCore::collectScreenProperties): * platform/mac/PlatformScreenMac.mm: (WebCore::collectScreenProperties): 2020-06-16 Xabier Rodriguez Calvar <calvaris@igalia.com> [EME] Create CDMProxyFactory https://bugs.webkit.org/show_bug.cgi?id=212695 Reviewed by Youenn Fablet. Currently in the GStreamer port we have the CDMProxy cabled in the player private and set to the instance. Setting this too late can create key sync issues that are worked around. This does not seem to be needed because it can be created in the constructor from a CDMProxyFactory if we just use the key system that we already have. This patch declares a CDMProxyFactory that is used in the CDMInstanceProxy to instantiate the proper CDMProxy in its constructor. CDMProxyFactoryClearKey is created and added to the GStreamer platform CDMProxyFactories. Initializing too fast creates flakyness in several ClearKey tests because of asking for protected memory so we need to initialize it in a lazy way. No new tests, just a rework. * platform/encryptedmedia/CDMProxy.cpp: (WebCore::CDMProxyFactory::registerFactory): (WebCore::CDMProxyFactory::unregisterFactory): (WebCore::CDMProxyFactory::createCDMProxyForKeySystem): (WebCore::CDMProxyFactory::platformRegisterFactories): * platform/encryptedmedia/CDMProxy.h: (WebCore::CDMProxyFactory::~CDMProxyFactory): (WebCore::CDMInstanceProxy::CDMInstanceProxy): * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::CDMInstanceClearKey::CDMInstanceClearKey): (WebCore::CDMInstanceClearKey::keySystem const): * platform/encryptedmedia/clearkey/CDMClearKey.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::cdmInstanceAttached): * platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp: (WebCore::CDMProxyFactory::platformRegisterFactories): * platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp: (WebCore::CDMProxyFactoryClearKey::singleton): (WebCore::CDMProxyFactoryClearKey::createCDMProxy): (WebCore::CDMProxyFactoryClearKey::supportsKeySystem): * platform/graphics/gstreamer/eme/CDMProxyClearKey.h: 2020-06-16 youenn fablet <youenn@apple.com> Make sure MediaRecorder.requestData returns data with the new writer backend https://bugs.webkit.org/show_bug.cgi?id=206929 Reviewed by Darin Adler. Test: http/wpt/mediarecorder/MediaRecorder-requestData.html * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::fetchData): Flush data whenever calling fetchData. 2020-06-16 Darryl Pogue <darryl@dpogue.ca> IndexedDB: Support IDBFactory databases method https://bugs.webkit.org/show_bug.cgi?id=211043 Reviewed by Youenn Fablet. Add support for fetching the list of IDB database names and versions from the IDBServer, and expose the functionality as `IDBFactory.prototype.databases()`. Spec: https://w3c.github.io/IndexedDB/#dom-idbfactory-databases * Headers.cmake: * Modules/indexeddb/IDBActiveDOMObject.h: (WebCore::IDBActiveDOMObject::performCallbackOnOriginThread): * Modules/indexeddb/IDBDatabaseNameAndVersionRequest.cpp: Added. (WebCore::IDBDatabaseNameAndVersionRequest::create): (WebCore::IDBDatabaseNameAndVersionRequest::IDBDatabaseNameAndVersionRequest): (WebCore::IDBDatabaseNameAndVersionRequest::~IDBDatabaseNameAndVersionRequest): (WebCore::IDBDatabaseNameAndVersionRequest::complete): (WebCore::IDBDatabaseNameAndVersionRequest::activeDOMObjectName const): (WebCore::IDBDatabaseNameAndVersionRequest::virtualHasPendingActivity const): (WebCore::IDBDatabaseNameAndVersionRequest::stop): * Modules/indexeddb/IDBDatabaseNameAndVersionRequest.h: Added. * Modules/indexeddb/IDBFactory.cpp: (WebCore::IDBFactory::databases): (WebCore::IDBFactory::getAllDatabaseNames): * Modules/indexeddb/IDBFactory.h: * Modules/indexeddb/IDBFactory.idl: * Modules/indexeddb/client/IDBConnectionProxy.cpp: (WebCore::IDBClient::IDBConnectionProxy::connectionToServerLost): (WebCore::IDBClient::IDBConnectionProxy::getAllDatabaseNamesAndVersions): (WebCore::IDBClient::IDBConnectionProxy::didGetAllDatabaseNamesAndVersions): (WebCore::IDBClient::IDBConnectionProxy::forgetActivityForCurrentThread): (WebCore::IDBClient::IDBConnectionProxy::getAllDatabaseNames): Deleted. * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/client/IDBConnectionToServer.cpp: (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNamesAndVersions): (WebCore::IDBClient::IDBConnectionToServer::didGetAllDatabaseNamesAndVersions): (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames): Deleted. (WebCore::IDBClient::IDBConnectionToServer::didGetAllDatabaseNames): Deleted. * Modules/indexeddb/client/IDBConnectionToServer.h: * Modules/indexeddb/client/IDBConnectionToServerDelegate.h: * Modules/indexeddb/server/IDBConnectionToClient.cpp: (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNamesAndVersions): (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNames): Deleted. * Modules/indexeddb/server/IDBConnectionToClient.h: * Modules/indexeddb/server/IDBConnectionToClientDelegate.h: * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::getAllDatabaseNamesAndVersions): (WebCore::IDBServer::IDBServer::getAllDatabaseNames): Deleted. * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameAndVersionFromFile): (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile): Deleted. * Modules/indexeddb/server/SQLiteIDBBackingStore.h: * Modules/indexeddb/shared/IDBDatabaseNameAndVersion.h: Added. (WebCore::IDBDatabaseNameAndVersion::encode const): (WebCore::IDBDatabaseNameAndVersion::decode): (WebCore::IDBDatabaseNameAndVersion::isolatedCopy const): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * inspector/agents/InspectorIndexedDBAgent.cpp: (WebCore::InspectorIndexedDBAgent::requestDatabaseNames): * loader/EmptyClients.cpp: 2020-06-15 ChangSeok Oh <changseok@webkit.org> [GTK] Rename GC3D to GCGL. https://bugs.webkit.org/show_bug.cgi?id=211117 Reviewed by Fujii Hironori. GraphicsContext3D has been renamed to GraphicsContextGL after r254103 but some files still follow the old name. This change reflects the new name to them for consistency. No new tests because of no new functionalities. * platform/TextureMapper.cmake: * platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp: Renamed from Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGC3DANGLELayer.cpp. (Nicosia::GCGLANGLELayer::ANGLEContext::errorString): (Nicosia::GCGLANGLELayer::ANGLEContext::lastErrorString): (Nicosia::GCGLANGLELayer::ANGLEContext::createContext): (Nicosia::GCGLANGLELayer::ANGLEContext::ANGLEContext): (Nicosia::GCGLANGLELayer::ANGLEContext::~ANGLEContext): (Nicosia::GCGLANGLELayer::ANGLEContext::makeContextCurrent): (Nicosia::GCGLANGLELayer::ANGLEContext::platformContext const): (Nicosia::GCGLANGLELayer::GCGLANGLELayer): (Nicosia::GCGLANGLELayer::~GCGLANGLELayer): (Nicosia::GCGLANGLELayer::makeContextCurrent): (Nicosia::GCGLANGLELayer::platformContext const): * platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.h: Renamed from Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGC3DANGLELayer.h. * platform/graphics/nicosia/texmap/NicosiaGCGLLayer.cpp: Renamed from Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp. (Nicosia::GCGLLayer::GCGLLayer): (Nicosia::GCGLLayer::~GCGLLayer): (Nicosia::GCGLLayer::makeContextCurrent): (Nicosia::GCGLLayer::platformContext const): (Nicosia::GCGLLayer::swapBuffersIfNeeded): * platform/graphics/nicosia/texmap/NicosiaGCGLLayer.h: Renamed from Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGC3DLayer.h. (Nicosia::GCGLLayer::contentLayer const): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp: Renamed from Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp. (WebCore::TextureMapperGCGLPlatformLayer::TextureMapperGCGLPlatformLayer): (WebCore::TextureMapperGCGLPlatformLayer::~TextureMapperGCGLPlatformLayer): (WebCore::TextureMapperGCGLPlatformLayer::makeContextCurrent): (WebCore::TextureMapperGCGLPlatformLayer::platformContext const): (WebCore::TextureMapperGCGLPlatformLayer::proxy const): (WebCore::TextureMapperGCGLPlatformLayer::swapBuffersIfNeeded): (WebCore::TextureMapperGCGLPlatformLayer::paintToTextureMapper): * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.h: Renamed from Source/WebCore/platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h. 2020-06-15 Megan Gardner <megan_gardner@apple.com> Text form controls can scroll by 1px when value is the same length as size. No scrolling should happen. https://bugs.webkit.org/show_bug.cgi?id=212856 <rdar://problem/63541707> Reviewed by Zalan Bujtas. We were only adding caret width to an input when determining if the input should start to be scrolled, but that additional width was not included in the initial calculation, which could result in fields being scrollable by 1px when they had the same number of fixed-width characters as the size of the field. This was incorrect, and caused fast/forms/password-scrolled-after-caps-lock-toggled.html to fail when the default size of the security dots increased to be the same as the average character width. Adding the caret width when the size of the input field is calculated brings consistency to when an input field is scrollable. Tested by fixing: fast/forms/password-scrolled-after-caps-lock-toggled.html And rebasing: * editing/editable-region/overflow-scroll-text-field-and-contenteditable-expected.txt: * editing/editable-region/search-field-basic-expected.txt: * editing/editable-region/text-field-basic-expected.txt: * fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly-expected.html: * fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly.html: * fast/forms/auto-fill-button/input-credit-card-auto-fill-button-expected.txt: * fast/forms/fieldset/fieldset-elements-htmlcollection-expected.txt: * fast/forms/fieldset/fieldset-elements-htmlcollection.html: * fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled-expected.html: * fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html: * fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly-expected.html: * fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html: * platform/ios-simulator/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt: * platform/ios-simulator/fast/forms/auto-fill-button/input-credit-card-auto-fill-button-expected.txt: * platform/ios-simulator/fast/forms/auto-fill-button/input-strong-password-viewable-expected.txt: * platform/ios-simulator/fast/forms/datalist/datalist-searchinput-appearance-expected.txt: * platform/ios-simulator/fast/forms/datalist/datalist-textinput-appearance-expected.txt: * platform/ios-wk2/editing/input/caret-at-the-edge-of-contenteditable-expected.txt: * platform/ios-wk2/editing/input/caret-at-the-edge-of-input-expected.txt: * platform/ios-wk2/editing/inserting/before-after-input-element-expected.txt: * platform/ios-wk2/editing/pasteboard/input-field-1-expected.txt: * platform/ios-wk2/editing/selection/4895428-3-expected.txt: * platform/ios-wk2/editing/selection/drag-select-1-expected.txt: * platform/ios-wk2/editing/selection/select-from-textfield-outwards-expected.txt: * platform/ios-wk2/fast/forms/input-appearance-preventDefault-expected.txt: * platform/ios-wk2/fast/forms/input-text-click-inside-expected.txt: * platform/ios-wk2/fast/forms/input-text-click-outside-expected.txt: * platform/ios-wk2/fast/forms/input-text-double-click-expected.txt: * platform/ios-wk2/fast/forms/input-text-drag-down-expected.txt: * platform/ios-wk2/fast/forms/input-text-option-delete-expected.txt: * platform/ios-wk2/fast/forms/input-text-self-emptying-click-expected.txt: * platform/ios-wk2/fast/forms/tabbing-input-iframe-expected.txt: * platform/ios-wk2/fast/forms/textfield-outline-expected.txt: * platform/ios-wk2/fast/overflow/overflow-focus-ring-expected.txt: * platform/ios-wk2/fast/repaint/placeholder-after-caps-lock-hidden-expected.txt: * platform/ios-wk2/fast/transforms/transformed-focused-text-input-expected.txt: * platform/ios/editing/pasteboard/4806874-expected.txt: * platform/ios/editing/selection/3690703-2-expected.txt: * platform/ios/editing/selection/3690703-expected.txt: * platform/ios/editing/selection/3690719-expected.txt: * platform/ios/editing/selection/4975120-expected.txt: * platform/ios/fast/clip/outline-overflowClip-expected.txt: * platform/ios/fast/css/focus-ring-exists-for-search-field-expected.txt: * platform/ios/fast/css/input-search-padding-expected.txt: * platform/ios/fast/css/line-height-expected.txt: * platform/ios/fast/css/text-overflow-input-expected.txt: * platform/ios/fast/events/context-no-deselect-expected.txt: * platform/ios/fast/forms/auto-fill-button/input-contacts-auto-fill-button-expected.txt: * platform/ios/fast/forms/basic-inputs-expected.txt: * platform/ios/fast/forms/box-shadow-override-expected.txt: * platform/ios/fast/forms/control-restrict-line-height-expected.txt: * platform/ios/fast/forms/encoding-test-expected.txt: * platform/ios/fast/forms/fieldset-align-expected.txt: * platform/ios/fast/forms/form-element-geometry-expected.txt: * platform/ios/fast/forms/input-align-expected.txt: * platform/ios/fast/forms/input-appearance-bkcolor-expected.txt: * platform/ios/fast/forms/input-appearance-default-bkcolor-expected.txt: * platform/ios/fast/forms/input-appearance-focus-expected.txt: * platform/ios/fast/forms/input-appearance-height-expected.txt: * platform/ios/fast/forms/input-appearance-selection-expected.txt: * platform/ios/fast/forms/input-appearance-visibility-expected.txt: * platform/ios/fast/forms/input-appearance-width-expected.txt: * platform/ios/fast/forms/input-disabled-color-expected.txt: * platform/ios/fast/forms/input-double-click-selection-gap-bug-expected.txt: * platform/ios/fast/forms/input-placeholder-visibility-1-expected.txt: * platform/ios/fast/forms/input-placeholder-visibility-3-expected.txt: * platform/ios/fast/forms/input-spaces-expected.txt: * platform/ios/fast/forms/input-table-expected.txt: * platform/ios/fast/forms/input-text-click-inside-expected.txt: * platform/ios/fast/forms/input-text-scroll-left-on-blur-expected.txt: * platform/ios/fast/forms/input-text-self-emptying-click-expected.txt: * platform/ios/fast/forms/input-type-text-min-width-expected.txt: * platform/ios/fast/forms/input-value-expected.txt: * platform/ios/fast/forms/input-width-expected.txt: * platform/ios/fast/forms/minWidthPercent-expected.txt: * platform/ios/fast/forms/number/number-appearance-rtl-expected.txt: * platform/ios/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt: * platform/ios/fast/forms/number/number-appearance-spinbutton-layer-expected.txt: * platform/ios/fast/forms/placeholder-pseudo-style-expected.txt: * platform/ios/fast/forms/search-cancel-button-style-sharing-expected.txt: * platform/ios/fast/forms/search-display-none-cancel-button-expected.txt: * platform/ios/fast/forms/search-input-rtl-expected.txt: * platform/ios/fast/forms/search-styled-expected.txt: * platform/ios/fast/forms/tabbing-input-iframe-expected.txt: * platform/ios/fast/forms/text-control-intrinsic-widths-expected.txt: * platform/ios/fast/forms/textfield-focus-ring-expected.txt: * platform/ios/fast/forms/textfield-overflow-expected.txt: * platform/ios/fast/frames/take-focus-from-iframe-expected.txt: * platform/ios/fast/html/details-no-summary4-expected.txt: * platform/ios/fast/html/details-open-javascript-expected.txt: * platform/ios/fast/html/details-open2-expected.txt: * platform/ios/fast/html/details-open4-expected.txt: * platform/ios/fast/lists/dynamic-marker-crash-expected.txt: * platform/ios/fast/replaced/replaced-breaking-expected.txt: * platform/ios/fast/replaced/replaced-breaking-mixture-expected.txt: * platform/ios/fast/table/colspanMinWidth-expected.txt: * platform/ios/fast/table/spanOverlapRepaint-expected.txt: * platform/ios/fast/table/text-field-baseline-expected.txt: * platform/ios/svg/custom/inline-svg-in-xhtml-expected.txt: * platform/ios/svg/hixie/mixed/003-expected.txt: * platform/ios/tables/mozilla/bugs/bug1188-expected.txt: * platform/ios/tables/mozilla/bugs/bug12384-expected.txt: * platform/ios/tables/mozilla/bugs/bug18359-expected.txt: * platform/ios/tables/mozilla/bugs/bug24200-expected.txt: * platform/ios/tables/mozilla/bugs/bug2479-2-expected.txt: * platform/ios/tables/mozilla/bugs/bug2479-3-expected.txt: * platform/ios/tables/mozilla/bugs/bug2479-4-expected.txt: * platform/ios/tables/mozilla/bugs/bug28928-expected.txt: * platform/ios/tables/mozilla/bugs/bug4382-expected.txt: * platform/ios/tables/mozilla/bugs/bug4527-expected.txt: * platform/ios/tables/mozilla/bugs/bug46368-1-expected.txt: * platform/ios/tables/mozilla/bugs/bug46368-2-expected.txt: * platform/ios/tables/mozilla/bugs/bug51037-expected.txt: * platform/ios/tables/mozilla/bugs/bug55545-expected.txt: * platform/ios/tables/mozilla/bugs/bug59354-expected.txt: * platform/ios/tables/mozilla/bugs/bug7342-expected.txt: * platform/ios/tables/mozilla/bugs/bug96334-expected.txt: * platform/ios/tables/mozilla/bugs/bug99948-expected.txt: * platform/ios/tables/mozilla/dom/tableDom-expected.txt: * platform/ios/tables/mozilla/other/move_row-expected.txt: * platform/ios/tables/mozilla_expected_failures/bugs/bug2479-5-expected.txt: * platform/ios/tables/mozilla_expected_failures/bugs/bug92647-1-expected.txt: * platform/ios/transforms/3d/general/perspective-non-layer-expected.txt: * platform/mac-mojave/tables/mozilla_expected_failures/bugs/bug2479-5-expected.txt: * platform/mac/editing/input/caret-at-the-edge-of-input-expected.txt: * platform/mac/editing/inserting/before-after-input-element-expected.txt: * platform/mac/editing/pasteboard/4806874-expected.txt: * platform/mac/editing/pasteboard/drop-text-without-selection-expected.txt: * platform/mac/editing/pasteboard/input-field-1-expected.txt: * platform/mac/editing/selection/3690703-2-expected.txt: * platform/mac/editing/selection/3690703-expected.txt: * platform/mac/editing/selection/3690719-expected.txt: * platform/mac/editing/selection/4895428-3-expected.txt: * platform/mac/editing/selection/4975120-expected.txt: * platform/mac/editing/selection/drag-select-1-expected.txt: * platform/mac/editing/selection/select-from-textfield-outwards-expected.txt: * platform/mac/fast/css/focus-ring-exists-for-search-field-expected.txt: * platform/mac/fast/css/line-height-expected.txt: * platform/mac/fast/css/text-overflow-input-expected.txt: * platform/mac/fast/events/context-no-deselect-expected.txt: * platform/mac/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt: * platform/mac/fast/forms/auto-fill-button/input-auto-fill-button-expected.txt: * platform/mac/fast/forms/auto-fill-button/input-contacts-auto-fill-button-expected.txt: * platform/mac/fast/forms/auto-fill-button/input-strong-password-viewable-expected.txt: * platform/mac/fast/forms/basic-inputs-expected.txt: * platform/mac/fast/forms/box-shadow-override-expected.txt: * platform/mac/fast/forms/control-restrict-line-height-expected.txt: * platform/mac/fast/forms/datalist/datalist-searchinput-appearance-expected.txt: * platform/mac/fast/forms/datalist/datalist-textinput-appearance-expected.txt: * platform/mac/fast/forms/encoding-test-expected.txt: * platform/mac/fast/forms/fieldset-align-expected.txt: * platform/mac/fast/forms/form-element-geometry-expected.txt: * platform/mac/fast/forms/input-align-expected.txt: * platform/mac/fast/forms/input-appearance-bkcolor-expected.txt: * platform/mac/fast/forms/input-appearance-default-bkcolor-expected.txt: * platform/mac/fast/forms/input-appearance-focus-expected.txt: * platform/mac/fast/forms/input-appearance-height-expected.txt: * platform/mac/fast/forms/input-appearance-preventDefault-expected.txt: * platform/mac/fast/forms/input-appearance-selection-expected.txt: * platform/mac/fast/forms/input-appearance-spinbutton-expected.txt: * platform/mac/fast/forms/input-appearance-spinbutton-up-expected.txt: * platform/mac/fast/forms/input-appearance-visibility-expected.txt: * platform/mac/fast/forms/input-appearance-width-expected.txt: * platform/mac/fast/forms/input-baseline-expected.txt: * platform/mac/fast/forms/input-disabled-color-expected.txt: * platform/mac/fast/forms/input-double-click-selection-gap-bug-expected.txt: * platform/mac/fast/forms/input-placeholder-visibility-1-expected.txt: * platform/mac/fast/forms/input-placeholder-visibility-3-expected.txt: * platform/mac/fast/forms/input-spaces-expected.txt: * platform/mac/fast/forms/input-table-expected.txt: * platform/mac/fast/forms/input-text-click-inside-expected.txt: * platform/mac/fast/forms/input-text-click-outside-expected.txt: * platform/mac/fast/forms/input-text-double-click-expected.txt: * platform/mac/fast/forms/input-text-drag-down-expected.txt: * platform/mac/fast/forms/input-text-option-delete-expected.txt: * platform/mac/fast/forms/input-text-scroll-left-on-blur-expected.txt: * platform/mac/fast/forms/input-text-self-emptying-click-expected.txt: * platform/mac/fast/forms/input-text-word-wrap-expected.txt: * platform/mac/fast/forms/input-type-text-min-width-expected.txt: * platform/mac/fast/forms/input-value-expected.txt: * platform/mac/fast/forms/input-width-expected.txt: * platform/mac/fast/forms/number/number-appearance-rtl-expected.txt: * platform/mac/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt: * platform/mac/fast/forms/number/number-appearance-spinbutton-layer-expected.txt: * platform/mac/fast/forms/placeholder-position-expected.txt: * platform/mac/fast/forms/placeholder-pseudo-style-expected.txt: * platform/mac/fast/forms/search-cancel-button-style-sharing-expected.txt: * platform/mac/fast/forms/search-display-none-cancel-button-expected.txt: * platform/mac/fast/forms/search-input-rtl-expected.txt: * platform/mac/fast/forms/search-styled-expected.txt: * platform/mac/fast/forms/search-vertical-alignment-expected.txt: * platform/mac/fast/forms/search/search-padding-cancel-results-buttons-expected.txt: * platform/mac/fast/forms/search/search-size-with-decorations-expected.txt: * platform/mac/fast/forms/tabbing-input-iframe-expected.txt: * platform/mac/fast/forms/text-control-intrinsic-widths-expected.txt: * platform/mac/fast/forms/textfield-focus-ring-expected.txt: * platform/mac/fast/forms/textfield-outline-expected.txt: * platform/mac/fast/forms/textfield-overflow-expected.txt: * platform/mac/fast/forms/visual-hebrew-text-field-expected.txt: * platform/mac/fast/frames/take-focus-from-iframe-expected.txt: * platform/mac/fast/html/details-no-summary4-expected.txt: * platform/mac/fast/html/details-open-javascript-expected.txt: * platform/mac/fast/html/details-open2-expected.txt: * platform/mac/fast/html/details-open4-expected.txt: * platform/mac/fast/lists/dynamic-marker-crash-expected.txt: * platform/mac/fast/repaint/renderer-destruction-by-invalidateSelection-crash-expected.txt: * platform/mac/fast/repaint/search-field-cancel-expected.txt: * platform/mac/fast/repaint/subtree-root-skipped-expected.txt: * platform/mac/fast/replaced/replaced-breaking-expected.txt: * platform/mac/fast/replaced/replaced-breaking-mixture-expected.txt: * platform/mac/fast/table/colspanMinWidth-expected.txt: * platform/mac/fast/table/spanOverlapRepaint-expected.txt: * platform/mac/fast/table/text-field-baseline-expected.txt: * platform/mac/fast/text/textIteratorNilRenderer-expected.txt: * platform/mac/fast/transforms/transformed-focused-text-input-expected.txt: * platform/mac/http/tests/navigation/javascriptlink-frames-expected.txt: * platform/mac/plugins/mouse-click-plugin-clears-selection-expected.txt: * platform/mac/svg/custom/inline-svg-in-xhtml-expected.txt: * platform/mac/svg/hixie/mixed/003-expected.txt: * platform/mac/tables/mozilla/bugs/bug1188-expected.txt: * platform/mac/tables/mozilla/bugs/bug12384-expected.txt: * platform/mac/tables/mozilla/bugs/bug18359-expected.txt: * platform/mac/tables/mozilla/bugs/bug24200-expected.txt: * platform/mac/tables/mozilla/bugs/bug2479-2-expected.txt: * platform/mac/tables/mozilla/bugs/bug2479-3-expected.txt: * platform/mac/tables/mozilla/bugs/bug2479-4-expected.txt: * platform/mac/tables/mozilla/bugs/bug28928-expected.txt: * platform/mac/tables/mozilla/bugs/bug4382-expected.txt: * platform/mac/tables/mozilla/bugs/bug4527-expected.txt: * platform/mac/tables/mozilla/bugs/bug46368-1-expected.txt: * platform/mac/tables/mozilla/bugs/bug46368-2-expected.txt: * platform/mac/tables/mozilla/bugs/bug51037-expected.txt: * platform/mac/tables/mozilla/bugs/bug55545-expected.txt: * platform/mac/tables/mozilla/bugs/bug59354-expected.txt: * platform/mac/tables/mozilla/bugs/bug7342-expected.txt: * platform/mac/tables/mozilla/bugs/bug96334-expected.txt: * platform/mac/tables/mozilla/bugs/bug99948-expected.txt: * platform/mac/tables/mozilla/dom/tableDom-expected.txt: * platform/mac/tables/mozilla/other/move_row-expected.txt: * platform/mac/tables/mozilla_expected_failures/bugs/bug2479-5-expected.txt: * platform/mac/tables/mozilla_expected_failures/bugs/bug92647-1-expected.txt: * platform/mac/transforms/3d/general/perspective-non-layer-expected.txt: * platform/win/editing/input/caret-at-the-edge-of-input-expected.txt: * platform/win/editing/inserting/before-after-input-element-expected.txt: * platform/win/fast/css/focus-ring-exists-for-search-field-expected.txt: * platform/win/fast/events/context-no-deselect-expected.txt: * platform/win/fast/forms/auto-fill-button/input-auto-fill-button-expected.txt: * platform/win/fast/forms/auto-fill-button/input-contacts-auto-fill-button-expected.txt: * platform/win/fast/forms/auto-fill-button/input-credit-card-auto-fill-button-expected.txt: * platform/win/fast/forms/basic-inputs-expected.txt: * platform/win/fast/forms/box-shadow-override-expected.txt: * platform/win/fast/forms/control-restrict-line-height-expected.txt: * platform/win/fast/forms/encoding-test-expected.txt: * platform/win/fast/forms/fieldset-align-expected.txt: * platform/win/fast/forms/form-element-geometry-expected.txt: * platform/win/fast/forms/input-align-expected.txt: * platform/win/fast/forms/input-appearance-bkcolor-expected.txt: * platform/win/fast/forms/input-appearance-default-bkcolor-expected.txt: * platform/win/fast/forms/input-appearance-disabled-expected.txt: * platform/win/fast/forms/input-appearance-focus-expected.txt: * platform/win/fast/forms/input-appearance-height-expected.txt: * platform/win/fast/forms/input-appearance-readonly-expected.txt: * platform/win/fast/forms/input-appearance-selection-expected.txt: * platform/win/fast/forms/input-appearance-visibility-expected.txt: * platform/win/fast/forms/input-appearance-width-expected.txt: * platform/win/fast/forms/input-baseline-expected.txt: * platform/win/fast/forms/input-disabled-color-expected.txt: * platform/win/fast/forms/input-double-click-selection-gap-bug-expected.txt: * platform/win/fast/forms/input-placeholder-visibility-1-expected.txt: * platform/win/fast/forms/input-placeholder-visibility-3-expected.txt: * platform/win/fast/forms/input-readonly-autoscroll-expected.txt: * platform/win/fast/forms/input-readonly-dimmed-expected.txt: * platform/win/fast/forms/input-readonly-empty-expected.txt: * platform/win/fast/forms/input-spaces-expected.txt: * platform/win/fast/forms/input-table-expected.txt: * platform/win/fast/forms/input-text-click-inside-expected.txt: * platform/win/fast/forms/input-text-click-outside-expected.txt: * platform/win/fast/forms/input-text-double-click-expected.txt: * platform/win/fast/forms/input-text-drag-down-expected.txt: * platform/win/fast/forms/input-text-option-delete-expected.txt: * platform/win/fast/forms/input-text-scroll-left-on-blur-expected.txt: * platform/win/fast/forms/input-text-self-emptying-click-expected.txt: * platform/win/fast/forms/input-text-word-wrap-expected.txt: * platform/win/fast/forms/input-type-text-min-width-expected.txt: * platform/win/fast/forms/input-value-expected.txt: * platform/win/fast/forms/input-width-expected.txt: * platform/win/fast/forms/placeholder-pseudo-style-expected.txt: * platform/win/fast/forms/search-cancel-button-style-sharing-expected.txt: * platform/win/fast/forms/search-display-none-cancel-button-expected.txt: * platform/win/fast/forms/search-styled-expected.txt: * platform/win/fast/forms/search-vertical-alignment-expected.txt: * platform/win/fast/forms/search/search-size-with-decorations-expected.txt: * platform/win/fast/forms/tabbing-input-iframe-expected.txt: * platform/win/fast/forms/text-control-intrinsic-widths-expected.txt: * platform/win/fast/forms/textfield-focus-ring-expected.txt: * platform/win/fast/forms/textfield-outline-expected.txt: * platform/win/fast/forms/textfield-overflow-expected.txt: * platform/win/fast/forms/visual-hebrew-text-field-expected.txt: * platform/win/fast/frames/take-focus-from-iframe-expected.txt: * platform/win/fast/html/details-no-summary4-expected.txt: * platform/win/fast/html/details-open-javascript-expected.txt: * platform/win/fast/html/details-open2-expected.txt: * platform/win/fast/html/details-open4-expected.txt: * platform/win/fast/lists/dynamic-marker-crash-expected.txt: * platform/win/fast/replaced/replaced-breaking-expected.txt: * platform/win/fast/replaced/replaced-breaking-mixture-expected.txt: * platform/win/fast/table/colspanMinWidth-expected.txt: * platform/win/fast/table/spanOverlapRepaint-expected.txt: * platform/win/fast/table/text-field-baseline-expected.txt: * platform/win/fast/text/textIteratorNilRenderer-expected.txt: * platform/win/fast/transforms/transformed-focused-text-input-expected.txt: * platform/win/svg/hixie/mixed/003-expected.txt: * platform/win/tables/mozilla/bugs/bug1188-expected.txt: * platform/win/tables/mozilla/bugs/bug12384-expected.txt: * platform/win/tables/mozilla/bugs/bug18359-expected.txt: * platform/win/tables/mozilla/bugs/bug24200-expected.txt: * platform/win/tables/mozilla/bugs/bug2479-2-expected.txt: * platform/win/tables/mozilla/bugs/bug2479-3-expected.txt: * platform/win/tables/mozilla/bugs/bug2479-4-expected.txt: * platform/win/tables/mozilla/bugs/bug28928-expected.txt: * platform/win/tables/mozilla/bugs/bug4382-expected.txt: * platform/win/tables/mozilla/bugs/bug4527-expected.txt: * platform/win/tables/mozilla/bugs/bug46368-1-expected.txt: * platform/win/tables/mozilla/bugs/bug46368-2-expected.txt: * platform/win/tables/mozilla/bugs/bug51037-expected.txt: * platform/win/tables/mozilla/bugs/bug55545-expected.txt: * platform/win/tables/mozilla/bugs/bug59354-expected.txt: * platform/win/tables/mozilla/bugs/bug7342-expected.txt: * platform/win/tables/mozilla/bugs/bug96334-expected.txt: * platform/win/tables/mozilla/bugs/bug99948-expected.txt: * platform/win/tables/mozilla/dom/tableDom-expected.txt: * platform/win/tables/mozilla/other/move_row-expected.txt: * platform/win/tables/mozilla_expected_failures/bugs/bug2479-5-expected.txt: * platform/win/tables/mozilla_expected_failures/bugs/bug92647-1-expected.txt: * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::addOverflowFromInlineChildren): * rendering/RenderBlockFlow.h: (WebCore::RenderBlockFlow::endPaddingWidthForCaret const): * rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::preferredContentLogicalWidth const): 2020-06-15 Pavel Feldman <pavel.feldman@gmail.com> Web Inspector: introduce request interception https://bugs.webkit.org/show_bug.cgi?id=207446 Reviewed by Devin Rousso. This change introduces network request interception to the Network protocol domain. It adds Network.interceptWithRequest notification that can be continued, modified or fulfilled. NetworkStage enum can now have 'request' and 'response' values. Tests: http/tests/inspector/network/intercept-aborted-request.html http/tests/inspector/network/intercept-request-continue.html http/tests/inspector/network/intercept-request-fragment.html http/tests/inspector/network/intercept-request-main-resource-with-response.html http/tests/inspector/network/intercept-request-main-resource.html http/tests/inspector/network/intercept-request-properties.html http/tests/inspector/network/intercept-request-subresource-with-error.html http/tests/inspector/network/intercept-request-subresource-with-response.html http/tests/inspector/network/intercept-request-subresource.html http/tests/inspector/network/intercept-request-with-response.html * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::willInterceptImpl): (WebCore::InspectorInstrumentation::shouldInterceptRequestImpl): (WebCore::InspectorInstrumentation::interceptRequestImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::willIntercept): (WebCore::InspectorInstrumentation::shouldInterceptRequest): (WebCore::InspectorInstrumentation::interceptRequest): * inspector/InspectorInstrumentationWebKit.cpp: (WebCore::InspectorInstrumentationWebKit::shouldInterceptRequestInternal): (WebCore::InspectorInstrumentationWebKit::interceptRequestInternal): * inspector/InspectorInstrumentationWebKit.h: (WebCore::InspectorInstrumentationWebKit::shouldInterceptRequest): (WebCore::InspectorInstrumentationWebKit::interceptRequest): * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::disable): (WebCore::InspectorNetworkAgent::shouldIntercept): (WebCore::InspectorNetworkAgent::continuePendingRequests): (WebCore::InspectorNetworkAgent::setInterceptionEnabled): (WebCore::InspectorNetworkAgent::addInterception): (WebCore::InspectorNetworkAgent::removeInterception): (WebCore::InspectorNetworkAgent::willIntercept): (WebCore::InspectorNetworkAgent::shouldInterceptRequest): (WebCore::InspectorNetworkAgent::shouldInterceptResponse): (WebCore::InspectorNetworkAgent::interceptRequest): (WebCore::InspectorNetworkAgent::interceptContinue): (WebCore::InspectorNetworkAgent::interceptWithRequest): (WebCore::InspectorNetworkAgent::interceptRequestWithResponse): (WebCore::InspectorNetworkAgent::interceptRequestWithError): * inspector/agents/InspectorNetworkAgent.h: (WebCore::InspectorNetworkAgent::PendingInterceptRequest::PendingInterceptRequest): (WebCore::InspectorNetworkAgent::PendingInterceptRequest::continueWithOriginalRequest): (WebCore::InspectorNetworkAgent::PendingInterceptRequest::continueWithRequest): (WebCore::InspectorNetworkAgent::Intercept::operator== const): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::preload): 2020-06-15 Keith Miller <keith_miller@apple.com> JIT thunks should work on arm64_32 https://bugs.webkit.org/show_bug.cgi?id=213103 Reviewed by Saam Barati. Refactor timesPtr() to ScalePtr. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasClasses): 2020-06-15 Sihui Liu <sihui_liu@apple.com> Text manipulation does not observe newly displayed element inside previously observed content https://bugs.webkit.org/show_bug.cgi?id=213156 Reviewed by Darin Adler. Fix two issues: 1. Some inserted nodes are marked as manipulated, but they are inserted because they get removed in the replacement process, not because they are manipulated or in the range of item. 2. TextManipulationController does not perform manipulation on an element if its ancestor is manipulated. This means the newly inserted/displayed children of a manipulated element are ruled out for manipulation. Test: TextManipulation.CompleteTextManipulationForNewlyDisplayedParagraph * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::observeParagraphs): (WebCore::TextManipulationController::didCreateRendererForElement): (WebCore::TextManipulationController::updateInsertions): (WebCore::TextManipulationController::replace): (WebCore::TextManipulationController::isInManipulatedElement): Deleted. * editing/TextManipulationController.h: 2020-06-15 Víctor Manuel Jáquez Leal <vjaquez@igalia.com> Suppress compiler warnings https://bugs.webkit.org/show_bug.cgi?id=213034 Reviewed by Darin Adler. Use PRIu64 formatter for uint64_t instead of %llu. No functional changes. * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd): 2020-06-15 ChangSeok Oh <changseok@webkit.org> [GTK] Use GRefPtr for ManetteMonitor https://bugs.webkit.org/show_bug.cgi?id=213094 Reviewed by Carlos Garcia Campos. We should use GRefPtr for ManetteMonitor, but not GUniquePtr. Because it is a gobject instance. No new tests because of no functionality changed. * platform/gamepad/manette/ManetteGamepadProvider.h: 2020-06-15 Alexey Shvayka <shvaikalesh@gmail.com> super should not depend on __proto__ https://bugs.webkit.org/show_bug.cgi?id=157972 Reviewed by Saam Barati. No new tests, no behavior change. * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): Set OverridesGetPrototype structure flag for CustomGetPrototype IDL attribute. 2020-06-15 Philippe Normand <pnormand@igalia.com> [GStreamer] ImageDecoder hits Debug ASSERTs https://bugs.webkit.org/show_bug.cgi?id=213178 Reviewed by Xabier Rodriguez-Calvar. Pass a reference of the decoder to its inner implementation instead of a WeakPtr, which can't be used across multiple threads. Covered by fast/images/animated-image-mp4{,-crash}.html tests. * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: (WebCore::ImageDecoderGStreamer::InnerDecoder::connectDecoderPad): * platform/graphics/gstreamer/ImageDecoderGStreamer.h: 2020-06-15 Youenn Fablet <youenn@apple.com> Simplify MediaRecorderPrivateWriterCocoa threading logic https://bugs.webkit.org/show_bug.cgi?id=213126 Reviewed by Eric Carlson. Always hop to the main thread when receiving compressed samples. This makes the threading model simpler and pushing enqueued samples in the writer is not very performance sensitive. Add handling of the special case of video samples being pushed but no compressed sample is yet produced. In that case, when stopping recording, the samples will be pushed and we will start the writer. Minor refactoring to remove some unnecessary checks and make sure some of the member fields gets initialized in their declaration. Covered by existing tests. * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::compressedVideoOutputBufferCallback): (WebCore::MediaRecorderPrivateWriter::compressedAudioOutputBufferCallback): (WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers): (WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers): (WebCore::MediaRecorderPrivateWriter::stopRecording): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor): 2020-06-15 Youenn Fablet <youenn@apple.com> Add a quirk to allow starting AudioContext if document was interacted https://bugs.webkit.org/show_bug.cgi?id=213118 Reviewed by Eric Carlson. Manually tested on bing.com. * Modules/webaudio/AudioContext.cpp: (WebCore::isDocumentAllowingAutoplayWebAudio): (WebCore::AudioContext::willBeginPlayback): * page/Quirks.cpp: (WebCore::Quirks::shouldAutoplayWebAudioForArbitraryUserGesture const): * page/Quirks.h: 2020-06-15 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Move textFromUTF8() to TextResourceDecoder from FetchBodyConsumer https://bugs.webkit.org/show_bug.cgi?id=213170 Reviewed by Youenn Fablet. This function abstracts https://encoding.spec.whatwg.org/#utf-8-decode so I think it's better to place to `TextResourceDecoder`. * Modules/fetch/FetchBodyConsumer.cpp: (WebCore::resolveWithTypeAndData): (WebCore::FetchBodyConsumer::takeAsText): * loader/TextResourceDecoder.cpp: (WebCore::shouldPrependBOM): (WebCore::TextResourceDecoder::textFromUTF8): * loader/TextResourceDecoder.h: 2020-06-15 Youenn Fablet <youenn@apple.com> MediaRecorder should not be collectable when fetching data from its backend https://bugs.webkit.org/show_bug.cgi?id=213121 Reviewed by Eric Carlson. Take a pending activity when fetching data since we might want dispatch an event when receiving the fetch data. Covered by existing tests no longer crashing in debug. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::requestData): 2020-06-14 Sergio Villar Senin <svillar@igalia.com> Unreviewed, reverting r262124. Twitter videos go blank after exiting fullscreen Reverted changeset: "[css-flex] Allow indefinite size flex items to be definite wrt resolving percentages inside them" https://bugs.webkit.org/show_bug.cgi?id=212264 https://trac.webkit.org/changeset/262124 2020-06-14 Sam Weinig <weinig@apple.com> [WPT] html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray.html fails due to lack of caching of Plugin objects https://bugs.webkit.org/show_bug.cgi?id=213185 Reviewed by Darin Adler. Tests: - Updates results for web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray.html which now passes. - Splits up http/tests/plugins/plugin-javascript-access.html, adding http/tests/plugins/plugin-javascript-access-allow-all-plugins.html which tests the internals.setShowAllPlugins(true) case. This was required now that the plugin and mimetype arrays are immutable after creation. Overhaul web exposed plugin APIs: - All DOMPlugin and DOMMimeTypes are now created together (along with the DOMPluginArray and DOMMimeTypeArray) on first access of either navigator.plugins or navigator.mimeTypes. - DOMPlugins are created and stored in the DOMPluginArray (fixing the initial lack of caching issue) - DOMMimeTypes are created and stored in the DOMMimeTypeArray. - DOMPlugins hold a strong reference to their associated DOMMimeType. The DOMMimeType has a weak reference back to the DOMPlugin. This means for a single executation context, we only ever create one DOMPlugin / DOMMimeType for each underlying plugin / mimetype. - Update GC so that DOMPlugin and DOMMimeType (in addition to DOMPluginArray and DOMMimeTypeArray which were already doing this) use navigator reachability for their lifetime. This is almost correct, except if we ever implement DOMPluginArray.refresh(false) to match the spec, in which case you could end up with some DOMPlugins and DOMMimeTypes that are marked as reachable when they really are not, but only plugins that were removed. This seems so unlikely to matter that implementing a more strict reachability function seems like the wrong way to go. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: Add NavigatorPlugins.idl * loader/SubframeLoader.cpp: (WebCore::findPluginMIMETypeFromURL): (WebCore::logPluginRequest): Simplify and cleanup code making use of the new webVisibleMimeTypes() rather than the clunky getWebVisibleMimesAndPluginIndices(). * page/Navigator.cpp: * page/Navigator.h: (WebCore::Navigator::initializePluginAndMIMETypeArrays): (WebCore::Navigator::plugins): (WebCore::Navigator::mimeTypes): Fully initialize Navigator.plugins/mimeTypes on first access of either, following the specified behavior that they should not change after initial access for a script execution context. This also ensures we always return the same wrappers for these objects on multiple accesses, something the spec mandates but we failed to do prior. In addition, we now correctly sort the plugins by name and mimeTypes by type, also as specified. * page/Navigator.idl: * page/NavigatorPlugins.idl: Added. Split NavigatorPlugins out of Navigator.idl as specified. No functional change but makes things nicer when we match the spec closer. * plugins/DOMMimeType.cpp: (WebCore::DOMMimeType::DOMMimeType): (WebCore::DOMMimeType::suffixes const): (WebCore::DOMMimeType::enabledPlugin const): * plugins/DOMMimeType.h: (WebCore::DOMMimeType::create): (WebCore::DOMMimeType::navigator): * plugins/DOMMimeType.idl: * plugins/DOMMimeTypeArray.cpp: (WebCore::DOMMimeTypeArray::DOMMimeTypeArray): (WebCore::DOMMimeTypeArray::length const): (WebCore::DOMMimeTypeArray::item): (WebCore::DOMMimeTypeArray::namedItem): (WebCore::DOMMimeTypeArray::supportedPropertyNames): (WebCore::DOMMimeTypeArray::getPluginData const): Deleted. * plugins/DOMMimeTypeArray.h: * plugins/DOMPlugin.cpp: (WebCore::DOMPlugin::DOMPlugin): (WebCore::DOMPlugin::item): (WebCore::DOMPlugin::namedItem): (WebCore::DOMPlugin::supportedPropertyNames): * plugins/DOMPlugin.h: * plugins/DOMPlugin.idl: * plugins/DOMPluginArray.cpp: (WebCore::DOMPluginArray::DOMPluginArray): (WebCore::DOMPluginArray::length const): (WebCore::DOMPluginArray::item): (WebCore::DOMPluginArray::namedItem): (WebCore::DOMPluginArray::supportedPropertyNames): (WebCore::DOMPluginArray::pluginData const): Deleted. * plugins/DOMPluginArray.h: Rather than dynamically accessing plugin information through Page on each interaction with the DOM plugin objects, we now fully initialize them on creation, allowing for correct wrapper caching and behavior if plugins are added / removed (e.g. the arrays should not change). * plugins/PluginData.cpp: (WebCore::PluginData::initPlugins): (WebCore::PluginData::publiclyVisiblePluginsAndAdditionalWebVisiblePlugins const): (WebCore::PluginData::webVisibleMimeTypes const): (WebCore::supportsMimeTypeForPlugins): (WebCore::PluginData::supportsMimeType const): (WebCore::PluginData::supportsWebVisibleMimeType const): (WebCore::PluginData::supportsWebVisibleMimeTypeForURL const): (WebCore::PluginData::pluginFileForWebVisibleMimeType const): (WebCore::PluginData::publiclyVisiblePlugins const): Deleted. (WebCore::PluginData::getWebVisibleMimesAndPluginIndices const): Deleted. (WebCore::PluginData::getMimesAndPluginIndices const): Deleted. (WebCore::PluginData::getMimesAndPluginIndiciesForPlugins const): Deleted. (WebCore::PluginData::getPluginInfoForWebVisibleMimeType const): Deleted. * plugins/PluginData.h: Simplify interface by removing out parameter based getWebVisibleMimesAndPluginIndices (and helpers) and adding more straigtword alternatives. getWebVisibleMimesAndPluginIndices was useful for the old DOM plugin model, but now that the arrays are initialized all together, it no longer provides an optimization. Instead, all callers really just want a either a list of MimeClassInfos or to know if one is supported under a specific scenario, so we now just expose that. 2020-06-14 Sam Weinig <weinig@apple.com> [WPT] websockets/Close-reason-unpaired-surrogates.any.html fails due to failure to convert unpaired surrogates to replacement character for close reason https://bugs.webkit.org/show_bug.cgi?id=213182 Reviewed by Darin Adler. Now passing the following tests: imported/w3c/web-platform-tests/websockets/Close-reason-unpaired-surrogates.any.html imported/w3c/web-platform-tests/websockets/Close-reason-unpaired-surrogates.any.worker.html imported/w3c/web-platform-tests/websockets/Secure-Close-Reason-Unpaired-surrogates.any.html imported/w3c/web-platform-tests/websockets/Secure-Close-Reason-Unpaired-surrogates.any.worker.html * Modules/websockets/WebSocket.idl: Match spec (https://html.spec.whatwg.org/multipage/web-sockets.html#the-websocket-interface) by making the reason argument in close() a USVString rather than a DOMString. This causes all unpaired surrogates to be replaced with \uFFFD, the replacement character. 2020-06-14 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Withdraw FileReaderSync from ServiceWorker https://bugs.webkit.org/show_bug.cgi?id=213136 Reviewed by Darin Adler. `FileReaderSync` is not exposed for ServiceWorker. - https://w3c.github.io/FileAPI/#FileReaderSync - https://github.com/w3c/FileAPI/issues/16 We does not support SharedWorker. We don't have to care about it. * fileapi/FileReaderSync.idl: 2020-06-13 Rob Buis <rbuis@igalia.com> https://bugs.webkit.org/show_bug.cgi?id=213166 Rename executeIfJavaScriptURL to executeJavaScriptURL Reviewed by Darin Adler. Rename executeIfJavaScriptURL to executeJavaScriptURL in order to make the function unconditional, i.e. the passed url is expected to have the javascript protocol, this is asserted first thing in the method. This allows us to remove the return parameter since the remaining return statements all return true. * bindings/js/ScriptController.cpp: (WebCore::ScriptController::executeJavaScriptURL): (WebCore::ScriptController::executeIfJavaScriptURL): Deleted. * bindings/js/ScriptController.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::changeLocation): (WebCore::FrameLoader::submitForm): * loader/SubframeLoader.cpp: (WebCore::FrameLoader::SubframeLoader::requestFrame): 2020-06-13 Zalan Bujtas <zalan@apple.com> [LFC][Floats] Floating positioned box is always a float avoider. https://bugs.webkit.org/show_bug.cgi?id=213162 Reviewed by Darin Adler. Test: fast/layoutformattingcontext/inline-float-simple.html * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::isFloatAvoider const): also fix the independent formatting context case. 2020-06-13 Sam Weinig <weinig@apple.com> [WPT] dom/nodes/Document-createCDATASection-xhtml.xhtml fails due to missing exception in Document.createCDATASection() https://bugs.webkit.org/show_bug.cgi?id=213167 Reviewed by Yusuke Suzuki. Tested by existing (formerly failing) test: imported/w3c/web-platform-tests/dom/nodes/Document-createCDATASection-xhtml.xhtml Throw an "InvalidCharacterError" DOMException if the data passed to createCDATASection contains the string "]]>" as specified by https://dom.spec.whatwg.org/#dom-document-createcdatasection * dom/Document.cpp: (WebCore::Document::createCDATASection): 2020-06-13 Michael Catanzaro <mcatanzaro@gnome.org> Obsolete comment in FontCustomPlatformDataFreeType.cpp https://bugs.webkit.org/show_bug.cgi?id=213169 Unreviewed, remove the stale comment. * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: (WebCore::defaultFontconfigOptions): 2020-06-13 Sam Weinig <weinig@apple.com> Extended Color: Experiment with strongly typed ColorComponents https://bugs.webkit.org/show_bug.cgi?id=212396 Reviewed by Darin Adler. Adds simple explicit types for sRGBA, LinearSRGBA, DisplayP3, LinearDisplayP3, XYZA and HSLA colors. Conversion to/from ColorComponents<float> is easy but explicit to make conversions easier to spot. The goal is to add type clarity (you know when you are dealing with an sRGB color vs. a DisplayP3 color) and make dealing with the colors nicer (color.red rather than color[0]). It also allows us to simplify the naming of functions that convert between color types as now only the output type needs to be in the function name. * Headers.cmake: Add new header, ColorTypes.h * WebCore.xcodeproj/project.pbxproj: Add new header, ColorTypes.h * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseHSLParameters): Switch from hslToSRGB({ ... }) to toSRGBA(HSLAColor { ... }) * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): Update to use toHSLA() and HSLA<float> making the code a bit more readable. * platform/graphics/Color.cpp: (WebCore::Color::lightened const): (WebCore::Color::darkened const): (WebCore::Color::isDark const): (WebCore::Color::lightness const): (WebCore::Color::luminance const): (WebCore::Color::colorSpaceAndComponents const): (WebCore::Color::toSRGBASimpleColorLossy const): (WebCore::Color::toSRGBALossy const): (WebCore::Color::toSRGBAComponentsLossy const): Deleted. * platform/graphics/Color.h: Renames toSRGBAComponentsLossy() to toSRGBALossy() which now returns a SRGBA<float>. * platform/graphics/ColorMatrix.h: (WebCore::ColorMatrix::transformColorComponents const): Deleted. Remove transformColorComponents, keeping just transformedColorComponents to simplify the interface. With late conversion to ColorComponents, the latter is more straightforward to use in most cases anyway. * platform/graphics/ColorUtilities.cpp: (WebCore::linearToRGBColorComponent): (WebCore::rgbToLinearColorComponent): (WebCore::toLinearSRGBA): (WebCore::toSRGBA): (WebCore::toLinearDisplayP3): (WebCore::toDisplayP3): (WebCore::toXYZ): (WebCore::lightness): (WebCore::luminance): (WebCore::contrastRatio): (WebCore::toHSLA): (WebCore::premultiplied): (WebCore::rgbToLinearComponents): Deleted. (WebCore::linearToRGBComponents): Deleted. (WebCore::xyzToLinearSRGB): Deleted. (WebCore::linearSRGBToXYZ): Deleted. (WebCore::XYZToLinearP3): Deleted. (WebCore::linearP3ToXYZ): Deleted. (WebCore::p3ToSRGB): Deleted. (WebCore::sRGBToP3): Deleted. (WebCore::sRGBToHSL): Deleted. (WebCore::hslToSRGB): Deleted. * platform/graphics/ColorUtilities.h: Rename / rework conversion and utility functions to operate on explicit Color types. In doing so, simplify the names of the conversion functions so only name the output type. For instance: ColorComponents<float> p3ToSRGB(const ColorComponents<float>&); is now SRGBA<float> toSRGBA(const DisplayP3<float>&); as the input type is implicit in the call. A little duplication was needed for linearToRGBColorComponent/rgbToLinearColorComponent (as it was used for both sRGB and DisplayP3 linearization), but mostly things stay the same. * platform/graphics/ExtendedColor.cpp: (WebCore::ExtendedColor::toSRGBALossy const): (WebCore::ExtendedColor::toSRGBAComponentsLossy const): Deleted. * platform/graphics/ExtendedColor.h: Renamed toSRGBAComponentsLossy() to toSRGBALossy() and have it return a SRGBA<float>. * platform/graphics/SimpleColor.h: (WebCore::SimpleColor::asSRGBA const): (WebCore::makeSimpleColor): (WebCore::SimpleColor::asSRGBFloatComponents const): Deleted. Rename asSRGBFloatComponents() to asSRGBA<T>() and have it return a SRGBA<float>. Replace makeSimpleColor taking FloatComponents with one taking a SRGBA<float>, making it much clearer that this is only valid for sRGB. * platform/graphics/filters/FELighting.cpp: (WebCore::FELighting::drawLighting): Rework to support seperate types for SRGB<float> and LinearSRGBA<float>. * platform/graphics/filters/FELighting.cpp: (WebCore::FELighting::drawLighting): * platform/graphics/filters/FilterOperation.cpp: (WebCore::BasicColorMatrixFilterOperation::transformColor const): (WebCore::BasicComponentTransferFilterOperation::transformColor const): (WebCore::InvertLightnessFilterOperation::transformColor const): (WebCore::InvertLightnessFilterOperation::inverseTransformColor const): * platform/graphics/filters/FilterOperation.h: (WebCore::FilterOperation::transformColor const): (WebCore::FilterOperation::inverseTransformColor const): * platform/graphics/filters/FilterOperations.cpp: (WebCore::FilterOperations::transformColor const): (WebCore::FilterOperations::inverseTransformColor const): Use SRGBA<float> rather than ColorComponents<float> to make it clear that the filters only work on sRGB colors right now. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::disabledTextColor const): * rendering/TextPaintStyle.cpp: (WebCore::textColorIsLegibleAgainstBackgroundColor): * platform/graphics/cairo/CairoUtilities.cpp: (WebCore::setSourceRGBAFromColor): * platform/graphics/cairo/GradientCairo.cpp: (WebCore::addColorStopRGBA): (WebCore::setCornerColorRGBA): (WebCore::interpolateColorStop): * platform/graphics/gtk/ColorGtk.cpp: (WebCore::Color::operator GdkRGBA const): * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::drawBorder): (WebCore::TextureMapperGL::drawNumber): (WebCore::prepareFilterProgram): (WebCore::TextureMapperGL::drawSolidColor): (WebCore::TextureMapperGL::clearColor): * platform/graphics/win/ColorDirect2D.cpp: (WebCore::Color::operator D2D1_COLOR_F const): (WebCore::Color::operator D2D1_VECTOR_4F const): * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::generateGradient): * platform/graphics/win/GraphicsContextDirect2D.cpp: (WebCore::GraphicsContext::colorWithGlobalAlpha const): Update to call toSRGBALossy() rather than toSRGBAComponentsLossy(). 2020-06-13 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Remove FileError.h https://bugs.webkit.org/show_bug.cgi?id=213119 Reviewed by Chris Dumez. * Headers.cmake: * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp: (WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::didFail): * Modules/async-clipboard/ClipboardItemBindingsDataSource.h: * Modules/mediastream/RTCDataChannel.cpp: (WebCore::RTCDataChannel::createMessageQueue): * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::didFail): (WebCore::WebSocketChannel::abortOutgoingFrameQueue): * Modules/websockets/WebSocketChannel.h: * WebCore.xcodeproj/project.pbxproj: * fileapi/BlobLoader.h: (WebCore::BlobLoader::didFail): * fileapi/FileError.h: Removed. * fileapi/FileReader.cpp: (WebCore::FileReader::didFail): * fileapi/FileReader.h: * fileapi/FileReaderLoader.cpp: (WebCore::FileReaderLoader::start): (WebCore::FileReaderLoader::cancel): (WebCore::FileReaderLoader::cleanup): (WebCore::FileReaderLoader::didReceiveResponse): (WebCore::FileReaderLoader::didReceiveData): (WebCore::FileReaderLoader::didFail): (WebCore::FileReaderLoader::failed): (WebCore::FileReaderLoader::toErrorCode): (WebCore::FileReaderLoader::httpStatusCodeToErrorCode): (WebCore::FileReaderLoader::arrayBufferResult const): (WebCore::FileReaderLoader::stringResult): * fileapi/FileReaderLoader.h: (WebCore::FileReaderLoader::errorCode const): * fileapi/FileReaderLoaderClient.h: * fileapi/FileReaderSync.cpp: (WebCore::FileReaderSync::startLoading): * fileapi/FileReaderSync.h: * fileapi/NetworkSendQueue.cpp: (WebCore::NetworkSendQueue::processMessages): * fileapi/NetworkSendQueue.h: * html/ImageBitmap.cpp: 2020-06-12 Simon Fraser <simon.fraser@apple.com> REGRESSION(r261985): Unable to respond to large comments on Bugzilla with always-on scrollbars https://bugs.webkit.org/show_bug.cgi?id=213135 <rdar://problem/64302086> Reviewed by Tim Horton. The combination of programmatic scrolls (e.g. anchor click, reveal selection) and user scrolling could result in a mismatch between the main thread and scrolling thread scroll positions, resulting in missing tiles and offset cursor handling. This happened if a programmatic scroll occurred and 'scrolledSinceLastCommit' was true for the equivalent scrolling node at the start of a rendering update. synchronizeStateFromScrollingTree() would take the scrolling thread's notion of the scroll position, clobbering the position resulting from the programmatic scroll. To fix this, call commitTreeStateIfNeeded() before synchronizeStateFromScrollingTree() to ensure that any programmatic scrolls have been pushed to the scrolling tree before we fetch its state. Some infrastructure is needed for testing; getting into the state where a programmatic scroll and 'scrolledSinceLastCommit' happened in the same event loop cycle required adding internals.scrollBySimulatingWheelEvent(), which just pokes the scrolling tree directly without the complexities of wheel events dispatched via the UI process. Test: scrollingcoordinator/mac/reveal-selection-tile-coverage.html * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::scrollBySimulatingWheelEventForTesting): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::scrollBySimulatingWheelEventForTesting): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::scrollBySimulatingWheelEventForTesting): * page/scrolling/ScrollingTree.h: * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::willStartRenderingUpdate): * testing/Internals.cpp: (WebCore::Internals::scrollBySimulatingWheelEvent): * testing/Internals.h: * testing/Internals.idl: 2020-06-12 David Kilzer <ddkilzer@apple.com> [IPC hardening] Check enum values in IPC::Decoder::decodeEnum() an IPC::Encoder::encodeEnum() <https://webkit.org/b/211988> <rdar://problem/63137695> Reviewed by Darin Adler. Replace decodeEnum() with decode() and encodeEnum() with operator<<(). * Modules/applicationmanifest/ApplicationManifest.h: (WebCore::ApplicationManifest::decode): * Modules/indexeddb/IDBKeyData.h: (WebCore::IDBKeyData::encode const): (WebCore::IDBKeyData::decode): * Modules/indexeddb/shared/IDBCursorInfo.h: (WebCore::IDBCursorInfo::encode const): (WebCore::IDBCursorInfo::decode): * Modules/indexeddb/shared/IDBError.h: (WebCore::IDBError::encode const): (WebCore::IDBError::decode): * Modules/indexeddb/shared/IDBGetAllRecordsData.h: (WebCore::IDBGetAllRecordsData::encode const): (WebCore::IDBGetAllRecordsData::decode): * Modules/indexeddb/shared/IDBGetRecordData.h: (WebCore::IDBGetRecordData::encode const): (WebCore::IDBGetRecordData::decode): * Modules/indexeddb/shared/IDBIterateCursorData.h: (WebCore::IDBIterateCursorData::encode const): (WebCore::IDBIterateCursorData::decode): * Modules/indexeddb/shared/IDBRequestData.h: (WebCore::IDBRequestData::encode const): (WebCore::IDBRequestData::decode): * Modules/indexeddb/shared/IDBResultData.h: (WebCore::IDBResultData::encode const): (WebCore::IDBResultData::decode): * Modules/indexeddb/shared/IDBTransactionInfo.h: (WebCore::IDBTransactionInfo::encode const): (WebCore::IDBTransactionInfo::decode): * Modules/webauthn/PublicKeyCredentialCreationOptions.h: (WebCore::PublicKeyCredentialCreationOptions::Parameters::decode): (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode): * Modules/webauthn/PublicKeyCredentialDescriptor.h: (WebCore::PublicKeyCredentialDescriptor::decode): * dom/ExceptionData.h: (WebCore::ExceptionData::encode const): (WebCore::ExceptionData::decode): * html/DataListSuggestionInformation.h: (WebCore::DataListSuggestionInformation::encode const): (WebCore::DataListSuggestionInformation::decode): * page/SecurityOrigin.h: (WebCore::SecurityOrigin::encode const): (WebCore::SecurityOrigin::decode): * platform/ContextMenuItem.h: (WTF::EnumTraits<WebCore::ContextMenuAction>): - Add missing ContextMenuItemTagPasteAsPlainText that was added in r261800. * platform/LinkIcon.h: (WebCore::LinkIcon::encode const): (WebCore::LinkIcon::decode): * platform/PasteboardItemInfo.h: (WebCore::PasteboardItemInfo::encode const): (WebCore::PasteboardItemInfo::decode): * platform/ScreenProperties.h: (WebCore::ScreenData::encode const): (WebCore::ScreenData::decode): * platform/graphics/InbandGenericCue.h: (WebCore::GenericCueData::encode const): * platform/graphics/Path.h: (WebCore::Path::encode const): (WebCore::Path::decode): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::SetState::encode const): (WebCore::DisplayList::SetState::decode): (WebCore::DisplayList::DrawTiledScaledImage::encode const): (WebCore::DisplayList::DrawTiledScaledImage::decode): * platform/mediastream/CaptureDevice.h: (WebCore::CaptureDevice::encode const): * platform/mediastream/MediaConstraints.h: (WebCore::MediaConstraint::encode const): (WebCore::MediaConstraint::decode): * platform/mediastream/MediaStreamRequest.h: (WebCore::MediaStreamRequest::encode const): (WebCore::MediaStreamRequest::decode): * platform/mediastream/RealtimeMediaSourceCapabilities.h: (WebCore::CapabilityValueOrRange::encode const): (WebCore::CapabilityValueOrRange::decode): (WebCore::RealtimeMediaSourceCapabilities::encode const): (WebCore::RealtimeMediaSourceCapabilities::decode): * platform/mediastream/RealtimeMediaSourceSettings.h: (WebCore::RealtimeMediaSourceSettings::encode const): (WebCore::RealtimeMediaSourceSettings::decode): * platform/mock/MockMediaDevice.h: (WebCore::MockDisplayProperties::encode const): * platform/network/HTTPHeaderMap.h: (WebCore::HTTPHeaderMap::CommonHeader::encode const): (WebCore::HTTPHeaderMap::CommonHeader::decode): * testing/MockWebAuthenticationConfiguration.h: (WebCore::MockWebAuthenticationConfiguration::HidConfiguration::decode): (WebCore::MockWebAuthenticationConfiguration::NfcConfiguration::decode): * workers/service/ServiceWorkerContextData.h: (WebCore::ServiceWorkerContextData::decode): * workers/service/ServiceWorkerJobData.h: (WebCore::ServiceWorkerJobData::encode const): (WebCore::ServiceWorkerJobData::decode): 2020-06-12 Chris Dumez <cdumez@apple.com> Stop allowing pages served over HTTPS with "Cache-Control: no-store" into the back/forward cache https://bugs.webkit.org/show_bug.cgi?id=213147 <rdar://problem/64249683> Reviewed by Geoffrey Garen. Stop allowing pages served over HTTPS with "Cache-Control: no-store" into the back/forward cache. This is a revert of r250437 due to push back from Web developers. No new tests, updated existing tests. * history/BackForwardCache.cpp: (WebCore::canCacheFrame): 2020-06-12 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Stop to use ActiveDOMObject::setPendingActivity() for Modules/fetch https://bugs.webkit.org/show_bug.cgi?id=213037 Reviewed by Youenn Fablet. By ActiveDOMObject's comments, these methods should be replaced with using makePendingActivity(). `JSFetchRequest`/`JSFetchResponse` (as derived class of `JSDOMWrapper`) hold `FetchRequest`/`FetchResponse`, and they have `FetchBodyOwner` as a base class and keep alive it. We can replace `setPendingActivity()` calling from `FetchBodyOwner`. * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::loadBlob): (WebCore::FetchBodyOwner::finishBlobLoading): (WebCore::FetchBodyOwner::virtualHasPendingActivity const): * Modules/fetch/FetchBodyOwner.h: * Modules/fetch/FetchBodySource.cpp: (WebCore::FetchBodySource::setActive): (WebCore::FetchBodySource::setInactive): * Modules/fetch/FetchBodySource.h: 2020-06-12 Takashi Komori <Takashi.Komori@sony.com> [Curl] Implement functions to use ResourceLoadStatistics. https://bugs.webkit.org/show_bug.cgi?id=207692 Reviewed by Don Olmstead. Implement functions which are required to implement ResourceLoadStatistics for Curl port. Tests: http/tests/resourceLoadStatistics/ * CMakeLists.txt: * platform/network/curl/CookieJarDB.cpp: (WebCore::CookieJarDB::openDatabase): (WebCore::CookieJarDB::setCookie): (WebCore::CookieJarDB::allDomains): (WebCore::CookieJarDB::deleteCookiesForHostname): * platform/network/curl/CookieJarDB.h: * platform/network/curl/NetworkStorageSessionCurl.cpp: (WebCore::NetworkStorageSession::setCookiesFromDOM const): (WebCore::NetworkStorageSession::setCookies): (WebCore::NetworkStorageSession::deleteCookiesForHostnames): (WebCore::NetworkStorageSession::getHostnamesWithCookies): 2020-06-12 Andres Gonzalez <andresg_22@apple.com> In isolated tree mode 2, AXIsolatedObject::setChildrenIDs should be called only on secondary thread. https://bugs.webkit.org/show_bug.cgi?id=213124 Reviewed by Chris Fleizach. Covered by existing tests. - AXIsolatedTree::createSubtree was calling AXIsolatedObject::setChildrenIDs which should be called only on the secondary thread. Now it is queueing the children update under lock. - The unsigned int range for object IDs was being overrun for large number of objects like in the case of the sample page in <rdar://problem/59331146>. Increased the size of AXID to size_t. - Better handle the case of invalid object IDs, although this needs more work, since we should never encounter this case. * accessibility/AccessibilityObjectInterface.h: AXID are now size_t instead of unsigned ints. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::AXIsolatedObject): (WebCore::AXIsolatedObject::setChildrenIDs): Inlined in header. * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::createSubtree): 2020-06-12 Andy Estes <aestes@apple.com> FileInputType should use WeakPtr for FileListCreator lambdas https://bugs.webkit.org/show_bug.cgi?id=213130 <rdar://problem/64276591> Reviewed by David Kilzer. FileInputType::filesChosen was passing a completion handler to FileListCreator::create that captured |this|. If the FileListCreator instance still existed when |this| was destroyed, FileInputType::~FileInputType would clear the captured |this| by calling FileListCreator::clear. This can be simplified by having the FileListCreator completion handler capture a WeakPtr to |this|. Also, when FileInputType::allowsDirectories is false, m_fileListCreator would not be properly cleared after creating the file list. The FileListCreator completion handler would set m_fileListCreator to nullptr, but would be executed *before* FileListCreator::create returned and set m_fileListCreator to the newly-created FileListCreator object. Fixed this by having FileListCreator::create execute the completion handler immediately and return nullptr in cases where a FileListCreator does not need to be created for directory resolution. Covered by existing tests. * html/FileInputType.cpp: (WebCore::FileInputType::~FileInputType): (WebCore::FileInputType::filesChosen): * html/FileInputType.h: * html/FileListCreator.cpp: (WebCore::createFileList): (WebCore::FileListCreator::create): (WebCore::FileListCreator::FileListCreator): (WebCore::FileListCreator::createFileList): * html/FileListCreator.h: (WebCore::FileListCreator::create): Deleted. 2020-06-12 Antti Koivisto <antti@apple.com> REGRESSION (r262618): Very slow typing in a github issue https://bugs.webkit.org/show_bug.cgi?id=213137 <rdar://problem/64214117> Reviewed by Darin Adler. Test: fast/media/media-query-keyframes-resolution-count.html If a stylesheet had multiple media queries and one of them forced static resolution (by containing @keyframes rule for example) we would end up reseting the style multiple times and forcing unneeded style resolutions. * style/RuleSet.cpp: (WebCore::Style::RuleSet::evaluteDynamicMediaQueryRules): We can't bail out from the loop. Even though the result is known we still need to loop to save the evaluation result for all media queries. 2020-06-12 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> FileReader.error should be DOMException now https://bugs.webkit.org/show_bug.cgi?id=213117 Reviewed by Chris Dumez. By the [lastest spec](https://w3c.github.io/FileAPI/), `FileReader.error` should return `DOMException` and this remove obsoleted `FileError` from exposed interfaces. Internally, our codebase still depends on `fileapi/FileError.h` in everywhere. I'll plan to create a patch to refactor them. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.order: * WebCore.xcodeproj/project.pbxproj: * fileapi/FileError.idl: Removed. * fileapi/FileReader.cpp: (WebCore::FileReader::abort): (WebCore::FileReader::didFail): * fileapi/FileReader.h: * fileapi/FileReader.idl: * fileapi/FileReaderSync.cpp: (WebCore::FileReaderSync::errorCodeToException): * fileapi/FileReaderSync.h: 2020-06-12 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add support for min/max-width https://bugs.webkit.org/show_bug.cgi?id=213111 Reviewed by Antti Koivisto. Apply min/max-width to constrain the available width for the table content. Test: fast/layoutformattingcontext/table-min-max-width-simple.html * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): (WebCore::Layout::BlockFormattingContext::computedWidthAndMargin): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): 2020-06-12 Antti Koivisto <antti@apple.com> Relative font size values (em) within CSS animations compound https://bugs.webkit.org/show_bug.cgi?id=194749 <rdar://problem/48171898> Reviewed by Antoine Quint. The em unit should be relative to the font size of the parent style when resolving 'font-size' property. We weren't passing the parent style when resolving keyframes. Test case by Scott Kellum. Test: animations/keyframe-em-unit.html * style/StyleResolver.cpp: (WebCore::Style::Resolver::styleForKeyframe): * style/StyleResolver.h: (WebCore::Style::Resolver::overrideDocumentElementStyle const): (WebCore::Style::Resolver::setOverrideDocumentElementStyle): (WebCore::Style::Resolver::setParentElementStyleForKeyframes): Add a way to pass the parent element style directly to the style resolver. This should really be passed via the animation system like other context but that requires lots of refactoring. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): Pass it. 2020-06-11 Sam Weinig <weinig@apple.com> Document.currentScript does not work for SVGScriptElements https://bugs.webkit.org/show_bug.cgi?id=213104 Reviewed by Yusuke Suzuki. Updates results for existing tests. * WebCore.xcodeproj/project.pbxproj: Add CurrentScriptIncrementer.h to the Xcode project as it was missing. * dom/CurrentScriptIncrementer.h: (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer): (WebCore::CurrentScriptIncrementer::~CurrentScriptIncrementer): Re-work using ScriptElement, removing the HTMLScriptElement checks. Also changes scriptType check to explicitly check that against classic scripts, as they are the only supported type, and if any types other than modules are added in the future, we would not want this to change behavior. * dom/Document.cpp: (WebCore::Document::pushCurrentScript): * dom/Document.h: (WebCore::Document::currentScript const): Use an Element, rather than an HTMLScriptElement for currentScript/currentScriptStack so that either an HTMLScriptElement or an SVGScriptElement can be stored. Using a ScriptElement would be possible, but would complicate the implementation unnecessarily by requiring currentScript to have an additional checks before extracting the Element. Variant<RefPtr<HTMLScriptElement>, RefPtr<SVGScriptElement>> could also have been used but also would unnecessarily complicated the interface and caused more memory to be used. * dom/Document.idl: Update interface to use Element rather HTMLScriptElement with a comment explaining why we are not using HTMLOrSVGScriptElement but retaining the same observable behavior. * dom/ScriptElement.cpp: (WebCore::ScriptElement::executeClassicScript): (WebCore::ScriptElement::executeModuleScript): Pass *this directly to CurrentScriptIncrementer to simplify implementation. 2020-06-12 Carlos Garcia Campos <cgarcia@igalia.com> [GTK4] Make WebDriver work https://bugs.webkit.org/show_bug.cgi?id=212316 Reviewed by Adrian Perez de Castro. Add helper gtk definitions to avoid ifdefs and implement currentScreenMonitor() for GTK4. * platform/gtk/GtkVersioning.h: (gtk_window_move): (gtk_window_minimize): (gtk_window_unminimize): * platform/gtk/PlatformScreenGtk.cpp: (WebCore::currentScreenMonitor): (WebCore::screenRect): (WebCore::screenAvailableRect): (WebCore::getCurrentScreenMonitor): Deleted. 2020-06-11 David Kilzer <ddkilzer@apple.com> [IPC] Add WTF::EnumTraits<> for every enum type used in IPC <https://webkit.org/b/213093> Reviewed by Darin Adler. Summary: - Change underlying type of enum class to `bool` when there are only two values. In some cases, reorder the two values so the mapping to 0 and 1 makes more sense. Converting every enum to an enum class is not a goal of this patch, so some two-value enums stil have WTF::EnumTraits<> defined as noted below. - Add WTF::EnumTraits<> for the remaining enum types that are used by IPC::Encoder::encodeEnum() and IPC::Decoder::decodeEnum() so that WTF::isValidEnum<>() checks may be added next. - Add #include <WebCore/LibWebRTCEnumTraits.h> as needed. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: - Add LibWebRTCEnumTraits.h to project. Keep these definitions separate from the libwebrtc project cut down on changes to re-merge after updating. * platform/mediastream/libwebrtc/LibWebRTCEnumTraits.h: Add. * Modules/applepay/ApplePaySessionPaymentRequest.h: * Modules/indexeddb/IDBTransactionMode.h: * Modules/indexeddb/IndexedDB.h: (WTF::EnumTraits<WebCore::IndexedDB::IndexRecordType>): - Remove after changing enum class to bool. * Modules/indexeddb/shared/IDBGetRecordData.h: * Modules/indexeddb/shared/IDBResultData.h: * WebCore.xcodeproj/project.pbxproj: * dom/ExceptionCode.h: * editing/CompositionUnderline.h: * html/Autofill.h: * html/DataListSuggestionInformation.h: * html/EnterKeyHint.h: * html/LinkIconType.h: * loader/FrameLoaderTypes.h: - Alphabetize WTF::EnumTraits<> definitions. * loader/ResourceLoaderOptions.h: * page/SecurityOrigin.h: * page/UserStyleSheetTypes.h: (WTF::EnumTraits<WebCore::UserStyleLevel>): - Define this since UserStyleLevel is not an enum class. * page/scrolling/ScrollingCoordinatorTypes.h: * platform/ContextMenuItem.h: * platform/Cursor.h: * platform/DragData.h: * platform/FileChooser.h: * platform/PopupMenuStyle.h: * platform/ScreenProperties.h: * platform/ScrollTypes.h: * platform/SerializedPlatformDataCueValue.h: (WebCore::SerializedPlatformDataCueValue::PlatformType): - Convert from enum to enum class. * platform/UserInterfaceLayoutDirection.h: * platform/animation/TimingFunction.h: * platform/graphics/GraphicsContext.h: * platform/graphics/GraphicsLayer.h: * platform/graphics/GraphicsTypes.h: - Alphabetize WTF::EnumTraits<> definitions. * platform/graphics/Image.h: * platform/graphics/Path.h: * platform/graphics/ca/PlatformCAAnimation.h: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/filters/FilterOperation.h: * platform/mediastream/MediaConstraints.h: * platform/mediastream/MediaStreamRequest.h: (WTF::EnumTraits<WebCore::MediaStreamRequest::Type>): - Fix EnumTraits definition (missing "::Type"). * platform/mediastream/RealtimeMediaSourceCapabilities.h: * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h: * platform/network/CredentialBase.h: * platform/network/ProtectionSpaceBase.h: * platform/network/ResourceErrorBase.h: * platform/network/soup/SoupNetworkProxySettings.h: * platform/text/TextChecking.h: (WTF::EnumTraits<WebCore::TextCheckingProcessType): - Define this since TextCheckingProcessType is not an enum class. * platform/text/WritingMode.h: * rendering/Pagination.h: * workers/service/ServiceWorkerJobType.h: 2020-06-11 Beth Dakin <bdakin@apple.com> Fix comment after blocklist transition https://bugs.webkit.org/show_bug.cgi?id=213100 Reviewed by Wenson Hsieh. * platform/mac/PasteboardMac.mm: (WebCore::cocoaTypeFromHTMLClipboardType): 2020-06-11 Rob Buis <rbuis@igalia.com> REGRESSION (r262776): Flaky crash under -[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:] https://bugs.webkit.org/show_bug.cgi?id=213059 Reviewed by Alex Christensen. My r262776 patch did not null check m_handle and it can cause crashes in some cases, so add the check. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]): 2020-06-11 Beth Dakin <bdakin@apple.com> Replace instances of whitelist in WebCore with allowlist https://bugs.webkit.org/show_bug.cgi?id=213068 Reviewed by Tim Horton. * Modules/webdatabase/DatabaseAuthorizer.cpp: (WebCore::DatabaseAuthorizer::DatabaseAuthorizer): (WebCore::DatabaseAuthorizer::addAllowedFunctions): (WebCore::DatabaseAuthorizer::allowFunction): (WebCore::DatabaseAuthorizer::addWhitelistedFunctions): Deleted. * Modules/webdatabase/DatabaseAuthorizer.h: * dom/ExtensionStyleSheets.cpp: (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const): * loader/CrossOriginAccessControl.cpp: (WebCore::isOnAccessControlSimpleRequestMethodAllowlist): (WebCore::isSimpleCrossOriginAccessRequest): (WebCore::isOnAccessControlSimpleRequestMethodWhitelist): Deleted. * loader/CrossOriginAccessControl.h: * loader/CrossOriginPreflightResultCache.cpp: (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod const): * loader/appcache/ApplicationCache.cpp: (WebCore::ApplicationCache::setOnlineAllowlist): (WebCore::ApplicationCache::isURLInOnlineAllowlist): (WebCore::ApplicationCache::setOnlineWhitelist): Deleted. (WebCore::ApplicationCache::isURLInOnlineWhitelist): Deleted. * loader/appcache/ApplicationCache.h: (WebCore::ApplicationCache::onlineAllowlist const): (WebCore::ApplicationCache::onlineWhitelist const): Deleted. * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): * loader/appcache/ApplicationCacheHost.cpp: (WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache): (WebCore::ApplicationCacheHost::getApplicationCacheFallbackResource): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL): (WebCore::ApplicationCacheStorage::openDatabase): (WebCore::ApplicationCacheStorage::store): (WebCore::ApplicationCacheStorage::loadCache): * loader/appcache/ManifestParser.cpp: (WebCore::parseManifest): * loader/appcache/ManifestParser.h: * page/Frame.cpp: (WebCore::Frame::injectUserScriptImmediately): * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::canRequest const): (WebCore::SecurityOrigin::canDisplay const): * page/SecurityPolicy.cpp: (WebCore::SecurityPolicy::isAccessAllowed): (WebCore::SecurityPolicy::addOriginAccessAllowlistEntry): (WebCore::SecurityPolicy::removeOriginAccessAllowlistEntry): (WebCore::SecurityPolicy::resetOriginAccessAllowlists): (WebCore::SecurityPolicy::isAccessWhiteListed): Deleted. (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry): Deleted. (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry): Deleted. (WebCore::SecurityPolicy::resetOriginAccessWhitelists): Deleted. * page/SecurityPolicy.h: * page/UserContentURLPattern.cpp: (WebCore::UserContentURLPattern::matchesPatterns): * page/UserContentURLPattern.h: * page/UserScript.h: (WebCore::UserScript::UserScript): (WebCore::UserScript::allowlist const): (WebCore::UserScript::encode const): (WebCore::UserScript::decode): (WebCore::UserScript::whitelist const): Deleted. * page/UserStyleSheet.h: (WebCore::UserStyleSheet::UserStyleSheet): (WebCore::UserStyleSheet::allowlist const): (WebCore::UserStyleSheet::whitelist const): Deleted. * platform/graphics/FontCache.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::fontAllowlist): (WebCore::FontCache::setFontAllowlist): (WebCore::platformFontLookupWithFamily): (WebCore::fontWhitelist): Deleted. (WebCore::FontCache::setFontWhitelist): Deleted. * platform/network/HTTPParsers.cpp: (WebCore::isValidAcceptHeaderValue): * rendering/FloatingObjects.h: * style/ElementRuleCollector.cpp: (WebCore::Style::ElementRuleCollector::transferMatchedRules): * style/ElementRuleCollector.h: * style/PropertyCascade.cpp: (WebCore::Style::PropertyCascade::addMatch): * style/RuleData.cpp: (WebCore::Style::determinePropertyAllowlistType): (WebCore::Style::RuleData::RuleData): (WebCore::Style::determinePropertyWhitelistType): Deleted. * style/RuleData.h: (WebCore::Style::RuleData::propertyAllowlistType const): (WebCore::Style::RuleData::propertyWhitelistType const): Deleted. 2020-06-11 Andy Estes <aestes@apple.com> [iOS] nullptr deref in FileInputType::iconLoaded when the input's type attribute is modified by a change event listener https://bugs.webkit.org/show_bug.cgi?id=208244 <rdar://problem/41855350> Reviewed by Wenson Hsieh. When an <input> element's type attribute changes, its existing InputType is detached from the HTMLInputElement by nulling InputType::m_element. When FileInputType::filesChosen is called, it dispatches the input and change events, which can run arbitrary JavaScript that might modify the element's type attribute. If this happens, FileInputType::m_element will be null after returning from FileInputType::setFiles and if there is an icon will be dereferenced by FileInputType::iconLoaded. Fixed this by checking for a non-null m_element before calling iconLoaded. While here, also fixed a bug where we sometimes checked the length of m_fileList before FileListCreator had finished setting m_fileList. This bug resulted in missing file icons whenever an <input type=file> had the webkitdirectory attribute. Tests: fast/forms/file/file-input-type-detached-on-change.html fast/forms/file/file-input-webkitdirectory-icon.html * html/FileInputType.cpp: (WebCore::FileInputType::filesChosen): 2020-06-11 Beth Dakin <bdakin@apple.com> Remove references to "slave" in WebCore https://bugs.webkit.org/show_bug.cgi?id=213085 Reviewed by Wenson Hsieh. This feature is referred to as a mediagroup in html, so let's use that terminology here as well. * html/MediaController.cpp: (WebCore::MediaController::buffered const): (WebCore::MediaController::seekable const): (WebCore::MediaController::played): (WebCore::MediaController::duration const): (WebCore::MediaController::setCurrentTime): (WebCore::MediaController::play): (WebCore::MediaController::updateReadyState): (WebCore::MediaController::updatePlaybackState): (WebCore::MediaController::isBlocked const): (WebCore::MediaController::hasEnded const): 2020-06-11 David Kilzer <ddkilzer@apple.com> [IPC] Adopt enum class for DragSourceAction <https://webkit.org/b/212885> <rdar://problem/64094134> Reviewed by Darin Adler. Summary: - Convert DragSourceAction to enum class. - Remove DragSourceActionNone by using Optional<> and OptionSet<> (as dictated by how the code used the value). - Remove DragSourceActionAny and replace (as needed) with anyDragSourceAction(). (Some--but not all--uses were removed.) - Add both WTF::EnumTraits<> and WTF::OptionSetTraits<> for DragSourceAction since both Optional<> and OptionSet<> are used with IPC. * loader/EmptyClients.cpp: * page/DragActions.h: (WebCore::DragSourceAction): - Convert to enum class. (WebCore::anyDragSourceAction): Add. - Replaces WebCore::DragSourceActionAny. (WTF::EnumTraits<WebCore::DragSourceAction>): Add. (WTF::OptionSetTraits<WebCore::DragSourceAction>): Add. * page/DragClient.h: * page/DragController.cpp: (WebCore::DragController::delegateDragSourceAction): (WebCore::DragController::draggableElement const): (WebCore::DragController::prepareForDragStart const): (WebCore::DragController::startDrag): (WebCore::DragController::doSystemDrag): - Use OptionSet<>::toSingleValue() and add ASSERT() that it does not return WTF::nullopt. * page/DragController.h: (WebCore::DragController::dragSourceAction const): * page/DragState.h: * page/EventHandler.cpp: (WebCore::EventHandler::updateDragSourceActionsAllowed const): (WebCore::EventHandler::dragHysteresisExceeded const): - Use OptionSet<>::toSingleValue() and add ASSERT() that it does not return WTF::nullopt. - Remove case statements for DragSourceActionNone and DragSourceActionAny, along with ASSERT_NOT_REACHED(). The ASSERT() for toSingleValue() replaces the DragSourceActionNone case. (WebCore::EventHandler::didStartDrag): (WebCore::ExactlyOneBitSet): Delete. - Move to WTF::OptionSet<>::hasExactlyOneBitSet(). (WebCore::EventHandler::handleDrag): - Add code to #ifndef NDEBUG/#endif instead of modifying dragState().type in-place since it seemed weird to modify it just to check an ASSERT(), even though it was overwritten immediately after that. * page/EventHandler.h: * platform/DragItem.h: (WebCore::DragItem::encode const): (WebCore::DragItem::decode): - Stop using decodeEnum()/encodeEnum() with Optional<DragSourceAction>. 2020-06-11 Youenn Fablet <youenn@apple.com> End a remote MediaStreamTrack if its source is ended https://bugs.webkit.org/show_bug.cgi?id=213074 Reviewed by Eric Carlson. Make remote audio/video source observers of their webrtc source. In case the webrtc source ends, end the source, thus its related tracks as well. This is covered by the above test. Test: webrtc/receiver-track-should-stay-live-even-if-receiver-is-inactive.html * platform/mediastream/RealtimeIncomingAudioSource.cpp: (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): (WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource): (WebCore::RealtimeIncomingAudioSource::startProducingData): (WebCore::RealtimeIncomingAudioSource::stopProducingData): (WebCore::RealtimeIncomingAudioSource::OnChanged): * platform/mediastream/RealtimeIncomingAudioSource.h: * platform/mediastream/RealtimeIncomingVideoSource.cpp: (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): (WebCore::RealtimeIncomingVideoSource::~RealtimeIncomingVideoSource): (WebCore::RealtimeIncomingVideoSource::startProducingData): (WebCore::RealtimeIncomingVideoSource::stopProducingData): (WebCore::RealtimeIncomingVideoSource::OnChanged): * platform/mediastream/RealtimeIncomingVideoSource.h: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::requestToEnd): (WebCore::RealtimeMediaSource::end): * platform/mediastream/RealtimeMediaSource.h: 2020-06-11 Rob Buis <rbuis@igalia.com> Improve url-setters.html WPT test https://bugs.webkit.org/show_bug.cgi?id=213046 Reviewed by Darin Adler. Improve url-setters.html WPT test by testing for failure that can occur when setting host or hostname [1]. [1] https://url.spec.whatwg.org/#host-state * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setHost): (WebCore::URLDecomposition::setHostname): 2020-06-11 ChangSeok Oh <changseok@webkit.org> [GTK] Implement button-press-event, button-release-event, and absolute-axis-event of GAMEPAD API. https://bugs.webkit.org/show_bug.cgi?id=133850 Reviewed by Carlos Garcia Campos. This is a follow-up change after r261965, implementing the rest of missing GAMEPAD API for the gtk port. Buttons and analog sticks of standard gamepads work with this change. No new tests since existing tests can cover this change. * html/OffscreenCanvas.h: * platform/gamepad/manette/ManetteGamepad.cpp: (WebCore::toStandardGamepadAxis): (WebCore::onAbsoluteAxisEvent): (WebCore::toStandardGamepadButton): (WebCore::onButtonPressEvent): (WebCore::onButtonReleaseEvent): (WebCore::ManetteGamepad::ManetteGamepad): (WebCore::ManetteGamepad::~ManetteGamepad): (WebCore::ManetteGamepad::buttonPressedOrReleased): (WebCore::ManetteGamepad::absoluteAxisChanged): * platform/gamepad/manette/ManetteGamepad.h: * platform/gamepad/manette/ManetteGamepadProvider.cpp: (WebCore::ManetteGamepadProvider::ManetteGamepadProvider): (WebCore::ManetteGamepadProvider::~ManetteGamepadProvider): (WebCore::ManetteGamepadProvider::gamepadHadInput): (WebCore::ManetteGamepadProvider::inputNotificationTimerFired): * platform/gamepad/manette/ManetteGamepadProvider.h: 2020-06-10 Sergio Villar Senin <svillar@igalia.com> [WebXR] Pass an unsigned long to cancelAnimationCallback() as handle https://bugs.webkit.org/show_bug.cgi?id=212529 Reviewed by Youenn Fablet. The type of the handle returned by XRSession::requestAnimationFrame() was recently changed to unsigned long from long as there was no point in using signed integers for that. However we forgot to update the cancelAnimationFrame() in the specs as well as it receives the handle returned by requestAnimationFrame(). We landed https://github.com/immersive-web/webxr/pull/1069 in the WebXR specs so we can now safely also replace signed by unsigned integers in our implementation. No new tests as there is no change in functionality. Reland r262718. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::cancelAnimationFrame): Use unsigned ids. * Modules/webxr/WebXRSession.h: Ditto. * Modules/webxr/WebXRSession.idl: Ditto. 2020-06-11 Antoine Quint <graouts@webkit.org> [Web Animations] Setting the style at the last style change event to null should not create an ElementAnimationRareData object https://bugs.webkit.org/show_bug.cgi?id=213070 <rdar://problem/63841893> Reviewed by Tim Horton. In r262154 we added code that records the pre-animation style for a given element in Style::TreeResolver::createAnimatedElementUpdate(), which is in Web Animations spec parlance the style at the last style change event. This style is set on the backing ElementAnimationRareData object for the given Element. For any element that did not actually have any animations, we would set this style to null, but the function on Element acting as a go-between would always create the backing ElementAnimationRareData even though it would set a null value. We now only creaste the ElementAnimationRareData object if there is a value to be stored, which fixes a performance regression in the Speedometer2 test. * dom/Element.cpp: (WebCore::Element::setLastStyleChangeEventStyle): 2020-06-10 Beth Dakin <bdakin@apple.com> Replace instances of blacklist in WebCore with blocklist https://bugs.webkit.org/show_bug.cgi?id=213064 Reviewed by Tim Horton. * dom/ExtensionStyleSheets.cpp: (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const): * page/Frame.cpp: (WebCore::Frame::injectUserScriptImmediately): * page/UserContentURLPattern.cpp: (WebCore::UserContentURLPattern::matchesPatterns): * page/UserContentURLPattern.h: * page/UserScript.h: (WebCore::UserScript::UserScript): (WebCore::UserScript::blocklist const): (WebCore::UserScript::encode const): (WebCore::UserScript::decode): (WebCore::UserScript::blacklist const): Deleted. * page/UserStyleSheet.h: (WebCore::UserStyleSheet::UserStyleSheet): (WebCore::UserStyleSheet::blocklist const): (WebCore::UserStyleSheet::blacklist const): Deleted. * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::checkGPUStatus): * platform/mac/PasteboardMac.mm: (WebCore::cocoaTypeFromHTMLClipboardType): * platform/text/TextEncodingRegistry.cpp: (WebCore::pruneBlocklistedCodecs): (WebCore::extendTextCodecMaps): (WebCore::pruneBlacklistedCodecs): Deleted. 2020-06-10 Frank Yang <guowei_yang@apple.com> Multiple SVG Filters Unexpectedly lightens image using linearRGB https://bugs.webkit.org/show_bug.cgi?id=212649 Reviewed by Myles C. Maxfield, Simon Fraser, Darin Adler Added color space conversion of input FilterEffect ImageBuffer and ImageData for filters that directly manipulates pixel values. The conversion is missing only on CG platforms because on CG platforms, FilterEffect::transformResultColorSpace doesn't perform any operations Its author assumed all filters are using CG ImageBuffers, and that CG will handle the conversion which is not the case. The following filters operates on the raw pixels inside an ImageBuffer, and this requires an explicit color space conversion of the pixel values when the ImageData are retrieved by calling FilterEffect::copy{Pre/Un}multipliedData(). The filters affected are feComponentTransfer, feComposite, feConvolveMatrix feGaussianBlur, FELighting, feMorphology. The conversion is done by CG, by drawing the input ImageBuffer to a new ImageBuffer that has the correct color space tag. The ImageData is then pulled from this new ImageBuffer and used in platformApplySoftware() Tests: svg/filters/feComponentTransfer-clipped-expected.svg svg/filters/feComponentTransfer-clipped.svg svg/filters/feComposite-clipped-expected.svg svg/filters/feComposite-clipped.svg svg/filters/feConvolveMatrix-clipped-expected.svg svg/filters/feConvolveMatrix-clipped.svg svg/filters/feGaussianBlur-clipped-expected.svg svg/filters/feGaussianBlur-clipped.svg svg/filters/feLighting-clipped-expected.svg svg/filters/feLighting-clipped.svg svg/filters/feMorphology-clipped-expected.svg svg/filters/feMorphology-clipped.svg * platform/graphics/filters/FEComponentTransfer.cpp: (WebCore::FEComponentTransfer::platformApplySoftware): Modified function call to FilterEffect::premultipliedResult, color space conversion is required on CG platforms, so operatingColorSpace is passed in and input will be converted to that color space * platform/graphics/filters/FEComposite.cpp: (WebCore::FEComposite::platformApplySoftware): Similarly, color space conversion Required on CG color space conversion is required on CG platforms, so operatingColorSpace is passed in and input will be converted to that color space * platform/graphics/filters/FEConvolveMatrix.cpp: (WebCore::FEConvolveMatrix::platformApplySoftware): converting to operating space * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::platformApplySoftware): converting to operating space * platform/graphics/filters/FELighting.cpp: (WebCore::FELighting::platformApplySoftware): converting to operating space * platform/graphics/filters/FEMorphology.cpp: (WebCore::FEMorphology::platformApplyDegenerate): converting to operating space (WebCore::FEMorphology::platformApplySoftware): converting to operating space * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::unmultipliedResult): modified function signature so that The Optional ColorSpace enum could be passed in to copyUnmultipliedResult() (WebCore::FilterEffect::premultipliedResult): modified function signature so that The Optional ColorSpace enum could be passed in to copyUnmultipliedResult() (WebCore::FilterEffect::convertImageDataToColorSpace): helper function that takes an ImageData ptr as input, put it into an ImageBuffer, and calls convertImageBufferToColorSpace to perform color conversion, and returns the converted ImageData (WebCore::FilterEffect::convertImageBufferToColorSpace): helper function that takes an ImageBuffer ptr as input, create a new ImageBuffer with target color space, write input ImageBuffer to this new buffer (CG backend handles the conversion) and returns the ImageData in the buffer. (WebCore::FilterEffect::copyConvertedImageBufferToDestination): helper function that copies data from ImageBuffer whose data is converted to the correct color space, to the destination array (WebCore::FilterEffect::copyConvertedImageDataToDestination): helper function that copies data from ImageData whose data is converted to the correct color space, to the destination array (WebCore::FilterEffect::copyUnmultipliedResult): added an optional argument, colorSpace, which will be passed into requiresAdditionalColorSpaceConversion, in order to determine if color space conversion is required when obtaining the unmultiplied result. Then, added code to convert color space before writing to the destination array (WebCore::FilterEffect::copyPremultipliedResult): added an optional argument, colorSpace, which will be passed into requiresAdditionalColorSpaceConversion, in order to determine if color space conversion is required when obtaining the premultiplied result. Then, added code to convert color space before writing to the destination array. (WebCore::FilterEffect::requiresImageDataColorSpaceConversion): unction that only returns true when 1) destination color space is non-null and is different than current color space AND 2) the code is running on CG platforms This function will only be called inside copy{Un, Pre}multipliedResult, to address the issue where color space is needed for filters that modifies raw pixels. * platform/graphics/filters/FilterEffect.h: Added function declarations 2020-06-10 Zalan Bujtas <zalan@apple.com> [Line clamp] Do not apply the special anchor handling when the anchor content is visible after clamping https://bugs.webkit.org/show_bug.cgi?id=213052 <rdar://problem/59739131> Reviewed by Simon Fraser. Line clamping tries to preserve the anchor text if it is at the bottom of the paragraph to support cases like "... Read more", where the "read more" is an actual link. This patch makes sure that we only apply the special case handling if the anchor text get clamped. Test: fast/flexbox/line-clamp-with-anchor-content-only.html * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp): 2020-06-10 Jer Noble <jer.noble@apple.com> [Cocoa] CRASH: imported/w3c/web-platform-tests/remote-playback/watch-availability-initial-callback.html is flaky crashing https://bugs.webkit.org/show_bug.cgi?id=213044 <rdar://problem/62317723> Reviewed by Eric Carlson. Add null-checks around previously non-null-checked derefs of WeakPtr<HTMLMediaElement>. * Modules/remoteplayback/RemotePlayback.cpp: (WebCore::RemotePlayback::watchAvailability): (WebCore::RemotePlayback::shouldPlayToRemoteTargetChanged): (WebCore::RemotePlayback::playbackTargetPickerWasDismissed): 2020-06-10 Sihui Liu <sihui_liu@apple.com> Text manipulation does not observe inserted elements that are invisible https://bugs.webkit.org/show_bug.cgi?id=213057 <rdar://problem/63768253> Reviewed by Wenson Hsieh. TextManipulationController gets notification when renderer of an element is created and starts observing the element. It currently sets the observing range to be the visible start position and visible end position of the element. When the invisible content becomes visible later, TextManipulationController does not get notification and will miss the content. Therefore, TextManipulationController should use the actual start and end positions of the element for range. Test: TextManipulation.StartTextManipulationFindsInsertedClippedText * editing/TextManipulationController.cpp: (WebCore::makeHashablePositionRange): (WebCore::TextManipulationController::scheduleObservationUpdate): 2020-06-10 Geoffrey Garen <ggaren@apple.com> Some style improvements to main thread code https://bugs.webkit.org/show_bug.cgi?id=213051 Reviewed by Darin Adler. Updated for rename. * WebCore.order: * platform/ios/wak/WebCoreThread.mm: (StartWebThread): 2020-06-10 Pinki Gyanchandani <pgyanchandani@apple.com> Release Assert @ WebCore::RenderTreeBuilder::RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=212714 Reviewed by Geoffrey Garen. Replaced call to WTFMove(widgetNewParentMap()) with std::exchange(widgetNewParentMap(), { }) in the WidgetHierarchyUpdatesSuspensionScope::moveWidgets(), thereby making it explicit to set the source map empty. Test would be added later. * rendering/RenderWidget.cpp: (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets): 2020-06-10 Brent Fulgham <bfulgham@apple.com> Improve CSP compliance under PSON https://bugs.webkit.org/show_bug.cgi?id=212995 <rdar://problem/62996186> Reviewed by Chris Dumez. Tests: http/tests/security/contentSecurityPolicy/1.1/form-action-src-self-blocked.html The form submission logic was only considering CSP if the form action was a JavaScript URL. This is incorrect, as CSP might apply to any URL. This is also covered by the existing form-action CSP tests. * loader/FrameLoader.cpp: (WebCore::FrameLoader::submitForm): All URLs should be evaluted for compliance with CSP. 2020-06-10 Brian Burg <bburg@apple.com> WebDriver on non-iOS ports cannot perform ActionChain which has scrolling down to the element and click it https://bugs.webkit.org/show_bug.cgi?id=208232 <rdar://problem/59859491> Reviewed by Devin Rousso. * platform/ScrollView.h: * platform/ScrollView.cpp: (WebCore::ScrollView::rootViewToContents const): Create a version of this function that works with FloatPoint. 2020-06-10 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r262718. https://bugs.webkit.org/show_bug.cgi?id=213047 Broke WPE Debug too Reverted changeset: "[WebXR] Pass an unsigned long to cancelAnimationCallback() as handle" https://bugs.webkit.org/show_bug.cgi?id=212529 https://trac.webkit.org/changeset/262718 2020-06-10 Antoine Quint <graouts@webkit.org> Subframes should not autosize independently https://bugs.webkit.org/show_bug.cgi?id=212984 <rdar://problem/64175493> Reviewed by Simon Fraser. * page/FrameView.cpp: (WebCore::FrameView::enableAutoSizeMode): 2020-06-10 Philippe Normand <pnormand@igalia.com> Unreviewed, WPE Debug build fix attempt after r262838. Second attempt. :) Still broken because of r262718 though... * platform/xr/openxr/PlatformXROpenXR.cpp: 2020-06-10 Philippe Normand <pnormand@igalia.com> Unreviewed, WPE Debug build fix attempt after r262838. Still broken because of r262718 though... * platform/xr/openxr/PlatformXROpenXR.cpp: 2020-06-10 Youenn Fablet <youenn@apple.com> BaseAudioSharedUnit does not need to restart its audio unit at resume time. https://bugs.webkit.org/show_bug.cgi?id=213021 Reviewed by Eric Carlson. Removing a case that should not happen, and was guarded by ASSERT. Keeping ASSERT to make sure we do not break this assumption. * platform/mediastream/mac/BaseAudioSharedUnit.cpp: (WebCore::BaseAudioSharedUnit::resume): (WebCore::BaseAudioSharedUnit::suspend): 2020-06-10 Youenn Fablet <youenn@apple.com> REGRESSION(r262798): fast/mediastream/media-stream-track-interrupted.html is failing https://bugs.webkit.org/show_bug.cgi?id=213011 Reviewed by Eric Carlson. Before the patch, a source that is muted and for which its observers get ended will not be ended. This is a potential issue as the source can get unmuted, in which case, the audio shared unit might be asked to restart. This is crashing in debug as we would not have the AudioSession correct category for audio capture. Test: fast/mediastream/track-ended-while-muted.html Also covered by fast/mediastream/media-stream-track-interrupted.html no longer flakily crashing in debug. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::requestToEnd): End the source even if muted. * platform/mediastream/RealtimeMediaSource.h: * testing/Internals.cpp: (WebCore::Internals::isMediaStreamSourceEnded const): * testing/Internals.h: * testing/Internals.idl: Add necessary test infrastructure. 2020-06-05 Sergio Villar Senin <svillar@igalia.com> [WebXR] Refactor OpenXR platform code https://bugs.webkit.org/show_bug.cgi?id=212470 Reviewed by Youenn Fablet. Refactored a bit the platform code because we want to extend the PlatformXR::Device for the OpenXR library. Also we're removing all the device id code because there is no need to expose it. The idea from now on is to only define interfaces in PlatformXR.h and then add all the OpenXR specifics in the newly renamed PlatformXROpenXR.[ch] files. We're also renaming PlatformXR.cpp to PlatformXROpenXR.cpp to clearly state that it's the OpenXR implementation and to differentiate it from the implementation agnostic PlatformXR.h file. No new tests as there is no change in functionality. * Sources.txt: Added renamed files. Removed PlatformXR.cpp. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/xr/PlatformXR.cpp: Removed. * platform/xr/PlatformXR.h: (PlatformXR::Device::id const): Deleted. (PlatformXR::Device::operator== const): Deleted. * platform/xr/openxr/PlatformXROpenXR.cpp: Renamed from Source/WebCore/platform/xr/openxr/PlatformXR.cpp. (PlatformXR::Instance::Impl::~Impl): Call xrDestroyInstance() on m_instance. (PlatformXR::Instance::Impl::collectSupportedSessionModes): Do not pass XrSystemId as argument as it's stored in the OpenXRDevice object. (PlatformXR::Instance::enumerateImmersiveXRDevices): Create an OpenXRDevice instead of a Device. * platform/xr/openxr/PlatformXROpenXR.h: Added. 2020-06-09 Pinki Gyanchandani <pgyanchandani@apple.com> Release Assert @ WebCore::RenderTreeBuilder::RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=212714 Reviewed by Geoffrey Garen. Made change in the WidgetHierarchyUpdatesSuspensionScope::moveWidgets() to handle all widgets scheduled to move, including new widgets scheduled during moveWidgets(). Test would be added later. * rendering/RenderWidget.cpp: (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets): 2020-06-09 Fujii Hironori <Hironori.Fujii@sony.com> Unreviewed, reverting r262791. WinCairo WebKit1 is crashing. Reverted changeset: "[Curl] Implement functions to use ResourceLoadStatistics." https://bugs.webkit.org/show_bug.cgi?id=207692 https://trac.webkit.org/changeset/262791 2020-06-09 Simon Fraser <simon.fraser@apple.com> Minor overflow layers cleanup https://bugs.webkit.org/show_bug.cgi?id=213002 Reviewed by Zalan Bujtas. Now that we parent scrollbar and scroll corner layers into the overflowControlsContainer layer, we no need to parent these layers in RenderLayerCompositor::updateBackingAndHierarchy(). Also rename overflowControlsHostLayerBox to overflowControlsHostLayerRect to avoid ambiguity with RenderBox. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateDebugIndicators): (WebCore::overflowControlsHostLayerRect): (WebCore::RenderLayerBacking::updateGeometry): (WebCore::overflowControlsHostLayerBox): Deleted. * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): 2020-06-09 Mark Lam <mark.lam@apple.com> Disambiguate the OverridesGetPropertyNames structure flag https://bugs.webkit.org/show_bug.cgi?id=212909 <rdar://problem/63823557> Reviewed by Saam Barati. 1. JSDOMWindowProperties was not defining its Base. As a result, its StructureFlags was inheriting from JSDOMObject's Base instead of from JSDOMObject as one would expect. This turns out to be harmless because JSDOMObject did not define any StructureFlags. Regardless, this is not fixed so that if JSDOMObject adds any StructureFlags, it will be inherited properly by JSDOMWindowProperties. 2. Updated CodeGeneratorJS.pm and rebased the binding test results. * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): * bindings/scripts/test/JS/JSTestEventTarget.h: * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h: * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: * bridge/runtime_array.h: * bridge/runtime_object.h: 2020-06-09 Dean Jackson <dino@apple.com> Stop using discriminatory names for WebGL and Plugin blocking https://bugs.webkit.org/show_bug.cgi?id=213000 Reviewed by Simon Fraser. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mac/BlocklistUpdater.h: Renamed from Source/WebCore/platform/mac/BlacklistUpdater.h. (WebCore::BlocklistUpdater::pluginBlocklist): (WebCore::BlocklistUpdater::webGLBlocklist): * platform/mac/BlocklistUpdater.mm: Renamed from Source/WebCore/platform/mac/BlacklistUpdater.mm. (WebCore::BlocklistUpdater::readBlocklistData): (WebCore::BlocklistUpdater::reloadIfNecessary): (WebCore::BlocklistUpdater::initializeQueue): * platform/mac/PluginBlocklist.h: Renamed from Source/WebCore/platform/mac/PluginBlacklist.h. * platform/mac/PluginBlocklist.mm: Renamed from Source/WebCore/platform/mac/PluginBlacklist.mm. (WebCore::PluginBlocklist::loadPolicyForPluginVersion): (WebCore::PluginBlocklist::isPluginUpdateAvailable): (WebCore::PluginBlocklist::create): (WebCore::PluginBlocklist::~PluginBlocklist): (WebCore::PluginBlocklist::splitOSVersion): (WebCore::PluginBlocklist::loadPolicyForPlugin const): (WebCore::PluginBlocklist::isUpdateAvailable const): (WebCore::PluginBlocklist::PluginBlocklist): * platform/mac/WebGLBlocklist.h: Renamed from Source/WebCore/platform/mac/WebGLBlacklist.h. * platform/mac/WebGLBlocklist.mm: Renamed from Source/WebCore/platform/mac/WebGLBlacklist.mm. (WebCore::buildInfoFromOSBuildString): (WebCore::WebGLBlocklist::shouldBlockWebGL): (WebCore::WebGLBlocklist::shouldSuggestBlockingWebGL): (WebCore::matchesBuildInfo): (WebCore::WebGLBlocklist::create): (WebCore::WebGLBlocklist::shouldBlock const): (WebCore::WebGLBlocklist::shouldSuggestBlocking const): (WebCore::WebGLBlocklist::WebGLBlocklist): (WebCore::WebGLBlocklist::~WebGLBlocklist): 2020-06-09 Simon Fraser <simon.fraser@apple.com> Logging and tree dumping crash fix https://bugs.webkit.org/show_bug.cgi?id=212988 Reviewed by Zalan Bujtas. Add scrolling logging to RenderLayer::requestScrollPositionUpdate(). Null-check the scrollerImp in ScrollbarThemeMac::isLayoutDirectionRTL, because this is called from renderTreeAsText() which can be invoked from the debugger, and should not crash. * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::isLayoutDirectionRTL): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::requestScrollPositionUpdate): 2020-06-09 Andy Estes <aestes@apple.com> Unreviewed change for post-commit feedback after r262682. * DerivedSources.make: Replaced tabs with spaces. 2020-06-09 Frank Yang <guowei_yang@apple.com> WebKit Crashes when SVG Filter Logging is Turned On https://bugs.webkit.org/show_bug.cgi?id=212415 Reviewed by Darin Adler. No new tests are required because this is just fixing a simple pointer access inside logging code * html/ImageData.cpp: (WebCore::operator<<): Overloaded << operator to print the address of pixel data it stores * html/ImageData.h: Declare overloaded << operator * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::imageBufferResult): Modified logging code so that it does a null check by calling ValueOrNull on m_premultipliedImageResult and m_unmultipliedImageResult (WebCore::FilterEffect::copyUnmultipliedResult): Modified logging code so that it does a null check by calling ValueOrNull on m_premultipliedImageResult and m_unmultipliedImageResult (WebCore::FilterEffect::copyPremultipliedResult): Modified logging code so that it does a null check by calling ValueOrNull on m_premultipliedImageResult and m_unmultipliedImageResult 2020-06-09 Dean Jackson <dino@apple.com> REGRESSION: [Safari Mojave for High Sierra] Accessing some of the featured pages on apple.com causes the webpage to crash https://bugs.webkit.org/show_bug.cgi?id=212940 rdar://63839405 Reviewed by Tim Horton. The code to use the singleton for a SwitchingGPUClient was assuming it has always been set, which was not the case when ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) was not true. * platform/graphics/opengl/GraphicsContextGLOpenGLManager.cpp: Check the state of the singleton before calling it. (WebCore::GraphicsContextGLOpenGLManager::updateHighPerformanceState): (WebCore::GraphicsContextGLOpenGLManager::disableHighPerformanceGPUTimerFired): * platform/graphics/mac/SwitchingGPUClient.h: Return a pointer to the singleton which will allow the code to check for its existence. (WebCore::SwitchingGPUClient::singletonIfExists): 2020-06-09 Sam Weinig <weinig@apple.com> Extended Color: Streamline SimpleColor premulitply/unpremultiply code https://bugs.webkit.org/show_bug.cgi?id=212945 Reviewed by Darin Adler. Simplify / streamline the premulitply/unpremultiply code by: - Removing the overloads that didn't take individual components, keeping only the ones taking a SimpleColor. - Replacing the "ceiling" bool in makePremultipliedSimpleColor and converting it into two functions. - Simplifying the names from makePremultipliedSimpleColor/makeUnpremultipliedSimpleColor to premultiplyFlooring/premultiplyCeiling/unpremultiply. - Where component order is important, use valueAsARGB() explicitly to show what the resulting value's format will be. * platform/graphics/Color.cpp: (WebCore::blend): Update to call premultiplyCeiling/unpremultiply. * platform/graphics/ImageBackingStore.h: (WebCore::ImageBackingStore::blendPixel): (WebCore::ImageBackingStore::pixelValue const): Update to call premultiplyFlooring/unpremultiply and valueAsARGB(). * platform/graphics/SimpleColor.h: * platform/graphics/SimpleColor.cpp: (WebCore::premultiplyFlooring): (WebCore::premultiplyCeiling): (WebCore::unpremultiplyChannel): (WebCore::unpremultiply): (WebCore::premultipliedChannel): Deleted. (WebCore::unpremultipliedChannel): Deleted. (WebCore::makePremultipliedSimpleColor): Deleted. (WebCore::makeUnpremultipliedSimpleColor): Deleted. Simplify premulitply/unpremultiply interfaces. Use structured bindings to make the code a bit easier to follow as well. * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp: (WebCore::ImageBufferCairoImageSurfaceBackend::platformTransformColorSpace): Update to call premultiplyFlooring/unpremultiply and valueAsARGB(). * platform/graphics/cairo/NativeImageCairo.cpp: (WebCore::nativeImageSinglePixelSolidColor): Update to call premultiplyFlooring/unpremultiply and valueAsARGB(). Also removes reinterpret cast to SimpleColor, instead following the model in ImageBufferCairoImageSurfaceBackend and casting to unsigned, and building the SimpleColor from that. This will allow SimpleColor to change its underlying representation in the future without breaking things. 2020-06-09 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r261841. https://bugs.webkit.org/show_bug.cgi?id=212991 Caused spotify pages to scroll to the top (<http://webkit.org/b/212983|webkit.org/b/212983>) Reverted changeset: "[css-grid] Clear the override width for computing percent margins" https://bugs.webkit.org/show_bug.cgi?id=209461 https://trac.webkit.org/changeset/261841 2020-06-09 Fujii Hironori <Hironori.Fujii@sony.com> [Win] ComplexTextControllerUniscribe: Retry ScriptShape with SCRIPT_UNDEFINED if it failed as USP_E_SCRIPT_NOT_IN_FONT https://bugs.webkit.org/show_bug.cgi?id=212947 Reviewed by Don Olmstead. If the given font doesn't support the givin text, ScriptShape API fails as USP_E_SCRIPT_NOT_IN_FONT. In the case, the complex run was simply ignored and nothing was drawn for the text. According to Uniscribe document, We should retry ScriptShape with SCRIPT_UNDEFINED to get missing glyphs. <https://docs.microsoft.com/en-us/windows/win32/intl/displaying-text-with-uniscribe> * platform/graphics/win/ComplexTextControllerUniscribe.cpp: (WebCore::shapeByUniscribe): 2020-06-09 Fujii Hironori <Hironori.Fujii@sony.com> ComplexTextController: Use std::sort to calculate m_runIndices https://bugs.webkit.org/show_bug.cgi?id=212944 Reviewed by Myles C. Maxfield. ComplexTextController was using O(n²) sort to lazily calculate m_runIndices. And, exact matching stringBegin and stringEnd can cause infinite loop (Bug 212670 and Bug 108877). Use std::sort instead. * platform/graphics/ComplexTextController.cpp: (WebCore::ComplexTextController::finishConstruction): (WebCore::ComplexTextController::indexOfCurrentRun): 2020-06-09 Youenn Fablet <youenn@apple.com> BaseAudioSharedUnit should unmute its clients in case of suspension even if not having any audio unit https://bugs.webkit.org/show_bug.cgi?id=212970 Reviewed by Eric Carlson. CoreAudioCaptureSource(s), when muted, are now calling stopProducingData. This will, in turn, make the BaseAudioSharedUnit stop and no longer have any audio unit. In that case, when resume is called on the BaseAudioSharedUnit, it will exit early as the audio unit is null. This will prevent to unmute the CoreAudioCaptureSource(s). Fix this by removing the audio unit check in BaseAudioSharedUnit::resume. Add infrastructure testing to be able to write a test. Covered by added test. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/BaseAudioSharedUnit.cpp: (WebCore::BaseAudioSharedUnit::resume): * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::setInterruptedForTesting): * platform/mediastream/mac/CoreAudioCaptureSource.h: * testing/Internals.cpp: (WebCore::Internals::isMediaStreamSourceInterrupted const): * testing/Internals.h: * testing/Internals.idl: 2020-06-09 Myles C. Maxfield <mmaxfield@apple.com> lang=zh needs to defer to system preferences to know whether it should be simplified or traditional https://bugs.webkit.org/show_bug.cgi?id=212626 <rdar://problem/60227623> Reviewed by Darin Adler. If the content says lang="zh" font-family: sans-serif, we have no signal for whether the content should be traditional or simplified. In this case, we should pick based on system preferences to make it more likely that we get the right answer. This is actually what some Cocoa platform text functions were doing, but not all of them. We need to do it at our level in WebKit to make sure that all our calls to the platform have consistent behavior. Also, we can cache the result at our level, which is more performant than if the platform cached it at each platform entry point. We already started consulting with system preferences to make this decision in r189038. This patch extends that and fixes it to throughout WebKit. This doesn't expose any new fingerprinting data, because this information was already exposed (e.g. by drawing fallback fonts to the canvas and then reading back the pixels). Tests: fast/text/locale-getComputedStyle.html fast/text/international/generic-font-family-language-traditional.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSFontSelector.cpp: (WebCore::resolveGenericFamily): * css/CSSProperties.json: * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::LineBreaker::wordBreakBehavior const): (WebCore::Layout::LineBreaker::tryBreakingTextRun const): * platform/graphics/Font.cpp: (WebCore::Font::systemFallbackFontForCharacter const): * platform/graphics/FontCache.h: (WebCore::FontDescriptionKey::FontDescriptionKey): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthForSimpleText const): * platform/graphics/FontCascadeDescription.cpp: * platform/graphics/FontCascadeDescription.h: (WebCore::FontCascadeDescription::initialSpecifiedLocale): (WebCore::FontCascadeDescription::initialLocale): Deleted. * platform/graphics/FontDescription.cpp: (WebCore::computeSpecializedChineseLocale): (WebCore::cachedSpecializedChineseLocale): (WebCore::fontDescriptionLanguageChanged): (WebCore::specializedChineseLocale): (WebCore::FontDescription::setSpecifiedLocale): (WebCore::FontDescription::setLocale): Deleted. * platform/graphics/FontDescription.h: (WebCore::FontDescription::computedLocale const): (WebCore::FontDescription::specifiedLocale const): (WebCore::FontDescription::operator== const): (WebCore::FontDescription::encode const): (WebCore::FontDescription::decode): (WebCore::FontDescription::locale const): Deleted. * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::applyFontTransforms): * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontCache::systemFallbackForCharacters): * platform/graphics/cocoa/FontDescriptionCocoa.cpp: (WebCore::FontDescription::platformResolveGenericFamily): (WebCore::computeSpecializedChineseLocale): Deleted. (WebCore::cachedSpecializedChineseLocale): Deleted. (WebCore::languageChanged): Deleted. * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: (WebCore::SystemFontDatabaseCoreText::systemFontParameters): * platform/graphics/mac/ComplexTextControllerCoreText.mm: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): * rendering/RenderQuote.cpp: (WebCore::RenderQuote::computeText const): * rendering/RenderText.cpp: (WebCore::maxWordFragmentWidth): (WebCore::RenderText::computePreferredLogicalWidths): (WebCore::applyTextTransform): * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::paintApplePayButton): * rendering/SimpleLineLayoutTextFragmentIterator.cpp: (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style): (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator): * rendering/line/BreakingContext.h: (WebCore::BreakingContext::handleText): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::computedLocale const): (WebCore::RenderStyle::specifiedLocale const): (WebCore::RenderStyle::locale const): Deleted. * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueWebkitLocale): * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): 2020-06-09 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add support for empty table https://bugs.webkit.org/show_bug.cgi?id=212971 Reviewed by Antti Koivisto. No need to run formatting context layout when the table box has no descendant. Test: fast/layoutformattingcontext/empty-table-box.html * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::layoutTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::ensureTableGrid): * layout/tableformatting/TableGrid.h: (WebCore::Layout::TableGrid::isEmpty const): 2020-06-09 Youenn Fablet <youenn@apple.com> Forward declare MediaKeys/MediaKeySession in Internals.h https://bugs.webkit.org/show_bug.cgi?id=212965 Reviewed by Xabier Rodriguez-Calvar. No change of behavior. * testing/Internals.cpp: * testing/Internals.h: 2020-06-09 Youenn Fablet <youenn@apple.com> Fix two MediaStream tests https://bugs.webkit.org/show_bug.cgi?id=208926 <rdar://problem/60329008> Reviewed by Eric Carlson. Previously, the mock capture sample rate was the one of the mock audio shared unit, which is the sample rate of the audio session by default. This sample rate may change according the bots. For that reason, explicitly set the mock shared unit sample rate to the default sample rate of the device, just before creating the source. MediaConstraints may still apply after this step. Fix an issue where we would use the real core audio unit in CoreAudioCaptureSource constructor. We now pass the unit override if any in constructor. Covered by unflaked tests. * platform/mediastream/mac/BaseAudioSharedUnit.cpp: (WebCore::BaseAudioSharedUnit::BaseAudioSharedUnit): * platform/mediastream/mac/BaseAudioSharedUnit.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::initializeCoreAudioCaptureSource): (WebCore::CoreAudioSharedUnit::CoreAudioSharedUnit): (WebCore::CoreAudioCaptureSource::create): (WebCore::CoreAudioCaptureSource::createForTesting): (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/MockAudioSharedUnit.mm: (WebCore::MockRealtimeAudioSource::create): (WebCore::MockAudioSharedUnit::MockAudioSharedUnit): Do not disable echo cancellation to mimick what the real unit is doing. 2020-06-09 Zalan Bujtas <zalan@apple.com> [LFC][Table][Floats] Multi-pass table layout needs clean floating state https://bugs.webkit.org/show_bug.cgi?id=212889 Reviewed by Antti Koivisto. When laying out the cell content multiple times to accommodate flex table layout, the float state needs be cleared to avoid having redundant float content. Test: fast/layoutformattingcontext/float-inside-table-cell-simple.html * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::append): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::floatBox const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createLayoutBox): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutCell): 2020-06-09 Takashi Komori <Takashi.Komori@sony.com> [Curl] Implement functions to use ResourceLoadStatistics. https://bugs.webkit.org/show_bug.cgi?id=207692 Reviewed by Don Olmstead. Implement functions which are required to implement ResourceLoadStatistics for Curl port. Tests: http/tests/resourceLoadStatistics/ * CMakeLists.txt: * platform/network/curl/CookieJarDB.cpp: (WebCore::CookieJarDB::openDatabase): (WebCore::CookieJarDB::setCookie): (WebCore::CookieJarDB::allDomains): (WebCore::CookieJarDB::deleteCookiesForHostname): * platform/network/curl/CookieJarDB.h: * platform/network/curl/NetworkStorageSessionCurl.cpp: (WebCore::NetworkStorageSession::setCookiesFromDOM const): (WebCore::NetworkStorageSession::setCookies): (WebCore::NetworkStorageSession::deleteCookiesForHostnames): (WebCore::NetworkStorageSession::getHostnamesWithCookies): 2020-06-09 Sam Weinig <weinig@apple.com> Extended Color: Switch ColorMac.mm's nsColor() function over to using TinyLRUCache https://bugs.webkit.org/show_bug.cgi?id=212918 Reviewed by Darin Adler. * platform/graphics/Color.h: (WebCore::Color::isExtended const): Make asSimple() public, so nsColor() can use it. This also allows us to unfriend cachedCGColor(). * platform/graphics/mac/ColorMac.mm: (WTF::RetainPtr<NSColor>>::createValueForKey): (WebCore::nsColor): Mimic the structure of cachedCGColor() by switching over simpleColor values for common colors and using a 32 value TinyLRUCache for the rest. 2020-06-09 Xabier Rodriguez Calvar <calvaris@igalia.com> [EME] CDMProxyInstance should not keep CDMInstanceSessions hard referenced https://bugs.webkit.org/show_bug.cgi?id=212689 Reviewed by Youenn Fablet. Sessions are now tracked as WeakPtr inside the CDMInstanceProxy instead of RefPtr because this creates referencing issues as the internal objects should be released when the backing JS object is garbage collected. Test: media/encrypted-media/clearKey/clearKey-session-life-cycle.html * Modules/encryptedmedia/MediaKeySession.h: * Modules/encryptedmedia/MediaKeySession.idl: * Modules/encryptedmedia/MediaKeys.h: * Modules/encryptedmedia/MediaKeys.idl: * platform/encryptedmedia/CDMProxy.cpp: (WebCore::CDMInstanceProxy::trackSession): * platform/encryptedmedia/CDMProxy.h: (WebCore::CDMInstanceProxy::trackSession): * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::CDMInstanceClearKey::createSession): * platform/encryptedmedia/clearkey/CDMClearKey.h: * testing/Internals.cpp: (WebCore::Internals::mediaKeysInternalInstanceObjectRefCount const): (WebCore::Internals::mediaKeySessionInternalInstanceSessionObjectRefCount const): * testing/Internals.h: * testing/Internals.idl: 2020-06-09 Sihui Liu <sihui_liu@apple.com> TextManipulationController range of paragraph may be wrong after r262601 https://bugs.webkit.org/show_bug.cgi?id=212874 Reviewed by Wenson Hsieh. Start and end position of item are not properly set in r262601. Test: TextManipulation.CompleteTextManipulationSuccedsWhenContentOutOfParagraphIsAdded * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::addItemIfPossible): 2020-06-08 Sihui Liu <sihui_liu@apple.com> TextManipulation should only convert text from Node's text content to tokens https://bugs.webkit.org/show_bug.cgi?id=212928 Reviewed by Wenson Hsieh. TextIterator may emit text like line breaks between nodes. This kind of text is generated based on the range of TextIterator and style of node. We need this text for splitting tokens or splitting paragraphs, but we should not convert it to normal tokens. This is because tokens should be created from content of node and text manipulation fails if content does not match. The change of this kind of text does not indicate change in content and we may still be able to finish text manipulation. Test: TextManipulation.CompleteTextManipulationReplaceTwoSimpleParagraphs * editing/TextManipulationController.cpp: (WebCore::isInPrivateUseArea): (WebCore::isTokenDelimiter): (WebCore::ParagraphContentIterator::currentContent): (WebCore::ParagraphContentIterator::appendToText): (WebCore::ParagraphContentIterator::advanceIteratorNodeAndUpdateText): (WebCore::TextManipulationController::createUnit): (WebCore::TextManipulationController::parse): (WebCore::TextManipulationController::observeParagraphs): (WebCore::TextManipulationController::replace): * editing/TextManipulationController.h: 2020-06-08 Rob Buis <rbuis@igalia.com> XMLHTTPRequest.send should not send Content-Type headers when Blob has no type https://bugs.webkit.org/show_bug.cgi?id=211999 Reviewed by Alex Christensen. XMLHTTPRequest.send should not send Content-Type headers when Blob has no type [1, 2]. This behavior overrides the behavior of the File API spec [3]. Behavior matches Firefox and Chrome. Test: imported/w3c/web-platform-tests/xhr/send-blob-with-no-mime-type.html [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send [2] https://fetch.spec.whatwg.org/#concept-bodyinit-extract [3] http://dev.w3.org/2006/webapi/FileAPI/#dfn-type * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::send): 2020-06-08 Simon Fraser <simon.fraser@apple.com> Horizontally scrolling elements are broken when revealed by toggling visibility https://bugs.webkit.org/show_bug.cgi?id=212439 <rdar://problem/63739559> Reviewed by Zalan Bujtas. When revealing an overflow:scroll by toggling the visibility property, make sure that we use composited scrolling. computeScrollDimensions() is only updated on layout, so we need to recompute m_hasCompositedScrollableOverflow on style change as well. Test: compositing/scrolling/async-overflow-scrolling/toggle-visibility-on-scroller.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::computeScrollDimensions): (WebCore::RenderLayer::computeHasCompositedScrollableOverflow): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: 2020-06-08 Sam Weinig <weinig@apple.com> Extended Color: Rename Color::lighten() and Color::darken() to Color::lightened() and Color::darkened() https://bugs.webkit.org/show_bug.cgi?id=212917 Reviewed by Darin Adler. Addresses feedback from Darin. * platform/graphics/Color.cpp: (WebCore::Color::lightened const): (WebCore::Color::darkened const): (WebCore::Color::lighten const): Deleted. (WebCore::Color::darken const): Deleted. * platform/graphics/Color.h: * rendering/RenderObject.cpp: (WebCore::RenderObject::calculateBorderStyleColor): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::disabledTextColor const): * rendering/TextPaintStyle.cpp: (WebCore::adjustColorForVisibilityOnBackground): 2020-06-08 Devin Rousso <drousso@apple.com> Remove unnecessary variable in `WindowProxy::createJSWindowProxy` https://bugs.webkit.org/show_bug.cgi?id=212929 Reviewed by Darin Adler. * bindings/js/WindowProxy.cpp: (WebCore::WindowProxy::createJSWindowProxy): 2020-06-08 Pinki Gyanchandani <pgyanchandani@apple.com> Release Assert @ WebCore::RenderTreeBuilder::RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=212714 Reviewed by Geoffrey Garen. Widget removal in the middle of building a Render Tree causes side effects, leading to Release Assert. Moved the scope for suspension of widgets update to RenderTreeBuilder instead of having it in RenderTreeUpdater. Test would be added later. * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::tearDownRenderers): 2020-06-08 Yusuke Suzuki <ysuzuki@apple.com> Use usual promise in readableStreamTee https://bugs.webkit.org/show_bug.cgi?id=212715 Reviewed by Mark Lam. The spec[1] is organized to be OK to use usual promises here. This patch uses usual promises instead of internal ones. [1]: https://streams.spec.whatwg.org/#readable-stream-tee * Modules/streams/ReadableStreamInternals.js: (readableStreamTee): 2020-06-08 David Kilzer <ddkilzer@apple.com> [IPC] Adopt enum class for DragOperation <https://webkit.org/b/212870> <rdar://problem/64069940> Reviewed by Darin Adler. * dom/DataTransfer.cpp: (WebCore::dragOpFromIEOp): (WebCore::IEOpFromDragOp): (WebCore::DataTransfer::sourceOperationMask const): (WebCore::DataTransfer::destinationOperationMask const): (WebCore::DataTransfer::setSourceOperationMask): (WebCore::DataTransfer::setDestinationOperationMask): (WebCore::DataTransfer::setEffectAllowed): * page/DragActions.h: (WebCore::DragOperation): - Convert to enum class. (WebCore::anyDragOperation): * page/DragController.cpp: (WebCore::DragController::platformGenericDragOperation): (WebCore::DragController::dragEnteredOrUpdated): (WebCore::DragController::tryDocumentDrag): (WebCore::defaultOperationForDrag): (WebCore::DragController::startDrag): * page/EventHandler.cpp: (WebCore::convertDropZoneOperationToDragOperation): (WebCore::convertDragOperationToDropZoneOperation): * page/gtk/DragControllerGtk.cpp: (WebCore::DragController::dragOperation): * page/mac/DragControllerMac.mm: (WebCore::DragController::dragOperation): (WebCore::DragController::platformGenericDragOperation): * page/win/DragControllerWin.cpp: (WebCore::DragController::dragOperation): * platform/gtk/GtkUtilities.cpp: (WebCore::gdkDragActionToDragOperation): (WebCore::dragOperationToGdkDragActions): (WebCore::dragOperationToSingleGdkDragAction): 2020-06-08 Sam Weinig <weinig@apple.com> Extended Color: Unify rounding / clamping conversions between 0-1 float components and 0-255 byte components https://bugs.webkit.org/show_bug.cgi?id=212871 Reviewed by Simon Fraser. Unify all conversions of 0.0f - 1.0f float based color components to 0-255 int based color components to use the new convertToComponentByte() function which scales, rounds (using lroundf) and clamps the value. For consistency, a convertToComponentFloat() function, which just scales down an int based value to a float based value, is also added. - Removes *UsingAlternativeRounding variants (actually, we now only have this variant) for color functions which allowed callers to pick from truncation vs. rounding when overriding alpha. - Replaces all uses of scaleRoundAndClampColorChannel() with convertToComponentByte() (really just a rename). - Replaces uses of nextafter(256, 0) based conversions with convertToComponentByte(). Also: - Moves roundAndClampColorChannel() functions to SVGAnimationAdditiveValueFunctionImpl.h, which was the only places they were used. - Removes areEssentiallyEqual() overload taking ColorComponents<float>. It was ununsed. - Removes makeSimpleColorFromHSLA(...) and just inlines makeSimpleColor(hslToSRGB(...)) which now does the same thing. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::clampRGBComponent): Use convertPrescaledToComponentByte() to round and clamp the components. (WebCore::CSSPropertyParserHelpers::parseRGBParameters): Use uint8_t more consistently now that helpers ensure that is the return type of conversion functions. (WebCore::CSSPropertyParserHelpers::parseHSLParameters): Switch to using makeSimpleColor(hslToSRGB(...)) directly. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): Switch to using makeSimpleColor(hslToSRGB(...)) directly. * html/HTMLElement.cpp: (WebCore::parseLegacyColorValue): Use uint8_t since that is what toASCIIHexValue() returns. * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::setStrokeStyle): (WebCore::CanvasRenderingContext2DBase::setFillStyle): (WebCore::CanvasRenderingContext2DBase::setShadow): * html/canvas/CanvasStyle.cpp: (WebCore::CanvasStyle::createFromStringWithOverrideAlpha): Replaces uses of colorWithAlphaUsingAlternativeRounding() with colorWithAlpha(). * inspector/agents/InspectorDOMAgent.cpp: (WebCore::parseColor): Use convertToComponentByte() rather than a simple truncating cast. * platform/graphics/Color.cpp: (WebCore::Color::light const): (WebCore::Color::dark const): Use makeSimpleColorFromFloats() rather than nextafterf(256.0f, 0.0f) conversion. (WebCore::Color::colorWithAlpha const): (WebCore::Color::invertedColorWithAlpha const): Use convertToComponentByte() for alpha conversion. (WebCore::Color::toSRGBASimpleColorLossy const): Call asExtended().toSRGBAComponentsLossy() directly to avoid unnecessary branch. (WebCore::Color::colorWithAlphaMultipliedBy const): Deleted. (WebCore::Color::colorWithAlphaMultipliedByUsingAlternativeRounding const): Deleted. (WebCore::Color::colorWithAlphaUsingAlternativeRounding const): Deleted. Remove UsingAlternativeRounding variants. * platform/graphics/Color.h: (WebCore::Color::alpha const): Use convertToComponentByte() for alpha conversion. (WebCore::Color::invertedColorWithAlpha const): Add an overload taking an Optional<float> for consistency. (WebCore::Color::colorWithAlphaMultipliedBy const): (WebCore::Color::colorWithAlpha const): Simplify by inlining all variants except the main colorWithAlpha(). * platform/graphics/ColorUtilities.cpp: (WebCore::areEssentiallyEqual): Deleted. Remove unused function. * platform/graphics/ColorUtilities.h: (WebCore::convertPrescaledToComponentByte): Added. Useful for callers who already have prescaled values but need rounding/clamping. (WebCore::convertToComponentByte): Added. Bottleneck for float to byte based color component conversions. (WebCore::convertToComponentFloat): Added. Bottleneck for byte to float based color component conversions. * platform/graphics/SimpleColor.cpp: (WebCore::makeSimpleColorFromCMYKA): Use makeSimpleColorFromFloats() rather than nextafterf(256.0f, 0.0f) conversion. Eventually, when we probably want this to go away and store CMYKA colors as ExtendedColors with their own color space. (WebCore::makeSimpleColorFromFloats): Moved to header. * platform/graphics/SimpleColor.h: (WebCore::SimpleColor::alphaComponentAsFloat const): Use convertToComponentFloat(). (WebCore::SimpleColor::asSRGBFloatComponents const): Use convertToComponentFloat(). (WebCore::makeSimpleColor): Avoid unncessary clamping of the alpha component by calling constructor directly. (WebCore::makeSimpleColorFromFloats): Inlined. Calls convertToComponentByte now rather than the older (identical) scaleRoundAndClampColorChannel(). * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::prepareCairoContextSource): Replaces use of colorWithAlphaMultipliedByUsingAlternativeRounding with colorWithAlphaMultipliedBy(). * platform/graphics/cg/ColorCG.cpp: (WebCore::makeSimpleColorFromCGColor): Use makeSimpleColorFromFloats() rather than nextafter(256.0, 0.0) conversion. * platform/graphics/filters/FEFlood.cpp: (WebCore::FEFlood::platformApplySoftware): Replaces use of colorWithAlphaMultipliedByUsingAlternativeRounding with colorWithAlphaMultipliedBy(). * platform/graphics/mac/ColorMac.mm: (WebCore::makeSimpleColorFromNSColor): Use makeSimpleColorFromFloats() rather than nextafter(256.0, 0.0) conversion. * platform/ios/ColorIOS.mm: (WebCore::colorFromUIColor): Use makeSimpleColorFromFloats() rather than nextafter(256.0, 0.0) conversion. * svg/SVGStopElement.cpp: (WebCore::SVGStopElement::stopColorIncludingOpacity const): Replaces use of colorWithAlphaMultipliedByUsingAlternativeRounding with colorWithAlphaMultipliedBy(). * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: (WebCore::SVGAnimationColorFunction::roundAndClampColorChannel): Moved from ColorUtilities.h as this was the only use. 2020-06-08 Sam Weinig <weinig@apple.com> Extended Color: Replace uses of differenceSquared() with luminance based computations https://bugs.webkit.org/show_bug.cgi?id=212872 Reviewed by Darin Adler. Replace all uses of differenceSquared() with luminance based comparisons. This is possible because all of the uses of differenceSquared() were about identifying a distance from black or white to determine relative brightness. It is more accurate to do this in terms of luminance, and has the added benefit of being something that is expressible in all colorspaces (since luminance is defined as the Y-component of the XYZ colorspace which all colorspaces are convertable to). * platform/graphics/Color.cpp: (WebCore::Color::lighten const): Renamed Color::light() to Color::lighten(), which makes more sense. The algorithm used should be updated at some point to also use luminance, but is unchanged for now. (WebCore::Color::darken const): Renamed Color::dark() to Color::darken(), which makes more sense. The algorithm used should be updated at some point to also use luminance, but is unchanged for now. (WebCore::Color::luminance const): Added. Converts to sRGB for now, but can be updated to work with other color spaces when needed. * platform/graphics/Color.h: Removed differenceSquared. * platform/graphics/ColorUtilities.cpp: (WebCore::luminance): Updated to use the standard conversion to linear-sRGB. While there are certainly some places that specify a 0.03928 cutoff, the much more accepted value (and value specified by the IEC) is 0.04045, which we use for all other gamma correction. (See https://entropymine.com/imageworsener/srgbformula/ or https://en.wikipedia.org/wiki/SRGB#The_forward_transformation_(CIE_XYZ_to_sRGB) for more information on this). Also added a FIXME about how in the future we can avoid hardcoding the specific values multiple times by extracting them from the linear-sRGB to XYZ matrix. * rendering/RenderObject.cpp: (WebCore::RenderObject::calculateBorderStyleColor): Use luminance, rather than distance as a better comparison for whether the color is too dark or too light for modification. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::disabledTextColor const): Use luminance, rather than distance as a better comparison for whether the color is too dark or too light for modification. Also us the contrastRatio utility function to determine illegibility issues due to contrast, picking a new minimum that roughly matches the old one based fast/forms/input-disabled-color.html * rendering/TextPaintStyle.cpp: (WebCore::adjustColorForVisibilityOnBackground): Use luminance, rather than distance as a better comparison for whether the color is too dark or too light for modification. 2020-06-08 Youenn Fablet <youenn@apple.com> Missing WebRTC Metrics in iOS Safari https://bugs.webkit.org/show_bug.cgi?id=212668 <rdar://problem/63902458> Reviewed by Eric Carlson. Expose more transports related stats. Covered by updated test. * Modules/mediastream/RTCStatsReport.h: * Modules/mediastream/RTCStatsReport.idl: * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::fillRTCTransportStats): 2020-06-08 Youenn Fablet <youenn@apple.com> Add missed WebRTC media-source and remote-inbound-rtp stats https://bugs.webkit.org/show_bug.cgi?id=206645 <rdar://problem/58833958> Reviewed by Eric Carlson. Update stats according latest spec and webrtc backend. We still expose obsolete trackId for consistency with existing WPT tests. Covered by existing and updated tests. * Modules/mediastream/RTCStatsReport.h: (WebCore::RTCStatsReport::InboundRtpStreamStats::InboundRtpStreamStats): (WebCore::RTCStatsReport::RemoteInboundRtpStreamStats::RemoteInboundRtpStreamStats): (WebCore::RTCStatsReport::OutboundRtpStreamStats::OutboundRtpStreamStats): (WebCore::RTCStatsReport::InboundRTPStreamStats::InboundRTPStreamStats): Deleted. (WebCore::RTCStatsReport::OutboundRTPStreamStats::OutboundRTPStreamStats): Deleted. * Modules/mediastream/RTCStatsReport.idl: * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::fillRtpStreamStats): (WebCore::fillReceivedRtpStreamStats): (WebCore::fillInboundRtpStreamStats): (WebCore::fillRemoteInboundRtpStreamStats): (WebCore::fillSentRtpStreamStats): (WebCore::fillOutboundRtpStreamStats): (WebCore::initializeRTCStatsReportBackingMap): (WebCore::fillRTCRTPStreamStats): Deleted. (WebCore::fillInboundRTPStreamStats): Deleted. (WebCore::fillOutboundRTPStreamStats): Deleted. 2020-06-08 Jonathan Bedard <jbedard@apple.com> WebCore: Add tvOS and watchOS SPI headers https://bugs.webkit.org/show_bug.cgi?id=212853 <rdar://problem/64048485> Reviewed by Andy Estes. No new tests, no behavior changed. * platform/ios/WebCoreMotionManager.h: Forward-declare CMMotionManager. * platform/ios/WebCoreMotionManager.mm: Include CoreMotionSPI.h. 2020-06-08 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for min/max-width/height https://bugs.webkit.org/show_bug.cgi?id=212904 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/inline-max-width-height-simple.html * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedWidthValue): Adjust assert to check inline, non-replaced boxes only (inline-block is an inline level element but not an inline element) * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin): (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin): 2020-06-05 Sergio Villar Senin <svillar@igalia.com> [WebXR] Add missing interfaces from the AR module https://bugs.webkit.org/show_bug.cgi?id=212826 Reviewed by Youenn Fablet. Added the XRInteractionMode partial interface from the WebXR AR module spec. This spec https://immersive-web.github.io/webxr-ar-module/ expands the WebXR Device API with functionality available in AR hardware. Some WebXR wpt tests are now passing. * CMakeLists.txt: Added new files. * DerivedSources.make: Ditto. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::interactionMode const): Added. * Modules/webxr/WebXRSession.h: Added interactionMode attribute and getter; * Modules/webxr/WebXRSession.idl: Added interactionMode attribute; * Modules/webxr/XRInteractionMode.h: Added. * Modules/webxr/XRInteractionMode.idl: Added. * Sources.txt: Added new files. * WebCore.xcodeproj/project.pbxproj: Ditto. 2020-05-29 Sergio Villar Senin <svillar@igalia.com> [WebXR] Pass an unsigned long to cancelAnimationCallback() as handle https://bugs.webkit.org/show_bug.cgi?id=212529 Reviewed by Youenn Fablet. The type of the handle returned by XRSession::requestAnimationFrame() was recently changed to unsigned long from long as there was no point in using signed integers for that. However we forgot to update the cancelAnimationFrame() in the specs as well as it receives the handle returned by requestAnimationFrame(). We landed https://github.com/immersive-web/webxr/pull/1069 in the WebXR specs so we can now safely also replace signed by unsigned integers in our implementation. No new tests as there is no change in functionality. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::cancelAnimationFrame): Use unsigned ids. * Modules/webxr/WebXRSession.h: Ditto. * Modules/webxr/WebXRSession.idl: Ditto. 2020-06-01 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] align-content should apply even when there's just a single line https://bugs.webkit.org/show_bug.cgi?id=209871 Reviewed by Manuel Rego Casasnovas. The 'align-content' property should have no effect on single line flex containers according to the specs https://drafts.csswg.org/css-flexbox/#propdef-align-content. The current code was not differentiating between single-line containers and multi-line containers with just 1 line. Also in order not to introduce regressions and properly support replaced elements as flex items we replaced the computation of child's width for 'flex-direction:column' by a direct call to computeLogicalWidthForFragment() which already properly handles all the cases. It used to be just the shrink-to-fit computation but that was not enough for replaced elements for example or elements with min/max-size restrictions. Several align-content-wrap-* subtests are working now. Updated expectations. * rendering/RenderFlexibleBox.cpp: (WebCore::initialAlignContentOffset): Removed check for #lines <= 1, as it is incorrect because it is true for multi-line containers with just 1 line. (WebCore::RenderFlexibleBox::alignFlexLines): Use isMultiline() instead of "#lines == 1". (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth const): Replace shrink-to-fit computation by a call computeLogicalWidthForFragment(). (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems): Use the whole crossAxisExtent for single line containers. Moved from alignFlexLines() as it fits much better here. 2020-06-08 Andy Estes <aestes@apple.com> [Apple Pay] Remove ENABLE_APPLE_PAY_SETUP, ENABLE_APPLE_PAY_SESSION_V7, and HAVE_PASSKIT_PAYMENT_SETUP https://bugs.webkit.org/show_bug.cgi?id=212883 <rdar://problem/64090763> Reviewed by Youenn Fablet. These macros evaluate to true whenever ENABLE(APPLE_PAY) is true on platforms supported by trunk WebKit, so we can either remove them or replace them with ENABLE(APPLE_PAY). * Modules/applepay/ApplePaySetup.cpp: * Modules/applepay/ApplePaySetup.idl: * Modules/applepay/ApplePaySetupConfiguration.h: * Modules/applepay/ApplePaySetupConfiguration.idl: * Modules/applepay/ApplePaySetupFeature.idl: * Modules/applepay/ApplePaySetupFeature.mm: * Modules/applepay/ApplePaySetupFeatureState.h: * Modules/applepay/ApplePaySetupFeatureState.idl: * Modules/applepay/ApplePaySetupFeatureType.idl: * Modules/applepay/ApplePaySetupFeatureTypeWebCore.h: * Modules/applepay/ApplePaySetupFeatureWebCore.h: * Modules/applepay/ApplePaySetupWebCore.h: * Modules/applepay/PaymentCoordinator.cpp: * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinatorClient.cpp: (WebCore::PaymentCoordinatorClient::supportsVersion): * Modules/applepay/PaymentCoordinatorClient.h: (WebCore::PaymentCoordinatorClient::endApplePaySetup): * testing/MockApplePaySetupFeature.cpp: * testing/MockApplePaySetupFeature.h: * testing/MockPaymentCoordinator.cpp: * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.idl: 2020-06-08 Antti Koivisto <antti@apple.com> Pseudo-elements (::after) in shadow roots don't animate https://bugs.webkit.org/show_bug.cgi?id=173027 <rdar://problem/42842994> Reviewed by Antoine Quint. Test: animations/keyframe-pseudo-shadow.html * animation/AnimationTimeline.cpp: (WebCore::shouldConsiderAnimation): We should use the actual element instead of the PseudoElement when calling Style::Scope::forOrdinal. The keyframe code that computes the style already does this correctly. 2020-06-08 Youenn Fablet <youenn@apple.com> Use one audio unit for all tracks of a given process https://bugs.webkit.org/show_bug.cgi?id=212406 Reviewed by Eric Carlson. Before the patch, we were creating one audio unit per track to render. This is potentially inefficient as this requires to IPC on iOS each audio data. Instead, we could have one single remote unit that will receive the mixed content of all tracks. For that purpose, introduce AudioMediaStreamTrackRendererUnit as a singleton. AudioMediaStreamTrackRendererCocoa will just register/unregister sources to AudioMediaStreamTrackRendererUnit. AudioMediaStreamTrackRendererUnit will then start/stop as needed and do the mixing. This requires a change in AudioSampleDataSource to support mixing in case track volumes are different. If we have to mix and with different volumes, we first pull the samples in a scratch buffer, apply volume and then mix it with the other tracks. In the future, we might also do the audio rendering with the CoreAudioSharedUnit directly so as to improve as much as possible echo cancellation. Interruption is handled by the fact that all tracks should stop playing, thus stop their renderer, thus unregister themselves from the renderer unit. it might be more future proof to add the unit as an interruption observer as a follow-up. Manually tested plus LayoutTests/webrtc/multi-audio.html * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/mac/AudioSampleBufferList.cpp: (WebCore::mixBuffers): (WebCore::AudioSampleBufferList::mixFrom): * platform/audio/mac/AudioSampleBufferList.h: * platform/audio/mac/AudioSampleDataSource.mm: (WebCore::AudioSampleDataSource::pullSamplesInternal): * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp: (WebCore::AudioMediaStreamTrackRendererCocoa::start): (WebCore::AudioMediaStreamTrackRendererCocoa::stop): (WebCore::AudioMediaStreamTrackRendererCocoa::clear): (WebCore::AudioMediaStreamTrackRendererCocoa::setVolume): (WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples): (WebCore::AudioMediaStreamTrackRendererCocoa::createAudioUnit): Deleted. (WebCore::AudioMediaStreamTrackRendererCocoa::render): Deleted. (WebCore::AudioMediaStreamTrackRendererCocoa::inputProc): Deleted. * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h: (): Deleted. * platform/mediastream/mac/AudioMediaStreamTrackRendererUnit.cpp: Added. (WebCore::AudioMediaStreamTrackRendererUnit::singleton): (WebCore::AudioMediaStreamTrackRendererUnit::~AudioMediaStreamTrackRendererUnit): (WebCore::AudioMediaStreamTrackRendererUnit::addSource): (WebCore::AudioMediaStreamTrackRendererUnit::removeSource): (WebCore::AudioMediaStreamTrackRendererUnit::createAudioUnitIfNeeded): (WebCore::AudioMediaStreamTrackRendererUnit::start): (WebCore::AudioMediaStreamTrackRendererUnit::stop): (WebCore::AudioMediaStreamTrackRendererUnit::formatDescription): (WebCore::AudioMediaStreamTrackRendererUnit::createAudioUnit): (WebCore::AudioMediaStreamTrackRendererUnit::render): (WebCore::AudioMediaStreamTrackRendererUnit::inputProc): * platform/mediastream/mac/AudioMediaStreamTrackRendererUnit.h: Copied from Source/WebCore/platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h. 2020-06-08 youenn fablet <youenn@apple.com> [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=206582 <rdar://problem/58985368> Reviewed by Eric Carlson. AVAssetWriterDelegate allows to grab recorded data whenever wanted. This delegate requires passing compressed samples to AVAssetWriter. Implement video encoding and audio encoding in dedicated classes and use these classes before adding buffers to AVAssetWriter. These classes are AudioSampleBufferCompressor and VideoSampleBufferCompressor. They support AAC and H264 so far and should be further improved to support more encoding options. Instantiate real writer only for platforms supporting AVAssetWriterDelegate, since it is not supported everywhere. The writer, doing the pacakging, is receiving compressed buffer from the audio/video compressors. It then sends data when being request to flush to its delegate, which will send data to the MediaRecorderPrivateWriter. The MediaRecorderPrivateWriter stores the data in a SharedBuffer until MediaRecorder asks for data. Note that, whenever we request data, we flush the writer and insert an end of video sample to make sure video data gets flushed. Therefore data should not be requested too fast to get adequate video compression. Covered by existing tests. * Modules/mediarecorder/MediaRecorderProvider.cpp: (WebCore::MediaRecorderProvider::createMediaRecorderPrivate): * WebCore.xcodeproj/project.pbxproj: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: Added. * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: Added. (WebCore::AudioSampleBufferCompressor::create): (WebCore::AudioSampleBufferCompressor::AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::initialize): (WebCore::AudioSampleBufferCompressor::finish): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): (WebCore::AudioSampleBufferCompressor::computeBufferSizeForAudioFormat): (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded): (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount): (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets): (WebCore::AudioSampleBufferCompressor::audioConverterComplexInputDataProc): (WebCore::AudioSampleBufferCompressor::provideSourceDataNumOutputPackets): (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime): (WebCore::AudioSampleBufferCompressor::processSampleBuffer): (WebCore::AudioSampleBufferCompressor::addSampleBuffer): (WebCore::AudioSampleBufferCompressor::getOutputSampleBuffer): (WebCore::AudioSampleBufferCompressor::takeOutputSampleBuffer): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (-[WebAVAssetWriterDelegate initWithWriter:]): (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedHeaderData:]): (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedMediaData:fragmentedMediaDataReport:]): (-[WebAVAssetWriterDelegate close]): (WebCore::MediaRecorderPrivateWriter::create): (WebCore::MediaRecorderPrivateWriter::compressedVideoOutputBufferCallback): (WebCore::MediaRecorderPrivateWriter::compressedAudioOutputBufferCallback): (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter): (WebCore::MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter): (WebCore::MediaRecorderPrivateWriter::initialize): (WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers): (WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers): (WebCore::MediaRecorderPrivateWriter::startAssetWriter): (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendCompressedSampleBuffers): (WebCore::appendEndsPreviousSampleDurationMarker): (WebCore::MediaRecorderPrivateWriter::appendEndOfVideoSampleDurationIfNeeded): (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers): (WebCore::MediaRecorderPrivateWriter::clear): (WebCore::copySampleBufferWithCurrentTimeStamp): (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): (WebCore::createAudioFormatDescription): (WebCore::createAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::stopRecording): (WebCore::MediaRecorderPrivateWriter::appendData): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: Copied from Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h. * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: Added. (WebCore::VideoSampleBufferCompressor::create): (WebCore::VideoSampleBufferCompressor::VideoSampleBufferCompressor): (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor): (WebCore::VideoSampleBufferCompressor::initialize): (WebCore::VideoSampleBufferCompressor::finish): (WebCore::VideoSampleBufferCompressor::videoCompressionCallback): (WebCore::VideoSampleBufferCompressor::initCompressionSession): (WebCore::VideoSampleBufferCompressor::processSampleBuffer): (WebCore::VideoSampleBufferCompressor::addSampleBuffer): (WebCore::VideoSampleBufferCompressor::getOutputSampleBuffer): (WebCore::VideoSampleBufferCompressor::takeOutputSampleBuffer): 2020-06-08 Youenn Fablet <youenn@apple.com> File URLs with hostnames are misleading https://bugs.webkit.org/show_bug.cgi?id=212739 <rdar://problem/63754917> Reviewed by Alex Christensen. Showing a file URL like file://example.org/test is misleading to users. To prevent this, we just do a redirection to the same file URL with an empty host. Remove the port at the same time. Covered by added API test. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::willSendRequest): 2020-06-08 Rob Buis <rbuis@igalia.com> Simplify fallback content handling in FrameLoader https://bugs.webkit.org/show_bug.cgi?id=212880 Reviewed by Youenn Fablet. Simplify fallback content handling in FrameLoader, this can be inlined and some HTMLObjectElement checks can be combined. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): * loader/FrameLoader.cpp: (WebCore::FrameLoader::receivedMainResourceError): (WebCore::FrameLoader::handleFallbackContent): Deleted. (WebCore::FrameLoader::isHostedByObjectElement const): Deleted. * loader/FrameLoader.h: * loader/HistoryController.cpp: (WebCore::FrameLoader::HistoryController::createItemTree): 2020-06-07 Zalan Bujtas <zalan@apple.com> [LFC][Height percentage] Skip anonymous wrappers when searching for fixed height https://bugs.webkit.org/show_bug.cgi?id=212881 Reviewed by Antti Koivisto. When the block level box is a direct child of an inline level box (<span><div></div></span>) and we wrap it into a continuation, the containing block (anonymous wrapper) is not the box we need to check for fixed height. Test: fast/layoutformattingcontext/height-precentage-with-anonymous-wrapper.html * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const): 2020-06-07 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Intrinsic width computation should take min/max-width into account. https://bugs.webkit.org/show_bug.cgi?id=212876 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/min-max-content-width-simple2.html * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedWidthValue): Address Sam's post-landing comment. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints): 2020-06-07 Zalan Bujtas <zalan@apple.com> [LFC] Pass in the element attributes to Layout::ReplacedBox https://bugs.webkit.org/show_bug.cgi?id=212879 Reviewed by Antti Koivisto. The information whether the replace box is an image box is required to see if the box has intrinsic ratio (used for sizing inflow replaced content). * layout/layouttree/LayoutReplacedBox.cpp: (WebCore::Layout::ReplacedBox::ReplacedBox): (): Deleted. * layout/layouttree/LayoutReplacedBox.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createReplacedBox): (WebCore::Layout::TreeBuilder::createLayoutBox): * layout/layouttree/LayoutTreeBuilder.h: 2020-06-07 Philippe Normand <pnormand@igalia.com> Remove ENABLE_VIDEO_TRACK ifdef guards https://bugs.webkit.org/show_bug.cgi?id=212568 Reviewed by Youenn Fablet. * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * Modules/mediacontrols/MediaControlsHost.cpp: * Modules/mediasource/AudioTrackMediaSource.h: * Modules/mediasource/AudioTrackMediaSource.idl: * Modules/mediasource/SourceBuffer.h: * Modules/mediasource/SourceBuffer.idl: * Modules/mediasource/TextTrackMediaSource.h: * Modules/mediasource/TextTrackMediaSource.idl: * Modules/mediasource/VideoTrackMediaSource.h: * Modules/mediasource/VideoTrackMediaSource.idl: * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp: (WebCore::HTMLVideoElementPictureInPicture::requestPictureInPicture): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSAudioTrackCustom.cpp: * bindings/js/JSAudioTrackListCustom.cpp: * bindings/js/JSTextTrackCueCustom.cpp: * bindings/js/JSTextTrackCustom.cpp: * bindings/js/JSTextTrackListCustom.cpp: * bindings/js/JSTrackCustom.cpp: * bindings/js/JSTrackCustom.h: * bindings/js/JSVideoTrackCustom.cpp: * bindings/js/JSVideoTrackListCustom.cpp: * css/CSSSelector.cpp: (WebCore::CSSSelector::pseudoId): (WebCore::CSSSelector::selectorText const): * css/CSSSelector.h: * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne const): * css/SelectorCheckerTestFunctions.h: (WebCore::matchesLangPseudoClass): * css/SelectorPseudoClassAndCompatibilityElementMap.in: * css/SelectorPseudoElementTypeMap.in: * css/parser/CSSParserSelector.h: (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching const): (WebCore::CSSParserSelector::isPseudoElementCueFunction const): * css/parser/CSSSelectorParser.cpp: (WebCore::CSSSelectorParser::consumePseudo): * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::addPseudoClassType): * dom/Document.cpp: * dom/Document.h: * dom/EventNames.in: * dom/EventTargetFactory.in: * dom/Node.h: * history/BackForwardCache.cpp: * history/BackForwardCache.h: * history/CachedPage.cpp: (WebCore::CachedPage::restore): (WebCore::CachedPage::clear): * history/CachedPage.h: * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::as const): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::~HTMLMediaElement): (WebCore::HTMLMediaElement::registerWithDocument): (WebCore::HTMLMediaElement::unregisterWithDocument): (WebCore::HTMLMediaElement::finishParsingChildren): (WebCore::HTMLMediaElement::prepareForLoad): (WebCore::HTMLMediaElement::selectMediaResource): (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const): (WebCore::HTMLMediaElement::setReadyState): (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded): (WebCore::HTMLMediaElement::playInternal): (WebCore::HTMLMediaElement::setVolume): (WebCore::HTMLMediaElement::playbackProgressTimerFired): (WebCore::HTMLMediaElement::configureTextTracks): (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): (WebCore::HTMLMediaElement::userCancelledLoad): (WebCore::HTMLMediaElement::clearMediaPlayer): (WebCore::HTMLMediaElement::syncTextTrackBounds): (WebCore::HTMLMediaElement::setVideoFullscreenStandby): (WebCore::HTMLMediaElement::setVideoFullscreenLayer): (WebCore::HTMLMediaElement::hasClosedCaptions const): (WebCore::HTMLMediaElement::setClosedCaptionsVisible): (WebCore::HTMLMediaElement::createMediaPlayer): (WebCore::HTMLMediaElement::bufferingPolicy const): * html/HTMLMediaElement.h: * html/HTMLMediaElement.idl: * html/HTMLTagNames.in: * html/HTMLTrackElement.cpp: * html/HTMLTrackElement.h: * html/HTMLTrackElement.idl: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texImageSourceHelper): (WebCore::WebGLRenderingContextBase::validateTexFuncParameters): * html/shadow/MediaControlTextTrackContainerElement.cpp: * html/shadow/MediaControlTextTrackContainerElement.h: * html/track/AudioTrack.cpp: * html/track/AudioTrack.h: * html/track/AudioTrack.idl: * html/track/AudioTrackList.cpp: * html/track/AudioTrackList.h: * html/track/AudioTrackList.idl: * html/track/DataCue.cpp: * html/track/DataCue.h: * html/track/DataCue.idl: * html/track/InbandDataTextTrack.cpp: * html/track/InbandDataTextTrack.h: * html/track/InbandGenericTextTrack.cpp: * html/track/InbandGenericTextTrack.h: * html/track/InbandTextTrack.cpp: * html/track/InbandTextTrack.h: * html/track/InbandWebVTTTextTrack.cpp: * html/track/InbandWebVTTTextTrack.h: * html/track/LoadableTextTrack.cpp: * html/track/LoadableTextTrack.h: * html/track/TextTrack.cpp: * html/track/TextTrack.h: * html/track/TextTrack.idl: * html/track/TextTrackCue.cpp: * html/track/TextTrackCue.h: * html/track/TextTrackCue.idl: * html/track/TextTrackCueGeneric.cpp: * html/track/TextTrackCueGeneric.h: * html/track/TextTrackCueGeneric.idl: * html/track/TextTrackCueList.cpp: * html/track/TextTrackCueList.h: * html/track/TextTrackCueList.idl: * html/track/TextTrackList.cpp: * html/track/TextTrackList.h: * html/track/TextTrackList.idl: * html/track/TrackBase.cpp: * html/track/TrackBase.h: * html/track/TrackEvent.cpp: * html/track/TrackEvent.h: * html/track/TrackEvent.idl: * html/track/TrackListBase.cpp: * html/track/TrackListBase.h: * html/track/VTTCue.cpp: * html/track/VTTCue.h: * html/track/VTTCue.idl: * html/track/VTTRegion.cpp: * html/track/VTTRegion.h: * html/track/VTTRegion.idl: * html/track/VTTRegionList.cpp: * html/track/VTTRegionList.h: * html/track/VTTRegionList.idl: * html/track/VideoTrack.cpp: * html/track/VideoTrack.h: * html/track/VideoTrack.idl: * html/track/VideoTrackList.cpp: * html/track/VideoTrackList.h: * html/track/VideoTrackList.idl: * html/track/WebVTTElement.cpp: * html/track/WebVTTElement.h: * html/track/WebVTTParser.cpp: * html/track/WebVTTParser.h: * html/track/WebVTTToken.h: * html/track/WebVTTTokenizer.cpp: * html/track/WebVTTTokenizer.h: * loader/LinkLoader.cpp: (WebCore::LinkLoader::resourceTypeFromAsAttribute): (WebCore::createLinkPreloadResourceClient): (WebCore::LinkLoader::isSupportedType): * loader/ResourceLoadInfo.cpp: (WebCore::ContentExtensions::toResourceType): * loader/SubresourceLoader.cpp: (WebCore::logResourceLoaded): * loader/TextTrackLoader.cpp: * loader/TextTrackLoader.h: * loader/cache/CachedResource.cpp: (WebCore::CachedResource::defaultPriorityForResourceType): * loader/cache/CachedResource.h: * loader/cache/CachedResourceLoader.cpp: (WebCore::createResource): (WebCore::contentTypeFromResourceType): (WebCore::CachedResourceLoader::checkInsecureContent const): (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const): (WebCore::destinationForType): * loader/cache/CachedResourceLoader.h: * loader/cache/CachedTextTrack.cpp: * loader/cache/CachedTextTrack.h: * page/CaptionUserPreferences.cpp: * page/CaptionUserPreferences.h: * page/CaptionUserPreferencesMediaAF.cpp: * page/CaptionUserPreferencesMediaAF.h: * page/Page.cpp: (WebCore::Page::setPageScaleFactor): (WebCore::Page::setUserInterfaceLayoutDirection): (WebCore::Page::doAfterUpdateRendering): (WebCore::Page::forEachMediaElement): * page/Page.h: * page/PageGroup.cpp: * page/PageGroup.h: * page/Settings.yaml: * platform/LocalizedStrings.cpp: * platform/LocalizedStrings.h: * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::isSupportedImageVideoOrSVGMIMEType): * platform/SerializedPlatformDataCue.cpp: * platform/graphics/AudioTrackPrivate.h: * platform/graphics/ImageDecoder.cpp: (WebCore::ImageDecoder::create): (WebCore::ImageDecoder::supportsMediaType): * platform/graphics/InbandGenericCue.cpp: * platform/graphics/InbandGenericCue.h: * platform/graphics/InbandTextTrackPrivate.h: * platform/graphics/InbandTextTrackPrivateClient.h: * platform/graphics/MediaPlayer.cpp: (WebCore::buildMediaEnginesVector): * platform/graphics/MediaPlayer.h: (WebCore::MediaPlayerClient::textTrackRepresentationBoundsChanged): * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::tracksChanged): * platform/graphics/TextTrackRepresentation.cpp: * platform/graphics/TextTrackRepresentation.h: * platform/graphics/TrackPrivateBase.cpp: * platform/graphics/TrackPrivateBase.h: * platform/graphics/VideoTrackPrivate.h: * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h: * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm: * platform/graphics/avfoundation/AudioTrackPrivateAVF.h: * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h: * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: * platform/graphics/avfoundation/VideoTrackPrivateAVF.h: * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm: * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp: * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp: * platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm: * platform/graphics/cocoa/TextTrackRepresentationCocoa.h: * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm: * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp: * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::initializeGStreamer): * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: * platform/graphics/gstreamer/ImageDecoderGStreamer.h: * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp: * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): (WebCore::MediaPlayerPrivateGStreamer::newTextSample): (WebCore::MediaPlayerPrivateGStreamer::updateTracks): (WebCore::MediaPlayerPrivateGStreamer::handleMessage): (WebCore::MediaPlayerPrivateGStreamer::purgeInvalidTextTracks): (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/TextCombinerGStreamer.cpp: * platform/graphics/gstreamer/TextCombinerGStreamer.h: * platform/graphics/gstreamer/TextSinkGStreamer.cpp: * platform/graphics/gstreamer/TextSinkGStreamer.h: * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp: * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: * platform/mac/SerializedPlatformDataCueMac.h: * platform/mac/SerializedPlatformDataCueMac.mm: * platform/mediastream/AudioMediaStreamTrackRenderer.cpp: * platform/mediastream/AudioMediaStreamTrackRenderer.h: * platform/mediastream/AudioTrackPrivateMediaStream.cpp: * platform/mediastream/AudioTrackPrivateMediaStream.h: * platform/mediastream/VideoTrackPrivateMediaStream.h: * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp: * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h: * rendering/RenderVTTCue.cpp: * rendering/RenderVTTCue.h: * style/ElementRuleCollector.cpp: (WebCore::Style::ElementRuleCollector::collectMatchingShadowPseudoElementRules): * style/PropertyCascade.cpp: (WebCore::Style::PropertyCascade::addMatch): * style/RuleData.cpp: (WebCore::Style::determinePropertyWhitelistType): * style/RuleData.h: * style/RuleSet.cpp: (WebCore::Style::RuleSet::addRule): (WebCore::Style::RuleSet::traverseRuleDatas): (WebCore::Style::RuleSet::hasShadowPseudoElementRules const): (WebCore::Style::RuleSet::shrinkToFit): * style/RuleSet.h: * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const): * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::setShouldDisplayTrackKind): (WebCore::InternalSettings::shouldDisplayTrackKind): * testing/InternalSettings.h: * testing/InternalSettings.idl: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::Internals): (WebCore::Internals::userPreferredAudioCharacteristics const): (WebCore::Internals::setUserPreferredAudioCharacteristic): (WebCore::Internals::captionsStyleSheetOverride): (WebCore::Internals::setCaptionsStyleSheetOverride): (WebCore::Internals::setPrimaryAudioTrackLanguageOverride): (WebCore::Internals::setCaptionDisplayMode): (WebCore::Internals::textTrackBCP47Language): (WebCore::Internals::getCurrentMediaControlsStatusForElement): * testing/Internals.h: * testing/Internals.idl: 2020-06-06 Yusuke Suzuki <ysuzuki@apple.com> Crash when running web-apis data collection https://bugs.webkit.org/show_bug.cgi?id=212458 Reviewed by Mark Lam. Test: js/dom/dom-attribute-getter-setter.html For properties using DOMAttribute property attribute in the table, code generator must use DOMAttributeGetterSetter instead of CustomGetterSetter. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjPrototype::finishCreation): 2020-06-06 Zalan Bujtas <zalan@apple.com> [LFC] Add support for width: min/max-content https://bugs.webkit.org/show_bug.cgi?id=212869 Reviewed by Antti Koivisto. Use the existing intrinsic width logic to compute min/max-content width. Test: fast/layoutformattingcontext/min-max-content-width-simple.html * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedWidthValue): (WebCore::Layout::FormattingContext::Geometry::computedWidth): (WebCore::Layout::FormattingContext::Geometry::fixedValue const): (WebCore::Layout::FormattingContext::Geometry::computedMinWidth): (WebCore::Layout::FormattingContext::Geometry::computedMaxWidth): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::computedWidth const): Deleted. (WebCore::Layout::FormattingContext::Geometry::computedMinWidth const): Deleted. (WebCore::Layout::FormattingContext::Geometry::computedMaxWidth const): Deleted. (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const): Deleted. (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin const): Deleted. (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const): Deleted. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin const): Deleted. * layout/tableformatting/TableFormattingContext.h: * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::computedColumnWidth): (WebCore::Layout::TableFormattingContext::Geometry::computedColumnWidth const): Deleted. 2020-06-06 Devin Rousso <drousso@apple.com> [ macOS wk2 ] inspector/page/setBootstrapScript-sub-frame.html is flaky failing https://bugs.webkit.org/show_bug.cgi?id=207053 <rdar://problem/59064908> Reviewed by Timothy Hatcher. Test: inspector/page/setBootstrapScript-sub-frame.html * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didCommitLoadImpl): Ensure the `InspectorPageAgent` sends the new `Page.Frame` payload to the frontend before the `PageRuntimeAgent` so that a `WI.Frame` exists before adding any `WI.ExecutionContext`. 2020-06-06 Jer Noble <jer.noble@apple.com> REGRESSION (r262364): Disney Plus crashes playing videos https://bugs.webkit.org/show_bug.cgi?id=212862 <rdar://problem/64044841> Reviewed by Eric Carlson. In r262364, we specified an incorrect number size for CFNumberGetValue, which nevertheless worked fine in debug builds, but overwrote stack data in release builds, leading to a crash when the returned pointer was ref()d. The correct size for a FourCharCode is a kCFNumberSInt32Type, not a kCFNumberLongType. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: 2020-06-06 David Kilzer <ddkilzer@apple.com> [IPC] Adopt enum class for GradientSpreadMethod <https://webkit.org/b/212868> <rdar://problem/64069035> Reviewed by Anders Carlsson. Summary: - Convert GradientSpreadMethod to an enum class. - Add WTF::EnumTraits<AutocapitalizeType> for IPC. - Remove use of decodeEnum() and encodeEnum(). * platform/graphics/Gradient.h: (WebCore::Gradient::encode const): (WebCore::Gradient::decode): * platform/graphics/GraphicsTypes.h: * platform/graphics/cairo/GradientCairo.cpp: (WebCore::Gradient::createPlatformGradient): * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::paint): * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::applyResource): 2020-06-06 Rob Buis <rbuis@igalia.com> Reduce includes for CustomHeaderFields https://bugs.webkit.org/show_bug.cgi?id=212691 Reviewed by Joseph Pecoraro. Reduce includes for CustomHeaderFields, I guess these were needed at some point but not anymore. * Modules/applepay/ApplePaySession.cpp: * Modules/applepay/PaymentSession.cpp: * bindings/js/ScriptController.cpp: * contentextensions/ContentExtensionsBackend.cpp: * dom/Document.cpp: * editing/cocoa/EditorCocoa.mm: * editing/cocoa/HTMLConverter.mm: * editing/cocoa/WebContentReaderCocoa.mm: * editing/markup.cpp: * history/CachedFrame.cpp: * html/HTMLDocument.cpp: * html/HTMLHtmlElement.cpp: * html/HTMLMediaElement.cpp: * html/ImageDocument.cpp: * html/MediaDocument.cpp: * html/PluginDocument.cpp: * html/parser/HTMLDocumentParser.cpp: * html/parser/XSSAuditor.cpp: * inspector/InspectorInstrumentation.cpp: * inspector/agents/InspectorApplicationCacheAgent.cpp: * inspector/agents/InspectorNetworkAgent.cpp: * inspector/agents/InspectorPageAgent.cpp: * inspector/agents/page/PageNetworkAgent.cpp: * loader/ApplicationManifestLoader.cpp: * loader/FrameLoader.cpp: * loader/LoadTiming.cpp: * loader/NetscapePlugInStreamLoader.cpp: * loader/ResourceLoader.cpp: * loader/SubresourceLoader.cpp: * loader/appcache/ApplicationCacheHost.cpp: * loader/archive/cf/LegacyWebArchive.cpp: * loader/icon/IconLoader.cpp: * page/ContextMenuController.cpp: * page/FrameView.cpp: * page/Page.cpp: * page/Performance.cpp: * page/PerformanceNavigation.cpp: * page/Quirks.cpp: * page/UserContentProvider.cpp: * page/csp/ContentSecurityPolicy.cpp: * page/mac/PageMac.mm: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: * svg/graphics/SVGImage.cpp: * testing/Internals.cpp: 2020-06-06 Andy Estes <aestes@apple.com> [Apple Pay] Add testing and logging for ApplePaySetup https://bugs.webkit.org/show_bug.cgi?id=211972 <rdar://problem/63291965> Reviewed by Alex Christensen. Test: http/tests/ssl/applepay/ApplePaySetup.https.html * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/applepay/ApplePaySetup.cpp: (WebCore::ApplePaySetup::getSetupFeatures): (WebCore::ApplePaySetup::begin): (WebCore::ApplePaySetup::ApplePaySetup): (WebCore::ApplePaySetup::stop): * Modules/applepay/ApplePaySetup.idl: * Modules/applepay/ApplePaySetupConfiguration.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl. * Modules/applepay/ApplePaySetupConfiguration.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl. * Modules/applepay/ApplePaySetupFeature.idl: * Modules/applepay/ApplePaySetupFeature.mm: (WebCore::ApplePaySetupFeature::state const): * Modules/applepay/ApplePaySetupFeatureState.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl. * Modules/applepay/ApplePaySetupFeatureState.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl. * Modules/applepay/ApplePaySetupFeatureType.idl: * Modules/applepay/ApplePaySetupFeatureWebCore.h: * Modules/applepay/ApplePaySetupWebCore.h: (WebCore::ApplePaySetup::create): * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::setApplePayIsActiveIfAllowed const): (WebCore::PaymentCoordinator::getSetupFeatures): (WebCore::PaymentCoordinator::beginApplePaySetup): (WebCore::PaymentCoordinator::endApplePaySetup): * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinatorClient.h: (WebCore::PaymentCoordinatorClient::getSetupFeatures): (WebCore::PaymentCoordinatorClient::beginApplePaySetup): * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * testing/MockApplePaySetupFeature.cpp: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h. (WebCore::MockApplePaySetupFeature::create): (WebCore::MockApplePaySetupFeature::MockApplePaySetupFeature): * testing/MockApplePaySetupFeature.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h. * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::addSetupFeature): (WebCore::MockPaymentCoordinator::getSetupFeatures): (WebCore::MockPaymentCoordinator::beginApplePaySetup): * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.idl: 2020-06-06 David Kilzer <ddkilzer@apple.com> Follow-up: Use OptionSet<DragOperation> for mask values <https://webkit.org/b/212605> <rdar://problem/64069091> * dom/DataTransfer.cpp: (WebCore::DataTransfer::destinationOperationMask const): - Don't compare to anyDragOperation(). Darin suggested this change during patch review, but this use was missed. 2020-06-06 David Kilzer <ddkilzer@apple.com> Use OptionSet<DragOperation> for mask values <https://webkit.org/b/212605> Reviewed by Darin Adler. In broad strokes: - Replace use of DragOperation with OptionSet<DragOperation> or Optional<DragOperation>. - Rename function parameters and local variables to denote use of mask values. - Remove DragOperationNone enum value. - Replace DragOperationEvery enum value with anyDragOperation(). * dom/DataTransfer.cpp: (WebCore::DataTransfer::createForDrop): (WebCore::DataTransfer::createForUpdatingDropTarget): (WebCore::dragOpFromIEOp): (WebCore::IEOpFromDragOp): (WebCore::DataTransfer::sourceOperation const): Rename. (WebCore::DataTransfer::sourceOperationMask const): (WebCore::DataTransfer::destinationOperation const): Rename. (WebCore::DataTransfer::destinationOperationMask const): (WebCore::DataTransfer::setSourceOperation): Rename. (WebCore::DataTransfer::setSourceOperationMask): (WebCore::DataTransfer::setDestinationOperation): Rename. (WebCore::DataTransfer::setDestinationOperationMask): * dom/DataTransfer.h: (WebCore::DataTransfer::createForDrop): (WebCore::DataTransfer::createForUpdatingDropTarget): (WebCore::DataTransfer::sourceOperation const): Rename. (WebCore::DataTransfer::sourceOperationMask const): (WebCore::DataTransfer::destinationOperation const): Rename. (WebCore::DataTransfer::destinationOperationMask const): (WebCore::DataTransfer::setSourceOperation): Rename. (WebCore::DataTransfer::setSourceOperationMask): (WebCore::DataTransfer::setDestinationOperation): Rename. (WebCore::DataTransfer::setDestinationOperationMask): * page/DragActions.h: (WebCore::anyDragOperation): Add. (WTF::EnumTraits<WebCore::DragOperation>): Add. (WTF::OptionSet<WebCore::DragOperation>): Add. * page/DragController.cpp: (WebCore::DragController::dragEntered): (WebCore::DragController::dragUpdated): (WebCore::DragController::performDragOperation): (WebCore::DragController::dragEnteredOrUpdated): (WebCore::DragController::tryDocumentDrag): (WebCore::DragController::operationForLoad): (WebCore::defaultOperationForDrag): (WebCore::DragController::tryDHTMLDrag): - Change logic to call defaultOperationForDrag() to convert targetResponse.operationMask to a single operation when targetResponse.operationMask but doesn't contain with any bit values set in sourceOperationMask. (WebCore::DragController::startDrag): * page/DragController.h: (WebCore::DragController::dragEntered): (WebCore::DragController::dragUpdated): (WebCore::DragController::sourceDragOperation const): Rename. (WebCore::DragController::sourceDragOperationMask const): (WebCore::DragController::startDrag): (WebCore::DragController::dragEnteredOrUpdated): (WebCore::DragController::operationForLoad): (WebCore::DragController::tryDocumentDrag): (WebCore::DragController::tryDHTMLDrag): (WebCore::DragController::dragOperation): * page/EventHandler.cpp: (WebCore::convertDropZoneOperationToDragOperation): (WebCore::convertDragOperationToDropZoneOperation): (WebCore::findDropZone): (WebCore::EventHandler::dispatchDragEnterOrDragOverEvent): (WebCore::EventHandler::updateDragAndDrop): (WebCore::EventHandler::cancelDragAndDrop): (WebCore::EventHandler::performDragAndDrop): (WebCore::EventHandler::dragSourceEndedAt): (WebCore::EventHandler::handleDrag): * page/EventHandler.h: (WebCore::EventHandler::updateDragAndDrop): (WebCore::EventHandler::cancelDragAndDrop): (WebCore::EventHandler::performDragAndDrop): (WebCore::EventHandler::dragSourceEndedAt): (WebCore::EventHandler::dispatchDragEnterOrDragOverEvent): * page/gtk/DragControllerGtk.cpp: (WebCore::DragController::dragOperation): * page/mac/DragControllerMac.mm: (WebCore::DragController::dragOperation): * page/win/DragControllerWin.cpp: (WebCore::DragController::dragOperation): - Clean up comment. * platform/DragData.cpp: (WebCore::DragData::DragData): * platform/DragData.h: (WebCore::DragData::DragData): (WebCore::DragData::draggingSourceOperationMask const): * platform/cocoa/DragDataCocoa.mm: (WebCore::DragData::DragData): * platform/gtk/GtkUtilities.cpp: (WebCore::gdkDragActionToDragOperation): (WebCore::dragOperationToGdkDragActions): (WebCore::dragOperationToSingleGdkDragAction): * platform/gtk/GtkUtilities.h: (WebCore::gdkDragActionToDragOperation): (WebCore::dragOperationToGdkDragActions): (WebCore::dragOperationToSingleGdkDragAction): * platform/win/DragDataWin.cpp: (WebCore::DragData::DragData): 2020-06-06 Zalan Bujtas <zalan@apple.com> [LFC] FormattingContext::Geometry::computedValue should not try to resolve values when layout is required https://bugs.webkit.org/show_bug.cgi?id=212867 Reviewed by Antti Koivisto. This is in preparation for adding min/max/fit-content support. * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedWidth const): (WebCore::Layout::FormattingContext::Geometry::computedValue const): (WebCore::Layout::FormattingContext::Geometry::computedMinWidth const): (WebCore::Layout::FormattingContext::Geometry::computedMaxWidth const): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const): (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const): (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin const): (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin const): (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto const): Deleted. * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin): 2020-06-06 Devin Rousso <drousso@apple.com> Web Inspector: unify the naming scheme for agents used by instrumentation https://bugs.webkit.org/show_bug.cgi?id=212859 Reviewed by Timothy Hatcher. Inspector agents fall into one of three categories: - "persistent" when Web Inspector is connected - "enabled" when that agent is `enable`d, such as if the corresponding tab is visible - "tracking" when that agent is part of a timeline recording. The only exception to this is the Console agent, as that exists regardless of whether Web Inspector is connected as it needs to preserve messages logged before Web Inspector connects. Also remove the "Inspector" prefix from getter/setter methods as it adds confusion if that agent also has subclasses (e.g. `InspectorRuntimeAgent` and `PageRuntimeAgent`). * inspector/InstrumentingAgents.h: * inspector/InstrumentingAgents.cpp: Use macros to simplify the process of adding an agent. * inspector/CommandLineAPIHost.cpp: * inspector/InspectorController.h: * inspector/InspectorController.cpp: * inspector/InspectorInstrumentation.cpp: * inspector/agents/InspectorAnimationAgent.cpp: * inspector/agents/InspectorApplicationCacheAgent.cpp: * inspector/agents/InspectorCPUProfilerAgent.cpp: * inspector/agents/InspectorCSSAgent.cpp: * inspector/agents/InspectorCanvasAgent.cpp: * inspector/agents/InspectorDOMAgent.cpp: * inspector/agents/InspectorDOMDebuggerAgent.cpp: * inspector/agents/InspectorDOMStorageAgent.cpp: * inspector/agents/InspectorDatabaseAgent.cpp: * inspector/agents/InspectorLayerTreeAgent.cpp: * inspector/agents/InspectorMemoryAgent.cpp: * inspector/agents/InspectorNetworkAgent.cpp: * inspector/agents/InspectorPageAgent.cpp: * inspector/agents/InspectorTimelineAgent.cpp: * inspector/agents/InspectorWorkerAgent.cpp: * inspector/agents/WebDebuggerAgent.cpp: * inspector/agents/WebHeapAgent.cpp: * inspector/agents/page/PageConsoleAgent.cpp: * inspector/agents/page/PageDOMDebuggerAgent.cpp: * inspector/agents/page/PageDebuggerAgent.cpp: * inspector/agents/page/PageHeapAgent.cpp: * inspector/agents/page/PageNetworkAgent.cpp: * inspector/agents/page/PageRuntimeAgent.cpp: Simple naming changes elided to avoid a long ChangeLog. 2020-06-05 Andy Estes <aestes@apple.com> REGRESSION (r256648): Apple Pay <button> elements no longer use the default corner radius on iOS (affects Stripe.js) https://bugs.webkit.org/show_bug.cgi?id=212860 <rdar://problem/64054728> Reviewed by Wenson Hsieh. As part of drawing iOS native form controls, RenderThemeIOS applies a round border to un-styled <button> elements in RenderThemeIOS::adjustRoundBorderRadius. Prior to r256648, this adjusted border radius would be ignored by RenderThemeCocoa::paintApplePayButton when painting <button> elements with the ApplePayButtonPart appearance, but now it's respected. Apple Pay <button>s with default width and height previously had a 4px corner radius but now have a 15px corner radius. Fixed the issue by skipping RenderThemeIOS::adjustRoundBorderRadius for elements with the ApplePayButtonPart appearance so that the correct border radius adjustment can be made by RenderThemeCocoa::adjustApplePayButtonStyle. Four existing tests were skipped on iOS that would have caught this; un-skipped them. Un-skipped tests: fast/css/appearance-apple-pay-button.html fast/css/appearance-apple-pay-button-border-radius.html fast/css/appearance-apple-pay-button-default-corners.html fast/css/getComputedStyle/computed-style-apple-pay-button.html * rendering/RenderThemeIOS.mm: (WebCore::canAdjustBorderRadiusForAppearance): Added a helper to check if border radius can be adjusted for a given ControlPart. Added ApplePayButtonPart to the list of appearances where border radius cannot be adjusted. (WebCore::RenderThemeIOS::adjustRoundBorderRadius): Changed to call canAdjustBorderRadiusForAppearance. 2020-06-05 Peng Liu <peng.liu6@apple.com> HTMLMediaElement::m_waitingToEnterFullscreen is not initialized in the constructor https://bugs.webkit.org/show_bug.cgi?id=212861 Reviewed by Jer Noble. Covered by existing tests. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): 2020-06-05 David Kilzer <ddkilzer@apple.com> [IPC] Adopt enum class for AutocapitalizeType <https://webkit.org/b/212846> <rdar://problem/64042825> Reviewed by Darin Adler. Summary: - Move AutocapitalizeType into WebCore namespace. - Convert AutocapitalizeType to an enum class. - Add WTF::EnumTraits<AutocapitalizeType> for IPC. * html/Autocapitalize.cpp: (WebCore::autocapitalizeTypeForAttributeValue): (WebCore::stringForAutocapitalizeType): * html/AutocapitalizeTypes.h: * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::autocapitalizeType const): 2020-06-05 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r262619, r262625, and r262641. Caused mediarecorder layout test crashes. Reverted changesets: "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder" https://bugs.webkit.org/show_bug.cgi?id=206582 https://trac.webkit.org/changeset/262619 "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder" https://bugs.webkit.org/show_bug.cgi?id=206582 https://trac.webkit.org/changeset/262625 "Unreviewed, silence deprecation warning to fix build with latest SDK." https://trac.webkit.org/changeset/262641 2020-06-05 Kate Cheney <katherine_cheney@apple.com> ITP SQLite Database should only vacuum once per day https://bugs.webkit.org/show_bug.cgi?id=212712 <rdar://problem/63939711> Reviewed by Brent Fulgham. Add WEBCORE_EXPORT macro to function needed in WebKit. * platform/sql/SQLiteDatabase.h: 2020-06-05 Sam Weinig <weinig@apple.com> Some tests in css/css-color/parsing/system-color-valid.html are failing https://bugs.webkit.org/show_bug.cgi?id=212703 Reviewed by Darin Adler. Add support for the following system color keywords, added in CSS Color 4 (https://www.w3.org/TR/css-color-4/#css-system-colors): ActiveText (Text in active links) Implemented identically to -webkit-activelink Canvas (Background of application content or documents) [NSColor textBackgroundColor] on macOS, Color::white by default. CanvasText (Text in application content or documents) [NSColor textBackgroundColor] on macOS, Color::black by default. Field [NSColor controlColor] on macOS, Color::white by default. FieldText [NSColor controlTextColor] on macOS, Color::black by default. LinkText [NSColor linkColor] on macOS (when UseSystemAppearance is true), same as -webkit-link (non-visited) by default. VisitedText [NSColor systemPurpleColor] on macOS (when UseSystemAppearance is true), same as -webkit-link (visited) by default. * css/CSSValueKeywords.in: * platform/ThemeTypes.cpp: (WebCore::operator<<): * platform/ThemeTypes.h: * rendering/RenderTheme.cpp: (WebCore::RenderTheme::systemColor const): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::systemColor const): 2020-06-05 Jason Lawrence <lawrence.j@apple.com> Unreviewed, reverting r262524. Reverting because this commit may have caused issues with other tests. Reverted changeset: "Release Assert @ WebCore::RenderTreeBuilder::RenderTreeBuilder" https://bugs.webkit.org/show_bug.cgi?id=212714 https://trac.webkit.org/changeset/262524 2020-06-05 Jonathan Bedard <jbedard@apple.com> WebCore: Link to framework stubs for watchOS and tvOS https://bugs.webkit.org/show_bug.cgi?id=212834 <rdar://problem/64033712> Reviewed by Tim Horton. No new tests, no behavior changed. * Configurations/Base.xcconfig: Ignore 64 to 32 bit conversion errors for watchOS simulators, add tvOS and watchOS major version macros. * Configurations/WebCore.xcconfig: Link to framework stubs for watchOS and tvOS. 2020-06-05 David Kilzer <ddkilzer@apple.com> [IPC] Adopt enum class for PluginLoadClientPolicy <https://webkit.org/b/212827> <rdar://problem/64030431> Reviewed by Alex Christensen. * plugins/PluginData.h: (WebCore::PluginLoadClientPolicy): - Make this an enum class. (WTF::EnumTraits<WebCore::PluginLoadClientPolicy>): - Add for use with strongly-typed IPC parameters. 2020-06-05 Wenson Hsieh <wenson_hsieh@apple.com> Text manipulation should exclude characters outside of the unicode private use area https://bugs.webkit.org/show_bug.cgi?id=212800 <rdar://problem/63736417> Reviewed by Sihui Liu. Consider characters that fall outside of unicode PUA (in addition to line breaks) as excluded when extracting tokens during text manipulation. In doing this, we also rename a few member variables in `ManipulationUnit` to refer to "token delimiters" rather than line breaks. Test: TextManipulation.StartTextManipulationExtractsPrivateUseCharactersAsExcludedTokens * editing/TextManipulationController.cpp: (WebCore::isInPrivateUseArea): (WebCore::isTokenDelimiter): (WebCore::TextManipulationController::parse): (WebCore::TextManipulationController::observeParagraphs): * editing/TextManipulationController.h: 2020-06-05 Dean Jackson <dino@apple.com> REGRESSION (r262366): [ Mac wk1 ] webgl/webgl-backing-store-size-update.html is failing https://bugs.webkit.org/show_bug.cgi?id=212647 <rdar://problem/63882960> Reviewed by Eric Carlson. In some unusual cases, specifically WebKit 1, a WebGLLayer could prepareForDisplay but never get told to actually display, producing incorrect results. Fix this by simply calling setNeedsDisplay. While here, address some comments from Simon Fraser that were made after r262366. * dom/Document.cpp: (WebCore::Document::prepareCanvasesForDisplayIfNeeded): * platform/graphics/cocoa/WebGLLayer.h: Move the instance variables into the implementation file since they are not exposed as an interface. * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer initWithGraphicsContextGL:]): (-[WebGLLayer prepareForDisplay]): (-[WebGLLayer display]): 2020-06-05 Chris Dumez <cdumez@apple.com> Unreviewed, silence deprecation warning to fix build with latest SDK. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::stopRecording): 2020-06-05 Andres Gonzalez <andresg_22@apple.com> Accessibility isolated tree mode: crashes when navigating websites, com.apple.AppKit: ConvertOutgoingValueForAttribute. https://bugs.webkit.org/show_bug.cgi?id=212829 <rdar://problem/63756267> Reviewed by Chris Fleizach. - [WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions] must retrieve an autoreleased id from the main thread. - [WebAccessibilityObjectWrapper textMarkerRangeForSelection] must also retrieve an autoreleased id from the main thread. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]): (-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): 2020-06-05 Jonathan Bedard <jbedard@apple.com> WebCore: Guard variable declarations on ENABLE(VIDEO_PRESENTATION_MODE) https://bugs.webkit.org/show_bug.cgi?id=212831 <rdar://problem/64033028> Reviewed by Tim Horton. No new tests, no behavior changed. * html/HTMLVideoElement.h: 2020-06-05 Peng Liu <peng.liu6@apple.com> Fix a tvOS build failure https://bugs.webkit.org/show_bug.cgi?id=212833 Reviewed by Jer Noble. * platform/cocoa/PlaybackSessionModelMediaElement.mm: (WebCore::PlaybackSessionModelMediaElement::togglePictureInPicture): 2020-06-05 Yusuke Suzuki <ysuzuki@apple.com> DOM constructor should only accept Ref<> / ExceptionOr<Ref<>> for creation to ensure toJSNewlyCreated is always returning object https://bugs.webkit.org/show_bug.cgi?id=212767 Reviewed by Darin Adler. When using toJSNewlyCreated in DOM constructor, we should ensure that this only returns JSObject* (if exception is not happening) to avoid `isObject()` check after that. However AudioContext and ImageData is not following this and can return nullptr from `create` factory function. We should not allow this. In this patch, 1. AudioContext should throw an error instead of returning null. AudioContext had a limit derived from OS, but this limit is reasonable only in Windows. We should insert `OS(WINDOWS)` around this check, and throw an error instead of returning null. 2. ImageData::create can return nullptr potentially, and it can be converted to null. This is not acceptable for DOM constructor. We should throw an error if we failed to create ImageData. 3. We inserted static_asserts in CodeGeneratorJS.pm to ensure that XXX::create only returns Ref<> or ExceptionOr<Ref<>>. This ensures that toJSNewlyCreated will return JSObject*. This patch is relanding of the completely same patch since internal build is fixed. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::create): * Modules/webaudio/AudioContext.h: * Modules/webaudio/AudioContext.idl: * bindings/scripts/CodeGeneratorJS.pm: (GenerateConstructorDefinition): * bindings/scripts/test/JS/JSTestEventConstructor.cpp: (WebCore::JSTestEventConstructorConstructor::construct): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::construct): * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: (WebCore::JSTestNamedConstructorNamedConstructor::construct): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::JSTestNodeConstructor::construct): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::construct): * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: (WebCore::constructJSTestOverloadedConstructors1): (WebCore::constructJSTestOverloadedConstructors2): (WebCore::constructJSTestOverloadedConstructors3): (WebCore::constructJSTestOverloadedConstructors4): (WebCore::constructJSTestOverloadedConstructors5): * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: (WebCore::constructJSTestOverloadedConstructorsWithSequence1): (WebCore::constructJSTestOverloadedConstructorsWithSequence2): * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: (WebCore::JSTestPromiseRejectionEventConstructor::construct): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::JSTestTypedefsConstructor::construct): * dom/ExceptionOr.h: * html/ImageData.cpp: (WebCore::ImageData::create): * html/ImageData.h: * testing/Internals.cpp: (WebCore::Internals::videoSampleAvailable): 2020-06-05 Tyler Wilcock <twilco.o@protonmail.com> CSS Variables: Color on specific `border` properties does not work. https://bugs.webkit.org/show_bug.cgi?id=211672 Reviewed by Antti Koivisto. Properly mark CSSPropertyBorderBlockStart, CSSPropertyBorderBlockEnd, CSSPropertyBorderInlineStart, and CSSPropertyBorderInlineEnd as direction-aware properties in CSSProperty::isDirectionAwareProperty. Also reordered a few properties in this switch so it's more alphabetically ordered. Prior to this change, CSS variables were not able to be resolved when used in these properties. Test: fast/borders/logical-border-props-with-variables.html * css/CSSProperty.cpp: (WebCore::CSSProperty::isDirectionAwareProperty): Add CSSPropertyBorderBlockStart, CSSPropertyBorderBlockEnd, CSSPropertyBorderInlineStart, CSSPropertyBorderInlineEnd. 2020-06-05 Andres Gonzalez <andresg_22@apple.com> AXIsolatedTree::updateChildren should not call nodeForID. https://bugs.webkit.org/show_bug.cgi?id=212794 Reviewed by Chris Fleizach. AXIsolatedTree::updateChildren is executed on the main thread and therfore should not call nodeForID. Since it requires the children IDs for the isolated object whose children are being updated, we need to store those children IDs outside the isolated object. For this reason we added the m_nodeMap member variable which will maintain a map between object ID and its children IDs. In addition, since retrieving the root node happens very often and required also a call to nodeForID, we now store a pointer to the root node instead of its ID, so there is no need to look it up in the reading map. * accessibility/AXLogger.cpp: (WebCore::operator<<): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::setChildrenIDs): (WebCore::AXIsolatedObject::appendChild): Renamed setChildrenIDs. * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::clear): (WebCore::AXIsolatedTree::create): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::applyPendingChanges): (WebCore::AXIsolatedTree::nodeInTreeForID): Deleted, not used. (WebCore::AXIsolatedTree::setRootNodeID): Renamed setRootNode. * accessibility/isolatedtree/AXIsolatedTree.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase attachIsolatedObject:]): 2020-06-05 Youenn Fablet <youenn@apple.com> [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=206582 <rdar://problem/58985368> Unreviewed. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::initialize): Allow deprecation warnings. 2020-06-05 Michael Catanzaro <mcatanzaro@gnome.org> Unreviewed, fix unused parameter warnings in EventRegion.cpp and RenderLayerBacking.cpp https://bugs.webkit.org/show_bug.cgi?id=212823 * rendering/EventRegion.cpp: (WebCore::EventRegion::unite): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintDebugOverlays): 2020-06-05 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes, early summer 2020 edition https://bugs.webkit.org/show_bug.cgi?id=212819 Unreviewed build fix. No new tests needed. * animation/ElementAnimationRareData.cpp: Add missing RenderStyle.h header. * animation/ElementAnimationRareData.h: Add forward declaration for RenderStyle. * editing/TextManipulationController.cpp: Sprinkle missing HTMLNames:: prefixes. (WebCore::shouldExtractValueForTextManipulation): (WebCore::TextManipulationController::observeParagraphs): (WebCore::makePositionTuple): (WebCore::TextManipulationController::replace): * platform/graphics/SimpleColor.h: Add missing ColorComponents.h and wtf/text/WTFString.h headers. * workers/service/context/ServiceWorkerThread.cpp: Add missing Logging.h header. 2020-06-05 Andy Estes <aestes@apple.com> [Apple Pay] Remove conditionals for ENABLE_APPLE_PAY_SESSION_V(3|4) https://bugs.webkit.org/show_bug.cgi?id=212541 <rdar://problem/63781452> Reviewed by Darin Adler. APPLE_PAY_SESSION_V(3|4) is now enabled whenever APPLE_PAY itself is enabled. * Configurations/FeatureDefines.xcconfig: * Modules/applepay/ApplePayError.idl: * Modules/applepay/ApplePayPaymentAuthorizationResult.idl: * Modules/applepay/ApplePayPaymentContact.idl: * Modules/applepay/ApplePayPaymentMethodUpdate.idl: * Modules/applepay/ApplePayRequestBase.idl: * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePayShippingContactUpdate.idl: * Modules/applepay/ApplePayShippingMethodUpdate.idl: * Modules/applepay/PaymentCoordinatorClient.cpp: (WebCore::PaymentCoordinatorClient::supportsVersion): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::computePaymentMethodErrors const): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::applePayButtonDescription const): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const): * css/CSSValueKeywords.in: * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): * rendering/RenderThemeCocoa.mm: (WebCore::toPKPaymentButtonType): * rendering/style/RenderStyleConstants.cpp: (WebCore::operator<<): * rendering/style/RenderStyleConstants.h: 2020-06-05 youenn fablet <youenn@apple.com> [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=206582 <rdar://problem/58985368> Reviewed by Eric Carlson. AVAssetWriterDelegate allows to grab recorded data whenever wanted. This delegate requires passing compressed samples to AVAssetWriter. Implement video encoding and audio encoding in dedicated classes and use these classes before adding buffers to AVAssetWriter. These classes are AudioSampleBufferCompressor and VideoSampleBufferCompressor. They support AAC and H264 so far and should be further improved to support more encoding options. Instantiate real writer only for platforms supporting AVAssetWriterDelegate, since it is not supported everywhere. The writer, doing the pacakging, is receiving compressed buffer from the audio/video compressors. It then sends data when being request to flush to its delegate, which will send data to the MediaRecorderPrivateWriter. The MediaRecorderPrivateWriter stores the data in a SharedBuffer until MediaRecorder asks for data. Note that, whenever we request data, we flush the writer and insert an end of video sample to make sure video data gets flushed. Therefore data should not be requested too fast to get adequate video compression. Covered by existing tests. * Modules/mediarecorder/MediaRecorderProvider.cpp: (WebCore::MediaRecorderProvider::createMediaRecorderPrivate): * WebCore.xcodeproj/project.pbxproj: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h: Added. * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm: Added. (WebCore::AudioSampleBufferCompressor::create): (WebCore::AudioSampleBufferCompressor::AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor): (WebCore::AudioSampleBufferCompressor::initialize): (WebCore::AudioSampleBufferCompressor::finish): (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription): (WebCore::AudioSampleBufferCompressor::computeBufferSizeForAudioFormat): (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded): (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount): (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets): (WebCore::AudioSampleBufferCompressor::audioConverterComplexInputDataProc): (WebCore::AudioSampleBufferCompressor::provideSourceDataNumOutputPackets): (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime): (WebCore::AudioSampleBufferCompressor::processSampleBuffer): (WebCore::AudioSampleBufferCompressor::addSampleBuffer): (WebCore::AudioSampleBufferCompressor::getOutputSampleBuffer): (WebCore::AudioSampleBufferCompressor::takeOutputSampleBuffer): * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (-[WebAVAssetWriterDelegate initWithWriter:]): (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedHeaderData:]): (-[WebAVAssetWriterDelegate assetWriter:didProduceFragmentedMediaData:fragmentedMediaDataReport:]): (-[WebAVAssetWriterDelegate close]): (WebCore::MediaRecorderPrivateWriter::create): (WebCore::MediaRecorderPrivateWriter::compressedVideoOutputBufferCallback): (WebCore::MediaRecorderPrivateWriter::compressedAudioOutputBufferCallback): (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter): (WebCore::MediaRecorderPrivateWriter::~MediaRecorderPrivateWriter): (WebCore::MediaRecorderPrivateWriter::initialize): (WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers): (WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers): (WebCore::MediaRecorderPrivateWriter::startAssetWriter): (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendCompressedSampleBuffers): (WebCore::appendEndsPreviousSampleDurationMarker): (WebCore::MediaRecorderPrivateWriter::appendEndOfVideoSampleDurationIfNeeded): (WebCore::MediaRecorderPrivateWriter::flushCompressedSampleBuffers): (WebCore::MediaRecorderPrivateWriter::clear): (WebCore::copySampleBufferWithCurrentTimeStamp): (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): (WebCore::createAudioFormatDescription): (WebCore::createAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::stopRecording): (WebCore::MediaRecorderPrivateWriter::appendData): * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h: Copied from Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h. * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm: Added. (WebCore::VideoSampleBufferCompressor::create): (WebCore::VideoSampleBufferCompressor::VideoSampleBufferCompressor): (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor): (WebCore::VideoSampleBufferCompressor::initialize): (WebCore::VideoSampleBufferCompressor::finish): (WebCore::VideoSampleBufferCompressor::videoCompressionCallback): (WebCore::VideoSampleBufferCompressor::initCompressionSession): (WebCore::VideoSampleBufferCompressor::processSampleBuffer): (WebCore::VideoSampleBufferCompressor::addSampleBuffer): (WebCore::VideoSampleBufferCompressor::getOutputSampleBuffer): (WebCore::VideoSampleBufferCompressor::takeOutputSampleBuffer): 2020-06-05 Antti Koivisto <antti@apple.com> REGRESSION (r253875?): Element styles incorrect after media query evaluation changes https://bugs.webkit.org/show_bug.cgi?id=211505 <rdar://problem/62983242> Reviewed by Zalan Bujtas. If there are keyframe rules in media queries we fall back to wiping the style resolver when something changes. This fallback code didn't work correctly when a rule flipped from matching to non-matching because MediaQueryCollector bailed out and didn't create DynamicMediaQueryRules structure needed to detect something has changed. Test: fast/media/media-query-dynamic-with-keyframes.html * style/RuleSet.cpp: (WebCore::Style::RuleSet::addChildRules): (WebCore::Style::RuleSet::addRulesFromSheet): Call both push and pop even when the rule doesn't match. (WebCore::Style::RuleSet::MediaQueryCollector::pushAndEvaluate): Collect the MediaQuerySet in non-matching case too. (WebCore::Style::RuleSet::MediaQueryCollector::pop): Record the DynamicMediaQueryRules when resolving all rules statically. 2020-06-05 Youenn Fablet <youenn@apple.com> Ad support for media-source stats https://bugs.webkit.org/show_bug.cgi?id=212702 Reviewed by Eric Carlson. Expose 'media-source' stats which come in audio and video flavours. Covered by updated test. * Modules/mediastream/RTCStatsReport.h: (WebCore::RTCStatsReport::AudioSourceStats::AudioSourceStats): (WebCore::RTCStatsReport::VideoSourceStats::VideoSourceStats): * Modules/mediastream/RTCStatsReport.idl: * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::fillRTCRTPStreamStats): (WebCore::fillRTCMediaSourceStats): (WebCore::fillRTCAudioSourceStats): (WebCore::fillRTCVideoSourceStats): (WebCore::initializeRTCStatsReportBackingMap): 2020-06-04 Sihui Liu <sihui_liu@apple.com> Text manipulation: first and last unit in a paragraph should not contain only excluded tokens https://bugs.webkit.org/show_bug.cgi?id=212759 Reviewed by Wenson Hsieh. In r262398, we literally made text of one Node as the minimum unit for text manipulation. This patches introduce a struct ManipulationUnit for that. Now a paragraph can be represented as multiple ManipulationUnits. When all tokens in a ManipulationUnit are excluded, it means the ManipulationUnit is excluded and should not be manipulated. To record ManipulationUnits in a paragraph based on our current implementation, we need to keep the excluded ManipulationUnits surrounded by non-excluded ManipulationUnits, but we can safely remove the leading and trailing excluded ManipulationUnits. In this case, we can limit the range of paragraph further and thus less text replacement work. Covered by existing test. * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::parse): (WebCore::TextManipulationController::addItemIfPossible): (WebCore::TextManipulationController::observeParagraphs): * editing/TextManipulationController.h: 2020-06-04 Peng Liu <peng.liu6@apple.com> A YouTube video gets stuck after rapidly tapping on touchbar’s PIP button https://bugs.webkit.org/show_bug.cgi?id=212729 Reviewed by Darin Adler. Call HTMLVideoElement::setFullscreenMode() instead of HTMLMediaElement::enterFullscreen() and HTMLMediaElement::exitFullscreen() to toggle picture-in-picture mode. HTMLVideoElement::setFullscreenMode() is robust under stress test after r262456. Manually tested. * platform/cocoa/PlaybackSessionModelMediaElement.mm: (WebCore::PlaybackSessionModelMediaElement::togglePictureInPicture): 2020-06-04 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r262583. https://bugs.webkit.org/show_bug.cgi?id=212799 Internal source code has the same bug, needs to be landed after fixing internal source Reverted changeset: "DOM constructor should only accept Ref<> / ExceptionOr<Ref<>> for creation to ensure toJSNewlyCreated is always returning object" https://bugs.webkit.org/show_bug.cgi?id=212767 https://trac.webkit.org/changeset/262583 2020-06-04 Zalan Bujtas <zalan@apple.com> HTMLAppletElement::updateWidget should check for renderer after the overlapping test. https://bugs.webkit.org/show_bug.cgi?id=212789 <rdar://problem/61854614> Reviewed by Simon Fraser. createJavaAppletWidget needs to check if the plugin(replacement) is obscured. Since the overlapping test requires up-to-date geometry, it initiates a top level style recalc/layout. We need to check if the apple element still has a renderer after the style recalc. * html/HTMLAppletElement.cpp: (WebCore::HTMLAppletElement::updateWidget): 2020-06-04 Jack Lee <shihchieh_lee@apple.com> Nullptr crash in DeleteSelectionCommand::doApply() when ending position is disconnected. https://bugs.webkit.org/show_bug.cgi?id=212723 <rdar://problem/63866653> Reviewed by Geoffrey Garen. In this test case, while merging paragraphs after deleting a text element, we need call removeNodeAndPruneAncestors() to remove a BR node. However, the ancestor of BR is also removed. Later we try to insert a node at the parent of the removed ancestor in function DeleteSelectionCommand::doApply(). For now we just check the parentless inserting position and bail out. The proper fix should be re-designing removeNodeAndPruneAncestors() or select a different inserting position after removeNodeAndPruneAncestors() is called. Test: editing/deleting/delete-txt-in-dl-crash.html * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::doApply): 2020-06-04 Ross Kirsling <ross.kirsling@sony.com> [PlayStation] Unreviewed revert of build fix. Missing include was not the cause. * platform/graphics/ColorUtilities.cpp: 2020-06-04 Sihui Liu <sihui_liu@apple.com> REGRESSION:(r262398) Text manipulation crashes when content is added https://bugs.webkit.org/show_bug.cgi?id=212785 Reviewed by Ryosuke Niwa. r262398 accidentally removed the bound check on array index and was not caught by existing tests. Test: TextManipulation.CompleteTextManipulationFailWhenContentIsAdded * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::replace): 2020-06-04 Ross Kirsling <ross.kirsling@sony.com> [PlayStation] Unreviewed build fix following r262352. * platform/graphics/ColorUtilities.cpp: 2020-06-04 Yusuke Suzuki <ysuzuki@apple.com> DOM constructor should only accept Ref<> / ExceptionOr<Ref<>> for creation to ensure toJSNewlyCreated is always returning object https://bugs.webkit.org/show_bug.cgi?id=212767 Reviewed by Darin Adler. When using toJSNewlyCreated in DOM constructor, we should ensure that this only returns JSObject* (if exception is not happening) to avoid `isObject()` check after that. However AudioContext and ImageData is not following this and can return nullptr from `create` factory function. We should not allow this. In this patch, 1. AudioContext should throw an error instead of returning null. AudioContext had a limit derived from OS, but this limit is reasonable only in Windows. We should insert `OS(WINDOWS)` around this check, and throw an error instead of returning null. 2. ImageData::create can return nullptr potentially, and it can be converted to null. This is not acceptable for DOM constructor. We should throw an error if we failed to create ImageData. 3. We inserted static_asserts in CodeGeneratorJS.pm to ensure that XXX::create only returns Ref<> or ExceptionOr<Ref<>>. This ensures that toJSNewlyCreated will return JSObject*. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::create): * Modules/webaudio/AudioContext.h: * Modules/webaudio/AudioContext.idl: * bindings/scripts/CodeGeneratorJS.pm: (GenerateConstructorDefinition): * dom/ExceptionOr.h: * html/ImageData.cpp: (WebCore::ImageData::create): * html/ImageData.h: * testing/Internals.cpp: (WebCore::Internals::videoSampleAvailable): 2020-06-04 Kate Cheney <katherine_cheney@apple.com> REGRESSION (r262212): [ iOS Debug wk2 ] ASSERTION FAILED: !isSynchronous() || !m_synchronousLoadData->delayedReply in WebKit::NetworkResourceLoader https://bugs.webkit.org/show_bug.cgi?id=212678 <rdar://problem/63797758> Reviewed by Chris Dumez. No new tests, this will fix http/tests/xmlhttprequest/access-control-preflight-credential-sync.html. Refactor the bundle identifier setters and getters in RuntimeApplicationChecksCocoa.mm so that a separate function sets an override bundle identifier, and clearing the override identifier does not clear the UI process bundle identifier as well. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::bundleIdentifierOverride): (WebCore::bundleIdentifier): (WebCore::applicationBundleIdentifier): (WebCore::setApplicationBundleIdentifier): (WebCore::setApplicationBundleIdentifierOverride): (WebCore::clearApplicationBundleIdentifierTestingOverride): (WebCore::applicationBundleIdentifierOverride): Deleted. 2020-06-04 Yusuke Suzuki <ysuzuki@apple.com> MessageEvent should tell its memory cost to GC https://bugs.webkit.org/show_bug.cgi?id=203990 Reviewed by Mark Lam. This patch fixes two issues to make MessageEvent's memoryCost working. 1. MessageEvent does not have memoryCost function. So even if ArrayBuffer etc. is held as a SerializedScriptValue, it does not communicate memory pressure to GC. This patch adds ReportExtraMemoryCost to MessageEvent.idl and memoryCost function to MessageEvent. And we implement SerializedScriptValue::memoryCost function to obtain rough memory cost for SerializedScriptValue. 2. IDL code generator puts `reportExtraMemoryAllocated` function call in `toJSNewlyCreated`. However, `toJSNewlyCreated` is not always used when creating JS wrapper. For example, JSMessageEvent can be created from toJSNewlyCreated for MessageEvent. But it can be also be created from toJSNewlyCreated for Event through EventFactory. If the latter path is taken, we won't properly report memory cost even if IDL has ReportExtraMemoryCost. In JSC, we put `reportExtraMemoryAllocated` at the end of JSXXX::finishCreation. IDL code should follow this convention. * bindings/js/SerializedScriptValue.cpp: (WebCore::SerializedScriptValue::SerializedScriptValue): (WebCore::SerializedScriptValue::computeMemoryCost const): * bindings/js/SerializedScriptValue.h: (WebCore::SerializedScriptValue::memoryCost const): * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/test/JS/JSInterfaceName.cpp: (WebCore::JSInterfaceName::finishCreation): (WebCore::toJSNewlyCreated): * dom/MessageEvent.cpp: (WebCore::MessageEvent::memoryCost const): * dom/MessageEvent.h: * dom/MessageEvent.idl: * html/OffscreenCanvas.h: (WebCore::DetachedOffscreenCanvas::memoryCost const): 2020-06-04 Wenson Hsieh <wenson_hsieh@apple.com> [macOS] Add a way to override the contact AutoFill button image https://bugs.webkit.org/show_bug.cgi?id=212775 <rdar://problem/60381452> Reviewed by Tim Horton. Rename `SYSTEM_ATTACHMENT_PLACEHOLDER_ICON` to `ALTERNATE_ICONS`, and use it to additionally guard an alternate appearance for the contact AutoFill button icon. * css/html.css: (input::-webkit-contacts-auto-fill-button): * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::extraDefaultStyleSheet): 2020-06-04 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Rename BlobLineEndings to EndingType to match the latest spec https://bugs.webkit.org/show_bug.cgi?id=212644 Reviewed by Sam Weinig. By the latest File API spec, the role of `BlobLineEndings` is named as `EndingType`. https://w3c.github.io/FileAPI/#enumdef-endingtype * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * fileapi/BlobBuilder.cpp: (WebCore::BlobBuilder::BlobBuilder): (WebCore::BlobBuilder::append): * fileapi/BlobBuilder.h: * fileapi/BlobPropertyBag.h: * fileapi/BlobPropertyBag.idl: * fileapi/EndingType.h: Renamed from Source/WebCore/fileapi/BlobLineEndings.h. * fileapi/EndingType.idl: Renamed from Source/WebCore/fileapi/BlobLineEndings.idl. 2020-06-04 Chris Dumez <cdumez@apple.com> [iOS] Validate index parameter in PlatformPasteboard https://bugs.webkit.org/show_bug.cgi?id=212713 <rdar://problem/60068765> Reviewed by Alex Christensen. Follow-up to r262529 to also make sure that the index is not negative after casting to NSInteger. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::readBuffer const): (WebCore::PlatformPasteboard::readString const): (WebCore::PlatformPasteboard::readURL const): 2020-06-04 Xabier Rodriguez Calvar <calvaris@igalia.com> [EME][GStreamer] cdmProxyAttached does not need to force a bump ref in the signature https://bugs.webkit.org/show_bug.cgi?id=212754 Reviewed by Philippe Normand. cdmProxyAttached is currently receiving a RefPtr<CDMProxy> in the signature, what causes a ref bump when the function is called. A const RefPtr<CDMProxy>& is more suitable cause the reference is already bumped when the CDMProxy assigned in the decryptor attribute. No new tests, just a rework. * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (cdmProxyAttached): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: 2020-06-04 Tim Horton <timothy_horton@apple.com> Work around broken system version macro https://bugs.webkit.org/show_bug.cgi?id=212726 Reviewed by Dan Bernstein. * Configurations/DebugRelease.xcconfig: 2020-06-04 Andy Estes <aestes@apple.com> [watchOS] Re-enable content filtering in the simulator build https://bugs.webkit.org/show_bug.cgi?id=212711 <rdar://problem/63938350> Reviewed by Wenson Hsieh. * Configurations/FeatureDefines.xcconfig: 2020-06-04 Zalan Bujtas <zalan@apple.com> Reset fragment line info when the relatively positioned inline box becomes static with block child. https://bugs.webkit.org/show_bug.cgi?id=212724 <rdar://problem/62847534> Reviewed by Simon Fraser. adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded was missing the case when the block container was inside an inline box. It happens when the inline box is relatively positioned while the child block box is absolutely positioned. RenderFragmentedFlow keeps track of the associated root lineboxes in m_lineToFragmentMap. In adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded, when the block is no longer part of the fragment we remove these cached lineboxes from the m_lineToFragmentMap. This patch fixes the case when the cached lineboxes are generated by a child block box. * rendering/RenderElement.cpp: (WebCore::RenderElement::adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded): 2020-06-04 Youenn Fablet <youenn@apple.com> Read MediaPlayerPrivateMediaStreamAVFObjC::m_canEnqueueDisplayLayer after the lock https://bugs.webkit.org/show_bug.cgi?id=212693 Reviewed by Eric Carlson. In case destroyLayers is called and shortly after ensureLayers is also called, the m_canEnqueueDisplayLayer check in enqueueVideoSample might be bypassed. Make sure to lock before checking m_canEnqueueDisplayLayer in enqueueVideoSample. For good measure, set m_canEnqueueDisplayLayer to false after locking in destroyLayers. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers): 2020-06-03 Chris Dumez <cdumez@apple.com> [iOS] Validate index parameter in PlatformPasteboard https://bugs.webkit.org/show_bug.cgi?id=212713 <rdar://problem/60068765> Reviewed by Wenson Hsieh. Validate index parameter in PlatformPasteboard, before calling [NSIndexSet indexSetWithIndex:]. Per documentation, index needs to be in the range [0 .. NSNotFound-1]. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::readBuffer const): (WebCore::PlatformPasteboard::readString const): (WebCore::PlatformPasteboard::readURL const): 2020-06-03 Andy Estes <aestes@apple.com> [Apple Pay] Add new values for -apple-pay-button-type https://bugs.webkit.org/show_bug.cgi?id=212684 <rdar://problem/63908535> Reviewed by Anders Carlsson. Where available, added new values for -apple-pay-button-type and introduced ApplePaySession v10. New test: http/tests/ssl/applepay/ApplePayButton.html * Modules/applepay/PaymentCoordinatorClient.cpp: (WebCore::PaymentCoordinatorClient::supportsVersion): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::applePayButtonDescription const): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const): * css/CSSValueKeywords.in: * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): * en.lproj/Localizable.strings: * platform/LocalizedStrings.cpp: (WebCore::AXApplePayReloadLabel): (WebCore::AXApplePayAddMoneyLabel): (WebCore::AXApplePayTopUpLabel): (WebCore::AXApplePayOrderLabel): (WebCore::AXApplePayRentLabel): (WebCore::AXApplePaySupportLabel): (WebCore::AXApplePayContributeLabel): (WebCore::AXApplePayTipLabel): * platform/LocalizedStrings.h: * rendering/RenderThemeCocoa.mm: (WebCore::toPKPaymentButtonType): * rendering/style/RenderStyleConstants.cpp: (WebCore::operator<<): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.h: 2020-06-03 Daniel Bates <dabates@apple.com> Inserted text placeholder should vertically align to top and behave like block-level element when it has 0 width https://bugs.webkit.org/show_bug.cgi?id=212716 <rdar://problem/62672479> Reviewed by Darin Adler. Refine the appearance of a text placeholder based on feedback: 1. If the width of the placeholder is 0 then put it on its own line. This is accomplished by making it CSS "display: block". 2. Vertically align the placeholder with the top of the line. Both of these refinements are to make the rendering more like TextKit's rendering. Tests: editing/text-placeholder/insert-into-content-editable-non-zero-width-and-height.html editing/text-placeholder/insert-into-content-editable-zero-width.html * html/shadow/TextPlaceholderElement.cpp: 2020-06-03 Pinki Gyanchandani <pgyanchandani@apple.com> Release Assert @ WebCore::RenderTreeBuilder::RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=212714 Reviewed by Geoffrey Garen. Widget removal in the middle of building a Render Tree causes side effects, leading to Release Assert. Moved the scope for suspension of widgets update to RenderTreeBuilder instead of having it in RenderTreeUpdater. Also made sure that the WidgetHierarchyUpdatesSuspensionScope::moveWidgets() should handle all widgets scheduled to move, including new widgets scheduled during moveWidgets(). Test: fast/rendering/widget-removal-in-render-tree-builder-crash.html * rendering/RenderWidget.cpp: (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets): * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::tearDownRenderers): 2020-06-03 Wenson Hsieh <wenson_hsieh@apple.com> [Text manipulation] Extract the value attribute in inputs of type "text" and "search" https://bugs.webkit.org/show_bug.cgi?id=212706 <rdar://problem/63876969> Reviewed by Tim Horton. Allow text manipulation to extract text for the value of text fields that were not last modified by user input. Aside from button types, it generally doesn't make sense to perform text manipulation over arbitrary input element values, especially for text field types such as passwords, URLs, emails, and numbers. However, some webpages set the `value` of inputs to implement `placeholder`-like behavior in text fields, and we need to be compatible with this. Tests: TextManipulation.StartTextManipulationExtractsValuesFromTextInputs TextManipulation.CompleteTextManipulationInButtonsAndTextFields * editing/TextManipulationController.cpp: (WebCore::shouldExtractValueForTextManipulation): Unfortunately, we need to check the type attribute here against "text", since inputs of type "date" and "time" fall back to text fields on macOS, and we still want to avoid extracting values for these. (WebCore::isAttributeForTextManipulation): Pull the `value` attribute of this out into a separate method, above. (WebCore::TextManipulationController::observeParagraphs): (WebCore::TextManipulationController::replace): Treat the text field value separately from other attributes by calling `HTMLInputElement::value()` upon extraction, and `HTMLInputElement::setValue()` upon replacement. 2020-06-03 Rob Buis <rbuis@igalia.com> Disallow responses when a response contains invalid header values https://bugs.webkit.org/show_bug.cgi?id=184493 Reviewed by Darin Adler. From the Fetch specification [1]: "A value is a byte sequence that matches the following conditions: "- Contains no 0x00 (NUL) or HTTP newline bytes." [1] https://fetch.spec.whatwg.org/#concept-header-value Tests: imported/w3c/web-platform-tests/fetch/h1-parsing/resources-with-0x00-in-header.window.html imported/web-platform-tests/fetch/api/basic/header-value-combining.any.html imported/web-platform-tests/fetch/api/basic/header-value-combining.any.worker.html imported/web-platform-tests/fetch/api/basic/header-value-null-byte.any.html imported/web-platform-tests/fetch/api/basic/header-value-null-byte.any.worker.html imported/web-platform-tests/xhr/headers-normalize-response.htm * Modules/fetch/FetchHeaders.cpp: (WebCore::canWriteHeader): (WebCore::appendToHeaderMap): (WebCore::FetchHeaders::filterAndFill): * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didReceiveResponse): * platform/network/HTTPParsers.cpp: (WebCore::isValidHTTPHeaderValue): * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::containsInvalidHTTPHeaders const): * platform/network/ResourceResponseBase.h: 2020-06-03 Wenson Hsieh <wenson_hsieh@apple.com> dataTransfer.types is empty when handling the "dragstart" event https://bugs.webkit.org/show_bug.cgi?id=212685 <rdar://problem/61368402> Reviewed by Andy Estes. Implements several currently stubbed methods on StaticPasteboard, so that the DataTransfer provided to the page on the "dragstart" event contains the DOM-exposed data types that will be written to the system pasteboard. This includes "text/html", "text/plain", and "text/uri-list". Tests: DragAndDropTests.DataTransferTypesOnDragStartForTextSelection DragAndDropTests.DataTransferTypesOnDragStartForImage DragAndDropTests.DataTransferTypesOnDragStartForLink ...as well as several existing tests in DragAndDropTestsIOS.mm that attempt to set pasteboard data during the dragstart event: DragAndDropTests.DataTransferSanitizeHTML DragAndDropTests.DataTransferSetDataCannotWritePlatformTypes DragAndDropTests.DataTransferSetDataInvalidURL DragAndDropTests.DataTransferSetDataUnescapedURL DragAndDropTests.DataTransferSetDataValidURL * dom/DataTransfer.cpp: (WebCore::DataTransfer::commitToPasteboard): Only commit data to the native pasteboard if the page actually tried to write or modify the data. This allows us to preserve existing behavior by allowing DragController to write dragged data to the pasteboard normally in the case where the page didn't specify any custom data. In the case where the page does specify custom data, we will write this custom data *in addition* to any default data that was written to the static pasteboard. While this is a departure from our current behavior (which is to treat the pasteboard as a blank slate that contains only whatever custom data was provided by the page), it matches behavior in both Chrome and Firefox, and is likely more compatible with webpages that don't have UA-specific logic targeting WebKit. * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::writeSelectionToPasteboard): Avoid calling into the injected bundle (as well as writing a few particular non-web-exposed types, such as web archive data) in the case where we're writing to a static pasteboard (there's no point in doing this for the static pasteboard, and in the worst case, it could confuse some internal clients). * editing/ios/EditorIOS.mm: (WebCore::Editor::writeImageToPasteboard): Ditto. * editing/mac/EditorMac.mm: (WebCore::Editor::writeImageToPasteboard): Ditto. But additionally, introduce a markup string to PasteboardImage, so that we will expose the "text/html" type when starting a drag on an image element. * page/DragController.cpp: (WebCore::DragController::startDrag): Only attempt to call into `Pasteboard::writeTrustworthyWebURLsPboardType` in the case where the pasteboard supports this type (i.e. on macOS). This fixes an existing assertion that was hit by my new API test, which attempts to override the contents of the pasteboard with custom data while starting a drag on a link. * page/EventHandler.cpp: (WebCore::EventHandler::handleDrag): Since the StaticPasteboard contains data before the page has written anything, don't use `Pasteboard::hasData()` to determine whether there's custom data; instead, use the new `hasNonDefaultData()` method on `StaticPasteboard` (see below). * platform/Pasteboard.cpp: (WebCore::Pasteboard::canWriteTrustworthyWebURLsPboardType): On non-macOS ports, return false. * platform/Pasteboard.h: * platform/StaticPasteboard.cpp: (WebCore::StaticPasteboard::hasNonDefaultData const): Keep track of whether the page attempted to stage any custom data during "dragstart" by maintaining the set of types written by the page, via calls to `writeString()` and similar. I'm using a set of types here instead of a simple `bool` flag to ensure correctness in the case where the page adds a type, and then later removes that same custom type, such that there is no longer non-default data. (WebCore::StaticPasteboard::writeString): (WebCore::StaticPasteboard::writeData): (WebCore::StaticPasteboard::writeStringInCustomData): (WebCore::StaticPasteboard::clear): See above. (WebCore::StaticPasteboard::writeMarkup): (WebCore::StaticPasteboard::writePlainText): (WebCore::StaticPasteboard::write): Implement these methods by writing to the `PasteboardCustomData`. These methods are invoked by our own code rather than the bindings, and should only be used to stage default data types when starting a drag. * platform/StaticPasteboard.h: * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::write): (WebCore::Pasteboard::canWriteTrustworthyWebURLsPboardType): 2020-06-03 Jer Noble <jer.noble@apple.com> Crash with uncaught exception: *** -[AVSampleBufferAudioRenderer enqueueSampleBuffer:] Sample buffer has media type 'vide' instead of 'soun' https://bugs.webkit.org/show_bug.cgi?id=212646 <rdar://problem/63040834> Reviewed by Eric Carlson. Protect against the possibility of AVStreamDataParser generating non-video or -audio samples in an otherwise video- or audio-track. Check the format description attached to the sample before appending, and ASSERT in debug builds and ERROR_LOG in release builds, as this is an exceptional condition. * platform/graphics/FourCC.h: (WTF::LogArgument<WebCore::FourCC>::toString): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): 2020-06-03 Kate Cheney <katherine_cheney@apple.com> Any active sqlite transactions for the ITP database should be aborted when the network process suspends. https://bugs.webkit.org/show_bug.cgi?id=212608 <rdar://problem/60540768> Reviewed by Chris Dumez. Add WEBCORE_EXPORT macro to use interrupt() function in ResourceLoadStatisticsDatabaseStore. * platform/sql/SQLiteDatabase.h: 2020-06-03 Andres Gonzalez <andresg_22@apple.com> AX: SVG text node with content is described as "empty group" even if it's not empty https://bugs.webkit.org/show_bug.cgi?id=210315 Reviewed by Darin Adler. Test: accessibility/svg-text.html SVGText elements are conveyed as AXGroups and cannot have a description or help property, but instead the content of the element is exposed as static text. * accessibility/AccessibilitySVGElement.cpp: (WebCore::AccessibilitySVGElement::accessibilityDescription const): (WebCore::AccessibilitySVGElement::helpText const): * accessibility/AccessibilitySVGElement.h: 2020-06-03 Sihui Liu <sihui_liu@apple.com> Text manipulation sometimes fails to replace text in attributes https://bugs.webkit.org/show_bug.cgi?id=212701 Reviewed by Wenson Hsieh. Concatenate replacement tokens of same identifier for attribute like we do for title and option element in r260393. Covered by test: TextManipulation.CompleteTextManipulationShouldReplaceTextContentWithMultipleTokens * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::replace): 2020-06-02 Dean Jackson <dino@apple.com> [ macOS ] REGRESSION(r262366): webgl/1.0.3/conformance/canvas/buffer-offscreen-test.html & webgl/2.0.0/conformance/canvas/buffer-offscreen-test.html are constant failures https://bugs.webkit.org/show_bug.cgi?id=212594 <rdar://problem/63828783> Reviewed by Eric Carlson. The change in r262366 split the OpenGL work to prepare a canvas for rendering from the actual painting (or compositing in this case). Canvas elements were being "prepared" at the end of the HTML run loop if they'd done anything that would change pixels. The problem is that canvas elements that are not in the document body are never composited, and thus should never be prepared, otherwise they will clear their drawing buffer. In other words, a canvas in this state must keep the same buffer through each rendering frame. The solution is to check if the canvas is in the tree scope at the time we consider preparing it for display. * dom/Document.cpp: (WebCore::Document::prepareCanvasesForDisplayIfNeeded): 2020-06-03 John Wilander <wilander@apple.com> Storage Access API: Add setting for per-page storage access scope https://bugs.webkit.org/show_bug.cgi?id=212682 <rdar://problem/63904824> Reviewed by Brent Fulgham. This is a follow-up patch to https://bugs.webkit.org/show_bug.cgi?id=212114, adding an off-by-default setting and a test case for per-page storage access. Test: http/tests/storageAccess/request-and-grant-access-with-per-page-scope-access-from-another-frame.html * dom/DocumentStorageAccess.cpp: (WebCore::DocumentStorageAccess::requestStorageAccess): * page/Settings.yaml: * testing/InternalSettings.cpp: (WebCore::InternalSettings::setStorageAccessAPIPerPageScopeEnabled): * testing/InternalSettings.h: * testing/InternalSettings.idl: 2020-06-03 Rob Buis <rbuis@igalia.com> Make generated C++ code use modern C++ https://bugs.webkit.org/show_bug.cgi?id=190714 Reviewed by Jonathan Bedard. Replace typedef usage by alias-declaration. No new tests. No change in behavior. * css/makeprop.pl: * dom/make_names.pl: (printHeaderHead): (printInit): (printTypeHelpersHeaderFile): (printFactoryCppFile): (printFactoryHeaderFile): (printWrapperFactoryCppFile): (printWrapperFactoryHeaderFile): 2020-06-03 Javier Fernandez <jfernandez@igalia.com> [css-grid] Dynamically setting "position: absolute" in a grid item doesn't trigger a relayout of that element https://bugs.webkit.org/show_bug.cgi?id=191465 Reviewed by Manuel Rego Casasnovas. From Blink r484620 by Sergio Villar <svillar@igalia.com> Containing block overrides not cleared for position:absolute Whenever a position:absolute block gets a new containing block the previously set containing block overrides are not cleared. This causes the block not to be properly layout for its new containing block (for example when using relative sizes). In particular this affects grid items which always get a containing block override size (which represent the grid areas) in case their containing block switches from the grid container to a grid ancestor. No new tests, as this change is covered by current web platform tests. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::insertPositionedObject): Clear the containing block's override width and height. 2020-06-03 Youenn Fablet <youenn@apple.com> Add more logging related to service worker fetch event handling https://bugs.webkit.org/show_bug.cgi?id=212632 Reviewed by Chris Dumez. Add logging related to creating/canceling/deleting fetch event handler related client. No change of behavior. * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::ServiceWorkerThreadProxy::startFetch): (WebCore::ServiceWorkerThreadProxy::cancelFetch): (WebCore::ServiceWorkerThreadProxy::removeFetch): 2020-06-02 Yusuke Suzuki <ysuzuki@apple.com> ASSERTION FAILED: isCell() under WebCore::JSDOMConstructor seen with webaudio/the-audio-api/the-audiocontext-interface/audiocontextoptions.html https://bugs.webkit.org/show_bug.cgi?id=212650 Reviewed by Mark Lam. Some DOM constructor can return jsNull. For example, AudioContext constructor can return jsNull when it exceeds # of hardware audio contexts. However CodeGeneratorJS assumes that DOM constructor always returns an object, or throws an exception. This patch adds object check after DOM constructor call to handle the jsNull case while it does not change the existing semantics. * bindings/scripts/CodeGeneratorJS.pm: (GenerateConstructorDefinition): 2020-06-02 Simon Fraser <simon.fraser@apple.com> EventRegion::translate() needs to offset the wheel event regions https://bugs.webkit.org/show_bug.cgi?id=212683 Reviewed by Zalan Bujtas. EventRegion::translate() failed to offset the wheel event regions, which resulted in wrong reasons for GraphicsLayers with a non-zero offsetFromRenderer. Test: fast/scrolling/mac/wheel-event-listener-region-layer-offset.html * rendering/EventRegion.cpp: (WebCore::EventRegion::translate): 2020-06-02 Wenson Hsieh <wenson_hsieh@apple.com> Add a helper method to populate a DataTransfer before dispatching a "dragstart" event https://bugs.webkit.org/show_bug.cgi?id=212614 Work towards <rdar://problem/61368402> Reviewed by Tim Horton. Add a helper method in DragController to pre-populate the StaticPasteboard-backed DataTransfer before dispatching the "dragstart" event. There should be no change in behavior yet, since StaticPasteboard doesn't implement methods for writing data to the pasteboard, which this new method uses. * page/DragController.cpp: (WebCore::DragController::prepareForDragStart const): (WebCore::DragController::hitTestResultForDragStart const): (WebCore::DragController::startDrag): * page/DragController.h: * page/EventHandler.cpp: (WebCore::EventHandler::dispatchDragStartEventOnSourceElement): 2020-06-02 Andres Gonzalez <andresg_22@apple.com> AXIsolatedTree::updateNode should not call nodeForID. https://bugs.webkit.org/show_bug.cgi?id=212662 Reviewed by Chris Fleizach. In isolated tree mode AXIsolatedTree::nodeForID should be called only on the secondary AX thread. So removing the need to call nodeForID in updateNode by using AXCoreObject::childrenIDs() instead of retrieving the isolated node to access its children IDs. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateNode): 2020-06-02 Keith Rollin <krollin@apple.com> Revert FEATURES_DEFINES related changes https://bugs.webkit.org/show_bug.cgi?id=212664 <rdar://problem/63893033> Reviewed by Andy Estes. Bug 262310, Bug 262311, Bug 262318, and Bug 262331 involve changes to FEATURE_DEFINES and how the values there relate to those found in the Platform*.h files. Those changes break XCBuild (by removing the .xcfilelist related to UnifiedSources and the process for generating them), and so are being reverted. No new tests -- build changes. * Configurations/FeatureDefines.xcconfig: * Configurations/GenerateUnifiedSources.xcconfig: Added. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/applepay/ApplePayError.idl: * Modules/applepay/ApplePayPaymentAuthorizationResult.idl: * Modules/applepay/ApplePayPaymentContact.idl: * Modules/applepay/ApplePayPaymentMethodUpdate.idl: * Modules/applepay/ApplePayRequestBase.idl: * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePayShippingContactUpdate.idl: * Modules/applepay/ApplePayShippingMethodUpdate.idl: * Modules/applepay/PaymentCoordinatorClient.cpp: (WebCore::PaymentCoordinatorClient::supportsVersion): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::computePaymentMethodErrors const): * Scripts/generate-unified-sources.sh: * UnifiedSources-output.xcfilelist: Added. * WebCore.xcodeproj/project.pbxproj: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::applePayButtonDescription const): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const): * css/CSSValueKeywords.in: * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): * rendering/RenderThemeCocoa.mm: (WebCore::toPKPaymentButtonType): * rendering/style/RenderStyleConstants.cpp: (WebCore::operator<<): * rendering/style/RenderStyleConstants.h: 2020-06-02 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r262424. Caused webkitpy test failure Reverted changeset: "Make generated C++ code use modern C++" https://bugs.webkit.org/show_bug.cgi?id=190714 https://trac.webkit.org/changeset/262424 2020-06-02 Peng Liu <peng.liu6@apple.com> Stressing webkitSetPresentationMode leads to wrong inline video dimensions https://bugs.webkit.org/show_bug.cgi?id=202425 Reviewed by Eric Carlson. Make the HTMLVideoElement::setFullscreenMode() robust under stress tests by ignoring a request when the video element is not ready yet. Manually tested. * dom/Element.h: (WebCore::Element::didStopBeingFullscreenElement): Add a callback to indicate that the element has exited fullscreen. * dom/FullscreenManager.cpp: (WebCore::FullscreenManager::didExitFullscreen): Call Element::didStopBeingFullscreenElement() when the element has exited fullscreen. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::enterFullscreen): * html/HTMLMediaElement.h: * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): This function will return true when a video element is in the process to exit fullscreen/picture-in-picture until it has completed the process. Therefore, a page can safely request the video element to enter fullscreen/picture-in-picture when this function returns false. (WebCore::HTMLVideoElement::setFullscreenMode): (WebCore::HTMLVideoElement::didBecomeFullscreenElement): (WebCore::HTMLVideoElement::didStopBeingFullscreenElement): (WebCore::HTMLVideoElement::didEnterFullscreen): Deleted. (WebCore::HTMLVideoElement::didExitFullscreen): Deleted. * html/HTMLVideoElement.h: Add a flag m_isChangingPresentationMode. webkitSetPresentationMode() will only change the presentation mode when the flag is false. 2020-06-01 Simon Fraser <simon.fraser@apple.com> Add ENABLE(WHEEL_EVENT_REGIONS), enabled on macOS which is the only platform that needs wheel event regions for scrolling thread hit-testing https://bugs.webkit.org/show_bug.cgi?id=212620 Reviewed by Tim Horton. Surround code related to wheel event regions with ENABLE(WHEEL_EVENT_REGIONS). Eventually we'll use this same code for touch event regions, and when we do, we can rejigger the #ifdefs. * rendering/EventRegion.cpp: (WebCore::EventRegion::operator== const): (WebCore::EventRegion::unite): (WebCore::EventRegion::containsEditableElementsInRect const): (WebCore::EventRegion::dump const): * rendering/EventRegion.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintDebugOverlays): 2020-06-02 Andres Gonzalez <andresg_22@apple.com> Avoid calling axBackingObject multiple times in [WebAccessibilityObjectWrapper roleDescription]. https://bugs.webkit.org/show_bug.cgi?id=212643 Reviewed by Chris Fleizach. No new functionality. Avoid unnecessary overhead of calling axBackingObject multiple times in roleDescription. axBackingObject is not just a getter but involves checking whether isolated tree mode is enabled. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper subrole]): (-[WebAccessibilityObjectWrapper roleDescription]): 2020-06-02 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Pass nullptr for the 2nd argument of FileReaderLoader https://bugs.webkit.org/show_bug.cgi?id=212642 Reviewed by Darin Adler. Instead of passing `0`, `nullptr` is better because `FileReaderLoader` takes a pointer. * fileapi/FileReaderSync.cpp: (WebCore::FileReaderSync::readAsArrayBuffer): (WebCore::FileReaderSync::readAsBinaryString): (WebCore::FileReaderSync::readAsText): (WebCore::FileReaderSync::readAsDataURL): 2020-06-02 Tim Horton <timothy_horton@apple.com> UIColor and NSColor WebCore::Color factories should return invalid colors for nil input colors https://bugs.webkit.org/show_bug.cgi?id=212631 Reviewed by Anders Carlsson. * platform/graphics/mac/ColorMac.mm: (WebCore::colorFromNSColor): (WebCore::semanticColorFromNSColor): * platform/ios/ColorIOS.mm: (WebCore::colorFromUIColor): This doesn't affect any code currently in WebKit, but it is very, very surprising that these functions happily accept a null color, assert in debug, but in release do crazy things like try to paint the null color into a small bitmap to figure out what it really is. Also, this matches the behavior of the Color constructors that take CGColorRef. 2020-06-02 Rob Buis <rbuis@igalia.com> Make generated C++ code use modern C++ https://bugs.webkit.org/show_bug.cgi?id=190714 Reviewed by Sam Weinig. Replace typedef usage by alias-declaration. No new tests. No change in behavior. * css/makeprop.pl: * dom/make_names.pl: (printHeaderHead): (printInit): (printTypeHelpersHeaderFile): (printFactoryCppFile): (printFactoryHeaderFile): (printWrapperFactoryCppFile): (printWrapperFactoryHeaderFile): 2020-06-02 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Remove unused BlobURL::getIdentifier https://bugs.webkit.org/show_bug.cgi?id=212635 Reviewed by Youenn Fablet. * fileapi/BlobURL.cpp: * fileapi/BlobURL.h: 2020-06-02 Mark Lam <mark.lam@apple.com> Fix broken Windows build. https://bugs.webkit.org/show_bug.cgi?id=212633 Reviewed by Yusuke Suzuki. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::needsPreparationForDisplay): (WebCore::HTMLCanvasElement::prepareForDisplay): 2020-06-02 Youenn Fablet <youenn@apple.com> Add some logging to ServiceWorkerThread to track install/activate event handling https://bugs.webkit.org/show_bug.cgi?id=212523 Reviewed by Chris Dumez. Add some logging for firing install/activate events and when these events are handled. No change of behavior. * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::queueTaskToFireInstallEvent): (WebCore::ServiceWorkerThread::queueTaskToFireActivateEvent): 2020-06-02 Carlos Garcia Campos <cgarcia@igalia.com> [GTK4] Make popup menus work https://bugs.webkit.org/show_bug.cgi?id=211178 Reviewed by Adrian Perez de Castro. * platform/gtk/GtkVersioning.h: (gtk_tree_view_column_cell_get_size): 2020-06-01 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] ChildIntrinsicLogicalWidth should use fit-content, not max-content https://bugs.webkit.org/show_bug.cgi?id=210465 Reviewed by Javier Fernandez. When computing the hypothetical cross size of each item in the flexbox algorithm the current code was using the max-size. However the specs state clearly that we should use fit-content instead, i.e., the shrink-to-fit size. See https://drafts.csswg.org/css-flexbox/#algo-cross-item. Based on Blink's crrev.com/1327746 by <cbiesinger@chromium.org> * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth const): Use the shrink-to-fit size instead just the max-size. 2020-06-02 Youenn Fablet <youenn@apple.com> MediaPlayerPrivateMediaStreamAVFObjC should enqueue samples in a background thread https://bugs.webkit.org/show_bug.cgi?id=212073 Reviewed by Eric Carlson. Do not hop to the main thread when rendering video samples anymore. Instead, we enqueue to the display layer in the background thread but still hop to the main thread for two things: - Update of various states of the player - keep a ref to the video sample if canvas rendering is needed. Most display layer operations stay in the main thread (creation, flushing...). Deletion of the display layer and access from a background are covered by a lock. The m_canEnqueueDisplayLayer boolean ensures we do not enqueue too early when the display layer is not yet properly initialized. LocalSampleBufferDisplayLayer needs to handle the fact that enqueueing might be done in a background thread. Instead of introducing a lock, we introduce a work queue and we hop to this queue whenever we need to enqueue/mutate the pending samples. Covered by existing tests and manual testing. * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h: * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm: (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::LocalSampleBufferDisplayLayer::enqueueSample): (WebCore::LocalSampleBufferDisplayLayer::enqueueSampleBuffer): (WebCore::LocalSampleBufferDisplayLayer::requestNotificationWhenReadyForVideoData): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::videoTransformationMatrix): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::processNewVideoSampleAvailable): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::applicationDidBecomeActive): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushRenderers): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateRenderingMode): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setBufferingPolicy): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::rootLayerBoundsDidChange): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix): Deleted. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueCorrectedVideoSample): Deleted. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer): Deleted. 2020-06-02 Youenn Fablet <youenn@apple.com> [ Mac wk2 ] http/wpt/service-workers/service-worker-spinning-fetch.https.html is flaky failing. https://bugs.webkit.org/show_bug.cgi?id=207515 <rdar://problem/59329307> Reviewed by Chris Dumez. When a service worker is terminated, we remove it from the map in SWContextManager. Shortly after a new service worker may be added to the map. In that case, previously, we were potentially trying to decrement the message count of the old service worker thread, which is confusing the new service worker thread. Instead, use WeakPtr to decrement if the service worker thread is still valid. Covered by existing tests. * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::queueTaskToPostMessage): (WebCore::ServiceWorkerThread::queueTaskToFireInstallEvent): (WebCore::ServiceWorkerThread::queueTaskToFireActivateEvent): (WebCore::ServiceWorkerThread::start): * workers/service/context/ServiceWorkerThread.h: 2020-06-01 Myles C. Maxfield <mmaxfield@apple.com> [WebGPU] Update texture creation validation according to the discussion at https://github.com/gpuweb/gpuweb/pull/799/files https://bugs.webkit.org/show_bug.cgi?id=212390 Reviewed by Dean Jackson. Two new rules: Multisampled textures can't have the STORAGE flag, and sampleCount must be either 1 or 4. Test: webgpu/texture-creation.html * platform/graphics/gpu/GPUDevice.cpp: (WebCore::GPUDevice::tryCreateTexture const): 2020-06-01 Noam Rosenthal <noam@webkit.org> Make unicode-bidi:isolate the default for an element with a dir attribute (instead of unicode-bidi:embed) https://bugs.webkit.org/show_bug.cgi?id=134630 Reviewed by Simon Fraser. Unskipped 11 dir-isolation w3c tests. * html/HTMLElement.cpp: (WebCore::HTMLElement::collectStyleForPresentationAttribute): Use isolate instead of embed for unicode-bidi when dir attribute is present. 2020-06-01 Devin Rousso <drousso@apple.com> Web Inspector: Graphics: should use the `id` (name) of the animation if it exists https://bugs.webkit.org/show_bug.cgi?id=212618 Reviewed by Timothy Hatcher. Test: inspector/animation/lifecycle-css-animation.html: inspector/animation/lifecycle-css-transition.html: inspector/animation/lifecycle-web-animation.html: inspector/animation/nameChanged.html * animation/WebAnimation.h: (WebCore::WebAnimation::setId): Deleted. * animation/WebAnimation.cpp: (WebCore::WebAnimation::setId): Added. * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::didChangeWebAnimationName): Added. * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didChangeWebAnimationNameImpl): Added. * inspector/agents/InspectorAnimationAgent.h: * inspector/agents/InspectorAnimationAgent.cpp: (WebCore::InspectorAnimationAgent::didChangeWebAnimationName): Added. (WebCore::InspectorAnimationAgent::bindAnimation): 2020-06-01 Andres Gonzalez <andresg_22@apple.com> [WebAccessibilityObjectWrapper subrole] should check for the nullity of the underlying AXCoreObject before dereferencing. https://bugs.webkit.org/show_bug.cgi?id=212607 Reviewed by Chris Fleizach. Covered by existing tests. - Check for nullity of the backingObject before dereferencing. - self.axBackingObject is now called only once, instead of many times unnecessarily. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper subrole]): 2020-06-01 Sihui Liu <sihui_liu@apple.com> TextManipulationController should put one Node in only one paragraph https://bugs.webkit.org/show_bug.cgi?id=212548 Reviewed by Wenson Hsieh. TextManipulationController mainly uses line break as delimiter to split paragraphs. In our current implementation, if text of a Node has line break, the part before the line break is in one paragraph and the part after the line break is in another paragraph, which means the Node is in the ranges of two paragraphs. In this case, when TextManipulationController manipulates the first paragraph, it replaces all the Nodes in the range of first paragraph with new Nodes. Then when it manipulates the second paragraph, if will find Node in the range of second paragraph does not exist and fail (because the Node is removed when handling the first paragraph.). Also, TextManipulationController currently does not preserve line breaks in text, which can be an issue if these line breaks are visible. This patch makes the ParagraphContentIterator iterate over Nodes instead of text, so a Node can only be in the range of one paragraph. To do this, it makes line break and spaces around it as a special excluded token. Here are the rules for splitting paragraphs by line break now: 1. If the special token is the first token in a Node, text in Nodes before the Node will make a paragraph. 2. If the special token is the last token in a Node, text in Nodes before the Node and in the Node will make a paragraph. 3. If the special token in the middle of tokens in a Node, then we don't make a new paragraph until next special token meets condition 1 or 2. This patch also fixes the issue that Nodes out of the paragraph range can be removed due to the preorder Node traversal, by finding and adding those Nodes back. * editing/TextManipulationController.cpp: (WebCore::ParagraphContentIterator::m_pastEndNode): (WebCore::ParagraphContentIterator::advance): (WebCore::ParagraphContentIterator::currentContent): (WebCore::ParagraphContentIterator::atEnd const): (WebCore::ParagraphContentIterator::advanceNode): (WebCore::ParagraphContentIterator::advanceIteratorNodeAndUpdateText): (WebCore::isEnclosingItemBoundaryElement): (WebCore::TextManipulationController::parse): (WebCore::TextManipulationController::observeParagraphs): (WebCore::TextManipulationController::addItem): (WebCore::TextManipulationController::getPath): (WebCore::TextManipulationController::updateInsertions): (WebCore::TextManipulationController::replace): (WebCore::ParagraphContentIterator::startPosition): Deleted. (WebCore::ParagraphContentIterator::endPosition): Deleted. (WebCore::ParagraphContentIterator::moveCurrentNodeForward): Deleted. (WebCore::containsOnlyHTMLSpaces): Deleted. * editing/TextManipulationController.h: 2020-06-01 David Kilzer <ddkilzer@apple.com> Don't use casts to convert between WebCore::DragDestinationAction and {Web,WK}DragDestinationAction types <https://webkit.org/b/212507> Reviewed by Darin Adler. * page/DragActions.h: (WebCore::anyDragDestinationAction): Add. (WebCore::DragDestinationActionAny): Delete. - Rename DragDestinationActionAny() to anyDragDestinationAction() to match WebKit style. * platform/DragData.h: - Update to use anyDragDestinationAction(). 2020-06-01 Simon Fraser <simon.fraser@apple.com> Add ENABLE(TOUCH_ACTION_REGIONS) to wrap code that's only relevant for platforms that consult touch-action for event handling https://bugs.webkit.org/show_bug.cgi?id=212572 Reviewed by Andy Estes. This will allow for optimizations in event region painting without ambiguity. * dom/Document.h: * page/Frame.cpp: (WebCore::Frame::invalidateContentEventRegionsIfNeeded): * page/scrolling/ScrollingTreeNode.h: * rendering/EventRegion.cpp: (WebCore::EventRegion::operator== const): (WebCore::EventRegion::unite): (WebCore::EventRegion::translate): (WebCore::EventRegion::dump const): * rendering/EventRegion.h: (WebCore::EventRegion::encode const): (WebCore::EventRegion::decode): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintObject): * rendering/RenderElement.cpp: (WebCore::RenderElement::styleWillChange): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::maintainsEventRegion const): (WebCore::RenderLayerBacking::paintDebugOverlays): * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveElement): 2020-06-01 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Implement ParentNode.prototype.replaceChildren https://bugs.webkit.org/show_bug.cgi?id=198578 Reviewed by Darin Adler. Ideally, we can use `ContainerNode::replaceAllChildren` to implement this simply but the current of it does not have a path to support `DocumentFragment`. Hence, we call related methods from `ParentNode.prototype.replaceChildren` directly. * dom/ContainerNode.cpp: (WebCore::ContainerNode::replaceChildren): * dom/ContainerNode.h: * dom/ParentNode.idl: 2020-05-25 Sergio Villar Senin <svillar@igalia.com> [css-flexbox] Tables as flex items should obey the flex container sizing https://bugs.webkit.org/show_bug.cgi?id=212355 Reviewed by Manuel Rego Casasnovas. For most of the boxes, "width:auto" means use all the available space from your container in the inline direction. This means that a flex container does not need to do anything in particular to stretch them in the inline axis. However that is not true for tables because their width mostly depend on the sum of the sizes of their columns (whichever algorithm is used). That's why the layout code of tables should check whether or not it has an override for the content logical width which is the way flexbox uses to stretch flex items (and use that override width). * rendering/RenderTable.cpp: (WebCore::RenderTable::updateLogicalWidth): Stretch till overrideContentLogicalWidth() if needed. 2020-06-01 Sam Weinig <weinig@apple.com> Extended Color: Replace Color constructors taking numeric values with type specific factory functions https://bugs.webkit.org/show_bug.cgi?id=212576 Reviewed by Tim Horton. Replaces all remaining implicit and explicit uses of the Color constructors taking numeric values with explicit calls to makeSimpleColor/makeSimpleColorFromFloats/makeExtendedColor, giving us a consistent way to create colors. Also addes use constexpr SimpleColors where possible. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): * css/CSSValuePool.cpp: (WebCore::StaticCSSValuePool::StaticCSSValuePool): * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::createInnerTextStyle): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::shadowColor const): (WebCore::CanvasRenderingContext2DBase::setShadow): * html/canvas/CanvasStyle.cpp: (WebCore::CanvasStyle::CanvasStyle): (WebCore::CanvasStyle::isEquivalentRGBA const): * inspector/InspectorOverlay.cpp: (WebCore::drawOutlinedQuadWithClip): (WebCore::drawShapeHighlight): (WebCore::InspectorOverlay::paint): (WebCore::InspectorOverlay::drawPaintRects): (WebCore::InspectorOverlay::drawBounds): (WebCore::InspectorOverlay::drawRulers): (WebCore::InspectorOverlay::drawElementTitle): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::parseColor): * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::debugTextShadow): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsBackgroundCSS const): * page/DebugPageOverlays.cpp: (WebCore::touchEventRegionColors): (WebCore::NonFastScrollableRegionOverlay::drawRect): * page/FrameView.cpp: (WebCore::FrameView::paintContents): * page/PrintContext.cpp: (WebCore::PrintContext::spoolAllPagesWithBoundaries): * page/linux/ResourceUsageOverlayLinux.cpp: (WebCore::ResourceUsageOverlay::platformInitialize): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::draw): * platform/graphics/Color.cpp: (WebCore::Color::light const): (WebCore::Color::dark const): (WebCore::Color::blendWithWhite const): (WebCore::Color::colorWithAlphaMultipliedBy const): (WebCore::Color::colorWithAlphaMultipliedByUsingAlternativeRounding const): (WebCore::Color::colorWithAlpha const): (WebCore::Color::colorWithAlphaUsingAlternativeRounding const): (WebCore::blendWithoutPremultiply): (WebCore::extendedColorsEqual): Deleted. (WebCore::Color::tagAsValid): Deleted. * platform/graphics/Color.h: (WebCore::Color::Color): (WebCore::Color::tagAsSemantic): (WebCore::Color::tagAsValid): (WebCore::extendedColorsEqual): (WebCore::Color::decode): (WebCore::Color::setIsSemantic): Deleted. * platform/graphics/ExtendedColor.cpp: (WebCore::makeExtendedColor): * platform/graphics/ExtendedColor.h: (WebCore::ExtendedColor::ExtendedColor): (): Deleted. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::getDebugBorderInfo const): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::recursiveCommitChanges): (WebCore::contentsLayerDebugBorderColor): (WebCore::cloneLayerDebugBorderColor): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/PlatformCALayer.cpp: (WebCore::PlatformCALayer::drawRepaintIndicator): * platform/graphics/ca/TileCoverageMap.cpp: (WebCore::TileCoverageMap::TileCoverageMap): (WebCore::TileCoverageMap::update): * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: (PlatformCALayerWinInternal::drawRepaintCounters): * platform/graphics/cairo/GradientCairo.cpp: (WebCore::interpolateColorStop): * platform/graphics/cg/ColorCG.cpp: (WebCore::Color::Color): * platform/graphics/cg/NativeImageCG.cpp: (WebCore::nativeImageSinglePixelSolidColor): * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::colorForMarkerLineStyle): * platform/graphics/filters/FilterOperation.cpp: (WebCore::DropShadowFilterOperation::blend): * platform/graphics/mac/ColorMac.mm: (WebCore::colorFromNSColor): * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper): * platform/ios/DragImageIOS.mm: (WebCore::createDragImageForLink): * platform/ios/LegacyTileCache.mm: (WebCore::LegacyTileCache::colorForGridTileBorder const): * platform/win/DragImageWin.cpp: (WebCore::createDragImageForLink): * rendering/PaintInfo.h: (WebCore::PaintInfo::forcedTextColor const): * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::paintReplaced): (WebCore::replacementTextRoundedRectPressedColor): Deleted. (WebCore::replacementTextRoundedRectColor): Deleted. (WebCore::replacementTextColor): Deleted. (WebCore::unavailablePluginBorderColor): Deleted. * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::paintColumnBorder): (WebCore::RenderFrameSet::paintRowBorder): (WebCore::borderStartEdgeColor): Deleted. (WebCore::borderEndEdgeColor): Deleted. (WebCore::borderFillColor): Deleted. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::beginTransparencyLayers): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintDebugOverlays): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::platformActiveSelectionBackgroundColor const): (WebCore::RenderTheme::platformInactiveSelectionBackgroundColor const): (WebCore::RenderTheme::platformTextSearchHighlightColor const): (WebCore::RenderTheme::paintSystemPreviewBadge): (WebCore::RenderTheme::platformTapHighlightColor const): * rendering/RenderTheme.h: (WebCore::RenderTheme::platformFocusRingColor const): * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintCheckboxDecorations): (WebCore::RenderThemeIOS::paintRadioDecorations): (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): (WebCore::RenderThemeIOS::paintSliderTrack): (WebCore::RenderThemeIOS::paintProgressBar): (WebCore::paintAttachmentProgress): (WebCore::paintAttachmentBorder): (WebCore::RenderThemeIOS::paintSystemPreviewBadge): (WebCore::RenderThemeIOS::shadowColor const): Deleted. (WebCore::attachmentBorderColor): Deleted. (WebCore::attachmentProgressColor): Deleted. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintMenuListButtonDecorations): (WebCore::titleTextColorForAttachment): (WebCore::AttachmentLayout::layOutSubtitle): (WebCore::paintAttachmentIconBackground): (WebCore::paintAttachmentTitleBackground): (WebCore::paintAttachmentProgress): (WebCore::paintAttachmentPlaceholderBorder): (WebCore::attachmentIconBackgroundColor): Deleted. (WebCore::attachmentIconBorderColor): Deleted. (WebCore::attachmentTitleInactiveBackgroundColor): Deleted. (WebCore::attachmentTitleInactiveTextColor): Deleted. (WebCore::attachmentSubtitleTextColor): Deleted. (WebCore::attachmentProgressBarBackgroundColor): Deleted. (WebCore::attachmentProgressBarFillColor): Deleted. (WebCore::attachmentProgressBarBorderColor): Deleted. (WebCore::attachmentPlaceholderBorderColor): Deleted. * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::platformActiveSelectionBackgroundColor const): (WebCore::RenderThemeWin::platformInactiveSelectionBackgroundColor const): (WebCore::RenderThemeWin::platformActiveSelectionForegroundColor const): (WebCore::RenderThemeWin::systemColor const): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::paint): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::colorResolvingCurrentColor const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialStrokeColor): * rendering/style/SVGRenderStyle.h: (WebCore::SVGRenderStyle::initialStopColor): (WebCore::SVGRenderStyle::initialFloodColor): (WebCore::SVGRenderStyle::initialLightingColor): * svg/SVGStopElement.cpp: (WebCore::SVGStopElement::stopColorIncludingOpacity const): * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: (WebCore::SVGAnimationColorFunction::animate): * testing/MockPageOverlayClient.cpp: (WebCore::MockPageOverlayClient::drawRect): * testing/cocoa/WebViewVisualIdentificationOverlay.mm: (-[WebViewVisualIdentificationOverlay initWithWebView:kind:deprecated:]): 2020-06-01 Per Arne Vollan <pvollan@apple.com> [Win] When GraphicsLayerCA::m_uncommittedChanges is initialized with a non-zero value, nothing is painted. https://bugs.webkit.org/show_bug.cgi?id=168666 Reviewed by Maciej Stachowiak. When m_uncommittedChanges is initialized with a non-zero value, client().notifyFlushRequired() will not be called in the first call to noteLayerPropertyChanged(), see https://bugs.webkit.org/show_bug.cgi?id=64808. Covered by existing tests. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::initialize): * platform/graphics/ca/GraphicsLayerCA.h: 2020-06-01 Carlos Garcia Campos <cgarcia@igalia.com> [GTK4] Add printing support https://bugs.webkit.org/show_bug.cgi?id=212320 Reviewed by Adrian Perez de Castro. Add gtk_dialog_run() to GTK4. * platform/gtk/GtkVersioning.h: (gtk_dialog_run): 2020-06-01 Carlos Garcia Campos <cgarcia@igalia.com> [GTK4] Make inspector work https://bugs.webkit.org/show_bug.cgi?id=212321 Reviewed by Adrian Perez de Castro. Add gtk_native_dialog_run() for GTK4. * platform/gtk/GtkVersioning.h: (gtk_native_dialog_run): 2020-06-01 Rob Buis <rbuis@igalia.com> Rename ResourceResponseBase::isHTTP to isInHTTPFamily https://bugs.webkit.org/show_bug.cgi?id=208782 Reviewed by Sam Weinig. As the comment says, the method name is misleading and the method is inconsistent with the API of ResourceRequestBase, so rename it to make it clear the method can be used for both http and https protocols. No tests since no change in behavior. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): * loader/NetscapePlugInStreamLoader.cpp: (WebCore::NetscapePlugInStreamLoader::didReceiveResponse): * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::isInHTTPFamily const): (WebCore::ResourceResponseBase::isHTTP const): Deleted. * platform/network/ResourceResponseBase.h: * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::responseMIMEType const): * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::externalEntityMimeTypeAllowed): 2020-05-31 Wenson Hsieh <wenson_hsieh@apple.com> Tidy up Source/WebCore/page/DragController.h https://bugs.webkit.org/show_bug.cgi?id=212584 Reviewed by Anders Carlsson. Unindent the `DragController` class by 1 indentation level, to adhere with <https://webkit.org/code-style-guidelines/#indentation-namespace>. Also, remove some stray trailing whitespace. No change in behavior. * page/DragController.h: (WebCore::DragController::mouseIsOverFileInput const): (WebCore::DragController::numberOfItemsToBeAccepted const): (WebCore::DragController::setDidInitiateDrag): (WebCore::DragController::didInitiateDrag const): (WebCore::DragController::sourceDragOperation const): (WebCore::DragController::draggingImageURL const): (WebCore::DragController::setDragOffset): (WebCore::DragController::dragOffset const): (WebCore::DragController::dragSourceAction const): (WebCore::DragController::dragHandlingMethod const): (WebCore::DragController::documentUnderMouse const): (WebCore::DragController::dragDestinationActionMask const): (WebCore::DragController::droppedImagePlaceholders const): (WebCore::DragController::droppedImagePlaceholderRange const): (WebCore::DragController::canLoadDataFromDraggingPasteboard const): (WebCore::DragController::client const): 2020-05-31 Dean Jackson <dino@apple.com> AutoTrader crashed while browsing search results https://bugs.webkit.org/show_bug.cgi?id=212461 rdar://60733185 Reviewed by Sam Weinig. On iOS, when using WebKit1 (UIWebView), CoreAnimation would call WebGLLayer's display method from a thread that is not the Web Thread. That method was performing some GL work using ANGLE, causing a crash. Since all the WebGLLayer's display method really needs to do is swap buffers for compositing, the fix is to separate all the GL operations into a method that can be called after painting but before compositing. This should also have the added benefit that by the time CoreAnimation comes to call display on all the dirty layers, we will have already executed our expensive GPU work. The total amount of work done on the GPU is the same, but hopefully it is now all done in WebKit's paint cycle, rather than when the Window Server is trying to get CA to composite things. Covered by a new API test: WebGLPrepareDisplayOnWebThread * html/HTMLCanvasElement.h: * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::HTMLCanvasElement): (WebCore::HTMLCanvasElement::~HTMLCanvasElement): (WebCore::HTMLCanvasElement::didMoveToNewDocument): (WebCore::HTMLCanvasElement::removedFromAncestor): Add or remove the document as a CanvasObserver. (WebCore::HTMLCanvasElement::needsPreparationForDisplay): Signals whether this element is the type that needs preparation. (WebCore::HTMLCanvasElement::prepareForDisplay): Tell the WebGLRenderingContext it must prepare. * html/canvas/WebGLRenderingContextBase.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::prepareForDisplay): The WebGLRenderingContext must forward the call to prepare down to the GraphicsContextGLOpenGL. * platform/graphics/opengl/GraphicsContextGLOpenGL.h: * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::prepareForDisplay): And the GraphicsContextGLOpenGL forwards the call into the WebGLLayer. * platform/graphics/cocoa/WebGLLayer.h: * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer prepareForDisplay]): (-[WebGLLayer display]): Split the parts of the `display` method that deal with flushing the GL commands, preparing the framebuffer texture, and swapping the IOSurfaces into a new `prepareForDisplay`. This method is invoked at the end of the rendering/layout tasks, leaving the `display` method to only tell CoreAnimation about a new buffer to composite. * dom/Document.cpp: * dom/Document.h: (WebCore::Document::prepareCanvasesForDisplayIfNeeded): (WebCore::Document::canvasChanged): (WebCore::Document::canvasDestroyed): Keep a set of HTMLCanvasElements that need to be prepared so we can tell them when they need to prepare. Do this by becoming a CanvasObserver, thus getting notified when a canvas has done something that would cause painting. * page/Page.cpp: (WebCore::Page::doAfterUpdateRendering): Add a new task that asks the Document to notify all relevant canvas objects that they should prepare for display. 2020-05-31 Jer Noble <jer.noble@apple.com> [Cocoa] EME should return more helpful error code during key exchange https://bugs.webkit.org/show_bug.cgi?id=212535 <rdar://problem/60439979> Reviewed by Eric Carlson. Clients have requested that the EME API provide more helpful information when the FairPlay CDM is unable to provide the requested level of key security. Currently, we reject the update() promise with a generic "failed" error code. Instead, resolve the promise, but mark the key as "output-restricted" in the key status map, indicating that the key cannot be used with required level of security. Drive-by fix: We currently ASSERT() that the callback from removeSessionData() isn't called if the session is not a PUR session. When calling removeSessionData() on a non-PUR session, call the callback with a generic "failed" error. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const): 2020-05-31 Jer Noble <jer.noble@apple.com> [Cocoa] Transition between encrypted and clear codecs throws error from SourceBuffer.appendBuffer() https://bugs.webkit.org/show_bug.cgi?id=212550 <rdar://problem/62207260> Reviewed by Eric Carlson. CoreMedia returns a different codec 4CC code for "encrypted AVC" than it does for "clear AVC", though the underlying codec used for both is the same. While CoreMedia does use different codec implementations for each, it is capable of freely switching between the two, and the codec string used by web developers for encrypted vs. clear content is identical. So we will treat these two codecs as "the same" as it pertains to the MSE requirement that codecs contained in new initialization segments are "the same" as previous ones. Adopt kCMFormatDescriptionExtension_ProtectedContentOriginalFormat, which can query the "original" codec used for encrypted codec playback. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: 2020-05-31 Zalan Bujtas <zalan@apple.com> [iBooks] Empty pages appear in book https://bugs.webkit.org/show_bug.cgi?id=212573 <rdar://problem/62912623> Reviewed by Antti Koivisto. Do not add a page break for orphan content unless the line does not fit anymore. Test: fast/multicol/orphans-ignored.html * rendering/SimpleLineLayoutPagination.cpp: (WebCore::SimpleLineLayout::setPageBreakForLine): (WebCore::SimpleLineLayout::adjustLinePositionsForPagination): 2020-05-31 Rob Buis <rbuis@igalia.com> Implement named item condition for images https://bugs.webkit.org/show_bug.cgi?id=212473 Reviewed by Maciej Stachowiak. Implement named item condition for images, not only should we check there are both an id and a name attribute, but also that the name attribute is non-empty [1]. Behavior matches Chrome and Firefox. [1] https://html.spec.whatwg.org/multipage/dom.html#dom-document-nameditem-filter Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/nameditem-06.html * html/HTMLNameCollection.cpp: (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch): 2020-05-31 Rob Buis <rbuis@igalia.com> <area> needs to be connected in order to navigate https://bugs.webkit.org/show_bug.cgi?id=177357 Reviewed by Maciej Stachowiak. Implement second step of cannot navigate algorithm: https://html.spec.whatwg.org/#cannot-navigate Test: web-platform-tests/html/semantics/links/following-hyperlinks/activation-behavior.window.html * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::handleClick): 2020-05-30 Sam Weinig <weinig@apple.com> Extended Color: Additional color cleanups https://bugs.webkit.org/show_bug.cgi?id=212567 Reviewed by Simon Fraser. A few unrelated quality-of-life cleanups to Color and related classes: - Rename Color::asSimpleColor() to Color::asSimple() for parity with Color::asExtended(). - Move SimpleColor implementations of invertedColorWithAlpha() and asSRGBFloatComponents() to SimpleColor for parity with ExtenedColor. - Rename ExtendedColor::channels() to ExtendedColor::components() to consistency. - Adds operator[] to ColorComponents to allow direct access to components rather than requiring and additional .components[] - Using std::minmax() where possible. - Renaming colorFloatToSimpleColorByte to scaleRoundAndClampColorChannel to have a consistent naming and location of conversion to 8-bit color channels. * platform/graphics/Color.cpp: (WebCore::Color::serialized const): (WebCore::Color::cssText const): (WebCore::Color::nameForRenderTreeAsText const): (WebCore::Color::light const): (WebCore::Color::dark const): (WebCore::Color::colorWithAlpha const): (WebCore::Color::colorWithAlphaUsingAlternativeRounding const): (WebCore::Color::invertedColorWithAlpha const): (WebCore::Color::colorSpaceAndComponents const): (WebCore::Color::toSRGBASimpleColorLossy const): (WebCore::Color::toSRGBAComponentsLossy const): * platform/graphics/Color.h: (WebCore::Color::isOpaque const): (WebCore::Color::isVisible const): (WebCore::Color::alpha const): (WebCore::Color::alphaAsFloat const): (WebCore::Color::asSimple const): (WebCore::Color::isBlackColor): (WebCore::Color::isWhiteColor): (WebCore::Color::encode const): (WebCore::Color::asSimpleColor const): Deleted. * platform/graphics/ColorComponents.h: (WebCore::ColorComponents::operator[]): (WebCore::ColorComponents::operator[] const): (WebCore::=): (WebCore::perComponentMax): (WebCore::perComponentMin): * platform/graphics/ColorMatrix.h: (WebCore::Rows>::transformedColorComponents const): * platform/graphics/ColorUtilities.cpp: (WebCore::areEssentiallyEqual): (WebCore::rgbToLinearComponents): (WebCore::linearToRGBComponents): (WebCore::lightness): (WebCore::luminance): (WebCore::sRGBToHSL): (WebCore::hslToSRGB): * platform/graphics/ColorUtilities.h: (WebCore::scaleRoundAndClampColorChannel): (WebCore::scaleRoundAndClampColorChannelUsingAlternativeRounding): (WebCore::colorFloatToSimpleColorByte): Deleted. * platform/graphics/ExtendedColor.cpp: (WebCore::ExtendedColor::hash const): (WebCore::ExtendedColor::cssText const): (WebCore::ExtendedColor::colorWithAlpha const): (WebCore::ExtendedColor::invertedColorWithAlpha const): (WebCore::ExtendedColor::toSRGBAComponentsLossy const): (WebCore::ExtendedColor::isWhite const): (WebCore::ExtendedColor::isBlack const): * platform/graphics/ExtendedColor.h: (WebCore::ExtendedColor::alpha const): (WebCore::ExtendedColor::components const): (WebCore::ExtendedColor::ExtendedColor): (WebCore::operator==): (WebCore::ExtendedColor::channels const): Deleted. * platform/graphics/SimpleColor.cpp: (WebCore::makeSimpleColorFromFloats): (WebCore::makeSimpleColorFromHSLA): * platform/graphics/SimpleColor.h: (WebCore::SimpleColor::SimpleColor): (WebCore::SimpleColor::valueAsARGB const): (WebCore::SimpleColor::colorWithAlpha const): (WebCore::SimpleColor::invertedColorWithAlpha const): (WebCore::SimpleColor::asSRGBFloatComponents const): (WebCore::makeSimpleColor): * platform/graphics/cg/ColorCG.cpp: (WebCore::cachedCGColor): * platform/graphics/filters/FELighting.cpp: (WebCore::FELighting::drawLighting): * platform/graphics/filters/FETurbulence.cpp: (WebCore::toIntBasedColorComponents): * platform/graphics/filters/FilterOperation.cpp: (WebCore::BasicComponentTransferFilterOperation::transformColor const): (WebCore::InvertLightnessFilterOperation::transformColor const): (WebCore::InvertLightnessFilterOperation::inverseTransformColor const): * platform/graphics/filters/FilterOperations.cpp: (WebCore::FilterOperations::transformColor const): (WebCore::FilterOperations::inverseTransformColor const): 2020-05-30 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r262335. https://bugs.webkit.org/show_bug.cgi?id=212571 Triggered assertions in WebKit1 Reverted changeset: "Disallow responses when a response contains invalid header values" https://bugs.webkit.org/show_bug.cgi?id=184493 https://trac.webkit.org/changeset/262335 2020-05-30 Simon Fraser <simon.fraser@apple.com> For scroll container and scrolled contents layers, use the renderer style to set up the event regions https://bugs.webkit.org/show_bug.cgi?id=212570 Reviewed by Antti Koivisto. RenderLayerBacking::updateEventRegion() sets up event regions on the scroll container and scrolled contents layer using the default style, in order to fill up the m_region part of EventRegion, but we might as well pass the renderer style so that it fills up the touch-action and wheel event regions as well. Also re-use the existing event region trace points for region building. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateEventRegion): 2020-05-30 Andy Estes <aestes@apple.com> [Apple Pay] Support percentage border-radius values in -apple-pay-button https://bugs.webkit.org/show_bug.cgi?id=212559 <rdar://problem/63781881> Reviewed by Antti Koivisto. Added test cases to fast/css/appearance-apple-pay-button-border-radius.html. * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::paintApplePayButton): Used floatValueForLength() to ensure percentage lengths are resolved before passing a corner radius to PassKit. 2020-05-29 Yusuke Suzuki <ysuzuki@apple.com> [JSC] JSBigInt allocation should be graceful for OOM https://bugs.webkit.org/show_bug.cgi?id=212512 Reviewed by Mark Lam. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readBigInt): 2020-05-29 Simon Fraser <simon.fraser@apple.com> Event region painting should use the same paint flags as normal painting https://bugs.webkit.org/show_bug.cgi?id=212547 Reviewed by Sam Weinig. There are cases (see r260118) where we need to send down the correct paint flags when painting the scrolled contents layer to avoid unwanted clipping. We need to send down the one paint flag relevant for event region paints, CompositedOverflowScrollContent, for the same reasons. I could not make a testcase that shows a behavior change, but I did copy the testcase from r260118 and adapt it for event-region generation to detect future behavior changes. Test: fast/scrolling/mac/wheel-event-listener-region-inside-overflow-scroll-clipped-out.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::collectEventRegionForFragments): * rendering/RenderLayer.h: 2020-05-29 Simon Fraser <simon.fraser@apple.com> Elements with wheel event handlers inside overflow:scroll are missing from the event region https://bugs.webkit.org/show_bug.cgi?id=212545 Reviewed by Zalan Bujtas. RenderBlock::paintObject() needs to traverse into descendants if there are are wheel event handlers on the document, just as it does for elements with touch-action. Test: fast/scrolling/mac/wheel-event-listener-region-inside-overflow-scroll.html * dom/Document.h: (WebCore::Document::hasTouchEventHandlers const): (WebCore::Document::hasWheelEventHandlers const): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintObject): 2020-05-29 Rob Buis <rbuis@igalia.com> Disallow responses when a response contains invalid header values https://bugs.webkit.org/show_bug.cgi?id=184493 Reviewed by Youenn Fablet. From the Fetch specification [1]: "A value is a byte sequence that matches the following conditions: "- Contains no 0x00 (NUL) or HTTP newline bytes." [1] https://fetch.spec.whatwg.org/#concept-header-value Tests: imported/w3c/web-platform-tests/fetch/h1-parsing/resources-with-0x00-in-header.window.html imported/web-platform-tests/fetch/api/basic/header-value-combining.any.html imported/web-platform-tests/fetch/api/basic/header-value-combining.any.worker.html imported/web-platform-tests/fetch/api/basic/header-value-null-byte.any.html imported/web-platform-tests/fetch/api/basic/header-value-null-byte.any.worker.html imported/web-platform-tests/xhr/headers-normalize-response.htm * Modules/fetch/FetchHeaders.cpp: (WebCore::canWriteHeader): (WebCore::appendToHeaderMap): (WebCore::FetchHeaders::filterAndFill): * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didReceiveResponse): * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::containsInvalidHTTPHeaders const): * platform/network/ResourceResponseBase.h: 2020-05-29 Andy Estes <aestes@apple.com> [Apple Pay] Remove conditionals for ENABLE_APPLE_PAY_SESSION_V(3|4) https://bugs.webkit.org/show_bug.cgi?id=212541 Reviewed by Darin Adler. APPLE_PAY_SESSION_V(3|4) is now enabled whenever APPLE_PAY itself is enabled. * Configurations/FeatureDefines.xcconfig: * Modules/applepay/ApplePayError.idl: * Modules/applepay/ApplePayPaymentAuthorizationResult.idl: * Modules/applepay/ApplePayPaymentContact.idl: * Modules/applepay/ApplePayPaymentMethodUpdate.idl: * Modules/applepay/ApplePayRequestBase.idl: * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePayShippingContactUpdate.idl: * Modules/applepay/ApplePayShippingMethodUpdate.idl: * Modules/applepay/PaymentCoordinatorClient.cpp: (WebCore::PaymentCoordinatorClient::supportsVersion): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::computePaymentMethodErrors const): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::applePayButtonDescription const): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const): * css/CSSValueKeywords.in: * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): * rendering/RenderThemeCocoa.mm: (WebCore::toPKPaymentButtonType): * rendering/style/RenderStyleConstants.cpp: (WebCore::operator<<): * rendering/style/RenderStyleConstants.h: 2020-05-29 Jer Noble <jer.noble@apple.com> [EME] navigator.requestMediaKeySystemAccess() should reject PUR sessionTypes in private browsing mode. https://bugs.webkit.org/show_bug.cgi?id=212540 <rdar://problem/61125757> Reviewed by Eric Carlson. A MediaKeySystemAccess with a PUR session type will never be able to create media keys when created in private browsing mode. Allow clients to fail over to non-PUR session by rejecting the promise returned by requestMediaKeySystemAccess() when in private browsing mode. Test: platform/mac/media/encrypted-media/fps-ephemeral-requestMediaKeySystemAccess.html * Modules/encryptedmedia/CDM.cpp: (WebCore::CDM::getSupportedConfiguration): 2020-05-29 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Unable to paste images when composing mail at yahoo.com https://bugs.webkit.org/show_bug.cgi?id=212544 <rdar://problem/63511613> Reviewed by Megan Gardner and Andy Estes. When pasting images in the mobile version of the mail compose editor on mail.yahoo.com, mail.yahoo.com's script handles the paste by allowing images to be inserted into the DOM (i.e. by not preventing the "paste" event), and then stripping away the `src` attribute of the pasted image afterwards. This leaves behind a blank space in the email. Work around this by avoiding images when converting the contents of the pasteboard into web content on iOS. Instead, we fall back to inserting (sanitized) text, or nothing at all if there is no other representation suitable for converting into web content. Unfortunately, the mobile version of the website is loaded on iPad as well, even when the desktop website has been requested (through sending the macOS user agent and "MacIntel" navigator platform). * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::WebContentReader::readImage): * page/Quirks.cpp: (WebCore::Quirks::shouldAvoidPastingImagesAsWebContent const): * page/Quirks.h: 2020-05-29 Darin Adler <darin@apple.com> Remove things from FeatureDefines.xcconfig that are covered by PlatformEnableCocoa.h https://bugs.webkit.org/show_bug.cgi?id=212418 Rubber-stamped by Simon Fraser. * Configurations/FeatureDefines.xcconfig: Add back ENABLE_CSS_CONIC_GRADIENTS, removed by accident. 2020-05-29 Jacob Uphoff <jacob_uphoff@apple.com> Unreviewed, reverting r262289. This commit caused a test to crash internally Reverted changeset: "MediaPlayerPrivateMediaStreamAVFObjC should enqueue samples in a background thread" https://bugs.webkit.org/show_bug.cgi?id=212073 https://trac.webkit.org/changeset/262289 2020-05-27 Darin Adler <darin@apple.com> Remove things from FeatureDefines.xcconfig that are covered by PlatformEnableCocoa.h https://bugs.webkit.org/show_bug.cgi?id=212418 Reviewed by Andy Estes. * Configurations/FeatureDefines.xcconfig: Removed 83 of the 119 things defined in this file. There are 36 more that are slightly more complex that we can remove carefully later. 2020-05-29 Darin Adler <darin@apple.com> Make generate-unified-sources.sh not depend on features being listed in FEATURE_DEFINES environment variable https://bugs.webkit.org/show_bug.cgi?id=212420 Currently any #if in the Sources.txt and SourcesCocoa.txt files can check only features defined in the FeatureDefines.xcconfig file, which sets up the FEATURE_DEFINES environment variable. Instead, we'd like to pass in all the things defined in the Platform.h headers as well. We accomplish that using the FEATURE_AND_PLATFORM_DEFINES variable from the DerivedSources.make file. This was the last place using FEATURE_DEFINES directly, so it frees us up to reduce FeatureDefines.xcconfig and move feature definitions to PlatformEnableCocoa.h instead, which will be less repetitive. Reviewed by Andy Estes. * Configurations/GenerateUnifiedSources.xcconfig: Deleted. * DerivedSources-input.xcfilelist: Updated. * DerivedSources-output.xcfilelist: Updated. * DerivedSources.make: Added a rule to invoke generate-unified-sources.sh, passing FEATURE_AND_PLATFORM_DEFINES. * Scripts/generate-unified-sources.sh: Removed hard-coded use of FEATURE_DEFINES. * UnifiedSources-output.xcfilelist: Deleted. * WebCore.xcodeproj/project.pbxproj: Removed Generate Unified Sources build step, since it's now part of Generate Derived Sources. 2020-05-29 Darin Adler <darin@apple.com> [Cocoa] Pass all defines from Platform.h to various scripts, not just the ones from .xcconfig https://bugs.webkit.org/show_bug.cgi?id=212451 Reviewed by Sam Weinig. * DerivedSources.make: Run the preprocessor on Platform.h and parse the output into FEATURE_AND_PLATFORM_DEFINES. Use that and FEATURE_AND_PLATFORM_DEFINE_DEPENDENCIES whenever we need a list of defines. Also took out some Windows-specific stuff since this is now only used on Mac platforms. Use ":=" when calling $(shell) to make sure the same shell command is not invoked over and over again. 2020-05-29 Keith Rollin <krollin@apple.com> Revert switch to XCBuild https://bugs.webkit.org/show_bug.cgi?id=212530 <rdar://problem/63764632> Unreviewed build fix. Bug 209890 enabled the use of XCBuild by default. Since then, some build issues have shown up. While addressing them, temporarily turn off the use of XCBuild by default. No new tests -- build fix. * WebCore.xcodeproj/project.pbxproj: 2020-05-29 Myles C. Maxfield <mmaxfield@apple.com> REGRESSION(r261940): PLT5 is 2% regressed https://bugs.webkit.org/show_bug.cgi?id=212504 <rdar://problem/63685637> Reviewed by Wenson Hsieh. We were causing spurious style recalcs on every main frame load. No new tests because there is no behavior change. * page/Settings.yaml: 2020-05-29 Sam Weinig <weinig@apple.com> Extended Color: ColorMatrix should support smaller matrices and be constexpr https://bugs.webkit.org/show_bug.cgi?id=212477 Reviewed by Simon Fraser. - Adds the ability to specify a ColorMatrix with any number of rows or columns, useful as most of the uses ColorMatrix did not need the full 5x4. Transformation act as-if the the ColorMatrix is the identify matrix for any rows or columns not present. For example, when transforming a ColorComponents, which is 4x1, a 3x3 ColorMatrix of the form: [ a, b, c ] [ d, e, f ] [ g, h, i ] will behave as-if it looks like: [ a, b, c, 0 ] [ d, e, f, 0 ] [ g, h, i, 0 ] [ 0, 0, 0, 1 ] In practice, this means that the last component of the input vector is left unmodified. - Adds ability to use ColorMatrix in constexpr statements, which will be useful for compile time concatenation of colorspace conversion matrices in a future change but is also useful for improved space efficiency of constant matrices already used. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Remove ColorMatrix.cpp * platform/graphics/ColorComponents.h: (WebCore::ColorComponents::ColorComponents): (WebCore::ColorComponents::operator+=): (WebCore::ColorComponents::operator+ const): (WebCore::ColorComponents::operator/ const): (WebCore::ColorComponents::operator* const): (WebCore::ColorComponents::abs const): (WebCore::ColorComponents::get const): (WebCore::perComponentMax): (WebCore::perComponentMin): (WebCore::operator==): (WebCore::operator!=): Make everything constexpr and move implementations out of the declarations for clarity. * platform/graphics/ColorMatrix.cpp: Removed. * platform/graphics/ColorMatrix.h: (WebCore::ColorMatrix::ColorMatrix): (WebCore::ColorMatrix::at const): (WebCore::grayscaleColorMatrix): (WebCore::sepiaColorMatrix): (WebCore::saturationColorMatrix): (WebCore::hueRotateColorMatrix): (WebCore::ColorMatrix::transformColorComponents): (WebCore::ColorMatrix::transformedColorComponents): Re-write as a class templatized on the number of rows and columns. Moves factory functions out of the class to avoid awkwardness of having to specify a dummy size when calling them (e.g. we wouldn't want you to have to write ColorMatrix<3, 3>::grayscaleMatrix(), instead just grayscaleColorMatrix() is much nicer). * platform/graphics/ColorUtilities.cpp: (WebCore::xyzToLinearSRGB): (WebCore::linearSRGBToXYZ): (WebCore::XYZToLinearP3): (WebCore::linearP3ToXYZ): * platform/graphics/filters/FilterOperation.cpp: (WebCore::BasicColorMatrixFilterOperation::transformColor const): (WebCore::InvertLightnessFilterOperation::transformColor const): (WebCore::InvertLightnessFilterOperation::inverseTransformColor const): Adopt new ColorMatrix interface. * platform/graphics/filters/FilterOperation.h: Remove unnecessary T in forward declaration. * platform/graphics/ColorUtilities.h: (WebCore::fastMultiplyBy255): (WebCore::fastDivideBy255): Add some missing constexprs. 2020-05-29 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r262245. https://bugs.webkit.org/show_bug.cgi?id=212531 "Caused WebCore's 'Check .xcfilelists' build phase to be ~100x slower" Reverted changeset: "[Cocoa] Pass all defines from Platform.h to various scripts, not just the ones from .xcconfig" https://bugs.webkit.org/show_bug.cgi?id=212451 https://trac.webkit.org/changeset/262245 2020-05-29 Sergio Villar Senin <svillar@igalia.com> Unreviewed build fix after r262299 We replaced ScriptExecutionContext* by Document& in WebXRSpace hierarchy, so the failing ASSERT() was: 1. Invalid, there is no "context" parameter but "document" 2. Not needed anymore, as we're passing a reference * Modules/webxr/WebXRSpace.cpp: (WebCore::WebXRSpace::WebXRSpace): Removed invalid ASSERT(). 2020-05-27 Sergio Villar Senin <svillar@igalia.com> [WebXR] Implement XRSession::requestReferenceSpace() https://bugs.webkit.org/show_bug.cgi?id=212407 Reviewed by Youenn Fablet. This patch implements the requestReferenceSpace() method of the XRSession which is used to create reference spaces. A reference space establishes a space where pose data will be defined and thus is mandatory to retrieve that pose information. There are still some bits that have to implementated in follow up patches using platform code. * Modules/webxr/WebXRBoundedReferenceSpace.cpp: (WebCore::WebXRBoundedReferenceSpace::create): Added. (WebCore::WebXRBoundedReferenceSpace::WebXRBoundedReferenceSpace): Ditto. * Modules/webxr/WebXRBoundedReferenceSpace.h: * Modules/webxr/WebXRReferenceSpace.cpp: (WebCore::WebXRReferenceSpace::create): Added. (WebCore::WebXRReferenceSpace::WebXRReferenceSpace): Ditto. (WebCore::WebXRReferenceSpace::getOffsetReferenceSpace): Use the create() method. * Modules/webxr/WebXRReferenceSpace.h: * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::referenceSpaceIsSupported const): New method to check whether a reference. space is supported by session and device. (WebCore::WebXRSession::requestReferenceSpace): New method that creates reference spaces for pose data. * Modules/webxr/WebXRSession.h: * Modules/webxr/WebXRSpace.cpp: (WebCore::WebXRSpace::WebXRSpace): Store a reference to the session creating the space. * Modules/webxr/WebXRSpace.h: 2020-05-29 Simon Fraser <simon.fraser@apple.com> Update debug overlays at rendering update time https://bugs.webkit.org/show_bug.cgi?id=212510 Reviewed by Antoine Quint. Don't eagerly update the regions in debug overlays when things change; this triggers assertions for touch event overlays. Instead, just mark them dirty and update the regions at "update the rendering" time. * page/DebugPageOverlays.cpp: (WebCore::RegionOverlay::setRegionChanged): (WebCore::RegionOverlay::didMoveToPage): (WebCore::RegionOverlay::recomputeRegion): (WebCore::DebugPageOverlays::regionChanged): (WebCore::DebugPageOverlays::updateRegionIfNecessary): * page/DebugPageOverlays.h: (WebCore::DebugPageOverlays::doAfterUpdateRendering): * page/Page.cpp: (WebCore::Page::doAfterUpdateRendering): 2020-05-29 Simon Fraser <simon.fraser@apple.com> Prepare for async scrolling in passive wheel event handler regions https://bugs.webkit.org/show_bug.cgi?id=212455 Reviewed by Tim Horton. Clarify the processing for wheel events by adding OptionSet<WheelEventProcessingSteps>, which will, in future, allow us to describe the processing for an event in the passive event handler region which does scrolling on the scrolling thread, and is then sent to the main thread for DOM event dispatch. Removed ScrollingEventResult, which conflated "handled" with "send to another thread". The thread sending behavior is now encoded in the WheelEventProcessingSteps, and we can just use a bool for handled. Scrolling tree and node handleWheelEvent() functions return a WheelEventHandlingResult, which is a tuple of OptionSet<WheelEventProcessingSteps> and 'handled', allowing for a node with background-attachment:fixed to add the "send to main thread" processing step. * page/FrameView.cpp: (WebCore::FrameView::wheelEvent): * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::handleWheelEvent): * page/scrolling/ScrollingCoordinatorTypes.h: * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::determineWheelEventProcessing): (WebCore::ScrollingTree::handleWheelEvent): (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): Deleted. * page/scrolling/ScrollingTree.h: (WebCore::WheelEventHandlingResult::needsMainThreadProcessing const): (WebCore::WheelEventHandlingResult::handled): (WebCore::WheelEventHandlingResult::unhandled): (WebCore::WheelEventHandlingResult::result): * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::handleWheelEvent): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::handleWheelEvent): (WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread): * page/scrolling/ThreadedScrollingTree.h: * page/scrolling/mac/ScrollingCoordinatorMac.h: * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::handleWheelEvent): * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent): * platform/PlatformWheelEvent.cpp: (WebCore::operator<<): * platform/PlatformWheelEvent.h: 2020-05-29 Sergio Villar Senin <svillar@igalia.com> [WebXR] ActiveDOMObjects must call suspendIfNeeded() upon creation https://bugs.webkit.org/show_bug.cgi?id=212517 Reviewed by Žan Doberšek. We weren't calling suspendIfNeeded() upon ActiveDOMObjects creation (XRSession and XRSystem) and that was triggering ASSERTION FAILED: m_suspendIfNeededWasCalled. No new tests required as this was already detected by existing tests. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::WebXRSession): Call suspendIfNeeded(). * Modules/webxr/WebXRSystem.cpp: (WebCore::WebXRSystem::WebXRSystem): Call suspendIfNeeded(). 2020-05-29 Sergio Villar Senin <svillar@igalia.com> [WebXR] WebXRSystem::unregisterSimulatedXRDeviceForTesting() ASSERTs in m_immersiveDevices.contains(device) https://bugs.webkit.org/show_bug.cgi?id=212516 Reviewed by Žan Doberšek. The ASSERT that was failing was wrong. It was assuming that every simulated device should be part of the list of immersive devices. That's wrong, as devices only supporting inline sessions are not in that list. Apart from that, fake devices were not removed from the list of available devices in WebXRTest after disconnecting them all. That could potentially cause flakiness in the tests. No new test required as the current tests were properly detecting the issue. * Modules/webxr/WebXRSystem.cpp: (WebCore::WebXRSystem::registerSimulatedXRDeviceForTesting): Use XRSessionMode directly. (WebCore::WebXRSystem::unregisterSimulatedXRDeviceForTesting): Fixed the ASSERT. A simulated device might not be in the list of immersive devices if only supports inline sessions. * testing/WebXRTest.cpp: (WebCore::WebXRTest::disconnectAllDevices): Clear the list of devices after disconnecting. 2020-05-29 Youenn Fablet <youenn@apple.com> MediaPlayerPrivateMediaStreamAVFObjC should enqueue samples in a background thread https://bugs.webkit.org/show_bug.cgi?id=212073 Reviewed by Eric Carlson. Do not hop to the main thread when rendering video samples anymore. Instead, we enqueue to the display layer in the background thread but still hop to the main thread for two things: - Update of various states of the player - keep a ref to the video sample if canvas rendering is needed. Most display layer operations stay in the main thread (creation, flushing...). Deletion of the display layer and access from a background are covered by a lock. The m_canEnqueueDisplayLayer boolean ensures we do not enqueue too early when the display layer is not yet properly initialized. LocalSampleBufferDisplayLayer needs to handle the fact that enqueueing might be done in a background thread. Instead of introducing a lock, we introduce a work queue and we hop to this queue whenever we need to enqueue/mutate the pending samples. Covered by existing tests and manual testing. * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h: * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm: (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::LocalSampleBufferDisplayLayer::enqueueSample): (WebCore::LocalSampleBufferDisplayLayer::enqueueSampleBuffer): (WebCore::LocalSampleBufferDisplayLayer::requestNotificationWhenReadyForVideoData): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::videoTransformationMatrix): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::processNewVideoSampleAvailable): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::applicationDidBecomeActive): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushRenderers): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateRenderingMode): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setBufferingPolicy): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::rootLayerBoundsDidChange): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix): Deleted. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueCorrectedVideoSample): Deleted. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer): Deleted. 2020-05-29 Carlos Garcia Campos <cgarcia@igalia.com> [GTK4] Implement script dialogs https://bugs.webkit.org/show_bug.cgi?id=212318 Reviewed by Adrian Perez de Castro. Add more definitions to avoid ifdefs. * platform/gtk/GtkVersioning.h: (gtk_entry_set_text): (gtk_entry_get_text): (gtk_label_set_line_wrap): (gtk_window_set_default): (gtk_widget_add_css_class): 2020-05-28 Andy Estes <aestes@apple.com> [Apple Pay] Buttons render with a corner radius of PKApplePayButtonDefaultCornerRadius even when explicitly specifying "border-radius: 0px" https://bugs.webkit.org/show_bug.cgi?id=212476 <rdar://problem/63401433> Reviewed by Antti Koivisto. r256648 added support for customizing the corner radius of Apple Pay buttons using the border-radius CSS property. PassKit buttons have a default corner radius of 4, but border-radius has an initial value of 0, so to maintain web compatibility with existing buttons we only want to customize the corner radius when a border-radius value has been explicitly specified (otherwise, previously rounded buttons would all become squared off due to border-radius's initial value). r256648 checked for a non-initial border-radius by calling RenderStyle::hasBorderRadius, but this check does not distinguish between an initial value and an explicit declaration of "border-radius: 0px". As a result, authors are unable to create Apple Pay buttons with square corners. This patch adds a flag to RenderStyle::NonInheritedFlags that tracks whether any border-radius longhand has been explicitly set (or has explicitly inherited an explicitly set value), and uses that flag to adjust the computed border radius for Apple Pay buttons. The addition of RenderStyle::NonInheritedFlags::hasExplicitlySetBorderRadius did not change the size of RenderStyle. Tests: fast/css/appearance-apple-pay-button-border-radius.html fast/css/getComputedStyle/computed-style-apple-pay-button.html * css/CSSProperties.json: * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::adjustApplePayButtonStyle const): (WebCore::RenderThemeCocoa::paintApplePayButton): (WebCore::largestCornerRadius): Deleted. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::RenderStyle): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::hasExplicitlySetBorderRadius const): (WebCore::RenderStyle::setHasExplicitlySetBorderRadius): (WebCore::RenderStyle::NonInheritedFlags::operator== const): (WebCore::RenderStyle::NonInheritedFlags::copyNonInheritedFrom): * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyInheritBorderBottomLeftRadius): (WebCore::Style::BuilderCustom::applyValueBorderBottomLeftRadius): (WebCore::Style::BuilderCustom::applyInheritBorderBottomRightRadius): (WebCore::Style::BuilderCustom::applyValueBorderBottomRightRadius): (WebCore::Style::BuilderCustom::applyInheritBorderTopLeftRadius): (WebCore::Style::BuilderCustom::applyValueBorderTopLeftRadius): (WebCore::Style::BuilderCustom::applyInheritBorderTopRightRadius): (WebCore::Style::BuilderCustom::applyValueBorderTopRightRadius): 2020-05-28 Andy Estes <aestes@apple.com> Shrink StyleRareNonInheritedData by 8 bytes (on 64-bit platforms) https://bugs.webkit.org/show_bug.cgi?id=212484 Reviewed by Tim Horton. There were 4 bytes of padding after shapeImageThreshold, enough to fit order and shrink the overall size of StyleRareNonInheritedData by 8 bytes on 64-bit platforms. Before: Total byte size: 480 Total pad bytes: 50 Padding percentage: 10.42 % After: Total byte size: 472 Total pad bytes: 42 Padding percentage: 8.90 % * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: 2020-05-28 Megan Gardner <megan_gardner@apple.com> Responding to post commit review comments for https://bugs.webkit.org/show_bug.cgi?id=212060 * editing/InsertIntoTextNodeCommand.cpp: (WebCore::InsertIntoTextNodeCommand::doApply): 2020-05-28 Simon Fraser <simon.fraser@apple.com> Simplify EventDispatcher wheel event dispatch https://bugs.webkit.org/show_bug.cgi?id=212490 Reviewed by Tim Horton. The various cross-thread bounces and completion lambdas in EventDispatcher::wheelEvent() and ScrollingTree code made the logic very hard to follow. Moving the ScrollingThread::dispatch() into EventHandler code simplifies things a little, and allows for removal of the hokey "try to handle" ScrollingTree function, as well as the clunky completion function. Now, EventHandler call shouldHandleWheelEventSynchronously(), then does the ScrollingThread::dispatch() which allows the lambda to easily call back into EventHandler for the main thread dispatch. * page/scrolling/ScrollingTree.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::tryToHandleWheelEvent): Deleted. * page/scrolling/ThreadedScrollingTree.h: 2020-05-28 Oriol Brufau <obrufau@igalia.com> [css-grid] Fix referencing grid line names with auto repeat() https://bugs.webkit.org/show_bug.cgi?id=209572 Reviewed by Darin Adler. This patch fixes multiple problems when referencing named grid lines with the presence of the auto repeat() syntax: - If the 1st track was defined with auto repeat(), then the code used to assume that the referenced line appeared after the repeated tracks. But it may actually precede them. - If the referenced line appeared both inside and outside the auto repeat(), then it could resolve to the outside raw index, without expanding the auto repeat(). - The logic for placing a placement property set to both an integer and an identifier was wrong with auto repeat(). This patch fixes it by using the same proper logic that was already implemented in OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex - The indices of both implicit grid lines defined with grid-template-areas and explicit ones defined with grid-template-rows/columns used to be stored together in NamedGridColumnLines and NamedGridRowLines. This was problematic because the former indices already refer to the final explicit grid so they don't have to be increased when expanding an auto repeat(), but the latter ones should. Therefore, this patch stores the indices in separate fields and uses the correct logic for each one. This also fixes 'grid-template-areas: inherit'. This patch is a port of these Chromium patches: - https://crrev.com/744426 - https://crrev.com/745925 - https://crrev.com/747631 - https://crrev.com/747669 - https://crrev.com/771984 Tests: imported/w3c/web-platform-tests/css/css-grid/placement/grid-placement-using-named-grid-lines-002.html imported/w3c/web-platform-tests/css/css-grid/placement/grid-placement-using-named-grid-lines-004.html imported/w3c/web-platform-tests/css/css-grid/placement/grid-placement-using-named-grid-lines-005.html imported/w3c/web-platform-tests/css/css-grid/placement/grid-placement-using-named-grid-lines-008.html imported/w3c/web-platform-tests/css/css-grid/placement/grid-placement-using-named-grid-lines-009.html * rendering/style/GridPositionsResolver.cpp: (WebCore::NamedLineCollection::NamedLineCollection): (WebCore::NamedLineCollection::hasExplicitNamedLines const): (WebCore::NamedLineCollection::hasNamedLines const): (WebCore::NamedLineCollection::contains const): (WebCore::NamedLineCollection::firstExplicitPosition const): (WebCore::NamedLineCollection::firstPosition const): * rendering/style/GridPositionsResolver.h: * rendering/style/RenderStyle.h: (WebCore::RenderStyle::implicitNamedGridColumnLines const): (WebCore::RenderStyle::implicitNamedGridRowLines const): (WebCore::RenderStyle::setImplicitNamedGridColumnLines): (WebCore::RenderStyle::setImplicitNamedGridRowLines): * rendering/style/StyleGridData.cpp: (WebCore::StyleGridData::StyleGridData): * rendering/style/StyleGridData.h: (WebCore::StyleGridData::operator== const): * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyInitialGridTemplateAreas): (WebCore::Style::BuilderCustom::applyInheritGridTemplateAreas): (WebCore::Style::BuilderCustom::applyValueGridTemplateAreas): 2020-05-28 Andres Gonzalez <andresg_22@apple.com> [ macOS Debug ] accessibility/roles-exposed.html is a flaky timeout https://bugs.webkit.org/show_bug.cgi?id=212478 <rdar://problem/63411656> Reviewed by Chris Fleizach. Logging the backingObject in every call to accessibilityAttributeValue seems to be causing this long test to take too long and timeout in slow systems. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 2020-05-27 Keith Miller <keith_miller@apple.com> for-of should check the iterable is a JSArray for FastArray in DFG iterator_open https://bugs.webkit.org/show_bug.cgi?id=212383 Reviewed by Saam Barati. Update various InheritsTraits specializations to contain a typeRange member. Also, change the inherits function to use inheritsJSTypeImpl like the JSC variants. * bindings/js/JSDocumentCustom.h: (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSDocument>::inherits): * bindings/js/JSElementCustom.h: (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSElement>::inherits): * bindings/js/JSEventCustom.h: (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSEvent>::inherits): * bindings/js/JSNodeCustom.h: (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSNode>::inherits): * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): 2020-05-27 Darin Adler <darin@apple.com> [Cocoa] Pass all defines from Platform.h to various scripts, not just the ones from .xcconfig https://bugs.webkit.org/show_bug.cgi?id=212451 Reviewed by Sam Weinig. * DerivedSources.make: Run the preprocessor on Platform.h and parse the output into FEATURE_AND_PLATFORM_DEFINES. Use that and FEATURE_AND_PLATFORM_DEFINE_DEPENDENCIES whenever we need a list of defines. Also took out some Windows-specific stuff since this is now only used on Mac platforms. 2020-05-27 Simon Fraser <simon.fraser@apple.com> ScrollingTreeMac::eventListenerRegionTypesForPoint() needs to convert the point to local coordinates https://bugs.webkit.org/show_bug.cgi?id=212440 Reviewed by Tim Horton. ScrollingTreeMac::eventListenerRegionTypesForPoint() needs to convert the point to local coordinates before consulting the event region. Also made EventListenerRegionType loggabale. Will be tested by wheel event tests once we switch to using these kinds of regions. * page/scrolling/mac/ScrollingTreeMac.mm: (collectDescendantLayersAtPoint): (ScrollingTreeMac::scrollingNodeForPoint): (ScrollingTreeMac::eventListenerRegionTypesForPoint const): * rendering/style/RenderStyleConstants.cpp: (WebCore::operator<<): * rendering/style/RenderStyleConstants.h: 2020-05-28 Youenn Fablet <youenn@apple.com> RealtimeIncomingVideoSourceCocoa::OnFrame should use video frame timestamp https://bugs.webkit.org/show_bug.cgi?id=212402 Reviewed by Eric Carlson. Use timestamp provided from the libwebrtc backend instread of marking the frames as display immediately. Update LocalSampleBufferDisplayLayer to mark the frame as display immediately if their presentation time is in the past since we guarantee the frames are in order. Remove the offset correction in MediaPlayerPrivateMediaStreamAVFObjC. This does not work well when the display layer is in GPU process and it is simpler to use the system clock which is what AVSampleBufferDisplayLayser is using if controlTimebase is not set. Manually tested. * platform/graphics/avfoundation/SampleBufferDisplayLayer.h: * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm: (WebCore::LocalSampleBufferDisplayLayer::enqueueSample): (WebCore::LocalSampleBufferDisplayLayer::removeOldSamplesFromPendingQueue): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferDisplayLayerStatusDidChange): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::applicationDidBecomeActive): * platform/mediastream/VideoTrackPrivateMediaStream.h: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame): 2020-05-28 Antti Koivisto <antti@apple.com> Incorrect clipping of absolute and fixed elements inside stacking-context composited overflow:hidden https://bugs.webkit.org/show_bug.cgi?id=212419 <rdar://problem/55856170> Reviewed by Simon Fraser. We incorrectly clip descendants that are not in containing block chain. There is already code to do the correct clipping, it just needs be enabled in this case. Tests: compositing/overflow/non-contained-descendant-clipping-absolute.html compositing/overflow/non-contained-descendant-clipping-fixed.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): * rendering/RenderLayer.h: Add hasCompositedNonContainedDescendants bit. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const): (WebCore::RenderLayerCompositor::CompositingState::updateWithDescendantStateAndLayer): Check if the parent layer is for a containing block of this layer. (WebCore::RenderLayerCompositor::computeCompositingRequirements): Update the bit. (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::clipsCompositingDescendants): Pick the clipping path where descendants are not clipped. 2020-05-27 Noam Rosenthal <noam@webkit.org> Implement AccessKeyLabel attribute. https://bugs.webkit.org/show_bug.cgi?id=72715 Spec: https://html.spec.whatwg.org/multipage/interaction.html#dom-accesskeylabel As per spec, return the modifiers+accessKey when requesting the element accessKeyLabel. Equivalent to the existing Firefox implementation and (pending) Chrome implementation. Alt is the hardcoded modifier for any non-cocoa platform, so hardcode it also for the label. Use modifier text for Mac/iOS as it can change (e.g. for voice-over). Reviewed by Darin Adler. Test: fast/forms/access-key-label.html * html/HTMLElement.cpp: (WebCore::HTMLElement::accessKeyLabel const): * html/HTMLElement.h: * html/HTMLElement.idl: 2020-05-27 Sam Weinig <weinig@apple.com> Extended Color: Refactor FloatComponents and ColorComponents into a single templatized ColorComponents class https://bugs.webkit.org/show_bug.cgi?id=212446 Reviewed by Simon Fraser. Merge FloatComponents and ColorComponents into ColorComponents<T> and move them to their own header. This avoids duplicate code and paves the way for further generalization down the line. Also moves some utility functions to ColorUtilities.h from SimpleColor.h as they make more sense in the former. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: Add ColorComponents.h * platform/graphics/ColorComponents.h: Copied from Source/WebCore/platform/graphics/ColorUtilities.h. Moved ColorComponents to its own header and templatized it to allow it to serve the needs of both the old ColorComponents and old FloatComponents classes. * platform/graphics/ColorUtilities.cpp: * platform/graphics/ColorUtilities.h: Removed ColorComponents/FloatComponents and update existing usages to their new names. Also moved roundAndClampColorChannel, fastMultiplyBy255, fastDivideBy255 and colorFloatToSimpleColorByte here from SimpleColor to make it clear where general helper functions can go. * platform/graphics/Color.h: * platform/graphics/Color.cpp: (WebCore::Color::colorSpaceAndComponents const): (WebCore::Color::toSRGBAComponentsLossy const): * platform/graphics/ExtendedColor.h: (WebCore::ExtendedColor::channels const): Update for rename of FloatComponents to ColorComponents<float>. * platform/graphics/SimpleColor.cpp: (WebCore::makeSimpleColorFromHSLA): Use structured bindings and simplify code. * platform/graphics/SimpleColor.h: (WebCore::roundAndClampColorChannel): Deleted. (WebCore::fastMultiplyBy255): Deleted. (WebCore::fastDivideBy255): Deleted. (WebCore::colorFloatToSimpleColorByte): Deleted. As noted above, moved roundAndClampColorChannel, fastMultiplyBy255, fastDivideBy255 and colorFloatToSimpleColorByte to ColorUtilities.h * platform/graphics/filters/FEColorMatrix.cpp: Update for rename of FloatComponents to ColorComponents<float>. * platform/graphics/filters/FEDisplacementMap.cpp: (WebCore::byteOffsetOfPixel): Moved byteOffsetOfPixel here from ColorUtilities. This file is the only user and it wasn't general in a way that was clear for other users. * platform/graphics/filters/FELighting.cpp: (WebCore::FELighting::drawLighting): Update for rename of FloatComponents to ColorComponents<float>. * platform/graphics/filters/FEMorphology.cpp: (WebCore::makeColorComponentsfromPixelValue): Added. Used to be ColorComponents::fromRGBA(), but was only used here and didn't seem generally useful. (WebCore::makePixelValueFromColorComponents): Added. Used to be ColorComponents::toRGBA(), but was only used here and didn't seem generally useful. (WebCore::minOrMax): (WebCore::columnExtremum): (WebCore::kernelExtremum): (WebCore::FEMorphology::platformApplyGeneric): Update for rename of FloatComponents to ColorComponents<float> and ColorComponents to ColorComponents<uint8_t>. * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::noise2D const): (WebCore::toIntBasedColorComponents): (WebCore::FETurbulence::calculateTurbulenceValueForPoint const): (WebCore::FETurbulence::fillRegion const): * platform/graphics/filters/FETurbulence.h: Update for rename of FloatComponents to ColorComponents<float> and ColorComponents to ColorComponents<uint8_t>. Also renames toColorComponents to toIntBasedColorComponents as the former was no longer specific enough. Updated to use std::clamp. * platform/graphics/filters/FilterOperation.cpp: (WebCore::BasicColorMatrixFilterOperation::transformColor const): (WebCore::BasicComponentTransferFilterOperation::transformColor const): (WebCore::InvertLightnessFilterOperation::transformColor const): (WebCore::InvertLightnessFilterOperation::inverseTransformColor const): * platform/graphics/filters/FilterOperation.h: (WebCore::FilterOperation::transformColor const): (WebCore::FilterOperation::inverseTransformColor const): * platform/graphics/filters/FilterOperations.cpp: (WebCore::FilterOperations::transformColor const): (WebCore::FilterOperations::inverseTransformColor const): Update for rename of FloatComponents to ColorComponents<float>. 2020-05-27 David Kilzer <ddkilzer@apple.com> REGRESSION (r260023): ITP sparse plist decoding. <https://bugs.webkit.org/show_bug.cgi?id=212424> <rdar://problem/63683055> Reviewed by John Wilander. Reverted changeset: "KeyedDecoder functions in ResourceLoadStatistics.{cpp,h} should return bool and use WARN_UNUSED_RETURN" https://bugs.webkit.org/show_bug.cgi?id=210414 https://trac.webkit.org/changeset/260023 The revert did not compile due to changes in the KeyedDecoder class that require checking the return value of its methods, so additional changes were made below. * loader/ResourceLoadStatistics.cpp: (WebCore::decodeHashCountedSet): (WebCore::decodeHashSet): - Use IGNORE_WARNINGS_BEGIN("unused-result")/IGNORE_WARNINGS_END to suppress warning about ignoring the return value from KeyeDecoder::decodeObjects() since decoding these objects is optional. (WebCore::decodeOptionSet): - Check return value of KeyedDecoder::decodeUInt64() before setting `optionSet` parameter. 2020-05-27 Andres Gonzalez <andresg_22@apple.com> Empty alt attribute does not ignore the image for accessibility clients in Safari. https://bugs.webkit.org/show_bug.cgi?id=212432 Reviewed by Chris Fleizach. Test: accessibility/img-alt-attribute-unassigned-empty.html - AccessibilityRenderObject::computeAccessibilityIsIgnored was handling the case of images too late, after checking for ariaRoleAttribute(). So if an image had a role attribute, it was exposed regardless whether its alt attribute was an empty string. This change moves the handling of images above the check for ariaroleAttribute and hence honors the empty alt attribute rule. - Also images that have an aria-label attribute are now exposed. - Added logging of AccessibilityObjectInclusion. - Changed signature of log(RefPtr<AXCoreObject>) as pointed out by Darin Adler in a separate review. * accessibility/AXLogger.cpp: (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::determineAccessibilityRole): (WebCore::AccessibilityNodeObject::isImage const): Moved to base class. * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: (WebCore::AXCoreObject::isImage const): * accessibility/AccessibilityRenderObject.cpp: (WebCore::objectInclusionFromAltText): (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const): (WebCore::AccessibilityRenderObject::determineAccessibilityRole): (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): * accessibility/isolatedtree/AXIsolatedObject.h: 2020-05-27 Chris Dumez <cdumez@apple.com> pageshow only fires the first time the back button is pressed https://bugs.webkit.org/show_bug.cgi?id=156356 <rdar://problem/29256489> Reviewed by Alexey Proskuryakov. When FrameLoader::commitProvisionalLoad() would restore a page from the back/forward cache, it would only call FrameLoader::checkCompleted() in the main frame and fail to do so in subframes. Calling checkCompleted() is important, not only because it sets m_isComplete to true but also because it calls checkCallImplicitClose(), which resets m_didCallImplicitClose to true and m_wasUnloadEventEmitted to false. Because checkCompleted() was not called, FrameLoader::dispatchUnloadEvents() would then fail to fire the pagehide event because the `m_didCallImplicitClose && !m_wasUnloadEventEmitted` was not met. Also, even though checkCompleted() was called for the main frame, if there are subframes, it would just return early because allChildrenAreComplete() returned false. Later on, when trying to fire the pageshow event, it would fail to because we have logic in DOMWindow::dispatchEvent() to avoid firing a pageshow event if we did not previously send a pagehide event. To address the issue, I now call checkCompleted() in FrameLoader::open() for subframes, as this gets called for every frame during restoration from the back/forward cache. For the main frame, we keep calling checkCompleted(), after we've called sendRemainingDelegateMessages(). Test: fast/history/multiple-back-forward-navigations.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::open): 2020-05-27 Sam Weinig <weinig@apple.com> Extended Color: Move ColorMatrix to its own files https://bugs.webkit.org/show_bug.cgi?id=212431 Reviewed by Dean Jackson. Move ColorMatrix to its own files from ColorUtilities.h/cpp * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/ColorMatrix.cpp: Copied from Source/WebCore/platform/graphics/ColorUtilities.cpp. * platform/graphics/ColorMatrix.h: Copied from Source/WebCore/platform/graphics/ColorUtilities.h. * platform/graphics/ColorUtilities.cpp: * platform/graphics/ColorUtilities.h: * platform/graphics/filters/FilterOperation.cpp: 2020-05-27 David Kilzer <ddkilzer@apple.com> Add OptionSetTraits<> and use with WebCore::DragDestinationAction <https://webkit.org/b/212397> Reviewed by Alex Christensen. * page/DragActions.h: (WTF::OptionSetTraits<WebCore::DragDestinationAction>): - Add for use with OptionSet<>. 2020-05-27 Wenson Hsieh <wenson_hsieh@apple.com> [Clipboard API] Support reading "image/png" on ClipboardItem https://bugs.webkit.org/show_bug.cgi?id=212339 <rdar://problem/63588957> Reviewed by Tim Horton. Adds support for reading "image/png" data via ClipboardItem.getType(). See below for more details. Tests: ClipboardTests.ConvertTIFFToPNGWhenPasting editing/async-clipboard/clipboard-read-write-images.html * Modules/async-clipboard/Clipboard.cpp: (WebCore::Clipboard::getType): (WebCore::Clipboard::updateSessionValidity): Factor out logic for invalidating the `Clipboard`'s active `Pasteboard` object into a helper method. This is invoked after reading data from the clipboard, and verifies that the changeCount of the pasteboard is still the same as it was upon initially reading the contents of the clipboard. If the clipboard contents changed, we invalidate the session, and `Clipboard` is subsequently denied pasteboard access (until the next time the user explicitly grants programmatic pasteboard access). Note that this step is here for correctness rather than security. While it is true that a compromised web process could fake the changeCount at any given moment, other fairly recent changes around WebPasteboardProxy in the UI process makes it impossible to take advantage of this fact to arbitrarily read content from the system pasteboard. Instead of simply reading the empty string, this invalidation ensures that we actually reject the promise returned by the async clipboard API. * Modules/async-clipboard/Clipboard.h: * Modules/async-clipboard/ClipboardImageReader.cpp: Added. Add a PasteboardFileReader subclass that is responsible for sanitizing image data from the pasteboard into data that may be exposed to the page via clipboard API. On both macOS and iOS, this ensures that potentially sensitive EXIF data is stripped via conversion to the platform image type and back. On macOS, this additionally allows us to handle transcoding TIFF data on the pasteboard to PNG (this is covered by the new API test). (WebCore::ClipboardImageReader::readBuffer): Add a stub implementation for non-Cocoa platforms for now, which don't implement this part of the API. (WebCore::ClipboardImageReader::shouldReadBuffer const): Add a new hook to skip over certain types when reading pasteboard data into Files. In particular, `ClipboardImageReader` skips over any MIME type that does not match the MIME type specified (for now, this is limited to "image/png", but may be extended to include more image types in the future after we implement more transcoding logic). * Modules/async-clipboard/ClipboardImageReader.h: Added. (WebCore::ClipboardImageReader::ClipboardImageReader): (WebCore::ClipboardImageReader::takeResult): * Modules/async-clipboard/ios/ClipboardImageReaderIOS.mm: Added. (WebCore::ClipboardImageReader::readBuffer): Add iOS-specific `(PNG) => PNG` transcoding logic. * Modules/async-clipboard/mac/ClipboardImageReaderMac.mm: Added. (WebCore::ClipboardImageReader::readBuffer): Add macOS-specific `(PNG, TIFF) => PNG` transcoding logic. * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/Pasteboard.h: (WebCore::PasteboardFileReader::shouldReadBuffer const): * platform/cocoa/PasteboardCocoa.mm: (WebCore::Pasteboard::read): Add support for targeting a given pasteboard item index when reading files on Cocoa platforms. * platform/gtk/PasteboardGtk.cpp: (WebCore::Pasteboard::read): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): (WebCore::webSafeTypes): (WebCore::PlatformPasteboard::informationForItemAtIndex): Expose "image/png" as one of the readable pasteboard types on iOS when using the async clipboard API. For some reason, this adjustment was made on macOS, but wasn't done on iOS, which led to a missing "image/png" type when asking for `ClipboardItem.types`. (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Add support for writing "image/png "data to the system pasteboard (note that this data has been sanitized already, as it has been processed through `ClipboardItemTypeLoader::sanitizeDataIfNeeded()`). We simply needed to use `forEachPlatformStringOrBuffer` instead of just `forEachPlatformString` when writing the custom pasteboard data. (WebCore::createItemProviderRegistrationList): * platform/libwpe/PasteboardLibWPE.cpp: (WebCore::Pasteboard::read): * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::read): 2020-05-27 Said Abou-Hallawa <sabouhallawa@apple.com> REGRESSION (r254541): Valid mime types can only be added to the HashSet of the supported types for encoding https://bugs.webkit.org/show_bug.cgi?id=212427 Reviewed by Darin Adler. Add back a check for the mime type validity which was removed in r254541. * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::createMIMETypeRegistryThreadGlobalData): 2020-05-27 Devin Rousso <drousso@apple.com> Web Inspector: replace `featureGuard` and `availability` with a combined `condition` that accepts any macro https://bugs.webkit.org/show_bug.cgi?id=210014 Reviewed by Brian Burg. Previously, the generated InspectorBackendCommands.js would include code for things that the backend doesn't actually support. By using actual macros and preprocessing that file, we can ensure that the frontend doesn't incorrectly think that something is supported by the page being inspected: - the `Canvas` commands and events related to shader programs/pipelines should only exist when the corresponding context type exists, namely `ENABLE(WEBGL)` and `ENABLE(WEBGPU)`. - iOS doesn't support showing rulers, so create a variant of `DOM.setInspectModeEnabled` that only exists for `PLATFORM(IOS_FAMILY)` that doesn't have the `showRulers` optional parameter, as well as removing `Page.setShowRulers` entirely. - setting the forced appearance should only be possible if dark mode is supported. - web archives only exist if CF is used. * inspector/InspectorInstrumentation.h: * inspector/InspectorInstrumentation.cpp: * inspector/agents/InspectorCanvasAgent.h: * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::InspectorCanvasAgent): (WebCore::InspectorCanvasAgent::enable): (WebCore::InspectorCanvasAgent::startRecording): (WebCore::InspectorCanvasAgent::reset): (WebCore::InspectorCanvasAgent::unbindCanvas): * inspector/InspectorShaderProgram.h: * inspector/InspectorShaderProgram.cpp: (WebCore::InspectorShaderProgram::requestShaderSource): (WebCore::InspectorShaderProgram::updateShader): * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::setInspectModeEnabled): * inspector/agents/InspectorPageAgent.h: * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::enable): (WebCore::InspectorPageAgent::disable): (WebCore::InspectorPageAgent::setForcedAppearance): (WebCore::InspectorPageAgent::archive): * Configurations/FeatureDefines.xcconfig: Add `ENABLE_WEB_ARCHIVE` since it's always enabled in wtf/PlatformEnableCocoa.h. * inspector/InspectorFrontendHost.idl: Drive-by: replace the `#if` with the IDL `[Conditional=]`. 2020-05-27 Miguel Gomez <magomez@igalia.com> [WPE] REGRESSION(r253675) Crash when using threaded rendering https://bugs.webkit.org/show_bug.cgi?id=212404 Reviewed by Carlos Garcia Campos. Check whether the GraphicsContext has a PlatformGraphicsContext before trying to paint with it. If there's no PlatformGraphicsContext, paint using the GraphicsContext methods instead. * platform/graphics/cairo/ImageBufferCairoBackend.cpp: (WebCore::ImageBufferCairoBackend::draw): (WebCore::ImageBufferCairoBackend::drawPattern): 2020-05-27 Carlos Garcia Campos <cgarcia@igalia.com> Unreviewed. Fix build warning with GTK4 * platform/gtk/GtkUtilities.cpp: (WebCore::widgetRootCoords): 2020-05-27 David Kilzer <ddkilzer@apple.com> Use OptionSet<DragDestinationAction> for mask values <https://webkit.org/b/212115> <rdar://problem/63423380> Reviewed by Alex Christensen. DragDestinationAction is used as both individual values and as a bit mask. This changes bit mask uses to OptionSet<> and renames variables to denote masks. * page/DragActions.h: (WebCore::DragDestinationAction): - Convert to enum class and remove *None and *Any values. (WebCore::DragDestinationActionAny): - Add helper function to return OptionSet<DragDestinationAction> with all values set. * page/DragController.cpp: (WebCore::DragController::performDragOperation): (WebCore::DragController::dragEnteredOrUpdated): (WebCore::DragController::tryDocumentDrag): (WebCore::DragController::concludeEditDrag): * page/DragController.h: (WebCore::DragController::dragDestinationAction const): Rename. (WebCore::DragController::dragDestinationActionMask const): - Rename dragDestinationAction() to dragDestinationActionMask(). * platform/DragData.cpp: (WebCore::DragData::DragData): * platform/DragData.h: (WebCore::DragData::DragData): - Use DragDestinationActionAny() in place of removed DragDestinationActionAny. (WebCore::DragData::dragDestinationAction const): Rename. (WebCore::DragData::dragDestinationActionMask const): - Rename dragDestinationAction() to dragDestinationActionMask(). (WebCore::DragData::operator =): * platform/cocoa/DragDataCocoa.mm: (WebCore::DragData::DragData): 2020-05-27 Youenn Fablet <youenn@apple.com> Video freezes when attaching a local MediaStream to multiple elements https://bugs.webkit.org/show_bug.cgi?id=194802 <rdar://problem/63613107> Reviewed by Eric Carlson. AVSampleBufferDisplayLayer sometimes does not update the rendering when the same local source is rendered several times. To workaround this, we set kCMSampleAttachmentKey_DisplayImmediately to true, which fixes the issue as per my testing. We clone the sample buffer before setting this property as it might not be thread safe to modify the attachments of a sample that might also be encoded. We implement this at LocalSampleBufferDisplayLayer level and enable this for local capture sources only. Manually tested. * platform/graphics/avfoundation/SampleBufferDisplayLayer.h: (WebCore::SampleBufferDisplayLayer::setRenderPolicy): * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.h: (WebCore::LocalSampleBufferDisplayLayer::setRenderPolicy): * platform/graphics/avfoundation/objc/LocalSampleBufferDisplayLayer.mm: (WebCore::LocalSampleBufferDisplayLayer::enqueueSample): (WebCore::LocalSampleBufferDisplayLayer::removeOldSamplesFromPendingQueue): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::setSampleBufferAsDisplayImmediately): (WebCore::MediaSampleAVFObjC::setAsDisplayImmediately): (WebCore::MediaSampleAVFObjC::cloneSampleBuffer): 2020-05-19 Sergio Villar Senin <svillar@igalia.com> [WebXR] Implement XRSession::requestAnimationFrame() https://bugs.webkit.org/show_bug.cgi?id=212099 Reviewed by Youenn Fablet. The WebXR spec defines a requestAnimationFrame() mechanism to provide information about XR tracking devices using callbacks. It's pretty similar to the requestAnimationFrame() exposed by Window but only used to update WebXR content. We're adding a basic implementation of this mechanism as long as cancellation support. It requires some platform code that will be added in follow up patches. That platform code will provide information like devices' refresh rates, pose (position & orientation), display resolution, etc... This patch also replaces the type of the callback id from int to unsigned int as per the following change in specs https://github.com/immersive-web/webxr/pull/1062. Apart from that we're adding a missing adoptRef() in the testing code that was causing assertions in some of the tests that are being unskipped as part of this change. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::WebXRSession): (WebCore::WebXRSession::animationTimerFired): Added. (WebCore::WebXRSession::scheduleAnimation): Ditto. (WebCore::WebXRSession::requestAnimationFrame): Ditto. (WebCore::WebXRSession::cancelAnimationFrame): * Modules/webxr/WebXRSession.h: * Modules/webxr/XRFrameRequestCallback.h: (WebCore::XRFrameRequestCallback::callbackId): (WebCore::XRFrameRequestCallback::setCallbackId): (WebCore::XRFrameRequestCallback::cancel): (WebCore::XRFrameRequestCallback::isCancelled const): * testing/WebFakeXRDevice.cpp: (WebCore::WebFakeXRDevice::simulateInputSourceConnection): * testing/WebFakeXRDevice.h: * testing/WebFakeXRInputController.h: 2020-05-27 Carlos Garcia Campos <cgarcia@igalia.com> [GTK4] Make PointerLock work https://bugs.webkit.org/show_bug.cgi?id=212314 Reviewed by Adrian Perez de Castro. * platform/gtk/GtkUtilities.cpp: (WebCore::widgetDevicePosition): Helper function to avoid #ifdefs due to GTK version differences. * platform/gtk/GtkUtilities.h: 2020-05-27 Peng Liu <peng.liu6@apple.com> VideoFullscreenInterfaceAVKit is leaking when a video element enters and exits fullscreen/picture-in-picture https://bugs.webkit.org/show_bug.cgi?id=212293 Reviewed by Youenn Fablet. WebAVPlayerViewControllerDelegate is created and retained by VideoFullscreenInterfaceAVKit, but it has a RefPtr to VideoFullscreenInterfaceAVKit. This leads to a memory leak when a video element enters and exit fullscreen or Picture-in-Picture. This patch replaces the RefPtr with a WeakPtr to fix the leak. With this patch, we config playerController in VideoFullscreenInterfaceAVKit::setupFullscreen() and VideoFullscreenInterfaceAVKit::cleanupFullscreen(), so that we can avoid relying on VideoFullscreenManagerProxy::setHasVideo() and VideoFullscreenManagerProxy::setVideoDimensions(). Those two functions are driven by IPC messages from the Web process, which may come before VideoFullscreenInterfaceAVKit is constructed or after VideoFullscreenInterfaceAVKit is destroyed. Manually tested. * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerViewControllerDelegate setFullscreenInterface:]): (VideoFullscreenInterfaceAVKit::setupFullscreen): (VideoFullscreenInterfaceAVKit::cleanupFullscreen): 2020-05-27 Carlos Garcia Campos <cgarcia@igalia.com> [GTK][WTR] EventSender: stop using GdkEvent API in preparation for GTK4 https://bugs.webkit.org/show_bug.cgi?id=212298 Reviewed by Adrian Perez de Castro. Add helpers to GtkUtilities to avoid #ifdefs due to GTK version differences. * platform/gtk/GtkUtilities.cpp: (WebCore::widgetRootCoords): (WebCore::widgetKeyvalToKeycode): * platform/gtk/GtkUtilities.h: 2020-05-26 Said Abou-Hallawa <sabouhallawa@apple.com> SMILTimeContainer must protect its m_scheduledAnimations while it does updateAnimations() https://bugs.webkit.org/show_bug.cgi?id=212192 <rdar://problem/56717734> Reviewed by Youenn Fablet. updateAnimations() needs to protect m_scheduledAnimations while processing the scheduled animations. m_scheduledAnimations may be changed from JavaScript callbacks. This will invalidate the HashMap iterators while the one used by the for-loop in updateAnimations() is still in use. To allow copying m_scheduledAnimations, the value of the entry has to be of type AnimationVector instead of std::unique_ptr<AnimationVector>. Test: svg/animations/css-animation-reinsert-target.html * svg/animation/SMILTimeContainer.cpp: (WebCore::SMILTimeContainer::schedule): (WebCore::SMILTimeContainer::unschedule): (WebCore::SMILTimeContainer::processScheduledAnimations): (WebCore::SMILTimeContainer::updateAnimations): * svg/animation/SMILTimeContainer.h: 2020-05-26 Alex Christensen <achristensen@webkit.org> MacApplication::isSafari should allow safari bundle id variants https://bugs.webkit.org/show_bug.cgi?id=212401 Reviewed by Timothy Hatcher. There is a test environment with bundle ID com.apple.Safari.something. This change is blocking rdar://problem/63574451 * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::MacApplication::isSafari): 2020-05-26 Simon Fraser <simon.fraser@apple.com> Rendering artifacts when scrolling overlays https://bugs.webkit.org/show_bug.cgi?id=204120 <rdar://problem/57121358> Reviewed by Zalan Bujtas. RenderLayerBacking::setContentsNeedDisplayInRect() needs to adjust repaint rects in the scrolled contents layer by the RenderLayer's scrollOffset, because that's what's used during repaint rect computation. We haven't yet pushed the new scroll offset onto the GraphicsLayer, so m_scrolledContentsLayer->scrollOffset() would be stale here. I tested RTL to make sure that scrollOffset(), and not scrollPosition() is the correct function to tall. Test: compositing/repaint/compositing-toggle-in-overflow-scroll-repaint.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): 2020-05-26 Said Abou-Hallawa <sabouhallawa@apple.com> An SVG animated property animator can stop animation while other animators are still running https://bugs.webkit.org/show_bug.cgi?id=207417 <rdar://problem/59278306> Reviewed by Simon Fraser. An SVG animated property can be animated by multiple animators. When one animator stops the animation, the animVal should not be deleted since it will be used by other animators. SVGAnimatedProperty will maintain a WeakHashSet<SVGAttributeAnimator> in which the animator will be added when the animation starts and will be removed when the the animation stops. When all the animators stops their animations, the animated property may delete the animVal or keep it if it can be referenced by JavaScript. Tests: svg/animations/animated-enum-mutiple-animators.svg svg/animations/animated-length-mutiple-animators.svg * svg/properties/SVGAnimatedDecoratedProperty.h: * svg/properties/SVGAnimatedPrimitiveProperty.h: * svg/properties/SVGAnimatedProperty.h: (WebCore::SVGAnimatedProperty::isAnimating const): (WebCore::SVGAnimatedProperty::startAnimation): (WebCore::SVGAnimatedProperty::stopAnimation): (WebCore::SVGAnimatedProperty::instanceStartAnimation): (WebCore::SVGAnimatedProperty::instanceStopAnimation): * svg/properties/SVGAnimatedPropertyAnimator.h: * svg/properties/SVGAnimatedPropertyList.h: * svg/properties/SVGAnimatedValueProperty.h: * svg/properties/SVGAttributeAnimator.h: 2020-05-26 Simon Fraser <simon.fraser@apple.com> REGRESSION (async oveflow): scrubber missing from inline video inside overflow scroll https://bugs.webkit.org/show_bug.cgi?id=212391 <rdar://problem/63089859> Reviewed by Zalan Bujtas. backgroundClipRect() is in the coordinate space of the ClipRectContext's rootLayer, not the receiver, so when converting to absolute coordinates we must use the ClipRectContext's rootLayer. Test: compositing/layer-creation/overlap-in-scroller.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::addToOverlapMap const): 2020-05-26 Jer Noble <jer.noble@apple.com> Can't scrub video on https://www.judiciary.senate.gov https://bugs.webkit.org/show_bug.cgi?id=212270 <rdar://problem/57922919> Reviewed by Eric Carlson. Test: media/video-duration-seekable.html www.judiciary.senate.gov uses the Akamai Media Player, which doesn't query HTMLMediaElement.duration directly. Rather, when it receives a "durationchange" event, it calculates the duration by using the HTMLMediaElement.seekable ranges to determine the effective media duration. But no event is fired when the seekable ranges change, and when they first query HTMLMediaElement.seekable, AVFoundation hasn't yet updated seekable ranges, so we report an empty set of seekable ranges. The HTML specification suggests that UAs "should adopt a very liberal and optimistic view of what is seekable." With that advice in mind, when we are asked by the page for our seekable ranges, and we do not yet have the official ranges from AVPlayerItem, lets just respond with [0, duration). * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable const): 2020-05-25 Darin Adler <darin@apple.com> Eliminate Color constructors that take strings, moving color parsing entirely into the CSS parser https://bugs.webkit.org/show_bug.cgi?id=212296 Reviewed by Sam Weinig. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseColor): Moved more of the logic into CSSParserFastPaths::parseSimpleColor. Also added a FIXME about what seems to be a mistake about strict mode. (WebCore::CSSParser::parseColorWorkerSafe): Ditto. (WebCore::CSSParser::parseSystemColor): Removed unused context argument. (WebCore::CSSParser::parseNamedColor): Added. (WebCore::CSSParser::parseHexColor): Added. (WebCore::CSSParser::parseSingleValue): Use auto. (WebCore::CSSParser::parseValue): Ditto. * css/parser/CSSParser.h: Exported parseColor. Removed unused value pool and strict arguments from parseColorWorkerSafe. Removed unused context argument from parseSystemColor. Added parseNamedColor and parseHexColor. * css/parser/CSSParserFastPaths.cpp: (WebCore::parseSimpleLengthValue): Take a StringView. (WebCore::finishParsingHexColor): Added, logic moved from Color constructor. (WebCore::parseHexColorInternal): Ditto. (WebCore::parseNumericColor): Added, logic moved from fastParseColorInternal. (WebCore::parseColor): Turned into a non-member function since it's private to this file. Use auto a bit more, and removed unneeded value pool argument. (WebCore::finishParsingNamedColor): Added, logic moved from Color constructor. (WebCore::parseNamedColorInternal): Ditto. (WebCore::parseSimpleColorInternal): Ditto. (WebCore::CSSParserFastPaths::parseSimpleColor): Ditto. (WebCore::CSSParserFastPaths::parseHexColor): Ditto. (WebCore::CSSParserFastPaths::parseNamedColor): Ditto. (WebCore::isUniversalKeyword): Take a StringView. (WebCore::parseKeywordValue): Ditto. (WebCore::parseSimpleTransform): Ditto. (WebCore::parseCaretColor): Ditto. Also take a parser context rather than a parser mode. (WebCore::CSSParserFastPaths::maybeParseValue): Take a StringView. * css/parser/CSSParserFastPaths.h: Cut down includes. Use StringView. Added parseSimpleColor, parseHexColor, and parseNamedColor. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseHexColor): Return an Optional<SimpleColor> instead of a Color. (WebCore::CSSPropertyParserHelpers::consumeColor): Refactor a bit for clarity. * html/HTMLElement.cpp: (WebCore::parseLegacyColorValue): Renamed from parseColorStringWithCrazyLegacyRules and refactored a bit. Made this match the HTML specification more closely. (WebCore::HTMLElement::addHTMLColorToStyle): Simplify now that more of the logic was moved into parseLegacyColorValue. * html/canvas/CanvasStyle.cpp: (WebCore::parseColor): Removed unneeded arguments for parseColorWorkerSafe and for parseSystemColor. * platform/graphics/Color.cpp: (WebCore::findNamedColor): Deleted. (WebCore::Color::Color): Deleted overloadds that take strings. * platform/graphics/Color.h: Updated for the above. * platform/graphics/SimpleColor.cpp: (WebCore::parseHexColorInternal): Deleted. (WebCore::SimpleColor::parseHexColor): Deleted. * platform/graphics/SimpleColor.h: Removed parseHexColor functions. 2020-05-26 Antoine Quint <graouts@apple.com> Hardware fill-forwards animation and transitions don't interact correctly https://bugs.webkit.org/show_bug.cgi?id=187839 <rdar://problem/42410412> Reviewed by Simon Fraser. Test: webanimations/updating-property-targeted-by-css-transition-during-css-animation.html We didn't follow the CSS Transitions spec closely enough when it came to defining the correct before and after change styles during a style change event. We now correctly set the before-change style as one of three possible values: 1. if there are running CSS-originated animations, we ensure those are updated to the current time and resolve them to get the style, 2. otherwise we use the RenderStyle recorded in Style::TreeResolver::createAnimatedElementUpdate() prior to applying animations during the last style change event, 3. otherwise we use the previous computed style, which should not have any animated values. As for the after-change style, we also need to ensure any running CSS Animations are update to the current time and resolve them to get the style. Otherwise, we just use the current computed style prior to applying animations. Finally, we can exit from AnimationTimeline::updateCSSTransitionsForElementAndProperty() early if we find that we have a JS-originated animation running for the given property on the given element since we know that that animation will yield an overriding value for both the before and after change styles since JS-originated animations have the hightest composite order. This means we no longer need to track the unanimated style on KeyframeEffect. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::updateCSSAnimationsForElement): (WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty): (WebCore::AnimationTimeline::updateCSSTransitionsForElement): * animation/AnimationTimeline.h: * animation/ElementAnimationRareData.h: (WebCore::ElementAnimationRareData::lastStyleChangeEventStyle const): (WebCore::ElementAnimationRareData::setLastStyleChangeEventStyle): * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::clearBlendingKeyframes): (WebCore::KeyframeEffect::apply): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): * animation/KeyframeEffect.h: (WebCore::KeyframeEffect::unanimatedStyle const): Deleted. * dom/Element.cpp: (WebCore::Element::lastStyleChangeEventStyle const): (WebCore::Element::setLastStyleChangeEventStyle): * dom/Element.h: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): 2020-05-26 Sam Weinig <weinig@apple.com> Extended Color Cleanup: Remove red()/green()/blue() accessors from ExtendedColor in preperation for supporting non-RGB based ColorSpaces https://bugs.webkit.org/show_bug.cgi?id=212366 Reviewed by Simon Fraser. * platform/graphics/Color.cpp: (WebCore::differenceSquared): Switch to using toSRGBASimpleColorLossy() rather than poking at the ExtendedColor components directly. The old code was already incorrect if the two colors had differing color spaces so this at least now gives reasonable results. (WebCore::Color::colorWithAlpha const): (WebCore::Color::colorWithAlphaUsingAlternativeRounding const): Delegate to ExtendedColor completely for colorWithAlpha() to allow for more control over how the components might be stored in the future. * platform/graphics/Color.h: (WebCore::Color::isBlackColor): (WebCore::Color::isWhiteColor): Delegate to ExtendedColor for isBlack()/isWhite() to allow per-color space interpretations of the predicate. (WebCore::Color::encode const): (WebCore::Color::decode): Use c1, c2, c3 rather than red/green/blue. This should be acceptable for the forseeable future, as all expected colorspaces only have 3 channels, but at some point, it may make sense to delegate coding to ExtendedColor completely. * platform/graphics/ExtendedColor.cpp: * platform/graphics/ExtendedColor.h: (WebCore::ExtendedColor::channels const): (WebCore::ExtendedColor::red const): Deleted. (WebCore::ExtendedColor::green const): Deleted. (WebCore::ExtendedColor::blue const): Deleted. (WebCore::ExtendedColor::colorWithAlpha const): Added. (WebCore::ExtendedColor::isWhite const): Added. (WebCore::ExtendedColor::isBlack const): Added. Use channels() with structured bindings rather than the red()/green()/blue() accessors everywhere. 2020-05-26 Peng Liu <peng.liu6@apple.com> ASSERTION FAILED: m_clientCounts.contains(contextId) - WebKit::VideoFullscreenManagerProxy::removeClientForContext() https://bugs.webkit.org/show_bug.cgi?id=212308 Reviewed by Jer Noble. Call m_videoFullscreenModel->didExitPictureInPicture() after the video player completes the process to exit Picture-in-Picture. Covered by existing tests. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::cleanupFullscreen): (VideoFullscreenInterfaceAVKit::didStopPictureInPicture): 2020-05-26 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Use padding to space out sections https://bugs.webkit.org/show_bug.cgi?id=212377 Reviewed by Antti Koivisto. Use fake padding before/after to space out sections. Test: fast/layoutformattingcontext/table-simple-multiple-sections-with-border-spacing-and-collapse.html * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): 2020-05-26 Keith Rollin <krollin@apple.com> Enable the use of XCBuild by default in Apple builds https://bugs.webkit.org/show_bug.cgi?id=209890 <rdar://problem/44182078> Reviewed by Darin Adler. Switch from the "legacy" Xcode build system to the "new" build system (also known as "XCBuild"). Switching to the new system speeds up builds by a small percentage, better validates projects for build-related issues (such as dependency cycles), lets WebKit benefit from future improvements in XCBuild such as those coming from the underlying llbuild open source project, and prepares us for any other tools built for this new ecosystem. Specific changes: - Remove Xcode project and workspace settings that selected the Build system, allowing the default to take hold (which is currently the New build system). - Updated webkitdirs.pm with a terser check for Xcode version. - Update build-webkit and Makefile.shared to be explicit when using the old build system (no longer treat it as a default or fall-back configuration). - Update various xcconfig files similarly to treat the default as using the new build system. - Update various post-processing build steps to check for Xcode 11.4 and to no longer treat the default as using the old build system. No new tests -- no changed functionality. * WebCore.xcodeproj/project.pbxproj: 2020-05-26 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add support for multiple sections https://bugs.webkit.org/show_bug.cgi?id=212354 Reviewed by Antti Koivisto. Let's keep the grid about rows and columns and about distributing available space. Use the layout tree to find sections. Test: fast/layoutformattingcontext/table-simple-multiple-sections.html * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): * layout/tableformatting/TableGrid.cpp: (WebCore::Layout::TableGrid::appendCell): (WebCore::Layout::TableGrid::Section::Section): Deleted. * layout/tableformatting/TableGrid.h: (WebCore::Layout::TableGrid::Section::box const): Deleted. (WebCore::Layout::TableGrid::sections const): Deleted. (WebCore::Layout::TableGrid::sections): Deleted. 2020-05-26 Carlos Garcia Campos <cgarcia@igalia.com> [GTK4] Use screen font options as default https://bugs.webkit.org/show_bug.cgi?id=212332 Reviewed by Adrian Perez de Castro. There's no gdk_screen_get_font_options() in GTK4, so we need to get the individual properties from the settings and build a cairo_font_options_t. We can just do the same in GTK3 to avoid ifdefs. Add a helper SystemFontOptions singleton class to monitor and parse the font settings. * platform/graphics/gtk/GdkCairoUtilities.cpp: (WebCore::SystemFontOptions::singleton): (WebCore::SystemFontOptions::SystemFontOptions): (WebCore::SystemFontOptions::fontOptions const): (WebCore::SystemFontOptions::updateFontOptions): (WebCore::getDefaultCairoFontOptions): 2020-05-25 Simon Fraser <simon.fraser@apple.com> Use an Optional<> for LayerFragment::boundingBox https://bugs.webkit.org/show_bug.cgi?id=212358 Reviewed by Zalan Bujtas. Replace a bool + LayoutRect with Optional<LayoutRect>. * rendering/LayerFragment.h: (WebCore::LayerFragment::setRects): (WebCore::LayerFragment::moveBy): (WebCore::LayerFragment::intersect): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::collectFragments): (WebCore::RenderLayer::updatePaintingInfoForFragments): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: 2020-05-25 Simon Fraser <simon.fraser@apple.com> Make isTableRow() an inline function https://bugs.webkit.org/show_bug.cgi?id=212360 Reviewed by Darin Adler. isTableCell() is a virtual function that's called in some hot code paths, like RenderLayer::localBoundingBox(), so make it inline by using a spare bit on RenderObject. * rendering/RenderObject.h: (WebCore::RenderObject::isTableCaption const): (WebCore::RenderObject::isTableRow const): (WebCore::RenderObject::setIsTableRow): (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields): * rendering/RenderTableRow.cpp: (WebCore::RenderTableRow::RenderTableRow): * rendering/RenderTableRow.h: 2020-05-25 Alex Christensen <achristensen@webkit.org> Expose more network metrics to WebCoreNSURLSession https://bugs.webkit.org/show_bug.cgi?id=212359 <rdar://problem/62909440> Reviewed by Darin Adler. * platform/network/NetworkLoadMetrics.h: (WebCore::NetworkLoadMetrics::isolatedCopy const): (WebCore::NetworkLoadMetrics::operator== const): (WebCore::NetworkLoadMetrics::encode const): (WebCore::NetworkLoadMetrics::decode): * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSessionTaskTransactionMetrics networkProtocolName]): (-[WebCoreNSURLSessionTaskTransactionMetrics isReusedConnection]): (-[WebCoreNSURLSessionTaskTransactionMetrics cellular]): (-[WebCoreNSURLSessionTaskTransactionMetrics expensive]): (-[WebCoreNSURLSessionTaskTransactionMetrics constrained]): (-[WebCoreNSURLSessionTaskTransactionMetrics multipath]): 2020-05-25 Oriol Brufau <obrufau@igalia.com> [css-grid] Prevent grid-template-rows from serializing adjacent <line-names> https://bugs.webkit.org/show_bug.cgi?id=212345 Reviewed by Manuel Rego Casasnovas. The parser for the grid-template shorthand has this code: // Persists between loop iterations so we can use the same value for // consecutive <line-names> values RefPtr<CSSGridLineNamesValue> lineNames; However, this wasn't working because of a lineNames.releaseNonNull() at the end of the loop. So each iteration started with a null lineNames, and consecutive <line-names> values were not merged together. Tests: fast/css-grid-layout/grid-template-shorthand-get-set.html imported/w3c/web-platform-tests/css/css-grid/parsing/grid-shorthand.html imported/w3c/web-platform-tests/css/css-grid/parsing/grid-shorthand-valid.html imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-shorthand.html imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid.html * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::consumeGridTemplateRowsAndAreasAndColumns): 2020-05-25 Sam Weinig <weinig@apple.com> Extended Color Cleanup: Assert !isExtended() in Color::asSimpleColor()...finally https://bugs.webkit.org/show_bug.cgi?id=212357 Reviewed by Simon Fraser. Reap the reward of the cleanup, and add the ASSERT(!isExtended()) to Color::asSimpleColor() as was the original goal of this effort. Only tree non-checked places remained and were trivial to add isExtended() checks for. * platform/graphics/Color.cpp: (WebCore::Color::nameForRenderTreeAsText const): Use ExtenedColor::cssText() for the RenderTree representation. It is stable and as good as any, no need to re-invent the wheel here. (WebCore::Color::light const): (WebCore::Color::dark const): Add isExtended() checks before doing white/black checks, * platform/graphics/Color.h: (WebCore::Color::asSimpleColor const): Add ASSERT. 2020-05-24 Sam Weinig <weinig@apple.com> Extended Color Cleanup: Use the name SimpleColor consistently https://bugs.webkit.org/show_bug.cgi?id=212337 Reviewed by Anders Carlsson. - Removes RGBA32 type alias, updating all remaining users of it. - Renames functions that take/return SimpleColor to use the name SimpleColor rather than RGB (e.g. makeRGBA -> makeSimpleColor) - Moves hex color parsing from Color to SimpleColor, as that is the type it returns. Also took the opportunity to make it return an Optional<SimpleColor> instead of using a bool/out parameter. - Move Color::compositionFill to editing/CompositionHighlight.h It makes no real sense to keep it in Color.h - Replaces rgb() function in Color with asSimpleColor() for symmetry with asExtended(). - Replaced std::max(a, std::min(value, b)) with std::clamp(value, a, b) for clarity. * css/parser/CSSParserFastPaths.cpp: (WebCore::fastParseColorInternal): (WebCore::CSSParserFastPaths::parseColor): * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseRGBParameters): (WebCore::CSSPropertyParserHelpers::parseHSLParameters): (WebCore::CSSPropertyParserHelpers::parseHexColor): * editing/CompositionHighlight.h: * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): * html/ColorInputType.cpp: (WebCore::parseSimpleColorValue): * html/HTMLElement.cpp: (WebCore::parseColorStringWithCrazyLegacyRules): * platform/adwaita/ScrollbarThemeAdwaita.cpp: * platform/adwaita/ThemeAdwaita.cpp: (WebCore::ThemeAdwaita::activeSelectionForegroundColor const): (WebCore::ThemeAdwaita::activeSelectionBackgroundColor const): (WebCore::ThemeAdwaita::inactiveSelectionForegroundColor const): * platform/graphics/Color.cpp: (WebCore::differenceSquared): (WebCore::Color::Color): (WebCore::Color::operator=): (WebCore::Color::serialized const): (WebCore::Color::cssText const): (WebCore::Color::nameForRenderTreeAsText const): (WebCore::Color::light const): (WebCore::Color::dark const): (WebCore::Color::blend const): (WebCore::Color::blendWithWhite const): (WebCore::Color::colorWithAlpha const): (WebCore::Color::colorWithAlphaUsingAlternativeRounding const): (WebCore::Color::invertedColorWithAlpha const): (WebCore::Color::colorSpaceAndComponents const): (WebCore::Color::toSRGBASimpleColorLossy const): (WebCore::blend): (WebCore::Color::tagAsValid): (WebCore::parseHexColorInternal): Deleted. (WebCore::Color::parseHexColor): Deleted. (WebCore::Color::asExtended const): Deleted. * platform/graphics/Color.h: (WebCore::Color::Color): (WebCore::Color::isHashTableDeletedValue const): (WebCore::Color::isValid const): (WebCore::Color::isOpaque const): (WebCore::Color::isVisible const): (WebCore::Color::alpha const): (WebCore::Color::alphaAsFloat const): (WebCore::Color::isSemantic const): (WebCore::Color::isExtended const): (WebCore::Color::setIsSemantic): (WebCore::operator==): (WebCore::equalIgnoringSemanticColor): (WebCore::Color::hash const): (WebCore::Color::asExtended const): (WebCore::Color::asSimpleColor const): (WebCore::Color::setSimpleColor): (WebCore::Color::isBlackColor): (WebCore::Color::isWhiteColor): (WebCore::Color::encode const): (WebCore::Color::decode): (WebCore::Color::setRGB): Deleted. (WebCore::Color::rgb const): Deleted. * platform/graphics/ColorUtilities.h: (WebCore::clampedColorComponent): * platform/graphics/ImageBackingStore.h: (WebCore::ImageBackingStore::blendPixel): (WebCore::ImageBackingStore::pixelValue const): * platform/graphics/SimpleColor.cpp: (WebCore::makePremultipliedSimpleColor): (WebCore::makeUnpremultipliedSimpleColor): (WebCore::makeSimpleColorFromFloats): (WebCore::makeSimpleColorFromHSLA): (WebCore::makeSimpleColorFromCMYKA): (WebCore::parseHexColorInternal): (WebCore::SimpleColor::parseHexColor): (WebCore::makePremultipliedRGBA): Deleted. (WebCore::makeUnPremultipliedRGBA): Deleted. (WebCore::makeRGBA32FromFloats): Deleted. (WebCore::makeRGBAFromHSLA): Deleted. (WebCore::makeRGBAFromCMYKA): Deleted. * platform/graphics/SimpleColor.h: (WebCore::roundAndClampColorChannel): (WebCore::colorFloatToSimpleColorByte): (WebCore::makeSimpleColor): (WebCore::colorFloatToRGBAByte): Deleted. (WebCore::makeRGB): Deleted. (WebCore::makeRGBA): Deleted. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::makeSimpleColorFromARGBCFArray): (WebCore::InbandTextTrackPrivateAVF::processCueAttributes): (WebCore::makeRGBA32FromARGBCFArray): Deleted. * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp: (WebCore::ImageBufferCairoImageSurfaceBackend::platformTransformColorSpace): * platform/graphics/cairo/NativeImageCairo.cpp: (WebCore::nativeImageSinglePixelSolidColor): * platform/graphics/cg/ColorCG.cpp: (WebCore::makeSimpleColorFromCGColor): (WebCore::Color::Color): (WebCore::cachedCGColor): (WebCore::makeRGBAFromCGColor): Deleted. * platform/graphics/gtk/ColorGtk.cpp: (WebCore::Color::Color): * platform/graphics/mac/ColorMac.mm: (WebCore::makeSimpleColorFromNSColor): (WebCore::colorFromNSColor): (WebCore::semanticColorFromNSColor): (WebCore::makeRGBAFromNSColor): Deleted. * platform/graphics/win/ColorDirect2D.cpp: (WebCore::Color::Color): * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::drawDotsForDocumentMarker): * platform/graphics/win/PlatformContextDirect2D.cpp: (WebCore::PlatformContextDirect2D::brushWithColor): * platform/ios/ColorIOS.mm: (WebCore::colorFromUIColor): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintCompositionBackground): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintResizer): * rendering/RenderLayerBacking.cpp: (WebCore::patternForTouchAction): (WebCore::patternForEventListenerRegionType): * rendering/RenderThemeAdwaita.cpp: * rendering/RenderThemeMac.mm: (WebCore::menuBackgroundColor): 2020-05-25 Zalan Bujtas <zalan@apple.com> [Subpixel layout] Bad scrolling on mercurynews.com article https://bugs.webkit.org/show_bug.cgi?id=201038 <rdar://problem/28489812> Reviewed by Dean Jackson. The scrolling is caused by the mismatching subpixel handling between block and inline content. Inline content (and in this particular case ascent/descent handling) is still integral based while block content supports fractional pixel values. When the (inline)line height relies on the (block)inline-block height, we need to make sure that the computed line height encloses the inline-block. This patch changes the rounding behavior of computed the line height from floor to round. Test: fast/inline/hidpi-inline-block-is-subpixel-while-line-is-not.html * rendering/RenderBox.cpp: (WebCore::RenderBox::baselinePosition const): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::ascentAndDescentForBox const): 2020-05-25 Rob Buis <rbuis@igalia.com> Use child text content when determining whether to bail early in running a script https://bugs.webkit.org/show_bug.cgi?id=182695 Reviewed by Youenn Fablet. Check that the text content is not empty instead of just checking for the first child [1]. Behavior matches Chrome and Firefox. [1] https://html.spec.whatwg.org/#prepare-a-script step 5 and 6 Test: web-platform-tests/html/semantics/scripting-1/the-script-element/emptyish-script-elements.html * dom/ScriptElement.cpp: (WebCore::ScriptElement::prepareScript): 2020-05-22 Sergio Villar Senin <svillar@igalia.com> [css-flex] Allow indefinite size flex items to be definite wrt resolving percentages inside them https://bugs.webkit.org/show_bug.cgi?id=212264 Reviewed by Manuel Rego Casasnovas. Implement https://github.com/w3c/csswg-drafts/commit/5b5db39d21f3658ae2f4d7992daaf822aca178d8 which modified the way percentages were resolved in flexible items with indefinite sizes. From now on we can pretend that they're really definite. This allows us to mark 3 tests which were testing percentages in flex items as correct. Based on Blink's crrev.com/1247184 by <cbiesinger@chromium.org> * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution): Do only check flex container main size definiteness when computing the main size for percentage resolution, no need to check flex basis at all. 2020-05-25 Youenn Fablet <youenn@apple.com> AVVideoCaptureSource should notify of video samples in a background thread https://bugs.webkit.org/show_bug.cgi?id=212072 Reviewed by Eric Carlson. Do not hop to the main thread to send samples. Instead, directly call the observer callback. Manually tested. * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): 2020-05-25 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes, late May 2020 edition https://bugs.webkit.org/show_bug.cgi?id=212342 Unreviewed build fix. No new tests needed. * loader/ImageLoader.h: Add missing inclusion of Element.h and remove forward declaration. * page/PageConfiguration.h: Add missing inclusion of ShouldRelaxThirdPartyCookieBlocking.h 2020-05-25 Youenn Fablet <youenn@apple.com> MediaPlayerPrivateMediaStreamAVFObjC::m_activeVideoTrack should be a VideoTrackPrivateMediaStream https://bugs.webkit.org/show_bug.cgi?id=212129 Reviewed by Eric Carlson. Instead of looking in the map when wanting to get the VideoTrackPrivateMediaStream corresponding to the active video track, store directly the VideoTrackPrivateMediaStream as the active video track and use streamTrack() to get the corresponding MediaStreamTrack. Small refactoring to use more Ref<>. Covered by existing tests. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferDisplayLayerStatusDidChange): (WebCore::updateTracksOfType): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): * platform/mediastream/AudioTrackPrivateMediaStream.h: * platform/mediastream/VideoTrackPrivateMediaStream.h: 2020-05-24 Youenn Fablet <youenn@apple.com> Do not allocate a WebAudioBufferList in the AudioContext rendering thread https://bugs.webkit.org/show_bug.cgi?id=212132 Reviewed by Eric Carlson. Instead of allocating the buffer in the rendering thread, we do that in the audio sample producer thread. Also, we do it only once versus one for each rendering call previously. Covered by existing tests. * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h: * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm: (WebCore::WebAudioSourceProviderAVFObjC::provideInput): (WebCore::WebAudioSourceProviderAVFObjC::prepare): (WebCore::WebAudioSourceProviderAVFObjC::unprepare): 2020-05-24 Wenson Hsieh <wenson_hsieh@apple.com> Add some missing includes due to unified sources https://bugs.webkit.org/show_bug.cgi?id=212306 Reviewed by Anders Carlsson. * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp: Include EnterPictureInPictureEvent.h. * platform/PictureInPictureObserver.h: Include WeakPtr and forward declare the IntSize class. 2020-05-24 Sam Weinig <weinig@apple.com> Extended Color Cleanup: Move SimpleColor into its own files https://bugs.webkit.org/show_bug.cgi?id=212309 Reviewed by Simon Fraser. Move SimpleColor into its own files. It's about time. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/Color.cpp: (WebCore::premultipliedChannel): Deleted. (WebCore::unpremultipliedChannel): Deleted. (WebCore::makePremultipliedRGBA): Deleted. (WebCore::makeUnPremultipliedRGBA): Deleted. (WebCore::colorFloatToRGBAByte): Deleted. (WebCore::makeRGBA32FromFloats): Deleted. (WebCore::makeRGBAFromHSLA): Deleted. (WebCore::makeRGBAFromCMYKA): Deleted. (WebCore::SimpleColor::serializationForHTML const): Deleted. (WebCore::decimalDigit): Deleted. (WebCore::fractionDigitsForFractionalAlphaValue): Deleted. (WebCore::SimpleColor::serializationForCSS const): Deleted. (WebCore::RGBA32::serializationForRenderTreeAsText const): Deleted. * platform/graphics/Color.h: (WebCore::SimpleColor::SimpleColor): Deleted. (WebCore::SimpleColor::value const): Deleted. (WebCore::SimpleColor::redComponent const): Deleted. (WebCore::SimpleColor::greenComponent const): Deleted. (WebCore::SimpleColor::blueComponent const): Deleted. (WebCore::SimpleColor::alphaComponent const): Deleted. (WebCore::SimpleColor::alphaComponentAsFloat const): Deleted. (WebCore::SimpleColor::isOpaque const): Deleted. (WebCore::SimpleColor::isVisible const): Deleted. (WebCore::SimpleColor::colorWithAlpha const): Deleted. (WebCore::SimpleColor::get const): Deleted. (WebCore::roundAndClampColorChannel): Deleted. (WebCore::fastMultiplyBy255): Deleted. (WebCore::fastDivideBy255): Deleted. (WebCore::makeRGB): Deleted. (WebCore::makeRGBA): Deleted. * platform/graphics/SimpleColor.cpp: Copied from platform/graphics/Color.cpp. (WebCore::SimpleColor::serializationForRenderTreeAsText const): (): Deleted. (WebCore::colorFloatToRGBAByte): Deleted. (WebCore::parseHexColorInternal): Deleted. (WebCore::Color::parseHexColor): Deleted. (WebCore::differenceSquared): Deleted. (WebCore::findNamedColor): Deleted. (WebCore::Color::Color): Deleted. (WebCore::Color::operator=): Deleted. (WebCore::Color::serialized const): Deleted. (WebCore::Color::cssText const): Deleted. (WebCore::RGBA32::serializationForRenderTreeAsText const): Deleted. (WebCore::Color::nameForRenderTreeAsText const): Deleted. (WebCore::Color::light const): Deleted. (WebCore::Color::dark const): Deleted. (WebCore::Color::isDark const): Deleted. (WebCore::Color::lightness const): Deleted. (WebCore::blendComponent): Deleted. (WebCore::Color::blend const): Deleted. (WebCore::Color::blendWithWhite const): Deleted. (WebCore::Color::colorWithAlphaMultipliedBy const): Deleted. (WebCore::Color::colorWithAlphaMultipliedByUsingAlternativeRounding const): Deleted. (WebCore::Color::colorWithAlpha const): Deleted. (WebCore::Color::colorWithAlphaUsingAlternativeRounding const): Deleted. (WebCore::Color::colorSpaceAndComponents const): Deleted. (WebCore::Color::toSRGBASimpleColorLossy const): Deleted. (WebCore::Color::toSRGBAComponentsLossy const): Deleted. (WebCore::extendedColorsEqual): Deleted. (WebCore::blend): Deleted. (WebCore::blendWithoutPremultiply): Deleted. (WebCore::Color::tagAsValid): Deleted. (WebCore::Color::asExtended const): Deleted. (WebCore::operator<<): Deleted. * platform/graphics/SimpleColor.h: Copied from platform/graphics/Color.h. (WebCore::SimpleColor::alphaComponentAsFloat const): (WebCore::SimpleColor::colorWithAlpha const): (WebCore::SimpleColor::get const): (WebCore::colorFloatToRGBAByte): (WebCore::Color::Color): Deleted. (WebCore::Color::isHashTableDeletedValue const): Deleted. (WebCore::Color::~Color): Deleted. (WebCore::Color::isValid const): Deleted. (WebCore::Color::isOpaque const): Deleted. (WebCore::Color::isVisible const): Deleted. (WebCore::Color::red const): Deleted. (WebCore::Color::green const): Deleted. (WebCore::Color::blue const): Deleted. (WebCore::Color::alpha const): Deleted. (WebCore::Color::alphaAsFloat const): Deleted. (WebCore::Color::opaqueColor const): Deleted. (WebCore::Color::isSemantic const): Deleted. (WebCore::Color::isExtended const): Deleted. (WebCore::Color::setRGB): Deleted. (WebCore::Color::setIsSemantic): Deleted. (WebCore::equalIgnoringSemanticColor): Deleted. (WebCore::Color::hash const): Deleted. (WebCore::Color::colorWithAlphaMultipliedByUsingAlternativeRounding const): Deleted. (WebCore::Color::colorWithAlphaUsingAlternativeRounding const): Deleted. (WebCore::Color::rgb const): Deleted. (WebCore::Color::isBlackColor): Deleted. (WebCore::Color::isWhiteColor): Deleted. (WebCore::Color::encode const): Deleted. (WebCore::Color::decode): Deleted. 2020-05-24 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Ignore section borders even when border collapse is off. https://bugs.webkit.org/show_bug.cgi?id=212336 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-simple-thead-border-ignore.html * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): 2020-05-24 Sam Weinig <weinig@apple.com> Extended Color Cleanup: Stop allowing direct access to the underlying SimpleColor (it is almost always incorrect with respect to extended colors) https://bugs.webkit.org/show_bug.cgi?id=212184 Reviewed by Dean Jackson. - Makes Color::rgb() private, removing a class of extended color bugs from users of the Color class. To get the equivilent functionality, users of the class must now use toSRGBASimpleColorLossy() which does actually does the conversion to sRGB if necessary and makes it clear to the caller that precision is being lost. - Removes Color::red()/green()/blue() entirely. They were just calling down to Color::rgb(), and going forward, it won't make sense to think about rgb components of Colors in general, since some extended color spaces don't deal in them (e.g. Lab) Color::alpha() was kept (and fixed to work even with ExtendedColor) since all ExtendedColors do need to have alpha. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::colorValue const): Use toSRGBASimpleColorLossy() to get access to color components. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (getAttributeSetForAccessibilityObject): Use toSRGBASimpleColorLossy() to get access to color components. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::colorValue const): Use toSRGBASimpleColorLossy() to get access to color components. * css/DeprecatedCSSOMRGBColor.h: Use toSRGBASimpleColorLossy() to get access to color components. * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsWindowCSS const): (WebCore::CaptionUserPreferencesMediaAF::captionsBackgroundCSS const): (WebCore::CaptionUserPreferencesMediaAF::captionsTextColor const): User Color::colorWithAlpha() to avoid the need to muck with components directly. * platform/graphics/Color.cpp: (WebCore::differenceSquared): Use rgb() directly, which is ok, since this is explicitly checking isExtended(). This code is still wrong (there is a FIXME) as it assumes the two colors are in the same color space. (WebCore::Color::Color): Add constructor which takes an ExtendedColor to allow functions like Color::invertedColorWithAlpha to delegate their functionality to ExtendedColor. (WebCore::Color::light const): Use new SimpleColor::colorWithAlpha() to avoid hardcoding constants here. (WebCore::Color::blend const): (WebCore::Color::blendWithWhite const): Use toSRGBASimpleColorLossy() to get access to color components. These are still not ideal implementations, as they don't preserve extended colors as well as they could, but now they don't return bogus values for extended colors. Minor cleanup bringing constants and lambda inside the function they are used in. (WebCore::Color::colorWithAlpha const): (WebCore::Color::colorWithAlphaUsingAlternativeRounding const): Minor cleanups to use a more consistent style and make use of the new SimpleColor::colorWithAlpha. (WebCore::Color::invertedColorWithAlpha const): Added. Used to avoid direct component usage in line box code. (WebCore::Color::semanticColor const): Added. Hopefully temporary. Used by RenderThemeIOS.mm to convert a Color from a map into a Color with the semantic bit set. This should not be necessary as every color in the map should already have it set, but to avoid uncessary possible behavior changes this preserves that functionality until it can be researched further. Fixing coders to preserve the semantic bit may be required to elliminate the need. (WebCore::Color::colorSpaceAndComponents const): Use rgb() rather than the individual components which have been removed. * platform/graphics/Color.h: (WebCore::SimpleColor::alphaComponentAsFloat const): Added. Needed by DeprecatedCSSOMRGBColor and useful to Color. (WebCore::SimpleColor::colorWithAlpha const): Useful to simplify Color::colorWithAlpha implementations and in Color::dark(). (WebCore::SimpleColor::get const): Added tuple interface to SimpleColor to support structure bindings. NOTE: Unlike the storage of SimpleColor (ARGB), this produces the bindings in the more familiar [r,g,b,a] to match FloatComponents. (WebCore::Color::alpha const): Made work with ExtendedColor as well. (WebCore::Color::red const): Deleted. (WebCore::Color::green const): Deleted. (WebCore::Color::blue const): Deleted. Removed. (CGColorRef cachedCGColor): (int differenceSquared): Made friends so they could use Color::rgb(). (WebCore::Color::rgb const): Made private. * platform/graphics/ExtendedColor.cpp: (WebCore::ExtendedColor::invertedColorWithAlpha const): * platform/graphics/ExtendedColor.h: Added invertedColorWithAlpha to allow inversion to be encapsulated. When future color spaces are added, we may need to choose per-colorspace algorithms for this instead of the trivial one used today. * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: (WebCore::PlatformCAAnimationCocoa::setFromValue): (WebCore::PlatformCAAnimationCocoa::setToValue): (WebCore::PlatformCAAnimationCocoa::setValues): Use toSRGBASimpleColorLossy() to get access to color components. * platform/graphics/ca/win/PlatformCAAnimationWin.cpp: (PlatformCAAnimationWin::setFromValue): (PlatformCAAnimationWin::setToValue): (PlatformCAAnimationWin::setValues): Use toSRGBASimpleColorLossy() to get access to color components. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::drawFocusRing): Use Color::colorWithAlpha() to avoid needing access to components. * platform/graphics/cpu/arm/filters/FELightingNEON.h: (WebCore::FELighting::platformApplyNeon): Use toSRGBASimpleColorLossy() to get access to color components. * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::clearColor): Use toSRGBASimpleColorLossy() to get access to color components. * platform/graphics/win/Direct2DOperations.cpp: (WebCore::Direct2D::drawGlyphs): Use colorWithAlphaMultipliedBy() to avoid needing access to components. * platform/graphics/win/FontCGWin.cpp: (WebCore::FontCascade::drawGlyphs): Use colorWithAlphaMultipliedBy() to avoid needing access to components. * platform/graphics/win/FontCascadeDirect2D.cpp: (WebCore::FontCascade::drawGlyphs): Use colorWithAlphaMultipliedBy() to avoid needing access to components. * rendering/EllipsisBox.cpp: (WebCore::EllipsisBox::paintSelection): Use invertedColorWithAlpha() to avoid needing access to components. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::resolveStyleForMarkedText): Use invertedColorWithAlpha() to avoid needing access to components. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintBoxShadow): Use opaqueColor() to avoid needing access to components. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::systemColor const): Use opaqueColor() to avoid needing access to components. * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: (WebCore::SVGAnimationColorFunction::animate): Use toSRGBASimpleColorLossy() to get access to color components. 2020-05-24 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Take sections into account when computing collapsed border. https://bugs.webkit.org/show_bug.cgi?id=212311 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-simple-collapsed-tbody-border.html * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): * layout/tableformatting/TableGrid.cpp: (WebCore::Layout::TableGrid::Section::Section): (WebCore::Layout::TableGrid::appendCell): * layout/tableformatting/TableGrid.h: (WebCore::Layout::TableGrid::Section::box const): (WebCore::Layout::TableGrid::sections const): (WebCore::Layout::TableGrid::sections): 2020-05-24 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Take collapsed in-between row border into account when computing cell height https://bugs.webkit.org/show_bug.cgi?id=212307 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-simple-collapsed-row-border2.html * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::computedCellBorder const): 2020-05-23 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Take row border into account when computing collapsed borders. https://bugs.webkit.org/show_bug.cgi?id=212305 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-simple-collapsed-row-border.html * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox): 2020-05-23 Jack Lee <shihchieh_lee@apple.com> ASSERTION FAILED: (!s_current || &m_view != &s_current->m_view) in RenderTreeBuilder::RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=212163 Unreviewed. Improve readability. Replace comments with curly brackets for scoping. * dom/Document.cpp: (WebCore::Document::updateRenderTree): 2020-05-23 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Maximum constraint of a cell should never be smaller than the minimum width https://bugs.webkit.org/show_bug.cgi?id=212304 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-simple-fixed-width-with-wide-content.html * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell): 2020-05-23 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Used height of a cell is the maximum of the computed and the content height. https://bugs.webkit.org/show_bug.cgi?id=212302 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-simple-tall-cell-content-with-fixed-height.html * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const): 2020-05-23 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Non-collapsing row border should not make the table wider/taller https://bugs.webkit.org/show_bug.cgi?id=212263 Reviewed by Antti Koivisto. Non-collapsing row border eats into the content box but oddly it does not constraint the cell boxes, so we can end up with smaller row content box than the cell box it contains. Test: fast/layoutformattingcontext/table-simple-row-border.html * layout/LayoutUnits.h: (WebCore::Layout::Edges::width const): (WebCore::Layout::Edges::height const): (WebCore::Layout::HorizontalEdges::width const): Deleted. (WebCore::Layout::VerticalEdges::height const): Deleted. * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell): 2020-05-22 Jack Lee <shihchieh_lee@apple.com> ASSERTION FAILED: (!s_current || &m_view != &s_current->m_view) in RenderTreeBuilder::RenderTreeBuilder https://bugs.webkit.org/show_bug.cgi?id=212163 <rdar://problem/57028096> Reviewed by Geoffrey Garen. Calling ~PostResolutionCallbackDisabler() before completing render tree updating and releasing RenderTreeBuilder triggers this assertion. Therefore we added a utility function "updateRenderTree" in which PostResolutionCallback is delayed until RenderTreeUpdater is released and m_inRenderTreeUpdate is cleared. Test: fast/rendering/nested-render-tree-update-crash.html * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::updateRenderTree): (WebCore::Document::resolveStyle): (WebCore::Document::updateTextRenderer): * dom/Document.h: * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::RenderTreeUpdater): (WebCore::RenderTreeUpdater::commit): * rendering/updating/RenderTreeUpdater.h: 2020-05-22 Simon Fraser <simon.fraser@apple.com> Stuttery overflow scrolling in slow-scrolling regions (facebook messenger, feedly.com) https://bugs.webkit.org/show_bug.cgi?id=212291 <rdar://problem/61940624> Reviewed by Tim Horton. Now that we do scrolling tree commits on the main thread, ThreadedScrollingTree::scrollingTreeNodeDidScroll() can be called on the main thread. In this case, don't do an RunLoop::main().dispatch() which introduces asynchrony; just call into the ScrollingCoordinator synchronously. Do some minor refactoring to move noteScrollingThreadSyncCompleteForNode() into updateScrollPositionAfterAsyncScroll(). Hard to test because it involves scrolling thread/main thread interactions. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate): (WebCore::AsyncScrollingCoordinator::synchronizeStateFromScrollingTree): (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll): (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired): (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll): 2020-05-22 Zalan Bujtas <zalan@apple.com> Nullptr deref in WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation when parent and beforeChild are siblings https://bugs.webkit.org/show_bug.cgi?id=212116 <rdar://problem/62993844> Reviewed by Simon Fraser. This patch fixes the case when a nested fragmented context has a spanner and we try to form a continuation while this nested fragmented context is being destroyed. 1. The continuation is triggered by a style change that turns a previously out-of-flow block container into an inflow box (and the parent inline level container can't have the box as a direct child anymore). 2. An unrelated style change nukes the nested fragmented context. We need to "re-assign" the spanner to the parent fragment. These 2 changes are split into 2 phases; first we take care of the tree mutation triggered by the continuation (updateRendererStyle), while we do the fragmented context cleanup (updateAfterDescendants) in a separate step. This 2 phase setup confuses the "where to put this spanner" logic. This patch addresses the issue by keeping the spanner inside the about-to-be-destroyed fragmented context while forming the continuation (phase #1) and let the second phase (updateAfterDescendants) deal with the spanner moving. Test: fast/multicol/nested-multicol-with-spanner-and-continuation.html * rendering/updating/RenderTreeBuilderMultiColumn.cpp: (WebCore::isValidColumnSpanner): 2020-05-22 Chris Dumez <cdumez@apple.com> Revoking an object URL immediately after triggering navigation causes navigation to fail https://bugs.webkit.org/show_bug.cgi?id=212279 <rdar://problem/63553090> Reviewed by Geoffrey Garen. When doing a policy check for a Blob URL, we clone the blob and create a new temporary Blob URL that stays alive for the duration of the policy check. We made sure to update the ResourceRequest URL with the new Blob URL, however, we were failing to update the DocumentLoader's request. As a result, if the client responded with Policy USE, the DocumentLoader would still attempt to navigate to the old Blob URL. Test: fast/loader/revoke-blob-url-after-navigation.html * loader/PolicyChecker.cpp: (WebCore::FrameLoader::PolicyChecker::extendBlobURLLifetimeIfNecessary const): (WebCore::FrameLoader::PolicyChecker::checkNavigationPolicy): (WebCore::FrameLoader::PolicyChecker::checkNewWindowPolicy): * loader/PolicyChecker.h: 2020-05-22 Simon Fraser <simon.fraser@apple.com> Make sure we clean up CFTimerRefs when destroying scrolling tree nodes https://bugs.webkit.org/show_bug.cgi?id=212278 <rdar://problem/63548212> Reviewed by Tim Horton. When destroying scrolling tree nodes, make sure we explicitly stop the RunLoop::Timers, and do this for all nodes when clearing the m_nodeMap, not just for orphaned nodes as was done in r262042. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::commitTreeState): (WebCore::ScrollingTree::updateTreeFromStateNodeRecursive): (WebCore::ScrollingTree::removeAllNodes): * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeNode.h: (WebCore::ScrollingTreeNode::willBeDestroyed): (WebCore::ScrollingTreeNode::wasRemovedFromTree): Deleted. * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::willBeDestroyed): (WebCore::ScrollingTreeFrameScrollingNodeMac::wasRemovedFromTree): Deleted. * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::willBeDestroyed): (WebCore::ScrollingTreeOverflowScrollingNodeMac::wasRemovedFromTree): Deleted. 2020-05-22 Andres Gonzalez <andresg_22@apple.com> Updates to the isolated tree must happen before posting notifications to clients. https://bugs.webkit.org/show_bug.cgi?id=212266 Reviewed by Chris Fleizach. Multiple tests. In AXObjectCache::notificationPostTimerFired we were updating the isolated tree after the notifications were posted to the platform clients. This caused that in some cases when the client requested info as the result of those notifications, the isolated tree was out-of-date. In this patch updateIsolatedTree is called before notifying platform clients. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::notificationPostTimerFired): (WebCore::AXObjectCache::postNotification): (WebCore::AXObjectCache::postTextStateChangeNotification): (WebCore::AXObjectCache::updateIsolatedTree): 2020-05-22 Sam Weinig <weinig@apple.com> Extended Color Cleanup: Make alpha premultiplication code more consistent and clear regarding what works with extended colors https://bugs.webkit.org/show_bug.cgi?id=212265 Reviewed by Simon Fraser. - Adds premultiplied(const FloatComponents&) to do premutiplication directly on FloatComponents rather than doing it on the ints and losing precision. - Makes non-FloatComponent alpha premultiplication all take place only for SimpleColors as that is what callers need. The existing premulitplication for ExtendedColors in blend() was incorrect as it never did a conversion to sRGB. - Adds new toSRGBASimpleColorLossy() (to complement toSRGBAComponentsLossy()). Will make it easy to find all the conversions in the future. - Broke non-premultiplying blend() out of blend() (removing parameter) and made a new blendWithoutPremultiply() function for it (no callers needed to make this decision dynamically). * css/CSSGradientValue.cpp: (WebCore::CSSGradientValue::computeStops): Use blendWithoutPremultiply() explicitly. * platform/graphics/Color.h: * platform/graphics/Color.cpp: (WebCore::makePremultipliedRGBA): Renamed from premultipliedARGBFromColor and now only operates on SimpleColors. (WebCore::makeUnPremultipliedRGBA): Renamed from colorFromPremultipliedARGB and now only operates on SimpleColors. (WebCore::colorFromPremultipliedARGB): Deleted. (WebCore::premultipliedARGBFromColor): Deleted. (WebCore::Color::toSRGBASimpleColorLossy const): Added. Useful for finding all non-colorspace preserving users of the color channels. (WebCore::blend): (WebCore::blendWithoutPremultiply): Split these out from each other. Made blend() use toSRGBASimpleColorLossy() and do all operations on SimpleColors directly. The old code that preported to work with extended colors was nonsense as it didn't actually take the colorspaces into account, just grabbed the channels regardless of space. * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp: (WebCore::ImageBufferCairoImageSurfaceBackend::platformTransformColorSpace): Adopt update premulitiplication names and stay in SimpleColor for entire conversion. * platform/graphics/cairo/NativeImageCairo.cpp: (WebCore::nativeImageSinglePixelSolidColor): Adopt update premulitiplication names. * platform/graphics/ColorUtilities.cpp: (WebCore::premultiplied): * platform/graphics/ColorUtilities.h: * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::drawBorder): (WebCore::prepareFilterProgram): (WebCore::TextureMapperGL::drawSolidColor): Add and adopt premultiplied(const FloatComponents&). 2020-05-22 Andy Estes <aestes@apple.com> [Apple Pay] Add new ApplePayInstallmentConfiguration members https://bugs.webkit.org/show_bug.cgi?id=212160 <rdar://problem/60703650> Reviewed by Alex Christensen. Test: http/tests/ssl/applepay/ApplePayInstallmentItems.https.html * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Added IDLs, headers, and derived sources for ApplePayInstallment{Item,ItemType,RetailChannel}. * Modules/applepay/ApplePayInstallmentConfiguration.idl: * Modules/applepay/ApplePayInstallmentConfigurationWebCore.h: Added items, applicationMetadata, and retailChannel members. Added missing conditionals to merchantIdentifier and referrerIdentifier. * Modules/applepay/ApplePayInstallmentItem.h: * Modules/applepay/ApplePayInstallmentItem.idl: * Modules/applepay/ApplePayInstallmentItemType.h: * Modules/applepay/ApplePayInstallmentItemType.idl: * Modules/applepay/ApplePayInstallmentRetailChannel.h: * Modules/applepay/ApplePayInstallmentRetailChannel.idl: Added. * Modules/applepay/ApplePayRequestBase.cpp: (WebCore::convertAndValidate): Changed to call PaymentInstallmentConfiguration::create, returning an exception if present. * Modules/applepay/PaymentInstallmentConfiguration.mm: (WebCore::fromDecimalNumber): Allowed for a large maximum number of fractional digits to support formatting high-precision currency and APRs (note that this formatter is only used for test support). (WebCore::applePayItemType): (WebCore::platformItemType): Added to convert between PKInstallmentItemType and ApplePayInstallmentItemType. (WebCore::applePayRetailChannel): (WebCore::platformRetailChannel): Added to convert between PKInstallmentRetailChannel and ApplePayInstallmentRetailChannel. (WebCore::makeNSArrayElement): (WebCore::makeVectorElement): Added to convert between NSArray<PKPaymentInstallmentItem *> and Vector<ApplePayInstallmentItem>. (WebCore::createPlatformConfiguration): Added a parameter for passing in applicationMetadata as an NSDictionary. Set properties on PKPaymentInstallmentConfiguration for new ApplePayInstallmentConfiguration members. (WebCore::PaymentInstallmentConfiguration::create): Added; converts the applicationMetadata JSON string (if present) to an NSDictionary, returning a TypeError if the JSON string does not deserialize to an NSDictionary (as PassKit requires). (WebCore::PaymentInstallmentConfiguration::PaymentInstallmentConfiguration): Added a parameter for passing in applicationMetadata as an NSDictionary. Made private. (WebCore::PaymentInstallmentConfiguration::applePayInstallmentConfiguration const): Set members on ApplePayInstallmentConfiguration for new PKPaymentInstallmentConfiguration properties. * Modules/applepay/PaymentInstallmentConfigurationWebCore.h: 2020-05-22 Alex Christensen <achristensen@webkit.org> Add SPI to unblock third party cookies from WKWebViews with ResourceLoadStatistics turned on https://bugs.webkit.org/show_bug.cgi?id=212058 <rdar://problem/60595539> Reviewed by John Wilander. * WebCore.xcodeproj/project.pbxproj: * loader/CookieJar.cpp: (WebCore::shouldRelaxThirdPartyCookieBlocking): (WebCore::CookieJar::cookies const): (WebCore::CookieJar::setCookies): (WebCore::CookieJar::cookieRequestHeaderFieldValue const): (WebCore::CookieJar::getRawCookies const): * page/Page.cpp: (WebCore::m_shouldRelaxThirdPartyCookieBlocking): * page/Page.h: (WebCore::Page::shouldRelaxThirdPartyCookieBlocking const): * page/PageConfiguration.h: * platform/network/CacheValidation.cpp: (WebCore::cookieRequestHeaderFieldValue): * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::shouldBlockCookies const): (WebCore::NetworkStorageSession::maxAgeCacheCap): * platform/network/NetworkStorageSession.h: * platform/network/ShouldRelaxThirdPartyCookieBlocking.h: Added. * platform/network/cf/NetworkStorageSessionCFNetWin.cpp: (WebCore::NetworkStorageSession::setCookiesFromDOM const): (WebCore::NetworkStorageSession::cookiesForDOM const): (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): (WebCore::NetworkStorageSession::getRawCookies const): * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::cookiesForURL const): (WebCore::NetworkStorageSession::cookiesForSession const): (WebCore::NetworkStorageSession::cookiesForDOM const): (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): (WebCore::NetworkStorageSession::setCookiesFromDOM const): (WebCore::NetworkStorageSession::getRawCookies const): * platform/network/curl/NetworkStorageSessionCurl.cpp: (WebCore::NetworkStorageSession::setCookiesFromDOM const): (WebCore::NetworkStorageSession::cookiesForDOM const): (WebCore::NetworkStorageSession::getRawCookies const): (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandle::createCurlRequest): * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::NetworkStorageSession::setCookiesFromDOM const): (WebCore::NetworkStorageSession::getRawCookies const): (WebCore::cookiesForSession): (WebCore::NetworkStorageSession::cookiesForDOM const): (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): 2020-05-22 Oriol Brufau <obrufau@igalia.com> Don't put out-of-flow boxes in anonymous flex/grid items https://bugs.webkit.org/show_bug.cgi?id=205386 Reviewed by Manuel Rego Casasnovas. A single anonymous flex/grid item should just contain a contiguous sequence of text runs. This patch is based on https://crrev.com/533825 from Chromium. Tests: imported/w3c/web-platform-tests/css/css-flexbox/anonymous-flex-item-004.html imported/w3c/web-platform-tests/css/css-grid/grid-items/anonymous-grid-item-001.html * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation): 2020-05-22 Tim Horton <timothy_horton@apple.com> iOS: Pressing tab in the Mail subject field moves focus to the body, but pressing shift tab doesn't move it back https://bugs.webkit.org/show_bug.cgi?id=212243 <rdar://problem/59127764> Reviewed by Wenson Hsieh. New API Tests: WebKit.ShiftTabTakesFocusFromEditableWebView and WebKit.TabDoesNotTakeFocusFromEditableWebView * page/FocusController.cpp: (WebCore::FocusController::relinquishFocusToChrome): (WebCore::FocusController::advanceFocusInDocumentOrder): * page/FocusController.h: Factor out the code that decides whether the Chrome might accept focus, and transfers focus out to the Chrome, for use in EventHandler. * page/EventHandler.cpp: (WebCore::EventHandler::defaultTabEventHandler): In the case where we are shift-tabbing out of an editable web view, allow focus to pass to the Chrome. Previously, we would not allow this, because tabKeyCyclesThroughElements is false in editable web views. However, focus exiting the web view entirely needn't be covered by "cycles through elements" behavior. We can't do this for plain "tab", because that needs to be allowed to insert a tab character instead. 2020-05-22 Tyler Wilcock <twilco.o@protonmail.com> Cannot style ::selection for a flex container https://bugs.webkit.org/show_bug.cgi?id=209822 Reviewed by Antti Koivisto. When needing to query for pseudostyles, RenderText used to unconditionally check the parent's pseudostyles. The parent of RenderText objects is often an anonymous box, depending on the presence of siblings, `display` type, etc. This is problematic as pseudostyles are associated with an element of the DOM, meaning RenderText elements would often fail to find any pseudostyle thanks to their anonymous parent. This patch changes RenderText to traverse its tree of ancestry upwards until it finds a non-anonymous ancestor and gets those pseudostyles, rather than unconditionally trying to get pseudostyles from its direct parent. Blink does something similar when retrieving pseudostyles: https://github.com/chromium/chromium/blob/793cb59c18334f8b506863192bf630776da0f4d2/third_party/blink/renderer/core/paint/selection_painting_utils.cc#L54 Tests: editing/selection/selection-display-block-sibling.html editing/selection/selection-display-flex.html * rendering/RenderObject.cpp: (WebCore::RenderObject::firstNonAnonymousAncestor const): * rendering/RenderObject.h: * rendering/RenderText.h: (WebCore::RenderText::getCachedPseudoStyle const): getCachedPseudoStyle from first non-anonymous ancestor, rather than only checking the direct parent. (WebCore::RenderText::selectionBackgroundColor const): Retrieve selectionBackgroundColor from first non-anonymous ancestor rather than only checking the direct parent. (WebCore::RenderText::selectionForegroundColor const): Retrieve selectionForegroundColor from first non-anonymous ancestor rather than only checking the direct parent. (WebCore::RenderText::selectionEmphasisMarkColor const): Retrieve selectionEmphasisMarkColor from first non-anonymous ancestor rather than only checking the direct parent. (WebCore::RenderText::selectionPseudoStyle const): Retrieve selectionPseudoStyle from first non-anonymous ancestor rather than only checking the direct parent. 2020-05-21 Wenson Hsieh <wenson_hsieh@apple.com> DataTransfer.files contains multiple files when pasting a single image with multiple representations https://bugs.webkit.org/show_bug.cgi?id=212245 <rdar://problem/60240436> Reviewed by Tim Horton. When pasting or dropping a single image that is backed by multiple representations in NSPasteboard (or UIPasteboard), we currently report more than one `File` to the page via `DataTransfer.files`. This is because `Pasteboard::read(PasteboardFileReader&)`, which is responsible for converting the contents of the pasteboard into a list of files, currently iterates over every pasteboard type and adds each of them as a file. This is wrong when an item has multiple type representations. To differentiate the case where a single item has multiple representations from the case where it has multiple pasteboard items, we use `allPasteboardItemInfo()` instead to grab a per-item list of types from the pasteboard on Cocoa platforms, and only create at most 1 file per item using the highest fidelity type that contains data. Test: PasteImage.PasteImageWithMultipleRepresentations * platform/cocoa/PasteboardCocoa.mm: (WebCore::Pasteboard::read): 2020-05-21 Simon Fraser <simon.fraser@apple.com> Fix rare scrolling thread crash firing the m_delayedRenderingUpdateDetectionTimer timer https://bugs.webkit.org/show_bug.cgi?id=212250 Reviewed by Tim Horton. It seems that we can fire the m_delayedRenderingUpdateDetectionTimer timer after the ScrollingTree has been destroyed (possibly because it's destroyed on another thread and CFRunLoopTimerRef isn't threadsafe), so explicitly clear the timer in invalidate() while holding m_treeMutex. * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::invalidate): 2020-05-21 Sam Weinig <weinig@apple.com> Extended Color Cleanup: Move Color coder definitions to Color to allow for future encaspulation improvements https://bugs.webkit.org/show_bug.cgi?id=212247 Reviewed by Simon Fraser. Move IPC encoder/decoder definitions from WebKit down into Color itself to move closer to making Color::rgb() private. * platform/graphics/Color.h: (WebCore::Color::encode const): (WebCore::Color::decode): 2020-05-21 Simon Fraser <simon.fraser@apple.com> Scrolling thread scrolls on sync-scrolling scrollers don't get to the main thread https://bugs.webkit.org/show_bug.cgi?id=212225 Fix builds that use Nicosia after r262041. * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeFrameScrollingNodeNicosia::currentScrollPositionChanged): * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: 2020-05-21 Simon Fraser <simon.fraser@apple.com> Fix some thread safety issues with ScrollController timers https://bugs.webkit.org/show_bug.cgi?id=212238 Reviewed by Wenson Hsieh. There were some problems with the timers fired by ScrollController, used for rubber-banding and scroll snap. First, they could fire on the main thread when we intended them to fire on the scrolling thread. This happened because in r260716 I made the scrolling tree commit on the main thread, so we'd construct the ScrollingTreeScrollingNodeDelegateMac and its ScrollController there and its timers would grab the main thread runloop. Fix by creating the timers on demand. Secondly, the timer callbacks called into scrolling tree code, but without taking the scrolling tree lock, and without any guarantee that the node would stay alive for the duration of the callback. Fix by having the ScrollControllerClient create the timers, allowing the client to have a callback wrapper that locks, and to ensure object lifetime (or make a weak ref). Now that scrolling tree nodes could be extended by a pending timer, we need to explicitly clear the timers when nodes are removed from the tree. Finally, rename some confusingly named ScrollControllerClient functions. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::commitTreeState): * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::treeMutex): * page/scrolling/ScrollingTreeNode.h: (WebCore::ScrollingTreeNode::wasBeRemovedFromTree): * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::wasBeRemovedFromTree): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::wasBeRemovedFromTree): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::nodeWillBeDestroyed): (WebCore::ScrollingTreeScrollingNodeDelegateMac::createTimer): (WebCore::ScrollingTreeScrollingNodeDelegateMac::didStopRubberbandSnapAnimation): (WebCore::ScrollingTreeScrollingNodeDelegateMac::willStartScrollSnapAnimation): (WebCore::ScrollingTreeScrollingNodeDelegateMac::didStopScrollSnapAnimation): (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopSnapRubberbandTimer): Deleted. (WebCore::ScrollingTreeScrollingNodeDelegateMac::startScrollSnapTimer): Deleted. (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopScrollSnapTimer): Deleted. * platform/ScrollAnimator.cpp: (WebCore::ScrollAnimator::createTimer): * platform/ScrollAnimator.h: * platform/cocoa/ScrollController.h: (WebCore::ScrollControllerTimer::ScrollControllerTimer): (WebCore::ScrollControllerClient::willStartRubberBandSnapAnimation): (WebCore::ScrollControllerClient::didStopRubberbandSnapAnimation): (WebCore::ScrollControllerClient::willStartScrollSnapAnimation): (WebCore::ScrollControllerClient::didStopScrollSnapAnimation): (WebCore::ScrollControllerClient::startSnapRubberbandTimer): Deleted. (WebCore::ScrollControllerClient::stopSnapRubberbandTimer): Deleted. (WebCore::ScrollControllerClient::startScrollSnapTimer): Deleted. (WebCore::ScrollControllerClient::stopScrollSnapTimer): Deleted. * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::ScrollController): (WebCore::ScrollController::stopAllTimers): (WebCore::ScrollController::handleWheelEvent): (WebCore::ScrollController::snapRubberBandTimerFired): (WebCore::ScrollController::isRubberBandInProgress const): (WebCore::ScrollController::isScrollSnapInProgress const): (WebCore::ScrollController::startSnapRubberbandTimer): (WebCore::ScrollController::stopSnapRubberbandTimer): (WebCore::ScrollController::snapRubberBand): (WebCore::ScrollController::scheduleStatelessScrollSnap): (WebCore::ScrollController::statelessSnapTransitionTimerFired): (WebCore::ScrollController::startScrollSnapTimer): (WebCore::ScrollController::stopScrollSnapTimer): * platform/mac/ScrollAnimatorMac.h: 2020-05-21 Simon Fraser <simon.fraser@apple.com> Scrolling thread scrolls on sync-scrolling scrollers don't get to the main thread https://bugs.webkit.org/show_bug.cgi?id=212225 Reviewed by Tim Horton. Some scrolls on nodes with synchronousScrollingReasons failed to set the m_scrolledSinceLastCommit bit, because ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged() bypassed a call to the superclass. Fix by passing ScrollingLayerPositionAction so that it can just call super. This will be tested by existing tests after some upcoming scroll snap changes. * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged): 2020-05-21 Peng Liu <peng.liu6@apple.com> Fix issues of the Picture-in-Picture API under stress tests https://bugs.webkit.org/show_bug.cgi?id=212191 Reviewed by Eric Carlson. The current implementation of the Picture-in-Picture API is not robust under stress tests. Changing the video presentation mode of a video element between inline and picture-in-picture continuously may corrupt the internal states of the video element. This patch refactors the approach to tracking the progress of video presentation mode changes and make sure no new requestPictureInPicture() or exitPictureInPicture() will trigger a presentation mode change unless the previous operations are completed. This patch also removes the code for testing purposes in the HTMLVideoElement class. Covered by existing tests. * html/HTMLMediaElement.h: * html/HTMLVideoElement.cpp: (WebCore::toPresentationMode): (WebCore::HTMLVideoElement::setFullscreenMode): (WebCore::HTMLVideoElement::fullscreenModeChanged): (WebCore::HTMLVideoElement::didEnterFullscreen): (WebCore::HTMLVideoElement::didExitFullscreen): (WebCore::HTMLVideoElement::setPictureInPictureObserver): (WebCore::HTMLVideoElement::setVideoFullscreenFrame): (WebCore::HTMLVideoElement::didBecomeFullscreenElement): Deleted. (WebCore::HTMLVideoElement::setPictureInPictureAPITestEnabled): Deleted. * html/HTMLVideoElement.h: * testing/Internals.cpp: (WebCore::Internals::setPictureInPictureAPITestEnabled): Deleted. * testing/Internals.h: * testing/Internals.idl: Remove setPictureInPictureAPITestEnabled(). 2020-05-21 Sam Weinig <weinig@apple.com> Extended Color Cleanup: Remove trivial uses of Color::rgb() https://bugs.webkit.org/show_bug.cgi?id=212231 Reviewed by Darin Adler Replaces a few unnecessary uses of Color::rgb(): - Uses of an idiom where code round-tripped a Color via Color(myColor.rgb()). This is not compatible with extended colors and seems to be unnecessary. - Uses of colorWithOverrideAlpha(). This function requires a SimpleColor, so required using color.rgb(). We can't transition to Color::colorWithAlpha due to a slightly different rounding of the alpha, so a new function Color::colorWithAlphaUsingAlternativeRounding was added to which implements the alternative rounding. A later change can reconcile the two versions. - Creation of D2D1::ColorF. D2D1::ColorF has a constructor that takes a four floats that is used instead. - Comparing two colors using rgb() for each to avoid comparing the semantic bit. equalIgnoringSemanticColor exists for just this use. * editing/cocoa/HTMLConverter.mm: (HTMLConverterCaches::colorPropertyValueForNode): * html/HTMLElement.cpp: (WebCore::HTMLElement::addHTMLColorToStyle): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::setStrokeStyle): (WebCore::CanvasRenderingContext2DBase::setFillStyle): (WebCore::CanvasRenderingContext2DBase::setShadow): * html/canvas/CanvasStyle.cpp: (WebCore::CanvasStyle::createFromStringWithOverrideAlpha): * html/track/InbandGenericTextTrack.cpp: (WebCore::InbandGenericTextTrack::updateCueFromCueData): * platform/graphics/Color.cpp: (WebCore::Color::colorWithAlphaMultipliedByUsingAlternativeRounding const): (WebCore::Color::colorWithAlpha const): (WebCore::Color::colorWithAlphaUsingAlternativeRounding const): (WebCore::colorWithOverrideAlpha): Deleted. * platform/graphics/Color.h: (WebCore::colorWithOverrideAlpha): Deleted. * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::prepareCairoContextSource): * platform/graphics/filters/FEFlood.cpp: (WebCore::FEFlood::platformApplySoftware): * platform/graphics/win/ColorDirect2D.cpp: (WebCore::Color::operator D2D1_COLOR_F const): (WebCore::Color::operator D2D1_VECTOR_4F const): * platform/graphics/win/GraphicsContextDirect2D.cpp: (WebCore::GraphicsContext::colorWithGlobalAlpha const): * platform/mac/ThemeMac.mm: (WebCore::drawCellFocusRingWithFrameAtTime): * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintFileUploadIconDecorations): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::platformFocusRingColor const): * rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): * svg/SVGStopElement.cpp: (WebCore::SVGStopElement::stopColorIncludingOpacity const): 2020-05-21 Oriol Brufau <obrufau@igalia.com> [css-grid] Don't create renderers for whitespace nodes https://bugs.webkit.org/show_bug.cgi?id=212220 Reviewed by Manuel Rego Casasnovas. Even with 'white-space: pre' we shouldn't create RenderTexts for whitespace-only nodes in grid layout, according to https://drafts.csswg.org/css-grid/#grid-items This patch is based on https://codereview.chromium.org/16888008 Tests: fast/text/simple-line-layout-with-zero-sized-font.html imported/w3c/web-platform-tests/css/css-grid/grid-items/whitespace-in-grid-item-001.html * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::textRendererIsNeeded): 2020-05-21 Simon Fraser <simon.fraser@apple.com> Fix rare crash in TileGrid::platformCALayerShowRepaintCounter() https://bugs.webkit.org/show_bug.cgi?id=212182 <rdar://problem/55618414> Reviewed by Darin Adler. Crash data suggest that owner() can be null in platformCALayerShowRepaintCounter(), so null-check in these functions. * platform/graphics/ca/TileGrid.cpp: (WebCore::TileGrid::platformCALayerDeviceScaleFactor const): (WebCore::TileGrid::platformCALayerShowDebugBorders const): (WebCore::TileGrid::platformCALayerShowRepaintCounter const): (WebCore::TileGrid::isUsingDisplayListDrawing const): 2020-05-21 Youenn Fablet <youenn@apple.com> Incorrect location.origin in blob workers https://bugs.webkit.org/show_bug.cgi?id=211876 <rdar://problem/63284717> Reviewed by Sihui Liu. Instead of computing the origin from the location URL in worker, get it directly from the WorkerGlobalScope origin. This ensures we unwrap properly blob URLs. Test: http/tests/security/contentSecurityPolicy/worker-blob-location.html * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::location const): * workers/WorkerLocation.cpp: (WebCore::WorkerLocation::origin const): * workers/WorkerLocation.h: (WebCore::WorkerLocation::create): (WebCore::WorkerLocation::url const): (WebCore::WorkerLocation::WorkerLocation): 2020-05-21 John Wilander <wilander@apple.com> Storage Access API: Allow configurable storage access scope https://bugs.webkit.org/show_bug.cgi?id=212114 <rdar://problem/63423063> Reviewed by Alex Christensen. The scope of storage access as per-frame or per-page was discussed in the standards process here: https://github.com/privacycg/storage-access/issues/3 The decision was to have per-page storage access by default. Recent feedback from Google and conversation with Mozilla suggest that we might want to support the caller choosing the scope. This patch adds support for different scope configurations while keeping the existing default as per-frame. A later patch will switch the default and add test cases for per-page scope. A new struct is added WebCore::RequestStorageAccessResult which carries full information about the storage access request result. A new enum is added WebCore::StorageAccessScope to encode per-frame and per-page access. No new tests. No changed functionality. Tests already exist. * dom/DocumentStorageAccess.cpp: (WebCore::DocumentStorageAccess::requestStorageAccess): * dom/DocumentStorageAccess.h: (WebCore::RequestStorageAccessResult::encode const): (WebCore::RequestStorageAccessResult::decode): * page/ChromeClient.h: (WebCore::ChromeClient::requestStorageAccess): 2020-05-21 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com> [PlayStation] Add minimal WKView API to enable TestWebKitAPI https://bugs.webkit.org/show_bug.cgi?id=211868 Reviewed by Alex Christensen. Enable TestWebKitAPI * PlatformPlayStation.cmake: Add WebKitRequirements library to WebCore_CopySharedLibs. 2020-05-21 Chris Dumez <cdumez@apple.com> ASSERTION FAILED: m_wrapper on fast/events/scoped/editing-commands.html https://bugs.webkit.org/show_bug.cgi?id=209862 <rdar://problem/61164607> Reviewed by Darin Adler. Make sure ScopedEventQueue keeps its event targets alive using a GCReachableRef<Node> so that it keeps alive both the target and its JS wrapper. No new tests, covered by existing test. * dom/ScopedEventQueue.cpp: (WebCore::ScopedEventQueue::enqueueEvent): (WebCore::ScopedEventQueue::dispatchEvent const): (WebCore::ScopedEventQueue::dispatchAllEvents): * dom/ScopedEventQueue.h: 2020-05-21 Sihui Liu <sihui_liu@apple.com> SQLite database fails to close in SQLiteIDBBackingStore::databaseNameFromFile https://bugs.webkit.org/show_bug.cgi?id=212090 Reviewed by Darin Adler. We should finish SQLite statement before closing database. * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile): 2020-05-21 Doug Kelly <dougk@apple.com> Dispatch pending events only for current page https://bugs.webkit.org/show_bug.cgi?id=211975 <rdar://problem/58942759> Reviewed by Chris Dumez. Document::implicitClose() should not dispatch events globally. The EventSender class operates as a singleton pattern for each event queue, so to add some means to restrict which documents are handling events, we can send the current page pointer and only dispatch the event if the event is for the same page. Other events are simply re-enqueued to be triggered at a later time. * dom/Document.cpp: (WebCore::Document::implicitClose): * dom/EventSender.h: (WebCore::EventSender::timerFired): (WebCore::EventSender<T>::dispatchPendingEvents): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::dispatchPendingLoadEvents): * html/HTMLLinkElement.h: * html/HTMLStyleElement.cpp: (WebCore::HTMLStyleElement::dispatchPendingLoadEvents): * html/HTMLStyleElement.h: * loader/ImageLoader.cpp: (WebCore::ImageLoader::dispatchPendingBeforeLoadEvents): (WebCore::ImageLoader::dispatchPendingLoadEvents): (WebCore::ImageLoader::dispatchPendingErrorEvents): * loader/ImageLoader.h: (WebCore::ImageLoader::document): * xml/parser/XMLDocumentParser.cpp: (WebCore::XMLDocumentParser::append): 2020-05-21 Simon Fraser <simon.fraser@apple.com> [macOS] Scrolling synchronization part 2: Have the scrolling thread detect when the main thread is slow to respond to start a rendering update https://bugs.webkit.org/show_bug.cgi?id=212175 Reviewed by Tim Horton. The scrolling thread now detects when a main thread rendering update is taking too long, going into desynchronized mode when that happens. However, there's another state that needs to be handled, which is the main thread being busy and taking too long to start the rendering update. The scrolling thread gets a "displayDidRefresh" ping and expects that the main thread will get the same ping, and use it to start the rendering update, but a busy main thread won't respond to this ping promptly. Detect this with a short-duration (1ms) timer that fires on the scrolling thread; if the timer fires we go into desynchronized mode until the next update. The timer is canceled if the scrolling thread receives the willStartRenderingUpdate(). * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::waitForRenderingUpdateCompletionOrTimeout): (WebCore::ThreadedScrollingTree::scheduleDelayedRenderingUpdateDetectionTimer): (WebCore::ThreadedScrollingTree::delayedRenderingUpdateDetectionTimerFired): (WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread): * page/scrolling/ThreadedScrollingTree.h: 2020-05-21 Sergio Villar Senin <svillar@igalia.com> [css-grid] [css-flex] Width of table as grid/flex item is infinite when the sum of columns' width exceed 100% https://bugs.webkit.org/show_bug.cgi?id=191365 Reviewed by Manuel Rego Casasnovas. Automatic table layout algorithm generates infinite width tables (tableMaxWidth to be more exact) when the sum of the columns percentages exceed the 100% value and there is at least one non-percentage based column with positive width as in those cases it's impossible to fulfill the table constrains. That should not be done in the case of the table being a flex or a grid item because they both define new formatting contexts. Based on Blink's crrev.com/1095220 by <mstensho@chromium.org> * rendering/AutoTableLayout.cpp: (WebCore::shouldScaleColumnsForParent): return false when the table is either a grid or a flex item. 2020-05-21 Zalan Bujtas <zalan@apple.com> [ macOS debug ] REGRESSION: fast/layoutformattingcontext/table-basic-row-baseline-with-nested-table.html is a flaky crash https://bugs.webkit.org/show_bug.cgi?id=212139 <rdar://problem/63447683> Reviewed by Antti Koivisto. Uninitialized row baseline value caused unexpected cell height in nested tables. * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): * layout/tableformatting/TableGrid.h: 2020-05-21 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Collapse in-between cell borders https://bugs.webkit.org/show_bug.cgi?id=212183 Reviewed by Antti Koivisto. This patch expands border collapsing to in-between cell borders. Test: fast/layoutformattingcontext/table-simple-border-collapse3.html * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutCell): * layout/tableformatting/TableFormattingContext.h: * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::computedCellBorder const): (WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell): 2020-05-21 Enrique Ocaña González <eocanha@igalia.com> [GStreamer][GTK][WPE] Expose and honor the media content types requiring hardware support setting https://bugs.webkit.org/show_bug.cgi?id=211950 Reviewed by Adrian Perez de Castro. Provide the needed information about media content types requiring hardware support when asking the MediaPlayer about what types are supported. This was already being done from HTMLMediaElement for player selection, but not in MediaSource nor in MediaSource::addSourceBuffer() when the webpage used the MSE API to check type support. In order to ask for the mediaContentTypesRequiringHardwareSupport setting we need a reference to the current Document in all the places where we need to check type support. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::addSourceBuffer): Provide hardware content types extra info. (WebCore::MediaSource::isTypeSupported): Get hardware content types extra info from ScriptExecutionContext and provide it to a new refactored private version of isTypeSupported() which can also be reused from addSourceBuffer(). * Modules/mediasource/MediaSource.h: Changed isTypeSupported() prototype to take ScriptExecutionContext and added a new overloaded version of the method. * Modules/mediasource/MediaSource.idl: isTypeSupported() now provides a reference to ScriptExecutionContext. It's the only way to access the required document settings from a static method. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::isContentTypeSupported const): Factor ContentType discrimination logic common to MediaPlayerPrivateGStreamer and MediaPlayerPrivateGStreamerMSE. * platform/graphics/gstreamer/GStreamerRegistryScanner.h: Added new method. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::supportsType): Provide hardware content types extra info when asking for type support. * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType): Ditto. 2020-05-20 Simon Fraser <simon.fraser@apple.com> [macOS] Scrolling synchronization part 1: Have the scrolling thread wait half a frame for the main thread to complete the rendering update https://bugs.webkit.org/show_bug.cgi?id=212168 Reviewed by Tim Horton. Currently the scrolling thread is a free-running thread that moves layers around in response to wheel events, and asynchronously posts data about scrolled layers back to the main thread. That results in an almost guaranteed lack of synchronization between the displayed layer positions, and the web-exposed values for scroll position (element.scrollTop, window.pageYOffset etc). This is a frequent source of stuttering or jumpy web content when scrolling. The first step to fixing this is to synchronize the scrolling thread layer positions and the main thread state for the case where the main thread is responsive enough to render once per frame. This is achieved as follow: - When the main thread is starting a rendering update, Page::updateRendering() informs the scrolling tree via ScrollingCoordinatorMac::willStartRenderingUpdate(). This atomically waits for the scrolling thread to take the m_treeMutex (via a BinarySemaphore) and starts waiting on the m_stateCondition Condition. Now the main thread pulls the state of the scrolling tree via synchronizeStateFromScrollingTree() and uses it for the rendering update. - If the rendering update finishes within half a frame (8ms), then m_stateCondition is released, and the scrolling thread assumes that the main thread is going to commit layers rapidly enough to preserve 60fps scrolling. - If the rendering update takes too long, m_stateCondition times out, and the scrolling thread applies layer positions, triggering a CA commit on that thread. We no longer apply layer positions directly when handling wheel events. synchronizeStateFromScrollingTree() has to only pull state from nodes that have moved on the scrolling thread, so track that via ScrollingTreeScrollingNode::scrolledSinceLastCommit() and adjust the visitor function to make it available during scrolling tree traversal. * page/Page.cpp: (WebCore::Page::updateRendering): (WebCore::Page::finalizeRenderingUpdate): * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::synchronizeStateFromScrollingTree): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::willStartRenderingUpdate): (WebCore::ScrollingCoordinator::didCompleteRenderingUpdate): (WebCore::ScrollingCoordinator::synchronizeStateFromScrollingTree): Deleted. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::handleWheelEvent): (WebCore::ScrollingTree::traverseScrollingTreeRecursive): (WebCore::ScrollingTree::commitTreeState): (WebCore::ScrollingTree::updateTreeFromStateNodeRecursive): (WebCore::ScrollingTree::applyLayerPositionsInternal): (WebCore::ScrollingTree::nominalFramesPerSecond): * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeNode.h: (WebCore::ScrollingTreeNode::didCompleteCommitForNode): * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::didCompleteCommitForNode): (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::willStartRenderingUpdate): (WebCore::ThreadedScrollingTree::maxAllowableRenderingUpdateDurationForSynchronization): (WebCore::ThreadedScrollingTree::waitForRenderingUpdateCompletionOrTimeout): (WebCore::ThreadedScrollingTree::didCompleteRenderingUpdate): (WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread): * page/scrolling/ThreadedScrollingTree.h: (WebCore::ThreadedScrollingTree::treeMutex): * page/scrolling/mac/ScrollingCoordinatorMac.h: * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::willStartRenderingUpdate): (WebCore::ScrollingCoordinatorMac::didCompleteRenderingUpdate): 2020-05-20 Chris Fleizach <cfleizach@apple.com> REGRESSION (iOS 13.4.1): SpeechSynthesisUtterance.onend event won't fire on cancel(). https://bugs.webkit.org/show_bug.cgi?id=211776 <rdar://problem/63130249> Reviewed by Per Arne Vollan. With the move to having speech synthesis happen in the client, the cancel case hits a snag. We cancel the speech job and clear out the current utterance. By the time the cancel callback comes back, the current utterance is gone and nothing happens. The fix is to process the speechError event immediately and not wait on the speech synthesizer -- which seems sane, since we're just cancelling a speech job. * Modules/speech/SpeechSynthesis.cpp: (WebCore::SpeechSynthesis::cancel): 2020-05-20 Darin Adler <darin@apple.com> Dictation context should be an object identifier, not a type-punned pointer https://bugs.webkit.org/show_bug.cgi?id=212174 Reviewed by Anders Carlsson. * Headers.cmake: Added DictationContext.h. * Sources.txt: Removed DictationAlternative.cpp. * WebCore.xcodeproj/project.pbxproj: Added DictationContext.h, removed DictationAlternative.cpp. * dom/DocumentMarker.h: Use DictationContext instead of uint64_t. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::timerFired): Ditto. * editing/AlternativeTextController.h: Ditto. * editing/DictationAlternative.h: Use DictationContext instead of uint64_t, but also use CharacterRange rather than two "unsigned" values. Also convert into a simple struct without constructors; don't really need those. * editing/DictationAlternative.cpp: Removed. * editing/DictationCommand.cpp: (WebCore::DictationCommand::collectDictationAlternativesInRange): Updated for changes to DictationAlternative. * editing/DictationContext.h: Added. * editing/Editor.h: Forward declare DictationAlternative rather than including its header. * editing/cocoa/AlternativeTextContextController.h: Use a pair of maps to bind NSTextAlternatives objects to object identifiers. Remove unnecessary explicit constructor and destructor. Also removed unnecessary use of WTF_MAKE_FAST_ALLOCATED, since this is only used as a data member of another class. Removed unused invalidContext constant. * editing/cocoa/AlternativeTextContextController.mm: Removed the unneeded includes. This file treats NSTextAlternatives as an opaque Objective-C type and so doesn't need any details of that class. (WebCore::AlternativeTextContextController::addAlternatives): Changed to return a DictationContext and use two maps, using HashMap::ensure to avoid double hashing. (WebCore::AlternativeTextContextController::alternativesForContext): Added a null check. (WebCore::AlternativeTextContextController::removeAlternativesForContext): Ditto. Also updated to remove from both maps. (WebCore::AlternativeTextContextController::clear): Clear both maps. * editing/cocoa/AlternativeTextUIController.h: Since this header is used only from Objective-C, removed use of OBJC_CLASS. Put showAlternatives inside a macOS-specific block. Use DictationContext instead of uint64_t. * editing/cocoa/AlternativeTextUIController.mm: (WebCore::AlternativeTextUIController::addAlternatives): Use DictationContext instead of uint64_t. (WebCore::AlternativeTextUIController::alternativesForContext): Ditto. (WebCore::AlternativeTextUIController::showAlternatives): Ditto. (WebCore::AlternativeTextUIController::handleAcceptedAlternative): Ditto. (WebCore::AlternativeTextUIController::removeAlternatives): Ditto. * page/AlternativeTextClient.h: Use DictationContext instead of uint64_t. 2020-05-20 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Preferred width computation should take border collapsing into account https://bugs.webkit.org/show_bug.cgi?id=212141 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-simple-border-collapse2.html * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns): * layout/tableformatting/TableFormattingContext.h: (WebCore::Layout::TableFormattingContext::Geometry::Geometry): * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell): 2020-05-20 Zalan Bujtas <zalan@apple.com> Repaint issues when the login field collapses on music.apple.com https://bugs.webkit.org/show_bug.cgi?id=212101 <rdar://problem/62874369> Reviewed by Simon Fraser. RenderWidgets (e.g iframe) are painted on integral pixel boundaries. When we issue the repaints on such renderers, we need to make sure that the repaint rectangles are also snapped to integral pixel values. Currently trunk only covers the case when the renderer itself is positioned on a subpixel position (e.g when the containing block's content box has a non-integral position value). This patch ensures that we repaint the RenderWidgets properly when a non-direct ancestor puts the renderer on a subpixel position. Test: fast/repaint/iframe-on-subpixel-position.html * page/FrameView.h: * rendering/RenderBox.cpp: (WebCore::RenderBox::computeVisibleRectInContainer const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::setContentsNeedDisplay): (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): * rendering/RenderObject.h: * testing/Internals.cpp: (WebCore::Internals::enableSubframeRepaintTracking): add subframe repaint tracking (WebCore::Internals::disableSubframeRepaintTracking): * testing/Internals.h: * testing/Internals.idl: 2020-05-20 Oriol Brufau <obrufau@igalia.com> Computed min-width/height for auto depends on box https://bugs.webkit.org/show_bug.cgi?id=209651 Reviewed by Manuel Rego Casasnovas. Resolved value of min-width and min-height for auto min sizing of flex and grid items may be 'auto'. We based this on the computed style of the shadow including parent. Instead we should rely on whether the element will actually be a rendered flex/grid item. The difference matters e.g. when the parent has 'display: contents' and thus is not a flex nor grid container, but the element can still be a flex or grid item, depending on the grand-parent. This patch is based on https://crrev.com/540901 from Chromium. Tests: imported/w3c/web-platform-tests/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_min-auto-size.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-min-auto-size-001.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::isFlexOrGridItem): (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): 2020-05-20 Alex Christensen <achristensen@webkit.org> Remove implicit URL->String conversion operators https://bugs.webkit.org/show_bug.cgi?id=211033 Reviewed by Darin Adler. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::stringValueForMSAA const): * html/DOMURL.cpp: (WebCore::DOMURL::create): * html/HTMLPlugInElement.cpp: (WebCore::pluginReplacementForType): * html/URLUtils.h: (WebCore::URLUtils<T>::protocol const): (WebCore::URLUtils<T>::setUsername): (WebCore::URLUtils<T>::setPassword): * page/Location.cpp: (WebCore::Location::setProtocol): (WebCore::Location::setHost): (WebCore::Location::setHostname): (WebCore::Location::setPort): (WebCore::Location::setPathname): (WebCore::Location::setSearch): (WebCore::Location::setHash): * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::load): 2020-05-20 Sam Weinig <weinig@apple.com> Replace Color::getHSL() with sRGBToHSL to ensure it at least gives somewhat sensible results for ExtendedColors and reduce code duplication https://bugs.webkit.org/show_bug.cgi?id=212143 Reviewed by Simon Fraser. - Updated API tests to test sRGBToHSL() rather than Color::getHSL() and extended the tests to include lightness tests and round tripping tests. - Update editing/pasteboard/paste-dark-mode-color-filtered.html with extended color test cases. Replaces Color::getHSL() with sRGBToHSL(color.toSRGBAComponentsLossy()) and adds an optimized variant, lightness(...) that just extracts the lightness component for callers that only needed that. It is now required to explicitly use color.toSRGBAComponentsLossy() to indicate that for non-SRGB colors, this will be a lossy transformation and give us an easy way to find all these sites in the future, if we want to make a better conversion for other color spaces. * editing/ReplaceSelectionCommand.cpp: (WebCore::fragmentNeedsColorTransformed): Switch to using lightness(). This was previously broken for extended colors but now works (though in a lossy way through sRGB). Update editing/pasteboard/paste-dark-mode-color-filtered.html with extended colors. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): Switch to using sRGBToHSL(color.toSRGBAComponentsLossy()). * page/FrameView.cpp: (WebCore::FrameView::recalculateScrollbarOverlayStyle): Switch to using lightness(). * platform/graphics/Color.cpp: (WebCore::Color::getHSL const): Deleted. * platform/graphics/Color.h: Remove Color::getHSL(). * platform/graphics/ColorUtilities.cpp: (WebCore::lightness): Added optimized subset of sRGBToHSL which just computes the lightness component for callers that only need that. (WebCore::sRGBToHSL): Simplify/cleanup code a little using initialize-list based std::max/std::min and structured bindings. * platform/graphics/ColorUtilities.h: Export functions to allow testing them directly. 2020-05-20 Megan Gardner <megan_gardner@apple.com> Hide password echo when screen is being captured. https://bugs.webkit.org/show_bug.cgi?id=212060 <rdar://problem/47653578> Reviewed by Wenson Hsieh. When the screen is being captured, turn off the password echo. * editing/InsertIntoTextNodeCommand.cpp: (WebCore::InsertIntoTextNodeCommand::doApply): * page/EditorClient.h: (WebCore::EditorClient::isScreenCaptured const): 2020-05-20 ChangSeok Oh <changseok@webkit.org> [GTK] Implement connected and disconnected events of GAMEPAD API with libmanette https://bugs.webkit.org/show_bug.cgi?id=133854 Reviewed by Carlos Garcia Campos. This patch brings initial GAMEPAD API support to the gtk port. We use libmanette, a simple GObject game controller library to handle gamepad connection and input. This change aims to implement two GAMEPAD API events: 'gamepadconnected' and 'gamepaddisconnected' on top of libmanette. Rest of API will be implemented by following patches. No new tests since existing tests can cover this change. * PlatformGTK.cmake: Add header & library paths for libmanette. * SourcesGTK.txt: * platform/gamepad/manette/GUniquePtrManette.h: Added to define a smart pointer for ManetteMonitor. * platform/gamepad/manette/ManetteGamepad.cpp: Added. A wrapper class for ManetteDevice. A ManetteGamepad instance is created per a physically connected gamepad. Currently, it is empty but input handling login will be placed in this class. (WebCore::ManetteGamepad::ManetteGamepad): * platform/gamepad/manette/ManetteGamepad.h: Added. * platform/gamepad/manette/ManetteGamepadProvider.cpp: Added. A manager class for ManetteGamepad instances. This class represents ManetteMonitor that handles connection and disconnection of gamepads. Many parts of this class implementation is brought from HIDGamepad.cpp (WebCore::ManetteGamepadProvider::singleton): (WebCore::onDeviceConnected): (WebCore::onDeviceDisconnected): (WebCore::ManetteGamepadProvider::ManetteGamepadProvider): (WebCore::ManetteGamepadProvider::startMonitoringGamepads): (WebCore::ManetteGamepadProvider::stopMonitoringGamepads): (WebCore::ManetteGamepadProvider::deviceConnected): (WebCore::ManetteGamepadProvider::deviceDisconnected): (WebCore::ManetteGamepadProvider::indexForNewlyConnectedDevice): (WebCore::ManetteGamepadProvider::connectionDelayTimerFired): (WebCore::ManetteGamepadProvider::removeGamepadForDevice): * platform/gamepad/manette/ManetteGamepadProvider.h: Added. 2020-05-20 Antoine Quint <graouts@apple.com> Potential crash in PointerCaptureController::cancelPointer() https://bugs.webkit.org/show_bug.cgi?id=208347 <rdar://problem/59866247> Reviewed by David Kilzer and Daniel Bates. * page/PointerCaptureController.cpp: (WebCore::PointerCaptureController::cancelPointer): 2020-05-20 Oriol Brufau <obrufau@igalia.com> [css-grid] Fix auto repeat with multiple tracks and gutters https://bugs.webkit.org/show_bug.cgi?id=182922 Reviewed by Manuel Rego Casasnovas. The code that computes the number of auto repeat tracks wrongly assumes that the second argument of the repeat() notation is a single track function. That was true in the beginning, however specs were later on modified to allow a <track-list>. We support a <track-list> as a second argument since long ago but the code that computes the number of auto-repeat tracks was never updated. This patch modifies two places that relate to the gaps between the auto-repeat tracks, which ensures the proper total length. This is a port of https://crrev.com/620278 from Chromium. Tests: fast/css-grid-layout/grid-auto-repeat-huge-grid.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-multiple-values-001.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::computeAutoRepeatTracksCount const): 2020-05-20 Simon Fraser <simon.fraser@apple.com> Plumb the display's nominal refresh rate down to ScrollingTree for use in scroll synchronization https://bugs.webkit.org/show_bug.cgi?id=212159 Reviewed by Tim Horton. Plumb an Optional<unsigned> down windowScreenDidChange, which contains the nominal display refresh rate (as frames per second) if available. On macOS, we get this from CVDisplayLinkGetNominalOutputVideoRefreshPeriod(). To read it, WebProcessPool::nominalFramesPerSecondForDisplay() makes a DisplayLink that doesn't get any observers, but that DisplayLink will very likely get used as soon as we schedule a rendering update. * page/Chrome.cpp: (WebCore::Chrome::windowScreenDidChange): * page/Chrome.h: * page/Page.cpp: (WebCore::Page::scrollingCoordinator): (WebCore::Page::windowScreenDidChange): * page/Page.h: (WebCore::Page::displayNominalFramesPerSecond const): * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::windowScreenDidChange): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::windowScreenDidChange): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::windowScreenDidChange): * page/scrolling/ScrollingTree.h: * platform/HostWindow.h: 2020-05-20 Chris Dumez <cdumez@apple.com> Disable support for BeforeLoadEvent https://bugs.webkit.org/show_bug.cgi?id=212140 <rdar://problem/62847577> Reviewed by Antti Koivisto. Disable support for BeforeLoadEvent. Other browsers do not support it and Chrome dropped it shortly after the fork: - https://bugs.chromium.org/p/chromium/issues/detail?id=333318 This is a synchronous event and therefore very dangerous. Test: fast/frames/didBecomeCurrentDocumentInFrame-crash.html * bindings/js/WebCoreBuiltinNames.h: * dom/BeforeLoadEvent.idl: * dom/Node.cpp: (WebCore::Node::dispatchBeforeLoadEvent): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setLegacyBeforeLoadEventEnabled): (WebCore::RuntimeEnabledFeatures::legacyBeforeLoadEventEnabled const): 2020-05-20 Zalan Bujtas <zalan@apple.com> RenderObject::VisibleRectContext members should not be prefixed with m_ https://bugs.webkit.org/show_bug.cgi?id=212154 Reviewed by Simon Fraser. * rendering/RenderBox.cpp: (WebCore::RenderBox::applyCachedClipAndScrollPosition const): (WebCore::RenderBox::computeVisibleRectInContainer const): * rendering/RenderInline.cpp: (WebCore::RenderInline::computeVisibleRectInContainer const): * rendering/RenderObject.cpp: (WebCore::RenderObject::computeVisibleRectInContainer const): * rendering/RenderObject.h: * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::computeVisibleRectInContainer const): * rendering/RenderView.cpp: (WebCore::RenderView::computeVisibleRectInContainer const): * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::computeFloatVisibleRectInContainer const): 2020-05-20 Myles C. Maxfield <mmaxfield@apple.com> [iPadOS] -webkit-text-size-adjust:percentage doesn't work https://bugs.webkit.org/show_bug.cgi?id=212122 <rdar://problem/54560875> Reviewed by Wenson Hsieh. We've gotten many bug reports that -webkit-text-size-adjust:X% no longer works in WebKit on iPads. We don't want to just start honoring the value, because our testing indicates that, with desktop-class browsing on iPad, more sites work better when we don't honor percentages. However, if Safari is using the mobile content mode, or if a native app has local content, it should be possible to get the old behavior of honoring percentages. This patch adds a new Setting, idempotentModeAutosizingOnlyHonorsPercentages, which is hooked up to the desktop-class browsing feature. When WebPageProxy::effectiveContentModeAfterAdjustingPolicies() determines that the WebContentMode::Mobile mode should be used, it sets the new setting, which causes idempotent text autosizing mode to have the same behavior that WKWebViews on iPadOS used to have: -w-t-s-a:auto and -w-t-s-a:none have no effect, but -w-t-s-a:X% is honored. This affects both Safari and WKWebView apps. If a native app wants the old behavior, they can set WKWebpagePreferences.preferredContentMode = WKContentModeMobile to force the old iPad behavior. It's expected that apps with legacy content would be doing this anyway. Tests: fast/text-autosizing/ios/idempotentmode/idempotent-percentage.html TestWebKitAPI.PreferredContentMode.IdempotentModeAutosizingOnlyHonorsPercentages * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::applyPoliciesToSettings): * loader/DocumentLoader.h: (WebCore::DocumentLoader::setIdempotentModeAutosizingOnlyHonorsPercentages): (WebCore::DocumentLoader::idempotentModeAutosizingOnlyHonorsPercentages const): * page/Settings.yaml: * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::adjustmentForTextAutosizing): * style/StyleBuilderCustom.h: (WebCore::Style::computeBaseSpecifiedFontSize): * style/StyleBuilderState.cpp: (WebCore::Style::BuilderState::updateFontForTextSizeAdjust): 2020-05-20 ChangSeok Oh <changseok@webkit.org> Move the TextStream logging definition in VisibleSelection.cpp to the outside of the TREE_DEBUGGING guard https://bugs.webkit.org/show_bug.cgi?id=212127 Reviewed by Simon Fraser. A linking failure occurs after r261819 where ENABLE_TREE_DEBUGGING is disabled. The TextStream logging defining is placed inside the guard while its declaration is not since r218976. Build fix, no functionality changed. * editing/VisibleSelection.cpp: (WebCore::operator<<): 2020-05-20 Andres Gonzalez <andresg_22@apple.com> Fix for accessibility-node-memory-management.html in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=212142 Reviewed by Chris Fleizach. LayoutTests/accessibility/accessibility-node-memory-management.html. - Fix in applyPendingChanges that was not removing removed nodes from the nodes map. This was causing that some detached AXIsolatedObjects were being returned. - Also handle the case where pending changes can come from a detached AXObject with invalid ID and no platform wrapper. - updateChildren better handles the case when the notification target is not in the isolated tree by walking up the object hierarchy until it finds an associated object that does have a corresponding isolated object. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::treeForPageID): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::applyPendingChanges): 2020-05-20 Antoine Quint <graouts@apple.com> [Web Animations] Animation engine should not wake up every tick for steps timing functions https://bugs.webkit.org/show_bug.cgi?id=212103 <rdar://problem/62737868> Unreviewed. Clean up some stray FIXMEs mistakenly commited in the previous commit. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty): * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): 2020-05-20 Antoine Quint <graouts@apple.com> [Web Animations] Animation engine should not wake up every tick for steps timing functions https://bugs.webkit.org/show_bug.cgi?id=212103 <rdar://problem/62737868> Reviewed by Simon Fraser. Tests: webanimations/scheduling-of-animation-with-steps-timing-function-on-effect.html webanimations/scheduling-of-animation-with-steps-timing-function-on-keyframe.html webanimations/scheduling-of-css-animation-with-explicit-steps-timing-function-on-some-keyframes.html webanimations/scheduling-of-css-animation-with-implicit-steps-timing-function.html When an animation uses a steps() timing function, it will appear to animate discretely between values such that there is only n visual changes, where n is the number of steps provided. This gives us an opportunity to be more efficient when scheduling animations using steps() timing functions. In WebAnimation::timeToNextTick() we now ask the associated effect for the amount of progress until the next step. For an effect-wide steps() timing function, we can use the provided iteration progress. For animations with a linear effect-wide timing function (the default), we have to map the provided iteration progress to a keyframe interval, provided that interval uses a steps() timing function. The new {Animation|Keyframe}Effect::progressUntilNextStep() method returns WTF::nullopt for any other case. In order to test this, we add a new internals.timeToNextAnimationTick(animation) method which we use in the two new tests. * animation/AnimationEffect.cpp: (WebCore::AnimationEffect::progressUntilNextStep const): * animation/AnimationEffect.h: * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::setBlendingKeyframes): (WebCore::KeyframeEffect::computeSomeKeyframesUseStepsTimingFunction): (WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex const): Avoid any out-of-bounds use of the underlying data structures by returning nullptr for cases where we don't have an explicit keyframe. We also make the function const such that it may be called from progressUntilNextStep(), it always was const but wasn't marked as such. (WebCore::KeyframeEffect::progressUntilNextStep const): * animation/KeyframeEffect.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::timeToNextTick const): * animation/WebAnimation.h: * animation/WebAnimation.idl: * testing/Internals.cpp: (WebCore::Internals::timeToNextAnimationTick const): * testing/Internals.h: * testing/Internals.idl: 2020-05-20 Noam Rosenthal <noam@webkit.org> Fix table sizing when 'max-width' is used https://bugs.webkit.org/show_bug.cgi?id=115156 Reviewed by Zalan Bujtas. Based on previous patch by László Langó <lango@inf.u-szeged.hu> Test: fast/table/html-table-width-max-width-constrained.html A table should always be wide enough to contain its content (preferred logical width). This constraint should be stronger than the table style's specified min-width/width. The behavior matches the spec, and behavior on Firefox/Chrome. * rendering/RenderTable.cpp: (WebCore::RenderTable::updateLogicalWidth): Max-width should only affect the table's max preferred width. (WebCore::RenderTable::computePreferredLogicalWidths): Change the order of constraints so that content constraint is stronger than style width/max-width constraint. 2020-05-20 Carlos Garcia Campos <cgarcia@igalia.com> REGRESSION(r261554): [GTK] Version 2.29.1 crashes using drag-n-drop API https://bugs.webkit.org/show_bug.cgi?id=212136 Reviewed by Adrian Perez de Castro. * platform/gtk/PasteboardGtk.cpp: (WebCore::Pasteboard::read): Use m_selectionData if present. 2020-05-20 Philippe Normand <pnormand@igalia.com> [GStreamer] <img> tag needs to support video formats https://bugs.webkit.org/show_bug.cgi?id=180370 Reviewed by Xabier Rodriguez-Calvar. GStreamer implementation of the ImageDecoder. It currently doesn't support zero-copy rendering though due to the the NativeImagePtr requirement. * platform/GStreamer.cmake: * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::isSupportedImageVideoOrSVGMIMEType): * platform/graphics/ImageDecoder.cpp: (WebCore::ImageDecoder::create): (WebCore::ImageDecoder::supportsMediaType): * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp: Added. (WebCore::toSample): (WebCore::ImageDecoderGStreamer::create): (WebCore::ImageDecoderGStreamer::ImageDecoderGStreamer): (WebCore::ImageDecoderGStreamer::supportsContainerType): (WebCore::ImageDecoderGStreamer::canDecodeType): (WebCore::ImageDecoderGStreamer::encodedDataStatus const): (WebCore::ImageDecoderGStreamer::size const): (WebCore::ImageDecoderGStreamer::repetitionCount const): (WebCore::ImageDecoderGStreamer::uti const): (WebCore::ImageDecoderGStreamer::frameOrientationAtIndex const): (WebCore::ImageDecoderGStreamer::frameDurationAtIndex const): (WebCore::ImageDecoderGStreamer::frameHasAlphaAtIndex const): (WebCore::ImageDecoderGStreamer::frameBytesAtIndex const): (WebCore::ImageDecoderGStreamer::createFrameImageAtIndex): (WebCore::ImageDecoderGStreamer::setData): (WebCore::ImageDecoderGStreamer::clearFrameBufferCache): (WebCore::ImageDecoderGStreamer::sampleAtIndex const): (WebCore::ImageDecoderGStreamer::InnerDecoder::decodebinPadAddedCallback): (WebCore::ImageDecoderGStreamer::InnerDecoder::connectDecoderPad): (WebCore::ImageDecoderGStreamer::handleSample): (WebCore::ImageDecoderGStreamer::InnerDecoder::handleMessage): (WebCore::ImageDecoderGStreamer::InnerDecoder::preparePipeline): (WebCore::ImageDecoderGStreamer::InnerDecoder::run): (WebCore::ImageDecoderGStreamer::InnerDecoder::encodedDataStatus const): (WebCore::ImageDecoderGStreamer::pushEncodedData): * platform/graphics/gstreamer/ImageDecoderGStreamer.h: Added. * platform/graphics/gstreamer/ImageGStreamer.h: (WebCore::ImageGStreamer::createImage): (WebCore::ImageGStreamer::image): (WebCore::ImageGStreamer::setCropRect): (WebCore::ImageGStreamer::rect): (WebCore::ImageGStreamer::hasAlpha const): * platform/graphics/gstreamer/ImageGStreamerCairo.cpp: (WebCore::ImageGStreamer::ImageGStreamer): * platform/graphics/gstreamer/MediaSampleGStreamer.h: 2020-05-20 Andy Estes <aestes@apple.com> [Mac] UI processes spin when creating the "Share" context menu item https://bugs.webkit.org/show_bug.cgi?id=212137 <rdar://problem/54498394> Reviewed by Wenson Hsieh. Ran update-webkit-localizable-strings. * en.lproj/Localizable.strings: 2020-05-20 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Internal table boxes should take collapsed border into account https://bugs.webkit.org/show_bug.cgi?id=212135 Reviewed by Antti Koivisto. Use the collapsed border value to compute the borders for sections, rows and cells. The collapsed border is propagated to the table box and the adjacent cell boxes. Test: fast/layoutformattingcontext/table-simple-border-collapse.html * layout/LayoutUnits.h: (WebCore::Layout::operator/): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): (WebCore::Layout::TableFormattingContext::layoutCell): * layout/tableformatting/TableGrid.h: (WebCore::Layout::TableGrid::setCollapsedBorder): (WebCore::Layout::TableGrid::collapsedBorder const): 2020-05-20 Youenn Fablet <youenn@apple.com> [Mac] Use preferedPixelBufferFormat for AVVideoCaptureSource https://bugs.webkit.org/show_bug.cgi?id=212071 Reviewed by Eric Carlson. Manually tested. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::avVideoCapturePixelBufferFormat): 2020-05-20 Carlos Garcia Campos <cgarcia@igalia.com> Unreviewed. Fix GTK4 build with GTK 3.98.4 * platform/gtk/GtkUtilities.cpp: (WebCore::convertWidgetPointToScreenPoint): * platform/gtk/GtkVersioning.h: (gtk_widget_destroy): * platform/gtk/PlatformScreenGtk.cpp: (WebCore::screenDPI): 2020-05-12 Carlos Garcia Campos <cgarcia@igalia.com> [GTK4] Add support for drag and drop operations https://bugs.webkit.org/show_bug.cgi?id=211779 Reviewed by Adrian Perez de Castro. Move the code to create a GdkTexture from an Image from CursorGtk to ImageGtk and add Image::gdkTexture(). * platform/graphics/BitmapImage.h: * platform/graphics/Image.h: (WebCore::Image::gdkTexture): * platform/graphics/gtk/ImageGtk.cpp: (WebCore::BitmapImage::gdkTexture): * platform/gtk/CursorGtk.cpp: (WebCore::createCustomCursor): 2020-05-20 Sam Weinig <weinig@apple.com> Remove unused Color::getHSV function https://bugs.webkit.org/show_bug.cgi?id=212119 Reviewed by Simon Fraser. * platform/graphics/Color.cpp: (WebCore::Color::getHSV const): Deleted. * platform/graphics/Color.h: Remove Color::getHSV(). It was unused outside of the API test for it. 2020-05-20 Youenn Fablet <youenn@apple.com> Allow calling VideoSampleObserver::videoSampleAvailable from a background thread https://bugs.webkit.org/show_bug.cgi?id=212024 Reviewed by Eric Carlson. Allow RealtimeMediaSource::videoSampleAvailable to be called on a background thread, typically the capture thread. Make WebRTC remote sources and mock capture sources do that. RealtimeMediaSource is then updating its intrinsic size from the generation thread while updating its size in the main thread. The size() getter can be called from both threads. Existing consumers do the following: - media player will hop to the main thread. - media recorder will do processing from the background thread. - WebRTC sender will do processing from the background thread, except when sending black frames where this will still be done on the main thread. This is ok as we ensure either we send black frames on the main thread (and we do not observe the source) or we observe the source to send. Follow-ups will migrate the real capture sources as well as migrating media player processing out of the main thread. Covered by existing tests. * platform/MediaSample.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable): * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::videoSampleAvailable): (WebCore::RealtimeMediaSource::setIntrinsicSize): * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame): (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample): Deleted. 2020-05-20 Oriol Brufau <obrufau@igalia.com> Fix computeMarginLogicalSizeForChild to check auto margins in the right axis https://bugs.webkit.org/show_bug.cgi?id=212113 Reviewed by Manuel Rego Casasnovas. GridLayoutFunctions::computeMarginLogicalSizeForChild checks for 'auto' margins before retrieving the margin size, since these should be treated as 0. However, for orthogonal grid items, it used to check the wrong axis. So if an item had 'margin-top: auto' and 'margin-left: 5px', when asking for the horizontal margin we could get 0px instead of 5px due to the auto margin in the vertical axis. Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-width-orthogonal-001.html * rendering/GridLayoutFunctions.cpp: (WebCore::GridLayoutFunctions::computeMarginLogicalSizeForChild): (WebCore::GridLayoutFunctions::marginLogicalSizeForChild): 2020-05-19 Fujii Hironori <Hironori.Fujii@sony.com> [WinCairo] ASSERT(m_eglDisplay == EGL_NO_DISPLAY) fails in ~PlatformDisplay() https://bugs.webkit.org/show_bug.cgi?id=212065 Reviewed by Don Olmstead. PlatformDisplay destoys m_eglDisplay by using std::atexit to ensure they are destructed before EGL's atexit handler (Bug 157973). However, calling eglTerminate in atexit handler causes a crash on Windows (Bug 145832, Bug 170331). Then, r214688 added shutDownEglDisplays() and explicitly call it in shutDownWebKit() to destory m_eglDisplay in Windows WebKit1. However, Windows WebKit2 may call _exit() in IPC::Connection's WorkQueue thread. It doesn't seem a good idea that explicitly destructing m_eglDisplay by calling shutDownEglDisplays(). Remove shutDownEglDisplays() and the assertion for Windows. * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::~PlatformDisplay): Conditioned out the assertion for PLATFORM(WIN). (WebCore::PlatformDisplay::initializeEGLDisplay): Restored the original atexit handler of r201595. (WebCore::PlatformDisplay::shutDownEglDisplays): Deleted. * platform/graphics/PlatformDisplay.h: 2020-05-19 Darin Adler <darin@apple.com> REGRESSION (r259930): Dictation marker at start of text is removed when added trailing whitespace is collapsed https://bugs.webkit.org/show_bug.cgi?id=212093 Reviewed by Daniel Bates. * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::shiftMarkers): Use int to do the math before clamping to unsigned. This protects against underflow. 2020-05-19 Sam Weinig <weinig@apple.com> Remove almost always incorrect Color::getRGBA https://bugs.webkit.org/show_bug.cgi?id=212059 Reviewed by Darin Adler and Simon Fraser. Removes the awkward and almost always incorrect out parameter based Color::getRGBA. Most existing callsites were updated to use Color::toSRGBAComponentsLossy() or other more ExtendedColor supporting functions (like cachedCGColor()). Also adds tuple-like adaptors for FloatComponents to allow it to be used with structured bindings. For example: auto [r, g, b, a] = myFloatComponents; * platform/graphics/Color.h: * platform/graphics/Color.cpp: (WebCore::Color::light const): (WebCore::Color::dark const): (WebCore::Color::isDark const): Adopt toSRGBAComponentsLossy() to make these not return totally incorrect values. (WebCore::Color::colorSpaceAndComponents const): Added. Returns a std::pair<ColorSpace, FloatComponents> for functions that need to operate on the components in a ColorSpace aware way. Used by toSRGBAComponentsLossy and leakCGColor() for now, but will be useful going forward as well. (WebCore::Color::toSRGBAComponentsLossy const): Re-implement using colorSpaceAndComponents() to simplify implementation. (WebCore::Color::getRGBA const): Deleted. * platform/graphics/ColorUtilities.cpp: (WebCore::FloatComponents::FloatComponents): Deleted. (WebCore::sRGBColorToLinearComponents): Deleted. * platform/graphics/ColorUtilities.h: (WebCore::FloatComponents::get const): Remove uses of the Color class to simplify inlining (Color.h already needs to know about FloatComponents). - FloatComponents constructor replaced by Color::toSRGBAComponentsLossy(). - sRGBColorToLinearComponents replaced by calling rgbToLinearComponents(color.toSRGBAComponentsLossy()). Also adds std::tuple adaptors for FloatComponents to allow using with stuctured bindings. * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::HistoricMemoryCategoryInfo::HistoricMemoryCategoryInfo): Replace getRGBA with cachedCGColor. * platform/graphics/ca/win/PlatformCALayerWin.cpp: (PlatformCALayerWin::setBackgroundColor): Replace getRGBA with cachedCGColor. * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: (PlatformCALayerWinInternal::setBorderColor): Replace getRGBA with cachedCGColor. * platform/graphics/cairo/CairoUtilities.cpp: (WebCore::setSourceRGBAFromColor): Replace getRGBA with toSRGBAComponentsLossy. * platform/graphics/cairo/GradientCairo.cpp: (WebCore::addColorStopRGBA): (WebCore::setCornerColorRGBA): (WebCore::interpolateColorStop): Replace getRGBA with toSRGBAComponentsLossy. * platform/graphics/cg/ColorCG.cpp: (WebCore::leakCGColor): (WebCore::cachedCGColor): Simplify implementation (and remove use of getRGBA) by using colorSpaceAndComponents(). * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::platformGradient): Replace getRGBA with colorSpaceAndComponent(). * platform/graphics/filters/FELighting.cpp: (WebCore::FELighting::drawLighting): Replace FloatComponents constructor taking a Color (which used getRGBA) with toSRGBAComponentsLossy. * platform/graphics/filters/FilterOperations.cpp: (WebCore::FilterOperations::transformColor const): (WebCore::FilterOperations::inverseTransformColor const): Replace getRGBA with toSRGBAComponentsLossy. * platform/graphics/gtk/ColorGtk.cpp: (WebCore::Color::operator GdkRGBA const): Replace getRGBA with toSRGBAComponentsLossy. * platform/graphics/texmap/TextureMapperGL.cpp: (WebCore::TextureMapperGL::drawBorder): (WebCore::TextureMapperGL::drawNumber): (WebCore::prepareFilterProgram): (WebCore::TextureMapperGL::drawSolidColor): Replace getRGBA with toSRGBAComponentsLossy. * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::generateGradient): Replace getRGBA with toSRGBAComponentsLossy. * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::drawDotsForDocumentMarker): (WebCore::setCGStrokeColor): Deleted. (WebCore::spellingPatternColor): Deleted. (WebCore::grammarPatternColor): Deleted. Replace use of getRGBA with direct use of SimpleColor instead. * rendering/TextPaintStyle.cpp: (WebCore::textColorIsLegibleAgainstBackgroundColor): Replace implicit FloatComponents construction taking a Color (which used getRGBA) with explicit toSRGBAComponentsLossy. 2020-05-19 Eric Carlson <eric.carlson@apple.com> Update some media logging https://bugs.webkit.org/show_bug.cgi?id=212109 Reviewed by Jer Noble. No new tests, no functional change. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::insertedIntoAncestor): (WebCore::HTMLMediaElement::didFinishInsertingNode): (WebCore::HTMLMediaElement::removedFromAncestor): (WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity): (WebCore::HTMLMediaElement::canPlayType const): (WebCore::HTMLMediaElement::waitForSourceChange): (WebCore::HTMLMediaElement::noneSupported): (WebCore::HTMLMediaElement::mediaLoadingFailed): (WebCore::HTMLMediaElement::fastSeek): (WebCore::HTMLMediaElement::seek): (WebCore::HTMLMediaElement::seekInternal): (WebCore::HTMLMediaElement::seekTask): (WebCore::HTMLMediaElement::finishSeek): (WebCore::HTMLMediaElement::currentMediaTime const): (WebCore::HTMLMediaElement::setPreload): (WebCore::HTMLMediaElement::playInternal): (WebCore::HTMLMediaElement::pauseInternal): (WebCore::HTMLMediaElement::setLoop): (WebCore::HTMLMediaElement::setControls): (WebCore::HTMLMediaElement::setVolume): (WebCore::HTMLMediaElement::setMuted): (WebCore::HTMLMediaElement::hardwareMutedStateDidChange): (WebCore::HTMLMediaElement::configureTextTrackGroup): (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged): (WebCore::HTMLMediaElement::mediaPlayerMuteChanged): (WebCore::HTMLMediaElement::mediaPlayerDurationChanged): (WebCore::HTMLMediaElement::mediaPlayerRateChanged): (WebCore::HTMLMediaElement::mediaPlayerPlaybackStateChanged): (WebCore::HTMLMediaElement::mediaPlayerResourceNotSupported): (WebCore::HTMLMediaElement::mediaPlayerSizeChanged): (WebCore::HTMLMediaElement::mediaPlayerRenderingModeChanged): (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): (WebCore::HTMLMediaElement::mediaPlayerFirstVideoFrameAvailable): (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): (WebCore::HTMLMediaElement::updatePlayState): (WebCore::HTMLMediaElement::stop): (WebCore::HTMLMediaElement::suspend): (WebCore::HTMLMediaElement::resume): (WebCore::HTMLMediaElement::visibilityStateChanged): (WebCore::HTMLMediaElement::addEventListener): (WebCore::HTMLMediaElement::removeEventListener): (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent): (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget): (WebCore::HTMLMediaElement::remoteHasAvailabilityCallbacksChanged): (WebCore::HTMLMediaElement::enterFullscreen): (WebCore::HTMLMediaElement::exitFullscreen): (WebCore::HTMLMediaElement::didBecomeFullscreenElement): (WebCore::HTMLMediaElement::setClosedCaptionsVisible): (WebCore::HTMLMediaElement::mediaCanStart): (WebCore::HTMLMediaElement::setShouldDelayLoadEvent): (WebCore::HTMLMediaElement::suspendPlayback): (WebCore::HTMLMediaElement::resumeAutoplaying): (WebCore::HTMLMediaElement::mayResumePlayback): (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): (WebCore::HTMLMediaElement::setBufferingPolicy): (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible): * platform/audio/PlatformMediaSession.cpp: (WebCore::PlatformMediaSession::setState): (WebCore::PlatformMediaSession::beginInterruption): (WebCore::PlatformMediaSession::endInterruption): (WebCore::PlatformMediaSession::clientWillBeginAutoplaying): (WebCore::PlatformMediaSession::clientWillBeginPlayback): (WebCore::PlatformMediaSession::processClientWillPausePlayback): (WebCore::PlatformMediaSession::clientWillPausePlayback): (WebCore::PlatformMediaSession::clientWillBeDOMSuspended): (WebCore::PlatformMediaSession::pauseSession): (WebCore::PlatformMediaSession::stopSession): (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand): 2020-05-19 Daniel Bates <dabates@apple.com> Blue dotted underline with alternatives only shown for last word, gets lost for previous insertions https://bugs.webkit.org/show_bug.cgi?id=212097 <rdar://problem/61913405> Reviewed by Darin Adler. Fix up two cases, <space> is a literal ' ' and | is the position of the caret: 1. Space inserted after marker, here's what it looks like BEFORE insertion (i.e. endOfFirstWord == startOfSelection): hello| This case is detected when the end of the next word (relative to caret) would be at the start of the word that begins before or on the caret. 2. Space inserted before marker, here's what it looks like BEFORE insertion (i.e. startOfLastWord == endOfSelection): |hello This case is detected when the end of the previous word (relative to caret) would be at the end of the word that ends after or on the caret. Note ^^^ example uses a caret, but code is slightly more general and works when the current selection is a range. Though I didn't explicitly test that because my bug is specific to having a caret selection. * editing/Editor.cpp: (WebCore::Editor::insertTextWithoutSendingTextEvent): Do not remove markers if selection starts at the beginning of a new word. This is detected by looking at the character before the selection start to see if it is a space or newline. This will be false when there is no preceding character (e.g. start of document), but that's OK because it doesn't matter what we pass to updateMarkersForWordsAffectedByEditing() - there's no markers to remove anyway, let alone text for markers to exist in. I don't use isStartOfWord() here because that would incorrectly return false if the current selection is at the end of a paragraph. I could have fixed that up by checking isEndOfParagraph() as well, but isStartOfWord() + isEndOfParagraph() is less efficient than just looking at the previous character directly. So, I did that instead. (WebCore::Editor::updateMarkersForWordsAffectedByEditing): Save off the original end of the first word and start of the last word positions before mutating them. Update early return checks to use these saved values instead of comparing against the start and end of the current selection, which weren't correct. Saved positioned are aligned by word, but start and end of current selection may NOT be. So, comparison was asymmetric: lhs was word aligned position, but rhs may not be. * editing/Editor.h: While I am here, fix up a param name to match what it is called in the .cpp. * testing/Internals.cpp: (WebCore::Internals::hasDictationAlternativesMarker): Added * testing/Internals.h: * testing/Internals.idl: Add new functionality for testing purposes. 2020-05-19 Oriol Brufau <obrufau@igalia.com> Fix marginLogicalSizeForChild to check auto margins in the right axis https://bugs.webkit.org/show_bug.cgi?id=212055 Reviewed by Manuel Rego Casasnovas. GridLayoutFunctions::marginLogicalSizeForChild checks for 'auto' margins before retrieving the margin size, since these should be treated as 0. However, for orthogonal grid items, it used to check the wrong axis. So if an item had 'margin-top: auto' and 'margin-left: 5px', when asking for the horizontal margin we could get 0px instead of 5px due to the auto margin in the vertical axis. Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-minimum-height-orthogonal-001.html * rendering/GridLayoutFunctions.cpp: (WebCore::GridLayoutFunctions::marginLogicalSizeForChild): 2020-05-19 Jacob Uphoff <jacob_uphoff@apple.com> Unreviewed, reverting r261856. This caused internal assertion failures. Reverted changeset: "Allow calling VideoSampleObserver::videoSampleAvailable from a background thread" https://bugs.webkit.org/show_bug.cgi?id=212024 https://trac.webkit.org/changeset/261856 2020-05-19 David Kilzer <ddkilzer@apple.com> IDBRequestData and IDBClient::TransactionOperation should initialize IndexedDB::IndexRecordType field <https://webkit.org/b/212096> <rdar://problem/63406376> Reviewed by Geoffrey Garen. IDBRequestData tested by IPC::Decoder::decode() and IPC::Encoder::operator<<() running on WebKit2 API and layout tests. * Modules/indexeddb/IndexedDB.h: (WTF::EnumTraits<WebCore::IndexedDB::IndexRecordType>): Add. * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::m_indexRecordType): - Add default initializer. * Modules/indexeddb/shared/IDBRequestData.h: (WebCore::IDBRequestData::m_indexRecordType): - Add default initializer. (WebCore::IDBRequestData::encode const): (WebCore::IDBRequestData::decode): - Switch from encodeEnum() and decodeEnum() to modern equivalents that check for valid enum values. 2020-05-19 Simon Fraser <simon.fraser@apple.com> Push a PlatformDisplayID to scrolling trees, and allow the scrolling thread to get displayDidRefresh notifications https://bugs.webkit.org/show_bug.cgi?id=211034 Reviewed by Sam Weinig. As work towards scrolling thread synchronization with main thread (webkit.org/b210884), allow ScrollingTree to get a displayDidRefresh() call on the scrolling thread. Each tree is associated with a Page which is associated with a display, so the ScrollingTree needs to have a PlatformDisplayID to know which notifications to respond to. Eventually, displayDidRefresh() will be used to trigger layer updates on the scrolling thread if the main thread is periodically unresponsive. * page/Page.cpp: (WebCore::Page::scrollingCoordinator): (WebCore::Page::windowScreenDidChange): * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::windowScreenDidChange): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::windowScreenDidChange): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::windowScreenDidChange): (WebCore::ScrollingTree::displayID): * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::displayDidRefresh): * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::displayDidRefresh): * page/scrolling/ThreadedScrollingTree.h: 2020-05-19 Simon Fraser <simon.fraser@apple.com> [iOS] Programmaic scroll of "scrolling=no" iframe fails https://bugs.webkit.org/show_bug.cgi?id=212063 <rdar://problem/57049514> Reviewed by Antti Koivisto. ScrollView::setScrollPosition() calls requestScrollPositionUpdate(), and if this returns false it relies on the confusingly-named updateScrollbars() to actually do the scroll. This code path is hit for "scrolling=no" frames, which are not scroll-coordinated. ScrollView::updateScrollbars() fails to set the scroll position on iOS, where managesScrollbars() returns false, so fix that. Test: fast/scrolling/progammatic-scroll-scrolling-no-frame.html * platform/ScrollView.cpp: (WebCore::ScrollView::updateScrollbars): 2020-05-19 Andy Estes <aestes@apple.com> [Apple Pay] Add testing and logging for ApplePaySetup https://bugs.webkit.org/show_bug.cgi?id=211972 <rdar://problem/63291965> Reviewed by Alex Christensen. Test: http/tests/ssl/applepay/ApplePaySetup.https.html * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/applepay/ApplePaySetup.cpp: (WebCore::ApplePaySetup::getSetupFeatures): (WebCore::ApplePaySetup::begin): (WebCore::ApplePaySetup::ApplePaySetup): (WebCore::ApplePaySetup::stop): * Modules/applepay/ApplePaySetup.idl: * Modules/applepay/ApplePaySetupConfiguration.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl. * Modules/applepay/ApplePaySetupConfiguration.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl. * Modules/applepay/ApplePaySetupFeature.idl: * Modules/applepay/ApplePaySetupFeature.mm: (WebCore::ApplePaySetupFeature::state const): * Modules/applepay/ApplePaySetupFeatureState.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl. * Modules/applepay/ApplePaySetupFeatureState.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl. * Modules/applepay/ApplePaySetupFeatureType.idl: * Modules/applepay/ApplePaySetupFeatureWebCore.h: * Modules/applepay/ApplePaySetupWebCore.h: (WebCore::ApplePaySetup::create): * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::setApplePayIsActiveIfAllowed const): (WebCore::PaymentCoordinator::getSetupFeatures): (WebCore::PaymentCoordinator::beginApplePaySetup): (WebCore::PaymentCoordinator::endApplePaySetup): * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinatorClient.h: (WebCore::PaymentCoordinatorClient::getSetupFeatures): (WebCore::PaymentCoordinatorClient::beginApplePaySetup): * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * testing/MockApplePaySetupFeature.cpp: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h. (WebCore::MockApplePaySetupFeature::create): (WebCore::MockApplePaySetupFeature::MockApplePaySetupFeature): * testing/MockApplePaySetupFeature.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h. * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::addSetupFeature): (WebCore::MockPaymentCoordinator::getSetupFeatures): (WebCore::MockPaymentCoordinator::beginApplePaySetup): * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.idl: 2020-05-19 Sergio Villar Senin <svillar@igalia.com> [WebXR] Implement requestSession() https://bugs.webkit.org/show_bug.cgi?id=211888 Reviewed by Youenn Fablet. This patch adds a preliminar implementation of the requestSession() API used to get a WebXRSession from the UA. It includes a fairly good amount of checks to verify that the request can be satisfied given the device's enabled features per session modes. The specs also describe how to request persmission for some actions using the Permissions API which WebKit does not currently implement. That should be done in a follow up patch perhaps using a similar approach to other APIs as Geolocation for example. In order to get some of the requestSession() tests passing the session finalization (shutdown) had to be implemented too. Several tests where unskipped for WPE port as they're now passing. * Modules/webxr/WebXRRenderState.cpp: (WebCore::WebXRRenderState::create): Pass XRSessionMode as argument instead of a WebXRSession. * Modules/webxr/WebXRRenderState.h: Ditto. * Modules/webxr/WebXRSession.cpp: (WebCore::WebXRSession::create): Added. (WebCore::WebXRSession::WebXRSession): Added. (WebCore::WebXRSession::renderState const): (WebCore::WebXRSession::inputSources const): (WebCore::WebXRSession::shutdown): Shutdown process called on session end. (WebCore::WebXRSession::end): Implemented session ending. * Modules/webxr/WebXRSession.h: Added create() and private constructor. Fixed some naming. * Modules/webxr/WebXRSystem.cpp: (WebCore::WebXRSystem::DummyInlineDevice::DummyInlineDevice): Contructor for the dummy inline device. (WebCore::WebXRSystem::ensureImmersiveXRDeviceIsSelected): Use a counter instead of a boolean to track testing devices as there might be more than 1. (WebCore::WebXRSystem::obtainCurrentDevice): Implemented from specs text. (WebCore::WebXRSystem::immersiveSessionRequestIsAllowedForGlobalObject const): Ditto. (WebCore::WebXRSystem::inlineSessionRequestIsAllowedForGlobalObject const): Ditto. (WebCore::WebXRSystem::resolveRequestedFeatures const): Ditto. (WebCore::WebXRSystem::isXRPermissionGranted const): Ditto. (WebCore::WebXRSystem::requestSession): Ditto. (WebCore::WebXRSystem::registerSimulatedXRDeviceForTesting): Use a counter instead of a bool. Also use a reference in the method argument. (WebCore::WebXRSystem::unregisterSimulatedXRDeviceForTesting): Ditto. (WebCore::WebXRSystem::sessionEnded): Added, used by sessions to notify the XRSystem. * Modules/webxr/WebXRSystem.h: * Modules/webxr/WebXRSystem.idl: Call requestSession with Document. * dom/TaskSource.h: Added a WebXR task source. * platform/xr/PlatformXR.h: Specs state that devices have a list of enabled features per session mode so store them in a hashmap instead of in a Vector. (PlatformXR::Device::supports const): Use the new Hashmap of session modes. (PlatformXR::Device::setEnabledFeatures): Ditto. (PlatformXR::Device::enabledFeatures const): Ditto. (PlatformXR::Device::setSupportedModes): Deleted. * platform/xr/openxr/PlatformXR.cpp: (PlatformXR::Instance::Impl::collectSupportedSessionModes): Return session modes if any. (PlatformXR::Instance::enumerateImmersiveXRDevices): Fill in features per session mode. * testing/WebXRTest.cpp: (WebCore::WebXRTest::simulateDeviceConnection): Fill in features per session mode. (WebCore::WebXRTest::disconnectAllDevices): Pass a reference to unregister. 2020-05-19 Antti Koivisto <antti@apple.com> Animation of font-size with rem values is incorrect https://bugs.webkit.org/show_bug.cgi?id=194765 <rdar://problem/48171742> Reviewed by Antoine Quint. Test: animations/keyframe-rem-unit.html 'rem' computation fails on first style resolution because the document element style is not available. * style/StyleResolver.cpp: (WebCore::Style::Resolver::styleForKeyframe): Provide the override value, needed because the style can't be found from DOM tree yet. 2020-05-19 Andy Estes <aestes@apple.com> [Apple Pay] Add testing and logging for ApplePaySetup https://bugs.webkit.org/show_bug.cgi?id=211972 <rdar://problem/63291965> Reviewed by Alex Christensen. Added support for ApplePaySetup to MockPaymentCoordinator and wrote a test. Added release logging for ApplePaySetup and removed a noisy log message from setApplePayIsActiveIfAllowed. Test: http/tests/ssl/applepay/ApplePaySetup.https.html * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Modules/applepay/ApplePaySetup.cpp: (WebCore::ApplePaySetup::getSetupFeatures): (WebCore::ApplePaySetup::begin): (WebCore::ApplePaySetup::ApplePaySetup): (WebCore::ApplePaySetup::stop): * Modules/applepay/ApplePaySetup.idl: * Modules/applepay/ApplePaySetupConfiguration.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl. * Modules/applepay/ApplePaySetupConfiguration.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl. * Modules/applepay/ApplePaySetupFeature.idl: * Modules/applepay/ApplePaySetupFeature.mm: (WebCore::ApplePaySetupFeature::state const): * Modules/applepay/ApplePaySetupFeatureState.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl. * Modules/applepay/ApplePaySetupFeatureState.idl: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureType.idl. * Modules/applepay/ApplePaySetupFeatureType.idl: * Modules/applepay/ApplePaySetupFeatureWebCore.h: * Modules/applepay/ApplePaySetupWebCore.h: (WebCore::ApplePaySetup::create): * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::setApplePayIsActiveIfAllowed const): (WebCore::PaymentCoordinator::getSetupFeatures): (WebCore::PaymentCoordinator::beginApplePaySetup): (WebCore::PaymentCoordinator::endApplePaySetup): * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinatorClient.h: (WebCore::PaymentCoordinatorClient::getSetupFeatures): (WebCore::PaymentCoordinatorClient::beginApplePaySetup): * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * testing/MockApplePaySetupFeature.cpp: Copied from Source/WebCore/Modules/applepay/ApplePaySetup.idl. (WebCore::MockApplePaySetupFeature::create): (WebCore::MockApplePaySetupFeature::MockApplePaySetupFeature): * testing/MockApplePaySetupFeature.h: Copied from Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h. * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::addSetupFeature): (WebCore::MockPaymentCoordinator::getSetupFeatures): (WebCore::MockPaymentCoordinator::beginApplePaySetup): * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.idl: 2020-05-19 Youenn Fablet <youenn@apple.com> Allow calling VideoSampleObserver::videoSampleAvailable from a background thread https://bugs.webkit.org/show_bug.cgi?id=212024 Reviewed by Eric Carlson. Allow RealtimeMediaSource::videoSampleAvailable to be called on a background thread, typically the capture thread. Make WebRTC remote sources and mock capture sources do that. RealtimeMediaSource is then updating its intrinsic size from the generation thread while updating its size in the main thread. The size() getter can be called from both threads. Existing consumers do the following: - media player will hop to the main thread. - media recorder will do processing from the background thread. - WebRTC sender will do processing from the background thread, except when sending black frames where this will still be done on the main thread. This is ok as we ensure either we send black frames on the main thread (and we do not observe the source) or we observe the source to send. Follow-ups will migrate the real capture sources as well as migrating media player processing out of the main thread. Covered by existing tests. * platform/MediaSample.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable): * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::videoSampleAvailable): (WebCore::RealtimeMediaSource::setIntrinsicSize): * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame): (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample): Deleted. 2020-05-19 Michael Catanzaro <mcatanzaro@gnome.org> REGRESSION(r257463): [GTK] Build failure with -DENABLE_GLES2=ON https://bugs.webkit.org/show_bug.cgi?id=212043 Reviewed by Philippe Normand. Fix the typo "Platfom" -> "Platform" * platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp: (createGstGLDisplay): 2020-05-18 Simon Fraser <simon.fraser@apple.com> Move some of the more chatty Scrolling logging to a ScrollingTree channel https://bugs.webkit.org/show_bug.cgi?id=212061 Reviewed by Tim Horton. Move logging about the scrolling tree to a new channel. * page/FrameView.cpp: (WebCore::FrameView::scrollToFragmentInternal): (WebCore::FrameView::scrollToAnchor): * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::createNode): (WebCore::AsyncScrollingCoordinator::insertNode): * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::createUnparentedNode): (WebCore::ScrollingStateTree::insertNode): (WebCore::ScrollingStateTree::unparentNode): (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode): (WebCore::ScrollingStateTree::detachAndDestroySubtree): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::commitTreeState): * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::scrollTo): * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll): * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm: (WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions): * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded): * platform/Logging.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::attachScrollingNode): 2020-05-18 David Kilzer <ddkilzer@apple.com> Replace TextIndicatorOptions with OptionSet<TextIndicatorOption> <https://webkit.org/b/212051> <rdar://problem/63368556> Reviewed by Simon Fraser. Use OptionSet<TextIndicatorOption> everywhere TextIndicatorOptions was previously used, plus: - Make TextIndicatorOption an enum class. Remove "TextIndicatorOption" prefix so TextIndicatorOptionBar becomes TextIndicatorOption::Bar. - Remove TextIndicatorOptionDefault because OptionSet<> initializes to zero. - Replace static variables (including two globals in WebCore) with constexpr variables. * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): (WebCore::TextIndicator::createWithSelectionInFrame): (WebCore::snapshotOptionsForTextIndicatorOptions): (WebCore::takeSnapshots): (WebCore::hasAnyIllegibleColors): (WebCore::initializeIndicator): * page/TextIndicator.h: * platform/ios/DragImageIOS.mm: (WebCore::createDragImageForLink): (WebCore::createDragImageForSelection): (WebCore::createDragImageForRange): * testing/Internals.h: 2020-05-18 Andy Estes <aestes@apple.com> http/tests/ssl/applepay/ApplePayInstallmentConfiguration.https.html fails in public SDK builds https://bugs.webkit.org/show_bug.cgi?id=212000 <rdar://problem/63323082> Reviewed by Youenn Fablet. * Configurations/FeatureDefines.xcconfig: * bindings/js/WebCoreBuiltinNames.h: 2020-05-18 Myles C. Maxfield <mmaxfield@apple.com> [WebGPU] Validation for GPUDevice.createTexture() https://bugs.webkit.org/show_bug.cgi?id=211882 <rdar://problem/63215999> Reviewed by Dean Jackson. Add lots of validation for texture creation. The logic was gathered by trial and error. Before this patch, we didn't have any validation. This is a first pass, as the validation logic isn't spelled out in the spec. Next, I will make a pull request to the spec to match this patch. This patch also updates three pieces of our IDL files to match the spec for WebGPU: One to remove GPUTextureUsage.NONE which was replaced with just 0, one to remove GPUTextureDescriptor.arrayLayerCount, which was deleted in favor of using regular dimension fields, and one to add [EnforceRange] to various values. This patch also updates GPUDevice to have a GPUErrorScopes object, which is required for good error messages. Test: webgpu/texture-creation.html * Modules/webgpu/GPUExtent3D.idl: * Modules/webgpu/GPUTextureDescriptor.idl: * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::tryCreate): (WebCore::WebGPUDevice::createTexture const): * Modules/webgpu/WebGPUDevice.h: * platform/graphics/gpu/GPUDevice.cpp: (WebCore::maximumMipLevelCount): (WebCore::GPUDevice::tryCreateTexture const): * platform/graphics/gpu/GPUDevice.h: (WebCore::GPUDevice::setErrorScopes): * platform/graphics/gpu/GPUExtent3D.h: * platform/graphics/gpu/GPUObjectBase.h: (WebCore::GPUObjectBase::errorScopes const): (WebCore::GPUObjectBase::errorScopes): Deleted. * platform/graphics/gpu/GPUTexture.h: * platform/graphics/gpu/GPUTextureDescriptor.h: * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: (WebCore::mtlTextureTypeForGPUTextureDescriptor): (WebCore::mtlTextureUsageForGPUTextureUsageFlags): (WebCore::tryCreateMtlTextureDescriptor): (WebCore::GPUTexture::tryCreate): 2020-05-18 Oriol Brufau <obrufau@igalia.com> [css-grid] Clear the override width for computing percent margins https://bugs.webkit.org/show_bug.cgi?id=209461 Reviewed by Manuel Rego Casasnovas. When calculating the min-content contribution of a grid item of an auto sized grid track we must consider the grid item's margin. When the grid item's area is indefinite, a percent margin is resolved to zero. However, when performing a relayout, the percent margin may be solved against the previously computed grid area, since the grid item has already an OverrideContainingBlockLogicalWidth value. In order to re-compute the percent margin properly, we need to clear the previously override value. It's important to be careful of not clearing the override value set during intrinsic size, since we need it for the actual layout phase. Hence, we only reset the 'override' value when we are executing a definite strategy. Tests: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-minimum-contribution-with-percentages.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-dynamic-min-contribution-001.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-003.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-004.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-005.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-006.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-007.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-008.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-009.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-010.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-011.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-012.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-013.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-margins-014.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-003.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-004.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-005.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-006.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-007.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-008.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-009.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-010.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-011.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-012.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-013.html imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-percentage-paddings-014.html * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::hasRelativeMarginOrPaddingForChild): (WebCore::hasRelativeOrIntrinsicSizeForChild): (WebCore::shouldClearOverrideContainingBlockContentSizeForChild): (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const): (WebCore::GridTrackSizingAlgorithmStrategy::minLogicalSizeForChild const): (WebCore::DefiniteSizeStrategy::minLogicalSizeForChild const): (WebCore::DefiniteSizeStrategy::minContentForChild const): * rendering/GridTrackSizingAlgorithm.h: 2020-05-18 David Kilzer <ddkilzer@apple.com> Follow-up: Use default initializers in TextIndicatorData <https://webkit.org/b/212039> <rdar://problem/63355619> * page/TextIndicator.h: (WebCore::TextIndicatorData::contentImageScaleFactor): - Simon Fraser says 1 is a better default than 0. 2020-05-18 Peng Liu <peng.liu6@apple.com> Add a quirk to allow an embedded Twitter video to play with one tapping https://bugs.webkit.org/show_bug.cgi?id=211932 Reviewed by Maciej Stachowiak. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::playbackPermitted const): Need to check the topDocument for the existence of user interactions. (WebCore::MediaElementSession::updateMediaUsageIfChanged): Ditto. * page/Quirks.cpp: (WebCore::Quirks::needsPerDocumentAutoplayBehavior const): Add the missing needsQuirks() checking. (WebCore::Quirks::shouldAutoplayForArbitraryUserGesture const): Add a the quirk for twitter.com. * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Clarify the log message. 2020-05-18 Simon Fraser <simon.fraser@apple.com> Content disappears on CSS parallax example https://bugs.webkit.org/show_bug.cgi?id=212045 <rdar://problem/63194217> Reviewed by Tim Horton. In r261632 I fixed parallax scrolling by migrating the perspective transform onto the scroll container layer, and making the scrolled contents layer a "preserve3D" layer. However, scrolling is achieved by changing the boundsOrigin of the scrolled contents layer, so the computation of the perspective matrix, which is a "child layer transform", has to take this boundsOrigin into account, otherwise we compute bad coverage rects, and drop backing store erroneously. Test: compositing/tiling/perspective-on-scroller-tile-coverage.html * platform/graphics/FloatPoint3D.h: (WebCore::FloatPoint3D::FloatPoint3D): (WebCore::FloatPoint3D::move): (WebCore::operator +=): (WebCore::operator -=): (WebCore::operator+): (WebCore::operator-): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const): (WebCore::GraphicsLayerCA::layerTransform const): (WebCore::GraphicsLayerCA::adjustCoverageRect const): (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): 2020-05-18 David Kilzer <ddkilzer@apple.com> Use default initializers in TextIndicatorData <https://webkit.org/b/212039> <rdar://problem/63355619> Reviewed by Alex Christensen. Tested by IPC::Decoder::decode() and IPC::Encoder::operator<<() running on WebKit2 API and layout tests. * page/TextIndicator.h: (WebCore::TextIndicatorData): - Add default initializers. (WTF::EnumTraits<WebCore::TextIndicatorPresentationTransition>): - Add EnumTraits so TextIndicatorPresentationTransition may be used by IPC::Decoder::decode() and IPC::Encoder::operator<<(). 2020-05-18 Simon Fraser <simon.fraser@apple.com> Fix operator== and hash() for ExtendedColor https://bugs.webkit.org/show_bug.cgi?id=211993 Post-landing followup. ExtendedColor operator== has to do exact comparison to be consistent with hash(). * platform/graphics/ExtendedColor.h: (WebCore::operator==): 2020-05-18 Wenson Hsieh <wenson_hsieh@apple.com> Replace uses of +self with +class https://bugs.webkit.org/show_bug.cgi?id=212041 Reviewed by Darin Adler. No change in behavior. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayer::isWebLayer): 2020-05-18 Ross Kirsling <ross.kirsling@sony.com> Unreviewed restabilization of non-unified build. * accessibility/AXObjectCache.cpp: * html/HTMLAttachmentElement.h: * inspector/agents/InspectorCSSAgent.cpp: * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: * layout/tableformatting/TableFormattingContextGeometry.cpp: * layout/tableformatting/TableFormattingState.cpp: * rendering/RenderTextFragment.h: * rendering/style/KeyframeList.h: 2020-05-18 Pinki Gyanchandani <pgyanchandani@apple.com> Null Ptr Deref @ WebCore::CSSValue::classType https://bugs.webkit.org/show_bug.cgi?id=212036 Reviewed by Geoffrey Garen. Calculated value for a primitive value type can be NULL for a CSS property. Added a null check before dereferencing it. Test: editing/execCommand/null_calc_primitive_value_for_css_property.html * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): 2020-05-18 Simon Fraser <simon.fraser@apple.com> Implement conversion between P3 and sRGB color https://bugs.webkit.org/show_bug.cgi?id=211998 Reviewed by Daniel Bates. Color::toSRGBAComponentsLossy() was a lie because it didn't actually convert extended colors into sRGB. Fix that by converting P3 and linaerRGB colors into sRGB, using the color math from CSS Color 4. Renamed the various "linear to sRGB" functions because they work for any RGB colors, not just sRGB. * platform/graphics/Color.cpp: (WebCore::Color::toSRGBAComponentsLossy const): * platform/graphics/Color.h: * platform/graphics/ColorUtilities.cpp: (WebCore::linearToRGBColorComponent): (WebCore::RGBToLinearColorComponent): (WebCore::sRGBColorToLinearComponents): (WebCore::RGBToLinearComponents): (WebCore::linearToRGBComponents): (WebCore::XYZToLinearSRGB): (WebCore::linearSRGBToXYZ): (WebCore::XYZToLinearP3): (WebCore::linearP3ToXYZ): (WebCore::P3ToSRGB): (WebCore::sRGBToP3): (WebCore::ColorMatrix::transformedColorComponents const): (WebCore::linearToSRGBColorComponent): Deleted. (WebCore::sRGBToLinearColorComponent): Deleted. (WebCore::sRGBToLinearComponents): Deleted. (WebCore::linearToSRGBComponents): Deleted. * platform/graphics/ColorUtilities.h: 2020-05-18 Wenson Hsieh <wenson_hsieh@apple.com> Allow clipboard API access when pasting from a menu item or key binding https://bugs.webkit.org/show_bug.cgi?id=211990 <rdar://problem/63308916> Reviewed by Megan Gardner. Allow the contents of the clipboard to be programmatically requested by the page while pasting from trusted UI (i.e. the paste menu item, or when WebKit API is called by the app to trigger the paste). This allows the 'reading' part of the async clipboard API (`read` and `readText`) to be used when the user pastes in an editable element, without having to fall back to showing the DOM paste access menu. Note that this change should not have an effect on the pasteboard security model, since it only grants the page programmatic access to the contents of the pasteboard in the case where access to the pasteboard has already been granted by the user. Additionally, even in the event that the web process is compromised, even if the web process can be tricked into believing it has been granted pasteboard access, the changes in r259151 will prevent it from being able to request pasteboard data, unless the user (or the application, on behalf of the user) has explicitly pasted via trusted API calls that are inaccessible from the web process. Test: editing/async-clipboard/clipboard-read-while-pasting.html * editing/Editor.cpp: (WebCore::Editor::paste): (WebCore::Editor::pasteAsPlainText): (WebCore::Editor::pasteAsQuotation): If `FromMenuOrKeyBinding::Yes` is passed in, set the `m_pastingFromMenuOrKeyBinding` flag to true during the scope of the paste command. * editing/Editor.h: (WebCore::Editor::isPastingFromMenuOrKeyBinding const): * editing/EditorCommand.cpp: (WebCore::executePaste): (WebCore::executePasteAndMatchStyle): (WebCore::executePasteAsPlainText): (WebCore::executePasteAsQuotation): Pass in `FromMenuOrKeyBinding::Yes` when triggering the paste from a menu item or key binding. * page/Frame.cpp: (WebCore::Frame::requestDOMPasteAccess): When pasting from menu or key binding, grant the page DOM paste access without requiring the DOM paste access UI to be shown and confirmed. 2020-05-18 Per Arne Vollan <pvollan@apple.com> [Win] Fix AppleWin build https://bugs.webkit.org/show_bug.cgi?id=212030 Reviewed by Brent Fulgham. The build fails because the number of bitfields in GreaterThanOrSameSizeAsStyleRareInheritedData does not match the actual number of bitfields in StyleRareInheritedData. * rendering/style/StyleRareInheritedData.cpp: 2020-05-18 Rob Buis <rbuis@igalia.com> Remove certain headers when a redirect causes a request method change https://bugs.webkit.org/show_bug.cgi?id=205119 Reviewed by Youenn Fablet. Implement step 11 of HTTP-redirect fetch [1] to redirect to GET method, remove body and strip certain headers for 301, 302 and 303 redirects. Tests: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any.html imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method.any.worker.html * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl): * platform/network/HTTPHeaderNames.in: * platform/network/ResourceRequestBase.cpp: (WebCore::shouldUseGet): (WebCore::ResourceRequestBase::redirectAsGETIfNeeded): (WebCore::ResourceRequestBase::redirectedRequest const): * platform/network/ResourceRequestBase.h: 2020-05-18 Antti Koivisto <antti@apple.com> [Wheel event region] Invalidation for root style https://bugs.webkit.org/show_bug.cgi?id=212029 Reviewed by Simon Fraser. Test: fast/scrolling/mac/wheel-event-listener-region-root-invalidation.html Invalidate the region when event listeners change on Document or Window. * dom/Document.cpp: (WebCore::Document::invalidateEventListenerRegions): * dom/Document.h: (isType): * dom/Element.cpp: (WebCore::Element::invalidateEventListenerRegions): * dom/Element.h: * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): (WebCore::EventTarget::removeEventListener): (WebCore::EventTarget::removeAllEventListeners): (WebCore::EventTarget::invalidateEventListenerRegions): * dom/EventTarget.h: * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::adjustEventListenerRegionTypesForRootStyle): * style/StyleAdjuster.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): 2020-05-18 Simon Fraser <simon.fraser@apple.com> Find doesn't always scroll search results into view https://bugs.webkit.org/show_bug.cgi?id=212007 <rdar://problem/36333321> Reviewed by Wenson Hsieh. HighlightData::collectBounds() could produce overly large bounds, causing the selection to fail to scroll into view. This happened when multiple block ancestors were added to 'renderers', with empty rects. The process of mapping that empty rect to a quad via localToAbsoluteQuad() could produce an empty quad at a fractional offset, then calling enclosingBoundingBox() on the quad would create a 1x1 rectangle, which got unioned with selectionRect. Fix by skipping entries with empty rects. Add a Selection log channel and some logging that makes this trivial to see. Test: editing/selection/selection-bounds-fractional-containing-blocks.html * platform/Logging.h: * rendering/HighlightData.cpp: (WebCore::HighlightData::collectBounds const): 2020-05-18 Darin Adler <darin@apple.com> Add iterator checking to ListHashSet https://bugs.webkit.org/show_bug.cgi?id=211669 Reviewed by Anders Carlsson. * page/ios/ContentChangeObserver.h: Added an include of Element.h, needed to call makeWeakPtr in an inline function. This is due to a change in the way makeWeakPtr now checks the type of the argument. It's possible we could refine it further to relax this requirement, but it seems OK to include Element.h here. 2020-05-18 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add support for computing the collapsed table border https://bugs.webkit.org/show_bug.cgi?id=212003 Reviewed by Antti Koivisto. UAs must compute an initial left and right border width for the table by examining the first and last cells in the first row of the table. The left border width of the table is half of the first cell's collapsed left border, and the right border width of the table is half of the last cell's collapsed right border. The top border width of the table is computed by examining all cells who collapse their top borders with the top border of the table. The top border width of the table is equal to half of the maximum collapsed top border. The bottom border width is computed by examining all cells whose bottom borders collapse with the bottom of the table. The bottom border width is equal to half of the maximum collapsed bottom border. https://www.w3.org/TR/CSS22/tables.html#collapsing-borders This patch implements the table box part of the border collapsing. Inner table elements need to implement collapsing as well. * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::ensureTableFormattingState): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: (WebCore::Layout::TableWrapperBlockFormattingContext::layoutTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeBorderAndPaddingForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h: * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints): (WebCore::Layout::TableFormattingContext::ensureTableGrid): * layout/tableformatting/TableFormattingContext.h: * layout/tableformatting/TableFormattingState.cpp: (WebCore::Layout::TableFormattingState::TableFormattingState): * layout/tableformatting/TableFormattingState.h: 2020-05-18 Antoine Quint <graouts@apple.com> Clean up media controls content for Apple platforms https://bugs.webkit.org/show_bug.cgi?id=212011 <rdar://problem/63298588> Reviewed by Dean Jackson. We strip Copyright and other comments from the CSS and JS media controls files. * WebCore.xcodeproj/project.pbxproj: 2020-05-18 Alicia Boya García <aboya@igalia.com> [GStreamer][MediaSource] Remove orphaned tracks in updateTracks() https://bugs.webkit.org/show_bug.cgi?id=211980 Reviewed by Xabier Rodriguez-Calvar. This patch ensures tracks missing from a subsequent updateTracks() calls are removed from the player. This fixes regressions on the following tests caused on r261683. imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-removetrack.https.html imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-applyConstraints.https.html * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::hashSetFromHashMapKeys): (WebCore::MediaPlayerPrivateGStreamer::updateTracks): 2020-05-18 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] "ASSERTION FAILED: !m_adoptionIsRequired" when double clicking on a word https://bugs.webkit.org/show_bug.cgi?id=211957 Reviewed by Adrian Perez de Castro. Make SelectionData non-refcounted. We can just move in most of the cases to avoid copies. * platform/Pasteboard.h: * platform/gtk/PasteboardGtk.cpp: (WebCore::Pasteboard::createForDragAndDrop): (WebCore::Pasteboard::Pasteboard): (WebCore::Pasteboard::selectionData const): * platform/gtk/SelectionData.h: 2020-05-18 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Add WebKitContextMenuItemType for paste as plaintext https://bugs.webkit.org/show_bug.cgi?id=177638 Reviewed by Michael Catanzaro. Add paste as plain text context menu item for rich editable content. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): (WebCore::ContextMenuController::populate): (WebCore::ContextMenuController::checkOrEnableIfNeeded const): * platform/ContextMenuItem.h: * platform/LocalizedStrings.h: * platform/gtk/LocalizedStringsGtk.cpp: (WebCore::contextMenuItemTagPasteAsPlainText): 2020-05-17 Simon Fraser <simon.fraser@apple.com> Fix operator== and hash() for ExtendedColor https://bugs.webkit.org/show_bug.cgi?id=211993 Reviewed by Sam Weinig. Color::operator== and hash() were wrong for extended color. Fix operator== to compare extended colors. Extended and non-extended colors have to always conpare as non-equal to preserve computed style behavior, currently. Fix hash() to hash the color components and colorspace for ExtendedColor. Add some API tests for these code paths. * platform/graphics/Color.cpp: (WebCore::extendedColorsEqual): * platform/graphics/Color.h: (WebCore::operator==): (WebCore::Color::hash const): * platform/graphics/ColorUtilities.cpp: (WebCore::areEssentiallyEqual): * platform/graphics/ColorUtilities.h: (WebCore::operator==): (WebCore::operator!=): * platform/graphics/ExtendedColor.cpp: (WebCore::ExtendedColor::hash const): * platform/graphics/ExtendedColor.h: (WebCore::operator==): (WebCore::operator!=): 2020-05-17 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Introduce TableWrapperBlockFormattingContext https://bugs.webkit.org/show_bug.cgi?id=211996 Reviewed by Antti Koivisto. Table wrapper box establishes a special BFC with only captions and the actual table box in it. It mostly behaves like a normal BFC but the table box requires some special handing when it comes to padding/border and width/height computation. This patch moves the table box specific code from generic BFC to this new subclass. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.h: * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::createFormattingContext): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContext.h: (): Deleted. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.cpp: Added. (WebCore::Layout::TableWrapperBlockFormattingContext::TableWrapperBlockFormattingContext): (WebCore::Layout::TableWrapperBlockFormattingContext::layoutInFlowContent): (WebCore::Layout::TableWrapperBlockFormattingContext::layoutTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeWidthAndMarginForTableBox): (WebCore::Layout::TableWrapperBlockFormattingContext::computeHeightAndMarginForTableBox): * layout/blockformatting/tablewrapper/TableWrapperBlockFormattingContext.h: Added. 2020-05-17 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Move to new Pasteboard API https://bugs.webkit.org/show_bug.cgi?id=177633 Reviewed by Adrian Perez de Castro. Add support for custom data and remove the support for unknown data types that is currently unused. * editing/gtk/EditorGtk.cpp: (WebCore::Editor::writeSelectionToPasteboard): Set the contentOrigin. * editing/gtk/WebContentReaderGtk.cpp: (WebCore::shouldReplaceSubresourceURL): Helper to decide whether to replace the subresource URL. (WebCore::WebContentMarkupReader::readHTML): Create a fragment for HTML sanitizing it if needed. * platform/Pasteboard.h: * platform/PasteboardCustomData.h: (WebCore::PasteboardCustomData::gtkType): Mime type name for GTK custom pasteboard data. * platform/SharedBuffer.h: * platform/glib/SharedBufferGlib.cpp: (WebCore::SharedBuffer::createGBytes const): Create a GBytes wrapping the SharedBuffer data. * platform/gtk/PasteboardGtk.cpp: (WebCore::Pasteboard::writeString): (WebCore::Pasteboard::write): (WebCore::Pasteboard::read): (WebCore::Pasteboard::hasData): (WebCore::Pasteboard::typesSafeForBindings): (WebCore::Pasteboard::typesForLegacyUnsafeBindings): (WebCore::Pasteboard::readOrigin): (WebCore::Pasteboard::readString): (WebCore::Pasteboard::readStringInCustomData): (WebCore::Pasteboard::fileContentState): (WebCore::Pasteboard::writeCustomData): * platform/gtk/SelectionData.cpp: (WebCore::SelectionData::clearAllExceptFilenames): * platform/gtk/SelectionData.h: (WebCore::SelectionData::setCustomData): (WebCore::SelectionData::customData const): (WebCore::SelectionData::hasCustomData const): (WebCore::SelectionData::clearCustomData): 2020-05-16 Simon Fraser <simon.fraser@apple.com> Some color-related cleanup https://bugs.webkit.org/show_bug.cgi?id=211991 Reviewed by Sam Weinig. Change FloatComponents and ColorComponents to use std::array<>. Add Color::toSRGBAComponentsLossy() to make explicit potentially lossy conversions between P3 and sRGB colors, and call it in places where we do that conversion. Add const in a few places. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/Color.cpp: (WebCore::Color::Color): (WebCore::Color::toSRGBAComponentsLossy const): (WebCore::Color::asExtended const): * platform/graphics/Color.h: * platform/graphics/ColorUtilities.cpp: (WebCore::ColorMatrix::ColorMatrix): * platform/graphics/ColorUtilities.h: (WebCore::FloatComponents::FloatComponents): (): Deleted. * platform/graphics/ExtendedColor.cpp: (WebCore::ExtendedColor::create): (WebCore::ExtendedColor::cssText const): * platform/graphics/ExtendedColor.h: (WebCore::ExtendedColor::red const): (WebCore::ExtendedColor::green const): (WebCore::ExtendedColor::blue const): (WebCore::ExtendedColor::alpha const): (WebCore::ExtendedColor::channels const): (WebCore::ExtendedColor::ExtendedColor): * platform/graphics/cg/ColorCG.cpp: (WebCore::leakCGColor): * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::fillRegion const): * platform/graphics/filters/FilterOperation.cpp: (WebCore::InvertLightnessFilterOperation::transformColor const): (WebCore::InvertLightnessFilterOperation::inverseTransformColor const): * platform/graphics/gtk/ColorGtk.cpp: (WebCore::Color::operator GdkRGBA const): * platform/graphics/win/ColorDirect2D.cpp: (WebCore::Color::operator D2D1_COLOR_F const): (WebCore::Color::operator D2D1_VECTOR_4F const): 2020-05-16 Andy Estes <aestes@apple.com> Fix the build after r261785. * Modules/applepay/PaymentInstallmentConfiguration.mm: (WebCore::fromDecimalNumber): 2020-05-16 David Kilzer <ddkilzer@apple.com> Let Xcode have its way with WebCore project * WebCore.xcodeproj/project.pbxproj: - Resort TableLayout.cpp. 2020-05-16 Zalan Bujtas <zalan@apple.com> Add missing is<RenderTableSection> check. Unreviewed. * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): 2020-05-16 Andy Estes <aestes@apple.com> REGRESSION (r260717): installmentConfiguration member is no longer available on ApplePayPaymentRequest https://bugs.webkit.org/show_bug.cgi?id=211911 <rdar://problem/63236367> Reviewed by Tim Horton. Prior to r260717, installmentConfiguration was a member of ApplePayRequestBase, making it available on ApplePayRequest and ApplePayPaymentRequest. In r260717, it was mistakenly moved to ApplePayRequest. This change moves it back to ApplePayRequestBase, adds infrastructure for regression testing ApplePayInstallmentConfiguration, and adds a regression test. Test: http/tests/ssl/applepay/ApplePayInstallmentConfiguration.https.html * Modules/applepay/ApplePayInstallmentConfiguration.idl: * Modules/applepay/ApplePayRequestBase.cpp: (WebCore::convertAndValidate): (WebCore::finishConverting): Deleted. * Modules/applepay/ApplePayRequestBase.idl: * Modules/applepay/PaymentInstallmentConfiguration.mm: (WebCore::fromDecimalNumber): (WebCore::applePaySetupFeatureType): (WebCore::PaymentInstallmentConfiguration::applePayInstallmentConfiguration const): * Modules/applepay/PaymentInstallmentConfigurationWebCore.h: * Modules/applepay/paymentrequest/ApplePayRequest.idl: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::showPaymentUI): * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.idl: 2020-05-16 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Ignore table padding when borders are collapsed https://bugs.webkit.org/show_bug.cgi?id=211984 Reviewed by Antti Koivisto. Table padding has no room left when the table border is collapsed with the inner table elements. Test: fast/layoutformattingcontext/table-simple-border-collapse-with-padding.html * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::isPaddingApplicable const): 2020-05-16 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Take vertical spacing into account when setting the height of a cell with rowspan https://bugs.webkit.org/show_bug.cgi?id=211976 Reviewed by Antti Koivisto. When a cell spans over multiple rows, the height of the cell includes the vertical spacing between those spanned rows as well. Test: fast/layoutformattingcontext/table-simple-rowspan-with-spacing.html * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): 2020-05-15 Antti Koivisto <antti@apple.com> Nullptr crash in MediaQueryMatcher::evaluateAll https://bugs.webkit.org/show_bug.cgi?id=211963 <rdar://problem/62850977> Reviewed by Brent Fulgham. Test: fast/media/media-query-list-mutation.html * css/MediaQueryMatcher.cpp: (WebCore::MediaQueryMatcher::evaluateAll): Copy the vector before iterating. 2020-05-15 Jack Lee <shihchieh_lee@apple.com> Nullptr crash in WebCore::Node::treeScope() when processing nested list insertion commands. https://bugs.webkit.org/show_bug.cgi?id=211964 <rdar://problem/63224871> Reviewed by Geoffrey Garen. Load event may fire in fixOrphanedListChild() and change the node tree. In doApplyForSingleParagraph check for disconnected node returned by fixOrphanedListChild() and bail out. Test: editing/inserting/nested-list-insertion-crash.html * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::doApplyForSingleParagraph): 2020-05-15 Alex Christensen <achristensen@webkit.org> Use enum serialization instead of casting to/from uint32_t https://bugs.webkit.org/show_bug.cgi?id=211885 <rdar://problem/60106629> and <rdar://problem/60107663> Reviewed by Geoffrey Garen. This doesn't change anything except make stricter checks at IPC boundaries. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::visiblePositionRangeForLine const): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityModifySelection:increase:]): * editing/EditingBehavior.h: * editing/Editor.cpp: (WebCore::Editor::shouldSmartDelete): (WebCore::Editor::deleteWithDirection): (WebCore::Editor::misspelledWordAtCaretOrRange const): (WebCore::Editor::guessesForMisspelledOrUngrammatical): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markAndReplaceFor): (WebCore::Editor::handleAcceptedCandidate): * editing/EditorCommand.cpp: (WebCore::executeDeleteBackward): (WebCore::executeDeleteBackwardByDecomposingPreviousCharacter): (WebCore::executeDeleteForward): (WebCore::executeDeleteToBeginningOfLine): (WebCore::executeDeleteToBeginningOfParagraph): (WebCore::executeDeleteToEndOfLine): (WebCore::executeDeleteToEndOfParagraph): (WebCore::executeDeleteWordBackward): (WebCore::executeDeleteWordForward): (WebCore::executeForwardDelete): (WebCore::executeMoveBackward): (WebCore::executeMoveBackwardAndModifySelection): (WebCore::executeMoveDown): (WebCore::executeMoveDownAndModifySelection): (WebCore::executeMoveForward): (WebCore::executeMoveForwardAndModifySelection): (WebCore::executeMoveLeft): (WebCore::executeMoveLeftAndModifySelection): (WebCore::executeMoveRight): (WebCore::executeMoveRightAndModifySelection): (WebCore::executeMoveToBeginningOfDocument): (WebCore::executeMoveToBeginningOfDocumentAndModifySelection): (WebCore::executeMoveToBeginningOfLine): (WebCore::executeMoveToBeginningOfLineAndModifySelection): (WebCore::executeMoveToBeginningOfParagraph): (WebCore::executeMoveToBeginningOfParagraphAndModifySelection): (WebCore::executeMoveToBeginningOfSentence): (WebCore::executeMoveToBeginningOfSentenceAndModifySelection): (WebCore::executeMoveToEndOfDocument): (WebCore::executeMoveToEndOfDocumentAndModifySelection): (WebCore::executeMoveToEndOfSentence): (WebCore::executeMoveToEndOfSentenceAndModifySelection): (WebCore::executeMoveToEndOfLine): (WebCore::executeMoveToEndOfLineAndModifySelection): (WebCore::executeMoveToEndOfParagraph): (WebCore::executeMoveToEndOfParagraphAndModifySelection): (WebCore::executeMoveParagraphBackwardAndModifySelection): (WebCore::executeMoveParagraphForwardAndModifySelection): (WebCore::executeMoveUp): (WebCore::executeMoveUpAndModifySelection): (WebCore::executeMoveWordBackward): (WebCore::executeMoveWordBackwardAndModifySelection): (WebCore::executeMoveWordForward): (WebCore::executeMoveWordForwardAndModifySelection): (WebCore::executeMoveWordLeft): (WebCore::executeMoveWordLeftAndModifySelection): (WebCore::executeMoveWordRight): (WebCore::executeMoveWordRightAndModifySelection): (WebCore::executeMoveToLeftEndOfLine): (WebCore::executeMoveToLeftEndOfLineAndModifySelection): (WebCore::executeMoveToRightEndOfLine): (WebCore::executeMoveToRightEndOfLineAndModifySelection): (WebCore::executeSelectLine): (WebCore::executeSelectParagraph): (WebCore::executeSelectSentence): (WebCore::executeSelectWord): * editing/FrameSelection.cpp: (WebCore::FrameSelection::FrameSelection): (WebCore::FrameSelection::willBeModified): (WebCore::FrameSelection::modifyExtendingRight): (WebCore::FrameSelection::modifyExtendingForward): (WebCore::FrameSelection::modifyMovingRight): (WebCore::FrameSelection::modifyMovingForward): (WebCore::FrameSelection::modifyExtendingLeft): (WebCore::FrameSelection::modifyExtendingBackward): (WebCore::FrameSelection::modifyMovingLeft): (WebCore::FrameSelection::modifyMovingBackward): (WebCore::isBoundary): (WebCore::FrameSelection::textSelectionIntent): (WebCore::textSelectionWithDirectionAndGranularity): (WebCore::FrameSelection::modify): (WebCore::FrameSelection::clear): (WebCore::FrameSelection::willBeRemovedFromFrame): (WebCore::FrameSelection::updateAppearance): (WebCore::FrameSelection::wordSelectionContainingCaretSelection): (WebCore::FrameSelection::rangeByAlteringCurrentSelection const): * editing/FrameSelection.h: * editing/TextGranularity.h: (): Deleted. * editing/TypingCommand.cpp: (WebCore::editActionForTypingCommand): (WebCore::TypingCommand::deleteKeyPressed): (WebCore::TypingCommand::forwardDeleteKeyPressed): (WebCore::TypingCommand::insertTextRunWithoutNewlines): (WebCore::TypingCommand::insertLineBreak): (WebCore::TypingCommand::insertParagraphSeparator): (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent): (WebCore::TypingCommand::deleteSelection): * editing/TypingCommand.h: * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity): * editing/VisibleSelection.h: * editing/VisibleUnits.cpp: (WebCore::directionIsDownstream): (WebCore::atBoundaryOfGranularity): (WebCore::withinTextUnitOfGranularity): (WebCore::nextWordBoundaryInDirection): (WebCore::nextSentenceBoundaryInDirection): (WebCore::nextParagraphBoundaryInDirection): (WebCore::positionOfNextBoundaryOfGranularity): (WebCore::enclosingTextUnitOfGranularity): (WebCore::charactersAroundPosition): (WebCore::wordRangeFromPosition): (WebCore::closestWordBoundaryForPosition): (WebCore::rangeExpandedByCharactersInDirectionAtWordBoundary): (WebCore::wordBoundaryForPositionWithoutCrossingLine): * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectItemAroundHitTestResult): * editing/cocoa/DictionaryLookup.mm: * editing/mac/DictionaryLookupLegacy.mm: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): * loader/FrameLoaderClient.h: (WebCore::FrameLoaderClient::webGLPolicyForURL const): (WebCore::FrameLoaderClient::resolveWebGLPolicyForURL const): (): Deleted. * loader/FrameLoaderTypes.h: * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * page/DOMSelection.cpp: (WebCore::DOMSelection::modify): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): * page/EventHandler.cpp: (WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart): (WebCore::EventHandler::selectClosestWordFromHitTestResult): (WebCore::EventHandler::selectClosestContextualWordFromMouseEvent): (WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent): (WebCore::EventHandler::handleMousePressEventTripleClick): (WebCore::EventHandler::handleMousePressEventSingleClick): (WebCore::EventHandler::updateSelectionForMouseDrag): (WebCore::setInitialKeyboardSelection): (WebCore::handleKeyboardSelectionMovement): * rendering/HitTestResult.cpp: (WebCore::HitTestResult::isOverTextInsideFormControlElement const): 2020-05-15 Simon Fraser <simon.fraser@apple.com> Rename the mapLocalToContainer() container argument, since it's not just used for repaint https://bugs.webkit.org/show_bug.cgi?id=211974 Reviewed by Zalan Bujtas. mapLocalToContainer() is a generic geometry mapping function, and not just used for repaint, so rename the "repaintContainer" argument to "ancestorContainer". Also fix some weirdly named variables in RenderMultiColumnFlow. * rendering/RenderBox.cpp: (WebCore::RenderBox::mapLocalToContainer const): * rendering/RenderBox.h: * rendering/RenderFragmentedFlow.cpp: (WebCore::RenderFragmentedFlow::mapLocalToContainer const): * rendering/RenderFragmentedFlow.h: * rendering/RenderInline.cpp: (WebCore::RenderInline::mapLocalToContainer const): (WebCore::RenderInline::pushMappingToContainer const): * rendering/RenderMultiColumnFlow.cpp: (WebCore::RenderMultiColumnFlow::addFragmentToThread): (WebCore::RenderMultiColumnFlow::mapFromFlowToFragment const): (WebCore::RenderMultiColumnFlow::physicalTranslationOffsetFromFlowToFragment const): (WebCore::RenderMultiColumnFlow::physicalTranslationFromFlowToFragment const): * rendering/RenderObject.cpp: (WebCore::RenderObject::mapLocalToContainer const): (WebCore::RenderObject::localToContainerQuad const): (WebCore::RenderObject::localToContainerPoint const): * rendering/RenderObject.h: * rendering/RenderView.cpp: (WebCore::RenderView::mapLocalToContainer const): * rendering/svg/RenderSVGForeignObject.cpp: (WebCore::RenderSVGForeignObject::mapLocalToContainer const): * rendering/svg/RenderSVGForeignObject.h: * rendering/svg/RenderSVGInline.cpp: (WebCore::RenderSVGInline::mapLocalToContainer const): * rendering/svg/RenderSVGInline.h: * rendering/svg/RenderSVGModelObject.cpp: (WebCore::RenderSVGModelObject::mapLocalToContainer const): * rendering/svg/RenderSVGModelObject.h: * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::mapLocalToContainer const): * rendering/svg/RenderSVGRoot.h: * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::mapLocalToContainer const): * rendering/svg/RenderSVGText.h: * rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::mapLocalToContainer): * rendering/svg/SVGRenderSupport.h: 2020-05-15 Simon Fraser <simon.fraser@apple.com> REGRESSION (r249091): Can't click on a video in the second column of a paginated web view https://bugs.webkit.org/show_bug.cgi?id=211973 <rdar://problem/61418775> Reviewed by Zalan Bujtas. In r249091 I made clip layer computation use offsetFromAncestor() by default, but this turns out to give different behavior from mapping via renderers in columns. The bug was that accumulateOffsetTowardsAncestor() would map through the RenderMultiColumnFlow columns if the ancestorLayer was the one that was using columns, but mapping via renderers only maps through columns if converting to some ancestor of the columnated renderer. I did not investigate why this only affects video. Test: fast/multicol/clipped-video-in-second-column.html * rendering/RenderLayer.cpp: (WebCore::accumulateOffsetTowardsAncestor): (WebCore::RenderLayer::calculateClipRects const): 2020-05-15 Kenneth Russell <kbr@chromium.org> OES_texture_float internal format conversion must depend on WEBGL_color_buffer_float https://bugs.webkit.org/show_bug.cgi?id=211971 Reviewed by Dean Jackson. Only adjust the internal formats of textures created for the WebGL 1.0 OES_texture_float extension if the WEBGL_color_buffer_float extension has been enabled. Covered by the WebGL 1.0 OES_texture_float conformance tests when run on iOS with another forthcoming fix to ANGLE which will enable the OES_texture_float extension on that platform. * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::ensureEnabled): (WebCore::ExtensionsGLANGLE::adjustWebGL1TextureInternalFormat): * platform/graphics/angle/ExtensionsGLANGLE.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::texImage2DDirect): 2020-05-15 Oriol Brufau <obrufau@igalia.com> [css-grid] Treat percentages as auto for the minimum contribution https://bugs.webkit.org/show_bug.cgi?id=195967 Reviewed by Manuel Rego Casasnovas. The minimum contribution of a grid item is the outer size resulting from the minimum size if the computed preferred size behaves as auto, or the min-content contribution otherwise. If the preferred size is a percentage, it should be resolved with respect to the grid area, which depends on the minimum contribution of the item. Thus the percentage is cyclic and behaves as auto. Before this change, WebKit only checked whether the preferred size is auto, not whether it behaves as auto. In fact this was according to an older version of the spec, but it was changed in https://github.com/w3c/csswg-drafts/issues/2367 Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-minimum-contribution-with-percentages.html Some cases in the test still fail due to bug 209461. * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const): 2020-05-15 Antoine Quint <graouts@apple.com> [Web Animations] Animation with a single keyframe is not accelerated https://bugs.webkit.org/show_bug.cgi?id=188730 <rdar://problem/43481113> Reviewed by Dean Jackson. Test: webanimations/accelerated-animation-single-keyframe.html Prior to attempting to run an accelerated effect, ensure that the KeyframeList passed to RenderLayerModelObject::startAnimation() does not have implicit keyframes since eventually GraphicsLayerCA::animationCanBeAccelerated() would be called and would reject a single-keyframe animation. To do this, we use the same code used in Style::Resolver::keyframeStylesForAnimation() which we refactor in the new KeyframeList::fillImplicitKeyframes() method. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::copyPropertiesFromSource): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): * rendering/style/KeyframeList.cpp: (WebCore::KeyframeList::hasImplicitKeyframes const): (WebCore::KeyframeList::copyKeyframes): (WebCore::zeroPercentKeyframe): (WebCore::hundredPercentKeyframe): (WebCore::KeyframeList::fillImplicitKeyframes): * rendering/style/KeyframeList.h: * style/StyleResolver.cpp: (WebCore::Style::Resolver::keyframeStylesForAnimation): 2020-05-15 Said Abou-Hallawa <sabouhallawa@apple.com> The initial value of "transform-box" should be "view-box" https://bugs.webkit.org/show_bug.cgi?id=211927 Reviewed by Simon Fraser. Specs: https://drafts.csswg.org/css-transforms/#transform-box. Test: svg/transforms/svg-transform-box-initial.html * css/CSSProperties.json: * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialTransformBox): 2020-05-15 Andres Gonzalez <andresg_22@apple.com> Fix for crash in accessibility/mac/replace-text-with-range-on-webarea-element.html in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=211954 Reviewed by Chris Fleizach. Fixes crash in isolated tree mode in accessibility/mac/replace-text-with-range-on-webarea-element.html. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::postTextStateChangeNotification): Check for null object before dereferencing. (WebCore::AXObjectCache::rootWebArea): Reverted to returning an AXObject since it is not needed to return AXCoreObject. * accessibility/AXObjectCache.h: 2020-05-15 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Move column and row balancing logic to a dedicated class https://bugs.webkit.org/show_bug.cgi?id=211937 Reviewed by Antti Koivisto. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutInFlowContent): (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraSpace): (WebCore::Layout::ColumnSpan::hasSpan): Deleted. (WebCore::Layout::ColumnSpan::isSpanned): Deleted. (WebCore::Layout::ColumnSpan::spanCount): Deleted. (WebCore::Layout::ColumnSpan::startSpan): Deleted. (WebCore::Layout::ColumnSpan::endSpan): Deleted. (WebCore::Layout::ColumnSpan::index): Deleted. (WebCore::Layout::ColumnSpan::size): Deleted. (WebCore::Layout::ColumnSpan::spacing): Deleted. (WebCore::Layout::RowSpan::hasSpan): Deleted. (WebCore::Layout::RowSpan::isSpanned): Deleted. (WebCore::Layout::RowSpan::spanCount): Deleted. (WebCore::Layout::RowSpan::startSpan): Deleted. (WebCore::Layout::RowSpan::endSpan): Deleted. (WebCore::Layout::RowSpan::index): Deleted. (WebCore::Layout::RowSpan::size): Deleted. (WebCore::Layout::RowSpan::spacing): Deleted. (WebCore::Layout::GridSpace::isEmpty const): Deleted. (): Deleted. (WebCore::Layout::max): Deleted. (WebCore::Layout::operator-): Deleted. (WebCore::Layout::operator+=): Deleted. (WebCore::Layout::operator-=): Deleted. (WebCore::Layout::operator/): Deleted. (WebCore::Layout::distributeAvailableSpace): Deleted. (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): Deleted. (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): Deleted. * layout/tableformatting/TableFormattingContext.h: * layout/tableformatting/TableFormattingState.h: (WebCore::Layout::TableFormattingState::tableGrid const): * layout/tableformatting/TableGrid.h: (WebCore::Layout::TableGrid::widthConstraints const): (WebCore::Layout::TableGrid::Rows::list const): (WebCore::Layout::TableGrid::widthConstraints): Deleted. (WebCore::Layout::TableGrid::Rows::rowList const): Deleted. 2020-05-15 Alicia Boya García <aboya@igalia.com> [GStreamer][MediaStream] Fix missing video size https://bugs.webkit.org/show_bug.cgi?id=211938 Reviewed by Philippe Normand. r261683 redefined m_currentVideoStreamId. Under the new design, tracks have several states: - "wanted": a track has been selected from JavaScript, or chosen by default. - "requested": a track that is expected to be chosen by the next STREAMS_SELECTED message. - "current": a track that has been selected after the STREAMS_SELECTED message has been handled. naturalSize() used to check m_currentVideoStreamId to look for the video size, but this is called relatively early before the track becomes "current" under the new design. Since the size tags can't be queried at any time, it makes sense to use m_wantedVideoStreamId instead. This fixes the following tests which were previously regressed: fast/mediastream/get-user-media-constraints.html fast/mediastream/getUserMedia-video-rescaling.html fast/mediastream/mediastreamtrack-video-clone.html imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-firstframe.https.html fast/mediastream/media-stream-renders-first-frame.html * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::naturalSize const): 2020-05-15 Antti Koivisto <antti@apple.com> [Wheel event region] Invalidation when changing listeners on elements https://bugs.webkit.org/show_bug.cgi?id=211895 Reviewed by Simon Fraser. Doesn't handle root (window/document) invalidation yet. Test: fast/scrolling/mac/wheel-event-listener-region-element-invalidation.html * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): (WebCore::EventTarget::removeEventListener): (WebCore::EventTarget::removeAllEventListeners): Invalidate element style on wheel event changes. * rendering/RenderElement.cpp: (WebCore::RenderElement::styleWillChange): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::invalidateEventRegion): Build on non-iOS platforms. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::maintainsEventRegion const): Factor into function so it can be shared with RenderLayer::invalidateEventRegion. (WebCore::RenderLayerBacking::updateEventRegion): * rendering/RenderLayerBacking.h: 2020-05-15 Antoine Quint <graouts@apple.com> Cursor should not update on a 20ms timer https://bugs.webkit.org/show_bug.cgi?id=211884 <rdar://problem/63220368> Reviewed by Simon Fraser. Test: fast/events/mouse-cursor-udpate-during-raf.html Update cursors after rAF callbacks have been serviced and layout has been updated. * page/Page.cpp: (WebCore::Page::updateRendering): (WebCore::Page::doAfterUpdateRendering): 2020-05-15 Andres Gonzalez <andresg_22@apple.com> Update the isolated tree only if isolated tree mode is enabled. https://bugs.webkit.org/show_bug.cgi?id=211936 Reviewed by Chris Fleizach. Check for isIsolatedTreeEnabled before updating the isolated tree. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::updateIsolatedTree): 2020-05-15 Adrian Perez de Castro <aperez@igalia.com> [GTK3] Bring back usage of GtkMenu for context menus https://bugs.webkit.org/show_bug.cgi?id=211557 Reviewed by Carlos Garcia Campos. No new tests needed. * platform/gtk/GtkVersioning.h: Remove GtkPopover functions used only for context menus. 2020-05-14 Said Abou-Hallawa <sabouhallawa@apple.com> Unreviewed. Fix build warning after r261113 Remove unused variable. * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const): 2020-05-14 Andres Gonzalez <andresg_22@apple.com> Expose isColumnHeaderCell and isRowHeaderCell through AXCoreObject. https://bugs.webkit.org/show_bug.cgi?id=211919 Reviewed by Chris Fleizach. Multiple tests including accessibility/crash-table-recursive-layout.html. - Expose isColumn/RowHeaderCell through AXCoreObject in order to make the return value of AccessibilityTable::cellForColumnAndRow an AXCoreObject. - Implemented these methods for AXIsolatedObject. - isolatedCopy the accessibilityDescription property. * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::cellForColumnAndRow): Removed incorrect assert since children are AXCoreObjects and not necessarily AccessibilityTableCells. * accessibility/AccessibilityTable.h: * accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::isTableCellInSameRowGroup): (WebCore::AccessibilityTableCell::isTableCellInSameColGroup): (WebCore::AccessibilityTableCell::columnHeaders): (WebCore::AccessibilityTableCell::rowHeaders): * accessibility/AccessibilityTableCell.h: * accessibility/AccessibilityTableColumn.cpp: (WebCore::AccessibilityTableColumn::addChildren): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityElementForRow:andColumn:]): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): * accessibility/isolatedtree/AXIsolatedObject.h: 2020-05-14 Timothy Hatcher <timothy@apple.com> Add baseURL version of _WKUserStyleSheet forWKWebView. https://bugs.webkit.org/show_bug.cgi?id=211926 rdar://problem/62074675 Reviewed by Devin Rousso. Consolidate the paths taken for adding a UserStyleSheet. The m_injectedStyleSheetToSource was missing for page specific style sheets since it was another loop. * dom/ExtensionStyleSheets.cpp: (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const): (WebCore::ExtensionStyleSheets::injectPageSpecificUserStyleSheet): (WebCore::ExtensionStyleSheets::removePageSpecificUserStyleSheet): (WebCore::ExtensionStyleSheets::detachFromDocument): * dom/ExtensionStyleSheets.h: 2020-05-14 Jiewen Tan <jiewen_tan@apple.com> [WebAuthn] Relaxing signature length requirements for U2fRegister https://bugs.webkit.org/show_bug.cgi?id=209645 <rdar://problem/63204591> Reviewed by Brent Fulgham. It turns out the length range specified from the spec, i.e., [71, 73] is wrong. https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#registration-response-message-success It should actually be [70, 72]. However, as a middleware to relay the messages, user agents are not necessary to check the length. Therefore, the check is relaxed to make the code more robust. Covered by existing tests. * Modules/webauthn/fido/U2fResponseConverter.cpp: (fido::WebCore::createFidoAttestationStatementFromU2fRegisterResponse): 2020-05-14 Timothy Hatcher <timothy@apple.com> Add sourceURL to _evaluateJavaScript: so the scripts appear in Web Inspector. https://bugs.webkit.org/show_bug.cgi?id=211904 rdar://problem/62074376 Reviewed by Devin Rousso. Added sourceURL to RunJavaScriptParameters. Use it instead of the frame's document URL. * bindings/js/RunJavaScriptParameters.h: (WebCore::RunJavaScriptParameters::RunJavaScriptParameters): (WebCore::RunJavaScriptParameters::encode const): (WebCore::RunJavaScriptParameters::decode): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::executeScriptInWorldIgnoringException): (WebCore::ScriptController::executeScriptInWorld): (WebCore::ScriptController::callInWorld): (WebCore::ScriptController::executeUserAgentScriptInWorld): 2020-05-14 Eric Carlson <eric.carlson@apple.com> [Cocoa] Don't clear NowPlaying state unless it was set https://bugs.webkit.org/show_bug.cgi?id=211899 <rdar://problem/62249870> Reviewed by Jer Noble. Test: media/now-playing-status-without-media.html * platform/audio/PlatformMediaSessionManager.h: (WebCore::PlatformMediaSessionManager::haveEverRegisteredAsNowPlayingApplication const): Method added for testing. * platform/audio/cocoa/MediaSessionManagerCocoa.h: * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::updateNowPlayingInfo): Don't clear NowPlaying state unless it was setup in the first place. * testing/Internals.cpp: (WebCore::Internals::nowPlayingState const): Add new property. * testing/Internals.h: * testing/Internals.idl: 2020-05-14 Andres Gonzalez <andresg_22@apple.com> AXCoreObject font comparison methods should take another AXCoreObject instead of a RenderObject. https://bugs.webkit.org/show_bug.cgi?id=211909 Reviewed by Chris Fleizach. Covered by existing tests. - In order for font comparison methods to be implementted for both AXObjects and AXIsolatedObjects, they should take another AXCoreObject to compare against, instead of a RenderObject. - The AXIsolatedObject implementation of these methods is forwarded to the associated AXObject and dispatched to the main thread. - Implemented AXIsolatedObject::accessibilityDescription, hasUnderline and isUnvisited. * accessibility/AccessibilityObject.cpp: (WebCore::Accessibility::isAccessibilityObjectSearchMatchAtIndex): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: (WebCore::AXCoreObject::isNativeListBox const): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::hasSameFont const): (WebCore::AccessibilityRenderObject::hasSameFontColor const): (WebCore::AccessibilityRenderObject::hasSameStyle const): * accessibility/AccessibilityRenderObject.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): (WebCore::AXIsolatedObject::hasSameFont const): (WebCore::AXIsolatedObject::hasSameFontColor const): (WebCore::AXIsolatedObject::hasSameStyle const): (WebCore::AXIsolatedObject::isNativeListBox const): Deleted, implemented in base class. (WebCore::AXIsolatedObject::isUnvisited const): Deleted, inlined in header. (WebCore::AXIsolatedObject::hasUnderline const): Deleted, inlined in header. (WebCore::AXIsolatedObject::accessibilityDescription const): Deleted, inlined in header. * accessibility/isolatedtree/AXIsolatedObject.h: 2020-05-14 Nikita Vasilyev <nvasilyev@apple.com> Web Inspector: front-end shouldn't change the order of User Style Sheet rules https://bugs.webkit.org/show_bug.cgi?id=210893 <rdar://problem/61937118> Reviewed by Devin Rousso. Previously, some style sheets were falsly detected as Inspector::Protocol::CSS::StyleSheetOrigin::User causing incorrect order of style rules in Web Inspector. Test: inspector/css/getMatchedStylesForNode.html * inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::detectOrigin): 2020-05-14 Wenson Hsieh <wenson_hsieh@apple.com> [macOS] Update the placeholder icon image for attachment elements with progress="0" https://bugs.webkit.org/show_bug.cgi?id=211898 <rdar://problem/63203900> Reviewed by Timothy Hatcher. Refactor logic for creating an attachment placeholder image into a separate helper method, with a WebKitAdditions implementation when HAVE(SYSTEM_ATTACHMENT_PLACEHOLDER_ICON) is defined. * rendering/RenderThemeMac.mm: (WebCore::createAttachmentPlaceholderImage): (WebCore::paintAttachmentIconPlaceholder): 2020-05-14 Chris Dumez <cdumez@apple.com> Regression(r254856) Family Health iOS app is broken due to lack for WebSQL support https://bugs.webkit.org/show_bug.cgi?id=211896 <rdar://problem/63025045> Reviewed by Maciej Stachowiak. Add RuntimeApplicationChecks function to identify Family Health app on iOS. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isFamilyHealthApp): 2020-05-14 Andres Gonzalez <andresg_22@apple.com> AXIsolatedTree::updateChildren needs to apply pending changes before updating the given node. https://bugs.webkit.org/show_bug.cgi?id=211790 Reviewed by Chris Fleizach. Covered by multiple tests. AXIsolatedTree::updateChildren may be fired for an isolated object that is still in the pending changes list, and thus nodeForID would fail, causing the isolated tree to not be updated. This patch calls applyPendingChanges before updating the given node's children. Additional logging was added including the logging of the AXObjectCache object hierarchy. * accessibility/AXLogger.cpp: (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::postNotification): (WebCore::AXObjectCache::performDeferredCacheUpdate): (WebCore::AXObjectCache::updateIsolatedTree): * accessibility/AXObjectCache.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updateSubtree): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::focusedNode): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::applyPendingChanges): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 2020-05-14 Andres Gonzalez <andresg_22@apple.com> Fix for crash in LayoutTest in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=211894 Reviewed by Chris Fleizach. Several LayoutTests. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]): Check backing object for nullity before dereferencing. 2020-05-14 Andres Gonzalez <andresg_22@apple.com> AXIsolatedObject::isOnScreen needs to be dispatched to the main thread. https://bugs.webkit.org/show_bug.cgi?id=211893 Reviewed by Chris Fleizach. Covered by existing tests. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::children): Split assert into two lines for readability. (WebCore::AXIsolatedObject::isOnScreen const): Forward to associated AXObject and dispatch to the main thread. 2020-05-14 Andres Gonzalez <andresg_22@apple.com> Implementation of AXIsolatedObject::hasPlainText. https://bugs.webkit.org/show_bug.cgi?id=211892 Reviewed by Chris Fleizach. Covered by existing tests. Adding hasPlainText to the cached properties map. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): (WebCore::AXIsolatedObject::hasPlainText const): Deleted, inlined in header. * accessibility/isolatedtree/AXIsolatedObject.h: 2020-05-14 Sergio Villar Senin <svillar@igalia.com> Unreviewed build fix. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createContextWebGL): downcast m_context to WebGLRenderingContextBase before calling isXRCompatible(). It's created as a WebGLRenderingContextBase but stored in a CanvasRenderingContext. 2020-05-14 Andres Gonzalez <andresg_22@apple.com> Replacing and inserting text need to be dispatched to the main thread. https://bugs.webkit.org/show_bug.cgi?id=211863 Reviewed by Chris Fleizach. Covered by existing tests. In isolated tree mode WebAccessibilityObjectWrapper accessibilityReplaceRange and InsertText may be called on the secondary thread. Thus the AXIsolatedObject implementation of this functionality needs to forward these calls to the associated AXObject on the main thread. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::replaceTextInRange): (WebCore::AXIsolatedObject::insertText): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]): (-[WebAccessibilityObjectWrapper accessibilityInsertText:]): 2020-05-14 Antoine Quint <graouts@apple.com> Cursor should not update on a 20ms timer https://bugs.webkit.org/show_bug.cgi?id=211884 <rdar://problem/63220368> Reviewed by Antti Koivisto. Update the cursor during page rendering rather than using a 20ms timer. * page/EventHandler.cpp: (WebCore::EventHandler::EventHandler): (WebCore::EventHandler::clear): (WebCore::EventHandler::updateCursorIfNeeded): (WebCore::EventHandler::handleMouseMoveEvent): (WebCore::EventHandler::scheduleCursorUpdate): (WebCore::EventHandler::cursorUpdateTimerFired): Deleted. * page/EventHandler.h: * page/Page.cpp: (WebCore::Page::updateRendering): 2020-05-14 Philippe Normand <pnormand@igalia.com> [GStreamer] webrtc/disable-encryption.html is a crashing flaky https://bugs.webkit.org/show_bug.cgi?id=211166 Reviewed by Xabier Rodriguez-Calvar. Make sure the audio and video mediastream source elements are correctly removed and disposed from their parent bin when resetting the track sources. Before this change there was a possibility of disposing the elements while they were still in PLAYING state. * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (WebCore::_WebKitMediaStreamSrc::SourceData::reset): (WebCore::webkitMediaStreamSrcDispose): (WebCore::webkitMediaStreamSrcRemoveTrackByType): 2020-05-14 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixed, mid May 2020 edition https://bugs.webkit.org/show_bug.cgi?id=211859 Unreviewed build. No new tests needed. * Modules/indexeddb/server/UniqueIDBDatabase.cpp: Add missing IDBBindingUtilities.h and IDBSerializationContext.h includes. * accessibility/AccessibilityRenderObject.cpp: Add missing EventHandler.h include. * css/parser/CSSParserToken.cpp: Add missing RuntimeEnabledFeatures.h include. * editing/gtk/WebContentReaderGtk.cpp: Add missing Blob.h include. * html/canvas/OESTextureHalfFloat.cpp: Add missing ExtensionsGL.h include. * page/ShareDataReader.h: Add missing ExceptionOr.h include. * rendering/ContentfulPaintChecker.cpp: Add missing RenderView.h include. * rendering/style/StyleRareInheritedData.h: Add missing RenderStyleConstants.h and wtf/OptionSet.h includes. * rendering/style/StyleRareNonInheritedData.h: Add missing TouchAction.h and wtf/OptionSet.h includes. * style/StyleAdjuster.h: Add missing RenderStyleConstants.h include and forward declaration for WebCore::EventTarget. 2020-05-14 Alicia Boya García <aboya@igalia.com> [GStreamer] Playbin3 track switch rework https://bugs.webkit.org/show_bug.cgi?id=211623 Reviewed by Philippe Normand. This patch reworks how track selection and reporting of selected tracks is done in the player. The following found limitations and assumptions in current GStreamer have informed this patch: a) Although the API for playbin3 is designed to be able to accept any number of tracks of any kind, this is not supported in practice. b) The first track of each type is always selected. Even in playbin3 mode, looking for GST_STREAM_FLAG_SELECT is not a reliable method, as in most cases the demuxer does not set it at all. [qtdemux never sets it at all, and matroskademux only sets it in certain cases.] c) Sending GST_EVENT_SELECT_STREAMS is only safe at certain moments. It's not safe before pre-roll, after EOS or during the handling of another SELECT_STREAMS. d) Selecting text tracks with playbin APIs is not relevant. All text tracks are already being picked by WebKitTextCombiner, unaffected by playbin track selection. e) Tracks requested in a GST_EVENT_SELECT_STREAMS are eventually selected. On the other hand, looking at GST_MESSAGE_STREAMS_SELECTED's content is not reliable, as this has been seen to miss tracks depending on thread luck. This patch takes the points above into account to rework how track selection is handled in MediaPlayerPrivateGStreamer and fix the following issues: 1) In playbin3 mode, no track was marked as selected initially, because of reliance on GST_STREAM_FLAG_SELECT. 2) In playbin2 mode, sometimes tracks would not be initially marked as selected. This occurred because of reliance on the "selected" property in inputselector sinkpads, whose initialization is racy -- it can occur after the track has been added and picked up by WebKit. 3) In playbin3 mode, the limitations explained before has been honored to make track selection stable, delaying SELECT_STREAMS events until they are safe to send. This patch doesn't introduce significative behavior changes, rather aiming for improving the stabilitity of the player. Existing tests should provide enough coverage. * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp: (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer): (WebCore::AudioTrackPrivateGStreamer::setEnabled): * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): (WebCore::MediaPlayerPrivateGStreamer::updateEnabledVideoTrack): (WebCore::MediaPlayerPrivateGStreamer::updateEnabledAudioTrack): (WebCore::MediaPlayerPrivateGStreamer::playbin3SendSelectStreamsIfAppropriate): (WebCore::MediaPlayerPrivateGStreamer::updateTracks): (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): (WebCore::MediaPlayerPrivateGStreamer::handleMessage): (WebCore::MediaPlayerPrivateGStreamer::didEnd): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: (WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer): * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp: (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer): (WebCore::VideoTrackPrivateGStreamer::setSelected): * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: 2020-05-14 Philippe Normand <pnormand@igalia.com> [GStreamer] Can't replay blob videos in web.whatsapp.com https://bugs.webkit.org/show_bug.cgi?id=192540 Reviewed by Xabier Rodriguez-Calvar. This is a variant of bug 211627 but I could reproduce it only for videos. Unfortunately I wasn't able to write a reliable test for this. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::updateBufferingStatus): Prevent the fill timer from running forever after buffering completed. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcMakeRequest): Don't buffer blobs, this doesn't seem useful as they're already in memory anyway. 2020-05-06 Sergio Villar Senin <svillar@igalia.com> [WebXR] Implement WebGLRenderingContextBase::makeXRCompatible() https://bugs.webkit.org/show_bug.cgi?id=211506 Reviewed by Youenn Fablet. The WebXR spec defines a way to mark a WebGLRenderingContext as compatible with WebXR. This can be made at creation time (by setting the xrCompatible) attribute or by calling makeXRCompatible(). There are several web-platform-tests testing/using this feature, however we cannot enable them right now as we need some other features to be implemented first. * Modules/webxr/NavigatorWebXR.cpp: (WebCore::NavigatorWebXR::xr): Do not pass ScriptExecutionContext and use the Navigator's instead. * Modules/webxr/NavigatorWebXR.h: Ditto. * Modules/webxr/NavigatorWebXR.idl: Ditto. * Modules/webxr/WebXRSystem.h: expose ensureImmersiveXRDeviceIsSelected() and hasActiveImmersiveXRDevice() to be used from canvas and the rendering context. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createContextWebGL): call ensureImmersiveXRDeviceIsSelected() if xrCompatible is set. * html/canvas/WebGLContextAttributes.idl: Added xrCompatible. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): Initialize m_isXRCompatible. (WebCore::WebGLRenderingContextBase::makeXRCompatible): Implemented. * html/canvas/WebGLRenderingContextBase.h: Defined makeXRCompatible(). * html/canvas/WebGLRenderingContextBase.idl: Added makeXRCompatible(). * platform/graphics/GraphicsContextGLAttributes.h: Added xrCompatible. * testing/Internals.cpp: (WebCore::Internals::xrTest): Simplified the usage of NavigatorWebXR. 2020-05-13 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add support for cases when the balancing is not based on the initial width https://bugs.webkit.org/show_bug.cgi?id=211878 Reviewed by Antti Koivisto. This patch adds support for the cases when the table stretches all the way to the maximum content size, and we still choose the minimum width as the initial width and the maximum width as the base for balancing the extra space. Consider the following 2 tables: <table> <tr><td style="width: 20px"></td><td>some long long long content</td></tr> <tr><td style="width: 20px"></td><td>22px width content</td></tr> </table> <table> <tr><td style="width: 20px"></td><td>some long long long content</td></tr> <tr><td style="width: 20px"></td><td id=fixed_width style="width: 22px;">22px width content</td></tr> </table> These tables have the same maximum widths and they both stretch to that size. However the second table will end up with a wider first and narrower second column because of the width property on the [fixed_width] cell. While the first table applies the maximum width for each columns, the second table uses the minimum width as the initial width and balances the extra space using the maximum width (as the distribution ratio). This produces a very different layout where the first table has no line wrapping, while the second table wraps the "some long long long content" text (even though the used max widths are the same for each cells). Test: fast/layoutformattingcontext/table-fixed-width-with-max-distribution.html * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::ColumnSpan::spacing): (WebCore::Layout::RowSpan::spacing): (WebCore::Layout::distributeAvailableSpace): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): 2020-05-13 Zalan Bujtas <zalan@apple.com> Do not clear selection/repaint when the renderer gets moved during tree normalization. https://bugs.webkit.org/show_bug.cgi?id=211865 <rdar://problem/62849044> Reviewed by Antti Koivisto. While detachFromRenderElement should really be about "this renderer is being detached from its parent", some code in here assumes the renderer is not only going to be detached but also going to be destroyed. Ideally such code should live in RenderObject::willBeDestroyed(), but no tree walk is possible in there anymore. The reason for the crash is that when we split the inline for continuation, we construct new anonymous containers and move subtrees over to these new renderers. However at this point these new parent containers are not yet attached to the tree so any tree-walking cleanup code will fail (in detachFromRenderElement). Test: fast/repaint/do-no-repaint-on-internal-move.html * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::detachFromRenderElement): * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderInline.cpp: (WebCore::RenderTreeBuilder::Inline::splitInlines): 2020-05-13 Devin Rousso <drousso@apple.com> Web Inspector: show EventTarget listeners as an internal property https://bugs.webkit.org/show_bug.cgi?id=211766 Reviewed by Timothy Hatcher. Test: inspector/runtime/getProperties-internalProperties.html Add a `listeners` internal property for `EventTarget` objects with the value ``` listeners: { <event>: [ { callback: <function> capture: <boolean> passive: <boolean> once: <boolean> } ... ] ... } ``` so long as at least one `JSEventListener` has been added prior to that point. * inspector/WebInjectedScriptHost.cpp: (WebCore::objectForEventTargetListeners): Added. (WebCore::WebInjectedScriptHost::getInternalProperties): Drive-by: only add the `name` internal property if the `Worker` actually has a name. 2020-05-13 Devin Rousso <drousso@apple.com> Web Inspector: rename CSS.StyleSheetOrigin.Regular to CSS.StyleSheetOrigin.Author to match the spec https://bugs.webkit.org/show_bug.cgi?id=211827 Reviewed by Timothy Hatcher. Tests: inspector/css/add-rule.html inspector/css/getMatchedStylesForNode.html * inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::asInspectorStyleSheet): (WebCore::InspectorCSSAgent::detectOrigin): * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyleSheet::buildObjectForRule): 2020-05-13 Yusuke Suzuki <ysuzuki@apple.com> JSDOMWindowBase m_windowCloseWatchpoints must be Ref<> https://bugs.webkit.org/show_bug.cgi?id=211844 Reviewed by Mark Lam. JSDOMWindowBase::m_windowCloseWatchpoints is WatchpointSet, not Ref<WatchpointSet>. And it is passed to JSC IC layer via PropertySlot::setWatchpoint(...). And ProxyableAccessCase can hold it as `RefPtr<WatchpointSet> m_additionalSet;`, this is wrong. This patch hides WatchpointSet constructor behind `protected` to disallow non Ref<> WatchpointSet construction. We made it `protected` since InferredValueWatchpointSet inherits WatchpointSet and uses this constructor. Possibly, this does not matter: ProxyableAccessCase keeps Structure, which points to JSDOMWindowBase. So, it would not happen that ProxyableAccessCase has a wrong pointer to WatchpointSet since JSDOMWindowBase is kept alive anyway. But avoid using RefCounted objects without RefCount allocation is better since this can cause bugs easily. * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::JSDOMWindowBase): (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow): * bindings/js/JSDOMWindowBase.h: * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::getOwnPropertySlot): 2020-05-13 Jack Lee <shihchieh_lee@apple.com> Nullptr crash in InsertParagraphSeparatorCommand::doApply when the canonical position is uneditable https://bugs.webkit.org/show_bug.cgi?id=211864 <rdar://problem/62982161> Reviewed by Geoffrey Garen. The position returned by positionAvoidingSpecialElementBoundary() is uneditable so we need to check for uneditable insertion position and bail out before calling insertNodeAt to avoid assertion. Test: editing/inserting/insert-img-uneditable-canonical-position-crash.html * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply): 2020-05-13 Jack Lee <shihchieh_lee@apple.com> Nullptr crash in DeleteSelectionCommand::doApply() when merge node is disconnected. https://bugs.webkit.org/show_bug.cgi?id=211793 <rdar://problem/62993645> Reviewed by Geoffrey Garen. Check for disconnected merge destination and endingSelection() after mergeParagraph is Called and bail out to avoid using corrupted positions for node insertion. Test: editing/inserting/insert-text-merge-node-removed-crash.html * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::mergeParagraphs): 2020-05-13 Said Abou-Hallawa <sabouhallawa@apple.com> Re-enable 'OutsideViewport' rAF throttling https://bugs.webkit.org/show_bug.cgi?id=211482 Reviewed by Darin Adler. Test: fast/animation/request-animation-frame-throttling-outside-viewport.html Make preferredFrameInterval return AggressiveThrottlingAnimationInterval if the OutsideViewport throttling reason exists. Add an internal setting for enabling 'OutsideViewport' rAF throttling. It is on by default but it is off by default for DRT and WTR. An Internals API is added to enable it for specific tests which want to test its functionality. * page/FrameView.cpp: (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState): * page/Page.cpp: (WebCore::Page::setOutsideViewportThrottlingEnabledForTesting): * page/Page.h: (WebCore::Page::canUpdateThrottlingReason const): * platform/graphics/AnimationFrameRate.h: (WebCore::preferredFrameInterval): (WebCore::operator<<): * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::setOutsideViewportThrottlingEnabled): * testing/Internals.h: * testing/Internals.idl: 2020-05-13 Andres Gonzalez <andresg_22@apple.com> Remove unnecessary assert in {WebAccessibilityObjectWrapper attachmentView]. https://bugs.webkit.org/show_bug.cgi?id=211857 Reviewed by Chris Fleizach. This assert is unnecessary since the backing object that is relevant is the one on the main thread. This was causing crashes in LayoutTest in isolated tree mode. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper attachmentView]): 2020-05-13 Jer Noble <jer.noble@apple.com> Replace isNullFunctionPointer with real weak-linking support https://bugs.webkit.org/show_bug.cgi?id=211751 Reviewed by Sam Weinig. Use the new WTF_WEAK_LINK_FORCE_IMPORT macro. * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProvider::webRTCAvailable): 2020-05-13 Andres Gonzalez <andresg_22@apple.com> Implementation of AXIsolatedObject::hasBoldFont and hasItalicFont. https://bugs.webkit.org/show_bug.cgi?id=211858 Reviewed by Chris Fleizach. Added hasBoldFont and hasItalicFont to the cached properties map. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): Added properties to cache. (WebCore::AXIsolatedObject::hasBoldFont const): Deleted. Inlined in header. (WebCore::AXIsolatedObject::hasItalicFont const): Deleted. Inlined in header. * accessibility/isolatedtree/AXIsolatedObject.h: 2020-05-13 Tim Horton <timothy_horton@apple.com> Add SPI for reverting to touch events for iPad trackpad interactions https://bugs.webkit.org/show_bug.cgi?id=211824 <rdar://problem/61363084> Reviewed by Megan Gardner. * loader/DocumentLoader.h: (WebCore::DocumentLoader::mouseEventPolicy const): (WebCore::DocumentLoader::setMouseEventPolicy): 2020-05-13 Kenneth Russell <kbr@chromium.org> Bad flicker on three.js example https://bugs.webkit.org/show_bug.cgi?id=183151 Reviewed by Dean Jackson. With preserveDrawingBuffer:true and antialias:false, allocate an intermediate texture and FBO, and blit from it to the destination texture in prepareTexture(). Use wipeAlphaChannelFromPixels on iOS as well as macOS. In addition to fixing the test case from the bug, this also fixes the webgl/2.0.0/conformance2/textures/webgl_canvas/ layout tests, which will be re-enabled in a subsequent patch. It also passes the more stringent webgl_canvas conformance tests in https://github.com/KhronosGroup/WebGL/pull/3071 . * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::readPixelsAndConvertToBGRAIfNecessary): (WebCore::GraphicsContextGLOpenGL::reshapeFBOs): (WebCore::GraphicsContextGLOpenGL::resolveMultisamplingIfNecessary): (WebCore::GraphicsContextGLOpenGL::readPixels): (WebCore::GraphicsContextGLOpenGL::validateDepthStencil): (WebCore::GraphicsContextGLOpenGL::prepareTexture): (WebCore::GraphicsContextGLOpenGL::reshape): * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: 2020-05-13 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] "Copy" context menu action for attachment element does not work in Mail https://bugs.webkit.org/show_bug.cgi?id=211817 <rdar://problem/58043110> Reviewed by Tim Horton. Minor refactoring to help support writing attachment data to the pasteboard when using context menu actions to copy an attachment element on iOS. See below for more details, as well as the WebKit ChangeLog entry. Test: WKAttachmentTestsIOS.CopyAttachmentUsingElementAction * editing/Editor.cpp: (WebCore::Editor::platformContentTypeForBlobType const): (WebCore::Editor::promisedAttachmentInfo): Move promisedAttachmentInfo out of DragController and into Editor, so that it is accessible outside of drag and drop code. * editing/Editor.h: * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::platformContentTypeForBlobType const): Move this private helper function out of DragController as well, and into Editor. * page/DragClient.h: * page/DragController.cpp: (WebCore::DragController::startDrag): Refactor this to use Editor::promisedAttachmentInfo(). (WebCore::DragController::platformContentTypeForBlobType const): Deleted. (WebCore::DragController::promisedAttachmentInfo): Deleted. * page/DragController.h: * page/mac/DragControllerMac.mm: (WebCore::DragController::platformContentTypeForBlobType const): Deleted. 2020-05-13 Antoine Quint <graouts@apple.com> [Web Animations] Calling reverse() on an accelerated animation has no effect https://bugs.webkit.org/show_bug.cgi?id=204717 <rdar://problem/62503582> Reviewed by Dean Jackson. Test: webanimations/accelerated-animation-playback-rate.html We completely ignored the playbackRate set on a WebAnimation object when considering whether we could run an accelerated animation. To address this we do several things. First, we now add a playbackRate() on Animation objects such that we can make GraphicsLayerCA aware of the originating WebAnimation's playback rate and use this data to opt out of running CA animations for animations with a playbackRate other than 1 in GraphicsLayerCA::animationCanBeAccelerated(). We'll be looking to add support for variable playback rates for CA animations in https://bugs.webkit.org/show_bug.cgi?id=211839. Then, we make sure to completely replace an accelerated animation whenever one of the properties affected timing would change. Up until now we would onyl do this for a change in the effective currentTime, but this needs to also happen when the current time doesn't change but the animation may have changed playback rate or any of its timing properties that could change the duration of the animation. So we remove the "Seek" command and instead use an "UpdateTiming" command that will remove the existing animation and add a new one. This allows us to remove any notion of seeking in GraphicsLayer since now we'll just create a new animation when its timing attributes changed. This revealed an issue where if we called animationFinished() and startAnimation() on a RenderLayerModelObject in succession, theanimation removal would not occur on the GraphicsLayerCA because we disregarded any pending accelerated action for an animation we knew would be replaced. We now ensure we honor the removal in GraphicsLayerCA::appendToUncommittedAnimations(). * animation/AnimationEffect.cpp: (WebCore::AnimationEffect::updateTiming): * animation/AnimationEffect.h: * animation/CSSAnimation.cpp: (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation): * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::addPendingAcceleratedAction): (WebCore::KeyframeEffect::animationDidChangeTimingProperties): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): (WebCore::KeyframeEffect::animationDidSeek): Deleted. * animation/KeyframeEffect.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::effectTimingDidChange): (WebCore::WebAnimation::setCurrentTime): (WebCore::WebAnimation::setPlaybackRate): (WebCore::WebAnimation::updatePlaybackRate): (WebCore::WebAnimation::reverse): * animation/WebAnimation.h: * platform/animation/Animation.h: (WebCore::Animation::playbackRate const): (WebCore::Animation::setPlaybackRate): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::pauseAnimation): (WebCore::GraphicsLayer::seekAnimation): Deleted. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::animationCanBeAccelerated const): (WebCore::GraphicsLayerCA::updateAnimations): (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): (WebCore::GraphicsLayerCA::seekAnimation): Deleted. (WebCore::GraphicsLayerCA::seekCAAnimationOnLayer): Deleted. * platform/graphics/ca/GraphicsLayerCA.h: * rendering/RenderElement.h: (WebCore::RenderElement::animationPaused): (WebCore::RenderElement::animationSeeked): Deleted. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::animationSeeked): Deleted. * rendering/RenderLayerBacking.h: * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::animationSeeked): Deleted. * rendering/RenderLayerModelObject.h: 2020-05-13 Antti Koivisto <antti@apple.com> [Wheel event region] Debug overlay https://bugs.webkit.org/show_bug.cgi?id=211850 Reviewed by Simon Fraser. This is tied to the existing Wheel event handler overlay debug flag. * platform/graphics/Color.cpp: (WebCore::makeRGB): Deleted. (WebCore::makeRGBA): Deleted. * platform/graphics/Color.h: (WebCore::makeRGB): (WebCore::makeRGBA): Make constexpr. * rendering/EventRegion.cpp: (WebCore::EventRegion::eventListenerRegionForType const): * rendering/EventRegion.h: * rendering/RenderLayerBacking.cpp: (WebCore::patternForDescription): Factor into a function. (WebCore::patternForTouchAction): (WebCore::patternForEventListenerRegionType): (WebCore::RenderLayerBacking::paintDebugOverlays): (WebCore::RenderLayerBacking::paintContents): 2020-05-13 Antoine Quint <graouts@apple.com> [Web Animations] Fix refactoring issue with animation suspension following r261336 https://bugs.webkit.org/show_bug.cgi?id=211842 <rdar://problem/63118326> Reviewed by Dean Jackson. We moved up the suspension code up from DocumentTimeline to DocumentTimelinesController in r261336 and forgot to move the code that set the initial suspension state from the DocumentTimeline constructor to the DocumentTimelinesController constructor. This is problematic because the suspension state is only recorded on DocumentTimelinesController itself. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::DocumentTimeline): * animation/DocumentTimelinesController.cpp: (WebCore::DocumentTimelinesController::DocumentTimelinesController): (WebCore::DocumentTimelinesController::addTimeline): 2020-05-13 Simon Fraser <simon.fraser@apple.com> composited scrolling interferes with the propagation of perspective https://bugs.webkit.org/show_bug.cgi?id=156435 <rdar://problem/25642222> Reviewed by Antti Koivisto. When we made RenderLayerBacking-internal layers for composited scrolling (m_scrollContainerLayer, m_scrolledContentsLayer) we'd lose the effects of the sublayer transform, which was applied to the primary layer, causing perspective on the scroller to not propagate to transformed descendants. Fix by moving the sublayer transform to the scroll container layer (adjusting the perspective matrix as appropriate), and making the scrolled contents layer a "preserve3D" layer so that it doesn't flatten. This fixes both macOS and iOS. Test: compositing/transforms/perspective-with-scrolling.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateChildrenTransformAndAnchorPoint): 2020-05-13 Youenn Fablet <youenn@apple.com> Allow WebAudioBufferList to dynamically change its number of frames https://bugs.webkit.org/show_bug.cgi?id=211720 Reviewed by Eric Carlson. We sometimes create WebAudioBufferList on the stack which triggers allocation of several vectors. Instead of doing that for every audio sample chunk, we should allocate the WebAudioBufferList and resize it as necessary. For that purpose, we introduce WebAudioBufferList::updateWithNumberOfFrames and use it in two places: - When creating an audio track into WebAudio. - When receiving audio chunks from another process. Covered by existing tests. * Modules/webaudio/MediaStreamAudioSource.cpp: (WebCore::MediaStreamAudioSource::~MediaStreamAudioSource): * Modules/webaudio/MediaStreamAudioSource.h: * Modules/webaudio/MediaStreamAudioSourceCocoa.cpp: (WebCore::streamDescription): (WebCore::MediaStreamAudioSource::consumeAudio): * platform/audio/cocoa/WebAudioBufferList.cpp: (WebCore::WebAudioBufferList::WebAudioBufferList): (WebCore::WebAudioBufferList::updateWithNumberOfFrames): (WebCore::WebAudioBufferList::channelCount const): * platform/audio/cocoa/WebAudioBufferList.h: * platform/mediastream/mac/MockAudioSharedUnit.mm: (WebCore::MockAudioSharedUnit::reconfigure): Drive-by fix, we do not need to give the size in bytes but the size in samples. 2020-05-13 Andres Gonzalez <andresg_22@apple.com> Check for accessibilityEnabled() before posting notifications asynchronously. https://bugs.webkit.org/show_bug.cgi?id=211848 Reviewed by Chris Fleizach. Covered by multiple tests. Fixes crashes in LayoutTests in isolated tree mode. During LayoutTests, accessibility may be disabled between the time the notifications are queued and the timer fires. Thus it is necessary to check for accessibilityEnabled() before posting the notifications asynchronously. Not doing so was causing crashes in isolated mode. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::notificationPostTimerFired): 2020-05-13 Simon Fraser <simon.fraser@apple.com> The perspective matrix is affected by overflow:hidden on a box with borders https://bugs.webkit.org/show_bug.cgi?id=211828 Reviewed by Zalan Bujtas. For a box with non-uniform borders, the layer created for overflow:hidden is not centered in its parent layer. However, we push the childrenTransform onto this clipping layer, so that transform needs to be adjusted to account for the geometry of the clipping layer. Test: compositing/transforms/perspective-with-clipping.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::perspectiveTransform const): * rendering/RenderLayerBacking.cpp: (WebCore::scrollContainerLayerBox): (WebCore::clippingLayerBox): (WebCore::overflowControlsHostLayerBox): (WebCore::RenderLayerBacking::updateChildrenTransformAndAnchorPoint): 2020-05-13 Tomoki Imai <Tomoki.Imai@sony.com> Selected element on Web Inspector is not highlighted with CPU Rendering. https://bugs.webkit.org/show_bug.cgi?id=195933 Reviewed by Devin Rousso. Expose InspectorOverlay::shouldShowOverlay via InspectorController. It's used to determine whether WebPage needs a transparency layer to draw highlight. * inspector/InspectorController.cpp: (WebCore::InspectorController::shouldShowOverlay const): * inspector/InspectorController.h: * inspector/InspectorOverlay.h: 2020-05-13 Zan Dobersek <zdobersek@igalia.com> REGRESSION(r261023): [GTK][WPE] Several WebGL tests are failing https://bugs.webkit.org/show_bug.cgi?id=211338 Reviewed by Dean Jackson. For non-ANGLE-backed WebGL, we are still required to query the internal format of the target texture for the texture sub-image commands. Falling back to that behavior on !USE(ANGLE) removes regressions in a bunch of WebGL tests. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texImageSourceHelper): (WebCore::WebGLRenderingContextBase::texImageArrayBufferViewHelper): 2020-05-13 Carlos Garcia Campos <cgarcia@igalia.com> Unreviewed. Fix GTK debug build after r261554 Remove writeToClipboard that receives a const SelectionData& that is no longer used. Make readBufferFromClipboard pure virtual and remove the GTK leftovers from PlatformPasteboard. * platform/PasteboardStrategy.h: * platform/PlatformPasteboard.h: 2020-05-13 Antti Koivisto <antti@apple.com> [Wheel event region] Add support for getting wheel event region from ScrollingTree https://bugs.webkit.org/show_bug.cgi?id=211785 Reviewed by Simon Fraser. Add ScrollingTree::eventListenerRegionTypesForPoint. It is not used yet. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::eventListenerRegionTypesForPoint const): * page/scrolling/ScrollingTree.h: * page/scrolling/mac/ScrollingTreeMac.h: * page/scrolling/mac/ScrollingTreeMac.mm: (collectDescendantLayersAtPoint): (ScrollingTreeMac::eventListenerRegionTypesForPoint const): * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::eventRegionContainsPoint const): Deleted. * rendering/EventRegion.cpp: (WebCore::EventRegion::eventListenerRegionTypesForPoint const): * rendering/EventRegion.h: 2020-05-12 Alex Christensen <achristensen@webkit.org> Give some NetworkLoadMetrics to WebCoreNSURLSession's delegate https://bugs.webkit.org/show_bug.cgi?id=211759 <rdar://problem/62909440> Reviewed by Jer Noble. This required packaging the fetchStart time with the rest of the time deltas, passing a const NetworkLoadMetrics& down to the media loader, and packaging the data up in an ObjC object that pretends to be NSURLSessionTaskMetrics, just like WebCoreNSURLSession pretends to be an NSURLSession. I manually verified the NSDates are correct. This is not straightforward to automate tests for because of the inherant dynamic nature of timing data, and because our other WebCoreNSURLSession tests use WebKitLegacy, and that approach won't work here because we are only hooking up data from NSURLSession, which is only used in modern WebKit. * Modules/beacon/NavigatorBeacon.cpp: (WebCore::NavigatorBeacon::notifyFinished): * Modules/beacon/NavigatorBeacon.h: * bindings/js/CachedModuleScriptLoader.cpp: (WebCore::CachedModuleScriptLoader::notifyFinished): * bindings/js/CachedModuleScriptLoader.h: * dom/LoadableClassicScript.cpp: (WebCore::LoadableClassicScript::notifyFinished): * dom/LoadableClassicScript.h: * html/HTMLImageLoader.cpp: (WebCore::HTMLImageLoader::notifyFinished): * html/HTMLImageLoader.h: * html/ImageDocument.cpp: (WebCore::ImageDocument::finishedParsing): * loader/ApplicationManifestLoader.cpp: (WebCore::ApplicationManifestLoader::notifyFinished): * loader/ApplicationManifestLoader.h: * loader/CrossOriginPreflightChecker.cpp: (WebCore::CrossOriginPreflightChecker::notifyFinished): * loader/CrossOriginPreflightChecker.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::notifyFinished): * loader/DocumentLoader.h: * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::notifyFinished): * loader/DocumentThreadableLoader.h: * loader/ImageLoader.cpp: (WebCore::ImageLoader::notifyFinished): * loader/ImageLoader.h: * loader/LinkLoader.cpp: (WebCore::LinkLoader::notifyFinished): * loader/LinkLoader.h: * loader/LinkPreloadResourceClients.h: * loader/MediaResourceLoader.cpp: (WebCore::MediaResource::notifyFinished): * loader/MediaResourceLoader.h: * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didReceiveResponse): (WebCore::SubresourceLoader::didFinishLoading): * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::notifyFinished): * loader/TextTrackLoader.h: * loader/appcache/ApplicationCacheResourceLoader.cpp: (WebCore::ApplicationCacheResourceLoader::responseReceived): (WebCore::ApplicationCacheResourceLoader::notifyFinished): * loader/appcache/ApplicationCacheResourceLoader.h: * loader/cache/CachedApplicationManifest.cpp: (WebCore::CachedApplicationManifest::finishLoading): * loader/cache/CachedApplicationManifest.h: * loader/cache/CachedCSSStyleSheet.cpp: (WebCore::CachedCSSStyleSheet::finishLoading): (WebCore::CachedCSSStyleSheet::checkNotify): * loader/cache/CachedCSSStyleSheet.h: * loader/cache/CachedFont.cpp: (WebCore::CachedFont::finishLoading): (WebCore::CachedFont::checkNotify): * loader/cache/CachedFont.h: * loader/cache/CachedImage.cpp: (WebCore::CachedImage::finishLoading): * loader/cache/CachedImage.h: * loader/cache/CachedRawResource.cpp: (WebCore::CachedRawResource::updateBuffer): (WebCore::CachedRawResource::finishLoading): * loader/cache/CachedRawResource.h: * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): (WebCore::CachedResource::checkNotify): (WebCore::CachedResource::finishLoading): (WebCore::CachedResource::error): (WebCore::CachedResource::cancelLoad): (WebCore::CachedResource::didAddClient): * loader/cache/CachedResource.h: * loader/cache/CachedResourceClient.h: (WebCore::CachedResourceClient::notifyFinished): * loader/cache/CachedSVGDocument.cpp: (WebCore::CachedSVGDocument::finishLoading): * loader/cache/CachedSVGDocument.h: * loader/cache/CachedScript.cpp: (WebCore::CachedScript::finishLoading): * loader/cache/CachedScript.h: * loader/cache/CachedTextTrack.cpp: (WebCore::CachedTextTrack::finishLoading): * loader/cache/CachedTextTrack.h: * loader/cache/CachedXSLStyleSheet.cpp: (WebCore::CachedXSLStyleSheet::finishLoading): (WebCore::CachedXSLStyleSheet::checkNotify): * loader/cache/CachedXSLStyleSheet.h: * loader/cache/KeepaliveRequestTracker.cpp: (WebCore::KeepaliveRequestTracker::notifyFinished): * loader/cache/KeepaliveRequestTracker.h: * loader/icon/IconLoader.cpp: (WebCore::IconLoader::notifyFinished): * loader/icon/IconLoader.h: * platform/graphics/PlatformMediaResourceLoader.h: (WebCore::PlatformMediaResourceClient::loadFinished): * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: (WebCore::CachedResourceMediaLoader::notifyFinished): * platform/network/NetworkLoadMetrics.h: (WebCore::NetworkLoadMetrics::isolatedCopy const): (WebCore::NetworkLoadMetrics::operator== const): (WebCore::NetworkLoadMetrics::encode const): (WebCore::NetworkLoadMetrics::decode): (WTF::Persistence::Coder<Optional<WebCore::NetworkLoadPriority>>::encode): Deleted. (WTF::Persistence::Coder<Optional<WebCore::NetworkLoadPriority>>::decode): Deleted. * platform/network/cocoa/NetworkLoadMetrics.mm: (WebCore::copyTimingData): * platform/network/cocoa/WebCoreNSURLSession.mm: (networkLoadMetricsDate): (-[WebCoreNSURLSessionTaskTransactionMetrics _initWithMetrics:]): (-[WebCoreNSURLSessionTaskTransactionMetrics fetchStartDate]): (-[WebCoreNSURLSessionTaskTransactionMetrics domainLookupStartDate]): (-[WebCoreNSURLSessionTaskTransactionMetrics domainLookupEndDate]): (-[WebCoreNSURLSessionTaskTransactionMetrics connectStartDate]): (-[WebCoreNSURLSessionTaskTransactionMetrics secureConnectionStartDate]): (-[WebCoreNSURLSessionTaskTransactionMetrics connectEndDate]): (-[WebCoreNSURLSessionTaskTransactionMetrics requestStartDate]): (-[WebCoreNSURLSessionTaskTransactionMetrics responseStartDate]): (-[WebCoreNSURLSessionTaskTransactionMetrics responseEndDate]): (-[WebCoreNSURLSessionTaskMetrics _initWithMetrics:]): (-[WebCoreNSURLSessionTaskMetrics transactionMetrics]): (WebCore::WebCoreNSURLSessionDataTaskClient::loadFinished): (-[WebCoreNSURLSessionDataTask _finish]): (-[WebCoreNSURLSessionDataTask _resource:loadFinishedWithError:metrics:]): (-[WebCoreNSURLSessionDataTask resource:accessControlCheckFailedWithError:]): (-[WebCoreNSURLSessionDataTask resource:loadFailedWithError:]): (-[WebCoreNSURLSessionDataTask resourceFinished:metrics:]): (-[WebCoreNSURLSessionDataTask _resource:loadFinishedWithError:]): Deleted. (-[WebCoreNSURLSessionDataTask resourceFinished:]): Deleted. * rendering/RenderElement.cpp: (WebCore::RenderElement::notifyFinished): * rendering/RenderElement.h: * rendering/RenderImage.cpp: (WebCore::RenderImage::notifyFinished): * rendering/RenderImage.h: * rendering/RenderLayerFilters.cpp: (WebCore::RenderLayerFilters::notifyFinished): * rendering/RenderLayerFilters.h: * svg/SVGFEImageElement.cpp: (WebCore::SVGFEImageElement::notifyFinished): * svg/SVGFEImageElement.h: * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::notifyFinished): * svg/SVGUseElement.h: 2020-05-12 Said Abou-Hallawa <sabouhallawa@apple.com> [CG] Change the UTI of the "WebP" image to be "org.webmproject.webp" https://bugs.webkit.org/show_bug.cgi?id=211794 <rdar://problem/63031187> Reviewed by Darin Adler. See https://developers.google.com/speed/webp/docs/riff_container. * platform/graphics/cg/UTIRegistry.cpp: (WebCore::defaultSupportedImageTypes): Fix review comments from bug 208038. 2020-05-12 Simon Fraser <simon.fraser@apple.com> Move perspective-setting code into its own function https://bugs.webkit.org/show_bug.cgi?id=211812 Reviewed by Zalan Bujtas. Move the code that updates anchor point and children transform (for perspective) into its own function. No behavior change. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateChildrenTransformAndAnchorPoint): (WebCore::computeOffsetFromAncestorGraphicsLayer): (WebCore::RenderLayerBacking::updateGeometry): * rendering/RenderLayerBacking.h: 2020-05-12 Jiewen Tan <jiewen_tan@apple.com> [WebAuthn] Don't assume extensions always exist https://bugs.webkit.org/show_bug.cgi?id=211760 <rdar://problem/61217642> Reviewed by Brent Fulgham. * Modules/webauthn/fido/U2fCommandConstructor.cpp: (fido::processGoogleLegacyAppIdSupportExtension): 2020-05-12 Jer Noble <jer.noble@apple.com> [iOS] REGRESSION: (r261342) Play/pause button doesn't work upon first entering fullscreen mode https://bugs.webkit.org/show_bug.cgi?id=211797 <rdar://problem/63118008> Reviewed by Eric Carlson. In r261342 we added code to handle "canplay" and "waiting" events without ever actually adding event listeners for them. So when we enter fullscreen before the "canplay" event, we never re-evaluate whether we're playing or not. Drive-by fix: Also noticed that stalls will cause the play/pause toggle to switch from the "pause icon" to the "play icon", which is incorrect; we're still "playing" event when we're stalled. So when we are in the stalled state, set the "playbackRate" property to some very small, but non-zero value. This will cause the playback slider to stop progressing, but won't also cause the play/pause button to swap states. * platform/cocoa/PlaybackSessionModelMediaElement.mm: (WebCore::PlaybackSessionModelMediaElement::updateForEventName): (WebCore::PlaybackSessionModelMediaElement::observedEventNames): 2020-05-12 Chris Dumez <cdumez@apple.com> [WK2] Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API https://bugs.webkit.org/show_bug.cgi?id=211808 Reviewed by Darin Adler. Neuter WKFrameIsFrameSet() / WKPageGetFrameSetLargestFrame() C API. This is only SPI and is only used for slightly different printing behavior in Safari. Framesets are no longer supported in HTML5 and are now super rare. Support for this C API adds quite a bit of code complexity and crashes such as <rdar://problem/60322282>, it just does not seem worth it anymore. * dom/Document.cpp: (WebCore::Document::resume): * html/HTMLFrameSetElement.cpp: (WebCore::HTMLFrameSetElement::insertedIntoAncestor): (WebCore::HTMLFrameSetElement::removedFromAncestor): * loader/EmptyFrameLoaderClient.h: * loader/FrameLoaderClient.h: 2020-05-12 Simon Fraser <simon.fraser@apple.com> Clean up some transformOrigin and perspectiveOrigin code https://bugs.webkit.org/show_bug.cgi?id=211807 Reviewed by Zalan Bujtas. Add LengthPoint and LengthSize-based "value for length" functions so we can do point and size math as we do for LayoutPoint/FloatPoint etc. Use them in code that computes transform and perspective origins. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const): * css/LengthFunctions.cpp: (WebCore::sizeForLengthSize): (WebCore::pointForLengthPoint): (WebCore::floatPointForLengthPoint): * css/LengthFunctions.h: * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::computeTransformedExtentViaTransformList const): * platform/Length.h: * platform/LengthPoint.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::perspectiveTransform const): (WebCore::RenderLayer::perspectiveOrigin const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::computeTransformOriginForPainting const): * rendering/style/BasicShapes.cpp: (WebCore::BasicShapeInset::path): (WebCore::floatSizeForLengthSize): Deleted. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::applyTransform const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::transformOriginXY const): Explicitly "xy" because it excludes the z component. (WebCore::RenderStyle::perspectiveOrigin const): * rendering/style/StyleRareNonInheritedData.h: (WebCore::StyleRareNonInheritedData::perspectiveOrigin const): * rendering/style/StyleTransformData.h: (WebCore::StyleTransformData::originXY const): 2020-05-12 Michael Catanzaro <mcatanzaro@gnome.org> -Wattribute warning in BreakLines.cpp https://bugs.webkit.org/show_bug.cgi?id=211784 Reviewed by Darin Adler. Remove export attribute. These only work in header files. * rendering/BreakLines.cpp: 2020-05-12 Eric Carlson <eric.carlson@apple.com> Poster set after playback begins should be ignored https://bugs.webkit.org/show_bug.cgi?id=211464 <rdar://problem/62605114> Reviewed by Darin Adler. Test: media/video-poster-set-after-playback.html * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::parseAttribute): Ignore `poster` changes after first video frame is available. (WebCore::HTMLVideoElement::updateDisplayState): Set mode to Video if the first video frame is available. * testing/Internals.cpp: (WebCore::Internals::elementShouldDisplayPosterImage const): * testing/Internals.h: * testing/Internals.idl: 2020-05-12 Simon Fraser <simon.fraser@apple.com> Perpective origin should be relative to the reference box https://bugs.webkit.org/show_bug.cgi?id=211769 Reviewed by Zalan Bujtas. Use the reference box <https://drafts.csswg.org/css-transforms-1/#reference-box> when computing perspective-origin <https://drafts.csswg.org/css-transforms-2/#perspective-origin-property>, adding a referenceBox() helper on RenderBox. The code to compute the perspective transform is wrong; for now, fudge it by passing in the border box, but this code needs to account for GraphicsLayer geometry and transform-origin in future (webkit.org/b/211787). Test: compositing/transforms/perspective-transform-box.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::nodeAtPoint): * rendering/RenderBox.cpp: (WebCore::RenderBox::referenceBox const): * rendering/RenderBox.h: * rendering/RenderLayer.cpp: (WebCore::computeReferenceRectFromBox): (WebCore::computeReferenceBox): (WebCore::RenderLayer::updateTransform): (WebCore::RenderLayer::currentTransform const): (WebCore::RenderLayer::perspectiveTransform const): (WebCore::RenderLayer::computeClipPath const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): 2020-05-12 Ross Kirsling <ross.kirsling@sony.com> Unreviewed PlayStation / clang-cl build fix following r261533. Apparently r261572 only caught half of the cases. * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::estimateSize): * bindings/js/IDBBindingUtilities.cpp: (WebCore::generateIndexKeyMapForValue): 2020-05-12 Myles C. Maxfield <mmaxfield@apple.com> Text is clipped when rendered with fonts which have a negative line gap metric https://bugs.webkit.org/show_bug.cgi?id=211683 <rdar://problem/62192986> Reviewed by Zalan Bujtas. ... As seen on nytimes.com. Some fonts have negative line gap metrics. Chrome and Firefox both clamp it to 0, so the line-height isn't decreased. However, we were honoring the negative line gap, thereby decreasing line-height. There are some typographical reasons to want a negative line gap, which is why this clamping behavior shouldn't be done in the platform text library. In the interest of matching other browsers, we should perform this clamping ourselves in WebKit. Test: fast/text/negative-line-gap.html * platform/graphics/Font.cpp: (WebCore::Font::platformGlyphInit): 2020-05-12 Ross Kirsling <ross.kirsling@sony.com> Unreviewed PlayStation / clang-cl build fix following r261533. clang for Windows (< v10.0.0) cannot destructure a const class. See also r254471, r249524, etc. * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord): * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord): 2020-05-12 Ross Kirsling <ross.kirsling@sony.com> Unreviewed PlayStation build fix following r261494. * PlatformPlayStation.cmake: 2020-05-12 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Rework drag and drop handling in preparation for GTK4 https://bugs.webkit.org/show_bug.cgi?id=211723 Reviewed by Adrian Perez de Castro. Remove PasteboardHelper that is no longer used and add conversion functions to GtkUtilities. * PlatformGTK.cmake: * SourcesGTK.txt: * platform/gtk/GtkUtilities.cpp: (WebCore::gdkDragActionToDragOperation): (WebCore::dragOperationToGdkDragActions): (WebCore::dragOperationToSingleGdkDragAction): * platform/gtk/GtkUtilities.h: * platform/gtk/PasteboardHelper.cpp: Removed. * platform/gtk/PasteboardHelper.h: Removed. 2020-05-12 Jacob Uphoff <jacob_uphoff@apple.com> Unreviewed, reverting r261557. This commit caused testing to exit early due to too many crashes on macOS Catalina Asan Reverted changeset: "Allow WebAudioBufferList to dynamically change its number of frames" https://bugs.webkit.org/show_bug.cgi?id=211720 https://trac.webkit.org/changeset/261557 2020-05-12 Simon Fraser <simon.fraser@apple.com> Speculative fix for crash in ScrollingTree::handleWheelEvent() https://bugs.webkit.org/show_bug.cgi?id=211763 <rdar://problem/62926117> Reviewed by Andy Estes. Crash data shows a null-deref crash in ScrollingTree::handleWheelEvent() which is most likely because m_rootNode is null. Protect against this. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::handleWheelEvent): 2020-05-12 Youenn Fablet <youenn@apple.com> Allow WebAudioBufferList to dynamically change its number of frames https://bugs.webkit.org/show_bug.cgi?id=211720 Reviewed by Eric Carlson. We sometimes create WebAudioBufferList on the stack which triggers allocation of several vectors. Instead of doing that for every audio sample chunk, we should allocate the WebAudioBufferList and resize it as necessary. For that purpose, we introduce WebAudioBufferList::updateWithNumberOfFrames and use it in two places: - When creating an audio track into WebAudio. - When receiving audio chunks from another process. Covered by existing tests. * Modules/webaudio/MediaStreamAudioSource.cpp: (WebCore::MediaStreamAudioSource::~MediaStreamAudioSource): * Modules/webaudio/MediaStreamAudioSource.h: * Modules/webaudio/MediaStreamAudioSourceCocoa.cpp: (WebCore::streamDescription): (WebCore::MediaStreamAudioSource::consumeAudio): * platform/audio/cocoa/WebAudioBufferList.cpp: (WebCore::WebAudioBufferList::WebAudioBufferList): (WebCore::WebAudioBufferList::updateWithNumberOfFrames): (WebCore::WebAudioBufferList::channelCount const): * platform/audio/cocoa/WebAudioBufferList.h: 2020-05-12 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Rework clipboard handling in preparation for GTK4 https://bugs.webkit.org/show_bug.cgi?id=211511 Reviewed by Adrian Perez de Castro. Remove PlatformPasteboard implementation that has been replaced by Clipboard class in the WebKit layer. When Pasteboard class is created for copy and paste operations, it no longer has a SelectionData member, it just uses the new methods in the pasteboard strategy to communicate with the clipboard. WebContentReader has now an implementation for GTK and it's used when reading from the clipboard, the same way it's done in other ports. * SourcesGTK.txt: * editing/WebContentReader.h: * editing/gtk/EditorGtk.cpp: (WebCore::Editor::pasteWithPasteboard): Use webContentFromPasteboard(). (WebCore::Editor::webContentFromPasteboard): Use WebContentReader. * editing/gtk/WebContentReaderGtk.cpp: Added. (WebCore::WebContentReader::readFilePath): (WebCore::WebContentReader::readFilePaths): (WebCore::WebContentReader::readHTML): (WebCore::WebContentReader::readPlainText): (WebCore::WebContentReader::readImage): (WebCore::WebContentReader::readURL): (WebCore::WebContentMarkupReader::readHTML): * platform/Pasteboard.h: (WebCore::PasteboardWebContentReader::readDataBuffer): * platform/PasteboardStrategy.h: * platform/gtk/PasteboardGtk.cpp: (WebCore::Pasteboard::Pasteboard): (WebCore::Pasteboard::selectionData const): (WebCore::Pasteboard::writeString): (WebCore::Pasteboard::writePlainText): (WebCore::Pasteboard::write): (WebCore::Pasteboard::clear): (WebCore::Pasteboard::canSmartReplace): (WebCore::Pasteboard::read): (WebCore::Pasteboard::hasData): (WebCore::Pasteboard::typesForLegacyUnsafeBindings): (WebCore::Pasteboard::readString): (WebCore::Pasteboard::fileContentState): * platform/gtk/PasteboardHelper.cpp: * platform/gtk/PasteboardHelper.h: * platform/gtk/PlatformPasteboardGtk.cpp: Removed. * platform/gtk/SelectionData.cpp: (WebCore::SelectionData::setURL): Do not override the text and markup if it has already been set. 2020-05-12 Youenn Fablet <youenn@apple.com> Introduce a RealtimeMediaSource video sample observer https://bugs.webkit.org/show_bug.cgi?id=211718 Reviewed by Eric Carlson. We introduce an observer dedicated to video samples similarly to AudioSampleObserver for audio. This will allow to move video frame processing out of the main thread progressively. For now, we remove video sample observing from the track private and observers should now register directly to the realtime media source. We update the various users, including MediaRecorder and the media player. In both cases, they will only observe the video track to be played/recorded, which is both more efficient and simpler. We introduced RealtimeMediaSource::Observer::hasStartedProducingData callback for MediaStreamTrackPrivate so that the processing to do when the first samples are available can be done on the main thread. MediaStreamTrackPrivate no longer filters out samples if it is not enabled. As such, each consumer is now responsible to observe/unobserve the source when its track gets enabled/disabled similarly as for audio, or do nothing if track is not enabled. Similarly, RealtimeOutgoingVideoSourceCocoa will now only observe video samples when the track is enabled and not muted. Covered by existing tests. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::sampleBufferUpdated): Deleted. * Modules/mediarecorder/MediaRecorder.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): We can renove the track check since we only observe the active video track. (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoSampleAvailable): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated): Deleted. * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::setVideoSource): (WebCore::MediaRecorderPrivate::~MediaRecorderPrivate): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): (WebCore::MediaRecorderPrivateAVFImpl::~MediaRecorderPrivateAVFImpl): (WebCore::MediaRecorderPrivateAVFImpl::videoSampleAvailable): (WebCore::MediaRecorderPrivateAVFImpl::stopRecording): (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated): Deleted. * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::MediaRecorderPrivateMock): (WebCore::MediaRecorderPrivateMock::~MediaRecorderPrivateMock): (WebCore::MediaRecorderPrivateMock::stopRecording): (WebCore::MediaRecorderPrivateMock::videoSampleAvailable): (WebCore::MediaRecorderPrivateMock::sampleBufferUpdated): Deleted. * platform/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::hasStartedProducingData): (WebCore::MediaStreamTrackPrivate::updateReadyState): (WebCore::MediaStreamTrackPrivate::videoSampleAvailable): Deleted. (WebCore::MediaStreamTrackPrivate::hasStartedProducingAudioData): Deleted. * platform/mediastream/MediaStreamTrackPrivate.h: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::addVideoSampleObserver): (WebCore::RealtimeMediaSource::removeVideoSampleObserver): (WebCore::RealtimeMediaSource::updateHasStartedProducingData): (WebCore::RealtimeMediaSource::videoSampleAvailable): (WebCore::RealtimeMediaSource::audioSamplesAvailable): * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::unobserveSource): (WebCore::RealtimeOutgoingVideoSource::updateBlackFramesSending): * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::~RealtimeVideoSource): (WebCore::RealtimeVideoSource::startProducingData): (WebCore::RealtimeVideoSource::stopProducingData): (WebCore::RealtimeVideoSource::videoSampleAvailable): * platform/mediastream/RealtimeVideoSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample): * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: (WebCore::RealtimeOutgoingVideoSourceCocoa::videoSampleAvailable): (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated): Deleted. * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h: * platform/mock/MockRealtimeVideoSource.cpp: * testing/Internals.cpp: (WebCore::Internals::~Internals): (WebCore::Internals::stopObservingRealtimeMediaSource): (WebCore::Internals::observeMediaStreamTrack): * testing/Internals.h: 2020-05-12 Philippe Normand <pnormand@igalia.com> [GStreamer] Audio messages in web.whatsapp.com only play once. https://bugs.webkit.org/show_bug.cgi?id=211627 Reviewed by Xabier Rodriguez-Calvar. Test: media/video-src-blob-replay.html * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::updateDownloadBufferingFlag): Make sure on-disk buffering is disabled for blob URIs, because it messes up the pipeline for replays, and it's useless for that use-case anyway. 2020-05-12 Said Abou-Hallawa <sabouhallawa@apple.com> Need to advertise support for WebP in the Accept header https://bugs.webkit.org/show_bug.cgi?id=211735 Reviewed by Darin Adler. On Mac and iOS, the system has to support WebP: HAVE(WEBP). On other platforms, WebKit has to be able to decode WebP images: USE(WEBP). * css/CSSCalculationValue.cpp: (WebCore::createCSS): Fix unrealted coding style issue. * loader/cache/CachedResourceRequest.cpp: (WebCore::acceptHeaderValueForImageResource): (WebCore::acceptHeaderValueFromType): 2020-05-11 Darin Adler <darin@apple.com> Fix problems caught by replacing WTF::Optional with std::optional https://bugs.webkit.org/show_bug.cgi?id=211703 Reviewed by Chris Dumez. * editing/EditorCommand.cpp: (WebCore::executeSelectToMark): Remove erroneous code that converts a live range to a SimpleRange and then back again. * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::willSendRequest): Pass a pointer to a ResourceRequest. (WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache): Ditto. (WebCore::InspectorNetworkAgent::buildInitiatorObject): Take a const* to a ResourceRequest instead of an Optional<const ResourceRequest&> because std::optional does not work with reference types. * inspector/agents/InspectorNetworkAgent.h: Update for the change above. * layout/floats/FloatingContext.cpp: (WebCore::Layout::Iterator::operator++): Fix code that was accidentally comparing two optionals, after already checking them for null. Instead we should compare their values. * platform/PlatformScreen.cpp: (WebCore::screenData): Return a const* instead of an Optional<const&> because std::optonal does not work with reference types. * platform/PlatformScreen.h: Updated for the above. Also removed both the unneeded include of Optional.h (could have included Forward.h) and of HashMap.h and put the Mac-specific type IORegistryGPUID inside a PLATFORM(MAC) #if statement. * platform/ScreenProperties.h: Moved the HashMap.h include here, since this is the header that uses it. Changed the EncodedColorSpaceDataType enum to an enum class and gave it much shorter names. (WebCore::ScreenData::encode const): Updated for the enum class change. Also fixed a mistake where the code would use operator<< instead of encodeEnum for the color space type of Null. This would lead to some kind of decoding error, rather than a null cgColorSpace. (WebCore::ScreenData::decode): Ditto. * platform/ios/PlatformScreenIOS.mm: (WebCore::screenIsMonochrome): Updated since screenData returns a pointer. (WebCore::screenHasInvertedColors): Ditto. (WebCore::screenSupportsExtendedColor): Ditto. (WebCore::screenSize): Ditto. (WebCore::availableScreenSize): Ditto. * platform/mac/PlatformScreenMac.mm: Moved declaration of CGDisplayUsesForceToGray to CoreGraphicsSPI.h. Removed unused declaration of CGDisplayUsesInvertedPolarity. (WebCore::primaryOpenGLDisplayMask): Updated since screendData returns a pointer. (WebCore::displayMaskForDisplay): Ditto. (WebCore::gpuIDForDisplay): Ditto. (WebCore::screenProperties): Ditto. Also renamed from getScreenProperties to adhere to WebKit coding style. (WebCore::screenIsMonochrome): Ditto. (WebCore::screenHasInvertedColors): Ditto. (WebCore::screenDepth): Ditto. (WebCore::screenDepthPerComponent): Ditto. (WebCore::screenRectForDisplay): Ditto. (WebCore::screenRect): Ditto. (WebCore::screenAvailableRect): Ditto. (WebCore::screenColorSpace): Ditto. (WebCore::screenSupportsExtendedColor): Ditto. (WebCore::screenSupportsHighDynamicRange): Ditto. * workers/service/context/ServiceWorkerThread.cpp: (WebCore::ServiceWorkerThread::queueTaskToFireInstallEvent): Removed capture of unused jobDataIdentifier. 2020-05-11 James Darpinian <jdarpinian@chromium.org> WebGLLayer clobbers TEXTURE_2D binding on iOS https://bugs.webkit.org/show_bug.cgi?id=211758 Reviewed by Dean Jackson. WebGLLayer was accidentally clobbering the TEXTURE_2D binding on iOS because IOSurfaces are bound to TEXTURE_2D instead of TEXTURE_RECTANGLE. This fixes a bunch of iOS-specific WebGL conformance failures including: texture-bindings-unaffected-on-resize.html default-texture.html tex-image-and-sub-image-2d-with-canvas-rgb565.html and friends * platform/graphics/GraphicsContextGL.h: * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer display]): (-[WebGLLayer bindFramebufferToNextAvailableSurface]): 2020-05-11 Simon Fraser <simon.fraser@apple.com> [ macOS ] scrollingcoordinator/mac/latching/scrolling-select-should-not-latch-mainframe.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=211747 Reviewed by Tim Horton. Add an option to monitorWheelEvents to reset latching. * page/Page.cpp: (WebCore::Page::startMonitoringWheelEvents): * page/Page.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::startMonitoringWheelEvents): * page/scrolling/mac/ScrollingCoordinatorMac.h: * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents): * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::monitorWheelEvents): * testing/js/WebCoreTestSupport.h: 2020-05-11 Andres Gonzalez <andresg_22@apple.com> Fixes for crashes in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=211740 Reviewed by Chris Fleizach. Fixes for several LayoutTests in isolated tree mode. * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase attachIsolatedObject:]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]): (-[WebAccessibilityObjectWrapper textMarkerForVisiblePosition:]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]): (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]): 2020-05-11 Simon Fraser <simon.fraser@apple.com> Scrollbars flicker in RTL scrollable regions https://bugs.webkit.org/show_bug.cgi?id=211757 Reviewed by Tim Horton. Scrollbars deal in scroll offsets (zero-based), not scroll positions (scroll-origin based) so the scrolling thread needs to update scrollbar painters using offsets. Not testable because this is a transient state that gets fixed by the main thread. * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters): 2020-05-11 Ben Nham <nham@apple.com> Improve accuracy of IndexedDB estimated write size computation https://bugs.webkit.org/show_bug.cgi?id=211360 Reviewed by Brady Eidson. We currently estimate the size of a put in IndexedDB for quota check purposes with something like: estimatedWriteSize = (1 + numIndices) * (keySize + valueSize) However, this can lead to large overestimates of write sizes. This is because secondary indices only store a mapping of secondary index key => primary key; they do not store the entire value. In the example site attached to 202137 (another DB quota-related bug), the the heuristic estimates that one of the put operations would use more than 800 MB when it actually uses 220 MB. This inaccuracy leads to spurious disk quota permission modals being presented in Safari. This patch improves the write size computation by generating the secondary index keys before estimating the write size. The performance should be about the same since we save the generated index keys for later usage when we actually add the record to the DB. * Headers.cmake: * Modules/indexeddb/server/IDBBackingStore.h: * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: (WebCore::IDBServer::MemoryIDBBackingStore::MemoryIDBBackingStore): (WebCore::IDBServer::MemoryIDBBackingStore::addRecord): (WebCore::IDBServer::MemoryIDBBackingStore::serializationContext): * Modules/indexeddb/server/MemoryIDBBackingStore.h: * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::addRecord): (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord): * Modules/indexeddb/server/MemoryObjectStore.h: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::serializationContext): * Modules/indexeddb/server/SQLiteIDBBackingStore.h: * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::estimateSize): (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd): * Modules/indexeddb/shared/IndexKey.h: * WebCore.xcodeproj/project.pbxproj: * bindings/js/IDBBindingUtilities.cpp: (WebCore::generateIndexKeyMapForValue): * bindings/js/IDBBindingUtilities.h: 2020-05-11 Kate Cheney <katherine_cheney@apple.com> Fail navigations to non app-bound domains after use of app-bound APIs https://bugs.webkit.org/show_bug.cgi?id=211647 <rdar://problem/62978159> Reviewed by Brent Fulgham. Simplified in-app browser privacy protections check into one, better named function. * bindings/js/ScriptController.cpp: (WebCore::ScriptController::executeScriptInWorld): * loader/FrameLoaderClient.h: * page/Frame.cpp: (WebCore::Frame::injectUserScriptImmediately): * page/Page.cpp: (WebCore::Page::injectUserStyleSheet): * page/WebKitNamespace.cpp: (WebCore::WebKitNamespace::messageHandlers): * style/StyleScopeRuleSets.cpp: (WebCore::Style::ScopeRuleSets::initializeUserStyle): Rearranged ordering so the message to WebPageProxy only gets sent to indicate app-bound behavior if user style sheets actually exist. 2020-05-11 Peng Liu <peng.liu6@apple.com> Enable the mock video presentation mode in related layout tests and fix test failures https://bugs.webkit.org/show_bug.cgi?id=211645 Reviewed by Eric Carlson. Revert the unnecessary change in r261493 to fix the build failures when the Picture-in-Picture API is disabled. * html/HTMLVideoElement.cpp: * html/HTMLVideoElement.h: 2020-05-11 Wenson Hsieh <wenson_hsieh@apple.com> Remove some unnecessary indirection when getting Document’s Editor https://bugs.webkit.org/show_bug.cgi?id=211744 Reviewed by Geoffrey Garen. After r261018, there's no longer a need to reach into Document's Frame to get the Editor instance, since Document itself owns the Editor (and Frame's implementation of editor() just calls back into the document anyways). No change in behavior. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (AXAttributeStringSetSpelling): * dom/Document.cpp: (WebCore::Document::setFocusedElement): (WebCore::Document::registerAttachmentIdentifier): (WebCore::Document::didInsertAttachmentElement): (WebCore::Document::didRemoveAttachmentElement): * testing/Internals.cpp: (WebCore::Internals::markerCountForNode): (WebCore::Internals::setMarkedTextMatchesAreHighlighted): (WebCore::Internals::lastSpellCheckRequestSequence): (WebCore::Internals::lastSpellCheckProcessedSequence): (WebCore::Internals::hasSpellingMarker): (WebCore::Internals::hasAutocorrectedMarker): (WebCore::Internals::setContinuousSpellCheckingEnabled): (WebCore::Internals::setAutomaticQuoteSubstitutionEnabled): (WebCore::Internals::setAutomaticLinkDetectionEnabled): (WebCore::Internals::setAutomaticDashSubstitutionEnabled): (WebCore::Internals::setAutomaticTextReplacementEnabled): (WebCore::Internals::setAutomaticSpellingCorrectionEnabled): (WebCore::Internals::handleAcceptedCandidate): (WebCore::Internals::isOverwriteModeEnabled): (WebCore::Internals::toggleOverwriteModeEnabled): (WebCore::Internals::rangeOfString): (WebCore::Internals::countMatchesForText): (WebCore::Internals::hasGrammarMarker): 2020-05-11 Devin Rousso <drousso@apple.com> Web Inspector: show JavaScript Worker name as an internal property https://bugs.webkit.org/show_bug.cgi?id=211708 Reviewed by Timothy Hatcher. Test: inspector/worker/worker-create-and-terminate.html * inspector/WebInjectedScriptHost.cpp: (WebCore::WebInjectedScriptHost::getInternalProperties): * workers/Worker.h: (WebCore::Worker::name const): Added. 2020-05-11 Simon Fraser <simon.fraser@apple.com> Have ScrollingThread use a RunLoop rather than rolling its own https://bugs.webkit.org/show_bug.cgi?id=211730 Reviewed by Darin Adler. ScrollingThread rolled its own runloop/function dispatch by dropping to CF for macOS. Fix to use RunLoop which provides the same functionality. There was also a race creating the ScrollingThread for the first time, since both the main thread, and EventDispatcher can call ScrollingThread::dispatch() early on, so fix with a std::once block. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::singleton): (WebCore::ScrollingThread::dispatch): (WebCore::ScrollingThread::createThreadIfNeeded): (WebCore::ScrollingThread::initializeRunLoop): (WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread): Deleted. (WebCore::ScrollingThread::wakeUpRunLoop): Deleted. (WebCore::ScrollingThread::threadRunLoopSourceCallback): Deleted. * page/scrolling/ScrollingThread.h: (WebCore::ScrollingThread::runLoop): * page/scrolling/mac/ScrollingThreadMac.mm: Removed. 2020-05-11 Peng Liu <peng.liu6@apple.com> Enable the mock video presentation mode in related layout tests and fix test failures https://bugs.webkit.org/show_bug.cgi?id=211645 Reviewed by Darin Adler. Clean up the internal states of video element regarding video presentation mode to simplify the task to write reliable layout tests for video fullscreen and Picture-in-Picture. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::enterFullscreen): Update the states after we are sure the video element will enter fullscreen. (WebCore::HTMLMediaElement::exitFullscreen): Remove the unnecessary "fullscreenModeChanged(VideoFullscreenModeNone)". * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::waitingToEnterFullscreen): * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): The function webkitDisplayingFullscreen() will return true after the process to enter fullscreen is completed. * html/HTMLVideoElement.h: Expose didBecomeFullscreenElement() when VIDEO_PRESENTATION_MODE is enabled. 2020-05-11 Antoine Quint <graouts@apple.com> [Web Animations] Document.getAnimations() should only consider document connection and not timeline association https://bugs.webkit.org/show_bug.cgi?id=211697 Reviewed by Dean Jackson. The Document.getAnimations() function should return any animation running for an element that is a child of the target Document. We now consider all current animations, regardless of which timeline they might be associated with. This lets us pass the final two WPT Document.getAnimations() tests. * dom/Document.cpp: (WebCore::Document::matchingAnimations): 2020-05-11 Andres Gonzalez <andresg_22@apple.com> Add implementation for AXIsolatedObject::elementPath, hasHighlighting, isBlockquote, isKeyboardFocusable. https://bugs.webkit.org/show_bug.cgi?id=211732 Reviewed by Chris Fleizach. Covered by several tests. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isBlockquote const): Moved to base class. * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: (WebCore::AXCoreObject::isBlockquote const): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): Cache the above mentioned properties. (WebCore::AXIsolatedObject::pathAttributeValue const): (WebCore::AXIsolatedObject::isBlockquote const): Moved to base class. (WebCore::AXIsolatedObject::isKeyboardFocusable const): Implemented inline in header. (WebCore::AXIsolatedObject::hasHighlighting const): Implemented inline in header. (WebCore::AXIsolatedObject::elementPath const): Implemented inline in header. * accessibility/isolatedtree/AXIsolatedObject.h: 2020-05-11 Alex Christensen <achristensen@webkit.org> Fix assertion after r261414 https://bugs.webkit.org/show_bug.cgi?id=211731 This fixes a debug assertion that fired 100% of the time when running the test introduced in r261414 I also respond to Darin's and Youenn's post-commit feedback. * page/SecurityPolicy.cpp: (WebCore::SecurityPolicy::generateReferrerHeader): * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::setHTTPReferrer): 2020-05-11 Andres Gonzalez <andresg_22@apple.com> Check the validity of the underlying Document before updating the isolated tree. https://bugs.webkit.org/show_bug.cgi?id=211728 Reviewed by Chris Fleizach. Solves crashes in isolated tree mode for several LayoutTests. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::focusedUIElementForPage): Update the focused document styles before returning the isolated tree focused object. (WebCore::AXObjectCache::notificationPostTimerFired): Ignored notification if underlying Document doesn't have a living render tree. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateChildren): Don't update isolated object if associated AXObject doesn't have a Document or the Document doesn't have a live render tree. 2020-05-11 Andres Gonzalez <andresg_22@apple.com> Add mechanism to turn on accessibility isolated tree mode from WebKitTestRunner. https://bugs.webkit.org/show_bug.cgi?id=211725 Reviewed by Chris Fleizach. If the client is WebKitTestRunner, enable isolated tree mode. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::isIsolatedTreeEnabled): 2020-05-11 Per Arne Vollan <pvollan@apple.com> Unreviewed, reverting r261296. Rolling r260769 back in, since this was not causing a regression. Reverted changeset: "Unreviewed, reverting r260769." https://bugs.webkit.org/show_bug.cgi?id=211578 https://trac.webkit.org/changeset/261296 2020-05-11 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Introduce GridSpace https://bugs.webkit.org/show_bug.cgi?id=211712 Reviewed by Antti Koivisto. Normally we use the initial width/height (minimum width/height) value to compute the distribution ratio for the extra space (e.g minimum widths are [ 1 ] [ 2 ] extra space: 6; final widths [ 1 + 2 ] [ 2 + 4 ]). However is some rare case, while we use the minimum widths as the initial widths, the distribution ratio is computed using the maximum widths. This patch introduces GridSpace to be able to differentiate initial and distribution widths/heights (no functional change yet). * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::GridSpace::isEmpty const): (WebCore::Layout::max): (WebCore::Layout::operator-): (WebCore::Layout::operator+=): (WebCore::Layout::operator-=): (WebCore::Layout::operator/): (WebCore::Layout::distributeAvailableSpace): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): 2020-05-10 Antoine Quint <graouts@apple.com> [Web Animations] Refactor animation comparison by composite order in a single utility function https://bugs.webkit.org/show_bug.cgi?id=211695 Reviewed by Darin Adler. We used to split sorting of animations by composite order across several functions and files. Specifically, DocumentTimeline::getAnimations() would first collect animations by class (CSS Transitions, then CSS Animations, then JS-originated animations), and then sort each class, calling into the static function compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder() in some cases and into the WebAnimationUtilities compareAnimationsByCompositeOrder() function in other. Since we need to be able to sort animations by composite order in other situations, for instance when sorting events when updating animations and sending events (which we will do in a future patch), we refactor all of the comparison logic into compareAnimationsByCompositeOrder(), removing the need to provide an AnimationList, which is specific to the case where we know we are comparing CSSAnimation objects targeting a shared element. This effectively empties DocumentTimeline::getAnimations() so we remove this function and filter relevant animations in Document::matchingAnimations() and call compareAnimationsByCompositeOrder() before returning the compiled animations. No new tests since there is no change of behavior. * animation/DocumentTimeline.cpp: (WebCore::compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder): Deleted. (WebCore::DocumentTimeline::getAnimations const): Deleted. * animation/DocumentTimeline.h: * animation/KeyframeEffectStack.cpp: (WebCore::KeyframeEffectStack::ensureEffectsAreSorted): * animation/WebAnimation.cpp: (WebCore::WebAnimation::commitStyles): * animation/WebAnimationUtilities.cpp: (WebCore::compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder): (WebCore::compareCSSTransitions): (WebCore::compareCSSAnimations): (WebCore::compareAnimationsByCompositeOrder): * animation/WebAnimationUtilities.h: * dom/Document.cpp: (WebCore::Document::matchingAnimations): 2020-05-11 Charlie Turner <cturner@igalia.com> [WPE] Layout test media/encrypted-media/mock-MediaKeySystemAccess.html is crashing https://bugs.webkit.org/show_bug.cgi?id=181225 Reviewed by Darin Adler. WebCore::CDM::createInstance assumes its private instance always produces a valid pointer. This is not the case in the testing mocks. Guard against it. Test: media/encrypted-media/mock-MediaKeySystemAccess.html * Modules/encryptedmedia/CDM.cpp: (WebCore::CDM::createInstance): Guard against null pointers in mock scenarios. 2020-05-10 Rob Buis <rbuis@igalia.com> Fix base64.any.html test https://bugs.webkit.org/show_bug.cgi?id=211671 Reviewed by Darin Adler. Fix base64.any.html test by extending DataURLDecoder with a forgiving-base64 decode mode [1], as used by the Fetch data: URL processor algorithm [2]. Behavior matches Chrome and Firefox. [1] https://infra.spec.whatwg.org/#forgiving-base64-decode [2] https://fetch.spec.whatwg.org/#data-url-processor Test: imported/w3c/web-platform-tests/fetch/data-urls/base64.any.html * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::loadDataURL): * platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::decodeBase64): (WebCore::DataURLDecoder::decode): * platform/network/DataURLDecoder.h: 2020-05-10 Darin Adler <darin@apple.com> Add copy constructor and assignment operator to Ref<> https://bugs.webkit.org/show_bug.cgi?id=211705 Reviewed by Sam Weinig. * dom/BoundaryPoint.h: As a test of the change to Ref, remove the explicit copy and move constructors and assignment operators, relying on the defaults instead, which are now exactly what we want. 2020-05-10 Michael Catanzaro <mcatanzaro@gnome.org> Update user agent quirk for bankofamerica.com https://bugs.webkit.org/show_bug.cgi?id=211700 Reviewed by Carlos Garcia Campos. The Mac platform quirk isn't working anymore. The Chrome quirk works. * platform/UserAgentQuirks.cpp: (WebCore::urlRequiresChromeBrowser): (WebCore::urlRequiresMacintoshPlatform): 2020-05-10 Darin Adler <darin@apple.com> Remove now-unneeded HAVE(CORE_VIDEO) https://bugs.webkit.org/show_bug.cgi?id=211677 Reviewed by Dan Bernstein. * page/cocoa/MemoryReleaseCocoa.mm: * platform/cocoa/CoreVideoSoftLink.cpp: Remove HAVE(CORE_VIDEO). * platform/cocoa/CoreVideoSoftLink.h: Ditto. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: Ditto. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage): Ditto. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::MediaSampleAVFObjC::getRGBAImageData const): Ditto. * platform/graphics/cv/PixelBufferConformerCV.cpp: Ditto. * platform/graphics/cv/PixelBufferConformerCV.h: Ditto. * platform/graphics/cv/TextureCacheCV.h: Ditto. * platform/graphics/cv/TextureCacheCV.mm: Ditto. * platform/graphics/cv/VideoTextureCopierCV.cpp: Ditto. * platform/graphics/cv/VideoTextureCopierCV.h: Ditto. 2020-05-09 Darin Adler <darin@apple.com> Tighten up logic in DocumentTimelinesController::updateAnimationsAndSendEvents https://bugs.webkit.org/show_bug.cgi?id=211668 Reviewed by Antoine Quint. * animation/DocumentTimelinesController.cpp: (WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents): Use Ref instead of RefPtr. Use Ref even in timelinesToUpdate; no harm in doing a little bit of extra ref'ing. Use copyToVector when iterating relevantAnimations since it could be a problem if the current animation was removed from the ListHashSet while we are iterating it and there is no obvious reason that can't happen. Use makeRef instead of makeRefPtr. Take advantage of the behavior of the Optional operator<, which already treats nullopt as less than any non-nullopt value, and remove unnecessary checks that weere doing the same thing explicitly. This fixes a mistake where we were returning true when both are nullopt, which could harm the stability of the sort, in theory. Add a null check of the timeline when iterating completedTransitions, since there is no obvious guarantee they could not have been removed as a side effect earlier. 2020-05-10 Darin Adler <darin@apple.com> Use makeReversedRange and get rid of one-off ReverseView https://bugs.webkit.org/show_bug.cgi?id=211675 Reviewed by Sam Weinig. * editing/markup.cpp: (WebCore::ReverseView): Deleted. (WebCore::StyledMarkupAccumulator::takeResults): Use makeReversedRange. 2020-05-10 Tim Horton <timothy_horton@apple.com> Clicking a tel:// link on iPad with a trackpad presents different UI than tapping on it https://bugs.webkit.org/show_bug.cgi?id=211686 <rdar://problem/57941589> Reviewed by Wenson Hsieh. * dom/MouseRelatedEvent.h: * editing/cocoa/DataDetection.h: * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::canPresentDataDetectorsUIForElement): (WebCore::DataDetection::shouldCancelDefaultAction): Deleted. Rename shouldCancelDefaultAction to canPresentDataDetectorsUIForElement. This bit indicates whether a given element should invoke DD UI instead of doing its default action, so either name is OK, but it feels better to have it in the affirmative direction. * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::handleClick): Determine if tapping on an anchor should invoke DataDetectors UI instead of performing the default action, and short-circuit if that is possible. * loader/EmptyClients.h: * page/ChromeClient.h: 2020-05-09 Wenson Hsieh <wenson_hsieh@apple.com> [macOS] Search field on mayoclinic.org/forms/us-resident-appointment clips the submit button https://bugs.webkit.org/show_bug.cgi?id=211673 <rdar://problem/62572501> Reviewed by Tim Horton. Allow search fields to be style-able, but only if the CSS `border` value is non-default. Note that there was a previous attempt to achieve something similar in r157443 by adding search fields to the base class implementation of `RenderTheme::isControlStyled`; however, this patch wasn't actually accompanied by support for rendering native search fields with a non-default background, which meant that customizing just the background of a search field would cause the entire search field to opt out of the native search field appearance (a pill with rounded corners on macOS). However, in the case where the border is customized on macOS, it is incorrect to use the default search field appearance, since the search field cell just consists of a border; as such, there should be little compatibility risk of a web page unexpectedly getting the fallback (non-native) appearance for a search field, due to having custom border styles. This also makes the behavior of search fields match that of text fields, textareas, and list boxes (multi-option selects) on macOS, in terms of what is needed in order to bail out of native appearance rendering. Rebaselined existing tests: fast/css/text-input-with-webkit-border-radius.html fast/forms/search-styled.html * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::isControlStyled const): Add SearchFieldPart. 2020-05-09 Jer Noble <jer.noble@apple.com> REGRESSION(r258493): CRASH running fast/mediastream/RTCPeerConnection tests https://bugs.webkit.org/show_bug.cgi?id=211666 <rdar://problem/63055644> Reviewed by Eric Carlson. MockMediaStreamTrack advertises that it's a webrtc::VideoTrackInterface, but doesn't inherit from that interface, leading to a crash when its pointer is cast to webrtc::VideoTrackInterface and a virtual method called on the resulting pointer. Since it's only used in one place, and since there's an existing mock webrtc::VideoTrackInterface object in that same file, remove MockMediaStreamTrack and replace the one place it's used with MockLibWebRTCVideoTrack. * testing/MockLibWebRTCPeerConnection.h: (WebCore::MockMediaStreamTrack::state const): Deleted. 2020-05-09 David Kilzer <ddkilzer@apple.com> XML external entity resources should only be loaded from XML MIME types <https://webkit.org/b/211488> <rdar://problem/62869515> Reviewed by Darin Adler. Tests: dom/xhtml/level3/core/entitygetinputencoding03.xhtml dom/xhtml/level3/core/entitygetinputencoding04.xhtml dom/xhtml/level3/core/entitygetxmlencoding02.xhtml dom/xhtml/level3/core/entitygetxmlencoding03.xhtml dom/xhtml/level3/core/entitygetxmlencoding04.xhtml dom/xhtml/level3/core/entitygetxmlversion03.xhtml dom/xhtml/level3/core/entitygetxmlversion04.xhtml dom/xhtml/level3/core/nodegetbaseuri16.xhtml dom/xhtml/level3/core/nodegetbaseuri19.xhtml dom/xhtml/level3/core/nodegetbaseuri20.xhtml fast/parser/external-entities-in-xslt.xml fast/xsl/dtd-in-source-document.xml fast/xsl/xslt-second-level-import.xml http/tests/security/contentTypeOptions/nosniff-xml-external-entity.xhtml http/tests/security/xss-DENIED-xsl-external-entity-redirect.xml * html/HTMLBaseElement.cpp: (WebCore::HTMLBaseElement::href const): - Add comment about keeping code in sync with openFunc() in XMLDocumentParserLibxml2.cpp. * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::responseMIMEType const): - Add comment about keeping code in sync with externalEntityMimeTypeAllowed() in XMLDocumentParserLibxml2.cpp. * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::externalEntityMimeTypeAllowed): - Rename from externalEntityMimeTypeAllowedByNosniff(). - Change to only allow XML MIME types regardless of nosniff option. - Add fallback path to determine MIME type for file:/// URLs to make layout tests work properly. Logic taken from XMLHttpRequest::responseMIMEType(). Not sure if there was a good place to share it. (WebCore::openFunc): - Fix relative URLs by providing the document's URL as a base. Also provide an encoding if needed. Logic taken from HTMLBaseElement::href(). (Not sure if there was a good place to share it.) This was required to fix loading of external entity resources in the dom/xhtml/level3/core tests, which hadn't been loading these resources for a while. Ultimately this didn't matter--except for new error messages being printed in test results--because the tests fail due to missing DOM features for XHTML documents). - Change the fix for Bug 21963 into an empty URL check since setting FetchOptions.mode to Mode::SameOrigin prevents a redirect from loading a resource outside the document's origin. The previous check worked, but the relaxed check in externalEntityMimeTypeAllowed() caused the XML MIME type warning to be output on redirects to non-same-origin URLs. I didn't see a way to check for a cross-origin loading error. - Add a console message for a cross-origin load failing. - Update for function rename. - Remove double negative from console message for an invalid MIME type. (WebCore::externalEntityMimeTypeAllowedByNosniff): - Rename to externalEntityMimeTypeAllowed(). 2020-05-09 David Kilzer <ddkilzer@apple.com> Adapt LocalCurrentGraphicsContext for iOS <https://webkit.org/b/211660> Reviewed by Darin Adler. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: - Update build files for: - Rename of LocalCurrentGraphicsContext.mm to LocalCurrentGraphicsContextMac.mm. - Move of LocalCurrentGraphicsContext.h from platform/mac to platform/cocoa. - Addition of LocalCurrentGraphicsContextIOS.mm. * platform/cocoa/LocalCurrentGraphicsContext.h: Renamed from Source/WebCore/platform/mac/LocalCurrentGraphicsContext.h. - Make this work for iOS by using PLATFORM(COCOA) for the outer guard and USE(APPKIT) for the Mac-specific bits. - Use RetainPtr<> for NSGraphicsContext to clean up code in LocalCurrentGraphicsContextMac.mm. (WebCore::LocalCurrentGraphicsContext::cgContext): - Inline from LocalCurrentGraphicsContextMac.mm. * platform/ios/LocalCurrentGraphicsContextIOS.mm: Copied from Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm. (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext): (WebCore::LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext): - Implement based on LocalCurrentGraphicsContextMac.mm. Use UIGraphics{GetCurrent,Pop,Push}Context() functions added to UIKitSoftLink.h. * platform/mac/LocalCurrentGraphicsContextMac.mm: Renamed from Source/WebCore/platform/mac/LocalCurrentGraphicsContext.mm. (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext): - Use m_savedGraphicsContext instead of graphicsContext in the body of the constructor. - Remove set-to-nil/retain of m_savedNSGraphicsContext since that is handled by RetainPtr<> now. (WebCore::LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext): - Remove release of m_savedNSGraphicsContext since that is handled by RetainPtr<> now. (WebCore::LocalCurrentGraphicsContext::cgContext): Delete. - Inline into header to share implementation with iOS. 2020-05-09 Darin Adler <darin@apple.com> Fix null-dereference in DocumentTimelinesController::updateAnimationsAndSendEvents https://bugs.webkit.org/show_bug.cgi?id=211667 Reviewed by Antoine Quint. * animation/DocumentTimelinesController.cpp: (WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents): Add null check before removing animationsToRemove, which may already have been removed since any arbitrary change could occur while animations are firing. 2020-05-09 Darin Adler <darin@apple.com> Add missing null-check of page in ResourceLoader::loadDataURL https://bugs.webkit.org/show_bug.cgi?id=211589 rdar://57213601 Reviewed by Anders Carlsson. * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::loadDataURL): Add null check before using page. 2020-05-08 Darin Adler <darin@apple.com> Streamline MarkupAccumulator to improve efficiency a bit https://bugs.webkit.org/show_bug.cgi?id=211656 Reviewed by Anders Carlsson. * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::appendCharactersReplacingEntities): Corrected early exit so it returns any time the length is 0. For some reason the code before wouldn't do the early return when offset is non-zero, which is unnecessary. (WebCore::MarkupAccumulator::appendString): Deleted. (WebCore::MarkupAccumulator::appendStringView): Deleted. (WebCore::MarkupAccumulator::appendEndTag): Use variadic append to cut down on memory allocations. (WebCore::MarkupAccumulator::totalLength): Deleted. (WebCore::MarkupAccumulator::concatenateMarkup): Deleted. (WebCore::MarkupAccumulator::takeMarkup): Added. (WebCore::MarkupAccumulator::appendQuotedURLAttributeValue): Use variadic append to cut down on memory allocations. Also use char instead of UChar so the string building code doesn't have to do an 8/16 bit check. (WebCore::shouldAddNamespaceElement): Prepend a literal, don't bother to make a String just to append to another String. Also made this a non-member function. (WebCore::shouldAddNamespaceAttribute): Made this a non-member function. (WebCore::MarkupAccumulator::appendNamespace): Fix hash table usage to use add instead of get followed by set to avoid double hashing. Use variadic append to cut down on memory allocation. (WebCore::MarkupAccumulator::appendText): Tweaked style to make this a one-line function. (WebCore::appendComment): Deleted. (WebCore::appendXMLDeclaration): Made this a non-member function. Use variadic append to cut down on memory allocation. (WebCore::appendDocumentType): Made this a non-member function. Use variadic append to cut down on memory allocation. (WebCore::MarkupAccumulator::appendCDATASection): Deleted. (WebCore::MarkupAccumulator::appendNonElementNode): Moved the bodies of appendComment, appendProcessingInstruction, and appendCDATASection in here since they can all be one-line variadic append calls. * editing/MarkupAccumulator.h: (WebCore::MarkupAccumulator::length const): Changed the return type of length to be unsigned since that's what StringBuilder returns. Made isAllASCII call StringBuilder::isAllASCII. Replaced appendString and appendStringView with variadic append. Removed many functions that no longer need to be member functions. Made appendAttributeValue a static member function. Made appendNamespace private. Made m_serializationSyntax const. * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::wrapWithStyleNode): Use append instead of appenString. (WebCore::StyledMarkupAccumulator::isAllASCII const): Added. Before the code would only check the StringBuilder, but we also need to check m_reversedPrecedingMarkup. (WebCore::StyledMarkupAccumulator::takeResults): Use CheckedUint32 since StringBuilder's reserveCapacity function takes unsigned, not size_t. The old code, using totalLength, would just pass a size_t and let it get chopped off, which didn't do any harm, but it seems strange to compute a 64-bit value just to chop off the lower 32 bits. An alternative is to compute the 32-bit value and just let it overflow. Use a modern for loop by defining a ReverseView template rather than writing a confusing backwards loop. Use the new takeMarkup instead of concatenateMarkup. (WebCore::StyledMarkupAccumulator::appendText): Tweak coding style a little bit. (WebCore::StyledMarkupAccumulator::appendStartTag): Ditto. (WebCore::StyledMarkupAccumulator::appendNodeToPreserveMSOList): Use variadic append to cut down on memory allocations. (WebCore::propertyMissingOrEqualToNone): Tweak coding style a bit. (WebCore::serializePreservingVisualAppearanceInternal): Use append instead of appendString. (WebCore::shouldPreserveMSOLists): Take a StringView instead of a String to eliminate unnecessary memory allocation in call to substring. (WebCore::sanitizedMarkupForFragmentInDocument): Use makeString instead of StringBuilder to cut down on memory allocation. * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::resetDefaultButton): Fix spelling error in the word "explicitly". * mathml/MathMLOperatorDictionary.cpp: (WebCore::MathMLOperatorDictionary::search): Ditto. * page/PageSerializer.cpp: (WebCore::PageSerializer::SerializerMarkupAccumulator::SerializerMarkupAccumulator): Use variadic append instead of appendString to cut down on memory allocations. * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::paint): Fix spelling error in the word "explicitly". 2020-05-09 Jack Lee <shihchieh_lee@apple.com> Nullptr crash in LegacyWebArchive::createPropertyListRepresentation when copying selected range that contains surrogate characters https://bugs.webkit.org/show_bug.cgi?id=211658 <rdar://problem/62844424> Reviewed by Ryosuke Niwa. Added check for null LegacyWebArchive in LegacyWebArchive::createFromSelection. Return nullptr when creation fails. Test: webarchive/copy-surrogate-char-crash.html * loader/archive/cf/LegacyWebArchive.cpp: (WebCore::LegacyWebArchive::createFromSelection): 2020-05-09 Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> Fix wpt shadow-dom/slots-fallback-in-document.html https://bugs.webkit.org/show_bug.cgi?id=211640 Reviewed by Ryosuke Niwa. By specs, HTMLSlotElement.assignedNodes() should not count children of a slot in a document tree for flattened assigned nodes. https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assignednodes https://dom.spec.whatwg.org/#find-flattened-slotables As sideeffect, this patch also fix wpt shadow-dom/slots-outside-shadow-dom-expected.html Test: web-platform-tests/shadow-dom/slots-fallback-in-document.html web-platform-tests/shadow-dom/slots-outside-shadow-dom.html * html/HTMLSlotElement.cpp: (WebCore::flattenAssignedNodes): 2020-05-08 Basuke Suzuki <basuke.suzuki@sony.com> Fix build error on PlatStation port after r261132 https://bugs.webkit.org/show_bug.cgi?id=211659 Unreviewed build fix after r261132. * page/scrolling/ScrollingTreeGestureState.cpp: 2020-05-08 David Kilzer <ddkilzer@apple.com> Remove empty directories from from svn.webkit.org repository <https://webkit.org/b/211644> Reviewed by Darin Adler. * Modules/webgpu/cocoa: Removed. * page/scrolling/ios: Removed. * platform/graphics/metal: Removed. 2020-05-08 Simon Fraser <simon.fraser@apple.com> Async overflow scroll: sometimes a <select> becomes non-scrollable https://bugs.webkit.org/show_bug.cgi?id=211433 <rdar://problem/62338474> Reviewed by Dean Jackson. Scrollable <select>s (RenderListBox) contribute to the non-fast scrollable region, so wheel events inside them are propagated to the main thread. If the select is scrolled to the end, the event will propagate to the enclosing scroller, then then FrameView::wheelEvent() may send it back to the scrolling thread. If the scrolling thread is processing such an event after the main thread, it should not perform any latching on the main thread. Test: scrollingcoordinator/mac/latching/scrolling-select-should-not-latch-mainframe.html * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): (WebCore::ScrollingTree::handleWheelEvent): * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeLatchingController.cpp: (WebCore::ScrollingTreeLatchingController::receivedWheelEvent): (WebCore::ScrollingTreeLatchingController::latchedNodeForEvent const): (WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent): (WebCore::ScrollingTreeLatchingController::clearLatchedNode): * page/scrolling/ScrollingTreeLatchingController.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread): * page/scrolling/ThreadedScrollingTree.h: * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::handleWheelEvent): * platform/PlatformWheelEvent.cpp: (WebCore::operator<<): 2020-05-08 Darin Adler <darin@apple.com> Remove now-unneeded HAVE(AVFOUNDATION_LOADER_DELEGATE) https://bugs.webkit.org/show_bug.cgi?id=211646 Reviewed by Eric Carlson. * loader/MediaResourceLoader.cpp: (WebCore::MediaResourceLoader::requestResource): Remove check of HAVE(AVFOUNDATION_LOADER_DELEGATE) in a place where it also checks PLATFORM(MAC). * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: Remove HAVE(AVFOUNDATION_LOADER_DELEGATE) in Cocoa-only code. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto. (WebCore::globalLoaderDelegateQueue): Ditto. (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Ditto. (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): Ditto. (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto. (WebCore::MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest): Ditto. * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h: Ditto. * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: Ditto. 2020-05-08 Tomoki Imai <Tomoki.Imai@sony.com> TextureMapper should skip clipping a content layer if it's not needed https://bugs.webkit.org/show_bug.cgi?id=210787 Reviewed by Don Olmstead. This patch follows up r260174. We don't need to clip a content layer if the clipping rect contains the content rect. This patch doesn't change the behavior but saves stencil indices. * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintSelf): 2020-05-08 Myles C. Maxfield <mmaxfield@apple.com> [iOS] Text-style fonts aren't locale-specific https://bugs.webkit.org/show_bug.cgi?id=211438 <rdar://problem/51654163> Reviewed by Sam Weinig. Simply hook up the locale to the Core Text function. It turns out that this patch actually has no behavior change, because this locale is only used for font fallback, but WebKit does its own font fallback and we already pass the locale into CTFontCopyDefaultCascadeListForLanguages(). However, for symmetry with CTFontCreateUIFontWithLanguage() it's a good idea to just supply it anyway. Just in case. Test: platform/ios/fast/text/lang-text-style.html * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: (WebCore::SystemFontDatabaseCoreText::createTextStyleFont): 2020-05-08 Kenneth Russell <kbr@chromium.org> [WebGL2] Complete new texture upload entry points in WebGL2RenderingContext https://bugs.webkit.org/show_bug.cgi?id=208875 Reviewed by Dean Jackson. Implement the remaining texture upload entry points - mainly for 3D textures - in WebGL2RenderingContext. Add support for uploading from the pixel unpack buffer. Refactor the WebGL 2.0 binding points into WebGL2RenderingContext, where they had previously been in the base class. Refactor validation code to override the base class where necessary. Refactor getParameter into WebGLRenderingContextBase and override it in WebGL2RenderingContext, eliminating duplicate code and fixing bugs. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::~WebGL2RenderingContext): (WebCore::WebGL2RenderingContext::getInt64Parameter): (WebCore::WebGL2RenderingContext::validateBufferTarget): (WebCore::WebGL2RenderingContext::validateBufferTargetCompatibility): (WebCore::WebGL2RenderingContext::validateBufferDataTarget): (WebCore::WebGL2RenderingContext::validateAndCacheBufferBinding): (WebCore::WebGL2RenderingContext::validateTexImageBinding): (WebCore::WebGL2RenderingContext::validateTexture3DBinding): (WebCore::WebGL2RenderingContext::copyBufferSubData): (WebCore::WebGL2RenderingContext::bindFramebuffer): (WebCore::WebGL2RenderingContext::deleteFramebuffer): (WebCore::WebGL2RenderingContext::getTexParameter): (WebCore::WebGL2RenderingContext::texStorage2D): (WebCore::WebGL2RenderingContext::texStorage3D): (WebCore::WebGL2RenderingContext::texImage2D): (WebCore::WebGL2RenderingContext::texImage3D): (WebCore::WebGL2RenderingContext::texSubImage2D): (WebCore::WebGL2RenderingContext::texSubImage3D): (WebCore::WebGL2RenderingContext::bindBufferBase): (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter): (WebCore::WebGL2RenderingContext::validateFramebufferTarget): (WebCore::WebGL2RenderingContext::getFramebufferBinding): (WebCore::WebGL2RenderingContext::getReadFramebufferBinding): (WebCore::WebGL2RenderingContext::restoreCurrentFramebuffer): (WebCore::WebGL2RenderingContext::getParameter): (WebCore::WebGL2RenderingContext::uncacheDeletedBuffer): (WebCore::WebGL2RenderingContext::validateFramebufferFuncParameters): Deleted. * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLBuffer.cpp: (WebCore::WebGLBuffer::setTarget): * html/canvas/WebGLBuffer.h: * html/canvas/WebGLFramebuffer.cpp: (WebCore::WebGLFramebuffer::setAttachmentForBoundFramebuffer): (WebCore::WebGLFramebuffer::attach): (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer): (WebCore::WebGLFramebuffer::isBound const): * html/canvas/WebGLFramebuffer.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::validateFramebufferFuncParameters): Deleted. (WebCore::WebGLRenderingContext::getParameter): Deleted. * html/canvas/WebGLRenderingContext.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::initializeNewContext): (WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase): (WebCore::WebGLRenderingContextBase::validateBufferTarget): (WebCore::WebGLRenderingContextBase::validateBufferDataTarget): (WebCore::WebGLRenderingContextBase::validateAndCacheBufferBinding): (WebCore::WebGLRenderingContextBase::bindBuffer): (WebCore::WebGLRenderingContextBase::bindFramebuffer): (WebCore::WebGLRenderingContextBase::bindTexture): (WebCore::WebGLRenderingContextBase::checkFramebufferStatus): (WebCore::WebGLRenderingContextBase::uncacheDeletedBuffer): (WebCore::WebGLRenderingContextBase::deleteFramebuffer): (WebCore::WebGLRenderingContextBase::deleteRenderbuffer): (WebCore::WebGLRenderingContextBase::deleteTexture): (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer): (WebCore::WebGLRenderingContextBase::framebufferTexture2D): (WebCore::WebGLRenderingContextBase::getParameter): (WebCore::WebGLRenderingContextBase::readPixels): (WebCore::WebGLRenderingContextBase::copyTexImage2D): (WebCore::WebGLRenderingContextBase::texParameter): (WebCore::WebGLRenderingContextBase::getBoundReadFramebufferColorFormat): (WebCore::WebGLRenderingContextBase::getBoundReadFramebufferWidth): (WebCore::WebGLRenderingContextBase::getBoundReadFramebufferHeight): (WebCore::WebGLRenderingContextBase::validateFramebufferTarget): (WebCore::WebGLRenderingContextBase::getFramebufferBinding): (WebCore::WebGLRenderingContextBase::getReadFramebufferBinding): (WebCore::WebGLRenderingContextBase::validateFramebufferFuncParameters): (WebCore::WebGLRenderingContextBase::validateBufferDataParameters): (WebCore::WebGLRenderingContextBase::setFramebuffer): (WebCore::WebGLRenderingContextBase::restoreCurrentFramebuffer): (WebCore::WebGLRenderingContextBase::getInt64Parameter): Deleted. * html/canvas/WebGLRenderingContextBase.h: 2020-05-08 Nikos Mouchtaris <nmouchtaris@apple.com> Implement web-share v2 for files https://bugs.webkit.org/show_bug.cgi?id=209265 Reviewed by Andy Estes. Modified existing tests for new behavior. Added support for handling of files in share/canShare, and implemented asynchronous reading of data from blobs on disk into memory. * WebCore.xcodeproj/project.pbxproj: * page/Navigator.cpp: (WebCore::Navigator::canShare): (WebCore::Navigator::share): (WebCore::Navigator::finishedLoad): * page/Navigator.h: * page/ReadShareDataAsync.cpp: Added. (WebCore::ReadShareDataAsync::readInternal): (WebCore::ReadShareDataAsync::ReadShareDataAsync): (WebCore::ReadShareDataAsync::~ReadShareDataAsync): (WebCore::ReadShareDataAsync::start): (WebCore::ReadShareDataAsync::didFinishLoading): (WebCore::ReadShareDataAsync::didReceiveData): (WebCore::ReadShareDataAsync::didStartLoading): (WebCore::ReadShareDataAsync::didFail): * page/ReadShareDataAsync.hpp: Added. * page/ShareData.h: 2020-05-08 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r261341 and r261392. Caused multiple regression test failures Reverted changesets: "Poster set after playback begins should be ignored" https://bugs.webkit.org/show_bug.cgi?id=211464 https://trac.webkit.org/changeset/261341 "REGRESSION(r261341): imported/w3c/web-platform- tests/html/semantics/embedded-content/the-video- element/intrinsic_sizes.htm is failing" https://bugs.webkit.org/show_bug.cgi?id=211612 https://trac.webkit.org/changeset/261392 2020-05-08 Alex Christensen <achristensen@webkit.org> Limit HTTP referer to 4kb https://bugs.webkit.org/show_bug.cgi?id=211603 <rdar://problem/56768823> Reviewed by Chris Dumez. Use the origin if it's longer, unless the origin is too long. This matches the behavior of other browsers. See https://bugzilla.mozilla.org/show_bug.cgi?id=1557346 Tested by API tests. * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::setHTTPReferrer): 2020-05-08 Pinki Gyanchandani <pgyanchandani@apple.com> SIGILL @ WebCore::Shape::createRasterShape -- DOS ASAN https://bugs.webkit.org/show_bug.cgi?id=211539 Reviewed by Simon Fraser. Corrected the comment. No new test needed. * rendering/shapes/Shape.cpp: (WebCore::Shape::createRasterShape): 2020-05-08 Rob Buis <rbuis@igalia.com> Fix urlsearchparams-delete.html https://bugs.webkit.org/show_bug.cgi?id=211456 Reviewed by Daniel Bates. Step 2 of URLSearchParams.delete algorithm [1] indicates we should run the update steps, even if no name-value pairs were removed. Behavior matches Chrome and Firefox. [1] https://url.spec.whatwg.org/#dom-urlsearchparams-delete Test: web-platform-tests/url/urlsearchparams-delete.html * html/URLSearchParams.cpp: (WebCore::URLSearchParams::remove): 2020-05-08 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] caret appears in the middle of a search field when field is focused on agoda.com https://bugs.webkit.org/show_bug.cgi?id=211591 <rdar://problem/60605873> Reviewed by Antoine Quint. See WebKit/ChangeLog for more details. Test: editing/selection/ios/caret-rect-after-animating-focused-text-field.html * animation/WebAnimation.cpp: (WebCore::WebAnimation::finishNotificationSteps): Add plumbing to call out to the WebKit client layer after an animation finishes running. * dom/Node.h: * editing/VisibleSelection.h: WEBCORE_EXPORT a couple of methods. * page/ChromeClient.h: (WebCore::ChromeClient::animationDidFinishForElement): 2020-05-08 Wenson Hsieh <wenson_hsieh@apple.com> Preserve character set information when writing to the pasteboard when copying rich text https://bugs.webkit.org/show_bug.cgi?id=211524 Reviewed by Darin Adler. This patch is a followup to r261247, which introduced a workaround for Cocoa platforms to automatically add a `meta charset` when writing HTML data to the platform pasteboard. When copying a rich text selection, we use a different codepath when sanitizing DOM content - that is, `serializePreservingVisualAppearance`. The previous change also introduced an enum, `AddMetaCharsetIfNeeded`, to limit applying this workaround to only when we're writing HTML to the clipboard. However, it should be harmless to include this when reading sanitized HTML as well, so we can also simplify this code by removing the `AddMetaCharsetIfNeeded` enum (and all of its uses). Test: CopyHTML.SanitizationPreservesCharacterSetInSelectedText * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp: (WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::sanitizeDataIfNeeded): * dom/DataTransfer.cpp: (WebCore::DataTransfer::setDataFromItemList): * editing/MarkupAccumulator.h: (WebCore::MarkupAccumulator::isAllASCII const): * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::sanitizeMarkupWithArchive): (WebCore::WebContentReader::readHTML): (WebCore::WebContentMarkupReader::readHTML): * editing/markup.cpp: (WebCore::sanitizeMarkup): (WebCore::serializePreservingVisualAppearanceInternal): Move the `meta charset` workaround from sanitizedMarkupForFragmentInDocument to serializePreservingVisualAppearanceInternal, such that HTML data written to the pasteboard when copying rich text can be used to load a web view, without losing the fact that the copied content was UTF-8 encoded. (WebCore::sanitizedMarkupForFragmentInDocument): * editing/markup.h: 2020-05-08 Andres Gonzalez <andresg_22@apple.com> Fix for crashes in LayoutTests in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=211622 Reviewed by Chris Fleizach. Several LayoutTests. Return the root from the isolated tree when it is really ready. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::rootObject): Some code cleanup. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::clickPoint): 2020-05-08 Simon Fraser <simon.fraser@apple.com> Overflow scrollers in iframes don't get mouseMovedInContentArea() https://bugs.webkit.org/show_bug.cgi?id=211347 <rdar://problem/62784560> Reviewed by Tim Horton. We never dispatched mouseMovedInContentArea() on ScrollableAreas in subframes, so overlay scrollbar interactions there were broken. This is because the code ran from EventHandler::mouseMoved(), which only runs for the main frame. Instead, move the mouseMovedInContentArea() dispatch down into updateMouseEventTargetNode() which is run for each subframe. notifyScrollableAreasOfMouseEvents() takes an event name so we only dispatch for mouseMove events. There's some complexity here related to whether the old and new ScrollableArea targets are nested; this code doesn't try to do the right thing with nesting, but does handle the mouse moving between the scrollable main frame and an overflow region. enclosingScrollableArea() is fixed to return the FrameView. enclosingScrollableLayer() is flawed, as noted in the RenderLayer.h comment. Tests: fast/scrolling/mac/scrollbars/overflow-in-iframe-overlay-scrollbar-hovered.html fast/scrolling/mac/scrollbars/overflow-in-iframe-overlay-scrollbar-reveal.html * page/EventHandler.cpp: (WebCore::EventHandler::enclosingScrollableArea): (WebCore::EventHandler::mouseMoved): (WebCore::EventHandler::handleMouseMoveEvent): (WebCore::EventHandler::pointerCaptureElementDidChange): (WebCore::EventHandler::updateMouseEventTargetNode): (WebCore::EventHandler::notifyScrollableAreasOfMouseEvents): (WebCore::EventHandler::dispatchMouseEvent): (WebCore::enclosingScrollableArea): Deleted. (WebCore::EventHandler::notifyScrollableAreasOfMouseEnterExit): Deleted. * page/EventHandler.h: * page/ios/EventHandlerIOS.mm: (WebCore::EventHandler::dispatchSyntheticMouseOut): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::debugDescription const): * rendering/RenderLayer.h: 2020-05-08 Zalan Bujtas <zalan@apple.com> [LFC][TFC] The fixed logical width should be used as the max width for a cell https://bugs.webkit.org/show_bug.cgi?id=211610 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-simple-with-fixed-widht-and-inline-content.html * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell): 2020-05-08 Youenn Fablet <youenn@apple.com> Handle remote audio capture IPC messages in a background thread https://bugs.webkit.org/show_bug.cgi?id=211583 Reviewed by Eric Carlson. * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp: (WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples): Add assertion to check that we are not running on the main thread. 2020-05-08 Youenn Fablet <youenn@apple.com> Video capture does not get unmuted in case of tab switch on iOS https://bugs.webkit.org/show_bug.cgi?id=211509 Reviewed by Eric Carlson. Remove setInterrupted and related code. Instead, directly use setMuted(true/false) of the source of capture tracks. To ensure we validate that the active source is tied to a track of the document, we add RealtimeSource::isSameAs which handles the case of a RealtimeVideoSource wrapping an AVVideoCaptureSource. There might be multiple video tracks with each one its RealtimeVideoSource using the same AVVideoCaptureSource. We mute the AVVideoCaptureSource directly to make sure all linked tracks will get muted/unmuted at the same time. Tests to be fixed. * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::MediaStreamTrack): (WebCore::isSourceCapturingForDocument): (WebCore::MediaStreamTrack::updateCaptureAccordingToMutedState): * Modules/mediastream/MediaStreamTrack.h: * dom/Document.cpp: (WebCore::Document::visibilityStateChanged): * platform/mediastream/RealtimeMediaSource.cpp: * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeMediaSourceCenter.cpp: * platform/mediastream/RealtimeMediaSourceCenter.h: * platform/mediastream/RealtimeMediaSourceFactory.h: * platform/mediastream/RealtimeVideoSource.h: * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: * platform/mock/MockRealtimeMediaSourceCenter.cpp: 2020-05-07 Simon Fraser <simon.fraser@apple.com> MayBegin wheel event in a <select> doesn't flash the scrollers https://bugs.webkit.org/show_bug.cgi?id=211605 Reviewed by Antti Koivisto. We need to special-case scrollable <select> elements, because they are ScrollableAreas which are never asynchronously scrolled, so the ScrollingTree never dispatches the handleWheelEventPhase() which is necessary to flash overlay scrollbars. Scrollable <select> elements are always in the non-fast scrollable region. Fix findEnclosingScrollableContainer() to return a ScrollableArea for the "maybegin" and "canceled" events that have no delta. Remove some "inline" and make some things references. Tests: fast/scrolling/mac/scrollbars/select-overlay-scrollbar-hovered.html fast/scrolling/mac/scrollbars/select-overlay-scrollbar-reveal.html * page/EventHandler.cpp: (WebCore::handleWheelEventPhaseInScrollableArea): (WebCore::didScrollInScrollableArea): (WebCore::handleWheelEventInAppropriateEnclosingBox): (WebCore::shouldGesturesTriggerActive): (WebCore::EventHandler::eventLoopHandleMouseUp): (WebCore::EventHandler::eventLoopHandleMouseDragged): * page/mac/EventHandlerMac.mm: (WebCore::findEnclosingScrollableContainer): (WebCore::EventHandler::determineWheelEventTarget): * testing/Internals.cpp: (WebCore::Internals::scrollableAreaForNode): Fix to find the ScrollableArea for RenderListBoxes. 2020-05-07 Chris Dumez <cdumez@apple.com> Unreviewed, reverting r261252. Reland r260684 now that a proper fix has landed in Reader Reverted changeset: "REGRESSION (r260684): Reader background is lost after multitasking" https://bugs.webkit.org/show_bug.cgi?id=211533 https://trac.webkit.org/changeset/261252 2020-05-07 Pinki Gyanchandani <pgyanchandani@apple.com> SIGILL @ WebCore::Shape::createRasterShape -- DOS ASAN https://bugs.webkit.org/show_bug.cgi?id=211539 Reviewed by Geoffrey Garen. Removed the RELEASE_ASSERT because its possible for imageData to be null when imageRect size is huge value. Test: fast/shapes/shape-outside-floats/shape-outside-imagedata-overflow.html * rendering/shapes/Shape.cpp: (WebCore::Shape::createRasterShape): 2020-05-07 Youenn Fablet <youenn@apple.com> Remove AudioMediaStreamTrackRenderer::muted https://bugs.webkit.org/show_bug.cgi?id=211289 Reviewed by Eric Carlson. * platform/mediastream/AudioMediaStreamTrackRenderer.h: muted is unnecessary since we are using start/stop instead. 2020-05-07 Eric Carlson <eric.carlson@apple.com> [macOS] Playhead in Touch Bar continues when loading stalls https://bugs.webkit.org/show_bug.cgi?id=211585 <rdar://problem/33893306> Reviewed by Darin Adler. * platform/cocoa/PlaybackSessionModelMediaElement.h: * platform/cocoa/PlaybackSessionModelMediaElement.mm: (WebCore::PlaybackSessionModelMediaElement::updateForEventName): Listen for `waitingEvent` and `canplay` events. Don't claim to be playing when stalled. (WebCore::PlaybackSessionModelMediaElement::isStalled const): New. 2020-05-07 Eric Carlson <eric.carlson@apple.com> Poster set after playback begins should be ignored https://bugs.webkit.org/show_bug.cgi?id=211464 Reviewed by Jer Noble. Redo the poster frame logic to use the `show poster flag` logic from the spec. Test: media/video-poster-set-after-playback.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_showPoster. (WebCore::HTMLMediaElement::prepareForLoad): m_displayMode was removed. (WebCore::HTMLMediaElement::selectMediaResource): Call setShowPosterFlag. (WebCore::HTMLMediaElement::loadResource): Remove calls to setDisplayMode and updateDisplayState, they have been deleted. (WebCore::HTMLMediaElement::waitForSourceChange): Call setShowPosterFlag. Update spec text. (WebCore::HTMLMediaElement::noneSupported): Call setShowPosterFlag. (WebCore::HTMLMediaElement::mediaLoadingFailed): Remove call to updateDisplayState. (WebCore::HTMLMediaElement::setReadyState): Ditto. (WebCore::HTMLMediaElement::seekWithTolerance): Call setShowPosterFlag. (WebCore::HTMLMediaElement::seekTask): Check m_showPoster, not displayMode. (WebCore::HTMLMediaElement::playInternal): Call setShowPosterFlag. (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Don't check displayMode. (WebCore::HTMLMediaElement::updatePlayState): No more setDisplayMode. (WebCore::HTMLMediaElement::userCancelledLoad): Call setShowPosterFlag. (WebCore::HTMLMediaElement::mediaPlayerFirstVideoFrameAvailable): Deleted. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::showPosterFlag const): (WebCore::HTMLMediaElement::setShowPosterFlag): (WebCore::HTMLMediaElement::displayMode const): Deleted. (WebCore::HTMLMediaElement::setDisplayMode): Deleted. (WebCore::HTMLMediaElement::updateDisplayState): Deleted. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::didAttachRenderers): No more updateDisplayState. (WebCore::HTMLVideoElement::parseAttribute): Ditto. Call updateFromElement when poster is removed. (WebCore::HTMLVideoElement::shouldDisplayPosterImage const): New. (WebCore::HTMLVideoElement::mediaPlayerFirstVideoFrameAvailable): New, update player and renderer if the poster isn't supposed to be visible. (WebCore::HTMLVideoElement::setDisplayMode): Deleted. (WebCore::HTMLVideoElement::updateDisplayState): Deleted. * html/HTMLVideoElement.h: * rendering/RenderVideo.cpp: (WebCore::RenderVideo::failedToLoadPosterImage const): New. * rendering/RenderVideo.h: * testing/Internals.cpp: (WebCore::Internals::elementShouldDisplayPosterImage const): * testing/Internals.h: * testing/Internals.idl: 2020-05-07 Jack Lee <shihchieh_lee@apple.com> In Document::willBeRemovedFromFrame, clear FrameSelection before Editor so the selection is removed. https://bugs.webkit.org/show_bug.cgi?id=211551 Reviewed by Geoffrey Garen. Covered by existing tests. * dom/Document.cpp: (WebCore::Document::willBeRemovedFromFrame): 2020-05-07 Antoine Quint <graouts@apple.com> [Web Animations] imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=211232 <rdar://problem/62650227> Reviewed by Dean Jackson. The flakiness came from this porting of the test: animA.finished.then(() => { animB.cancel() }); animB.finished.then(() => { animA.cancel() }); Sometimes, animA and animB would finish in different frames even though they were designed to finish at the same time. If this happened, animA.finished would resolve and trigger animB.cancel, which then rejected animB.finished. This happened because animB was attached to a DocumentTimeline created by script which isn't the main DocumenTimeline accessed via document.timeline. Some curious code would handle syncing of the various timelines such that they would use a shared timebase. This was in DocumentTimeline::currentTime(): auto& mainDocumentTimeline = m_document->timeline(); if (&mainDocumentTimeline != this) { if (auto mainDocumentTimelineCurrentTime = mainDocumentTimeline.currentTime()) return *mainDocumentTimelineCurrentTime - m_originTime; return WTF::nullopt; } We now move the currentTime caching at the DocumentTimelinesController level which ensures all DocumentTimeline objects attached to a given Document use the exact same currentTime(). This prompted some overdue refactoring where also all the related animation suspension code is moved from DocumentTimeline up to DocumentTimelinesController. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::detachFromDocument): (WebCore::DocumentTimeline::suspendAnimations): (WebCore::DocumentTimeline::resumeAnimations): (WebCore::DocumentTimeline::animationsAreSuspended const): (WebCore::DocumentTimeline::currentTime): (WebCore::DocumentTimeline::scheduleAnimationResolution): (WebCore::DocumentTimeline::documentWillUpdateAnimationsAndSendEvents): (WebCore::DocumentTimeline::animationsAreSuspended): Deleted. (WebCore::DocumentTimeline::liveCurrentTime const): Deleted. (WebCore::DocumentTimeline::cacheCurrentTime): Deleted. (WebCore::DocumentTimeline::maybeClearCachedCurrentTime): Deleted. * animation/DocumentTimeline.h: * animation/DocumentTimelinesController.cpp: (WebCore::DocumentTimelinesController::detachFromDocument): (WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents): (WebCore::DocumentTimelinesController::suspendAnimations): (WebCore::DocumentTimelinesController::resumeAnimations): (WebCore::DocumentTimelinesController::animationsAreSuspended const): (WebCore::DocumentTimelinesController::liveCurrentTime const): (WebCore::DocumentTimelinesController::currentTime): (WebCore::DocumentTimelinesController::cacheCurrentTime): (WebCore::DocumentTimelinesController::maybeClearCachedCurrentTime): * animation/DocumentTimelinesController.h: * dom/Document.cpp: (WebCore::Document::didBecomeCurrentDocumentInFrame): (WebCore::Document::resume): * dom/Document.h: * page/Frame.cpp: (WebCore::Frame::clearTimers): (WebCore::Frame::resumeActiveDOMObjectsAndAnimations): * page/Page.cpp: (WebCore::Page::setIsVisibleInternal): (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged): * testing/Internals.cpp: (WebCore::Internals::animationsAreSuspended const): (WebCore::Internals::suspendAnimations const): (WebCore::Internals::resumeAnimations const): 2020-05-07 Simon Fraser <simon.fraser@apple.com> REGRESSION (r252161): Animation of box-shadow with border-radius set is flashy https://bugs.webkit.org/show_bug.cgi?id=211530 <rdar://problem/62570229> Reviewed by Zalan Bujtas. Drawing inset box shadows with spread was broken, and in some cases generated invalid rounded rects, causing inset shadows with border-radius to lose the radius. First, with split inlines, the spread was not getting removed from the excluded edges. Fix in the includeLogicalLeftEdge/includeLogicalRightEdge clauses, adding shiftXEdgeBy()/shiftYEdgeBy() helpers to LayoutRect to simplify logic. Second, when computing the rounded hole rect, we'd use the result of style.getRoundedInnerBorderFor() but that doesn't take shadow spread into account, so we'd build a rounded rect with a rect that accounted for spread, but radii computed without. That could result in unrenderable rounded rects. Fix by calling style.getRoundedInnerBorderFor() a second time if we have spread; this will fix up the radii for spread. Tests: fast/box-shadow/inset-box-shadow-fractional-radius.html fast/box-shadow/inset-shadow-split-inline.html fast/box-shadow/inset-spread-box-shadow-split-inline.html * platform/graphics/LayoutRect.h: (WebCore::LayoutRect::shiftXEdgeBy): (WebCore::LayoutRect::shiftYEdgeBy): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintBoxShadow): 2020-05-07 Don Olmstead <don.olmstead@sony.com> Remove unused USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) https://bugs.webkit.org/show_bug.cgi?id=211582 Reviewed by Fujii Hironori. After r261264 all ports implemented USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR. * page/ChromeClient.h: (WebCore::ChromeClient::createDisplayRefreshMonitor const): * page/Page.cpp: (WebCore::Page::windowScreenDidChange): * page/RenderingUpdateScheduler.cpp: (WebCore::RenderingUpdateScheduler::RenderingUpdateScheduler): (WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency): (WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate): (WebCore::RenderingUpdateScheduler::windowScreenDidChange): * page/RenderingUpdateScheduler.h: * platform/graphics/DisplayRefreshMonitor.cpp: * platform/graphics/DisplayRefreshMonitor.h: * platform/graphics/DisplayRefreshMonitorClient.cpp: * platform/graphics/DisplayRefreshMonitorClient.h: * platform/graphics/DisplayRefreshMonitorManager.cpp: * platform/graphics/DisplayRefreshMonitorManager.h: * platform/graphics/GraphicsLayerUpdater.cpp: (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater): (WebCore::GraphicsLayerUpdater::scheduleUpdate): (WebCore::GraphicsLayerUpdater::screenDidChange): (WebCore::GraphicsLayerUpdater::displayRefreshFired): (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor const): * platform/graphics/GraphicsLayerUpdater.h: * platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp: * platform/graphics/gtk/DisplayRefreshMonitorGtk.h: * platform/graphics/ios/DisplayRefreshMonitorIOS.h: * platform/graphics/ios/DisplayRefreshMonitorIOS.mm: * platform/graphics/mac/DisplayRefreshMonitorMac.cpp: * platform/graphics/mac/DisplayRefreshMonitorMac.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor const): * rendering/RenderLayerCompositor.h: 2020-05-07 Antoine Quint <graouts@apple.com> Add watchOS media controls assets https://bugs.webkit.org/show_bug.cgi?id=211508 Unreviewed. Cleaning up some stray logging. * WebCore.xcodeproj/project.pbxproj: 2020-05-07 Darin Adler <darin@apple.com> Add some missing null checks for DocumentLoader https://bugs.webkit.org/show_bug.cgi?id=211544 rdar://62843516 Reviewed by Anders Carlsson. * loader/FrameLoader.cpp: (WebCore::FrameLoader::transitionToCommitted): Use some more RefPtr, and check for null before calling DocumentLoader::responseMIMEType. Also removed a comment that made no sense, and an assertion that was there for no reason, left over from some point in history where it made sense. * loader/HistoryController.cpp: (WebCore::FrameLoader::HistoryController::updateForRedirectWithLockedBackForwardList): Add checks for null before calling urlForHistory and isClientRedirect. 2020-05-07 Darin Adler <darin@apple.com> Remove USE(INSERTION_UNDO_GROUPING) checks in macOS platform code https://bugs.webkit.org/show_bug.cgi?id=211525 Reviewed by Anders Carlsson. * editing/mac/TextUndoInsertionMarkupMac.h: Remove NSTextInputContext_Private.h usage. Moving to NSTextInputContextSPI.h instead. Also remove #pragma once since this is an Objective-C-only header, not for cross-platform use. * editing/mac/TextUndoInsertionMarkupMac.mm: Above, plus move NSUndoManager_Private.h to NSUndoManagerSPI.h. 2020-05-07 Sergio Villar Senin <svillar@igalia.com> [Conditional=] not working for operations in WebGLRenderingContextBase.idl https://bugs.webkit.org/show_bug.cgi?id=211528 Reviewed by Chris Dumez. When an IDL interface under a given Condition defined an operation with another Condition the generated source file should guard the operation with both the Condition from the interface and the one from the operation. This was working fine for sole interfaces but not for those who were inheriting from a base one, i.e., it was not working for supplemental interfaces. Added a new minimalistic binding test showcasing the problem. * bindings/scripts/CodeGenerator.pm: (ProcessSupplementalDependencies): Add Conditionals from both interface and operation. * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::jsTestGlobalObjectTestOperationConditionalConstructorGetter): Updated result. (WebCore::jsTestGlobalObjectTestOperationConditionalConstructor): Ditto. (WebCore::setJSTestGlobalObjectTestOperationConditionalConstructorSetter): Ditto. (WebCore::setJSTestGlobalObjectTestOperationConditionalConstructor): Ditto. * bindings/scripts/test/JS/JSTestOperationBase.cpp: Added. * bindings/scripts/test/JS/JSTestOperationBase.h: Added. * bindings/scripts/test/JS/JSTestOperationConditional.cpp: Added. * bindings/scripts/test/JS/JSTestOperationConditional.h: Added. * bindings/scripts/test/TestOperationBase.idl: Added. * bindings/scripts/test/TestOperationConditional.idl: Added. 2020-05-07 Antti Koivisto <antti@apple.com> [Wheel event region] Include listeners on Window https://bugs.webkit.org/show_bug.cgi?id=211577 Reviewed by Simon Fraser. Test: fast/scrolling/mac/wheel-event-listener-region-window.html * dom/EventTarget.h: * dom/Node.h: * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::computeEventListenerRegionTypes): Take EventTarget so this can be used with DOMWindow. * style/StyleAdjuster.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): 2020-05-07 Simon Fraser <simon.fraser@apple.com> REGRESSION (r261056): [ Mac WK1 ] inspector/console/console-api.html is flaky crashing https://bugs.webkit.org/show_bug.cgi?id=211386 Reviewed by Darin Adler. Address additional review feedback. * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::unregisterScrollbar): 2020-05-07 Zalan Bujtas <zalan@apple.com> [LFC[TFC] Adjust the table wrapper box style https://bugs.webkit.org/show_bug.cgi?id=211574 Reviewed by Antti Koivisto. The computed values of properties 'position', 'float', 'margin-*', 'top', 'right', 'bottom', and 'left' on the table element are used on the table wrapper box and not the table box; all other values of non-inheritable properties are used on the table box and not the table wrapper box. https://www.w3.org/TR/CSS22/tables.html#model Test: fast/layoutformattingcontext/table-simple-with-border.html * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::isBlockContainerBox const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createLayoutBox): (WebCore::Layout::TreeBuilder::buildTableStructure): 2020-05-07 Andres Gonzalez <andresg_22@apple.com> Make debug build run in accessibility isolated tree mode = 1. https://bugs.webkit.org/show_bug.cgi?id=211567 Reviewed by Chris Fleizach. - Removed several unnecessary ASSERTs that prevent debug builds to run in isolated tree mode = 1, i.e., isolated tree mode on main thread. - AXIsolatedObject::children and updateBackingStore need to be executed on both threads. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::detachRemoteParts): (WebCore::AXIsolatedObject::children): Need to update the children regardless of the thread in which it is invoked. Pending, must add a lock to prevent thread collision. (WebCore::AXIsolatedObject::updateBackingStore): Need to update the backing store regardless of the thread in whhich it is invoked. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::setRootNodeID): * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: Enable isolated tree mode = 1. (-[WebAccessibilityObjectWrapperBase detach]): (-[WebAccessibilityObjectWrapperBase axBackingObject]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Use makeString instead of String concatenation as pointed out by Darin Adler in bug 210914. (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]): 2020-05-07 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Set section [top, left] used position. https://bugs.webkit.org/show_bug.cgi?id=211546 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-simple-with-padding.html * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutInFlowContent): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): * layout/tableformatting/TableFormattingContext.h: 2020-05-07 Antti Koivisto <antti@apple.com> [Wheel event region] Include listeners on Document https://bugs.webkit.org/show_bug.cgi?id=211571 Reviewed by Simon Fraser. Test: fast/scrolling/mac/wheel-event-listener-region-document.html * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::computeEventListenerRegionTypes): (WebCore::Style::computeEventListenerRegionTypes): Deleted. Make public and take Node instead of Element. * style/StyleAdjuster.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Gather event region bits from Document too. 2020-05-07 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r260769. https://bugs.webkit.org/show_bug.cgi?id=211578 Introduced regressions related to sharing (Requested by perarne on #webkit). Reverted changeset: "[Cocoa] After r258891, r255119 can be reverted" https://bugs.webkit.org/show_bug.cgi?id=211083 https://trac.webkit.org/changeset/260769 2020-05-07 Darin Adler <darin@apple.com> Fix assertions seen when trying to draw an absurdly large shadow https://bugs.webkit.org/show_bug.cgi?id=211541 rdar://62843377 Reviewed by Geoffrey Garen. * platform/graphics/IntSize.h: (WebCore::IntSize::unclampedArea const): Return uint64_t instead of size_t. Two 32-bit positive integers multiplied fit in a 64-bit integer, but there's no guarantee they fit in a "pointer sized" integer. * platform/graphics/ShadowBlur.cpp: (WebCore::ShadowBlur::drawRectShadow): When comparing an IntSize area with a FloatSize area, avoid checked overflow by using IntSize::unclampedArea, which returns something we can compare with a float. Using IntSize::area meant we'd intentionally crash the process if the area number doesn't fit in a 32-bit int, which is not important or helpful. (WebCore::ShadowBlur::drawRectShadowWithTiling): Make sure ScratchBuffer::scheduleScratchBufferPurge is always called after ScratchBuffer::getScratchBuffer, even it returns nullptr. An alternative would have been to change the logic inside getScratchBuffer, but this seems easier to get right, and no need to optimize the failure case. (WebCore::ShadowBlur::drawInsetShadowWithTiling): Ditto. 2020-05-07 Youenn Fablet <youenn@apple.com> Fix potential threading issue in AudioMediaStreamTrackRendererCocoa::render https://bugs.webkit.org/show_bug.cgi?id=211560 Reviewed by Eric Carlson. When the audio description is updated, the audio renderer is creating a new AudioSampleDataSource. The refing of the source in the render method is not sufficient to protect agains the change. For that purpose, we keep a separate reference to the source that is only used in the render method/render thread. We add a boolean that tells the render method whether to update its source reference. As long as the source reference is not updated, no new source will be created n the method processing the pushed samples. * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp: (WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples): (WebCore::AudioMediaStreamTrackRendererCocoa::render): * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h: 2020-05-07 Andres Gonzalez <andresg_22@apple.com> Fix for crash in AXIsolatedObject::identifierAttribute. https://bugs.webkit.org/show_bug.cgi?id=211565 Reviewed by Chris Fleizach. Covered by existing tests. When adding the identifierAttribute property to the AXIsolatedObject's properties map, must make an isolatedCopy of it in order to retrieve it on the secondary thread. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): 2020-05-07 Antti Koivisto <antti@apple.com> Add basic support for generating accurate wheel event listener region https://bugs.webkit.org/show_bug.cgi?id=211512 Reviewed by Simon Fraser. Add fake properties for wheel event listeners to RenderStyle and use them to generate regions in EventRegion. There is a separate region for non-passive wheel event listeners (that will require synchronous handling). The generated regions are not used for anything in this patch. Style is not yet invalided on event listener additions and removals. Test: fast/scrolling/mac/wheel-event-listener-region-basic.html * dom/Node.h: * rendering/EventRegion.cpp: (WebCore::EventRegion::unite): (WebCore::EventRegion::uniteEventListeners): (WebCore::EventRegion::dump const): * rendering/EventRegion.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateEventRegion): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::eventListenerRegionTypes const): (WebCore::RenderStyle::setEventListenerRegionTypes): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator== const): * rendering/style/StyleRareInheritedData.h: * style/StyleAdjuster.cpp: (WebCore::Style::computeEventListenerRegionTypes): (WebCore::Style::Adjuster::adjust const): 2020-05-07 Youenn Fablet <youenn@apple.com> Sending WebRTC network packets should not go through the main thread https://bugs.webkit.org/show_bug.cgi?id=211291 Reviewed by Eric Carlson. Covered by existing tests. * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::filterSDP const): Fix a case where the SDP would be badly formatted if we do not have yet a MDNS name for the corresponding IP address. Small refactoring to use early returns. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::LibWebRTCProvider::getStaticFactoryAndThreads): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: Add the ability for WebKit LibWebRTCProvider to do some processing on creation of the RTC threads. 2020-05-06 Sergio Villar Senin <svillar@igalia.com> [WebXR] Implement simulateUserActivation() https://bugs.webkit.org/show_bug.cgi?id=211516 Reviewed by Youenn Fablet. simulateUserActivation() is the method used by the WebXR Test API to mock a user activation and thus let WebXR API think that the user is behind the request that is going to be made in the function passed as argument. No new tests added as the imported WebXR web-platform-tests already make use of this API. * testing/WebXRTest.cpp: (WebCore::WebXRTest::simulateUserActivation): Implemented. * testing/WebXRTest.h: Added Document parameter. * testing/WebXRTest.idl: Call with Document. * testing/XRSimulateUserActivationFunction.h: Removed function params. * testing/XRSimulateUserActivationFunction.idl: Ditto. 2020-05-06 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com> and Fujii Hironori <Hironori.Fujii@sony.com> [Win] Implement DisplayRefreshMonitor by using RunLoop::Timer https://bugs.webkit.org/show_bug.cgi?id=211431 Reviewed by Don Olmstead. * PlatformWin.cmake: * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor): * platform/graphics/win/DisplayRefreshMonitorWin.cpp: Added. (WebCore::DisplayRefreshMonitorWin::create): (WebCore::DisplayRefreshMonitorWin::DisplayRefreshMonitorWin): (WebCore::DisplayRefreshMonitorWin::requestRefreshCallback): (WebCore::DisplayRefreshMonitorWin::displayLinkFired): * platform/graphics/win/DisplayRefreshMonitorWin.h: Added. 2020-05-06 Zalan Bujtas <zalan@apple.com> [ContentObservation] Shutterstock search bar is not activated on the first tap https://bugs.webkit.org/show_bug.cgi?id=211529 <rdar://problem/58843932> Reviewed by Simon Fraser. * page/Quirks.cpp: (WebCore::Quirks::shouldIgnoreContentObservationForSyntheticClick const): * page/Quirks.h: 2020-05-06 Jack Lee <shihchieh_lee@apple.com> Nullptr crash in indentOutdentCommand::formatRange with asynchronous commands: indent and insert list. https://bugs.webkit.org/show_bug.cgi?id=211466 <rdar://problem/62845430> Reviewed by Geoffrey Garen. Check for null outerBlock returned by splitTreeToNode and bail out. Test: fast/editing/indent-then-insertUL-crash.html * editing/IndentOutdentCommand.cpp: (WebCore::IndentOutdentCommand::indentIntoBlockquote): 2020-05-06 Darin Adler <darin@apple.com> Make a helper for the pattern of ICU functions that may need to be called twice to populate a buffer https://bugs.webkit.org/show_bug.cgi?id=211499 Reviewed by Ross Kirsling. * editing/TextIterator.cpp: (WebCore::normalizeCharacters): Use callBufferProducingFunction. 2020-05-06 Simon Fraser <simon.fraser@apple.com> REGRESSION (r261056): [ Mac WK1 ] inspector/console/console-api.html is flaky crashing https://bugs.webkit.org/show_bug.cgi?id=211386 Reviewed by Tim Horton. This bug was caused by the failure to clear the delegate on an NSScrollerImp when, for testing, we flip between the native scrollbar theme, and the mock scrollbar theme. The crux of the fix is to have ScrollAnimatorMac's scrollerImpForScrollbar() call a static function on ScrollbarThemeMac to get the painters, rather than going through the possibly-null ScrollbarThemeMac instance. A belt-and-braces fix in ScrollbarThemeMac::unregisterScrollbar() always clears the delegate on the NSScrollerImp when unregistering a scrollbar. Finally, modernize code in various places. * platform/mac/ScrollAnimatorMac.mm: (WebCore::scrollerImpForScrollbar): (WebCore::ScrollAnimatorMac::updateScrollerStyle): * platform/mac/ScrollbarThemeMac.h: * platform/mac/ScrollbarThemeMac.mm: (WebCore::scrollbarMap): (+[WebScrollbarPrefsObserver appearancePrefsChanged:]): (WebCore::ScrollbarThemeMac::registerScrollbar): (WebCore::ScrollbarThemeMac::unregisterScrollbar): (WebCore::ScrollbarThemeMac::setNewPainterForScrollbar): (WebCore::ScrollbarThemeMac::painterForScrollbar): (WebCore::ScrollbarThemeMac::hasThumb): (WebCore::ScrollbarThemeMac::minimumThumbLength): (WebCore::ScrollbarThemeMac::updateEnabledState): (WebCore::ScrollbarThemeMac::paint): 2020-05-06 Jack Lee <shihchieh_lee@apple.com> Nullptr crash in InsertListCommand::doApply with user-select:none elements https://bugs.webkit.org/show_bug.cgi?id=211534 <rdar://problem/62898521> Reviewed by Geoffrey Garen. Check for empty position in InsertListCommand::doApply when searching for the start of last paragraph in the selected range. Skip listifying individual paragraphs in the range. Test: editing/inserting/insert-list-user-select-none-crash.html * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::doApply): 2020-05-06 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r261239. Caused fast/events/wheel-event-outside-body.html to assert on macOS WK1 Reverted changeset: "Add basic support for generating accurate wheel event listener region" https://bugs.webkit.org/show_bug.cgi?id=211512 https://trac.webkit.org/changeset/261239 2020-05-06 Chris Dumez <cdumez@apple.com> REGRESSION (r260684): Reader background is lost after multitasking https://bugs.webkit.org/show_bug.cgi?id=211533 <rdar://problem/62941837> Unreviewed, revert r260684 due to regression. * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): * page/FrameView.cpp: (WebCore::FrameView::sendResizeEventIfNeeded): * page/Page.h: (WebCore::Page::shouldFireResizeEvents const): (WebCore::Page::setShouldFireResizeEvents): 2020-05-06 Chris Fleizach <cfleizach@apple.com> AX: Implement accessibility of HTML 5.1 Drag & Drop https://bugs.webkit.org/show_bug.cgi?id=211415 <rdar://problem/22695531> Reviewed by Joanmarie Diggs. Support HTML5 drag and drop. Support dropzone attribute. Add new notifications for VoiceOver to consume. It appears that most of the dragging tests are skipped because of eventSender issues. I think this test could do a little more if those issues were resolved. Specifically, not all the notifications are seen that are expected. Test: accessibility/mac/draggable.html * accessibility/AXObjectCache.h: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::supportsARIAAttributes const): (WebCore::AccessibilityObject::isAXHidden const): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::supportsDropping const): (WebCore::AccessibilityRenderObject::supportsDragging const): (WebCore::AccessibilityRenderObject::isGrabbed): (WebCore::AccessibilityRenderObject::determineDropEffects): (WebCore::AccessibilityRenderObject::supportsARIADropping const): Deleted. (WebCore::AccessibilityRenderObject::supportsARIADragging const): Deleted. (WebCore::AccessibilityRenderObject::isARIAGrabbed): Deleted. (WebCore::AccessibilityRenderObject::determineARIADropEffects): Deleted. * accessibility/AccessibilityRenderObject.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): * html/HTMLAttributeNames.in: * page/EventHandler.cpp: (WebCore::EventHandler::dispatchDragEvent): (WebCore::EventHandler::draggingElement const): * page/EventHandler.h: 2020-05-06 Wenson Hsieh <wenson_hsieh@apple.com> Cut and paste from Google Doc to Notes in several (non-Latin) languages doesn't work https://bugs.webkit.org/show_bug.cgi?id=211498 <rdar://problem/56675345> Reviewed by Darin Adler. When copying text in Google Docs, the page uses `DataTransfer.setData` to write text/html data to the system pasteboard. This markup string includes a meta tag with `charset="utf-8"`, indicating that the HTML string that was copied should be interpreted as UTF-8 data. However, before we write this data to the system pasteboard, we first sanitize it by loading it in a separate page, and then build the final sanitized markup string to write by iterating over only visible content in the main document of this page. Importantly, this last step skips over the meta element containing the charset. Later, when pasting in Notes or TextEdit, both apps use `-[NSAttributedString initWithData:...:]` to convert the HTML data on the pasteboard into an NSAttributedString. This takes the NSPasteboard's HTML data (a blob of `NSData`) and synchronously loads it in a new legacy WebKit view by calling `-[WebFrame loadData:MIMEType:textEncodingName:baseURL:]`, passing in `nil` as the text encoding name. Since WebKit is only given a blob of data and no particular encoding, we fall back to default Latin-1 encoding, which produces gibberish for CJK text. To fix this, we automatically insert a `<meta charset="utf-8">` tag when writing HTML to the pasteboard, if the sanitized markup contains non-ASCII characters. Test: CopyHTML.SanitizationPreservesCharacterSet * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp: (WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::sanitizeDataIfNeeded): Pass in AddMetaCharsetIfNeeded::Yes. * dom/DataTransfer.cpp: (WebCore::DataTransfer::setDataFromItemList): Pass in AddMetaCharsetIfNeeded::Yes here too. * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::sanitizeMarkupWithArchive): (WebCore::WebContentReader::readHTML): (WebCore::WebContentMarkupReader::readHTML): * editing/markup.cpp: (WebCore::sanitizeMarkup): Add a new enum so that we only add the extra meta tag when sanitizing content that is being written to the system pasteboard through one of the clipboard DOM APIs. (WebCore::sanitizedMarkupForFragmentInDocument): * editing/markup.h: 2020-05-06 Tim Horton <timothy_horton@apple.com> REGRESSION (r260753): Frequent crashes under TextIndicator's estimatedTextColorsForRange https://bugs.webkit.org/show_bug.cgi?id=211523 <rdar://problem/62860203> Reviewed by Darin Adler. * page/TextIndicator.cpp: (WebCore::estimatedTextColorsForRange): TextIterator's node() getter can return null. r260753 accidentally refactored away the null check. 2020-05-06 John Wilander <wilander@apple.com> Exempt app-bound domains from ITP's website data deletion and third-party cookie blocking between themselves https://bugs.webkit.org/show_bug.cgi?id=210674 <rdar://problem/61950767> Reviewed by Chris Dumez. This change adds functionality to NetworkStorageSession to allow it to exempt app-bound domains from third-party cookie blocking. Tests: http/tests/resourceLoadStatistics/exemptDomains/app-bound-domains-exempt-from-cookie-blocking-between-each-other.html http/tests/resourceLoadStatistics/exemptDomains/app-bound-domains-exempt-from-website-data-deletion-database.html http/tests/resourceLoadStatistics/exemptDomains/app-bound-domains-exempt-from-website-data-deletion.html * platform/network/NetworkStorageSession.cpp: (WebCore::NetworkStorageSession::shouldBlockCookies const): (WebCore::NetworkStorageSession::shouldExemptDomainPairFromThirdPartyCookieBlocking const): (WebCore::NetworkStorageSession::setAppBoundDomains): (WebCore::NetworkStorageSession::resetAppBoundDomains): * platform/network/NetworkStorageSession.h: 2020-05-06 Antti Koivisto <antti@apple.com> Add basic support for generating accurate wheel event listener region https://bugs.webkit.org/show_bug.cgi?id=211512 Reviewed by Simon Fraser. Add fake properties for wheel event listeners to RenderStyle and use them to generate regions in EventRegion. There is a separate region for non-passive wheel event listeners (that will require synchronous handling). The generated regions are not used for anything in this patch. Style is not yet invalided on event listener additions and removals. Test: fast/scrolling/mac/wheel-event-listener-region-basic.html * dom/Node.h: * rendering/EventRegion.cpp: (WebCore::EventRegion::unite): (WebCore::EventRegion::uniteEventListeners): (WebCore::EventRegion::dump const): * rendering/EventRegion.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateEventRegion): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::eventListenerRegionTypes const): (WebCore::RenderStyle::setEventListenerRegionTypes): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator== const): * rendering/style/StyleRareInheritedData.h: * style/StyleAdjuster.cpp: (WebCore::Style::computeEventListenerRegionTypes): (WebCore::Style::Adjuster::adjust const): 2020-05-06 Darin Adler <darin@apple.com> Remove now-unneeded USE(GRAMMAR_CHECKING) https://bugs.webkit.org/show_bug.cgi?id=211452 Reviewed by Anders Carlsson. * editing/Editor.cpp: (WebCore::Editor::advanceToNextMisspelling): Remove USE(GRAMMAR_CHECKING). (WebCore::Editor::isSelectionUngrammatical): Ditto. (WebCore::Editor::markMisspellingsOrBadGrammar): Ditto. (WebCore::Editor::markBadGrammar): Ditto. * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::markAllBadGrammar): Ditto. (WebCore::checkTextOfParagraph): Ditto. Also correct misspelling of the word "misspelling". * editing/TextCheckingHelper.h: Ditto. 2020-05-06 Devin Rousso <drousso@apple.com> ASSERT_WITH_MESSAGE(m_isOwnedByMainThread == isMainThread()) when web inspecting https://bugs.webkit.org/show_bug.cgi?id=203638 <rdar://problem/56761893> Reviewed by Brian Burg. Mark the `InspectorEnvironment::executionStopwatch` abstract function as `const` and have it return a `Stopwatch&` instead of a `RefPtr<Stopwatch>&` as callers assume that it exists. By not using a `RefPtr`, an additional `copyRef` can be avoided. * inspector/InspectorController.h: * inspector/InspectorController.cpp: (WebCore::InspectorController::executionStopwatch const): Added. (WebCore::InspectorController::executionStopwatch): Deleted. * inspector/WorkerInspectorController.h: (WebCore::WorkerInspectorController::executionStopwatch const): Added. (WebCore::WorkerInspectorController::executionStopwatch): Deleted. * inspector/agents/InspectorAnimationAgent.cpp: (WebCore::InspectorAnimationAgent::startTracking): (WebCore::InspectorAnimationAgent::stopTracking): (WebCore::InspectorAnimationAgent::willApplyKeyframeEffect): (WebCore::InspectorAnimationAgent::stopTrackingDeclarativeAnimation): * inspector/agents/InspectorCPUProfilerAgent.cpp: (WebCore::InspectorCPUProfilerAgent::startTracking): (WebCore::InspectorCPUProfilerAgent::stopTracking): (WebCore::InspectorCPUProfilerAgent::collectSample): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::mediaMetricsTimerFired): * inspector/agents/InspectorMemoryAgent.cpp: (WebCore::InspectorMemoryAgent::startTracking): (WebCore::InspectorMemoryAgent::stopTracking): (WebCore::InspectorMemoryAgent::didHandleMemoryPressure): (WebCore::InspectorMemoryAgent::collectSample): * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildObjectForTiming): (WebCore::InspectorNetworkAgent::timestamp): (WebCore::InspectorNetworkAgent::didFinishLoading): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::enable): (WebCore::InspectorPageAgent::timestamp): * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::timestamp): 2020-05-06 Darin Adler <darin@apple.com> Eliminate checks of USE(DICTATION_ALTERNATIVES) in Cocoa-specific code https://bugs.webkit.org/show_bug.cgi?id=211460 Reviewed by Anders Carlsson. * editing/cocoa/AlternativeTextContextController.h: Remove USE(DICTATION_ALTERNATIVES). Also remove unnecessary use of RetainPtr and add a FIXME. Also remove #pragma once since this header is only imported from Objective-C++ sources. * editing/cocoa/AlternativeTextContextController.mm: Ditto. * editing/cocoa/AlternativeTextUIController.h: Ditto. * editing/cocoa/AlternativeTextUIController.mm: Ditto. * editing/mac/TextAlternativeWithRange.h: Ditto. * editing/mac/TextAlternativeWithRange.mm: Ditto. 2020-05-06 Simon Fraser <simon.fraser@apple.com> Factor EventHandler code that sends mouseEnteredContentArea/mouseExitedContentArea into its own function https://bugs.webkit.org/show_bug.cgi?id=211494 Reviewed by Antti Koivisto. mouseEnteredContentArea/mouseEnteredContentArea are used only to notify overlay scrollbars of state changes. Factor the code that calls these functions into a separate EventHandler function, and refactor it for clarity, now we know that both lastElementUnderMouse and elementUnderMouse must belong to this EventHandler's Frame's Document. * page/EventHandler.cpp: (WebCore::EventHandler::updateMouseEventTargetNode): (WebCore::EventHandler::notifyScrollableAreasOfMouseEnterExit): * page/EventHandler.h: 2020-05-06 Zalan Bujtas <zalan@apple.com> [LFC] BlockFormattingContext::computeHeightAndMargin should special case the table box https://bugs.webkit.org/show_bug.cgi?id=211493 Reviewed by Antti Koivisto. By the time we get to BlockFormattingContext::computeHeightAndMargin(), the used valued for the table height is already been computed. (Table box height is mostly content driven, and both the computed height and the min/max pair are taken into account while we are laying out the table content). * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): 2020-05-06 Antoine Quint <graouts@apple.com> Add watchOS media controls assets https://bugs.webkit.org/show_bug.cgi?id=211508 <rdar://problem/62926565> Reviewed by Eric Carlson. * Modules/modern-media-controls/images/watchOS/ActivityIndicatorSpriteCompact@2x.png: Added. * Modules/modern-media-controls/images/watchOS/InvalidCompact.pdf: Added. * Modules/modern-media-controls/images/watchOS/PlayCompact.pdf: Added. * WebCore.xcodeproj/project.pbxproj: 2020-05-06 Zalan Bujtas <zalan@apple.com> [LFC][BFC] FormattingContext::ConstraintsForInFlowContent should include the computed value of height https://bugs.webkit.org/show_bug.cgi?id=211487 Reviewed by Antti Koivisto. When the formatting context root has fixed height, the computed value should be passed in to the formatting context layout as the available vertical space. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::constraintsForInFlowContent): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): 2020-04-29 Sergio Villar Senin <svillar@igalia.com> [WebXR] Implement isSessionSupported() https://bugs.webkit.org/show_bug.cgi?id=211187 Reviewed by Dean Jackson. The isSessionSupported() method queries if a given mode may be supported by the UA and device capabilities. Apart from the needed machinery in the webxr Module we're adding an OpenXR implementation of the enumerateImmersiveXRDevices() method required by isSessionSupported(). The method is not completely implemented as it lacks a few action at its very end, like firing events. They'll be implemented in follow up patches as they require additional changes. Some OpenXR runtimes as Monado always enumerate at least one device even if none is connected. This dummy device might interfere with tests execution (as there will be more devices than expected) so we're adding a testMode to WebXRSystem which does not query platform for existing devices. Added expected results and unskipped some WPT that are now passing. * Modules/webxr/WebXRSystem.cpp: (WebCore::WebXRSystem::ensureImmersiveXRDeviceIsSelected): Asks platform code for the list of attached XR devices and properly set the active immersive device if any. (WebCore::WebXRSystem::isSessionSupported): Partially implemented. (WebCore::WebXRSystem::registerSimulatedXRDeviceForTesting): Set the passed in mock device as either the current active immersive or inline device. (WebCore::WebXRSystem::unregisterSimulatedXRDeviceForTesting): Removes the passed in mock device from the list of immersive devices. * Modules/webxr/WebXRSystem.h: * html/FeaturePolicy.cpp: (WebCore::policyTypeName): Handle XRSpatialTracking. (WebCore::FeaturePolicy::parse): Parse "xr-spatial-tracking". (WebCore::FeaturePolicy::allows const): Handle XRSpatialTracking. * html/FeaturePolicy.h: Added XRSpatialTracking. * platform/xr/PlatformXR.h: (PlatformXR::Instance::immersiveXRDevices const): Keep a list of immersive devices. * platform/xr/openxr/PlatformXR.cpp: (PlatformXR::Instance::Impl::collectSupportedSessionModes): Gather supported session modes for a given device from OpenXR. (PlatformXR::Instance::enumerateImmersiveXRDevices): Collect devices from OpenXR. We are currently asking for HMD devices. 2020-05-06 Antoine Quint <graouts@apple.com> [Web Animations] Coordinate "update animations and send events" procedure across multiple timelines https://bugs.webkit.org/show_bug.cgi?id=202109 Unreviewed. Remove an unused function. * animation/AnimationTimeline.h: (WebCore::AnimationTimeline::allAnimations const): Deleted. 2020-05-05 Antoine Quint <graouts@apple.com> Fix animation ordering to make imported/w3c/web-platform-tests/css/css-animations/Element-getAnimations.tentative.html pass https://bugs.webkit.org/show_bug.cgi?id=211468 <rdar://problem/62732578> Reviewed by David Kilzer. The "Animation composite order" section of the CSS Animations Level 2 specification (https://drafts.csswg.org/css-animations-2/#animation-composite-order) defines the relative composite order of animations. We bake this into compareAnimationsByCompositeOrder(), but this function would not yield consistent results if it is called in a non-stable sort, because if both CSSAnimation objects passed to this function have the same backing Animation object, they would not return the same value if passed in a different order. The Web Animations spec always ensures that procedures that sort using the composite order are called as part of a stable sort. So we change all call sites to use std::stable_sort and add an assertion in case we have two CSSAnimation objects with the same backing Animation objects to catch cases like this in the future. Finally, since we already know only relevant animations can find their way into the output of Document::getAnimations(), we also ensure we iterate over m_animations (which holds only relevant animations) rather than m_allAnimations (which may not). * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::getAnimations const): * animation/KeyframeEffectStack.cpp: (WebCore::KeyframeEffectStack::ensureEffectsAreSorted): * animation/WebAnimationUtilities.cpp: (WebCore::compareAnimationsByCompositeOrder): 2020-05-05 Simon Fraser <simon.fraser@apple.com> EventHandler::dispatchMouseEvent() cleanup https://bugs.webkit.org/show_bug.cgi?id=211491 Reviewed by Zalan Bujtas. Replace the last bool argument with FireMouseOverOut, and remove the "cancelable" argument that was unused. * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEvent): (WebCore::EventHandler::handleMouseDoubleClickEvent): (WebCore::EventHandler::handleMouseMoveEvent): (WebCore::EventHandler::handleMouseReleaseEvent): (WebCore::EventHandler::handleMouseForceEvent): (WebCore::EventHandler::dispatchMouseEvent): (WebCore::EventHandler::sendContextMenuEvent): * page/EventHandler.h: 2020-05-05 Rob Buis <rbuis@igalia.com> Fix setting host on URL when no port is specified https://bugs.webkit.org/show_bug.cgi?id=211453 Reviewed by Darin Adler. Behavior matches Firefox and Chrome. Test: web-platform-tests/url/url-setters.html * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setHost): 2020-05-05 Simon Fraser <simon.fraser@apple.com> Minor EventHandler and test cleanup https://bugs.webkit.org/show_bug.cgi?id=211475 Reviewed by Zalan Bujtas. Now that we assert that m_elementUnderMouse and m_lastElementUnderMouse are either null or in this EventHandler's document, we can remove the document comparisons (but this code is probably wrong as well). Fix enclosingScrollableArea(), which would return any RenderLayer, but should only return scrollable ones, and should only return scrollable RenderListBoxes. * page/EventHandler.cpp: (WebCore::enclosingScrollableArea): (WebCore::EventHandler::updateMouseEventTargetNode): 2020-05-05 David Kilzer <ddkilzer@apple.com> Fix deprecated NSGraphicsContext methods using 'graphicsPort' <https://webkit.org/b/211481> Reviewed by Darin Adler. - Replace uses of -graphicsPort with -CGContext. - Replace uses of -graphicsContextWithGraphicsPort:flipped: with -graphicsContextWithCGContext:flipped:. - Remove ALLOW_DEPRECATED_DECLARATIONS_{BEGIN,END} if possible. * platform/cocoa/DragImageCocoa.mm: (WebCore::createDragImageForLink): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayer::drawLayerContents): * platform/mac/ThemeMac.mm: (WebCore::drawCellFocusRingWithFrameAtTime): * platform/mac/WidgetMac.mm: (WebCore::Widget::paint): 2020-05-05 Pinki Gyanchandani <pgyanchandani@apple.com> Crash in match_constness<WebCore::CSSValue, WebCore::CSSPrimitiveValue>::type& WTF::downcast<WebCore::CSSPrimitiveValue, WebCore::CSSValue> -- ASAN https://bugs.webkit.org/show_bug.cgi?id=211479 Reviewed by Geoffrey Garen. Added check to downcast CSSValue to CSSPrimitiveValue, only if valid CSSPrimitveValue is associated with the property. New test would be added to Internal repository. * css/StyleProperties.cpp: (WebCore::StyleProperties::pageBreakPropertyValue const): 2020-05-05 Peng Liu <peng.liu6@apple.com> Update WebKitTestRunner to support running multiple video fullscreen and Picture-in-Picture tests simultaneously https://bugs.webkit.org/show_bug.cgi?id=203723 Reviewed by Jer Noble. Test: media/video-presentation-mode.html Add a flag MockVideoPresentationModeEnabled to "internals" for video fullscreen and picture-in-picture tests. * page/ChromeClient.h: (WebCore::ChromeClient::setMockVideoPresentationModeEnabled): * testing/Internals.cpp: (WebCore::Internals::setMockVideoPresentationModeEnabled): * testing/Internals.h: * testing/Internals.idl: 2020-05-05 Darin Adler <darin@apple.com> Remove HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT) https://bugs.webkit.org/show_bug.cgi?id=211461 Reviewed by Eric Carlson. * PlatformMac.cmake: Removed InbandTextTrackPrivateLegacyAVFObjC.mm. * SourcesCocoa.txt: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto, also the header. * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.h: Removed. * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: Removed. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: Removed HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT). Also moved data member initialization to the class definition, made more things private and final, made outputObscuredDueToInsufficientExternalProtectionChanged unconditional, changed friend class MediaPlayerFactoryAVFoundationObjC into member class MediaPlayerPrivateAVFoundationObjC::Factory, removed unused removeSession function, and tweaked conditionals. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Removed import of InbandTextTrackPrivateLegacyAVFObjC.h. Moved data member initialization to the class definition. Moved include of BinarySemaphore here. 2020-05-05 Simon Fraser <simon.fraser@apple.com> Assert that EventHandler only tracks event target nodes in its own document https://bugs.webkit.org/show_bug.cgi?id=211462 Reviewed by Zalan Bujtas. EventHandler is per-Frame, so should not track Nodes from different documents. However, it did so by mistake if an event handler moved a node between documents. * page/EventHandler.cpp: (WebCore::EventHandler::updateMouseEventTargetNode): * rendering/HitTestResult.cpp: (WebCore::HitTestResult::targetNode const): 2020-05-05 Antti Koivisto <antti@apple.com> Factor RenderLayerBacking::updateEventRegion skip conditions into a lambda https://bugs.webkit.org/show_bug.cgi?id=211450 Reviewed by Simon Fraser. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateEventRegion): 2020-05-05 Chris Dumez <cdumez@apple.com> Drop code path using the legacy CFNetwork cookie change notification SPI https://bugs.webkit.org/show_bug.cgi?id=211411 <rdar://problem/62869148> Reviewed by John Wilander. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::registerCookieChangeListenersIfNecessary): (WebCore::NetworkStorageSession::unregisterCookieChangeListenersIfNecessary): (WebCore::NetworkStorageSession::supportsCookieChangeListenerAPI const): 2020-05-05 Timothy Horton <timothy_horton@apple.com> "Essential Skeleton" does not respond to mouse events, only touch events https://bugs.webkit.org/show_bug.cgi?id=211439 <rdar://problem/62694519> Reviewed by Wenson Hsieh. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isEssentialSkeleton): 2020-05-05 Megan Gardner <megan_gardner@apple.com> Style is not applied when changed on the first line of a new mail message. https://bugs.webkit.org/show_bug.cgi?id=211200 <rdar://problem/62087514> Reviewed by Darin Adler. After r257487 when we resign first responder, we immediatly update activity state. This means that if we resign first responder, and then become first responder, we are clearing the selection if the caret is at the beginning of the document, due to a check in setSelectionFromNone. This check was originally added in 2006 because it happened to fix <rdar://problem/4483145>. Removing this check and merging the iOS and Mac logic. Test: editing/execCommand/ios/first-line-text-attribute-change-presist-through-resigning-first-responder.html * editing/FrameSelection.cpp: (WebCore::FrameSelection::setSelectionFromNone): 2020-05-05 Rob Buis <rbuis@igalia.com> A URL cannot have a username/password/port if its host is null https://bugs.webkit.org/show_bug.cgi?id=211358 Reviewed by Darin Adler. A URL cannot have a username/password/port if its host is null [1], so adjust URL.cpp accordingly. Behavior matches Chrome and Firefox. [1] https://url.spec.whatwg.org/#cannot-have-a-username-password-port * html/URLDecomposition.cpp: (WebCore::URLDecomposition::setUsername): (WebCore::URLDecomposition::setPassword): (WebCore::URLDecomposition::setPort): 2020-05-05 Youenn Fablet <youenn@apple.com> MediaPlayerPrivateMediaStreamAVFObjC should unobserve the tracks from its audio and video track sets https://bugs.webkit.org/show_bug.cgi?id=211444 <rdar://problem/62886221> Reviewed by Eric Carlson. Test: fast/mediastream/MediaStream-removeTrack-while-playing.html * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): We keep maps of audio and video tracks we are observing. Use these two maps to properly unobserve all tracks at destruction time. While this is not strictly needed since we are using weak pointers, this helps keeping the code healthy. * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::forEachObserver): Add a debug ASSERT so that we ensure add/remove observers is done properly. 2020-05-05 Chris Dumez <cdumez@apple.com> Unreviewed, reverting r261130. Caused crashes on some of our bots Reverted changeset: "Drop code path using the legacy CFNetwork cookie change notification SPI" https://bugs.webkit.org/show_bug.cgi?id=211411 https://trac.webkit.org/changeset/261130 2020-05-05 Darin Adler <darin@apple.com> Remove now-unneeded USE(COREMEDIA) and USE(VIDEOTOOLBOX) https://bugs.webkit.org/show_bug.cgi?id=211437 Reviewed by Eric Carlson. * platform/cocoa/VideoToolboxSoftLink.cpp: Remove USE(VIDEOTOOLBOX). * platform/cocoa/VideoToolboxSoftLink.h: Ditto. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer): Ditto. (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Ditto. (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage): Ditto. * platform/graphics/cocoa/WebCoreDecompressionSession.h: Ditto. Also remove #pragma once since this header is only used with #import, not #include. * platform/graphics/cocoa/WebCoreDecompressionSession.mm: Ditto. * platform/graphics/cv/ImageRotationSessionVT.h: Ditto. * platform/graphics/cv/ImageRotationSessionVT.mm: Ditto. * platform/graphics/cv/ImageTransferSessionVT.h: Ditto. * platform/graphics/cv/ImageTransferSessionVT.mm: Ditto. * platform/graphics/cv/PixelBufferConformerCV.cpp: (WebCore::PixelBufferConformerCV::PixelBufferConformerCV): Ditto. (WebCore::PixelBufferConformerCV::convert): Ditto. (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer): Ditto. * platform/graphics/cv/PixelBufferConformerCV.h: Ditto. 2020-05-05 Youenn Fablet <youenn@apple.com> Remove LegacySchemeRegistry::canServiceWorkersHandleURLScheme https://bugs.webkit.org/show_bug.cgi?id=211170 Reviewed by Alex Christensen. Since we no longer use custom service worker schemes in API tests, we no longer need custom schemes in web process, given they are not supported in network process anyway. Remove related code. * Modules/cache/DOMWindowCaches.idl: * bindings/scripts/CodeGeneratorJS.pm: (NeedsRuntimeCheck): (GenerateRuntimeEnableConditionalString): * bindings/scripts/IDLAttributes.json: * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::hasServiceWorkerScheme const): Deleted. * dom/ScriptExecutionContext.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::matchRegistration): (WebCore::DocumentLoader::commitData): * page/NavigatorServiceWorker.idl: * platform/LegacySchemeRegistry.cpp: (WebCore::serviceWorkerSchemes): Deleted. (WebCore::LegacySchemeRegistry::registerURLSchemeServiceWorkersCanHandle): Deleted. (WebCore::LegacySchemeRegistry::canServiceWorkersHandleURLScheme): Deleted. (WebCore::LegacySchemeRegistry::isServiceWorkerContainerCustomScheme): Deleted. * platform/LegacySchemeRegistry.h: * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::addRegistration): 2020-05-05 Darin Adler <darin@apple.com> Remove now-unneeded HAVE(DISALLOWABLE_USER_INSTALLED_FONTS) https://bugs.webkit.org/show_bug.cgi?id=211428 Reviewed by Anders Carlsson. * platform/graphics/Font.h: Removed isUserInstalledFont, only used for an assertion that I took the liberty of removing. * platform/graphics/FontCascadeFonts.cpp: (WebCore::FontCascadeFonts::glyphDataForSystemFallback): Removed an assertion since it was the only reason to introduce the concept of a user-installed font to the cross-platform code. The assertion is a bit of a self-check that doesn't seem critical. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::singleton): Deleted. (WebCore::FontDatabase::singletonAllowingUserInstalledFonts): Remove HAVE(DISALLOWABLE_USER_INSTALLED_FONTS). (WebCore::FontDatabase::singletonDisallowingUserInstalledFonts): Ditto. (WebCore::isUserInstalledFont): Ditto. (WebCore::addAttributesForInstalledFonts): Ditto. (WebCore::isFontMatchingUserInstalledFontFallback): Ditto. (WebCore::addAttributesForWebFonts): Ditto. (WebCore::installedFontMandatoryAttributes): Ditto. * platform/graphics/mac/SimpleFontDataCoreText.cpp: (WebCore::Font::isUserInstalledFont const): Deleted. 2020-05-05 Alicia Boya García <aboya@igalia.com> [GStreamer] Video loops when ran in rr record --chaos https://bugs.webkit.org/show_bug.cgi?id=211182 Reviewed by Philippe Normand. While trying to investigate a different bug, I ran the browser with `rr record --chaos`, which makes it run very slowly and shuffles thread scheduling to try to make existing race conditions more likely to show up, also inevitably making the software run very slow. Doing so I found something strange: the video kept looping even though it didn't have the `loop` attribute set. After some debugging I found that MediaPlayer decides if the video has ended in part by checking `currentMediaTime()` is greater or equal to the video duration, which was not guaranteed to be the case in MediaPlayerPrivateGStreamer. As a consequence of this patch, one new LayoutTest has passed. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): 2020-05-05 Zalan Bujtas <zalan@apple.com> [LFC] Rename computedContentHeight/Width to computedHeight/Width https://bugs.webkit.org/show_bug.cgi?id=211432 Reviewed by Darin Adler. These functions used to return the computed content box height/width but with box-sizing support the name is not correct anymore. * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedHeight const): (WebCore::Layout::FormattingContext::Geometry::computedWidth const): (WebCore::Layout::FormattingContext::Geometry::computedMinHeight const): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases const): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const): (WebCore::Layout::FormattingContext::Geometry::computedContentHeight const): Deleted. (WebCore::Layout::FormattingContext::Geometry::computedContentWidth const): Deleted. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const): (WebCore::Layout::TableFormattingContext::Geometry::computedColumnWidth const): 2020-05-05 Antoine Quint <graouts@apple.com> Unreviewed, reverting r260989. Mistakenly identified cause of MotionMark 1.1 performance regression Reverted changeset: "REGRESSION: MotionMark 1.1 regressed due to r260016" https://bugs.webkit.org/show_bug.cgi?id=211280 https://trac.webkit.org/changeset/260989 2020-05-05 Alexey Shvayka <shvaikalesh@gmail.com> Object.prototype.toString is not spec-perfect https://bugs.webkit.org/show_bug.cgi?id=199138 Reviewed by Darin Adler and Keith Miller. This patch defines @@toStringTag symbols for all WebIDL prototypes, including interfaces that are not exposed, as required by the spec [1]. With updated JSObject::toStringName() and @@toStringTag symbols added in r260992, className() and toStringName() methods of JSDOMConstructorBase can be safely removed. [1]: https://heycam.github.io/webidl/#dfn-class-string Tests: imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-interface.any.js imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-iterator-prototype-object.any.js * bindings/js/JSDOMConstructorBase.cpp: (WebCore::JSDOMConstructorBase::className): Deleted. (WebCore::JSDOMConstructorBase::toStringName): Deleted. * bindings/js/JSDOMConstructorBase.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GeneratePrototypeDeclaration): * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::JSTestGlobalObjectPrototype::finishCreation): 2020-05-04 Darin Adler <darin@apple.com> [Mac] Remove __MAC_OS_X_VERSION_MIN_REQUIRED checks for versions older than 10.14 https://bugs.webkit.org/show_bug.cgi?id=211420 Reviewed by Alex Christensen. * editing/cocoa/DataDetection.mm: (WebCore::detectItem): Remove __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400. * editing/cocoa/HTMLConverter.mm: (_WebMessageDocumentClass): Ditto. * platform/graphics/cg/GraphicsContextCG.cpp: Ditto. * platform/mac/WebCoreFullScreenPlaceholderView.mm: (-[WebCoreFullScreenPlaceholderView initWithFrame:]): Ditto. * platform/network/cocoa/CookieCocoa.mm: (WebCore::nsSameSitePolicy): Ditto. (WebCore::Cookie::operator NSHTTPCookie * _Nullable const): Ditto. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::cookiesForURL): Ditto. (WebCore::NetworkStorageSession::setHTTPCookiesForURL const): Ditto. * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::doUpdateResourceRequest): Ditto. (WebCore::siteForCookies): Ditto. (WebCore::ResourceRequest::doUpdatePlatformRequest): Ditto. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintTextField): Ditto. * testing/Internals.h: Ditto. 2020-05-04 Darin Adler <darin@apple.com> Remove now-unneeded HAVE(NETWORK_EXTENSION) https://bugs.webkit.org/show_bug.cgi?id=211424 Reviewed by Alex Christensen. * loader/ContentFilter.cpp: (WebCore::ContentFilter::types): Remove check of HAVE(NETWORK_EXTENSION), not needed because ENABLE(CONTENT_FILTER) is only done on Cocoa platforms, and HAVE(NETWORK_EXTENSION) is true for all of those. * platform/cocoa/NetworkExtensionContentFilter.mm: Ditto. 2020-05-04 Darin Adler <darin@apple.com> Remove now-unneeded HAVE(SEC_TRUST_EVALUATE_WITH_ERROR) https://bugs.webkit.org/show_bug.cgi?id=211429 Reviewed by Alex Christensen. * platform/network/cocoa/ResourceResponseCocoa.mm: (WebCore::ResourceResponse::platformCertificateInfo const): Remove HAVE(SEC_TRUST_EVALUATE_WITH_ERROR). 2020-05-04 Simon Fraser <simon.fraser@apple.com> Code cleanup in EventHandler https://bugs.webkit.org/show_bug.cgi?id=211413 Reviewed by Tim Horton. Use a better name for "hoveredNode" which is a HitTestResult. Convert Frame* to Frame&. Have a couple of helper functions return RefPtr<Frame>. * page/AutoscrollController.cpp: (WebCore::AutoscrollController::stopAutoscrollTimer): * page/EventHandler.cpp: (WebCore::EventHandler::subframeForHitTestResult): (WebCore::EventHandler::subframeForTargetNode): (WebCore::EventHandler::handleMousePressEvent): (WebCore::EventHandler::handleMouseDoubleClickEvent): (WebCore::EventHandler::mouseMoved): (WebCore::EventHandler::passMouseMovedEventToScrollbars): (WebCore::EventHandler::handleMouseMoveEvent): (WebCore::EventHandler::handleMouseReleaseEvent): (WebCore::EventHandler::passMousePressEventToScrollbar): (WebCore::EventHandler::passMousePressEventToSubframe): (WebCore::EventHandler::passMouseReleaseEventToSubframe): (WebCore::EventHandler::passWidgetMouseDownEventToWidget): (WebCore::EventHandler::passMouseMoveEventToSubframe): * page/EventHandler.h: * page/ios/EventHandlerIOS.mm: (WebCore::EventHandler::passSubframeEventToSubframe): (WebCore::EventHandler::passMousePressEventToSubframe): (WebCore::EventHandler::passMouseMoveEventToSubframe): (WebCore::EventHandler::passMouseReleaseEventToSubframe): (WebCore::EventHandler::tryToBeginDragAtPoint): * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::passSubframeEventToSubframe): (WebCore::EventHandler::passMousePressEventToSubframe): (WebCore::EventHandler::passMouseMoveEventToSubframe): (WebCore::EventHandler::passMouseReleaseEventToSubframe): * page/win/EventHandlerWin.cpp: (WebCore::EventHandler::passMouseMoveEventToSubframe): 2020-05-04 Ben Nham <nham@apple.com> IndexedDB WAL file keeps growing while app is in use https://bugs.webkit.org/show_bug.cgi?id=202137 Reviewed by Brady Eidson. It's easy to get into a situation where the WAL file associated with a SQLite-backed IndexedDB grows indefinitely while a site is in use for two reasons: 1. We don't promptly reset cached prepared statements in SQLiteIDBBackingStore. Many statements are left hanging in the SQLITE_ROW state without being reset or fully stepped to the SQLITE_DONE state. These hanging statements keep their associated transactions open and prevent the WAL checkpointer from progressing past those active transactions. To fix this, I added SQLiteStatementAutoResetScope. This is a scope guard that SQLiteIDBBackingStore uses to ensure that cached statements are reset in a timely manner. While going through the reset code I also noticed we aren't clearing bindings after resetting statements. We should be doing this because sqlite3_reset does not clear bindings (and their associated copies of blobs/strings); sqlite3_clear_bindings does that. 2. The default WAL hook for auto-checkpointing in upstream SQLite uses the SQLITE_CHECKPOINT_PASSIVE mode, which doesn't truncate the WAL until the next write transaction occurs. (It actually doesn't truncate at all when compiled with default settings, but macOS's SQLite sets SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT, which causes the truncation to occur on the next write.) We want the WAL to be truncated more promptly, because otherwise the quota check that happens on each mutation won't be as accurate. To do this, I installed a WAL hook that truncates the WAL with SQLITE_CHECKPOINT_TRUNCATE after the default threshold of 1000 WAL pages. I didn't enable this for all SQLiteDatabases because this checkpoint call can block on the busy handler. This isn't a problem for IDB since we don't use busy handlers in IDB. * Headers.cmake: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo): (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey): (WebCore::IDBServer::SQLiteIDBBackingStore::getCount): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue): (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatement): * Modules/indexeddb/server/SQLiteIDBBackingStore.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/sql/SQLiteDatabase.cpp: (WebCore::walAutomaticTruncationHook): (WebCore::SQLiteDatabase::enableAutomaticWALTruncation): * platform/sql/SQLiteDatabase.h: * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::reset): * platform/sql/SQLiteStatementAutoResetScope.cpp: Added. (WebCore::SQLiteStatementAutoResetScope::SQLiteStatementAutoResetScope): (WebCore::SQLiteStatementAutoResetScope::operator=): (WebCore::SQLiteStatementAutoResetScope::~SQLiteStatementAutoResetScope): * platform/sql/SQLiteStatementAutoResetScope.h: Added. (WebCore::SQLiteStatementAutoResetScope::operator bool const): (WebCore::SQLiteStatementAutoResetScope::operator! const): (WebCore::SQLiteStatementAutoResetScope::get): (WebCore::SQLiteStatementAutoResetScope::operator->): 2020-05-04 Wenson Hsieh <wenson_hsieh@apple.com> Tapping to focus editable elements should start caret selection at word boundary https://bugs.webkit.org/show_bug.cgi?id=211409 <rdar://problem/62869098> Reviewed by Megan Gardner. Match platform behavior when focusing editable text content by beginning the caret selection at word granularity (i.e. the start or end of a word), rather than character granularity. This will match behavior of other editable widgets on iOS (such as UITextField and UITextView), as well as our current behavior when tapping to change the selection when the text interaction is editable (i.e. when the caret is already visible when tapping). Rebaselined existing layout tests. * editing/VisibleUnits.cpp: (WebCore::wordBoundaryForPositionWithoutCrossingLine): Move logic previously in `WebPage::selectWithGesture` down into `VisibleUnits.h`, as a new standalone helper function. Given a `VisiblePosition`, this new helper will return the given position if it is either already at word boundary or line boundary; if it is within the boundary of a word, it will instead return the start or end of the word. * editing/VisibleUnits.h: * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEventSingleClick): When setting the selection due to a synthetic single click, automatically adjust the caret position to be at word boundary instead of using the hit-tested position directly. 2020-05-04 Darin Adler <darin@apple.com> Make __IPHONE_OS_VERSION_MIN_REQUIRED checks against old versions explicit about watchOS and tvOS https://bugs.webkit.org/show_bug.cgi?id=211402 Reviewed by Alexey Proskuryakov. * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::attributesForAttributedStringConversion): Move from __IPHONE_OS_VERSION_MIN_REQUIRED to !PLATFORM(WATCHOS) && !PLATFORM(APPLETV). Move NSExcludedElementsDocumentAttribute to AttributedStringSPI.h. * page/SettingsDefaultValues.h: Rewrite conic gradient conditional to call out tvOS as an exception rather than doing that indirectly through __IPHONE_OS_VERSION_MIN_REQUIRED. * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::paint): Ditto. * platform/graphics/cocoa/FontCacheCoreText.cpp: Rewrite HAS_CORE_TEXT_WIDTH_ATTRIBUTE to use !PLATFORM(WATCHOS) && !PLATFORM(APPLETV). (WebCore::variationCapabilitiesForFontDescriptor): Ditto. (WebCore::FontCache::lastResortFallbackFont): Ditto. * platform/graphics/cocoa/FontDescriptionCocoa.cpp: (WebCore::matchSystemFontUse): Use HAVE(SYSTEM_FONT_STYLE_TITLE_0) and HAVE(SYSTEM_FONT_STYLE_TITLE_4) instead of __IPHONE_OS_VERSION_MIN_REQUIRED. This consolidates the watchOS/tvOS issue into the PlatformHave.h file, and does not change behavior at this time. * platform/graphics/cocoa/FontPlatformDataCocoa.mm: (WebCore::cascadeToLastResortAttributesDictionary): Changed this to not use a global since it's only called as part of initializing another global, and to return a RetainPtr. (WebCore::cascadeToLastResortAndVariationsFontDescriptor): Removed WORKAROUND_CORETEXT_VARIATIONS_WITH_FALLBACK_LIST_BUG after researching to be sure it's fixed on recent watchOS and tvOS. Also changed this to return a raw pointer instead of RetainPtr since it returns a single global object. Also removed the CTFontRef argument. (WebCore::FontPlatformData::ctFont const): Updated for the changes above. * platform/graphics/cocoa/IOSurface.mm: (WebCore::IOSurface::surfaceID const): Move from __IPHONE_OS_VERSION_MIN_REQUIRED to !PLATFORM(WATCHOS) && !PLATFORM(APPLETV). * platform/graphics/ios/FontCacheIOS.mm: (WebCore::platformFontWithFamilySpecialCase): Ditto. * platform/graphics/mac/FontCustomPlatformData.cpp: (WebCore::createFontCustomPlatformData): Ditto. 2020-05-04 Darin Adler <darin@apple.com> Remove HAVE(IOSURFACE) checks in Cocoa-platform-specific code https://bugs.webkit.org/show_bug.cgi?id=211389 Reviewed by Alexey Proskuryakov. * page/cocoa/MemoryReleaseCocoa.mm: (WebCore::platformReleaseMemory): Remove HAVE(IOSURFACE) since it's always true on Cocoa platforms. * platform/graphics/RemoteVideoSample.cpp: (WebCore::RemoteVideoSample::surface const): Ditto. * platform/graphics/RemoteVideoSample.h: Ditto. * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::allocateIOSurfaceBackingStore): Ditto. (WebCore::GraphicsContextGLOpenGL::updateFramebufferTextureBackingStoreFromLayer): Ditto. * platform/graphics/cocoa/IOSurface.mm: Ditto. * platform/graphics/cocoa/IOSurfacePoolCocoa.mm: Ditto. * platform/graphics/cocoa/WebGLLayer.h: Ditto. * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer display]): Ditto. * platform/graphics/cv/ImageTransferSessionVT.h: Ditto. * platform/graphics/cv/ImageTransferSessionVT.mm: Ditto. * platform/graphics/cv/VideoTextureCopierCV.cpp: (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction): Ditto. (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture): Ditto. * platform/graphics/cv/VideoTextureCopierCV.h: Ditto. * rendering/RenderThemeIOS.h: Ditto. 2020-05-04 Simon Fraser <simon.fraser@apple.com> Overflow scrollbars don't grow when hovered https://bugs.webkit.org/show_bug.cgi?id=210692 <rdar://problem/61977273> Reviewed by Tim Horton. Overlay scrollar interaction has a few behaviors that are mediated by ScrollAnimatorMac. These are a trackpad two-finger tap, which sends a "MayBegin" wheel event (which can be followed by a "Cancelled" on fingers up, if they didn't move), and hovering the scrollbar when visible, which causes it to expand (unhovering causes it to fade out). To track these gestures on the scrolling thread, give ScrollingTree a ScrollingTreeGestureState. Flashing the scrollbars on "MayBegin" is driven by didBeginScrollGesture()/didEndScrollGesture(). This relies on sending these for the correct scrollable area, and matching the begin/cancel, so use the normal scrolling tree event handling code path for "MayBegin", and always send "Cancelled" on the node that received "MayBegin. Do the same for "Began" and "Ended". Scrollbars expanding on hover is controlled by these functions on ScrollAnimatorMac: void mouseEnteredContentArea(); void mouseExitedContentArea(); void mouseMovedInContentArea(); void mouseEnteredScrollbar(Scrollbar*) const; void mouseExitedScrollbar(Scrollbar*) const; This mostly (webkit.org/b/211347) works now that the mayBegin/Canceled state is updated correctly, and is tested by a new test. Tests: fast/scrolling/mac/scrollbars/overflow-overlay-scrollbar-hovered.html fast/scrolling/mac/scrollbars/overflow-overlay-scrollbar-reveal.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::ScrollingTree): (WebCore::ScrollingTree::handleWheelEvent): * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeGestureState.cpp: Added. (WebCore::ScrollingTreeGestureState::ScrollingTreeGestureState): (WebCore::ScrollingTreeGestureState::receivedWheelEvent): (WebCore::ScrollingTreeGestureState::handleGestureCancel): (WebCore::ScrollingTreeGestureState::nodeDidHandleEvent): (WebCore::ScrollingTreeGestureState::clearAllNodes): * page/scrolling/ScrollingTreeGestureState.h: Copied from Source/WebCore/page/scrolling/ScrollingTreeLatchingController.h. * page/scrolling/ScrollingTreeLatchingController.cpp: (WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent): * page/scrolling/ScrollingTreeLatchingController.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::canHandleWheelEvent const): (WebCore::ScrollingTreeScrollingNode::canScrollWithWheelEvent const): Deleted. * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent): * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent): * platform/Logging.cpp: (WebCore::initializeLogChannelsIfNecessary): * platform/PlatformWheelEvent.h: (WebCore::PlatformWheelEvent::isGestureStart const): (WebCore::PlatformWheelEvent::isGestureCancel const): * platform/cocoa/ScrollController.mm: (WebCore::ScrollController::handleWheelEvent): * platform/mac/ScrollAnimatorMac.mm: (WebCore::scrollbarState): 2020-05-04 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r261102. https://bugs.webkit.org/show_bug.cgi?id=211418 Revert some debug logging (Requested by smfr on #webkit). Reverted changeset: "REGRESSION: [ Mac WK1 ] inspector/console/console-api.html is flaky crashing" https://bugs.webkit.org/show_bug.cgi?id=211386 https://trac.webkit.org/changeset/261102 2020-05-04 Chris Dumez <cdumez@apple.com> Drop code path using the legacy CFNetwork cookie change notification SPI https://bugs.webkit.org/show_bug.cgi?id=211411 Reviewed by John Wilander. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::registerCookieChangeListenersIfNecessary): (WebCore::NetworkStorageSession::unregisterCookieChangeListenersIfNecessary): 2020-05-04 Jack Lee <shihchieh_lee@apple.com> Nullptr crash in CompositeEditCommand::moveParagraphs when changing style on elements that are user-select:none and dir:rtl. https://bugs.webkit.org/show_bug.cgi?id=211206 <rdar://problem/61830589> Reviewed by Geoffrey Garen. In function moveParagraphs check if the destination is an empty position and bail out before moving the paragraphs. Test: fast/editing/justify-user-select-none-dir-rtl-crash.html * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): 2020-05-04 Jiewen Tan <jiewen_tan@apple.com> [WebAuthn] Implement +[_WKWebAuthenticationPanel clearAllLocalAuthenticatorCredentials] https://bugs.webkit.org/show_bug.cgi?id=211369 <rdar://problem/60246635> Reviewed by Brent Fulgham. Covered by manual tests given auto tests could clear developers' actual credentials. * Modules/webauthn/WebAuthenticationConstants.h: 2020-05-04 Said Abou-Hallawa <sabouhallawa@apple.com> Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler https://bugs.webkit.org/show_bug.cgi?id=204713 Reviewed by Simon Fraser. rAF and Page rendering were managed by two different timers. Throttling rAF was implemented by changing its timer. After r242624, RenderingUpdate steps have been managed by RenderingUpdateScheduler. This means rAF is now serviced by the preferredFramesPerSecond which is 60 fps regardless it's throttled or not. Moreover the rAF throttling timer was mistakenly kept and it has been running under the old assumption which is: rAF is serviced by a timer only. This means rAF will be serviced by its timer and by the RenderingUpdate steps at the same time when it is supposed to throttle. This will make it fire more than 60 fps in cases which it is supposed to run less than 60 fps. The solution is to have two throttling types: 1) Page throttling (or full throttling): This slows down all the steps of RenderingUpdate for the main document and all the sub-documents. Page throttling reasons are: -- VisuallyIdle: Aggressive throttling. -- LowPowerMode: Half speed throttling. 2) Document throttling (or partial throttling): This only slows down the rAF of a certain document. Document throttling reasons are: -- OutsideViewport: Aggressive throttling. -- NonInteractedCrossOriginFrame: Half speed throttling. RenderingUpdate steps will still be managed by RenderingUpdateScheduler which can be throttled. The assumption is none of these steps will need to run faster than the Page preferredFramesPerSecond. If rAF wants to run slower than the Page because of a Document throttling reason, no rAF callbacks will be serviced before its preferredFrameInterval has elapsed. In this patch, "Half speed throttling" is only implemented for the Page and the Document throttling. The "Aggressive throttling" will be done in following patches. Page rendering was never throttled before. We need to make sure this is not going to affect PLT. Some tests need to be changed and new tests need to be written. All of the throttling tests checks the state of the code but none of them checks the real user's experience. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::animationInterval const): (WebCore::DocumentTimeline::updateThrottlingState): Deleted. * animation/DocumentTimeline.h: There is no need to have DocumentTimeline throttling. It is already throttled when the page RenderingUpdate is throttled. * dom/Document.cpp: (WebCore::Document::requestAnimationFrame): (WebCore::Document::updateLastHandledUserGestureTimestamp): LowPowerMode throttling is now handled by the Page. So remove its handling from the Document. * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::ScriptedAnimationController): (WebCore::ScriptedAnimationController::page const): (WebCore::ScriptedAnimationController::interval const): (WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const): (WebCore::ScriptedAnimationController::throttlingReasons const): (WebCore::ScriptedAnimationController::isThrottledRelativeToPage const): (WebCore::ScriptedAnimationController::shouldRescheduleRequestAnimationFrame const): (WebCore::ScriptedAnimationController::registerCallback): (WebCore::ScriptedAnimationController::cancelCallback): (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks): (WebCore::ScriptedAnimationController::scheduleAnimation): (WebCore::throttlingReasonToString): Deleted. (WebCore::throttlingReasonsToString): Deleted. (WebCore::ScriptedAnimationController::addThrottlingReason): Deleted. (WebCore::ScriptedAnimationController::removeThrottlingReason): Deleted. (WebCore::ScriptedAnimationController::isThrottled const): Deleted. (WebCore::ScriptedAnimationController::animationTimerFired): Deleted. * dom/ScriptedAnimationController.h: (WebCore::ScriptedAnimationController::addThrottlingReason): (WebCore::ScriptedAnimationController::removeThrottlingReason): Get rid of the rAF throttling timer. Service the rAF callback only when the period from the current time stamp till the last service time stamp is greater than the preferred rAF interval. * page/FrameView.cpp: (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState): ThrottlingReason is now defined outside ScriptedAnimationController. * page/Page.cpp: (WebCore::m_loadsFromNetwork): (WebCore::Page::setLowPowerModeEnabledOverrideForTesting): (WebCore::Page::preferredRenderingUpdateInterval const): Calculate the preferred RenderingUpdate interval from the throttling reasons. (WebCore::Page::setIsVisuallyIdleInternal): (WebCore::Page::handleLowModePowerChange): Call adjustRenderingUpdateFrequency() when isLowPowerModeEnabled or IsVisuallyIdle is toggled. (WebCore::Page::isLowPowerModeEnabled const): Deleted. (WebCore::updateScriptedAnimationsThrottlingReason): Deleted. * page/Page.h: (WebCore::Page::isLowPowerModeEnabled const): (WebCore::Page::throttlingReasons const): (WebCore::Page::canUpdateThrottlingReason const): * page/RenderingUpdateScheduler.cpp: (WebCore::RenderingUpdateScheduler::setPreferredFramesPerSecond): (WebCore::RenderingUpdateScheduler::scheduleAnimation): (WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency): Change the preferredFramesPerSecond of the DisplayRefreshMonitor if the throttling is not aggressive e.g. 10_s. Otherwise use the timer. (WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate): Call adjustFramesPerSecond() when DisplayRefreshMonitor is created. (WebCore::RenderingUpdateScheduler::startTimer): * page/RenderingUpdateScheduler.h: * platform/graphics/AnimationFrameRate.h: Added. (WebCore::preferredFrameInterval): (WebCore::preferredFramesPerSecond): (WebCore::operator<<): Push names of ThrottlingReasons to a TextStream. * platform/graphics/DisplayRefreshMonitor.h: (WebCore::DisplayRefreshMonitor::setPreferredFramesPerSecond): * platform/graphics/DisplayRefreshMonitorManager.cpp: (WebCore::DisplayRefreshMonitorManager::monitorForClient): Rename createMonitorForClient() to monitorForClient() since it may return a cached DisplayRefreshMonitor. (WebCore::DisplayRefreshMonitorManager::setPreferredFramesPerSecond): (WebCore::DisplayRefreshMonitorManager::scheduleAnimation): (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange): No need to call registerClient(). This function was just ensuring the DisplayRefreshMonitor is created. scheduleAnimation() does the same thing. (WebCore::DisplayRefreshMonitorManager::createMonitorForClient): Deleted. (WebCore::DisplayRefreshMonitorManager::registerClient): Deleted. * platform/graphics/DisplayRefreshMonitorManager.h: (WebCore::DisplayRefreshMonitorManager::DisplayRefreshMonitorManager): Deleted. * platform/graphics/GraphicsLayerUpdater.cpp: (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater): * platform/graphics/ios/DisplayRefreshMonitorIOS.mm: (-[WebDisplayLinkHandler setPreferredFramesPerSecond:]): Set the preferredFramesPerSecond of the CADisplayLink. * testing/Internals.cpp: (WebCore::Internals::requestAnimationFrameThrottlingReasons const): (WebCore::Internals::isRequestAnimationFrameThrottled const): Deleted. * testing/Internals.h: * testing/Internals.idl: Replace isRequestAnimationFrameThrottled() which returns a boolean by requestAnimationFrameThrottlingReasons() which returns a string. The string represents the throttling reasons. 2020-05-04 Darin Adler <darin@apple.com> Remove unneeded USE(MEDIAREMOTE) https://bugs.webkit.org/show_bug.cgi?id=211385 Reviewed by Eric Carlson. * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::updateNowPlayingInfo): Remove USE(MEDIAREMOTE). * platform/mac/MediaRemoteSoftLink.cpp: Ditto. * platform/mac/MediaRemoteSoftLink.h: Ditto. * platform/mac/RemoteCommandListenerMac.mm: (WebCore::RemoteCommandListenerMac::updateSupportedCommands): Ditto. (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Ditto. (WebCore::RemoteCommandListenerMac::~RemoteCommandListenerMac): Ditto. 2020-05-04 Devin Rousso <drousso@apple.com> Web Inspector: Worker: should use the name of the worker if it exists https://bugs.webkit.org/show_bug.cgi?id=211244 Reviewed by Brian Burg. Test: inspector/worker/runtime-basic.html Pass the `name` from the `WorkerOptions` given to the `Worker` when it's constructed to Web Inspector so it can be used in the frontend UI. Drive-by: replace lots of pointers with references. * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): * workers/WorkerInspectorProxy.h: (WebCore::WorkerInspectorProxy::name const): Added. * workers/WorkerInspectorProxy.cpp: (WebCore::WorkerInspectorProxy::workerStarted): (WebCore::WorkerInspectorProxy::workerTerminated): (WebCore::WorkerInspectorProxy::connectToWorkerInspectorController): (WebCore::WorkerInspectorProxy::sendMessageFromWorkerToFrontend): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::workerStarted): (WebCore::InspectorInstrumentation::workerTerminated): * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::workerStartedImpl): (WebCore::InspectorInstrumentation::workerTerminatedImpl): * inspector/agents/InspectorWorkerAgent.h: * inspector/agents/InspectorWorkerAgent.cpp: (WebCore::InspectorWorkerAgent::sendMessageFromWorkerToFrontend): (WebCore::InspectorWorkerAgent::workerStarted): (WebCore::InspectorWorkerAgent::workerTerminated): (WebCore::InspectorWorkerAgent::connectToAllWorkerInspectorProxiesForPage): (WebCore::InspectorWorkerAgent::connectToWorkerInspectorProxy): (WebCore::InspectorWorkerAgent::disconnectFromWorkerInspectorProxy): 2020-05-04 Devin Rousso <drousso@apple.com> Web Inspector: provide a way for inspector to turn on/off ITP debug mode and AdClickAttribution debug mode https://bugs.webkit.org/show_bug.cgi?id=209763 Reviewed by Brian Burg. Tests: inspector/page/overrideSetting-AdClickAttributionDebugModeEnabled.html inspector/page/overrideSetting-ITPDebugModeEnabled.html * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::disable): (WebCore::InspectorPageAgent::overrideSetting): * inspector/InspectorClient.h: (WebCore::InspectorClient::setDeveloperPreferenceOverride): Added. (WebCore::InspectorClient::setMockCaptureDevicesEnabledOverride): Deleted. 2020-05-04 Simon Fraser <simon.fraser@apple.com> REGRESSION: [ Mac WK1 ] inspector/console/console-api.html is flaky crashing https://bugs.webkit.org/show_bug.cgi?id=211386 Reviewed by David Kilzer. Add some temporary logging code to get data from Mojave bots related to this NSScrollerImp crash. * platform/mac/ScrollAnimatorMac.mm: (WebCore::dumpPaintersWithDelegates): (WebCore::ScrollAnimatorMac::ScrollAnimatorMac): (WebCore::ScrollAnimatorMac::~ScrollAnimatorMac): (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar): (WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar): (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar): (WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar): 2020-05-04 Doug Kelly <dougk@apple.com> Add additional null checks to MediaPlayerPrivateMediaSourceAVFObjC https://bugs.webkit.org/show_bug.cgi?id=211134 <rdar://problem/62056577> Reviewed by Daniel Bates. Add additional null checks for a set m_mediaSourcePrivate to MediaPlayerPrivateMediaSourceAVFObjC. Most uses in this class are already guarded, but a few were not, which could lead to a null pointer crash if encountered. No new tests; no functional changes. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession): 2020-05-04 Darin Adler <darin@apple.com> Remove now-unneeded HAVE(MEDIA_PLAYER) https://bugs.webkit.org/show_bug.cgi?id=211378 Reviewed by Alex Christensen. * platform/RemoteCommandListener.cpp: Remove uneeded check for HAVE(MEDIA_PLAYER) in code that already checks for Cocoa platforms explicitly. * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring): Removed check of HAVE(MEDIA_PLAYER) in a Cocoa-only source file. * platform/ios/RemoteCommandListenerIOS.h: Ditto. Also removed #pragma once and some other unnecessary things because this is only included in the .mm file below. * platform/ios/RemoteCommandListenerIOS.mm: Ditto. 2020-05-04 Guillem Vinals <gvinals@apple.com> WebGPU: Textures should be able to have OUTPUT_ATTACHMENT | SAMPLED usage flags https://bugs.webkit.org/show_bug.cgi?id=211345 <rdar://problem/62264423> Reviewed by Myles C. Maxfield. Added support for off-screen render targets. Test: webgpu/textures-textureviews.html * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: (WebCore::mtlTextureUsageForGPUTextureUsageFlags): 2020-05-04 Guillem Vinals <gvinals@apple.com> WebGPU: copyTextureToTexture() has an implementation bug (src copy view info is used also as dst) https://bugs.webkit.org/show_bug.cgi?id=211303 Reviewed by Daniel Bates. The source copy information is also used as the destination copy information. Test: webgpu/blit-commands-texture-to-texture.html * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: (WebCore::GPUCommandBuffer::copyTextureToTexture): 2020-05-04 Antoine Quint <graouts@apple.com> Media controls tracks menu shows "Auto" selected instead of track selected via the JS API https://bugs.webkit.org/show_bug.cgi?id=211230 <rdar://problem/62648409> Reviewed by Eric Carlson. Test: media/modern-media-controls/tracks-support/tracks-support-text-track-selected-via-media-api.html We're fixing two issues with the captions menu on macOS here. First, if a text track was marked as "showing" with the JS API, we would not show it as selected in the UI because MediaControlsHost would report that the captionDisplayMode was "automatic" and we'd take this as sufficient data to say that the "Automatic (Recommended)" item should be shown as selected. We now only do this if we also don't have any text tracks set as "showing". The second issue was when trying to select "Automatic (Recommended)" when a text track had been marked as "showing" with the JS API. Calling `setSelectedTextTrack()` on MediaControlsHost in this case was not sufficient because HTMLMediaElement::setSelectedTextTrack is a no-op if the automatic text track is provided but captionDisplayMode is still set to "automatic". To address this, we first disable all text tracks before calling `setSelectedTextTrack()`. * Modules/modern-media-controls/media/tracks-support.js: (TracksSupport.prototype.tracksPanelIsTrackInSectionSelected): (TracksSupport.prototype.tracksPanelSelectionDidChange): 2020-05-04 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Override the table computed height when content needs more space https://bugs.webkit.org/show_bug.cgi?id=211367 Reviewed by Antti Koivisto. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): 2020-05-04 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Use distributeAvailableSpace for row sizing https://bugs.webkit.org/show_bug.cgi?id=211366 Reviewed by Antti Koivisto. Switch over to the generic space distribution for table row sizing. * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::RowSpan::hasSpan): (WebCore::Layout::RowSpan::isSpanned): (WebCore::Layout::RowSpan::spanCount): (WebCore::Layout::RowSpan::startSpan): (WebCore::Layout::RowSpan::endSpan): (WebCore::Layout::RowSpan::index): (WebCore::Layout::RowSpan::size): (WebCore::Layout::RowSpan::spacing): (WebCore::Layout::distributeAvailableSpace): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): 2020-05-04 Youenn Fablet <youenn@apple.com> Camera video samples have a bad orientation if upside down https://bugs.webkit.org/show_bug.cgi?id=211373 Reviewed by Eric Carlson. Manually tested on iPad and iPhones. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::computeSampleRotation): -90 should be the same as 270 not -270. 2020-05-04 Yusuke Suzuki <ysuzuki@apple.com> [gtk] isMainThread() assert when running minibrowser in debug builds. https://bugs.webkit.org/show_bug.cgi?id=211355 Reviewed by Mark Lam. Using NeverDestroyed<const AtomString> is discouraged if it is in the non main thread. This can be quite easily wrong: if the running thread is one of WorkerPool, then this is wrong since AtomStringTable will be destroyed every time underlying Thread is shutdown. If this is invoked by AutomaticThread, this is also wrong due to the same reason etc. This is why we introduced MainThreadNeverDestroyed and use it for const AtomString. This restriction found the bug that we are using `NeverDestroyed<const AtomString>` in non main thread. We should not do that. This patch fixes the issue by introducing TextureMapperShaderProgram::Variable instead of using AtomString. Then this code no longer has thread affinity. * platform/graphics/texmap/TextureMapperShaderProgram.cpp: (WebCore::TextureMapperShaderProgram::getLocation): Deleted. * platform/graphics/texmap/TextureMapperShaderProgram.h: 2020-05-04 Emilio Cobos Álvarez <emilio@crisal.io> Put lh / rlh units behind a flag until bug 211351 is sorted out. https://bugs.webkit.org/show_bug.cgi?id=211356 Reviewed by Antti Koivisto. * css/parser/CSSParserToken.cpp: Use the new runtime flag to disable parsing the units. (WebCore::cssPrimitiveValueUnitFromTrie): * page/RuntimeEnabledFeatures.h: Define the new runtime flag. (WebCore::RuntimeEnabledFeatures::setLineHeightUnitsEnabled): (WebCore::RuntimeEnabledFeatures::lineHeightUnitsEnabled const): 2020-05-03 David Kilzer <ddkilzer@apple.com> Use LocalCurrentGraphicsContext in WebKit::convertPlatformImageToBitmap() <https://webkit.org/b/211274> Reviewed by Darin Adler. * platform/mac/LocalCurrentGraphicsContext.h: (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext): (WebCore::LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext): - Export methods for use in WebKit. 2020-05-03 David Kilzer <ddkilzer@apple.com> Fix static analyzer false positive in -[WebUndefined undefined] <https://webkit.org/b/211353> Reviewed by Darin Adler. * bridge/objc/WebScriptObject.mm: (+[WebUndefined allocWithZone:]): (-[WebUndefined initWithCoder:]): (-[WebUndefined retain]): (-[WebUndefined autorelease]): - Update method signatures. (+[WebUndefined undefined]): - Fix clang static analyzer false positive by using idiomatic -alloc, -init calls to create object. These methods call -allocWithZone:, so this still uses the singleton pattern. 2020-05-03 Daniel Bates <dabates@apple.com> Sometimes cannot find <textarea> in list of editable elements https://bugs.webkit.org/show_bug.cgi?id=211348 <rdar://problem/62231067> Reviewed by Simon Fraser. When building the editable region add the bounds of the text control to the region instead of the bounds of its inner text element even though it is the latter that is actually editable. Using the bounds of the text control is more in line with a user's expectation for the editable portion of a text control: the entire control. So, do that. Tests: editing/editable-region/hit-test-textarea-empty-space.html editing/editable-region/search-field-basic.html editing/editable-region/text-field-basic.html editing/editable-region/textarea-basic.html * rendering/EventRegion.cpp: (WebCore::EventRegionContext::unite): (WebCore::EventRegion::unite): Add a new bool as to whether to override the user-modify check and just assume that the region is for something editable. This is needed because the form control (e.g. the <input> or <textarea> aka the shadow host element) isn't actually editable itself. Its inner text element is editable. RenderBlock::paintObject() will pass true for this override when event region painting such a control and the control's inner text element is editable so that the controls bounds are added to the editable region. * rendering/EventRegion.h: Add a bool, defaulting to false to keep the current behavior. While I am here remove some unneeded WEBCORE_EXPORT attributions. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintObject): Pass a value for the override argument. It will be true if this block is actually a text control and its inner text element is editable. Otherwise, it will be false. There is also no longer a need to descend into the children of a text control because I only care to record the bounds of the control itself as editable, not its inner text element. 2020-05-03 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Turns horizontal space distribution into a generic space distribution https://bugs.webkit.org/show_bug.cgi?id=211352 Reviewed by Antti Koivisto. Horizontal(column) and vertical(row) space distributions use essentially the same logic to distribute the extra space among the columns/rows. This patch turns the horizontal space distribution function into a generic space distribution code so that we can use it for row sizing as well. * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::ColumnSpan::hasSpan): (WebCore::Layout::ColumnSpan::isSpanned): (WebCore::Layout::ColumnSpan::spanCount): (WebCore::Layout::ColumnSpan::startSpan): (WebCore::Layout::ColumnSpan::endSpan): (WebCore::Layout::ColumnSpan::index): (WebCore::Layout::ColumnSpan::size): (WebCore::Layout::ColumnSpan::spacing): (WebCore::Layout::distributeAvailableSpace): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): * layout/tableformatting/TableGrid.h: (WebCore::Layout::TableGrid::slot const): 2020-05-03 Youenn Fablet <youenn@apple.com> AudioMediaStreamTrackRendererCocoa should create/start/stop its remote unit on the main thread https://bugs.webkit.org/show_bug.cgi?id=211287 Reviewed by Eric Carlson. Creating/starting/stopping audio units in different threads is error prone. Now that we have an observer model where we have observers for when to play in the main thread and based on that, we decide to receive audio samples in a background thread, we can simplify the logic of AudioMediaStreamTrackRendererCocoa. We do this by creating/starting the unit in AudioMediaStreamTrackRendererCocoa::start. At that point, AudioMediaStreamTrackRendererCocoa is not expected to receive any sample. Just after starting, AudioTrackPrivateMediaStream will receive audio samples and forward them to AudioMediaStreamTrackRendererCocoa. AudioMediaStreamTrackRendererCocoa will then create in a background thread the AudioSampleDataSource that is responsible to adapt the received audio samples to the unit. Manually tested. * platform/audio/mac/AudioSampleDataSource.h: (WebCore::AudioSampleDataSource::inputDescription const): * platform/audio/mac/CAAudioStreamDescription.h: * platform/mediastream/AudioTrackPrivateMediaStream.cpp: (WebCore::AudioTrackPrivateMediaStream::startRenderer): Ensure to start the unit and then start gettting audio samples. * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.cpp: (WebCore::AudioMediaStreamTrackRendererCocoa::start): (WebCore::AudioMediaStreamTrackRendererCocoa::stop): (WebCore::AudioMediaStreamTrackRendererCocoa::clear): (WebCore::AudioMediaStreamTrackRendererCocoa::pushSamples): (WebCore::AudioMediaStreamTrackRendererCocoa::render): * platform/mediastream/mac/AudioMediaStreamTrackRendererCocoa.h: 2020-05-03 Rob Buis <rbuis@igalia.com> atob() should not accept a vertical tab https://bugs.webkit.org/show_bug.cgi?id=184529 Reviewed by Darin Adler. The forgiving-base64 decode algorithm [1] uses [2] to strip out ASCII whitespace which does not include vertical tabs, so change the atob() implementation to not strip out vertical tabs and thus to fail decode on vertical tabs. [1] https://infra.spec.whatwg.org/#forgiving-base64-decode [2] https://infra.spec.whatwg.org/#ascii-whitespace Behavior matches Firefox and Chrome. * page/Base64Utilities.cpp: (WebCore::Base64Utilities::atob): * platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::decodeBase64): 2020-05-02 Simon Fraser <simon.fraser@apple.com> Add a log channel for OverlayScrollbars https://bugs.webkit.org/show_bug.cgi?id=211329 Reviewed by Zalan Bujtas. Overlay scrollbar behavior is opaque. This log channel will add clarity. * platform/Logging.h: * platform/mac/ScrollAnimatorMac.mm: (operator<<): (-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]): (-[WebScrollbarPartAnimation startAnimation]): (-[WebScrollbarPartAnimation setCurrentProgress:setCurrentProgress:]): (WebCore::ScrollAnimatorMac::mouseEnteredContentArea): (WebCore::ScrollAnimatorMac::mouseExitedContentArea): (WebCore::ScrollAnimatorMac::mouseMovedInContentArea): (WebCore::ScrollAnimatorMac::didBeginScrollGesture const): (WebCore::ScrollAnimatorMac::didEndScrollGesture const): (WebCore::ScrollAnimatorMac::mayBeginScrollGesture const): (WebCore::ScrollAnimatorMac::handleWheelEventPhase): 2020-05-02 Simon Fraser <simon.fraser@apple.com> Make it possible to test overlay scrollbar interactions https://bugs.webkit.org/show_bug.cgi?id=211342 Reviewed by Daniel Bates. Add internals.horizontalScrollbarState() and internals.verticalScrollbarState() and hook them up via ScrollableArea to ScrollAnimatorMac. They dump state based on the NSScrollerImp state. Make internals.setUsesOverlayScrollbars(true) actually trigger real overlay scrollbars by notifying the ScrollbarTheme about the scrollbar style change. Tests: fast/scrolling/mac/scrollbars/overlay-scrollbar-hovered.html fast/scrolling/mac/scrollbars/overlay-scrollbar-reveal.html fast/scrolling/mac/scrollbars/overlay-scrollbar-state.html fast/scrolling/mac/scrollbars/scrollbar-state.html * platform/ScrollAnimator.h: (WebCore::ScrollAnimator::ScrollAnimator::horizontalScrollbarStateForTesting const): (WebCore::ScrollAnimator::ScrollAnimator::verticalScrollbarStateForTesting const): * platform/ScrollableArea.cpp: (WebCore::ScrollableArea::horizontalScrollbarStateForTesting const): (WebCore::ScrollableArea::verticalScrollbarStateForTesting const): * platform/ScrollableArea.h: * platform/mac/NSScrollerImpDetails.h: * platform/mac/ScrollAnimatorMac.h: * platform/mac/ScrollAnimatorMac.mm: (WebCore::scrollbarState): (WebCore::ScrollAnimatorMac::horizontalScrollbarStateForTesting const): (WebCore::ScrollAnimatorMac::verticalScrollbarStateForTesting const): * testing/Internals.cpp: (WebCore:: const): (WebCore::Internals::scrollbarOverlayStyle const): (WebCore::Internals::scrollbarUsingDarkAppearance const): (WebCore::Internals::horizontalScrollbarState const): (WebCore::Internals::verticalScrollbarState const): (WebCore::Internals::setUsesOverlayScrollbars): * testing/Internals.h: * testing/Internals.idl: 2020-05-02 Daniel Bates <dabates@apple.com> Page::editableElementsInRect() should return root editable elements https://bugs.webkit.org/show_bug.cgi?id=211343 <rdar://problem/60015801> Reviewed by Simon Fraser. Return the root editable element for each non-text form control editable element inside the search rect as it may not have been hit itself. This can happen if the search rect is small enough to intersect only child elements of the root editable elements. * page/Page.cpp: (WebCore::Page::editableElementsInRect const): (WebCore::isEditableTextInputElement): Deleted. 2020-05-02 Simon Fraser <simon.fraser@apple.com> scrollableAreaForScrollingNodeID() gives the wrong answer for the FrameView https://bugs.webkit.org/show_bug.cgi?id=211310 Reviewed by Zalan Bujtas. Given the FrameView's scrollingNodeID, RenderLayerCompositor::scrollableAreaForScrollingNodeID() would return the RenderView's layer when it should return the FrameView itself. Fixing this allows removal of a special-case in setActiveScrollSnapIndices(). No behavior change. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::scrollableAreaForScrollingNodeID const): 2020-05-02 Simon Fraser <simon.fraser@apple.com> handleWheelEventPhase() should include the relevant ScrollingNodeID https://bugs.webkit.org/show_bug.cgi?id=211315 Reviewed by Tim Horton. handleWheelEventPhase() is used to send information about wheel event phases to the main thread, which make their way to ScrollAnimatorMac::handleWheelEventPhase() and are used to update the state of overlay scrollbars. In order to talk to the correct set of scrollbars with overflow:scroll, we need to send along the ScrollingNodeID and map that to the appropriate ScrollableArea. Will be tested by future overlay scrollbar tests. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::handleWheelEventPhase): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::handleWheelEventPhase): Deleted. * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::handleWheelEventPhase): * page/scrolling/ScrollingTree.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::handleWheelEventPhase): * page/scrolling/ThreadedScrollingTree.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent): * platform/mac/ScrollAnimatorMac.mm: 2020-05-02 Devin Rousso <drousso@apple.com> [CSS Easing 1] implement `jump-*` step positions https://bugs.webkit.org/show_bug.cgi?id=211271 Reviewed by Dean Jackson. Add support for `jump-start`, `jump-end`, `jump-none`, and `jump-both` step positions inside the `steps()` CSS timing function <https://drafts.csswg.org/css-easing-1/#step-position>. Adjust existing serialization logic to match the spec <https://drafts.csswg.org/css-easing-1/#serialization>: - omit `end` (and `jump-end`) - the value `step-start` should result in `steps(1, start)` instead of `step-start` - the value `step-end` should result in `steps(1)` instead of `step-end` Tests: animations/computed-style.html fast/css/animation-steps-calculated-value.html transitions/transitions-parsing.html web-platform-tests/css/css-animations/parsing/animation-timing-function-computed.html web-platform-tests/css/css-animations/parsing/animation-timing-function-valid.html web-platform-tests/css/css-easing/step-timing-functions-output.html web-platform-tests/css/css-easing/step-timing-functions-syntax.html web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed.html web-platform-tests/css/css-transitions/parsing/transition-timing-function-valid.html web-platform-tests/web-animations/timing-model/time-transformations/transformed-progress.html * css/CSSValueKeywords.in: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeSteps): (WebCore::consumeAnimationTimingFunction): * css/CSSComputedStyleDeclaration.cpp: (WebCore::createTimingFunctionValue): * css/CSSToStyleMap.cpp: (WebCore::CSSToStyleMap::mapAnimationTimingFunction): * css/CSSTimingFunctionValue.h: (WebCore::CSSStepsTimingFunctionValue::create): (WebCore::CSSStepsTimingFunctionValue::stepPosition const): Added. (WebCore::CSSStepsTimingFunctionValue::CSSStepsTimingFunctionValue): (WebCore::CSSStepsTimingFunctionValue::stepAtStart const): Deleted. * css/CSSTimingFunctionValue.cpp: (WebCore::CSSStepsTimingFunctionValue::customCSSText const): (WebCore::CSSStepsTimingFunctionValue::equals const): * platform/animation/TimingFunction.h: (WebCore::StepsTimingFunction::create): (WebCore::StepsTimingFunction::StepsTimingFunction): (WebCore::StepsTimingFunction::stepPosition): Added. (WebCore::StepsTimingFunction::setStepPosition): Added. (WebCore::StepsTimingFunction::clone): (WebCore::StepsTimingFunction::stepAtStart): Deleted. (WebCore::StepsTimingFunction::setStepAtStart): Deleted. * platform/animation/TimingFunction.cpp: (WebCore::operator<<): (WebCore::TimingFunction::transformTime): (WebCore::TimingFunction::createFromCSSValue): (WebCore::TimingFunction::cssText const): 2020-05-01 Tim Horton <timothy_horton@apple.com> Books sometimes ends up with blank pages, especially after adjusting font size https://bugs.webkit.org/show_bug.cgi?id=211265 <rdar://problem/59898144> Reviewed by Darin Adler. * page/FrameView.cpp: (WebCore::FrameView::setViewExposedRect): Rename "hasRectChanged" because it only tests if the optional-state of the rect has changed, not the actual value. 2020-05-01 Wenson Hsieh <wenson_hsieh@apple.com> Text manipulation should observe the value attribute of some input elements https://bugs.webkit.org/show_bug.cgi?id=211307 <rdar://problem/61568528> Reviewed by Darin Adler. Teach TextManipulationController to detect the `value` attribute in input elements of type "button" and "submit". To do this, we plumb the element through to `isAttributeForTextManipulation` and check `isTextButton()` if "value" attribute is being considered. Test: TextManipulation.StartTextManipulationExtractsValuesFromButtonInputs * editing/TextManipulationController.cpp: (WebCore::isAttributeForTextManipulation): (WebCore::TextManipulationController::observeParagraphs): 2020-05-01 Chris Dumez <cdumez@apple.com> Regression(r259036) Unable to post comments on Jira https://bugs.webkit.org/show_bug.cgi?id=211122 <rdar://problem/62561879> Unreviewed, revert r259036 as the new behavior does not match other browsers and broke some Jira instances. * loader/FormSubmission.cpp: (WebCore::FormSubmission::populateFrameLoadRequest): * loader/FrameLoader.cpp: (WebCore::FrameLoader::addExtraFieldsToRequest): (WebCore::FrameLoader::addHTTPOriginIfNeeded): (WebCore::FrameLoader::loadResourceSynchronously): (WebCore::FrameLoader::loadDifferentDocumentItem): * loader/FrameLoader.h: * loader/NavigationScheduler.cpp: * loader/PingLoader.cpp: (WebCore::PingLoader::sendPing): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl): * loader/cache/CachedResourceRequest.cpp: (WebCore::CachedResourceRequest::updateReferrerAndOriginHeaders): * platform/network/ResourceRequestBase.cpp: (WebCore::doesRequestNeedHTTPOriginHeader): Deleted. * platform/network/ResourceRequestBase.h: 2020-05-01 Jack Lee <shihchieh_lee@apple.com> Unreviewed, amend change log entry for r260831. * ChangeLog: 2020-05-01 Chris Dumez <cdumez@apple.com> Unreviewed, another build fix after r260962. * page/Page.h: 2020-05-01 Daniel Bates <dabates@apple.com> Avoid unnecessary copying in AnimationTimeline and other clean ups https://bugs.webkit.org/show_bug.cgi?id=211309 Reviewed by Simon Fraser. Return animations by const lvalue ref to avoid copying the Vectors. Default the constructor and destructor implementations. Remove an unnessary argument name from animationsForElement() and re-arrange decls to make class definition more idiomatic. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::AnimationTimeline): Deleted. (WebCore::AnimationTimeline::~AnimationTimeline): Deleted. * animation/AnimationTimeline.h: (WebCore::AnimationTimeline::relevantAnimations const): (WebCore::AnimationTimeline::allAnimations const): 2020-05-01 Daniel Bates <dabates@apple.com> Change HitTestResult::NodeSet from set of RefPtrs to set of Refs https://bugs.webkit.org/show_bug.cgi?id=211306 Reviewed by Simon Fraser. HitTestResult::listBasedTestResult() never returns a set with nullptrs in it. So, change the set declaration from ListHashSet<RefPtr<Node>> to ListHashSet<Ref<Node>>. This way people are not tempted to unnecessarily null check the nodes in the set. As I made this change to TreeScope::elementsFromPoint() I noticed that retargetToScope(), which is called by it, returned a Node&. So, I changed it to return a Ref<Node>. That required me to fix up caretRangeFromPoint(), which lead me to fix up nodeFromPoint() as well. * dom/Document.cpp: (WebCore::Document::caretRangeFromPoint): * dom/EventPath.cpp: (WebCore::RelatedNodeRetargeter::checkConsistency): * dom/TreeScope.cpp: (WebCore::TreeScope::retargetToScope const): (WebCore::TreeScope::nodeFromPoint): (WebCore::TreeScope::elementFromPoint): (WebCore::TreeScope::elementsFromPoint): * dom/TreeScope.h: * page/Page.cpp: (WebCore::Page::editableElementsInRect const): * rendering/HitTestResult.cpp: (WebCore::appendToNodeSet): (WebCore::HitTestResult::HitTestResult): (WebCore::HitTestResult::operator=): (WebCore::HitTestResult::addNodeToListBasedTestResultCommon): (WebCore::HitTestResult::append): * rendering/HitTestResult.h: * testing/Internals.cpp: (WebCore::Internals::nodesFromRect const): 2020-05-01 Chris Dumez <cdumez@apple.com> Unreviewed build fix after r260962. * page/Page.cpp: (WebCore::Page::setCORSDisablingPatterns): * page/Page.h: (WebCore::Page::setCORSDisablingPatterns): Deleted. 2020-05-01 Kenneth Russell <kbr@chromium.org> [WebGL2] Refactor texImage2D and texSubImage2D taking ImageBitmap, ImageData, Image, ArrayBufferView https://bugs.webkit.org/show_bug.cgi?id=210766 Reviewed by Dean Jackson. Refactor the texture upload paths taking DOM sources and ArrayBuffers so that texImage/texSubImage and 2D/3D textures are handled with the same entry point. Hook up WebGL 2.0 pixel unpack parameters for selecting sub-rectangles during texture uploads. Refactor context initialization to support WebGL 2.0-specific code paths. Remove duplicate code validating the type of the ArrayBufferView passed to readPixels that was added in the patch for Bug 209515, and validation code subsumed by ANGLE. With this patch, dozens more texture-related WebGL 2.0 conformance tests are passing completely, including all of those under the directories: webgl/2.0.0/conformance2/textures/ canvas_sub_rectangle/ image_data/ The svg_image/ tests in this directory demonstrate browser inconsistencies in SVG handling, and are temporarily skipped. These will be investigated in Bug 211220. Other conformance tests progress or change results, which is expected until WebGL2RenderingContext is fully implemented. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::create): (WebCore::WebGL2RenderingContext::WebGL2RenderingContext): (WebCore::WebGL2RenderingContext::initializeNewContext): (WebCore::WebGL2RenderingContext::resetUnpackParameters): (WebCore::WebGL2RenderingContext::restoreUnpackParameters): (WebCore::WebGL2RenderingContext::initializeShaderExtensions): (WebCore::WebGL2RenderingContext::getTextureSourceSubRectangle): (WebCore::WebGL2RenderingContext::pixelStorei): (WebCore::WebGL2RenderingContext::texStorage2D): (WebCore::WebGL2RenderingContext::texImage2D): (WebCore::WebGL2RenderingContext::texImage3D): (WebCore::WebGL2RenderingContext::texSubImage2D): (WebCore::WebGL2RenderingContext::texSubImage3D): (WebCore::WebGL2RenderingContext::initializeTransformFeedbackBufferCache): Deleted. (WebCore::WebGL2RenderingContext::initializeSamplerCache): Deleted. (WebCore::WebGL2RenderingContext::sliceTypedArrayBufferView): Deleted. * html/canvas/WebGL2RenderingContext.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::create): (WebCore::WebGLRenderingContext::WebGLRenderingContext): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::ScopedUnpackParametersResetRestore::ScopedUnpackParametersResetRestore): (WebCore::ScopedUnpackParametersResetRestore::~ScopedUnpackParametersResetRestore): (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): (WebCore::WebGLRenderingContextBase::initializeNewContext): (WebCore::WebGLRenderingContextBase::resetUnpackParameters): (WebCore::WebGLRenderingContextBase::restoreUnpackParameters): (WebCore::WebGLRenderingContextBase::compressedTexImage2D): (WebCore::WebGLRenderingContextBase::compressedTexSubImage2D): (WebCore::WebGLRenderingContextBase::validateSettableTexInternalFormat): (WebCore::WebGLRenderingContextBase::copyTexSubImage2D): (WebCore::WebGLRenderingContextBase::generateMipmap): (WebCore::WebGLRenderingContextBase::getTexParameter): (WebCore::WebGLRenderingContextBase::readPixels): (WebCore::WebGLRenderingContextBase::sentinelEmptyRect): (WebCore::WebGLRenderingContextBase::safeGetImageSize): (WebCore::WebGLRenderingContextBase::getImageDataSize): (WebCore::WebGLRenderingContextBase::getTexImageSourceSize): (WebCore::WebGLRenderingContextBase::texImageSourceHelper): (WebCore::WebGLRenderingContextBase::texImageArrayBufferViewHelper): (WebCore::WebGLRenderingContextBase::texImageImpl): (WebCore::WebGLRenderingContextBase::texImage2DBase): (WebCore::WebGLRenderingContextBase::texSubImage2DBase): (WebCore::WebGLRenderingContextBase::getTexImageFunctionName): (WebCore::WebGLRenderingContextBase::validateTexFunc): (WebCore::WebGLRenderingContextBase::texImage2D): (WebCore::WebGLRenderingContextBase::texSubImage2D): (WebCore::WebGLRenderingContextBase::validateArrayBufferType): (WebCore::WebGLRenderingContextBase::validateTexFuncData): (WebCore::WebGLRenderingContextBase::validateTexFuncParameters): (WebCore::WebGLRenderingContextBase::addExtensionSupportedFormatsAndTypes): (WebCore::WebGLRenderingContextBase::addExtensionSupportedFormatsAndTypesWebGL2): (WebCore::WebGLRenderingContextBase::validateTexImageSourceFormatAndType): (WebCore::WebGLRenderingContextBase::copyTexImage2D): (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer): (WebCore::WebGLRenderingContextBase::texParameter): (WebCore::WebGLRenderingContextBase::getUnpackPixelStoreParams const): (WebCore::WebGLRenderingContextBase::validateTextureBinding): (WebCore::WebGLRenderingContextBase::validateTexImageBinding): (WebCore::WebGLRenderingContextBase::validateTexture2DBinding): (WebCore::WebGLRenderingContextBase::validateSize): (WebCore::WebGLRenderingContextBase::validateImageBitmap): (WebCore::WebGLRenderingContextBase::maybeRestoreContext): (WebCore::WebGLRenderingContextBase::texImageSource2D): Deleted. (WebCore::WebGLRenderingContextBase::texImage2DImpl): Deleted. (WebCore::WebGLRenderingContextBase::texSubImage2DImpl): Deleted. * html/canvas/WebGLRenderingContextBase.h: (WebCore::WebGLRenderingContextBase::getTextureSourceSize): (WebCore::WebGLRenderingContextBase::validateTexImageSubRectangle): * platform/graphics/IntRect.cpp: (WebCore::IntRect::isValid const): * platform/graphics/IntRect.h: 2020-05-01 Jack Lee <shihchieh_lee@apple.com> Nullptr crash in CompositeEditCommand::cloneParagraphUnderNewElement when indent and align a paragraph. https://bugs.webkit.org/show_bug.cgi?id=211273 <rdar://problem/61885958> Reviewed by Geoffrey Garen. A load event can fire when we clone and append a paragraph. Check if the elements are removed in the event and bail out. Test: fast/editing/indent-then-justifyFull-crash.html * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement): 2020-05-01 Jack Lee <shihchieh_lee@apple.com> Nullptr crash in EditCommand::EditCommand via CompositeEditCommand::removeNode https://bugs.webkit.org/show_bug.cgi?id=207600 <rdar://problem/56969450> Reviewed by Geoffrey Garen. Second part of the fix. Remove m_frame in FrameSelection so it will not be inadvertently used and cause this crash. No new tests, covered by existing test. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::rootViewRectForRange const): * editing/FrameSelection.cpp: (WebCore::FrameSelection::FrameSelection): (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance): (WebCore::FrameSelection::modify): (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected): (WebCore::FrameSelection::setFocusedElementIfNeeded): (WebCore::FrameSelection::shouldDeleteSelection const): (WebCore::FrameSelection::shouldDeleteSelection): (WebCore::FrameSelection::revealSelection): (WebCore::FrameSelection:: shouldChangeSelection): (WebCore::FrameSelection::shouldChangeSelection const): * editing/FrameSelection.h: * editing/atk/FrameSelectionAtk.cpp: (WebCore::FrameSelection::notifyAccessibilityForSelectionChange): * editing/mac/FrameSelectionMac.mm: (WebCore::FrameSelection::notifyAccessibilityForSelectionChange): 2020-05-01 Darin Adler <darin@apple.com> REGRESSION (r260739): Crash when pasting into Mail https://bugs.webkit.org/show_bug.cgi?id=211311 Reviewed by Wenson Hsieh. Speculative fix. Would be much better to create a test case demonstrating it's correct. * editing/cocoa/HTMLConverter.mm: (WebCore::editingAttributedString): Use container node when TextIterator::node returns null. 2020-05-01 Don Olmstead <don.olmstead@sony.com> [GTK] Add additional exports to support hidden visibility https://bugs.webkit.org/show_bug.cgi?id=211246 Reviewed by Michael Catanzaro. * platform/ContentType.h: * platform/graphics/cairo/RefPtrCairo.h: * platform/gtk/GtkUtilities.h: * platform/network/soup/CertificateInfo.h: * platform/network/soup/SoupNetworkSession.h: 2020-05-01 Yusuke Suzuki <ysuzuki@apple.com> Introduce MainThreadNeverDestroyed / MainThreadLazyNeverDestroyed https://bugs.webkit.org/show_bug.cgi?id=211264 Reviewed by Mark Lam. No behavior change. Adding assertions additionally. * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp: (WebCore::stringForPlaybackTargetAvailability): * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::InitDataRegistry::cencName): (WebCore::InitDataRegistry::keyidsName): (WebCore::InitDataRegistry::webmName): * Modules/mediacontrols/MediaControlsHost.cpp: (WebCore::MediaControlsHost::automaticKeyword): (WebCore::MediaControlsHost::forcedOnlyKeyword): (WebCore::alwaysOnKeyword): (WebCore::manualKeyword): * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::kind const): (WebCore::MediaStreamTrack::contentHint const): * Modules/mediastream/RTCDataChannel.cpp: (WebCore::blobKeyword): (WebCore::arraybufferKeyword): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::liveRegionRelevant const): * dom/ConstantPropertyMap.cpp: (WebCore::ConstantPropertyMap::nameForProperty const): * dom/Document.cpp: (WebCore::Document::validateCustomElementName): * dom/InlineStyleSheetOwner.cpp: (WebCore::isValidCSSContentType): * dom/MutationRecord.cpp: * dom/make_names.pl: (printNamesHeaderFile): (printNamesCppFile): * html/Autocapitalize.cpp: (WebCore::stringForAutocapitalizeType): * html/Autofill.cpp: (WebCore::isContactToken): (WebCore::AutofillData::createFromHTMLFormControlElement): * html/BaseCheckableInputType.cpp: (WebCore::BaseCheckableInputType::fallbackValue const): * html/BaseChooserOnlyDateAndTimeInputType.cpp: (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree): * html/ColorInputType.cpp: (WebCore::ColorInputType::createShadowSubtree): * html/FileInputType.cpp: (WebCore::UploadButtonElement::UploadButtonElement): * html/FormController.cpp: (WebCore::FormKeyGenerator::formKey): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parseAttribute): (WebCore::HTMLAnchorElement::isSystemPreviewLink const): * html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::formControlType const): * html/HTMLDetailsElement.cpp: (WebCore::summarySlotName): * html/HTMLElement.cpp: (WebCore::toValidDirValue): (WebCore::trueName): (WebCore::falseName): (WebCore::plaintextOnlyName): (WebCore::HTMLElement::setAutocorrect): * html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::formControlType const): * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::autocomplete const): * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::loadingForBindings const): * html/HTMLKeygenElement.cpp: (WebCore::HTMLKeygenElement::formControlType const): * html/HTMLOptGroupElement.cpp: (WebCore::HTMLOptGroupElement::formControlType const): * html/HTMLOutputElement.cpp: (WebCore::HTMLOutputElement::formControlType const): * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const): * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::formControlType const): * html/HTMLTableCellElement.cpp: (WebCore::HTMLTableCellElement::scope const): * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::formControlType const): * html/HTMLTextFormControlElement.cpp: (WebCore::directionString): (WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability): * html/InputMode.cpp: (WebCore::InputModeNames::none): (WebCore::InputModeNames::text): (WebCore::InputModeNames::tel): (WebCore::InputModeNames::url): (WebCore::InputModeNames::email): (WebCore::InputModeNames::numeric): (WebCore::InputModeNames::decimal): (WebCore::InputModeNames::search): * html/InputTypeNames.cpp: (WebCore::InputTypeNames::button): (WebCore::InputTypeNames::checkbox): (WebCore::InputTypeNames::color): (WebCore::InputTypeNames::date): (WebCore::InputTypeNames::datetime): (WebCore::InputTypeNames::datetimelocal): (WebCore::InputTypeNames::email): (WebCore::InputTypeNames::file): (WebCore::InputTypeNames::hidden): (WebCore::InputTypeNames::image): (WebCore::InputTypeNames::month): (WebCore::InputTypeNames::number): (WebCore::InputTypeNames::password): (WebCore::InputTypeNames::radio): (WebCore::InputTypeNames::range): (WebCore::InputTypeNames::reset): (WebCore::InputTypeNames::search): (WebCore::InputTypeNames::submit): (WebCore::InputTypeNames::telephone): (WebCore::InputTypeNames::text): (WebCore::InputTypeNames::time): (WebCore::InputTypeNames::url): (WebCore::InputTypeNames::week): * html/MediaController.cpp: (WebCore::playbackStateWaiting): (WebCore::playbackStatePlaying): (WebCore::playbackStateEnded): * html/RangeInputType.cpp: (WebCore::RangeInputType::createShadowSubtree): * html/SearchInputType.cpp: (WebCore::updateResultButtonPseudoType): * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::createShadowSubtree): (WebCore::TextFieldInputType::createDataListDropdownIndicator): (WebCore::TextFieldInputType::createContainer): (WebCore::TextFieldInputType::createAutoFillButton): * html/ValidationMessage.cpp: (WebCore::ValidationMessage::buildBubbleTree): * html/shadow/DetailsMarkerControl.cpp: (WebCore::DetailsMarkerControl::DetailsMarkerControl): * html/shadow/MediaControlTextTrackContainerElement.cpp: (WebCore::MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement): * html/shadow/ProgressShadowElement.cpp: (WebCore::ProgressInnerElement::create): (WebCore::ProgressBarElement::create): (WebCore::ProgressValueElement::create): * html/shadow/SliderThumbElement.cpp: (WebCore::SliderThumbElement::resolveCustomStyle): (WebCore::SliderContainerElement::resolveCustomStyle): * html/shadow/SpinButtonElement.cpp: (WebCore::SpinButtonElement::SpinButtonElement): * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement): (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement): * html/shadow/YouTubeEmbedShadowElement.cpp: (WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement): * html/shadow/mac/ImageControlsButtonElementMac.cpp: (WebCore::ImageControlsButtonElementMac::tryCreate): * html/shadow/mac/ImageControlsRootElementMac.cpp: (WebCore::ImageControlsRootElement::tryCreate): * html/track/AudioTrack.cpp: (WebCore::AudioTrack::alternativeKeyword): (WebCore::AudioTrack::descriptionKeyword): (WebCore::AudioTrack::mainKeyword): (WebCore::AudioTrack::mainDescKeyword): (WebCore::AudioTrack::translationKeyword): (WebCore::AudioTrack::commentaryKeyword): * html/track/TextTrack.cpp: (WebCore::TextTrack::subtitlesKeyword): (WebCore::captionsKeyword): (WebCore::descriptionsKeyword): (WebCore::chaptersKeyword): (WebCore::metadataKeyword): (WebCore::forcedKeyword): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::cueShadowPseudoId): (WebCore::TextTrackCue::cueBoxShadowPseudoId): (WebCore::TextTrackCue::cueBackdropShadowPseudoId): (WebCore::TextTrackCue::rebuildDisplayTree): * html/track/VTTRegion.cpp: (WebCore::upKeyword): (WebCore::VTTRegion::textTrackCueContainerScrollingClass): (WebCore::VTTRegion::textTrackCueContainerShadowPseudoId): (WebCore::VTTRegion::textTrackRegionShadowPseudoId): * html/track/VideoTrack.cpp: (WebCore::VideoTrack::alternativeKeyword): (WebCore::VideoTrack::captionsKeyword): (WebCore::VideoTrack::mainKeyword): (WebCore::VideoTrack::signKeyword): (WebCore::VideoTrack::subtitlesKeyword): (WebCore::VideoTrack::commentaryKeyword): * loader/cache/CachedResourceRequest.cpp: (WebCore::CachedResourceRequest::initiatorName const): * page/EventHandler.cpp: (WebCore::focusDirectionForKey): * page/Quirks.cpp: (WebCore::Quirks::shouldBypassBackForwardCache const): * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::updateKeyframeAnimations): * platform/cocoa/PlaybackSessionModelMediaElement.mm: (WebCore::PlaybackSessionModelMediaElement::eventNameAll): * platform/cocoa/VideoFullscreenModelVideoElement.mm: (WebCore::VideoFullscreenModelVideoElement::eventNameAll): * platform/graphics/FontCache.cpp: (WebCore::FontCache::alternateFamilyName): * platform/graphics/MediaPlayer.cpp: (WebCore::applicationOctetStream): (WebCore::textPlain): * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp: (WebCore::CDMPrivateFairPlayStreaming::sinfName): (WebCore::CDMPrivateFairPlayStreaming::skdName): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::metadataType): * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontCache::similarFont): (WebCore::FontCache::platformAlternateFamilyName): * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: (WebCore::SystemFontDatabaseCoreText::systemFontParameters): * platform/graphics/filters/SourceAlpha.cpp: (WebCore::SourceAlpha::effectName): * platform/graphics/filters/SourceGraphic.cpp: (WebCore::SourceGraphic::effectName): * platform/graphics/ios/FontCacheIOS.mm: (WebCore::FontCache::getCustomFallbackFont): * platform/graphics/texmap/TextureMapperShaderProgram.h: * platform/graphics/win/FontCacheWin.cpp: (WebCore::FontCache::lastResortFallbackFont): (WebCore::FontCache::platformAlternateFamilyName): * platform/network/cocoa/ResourceResponseCocoa.mm: (WebCore::extractHTTPStatusText): * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::checkLinesForTextOverflow): * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::hyphenString const): (WebCore::RenderStyle::textEmphasisMarkString const): * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const): * svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::rotateMode const): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::setCalcMode): (WebCore::SVGAnimationElement::setAttributeType): (WebCore::SVGAnimationElement::isAdditive const): (WebCore::SVGAnimationElement::isAccumulated const): (WebCore::inheritsFromProperty): * svg/SVGStyleElement.cpp: (WebCore::SVGStyleElement::type const): (WebCore::SVGStyleElement::media const): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::parseClockValue): (WebCore::SVGSMILElement::restart const): (WebCore::SVGSMILElement::fill const): (WebCore::SVGSMILElement::repeatCount const): * svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp: (WebCore::SVGAnimationColorFunction::colorFromString): * svg/properties/SVGPropertyAnimator.h: (WebCore::SVGPropertyAnimator::adjustForInheritance const): 2020-05-01 Chris Dumez <cdumez@apple.com> REGRESSION (r260243): [ Mac WK1 ] fast/media/mq-inverted-colors-live-update-for-listener.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=211154 <rdar://problem/62555128> Reviewed by Darin Adler. Make MediaQueryList an ActiveDOMObject and make sure its JS wrapper stays alive as long as it may fire change events and there is at least 1 change event listener. No new tests, already covered by existing tests. * css/MediaQueryList.cpp: (WebCore::MediaQueryList::MediaQueryList): (WebCore::MediaQueryList::create): (WebCore::MediaQueryList::~MediaQueryList): (WebCore::MediaQueryList::detachFromMatcher): (WebCore::MediaQueryList::evaluate): (WebCore::MediaQueryList::setMatches): (WebCore::MediaQueryList::matches): (WebCore::MediaQueryList::eventListenersDidChange): (WebCore::MediaQueryList::activeDOMObjectName const): (WebCore::MediaQueryList::virtualHasPendingActivity const): * css/MediaQueryList.h: * css/MediaQueryList.idl: * css/MediaQueryMatcher.cpp: (WebCore::MediaQueryMatcher::documentDestroyed): 2020-05-01 Don Olmstead <don.olmstead@sony.com> Use export macros on all platforms https://bugs.webkit.org/show_bug.cgi?id=211293 Reviewed by Michael Catanzaro. * platform/PlatformExportMacros.h: 2020-05-01 Eric Carlson <eric.carlson@apple.com> [MSE] Audio session category is sometimes not set correctly after changing video source https://bugs.webkit.org/show_bug.cgi?id=211252 <rdar://problem/61894737> Reviewed by Jer Noble. Test: media/media-source/media-source-change-source.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaPlayerActiveSourceBuffersChanged): Call checkForAudioAndVideo. (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Ditto. (WebCore::HTMLMediaElement::videoTrackSelectedChanged): Ditto. (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto. (WebCore::HTMLMediaElement::updatePlayState): Ditto. (WebCore::HTMLMediaElement::checkForAudioAndVideo): New, update m_hasEverHadAudio and m_hasEverHadVideo and call m_mediaSession->canProduceAudioChanged. (WebCore::HTMLMediaElement::mediaType const): Put `hasVideo()` in a local variable since it is used more than once. * html/HTMLMediaElement.h: * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::updateSessionState): Iterate over the list of media sessions once, not five times. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): Call m_player->characteristicChanged() rather than m_player->renderingModeChanged(). 2020-05-01 Peng Liu <peng.liu6@apple.com> A PiP window doesn’t actually dismiss after the browser navigates to a different page within the same domain https://bugs.webkit.org/show_bug.cgi?id=211257 Reviewed by Jer Noble. When we suspend a video element (this will happen when the browser is navigating to another page within the same domain), we need to request the corresponding video to exit fullscreen/PiP. The operation should be done immediately because the video element won't response to events after it is suspended. In r259095, we hold the start of exiting video fullscreen/PiP in HTMLMediaElement::exitFullscreen() until the "webkitendfullscreen" event is dispatched/handled. This behavior does not work if the video element is going to be suspended because the exiting fullscreen operation will be held until the video element is resumed. Therefore, we need to handle that case separately by exiting video fullscreen/PiP immediately. API test: PictureInPicture.ExitPiPOnSuspendVideoElement * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::exitFullscreen): * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::exitFullscreen): 2020-05-01 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Introduce struct RowHeight in TableFormattingContext::computeAndDistributeExtraVerticalSpace https://bugs.webkit.org/show_bug.cgi?id=211275 Reviewed by Antti Koivisto. This is in preparation for available space distribution across row spans. * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): 2020-05-01 Antti Koivisto <antti@apple.com> Specific dom node order of Shadow DOM (re)projection causes crash https://bugs.webkit.org/show_bug.cgi?id=211159 <rdar://problem/62626920> Reviewed by Zalan Bujtas. ComposedTreeIterator may traverse to nodes outside its root element if it is constructed with a starting node that has no next sibling inside a slot. This leads to miscomputing RenderTreePosition::nextSibling() and eventual nullptr crash in RenderTreeBuilder when adding a renderer (due to beforeChild renderer being outside the parent renderer). Test case by Elliott Marquez. Test: fast/shadow-dom/composed-tree-iterator-escape.html * dom/ComposedTreeIterator.cpp: (WebCore::ComposedTreeIterator::Context::Context): When findind the end iterator for a tree context we need to look for a sibling in ancestors if the current node has no siblings. 2020-05-01 Alexey Shvayka <shvaikalesh@gmail.com> [WebIDL] Interface prototype objects should define @@toStringTag https://bugs.webkit.org/show_bug.cgi?id=211020 Reviewed by Darin Adler. WebIDL spec was recently updated [1] to define @@toStringTag on interface prototype objects. This change aligns WebIDL with ECMA-262 built-ins and Blink's behavior. Gecko have also expressed implementation commitment. This patch implements the spec change, making `X.prototype.toString()` return "[object X]" instead of "[object XPrototype]", where X is WebIDL interface. This behavior is proven to be web compatible (shipping in Chrome since Q2 2016) and matches class strings of iterator prototype objects [2] introduced in r253855. [1]: https://github.com/heycam/webidl/pull/357 [2]: https://heycam.github.io/webidl/#es-iterator-prototype-object Tests: fast/dom/prototype-chain.html fast/dom/wrapper-classes.html fast/workers/DedicatedWorkerGlobalScope-prototype-chain.html imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-interface.any.js imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-named-properties-object.window.js * bindings/js/JSDOMIterator.h: (WebCore::IteratorTraits>::finishCreation): * bindings/js/JSDOMWindowProperties.cpp: (WebCore::JSDOMWindowProperties::finishCreation): * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GeneratePrototypeDeclaration): (GenerateConstructorHelperMethods): * bindings/scripts/test/*: Updated. 2020-05-01 Saam Barati <sbarati@apple.com> We can't cast toLength result to unsigned https://bugs.webkit.org/show_bug.cgi?id=211205 <rdar://problem/62625562> Reviewed by Yusuke Suzuki. * bridge/NP_jsobject.cpp: 2020-05-01 Antoine Quint <graouts@apple.com> REGRESSION: MotionMark 1.1 regressed due to r260016 https://bugs.webkit.org/show_bug.cgi?id=211280 <rdar://problem/61898830> Unreviewed. * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::drawImage): * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::draw): * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawImage): 2020-05-01 Philippe Normand <pnormand@igalia.com> [GStreamer] Move video frame holder to its own file https://bugs.webkit.org/show_bug.cgi?id=211239 Reviewed by Alex Christensen. This class implementation is big enough for a new compilation unit, IMHO. * platform/GStreamer.cmake: * platform/graphics/gstreamer/GStreamerVideoFrameHolder.cpp: Added. (WebCore::GstVideoFrameHolder::GstVideoFrameHolder): (WebCore::GstVideoFrameHolder::~GstVideoFrameHolder): (WebCore::GstVideoFrameHolder::handoffVideoDmaBuf): (WebCore::GstVideoFrameHolder::waitForCPUSync): (WebCore::GstVideoFrameHolder::updateTexture): (WebCore::GstVideoFrameHolder::platformLayerBuffer): * platform/graphics/gstreamer/GStreamerVideoFrameHolder.h: Added. (WebCore::GstVideoFrameHolder::size const): (WebCore::GstVideoFrameHolder::hasAlphaChannel const): (WebCore::GstVideoFrameHolder::flags const): (WebCore::GstVideoFrameHolder::textureID const): (WebCore::GstVideoFrameHolder::hasMappedTextures const): (WebCore::GstVideoFrameHolder::videoFrame const): (WebCore::GstVideoFrameHolder::hasDMABuf const): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::GstVideoFrameHolder::GstVideoFrameHolder): Deleted. (WebCore::GstVideoFrameHolder::~GstVideoFrameHolder): Deleted. (WebCore::GstVideoFrameHolder::handoffVideoDmaBuf): Deleted. (WebCore::GstVideoFrameHolder::waitForCPUSync): Deleted. (WebCore::GstVideoFrameHolder::size const): Deleted. (WebCore::GstVideoFrameHolder::hasAlphaChannel const): Deleted. (WebCore::GstVideoFrameHolder::flags const): Deleted. (WebCore::GstVideoFrameHolder::textureID const): Deleted. (WebCore::GstVideoFrameHolder::hasMappedTextures const): Deleted. (WebCore::GstVideoFrameHolder::videoFrame const): Deleted. (WebCore::GstVideoFrameHolder::updateTexture): Deleted. (WebCore::GstVideoFrameHolder::platformLayerBuffer): Deleted. (WebCore::GstVideoFrameHolder::hasDMABuf const): Deleted. 2020-05-01 Adrian Perez de Castro <aperez@igalia.com> [GTK4] Disable arrow on context menu popover https://bugs.webkit.org/show_bug.cgi?id=211241 Reviewed by Carlos Garcia Campos. No new tests needed. * platform/gtk/GtkVersioning.h: (gdk_display_get_monitor_at_window): Add no-op stub for GTK3. 2020-04-30 Rob Buis <rbuis@igalia.com> Inline reportBlockedPortFailed and reportAuthenticationChallengeBlocked https://bugs.webkit.org/show_bug.cgi?id=211250 Reviewed by Alex Christensen. These two static methods have only one caller each, so we can just inline them at the call site since there is nothing tying them to FrameLoader. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::willSendRequest): * loader/FrameLoader.cpp: (WebCore::FrameLoader::reportBlockedPortFailed): Deleted. (WebCore::FrameLoader::reportAuthenticationChallengeBlocked): Deleted. * loader/FrameLoader.h: * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::didBlockAuthenticationChallenge): 2020-04-30 Ross Kirsling <ross.kirsling@sony.com> TriState should be an enum class and use "Indeterminate" instead of "Mixed" https://bugs.webkit.org/show_bug.cgi?id=211268 Reviewed by Mark Lam. * dom/Document.cpp: (WebCore::Document::queryCommandIndeterm): (WebCore::Document::queryCommandState): * editing/EditingStyle.cpp: (WebCore::EditingStyle::triStateOfStyle const): (WebCore::EditingStyle::hasStyle): * editing/Editor.cpp: (WebCore::Editor::selectionUnorderedListState const): (WebCore::Editor::selectionOrderedListState const): * editing/EditorCommand.cpp: (WebCore::isStylePresent): (WebCore::stateStyle): (WebCore::stateTextWritingDirection): (WebCore::stateNone): (WebCore::stateStyleWithCSS): (WebCore::Editor::Command::state const): (WebCore::Editor::Command::value const): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::checkOrEnableIfNeeded const): 2020-04-30 Simon Fraser <simon.fraser@apple.com> Clean up some EventHandler coordinate-related naming and fix ScrollableArea::lastKnownMousePosition() conversions https://bugs.webkit.org/show_bug.cgi?id=211259 Reviewed by Zalan Bujtas. On EventHandler, rename m_lastKnownMousePosition, m_mouseDownPos and m_mouseDown for clarity. Rename ScrollableArea::lastKnownMousePosition() to be lastKnownMousePositionInView(). Previously, lastKnownMousePosition() would fetch it from EventHandler, which simply stashed event.position() (which is in a coordinate system that differs between WK1 and Wk2) which was not relative to the EventHandler's frame. This cause mouseLocationInScrollerForScrollerImp: to give wrong answers. Instead, lastKnownMousePositionInView() now specifically returns coordinates relative to the Frame. This behavior change will be tested in future overlay scrollbar tests. Document::showPlaybackTargetPicker() was using FrameView::lastKnownMousePosition(), so to avoid changing its (probably broken) behavior, have it call frame()->eventHandler().lastKnownMousePosition(). * dom/Document.cpp: (WebCore::Document::showPlaybackTargetPicker): * page/EventHandler.cpp: (WebCore::EventHandler::clear): (WebCore::EventHandler::handleMousePressEvent): (WebCore::EventHandler::handleMouseDraggedEvent): (WebCore::EventHandler::updateDragSourceActionsAllowed const): (WebCore::EventHandler::dispatchDragStartEventOnSourceElement): (WebCore::EventHandler::handleDrag): (WebCore::EventHandler::mouseMovementExceedsThreshold const): * page/EventHandler.h: * page/FrameView.cpp: (WebCore::FrameView::lastKnownMousePositionInView const): (WebCore::FrameView::lastKnownMousePosition const): Deleted. * page/FrameView.h: * platform/PlatformMouseEvent.h: * platform/ScrollableArea.h: (WebCore::ScrollableArea::lastKnownMousePositionInView const): (WebCore::ScrollableArea::lastKnownMousePosition const): Deleted. * platform/mac/ScrollAnimatorMac.mm: (-[WebScrollerImpPairDelegate mouseLocationInContentAreaForScrollerImpPair:]): (-[WebScrollerImpPairDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]): (-[WebScrollerImpDelegate mouseLocationInScrollerForScrollerImp:]): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::lastKnownMousePositionInView const): (WebCore::RenderLayer::lastKnownMousePosition const): Deleted. * rendering/RenderLayer.h: * rendering/RenderListBox.cpp: (WebCore::RenderListBox::lastKnownMousePositionInView const): (WebCore::RenderListBox::lastKnownMousePosition const): Deleted. * rendering/RenderListBox.h: 2020-04-30 Yusuke Suzuki <ysuzuki@apple.com> Some HTML element critical paths include AtomString materialization https://bugs.webkit.org/show_bug.cgi?id=211223 Reviewed by Saam Barati. While measuring Speedometer2, I've noticed that every time we create some type of input element, we call AtomString multiple times while it is not necessary. It turned out that this is because some places are using `AtomString("...", AtomString::ConstructFromLiteral)` instead of `static NeverDestroyed<const AtomString> ...("...", AtomString::ConstructFromLiteral)`. Since HTML is in the main thread, we can just use `static NeverDestroyed<>`. This patch fixes `AtomString()` calls by changing them to `NeverDestroyed<const AtomString>` if it is under WebCore/html directory. And in this patch, we omit FTPDirectoryDocument, MediaDocument, and PluginDocument's fixes for now since their AtomString content has a bit different nature (some pseudo CSS value ("-webkit-xxx") v.s. some particular CSS property value ("100%"). * html/ColorInputType.cpp: (WebCore::ColorInputType::createShadowSubtree): * html/FileInputType.cpp: (WebCore::UploadButtonElement::UploadButtonElement): * html/HTMLElement.cpp: (WebCore::trueName): (WebCore::falseName): (WebCore::plaintextOnlyName): (WebCore::HTMLElement::setContentEditable): (WebCore::HTMLElement::setDraggable): (WebCore::HTMLElement::setSpellcheck): (WebCore::HTMLElement::setAutocorrect): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability): * html/RangeInputType.cpp: (WebCore::RangeInputType::createShadowSubtree): * html/SearchInputType.cpp: (WebCore::updateResultButtonPseudoType): * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::createShadowSubtree): (WebCore::TextFieldInputType::createDataListDropdownIndicator): (WebCore::TextFieldInputType::createContainer): (WebCore::TextFieldInputType::createAutoFillButton): * html/ValidationMessage.cpp: (WebCore::ValidationMessage::buildBubbleTree): * html/shadow/DetailsMarkerControl.cpp: (WebCore::DetailsMarkerControl::DetailsMarkerControl): * html/shadow/MediaControlTextTrackContainerElement.cpp: (WebCore::MediaControlTextTrackContainerElement::MediaControlTextTrackContainerElement): * html/shadow/ProgressShadowElement.cpp: (WebCore::ProgressInnerElement::create): (WebCore::ProgressBarElement::create): (WebCore::ProgressValueElement::create): * html/shadow/ProgressShadowElement.h: (WebCore::ProgressInnerElement::create): Deleted. (WebCore::ProgressBarElement::create): Deleted. (WebCore::ProgressValueElement::create): Deleted. * html/shadow/SpinButtonElement.cpp: (WebCore::SpinButtonElement::SpinButtonElement): * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement): (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement): * html/shadow/YouTubeEmbedShadowElement.cpp: (WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement): * html/shadow/mac/ImageControlsButtonElementMac.cpp: (WebCore::ImageControlsButtonElementMac::tryCreate): * html/shadow/mac/ImageControlsRootElementMac.cpp: (WebCore::ImageControlsRootElement::tryCreate): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::rebuildDisplayTree): 2020-04-30 Jiewen Tan <jiewen_tan@apple.com> [WebAuthn] Optimize LocalAuthenticator https://bugs.webkit.org/show_bug.cgi?id=183534 <rdar://problem/43357408> Reviewed by Brent Fulgham. Covered by new API tests. * en.lproj/Localizable.strings: * platform/LocalizedStrings.cpp: (WebCore::getAssertionTouchIDPromptTitle): (WebCore::genericTouchIDPromptTitle): * platform/LocalizedStrings.h: Improving the LocalAuthentication dialog titles for iOS. 2020-04-30 Kate Cheney <katherine_cheney@apple.com> clearApplicationBundleIdentifierTestingOverride() should set the bundle identifier to a null string, not an empty string https://bugs.webkit.org/show_bug.cgi?id=211255 <rdar://problem/62651110> Reviewed by John Wilander. No new tests, behavior confirmed by existing tests. Clearing the bundle identifier during tests should reset the override value to be a null string so that the following calls to applicationBundleIdentifier() use the [NSBundle mainBundle] bundleIdentifier] call. * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::clearApplicationBundleIdentifierTestingOverride): 2020-04-30 Devin Rousso <drousso@apple.com> WebKit.WebContent process crashes when web developer tools are opened in Safari https://bugs.webkit.org/show_bug.cgi?id=210794 <rdar://problem/62214651> Reviewed by Brian Burg. Test: inspector/worker/dom-debugger-event-after-terminate-crash.html * inspector/agents/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::willHandleEvent): Don't `ASSERT(injectedScript.hasNoValue())` as it's possible for the event to be fired after `Worker.prototype.terminate`, in which case `InjectedScriptManager::injectedScriptFor` will now return an `InjectedScript` that would fail that `ASSERT`. 2020-04-30 Alex Christensen <achristensen@webkit.org> Add SPI to change a WKWebView's CORS disabling pattern after initialization https://bugs.webkit.org/show_bug.cgi?id=211211 <rdar://problem/61837474> Reviewed by Chris Dumez. * page/Page.h: (WebCore::Page::setCORSDisablingPatterns): 2020-04-30 Chris Dumez <cdumez@apple.com> WebCore::systemHasBattery() is unnecessarily expensive on iOS https://bugs.webkit.org/show_bug.cgi?id=211240 <rdar://problem/62619971> Reviewed by Geoffrey Garen. Update WebCore::systemHasBattery() to return true unconditionally on PLATFORM(IOS) and PLATFORM(WATCHOS) since iOS devices always have a battery. Also return false unconditionally for PLATFORM(APPLETV). * platform/cocoa/SystemBattery.mm: (WebCore::systemHasBattery): 2020-04-30 Andres Gonzalez <andresg_22@apple.com> Fix for crash in AXLogger. https://bugs.webkit.org/show_bug.cgi?id=211236 Reviewed by Chris Fleizach. Covered by existing tests. Notifications may have a null AXCoreObject target, so must check for nullity before streaming the object. * accessibility/AXLogger.cpp: (WebCore::AXLogger::log): 2020-04-30 Charlie Turner <cturner@igalia.com> [clang 11] fix build errors due to -WWc++11-narrowing https://bugs.webkit.org/show_bug.cgi?id=211193 Reviewed by Adrian Perez de Castro. Fixes the following errors, Source/WebCore/html/MediaElementSession.cpp:1059:9: error: type 'WebCore::RenderMedia *' cannot be narrowed to 'bool' in initializer list [-Wc++11-narrowing] m_element.renderer(), ^~~~~~~~~~~~~~~~~~~~ Source/WebCore/style/StyleResolver.cpp:106:55: error: type 'const char [4]' cannot be narrowed to 'bool' in initializer list [-Wc++11-narrowing] m_mediaQueryEvaluator = MediaQueryEvaluator { "all" }; ^~~~~ Source/WebCore/style/StyleResolver.cpp:106:55: note: insert an explicit cast to silence this issue m_mediaQueryEvaluator = MediaQueryEvaluator { "all" }; ^~~~~ static_cast<bool>( ) * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::hasRenderer const): MediaElementSession was implicitly casting a pointer to a bool, which is not allowed with modern Clang checks. Add a helper method to encapsulate the now required static_cast<bool>. * html/MediaElementSession.cpp: Use the new helper method to see if the HTMLMediaElement has an associated renderer. (WebCore::MediaElementSession::updateMediaUsageIfChanged): * style/StyleResolver.cpp: This was calling MediaQueryEvaluator { "all" }; and seemingly expecting to cast a const char[] to a bool, or maybe String? It's confusing because of the MediaQueryEvaluator API. If it was implicitly converting to bool then that could be unintentional. Such casts are not allowed either now. The MediaQueryEvaluator's default constructor says it returns true for "all", which appears to be the original intent of this call, so I replaced it with that. (WebCore::Style::Resolver::Resolver): 2020-04-30 Simon Fraser <simon.fraser@apple.com> border-radius fails to clip iframe contents https://bugs.webkit.org/show_bug.cgi?id=211199 <rdar://problem/61945671> Reviewed by Zalan Bujtas. iframes need to use the same composited clipping strategy that we use for other replaced elements with composited contents, like video and WebGL. To achieve this, change GraphicsLayer to allow child GraphicsLayers to be parented in the contents clipping layer, just like content layers are. (We don't want to do this unconditionally, because it will change behavior for video with controls.) Add GraphicsLayer::contentsRectClipsDescendants(), and used it to run code that creates the contents clipping (and optional shape) layers even when no contents layer is present. Fix up the sublayer list building to parent layers from children in the contents clipping layer. Tests: compositing/iframes/border-radius-composited-frame.html compositing/iframes/border-uneven-radius-composited-frame.html * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::GraphicsLayer): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::contentsRectClipsDescendants const): (WebCore::GraphicsLayer::setContentsRectClipsDescendants): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setContentsRectClipsDescendants): (WebCore::GraphicsLayerCA::updateSublayerList): (WebCore::GraphicsLayerCA::updateContentsRects): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/GraphicsLayerCA.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::isCompositedSubframeRenderer): * rendering/RenderLayerCompositor.h: 2020-04-30 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Adjust the available vertical space with the row span for cell layout https://bugs.webkit.org/show_bug.cgi?id=211218 Reviewed by Antti Koivisto. The vertical available space for a cell should include all row heights it spans. (can't include test, current table layout logic is incompatible with LFC -and FF/Chrome.) * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): 2020-04-30 Philippe Normand <pnormand@igalia.com> [SOUP] http/tests/media/video-accept-encoding.html fails https://bugs.webkit.org/show_bug.cgi?id=211228 Reviewed by Carlos Garcia Campos. The resource requests received by the network process always had the accept-encoding setting enabled due to lack of IPC (de)serialization for this boolean. The patch also enables soup release logging, set WEBKIT_DEBUG=Network=debug. * platform/network/soup/ResourceRequest.h: (WebCore::ResourceRequest::encodeWithPlatformData const): (WebCore::ResourceRequest::decodeWithPlatformData): * platform/network/soup/SoupNetworkSession.cpp: (WebCore::soupLogPrinter): (WebCore::SoupNetworkSession::setupLogger): 2020-04-30 Carlos Garcia Campos <cgarcia@igalia.com> [GTK4][X11] Add support for rendering web view contents https://bugs.webkit.org/show_bug.cgi?id=211189 Reviewed by Adrian Perez de Castro. Add PlatformDisplayX11::visual() to get the X visual used for rendering. * platform/graphics/x11/PlatformDisplayX11.cpp: (WebCore::PlatformDisplayX11::visual const): * platform/graphics/x11/PlatformDisplayX11.h: 2020-04-30 Andres Gonzalez <andresg_22@apple.com> Add logging of AXIsolatedTree and AXNotifications. https://bugs.webkit.org/show_bug.cgi?id=211214 Reviewed by Chris Fleizach. - Added operator<< implementations for AXIsolatedTree and AX notifications. - Added corresponding AXLogger::log overloads for the above types. - To set the root node and the focused node we are now always using setRootNodeID and setFocusedNodeID respectively. Therefore, before returning the root or the focused nodes, it is necessary to applyPendingChanges. * accessibility/AXLogger.cpp: (WebCore::AXLogger::add): Used for recursive logging of the hierarchy. (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AXObjectCache.cpp: Added logging of the isolated tree when it's generated and before and after updates. (WebCore::AXObjectCache::isolatedTreeFocusedObject): (WebCore::AXObjectCache::generateIsolatedTree): (WebCore::AXObjectCache::updateIsolatedTree): * accessibility/AXObjectCache.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::focusedUIElement const): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::createTreeForPageID): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::focusedNode): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNodeID): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::applyPendingChanges): (WebCore::AXIsolatedTree::focusedUIElement): Renamed focusedNode for naming consistency. (WebCore::AXIsolatedTree::setRootNode): Deleted. Using setRootNodeID instead, (WebCore::AXIsolatedTree::setFocusedNode): Deleted. Use setFocusedNodeID instead. * accessibility/isolatedtree/AXIsolatedTree.h: (WebCore::AXIsolatedTree::treeID const): (WebCore::AXIsolatedTree::treeIdentifier const): renamed treeID for naming consistency. 2020-04-30 Philippe Normand <pnormand@igalia.com> Unreviewed, GStreamer build warning fix after r260755. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcMakeRequest): There is no need to capture src in the closure, its protector is used instead. 2020-04-30 Philippe Normand <pnormand@igalia.com> [GStreamer] fast/mediastream/get-user-media-device-id.html failing https://bugs.webkit.org/show_bug.cgi?id=190576 Reviewed by Xabier Rodriguez-Calvar. The test was failing due to deviceId invalid constraint, which led me to rewrite the GStreamer Mock sources, removing various hacks and appsrc usage, which is not needed because we rely on audioSamplesAvailable and videoSamplesAvailable notifications. This patch also fixes the audio mock, which was generating silence until now. * platform/GStreamer.cmake: * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (WebCore::WebKitMediaStreamTrackObserver::WebKitMediaStreamTrackObserver): * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp: Removed. * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp: Removed. * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h: Removed. * platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp: Added. (WebCore::MockRealtimeAudioSource::create): (WebCore::MockRealtimeAudioSourceGStreamer::createForMockAudioCapturer): (WebCore::MockRealtimeAudioSourceGStreamer::MockRealtimeAudioSourceGStreamer): (WebCore::MockRealtimeAudioSourceGStreamer::render): (WebCore::MockRealtimeAudioSourceGStreamer::addHum): (WebCore::MockRealtimeAudioSourceGStreamer::reconfigure): * platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.h: Copied from Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h. * platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp: Added. (WebCore::MockRealtimeVideoSource::create): (WebCore::MockRealtimeVideoSourceGStreamer::createForMockDisplayCapturer): (WebCore::MockRealtimeVideoSourceGStreamer::MockRealtimeVideoSourceGStreamer): (WebCore::MockRealtimeVideoSourceGStreamer::updateSampleBuffer): * platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.h: Renamed from Source/WebCore/platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h. * platform/mock/MockRealtimeVideoSource.h: 2020-04-29 Simon Fraser <simon.fraser@apple.com> Use initializers in PlatformMouseEvent and WebEvent https://bugs.webkit.org/show_bug.cgi?id=211217 Reviewed by Tim Horton. Use initializers im PlatformMouseEvent. * platform/PlatformMouseEvent.h: (WebCore::PlatformMouseEvent::PlatformMouseEvent): 2020-04-29 Jer Noble <jer.noble@apple.com> Remove the debug ASSERT in ImageDecoderAVFObjC::storeSampleBuffer() https://bugs.webkit.org/show_bug.cgi?id=211191 <rdar://problem/62542285> Reviewed by Said Abou-Hallawa. r259594 added an iterator check and a RELEASE_LOG_ERROR for that check, making this ASSERT superfluous. * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::ImageDecoderAVFObjC::storeSampleBuffer): 2020-04-29 Simon Fraser <simon.fraser@apple.com> Simplify contents clipping layer geometry https://bugs.webkit.org/show_bug.cgi?id=211162 Reviewed by Zalan Bujtas. GraphicsLayerCA uses a contents clipping layer, with an optional shape layer, to support clipping replaced elements with composited contents, like video and WebGL canvas. A future patch will use this code path for composited subframes. To achieve this, we need to host the layers of child GraphicsLayers under m_contentsClippingLayer, but without the GraphicsLayer client having to do geometry math. We can do this by setting the bounds origin of m_contentsClippingLayer to adjust for its position relative to the GraphicsLayer origin. This patch does that, adjusting the position of the contents layer accordingly. The shape mask layer also needs adjusting; its position has to be at the layer's bounds origin, and the shape itself needs to have a zero origin. Tested by existing tests. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateSublayerList): (WebCore::GraphicsLayerCA::updateClippingStrategy): (WebCore::GraphicsLayerCA::updateContentsRects): 2020-04-29 Kenneth Russell <kbr@chromium.org> REGRESSION (r256784?): Shadertoy demo no longer works in Safari https://bugs.webkit.org/show_bug.cgi?id=210994 Reviewed by Dean Jackson. Certain Shadertoy examples stopped working with the ANGLE backend for WebGL because rendering to floating-point render targets was no longer being enabled implicitly along with the OES_texture_float extension. Add support for the WebGL 1.0 extensions EXT_color_buffer_half_float and WEBGL_color_buffer_float, and the WebGL 2.0 extension EXT_color_buffer_float. Enable these implicitly for WebGL 1.0 in the OES_texture_float and OES_texture_half_float extensions, restoring the previous functionality. Translate 32-bit floating point texture formats appropriately for the ANGLE backend. Fix some failures in previously-skipped conformance tests. The new code passes the more stringent top-of-tree WebGL 1.0.4 and 2.0.1 conformance tests related to floating-point texture renderability, which are not yet in the WebKit repository. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMConvertWebGL.cpp: (WebCore::convertToJSValue): * html/canvas/EXTColorBufferFloat.cpp: Copied from Source/WebCore/html/canvas/OESTextureHalfFloat.cpp. (WebCore::EXTColorBufferFloat::EXTColorBufferFloat): (WebCore::EXTColorBufferFloat::getName const): (WebCore::EXTColorBufferFloat::supported): * html/canvas/EXTColorBufferFloat.h: Copied from Source/WebCore/html/canvas/OESTextureFloat.h. * html/canvas/EXTColorBufferFloat.idl: Added. * html/canvas/EXTColorBufferHalfFloat.cpp: Copied from Source/WebCore/html/canvas/OESTextureFloat.cpp. (WebCore::EXTColorBufferHalfFloat::EXTColorBufferHalfFloat): (WebCore::EXTColorBufferHalfFloat::getName const): (WebCore::EXTColorBufferHalfFloat::supported): * html/canvas/EXTColorBufferHalfFloat.h: Copied from Source/WebCore/html/canvas/OESTextureFloat.h. * html/canvas/EXTColorBufferHalfFloat.idl: Added. * html/canvas/OESTextureFloat.cpp: (WebCore::OESTextureFloat::OESTextureFloat): (WebCore::OESTextureFloat::supported): * html/canvas/OESTextureFloat.h: * html/canvas/OESTextureHalfFloat.cpp: (WebCore::OESTextureHalfFloat::OESTextureHalfFloat): (WebCore::OESTextureHalfFloat::supported): * html/canvas/OESTextureHalfFloat.h: * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getExtension): (WebCore::WebGL2RenderingContext::getSupportedExtensions): (WebCore::WebGL2RenderingContext::getParameter): * html/canvas/WebGLColorBufferFloat.cpp: Copied from Source/WebCore/html/canvas/OESTextureFloat.cpp. (WebCore::WebGLColorBufferFloat::WebGLColorBufferFloat): (WebCore::WebGLColorBufferFloat::getName const): (WebCore::WebGLColorBufferFloat::supported): * html/canvas/WebGLColorBufferFloat.h: Copied from Source/WebCore/html/canvas/OESTextureFloat.h. * html/canvas/WebGLColorBufferFloat.idl: Added. * html/canvas/WebGLExtension.h: * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::getExtension): (WebCore::WebGLRenderingContext::getSupportedExtensions): (WebCore::WebGLRenderingContext::getParameter): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::extensionIsEnabled): (WebCore::WebGLRenderingContextBase::copyTexImage2D): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::adjustWebGL1TextureInternalFormat): (WebCore::ExtensionsGLANGLE::texImage2DRobustANGLE): * platform/graphics/angle/ExtensionsGLANGLE.h: * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::texImage2DDirect): 2020-04-29 Zalan Bujtas <zalan@apple.com> Header is blank on https://nader.org https://bugs.webkit.org/show_bug.cgi?id=205747 <rdar://problem/58305910> Reviewed by Simon Fraser. Do not use stale containing block width value while computing preferred width. Test: fast/text/text-indent-inside-float.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const): 2020-04-29 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Take row span into account when checking for missing cells https://bugs.webkit.org/show_bug.cgi?id=211184 Reviewed by Antti Koivisto. The tree builder looks for missing cells in the table grid and fills in the gaps with empty cells. This patch takes row spanning into account and make sure we don't end up adding an extra, redundant cell. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::buildTableStructure): 2020-04-29 Youenn Fablet <youenn@apple.com> Update SWServer.cpp originURL after https://trac.webkit.org/changeset/260707 https://bugs.webkit.org/show_bug.cgi?id=211169 Reviewed by Alex Christensen. * workers/service/server/SWServer.cpp: (WebCore::originURL): No need to dereference port since URL::setPort takes an Optional. 2020-04-29 Zalan Bujtas <zalan@apple.com> [LFC] FormattingContext::constraintsForInFlow/OutOfFlowContent should take const ContainerBox& https://bugs.webkit.org/show_bug.cgi?id=211161 Reviewed by Antti Koivisto. Leaf boxes should not need to compute constraints (as by definition they don't have in/out-of-flow descendants). * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::constraintsForOutOfFlowContent): (WebCore::Layout::FormattingContext::Geometry::constraintsForInFlowContent): * layout/FormattingContextQuirks.cpp: (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutInFlowContent): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForBoxAndAncestors): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight): * layout/blockformatting/PrecomputedBlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::precomputedPositiveNegativeValues const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutCell): 2020-04-29 Joonghun Park <jh718.park@samsung.com> Unreviewed. Remove no longer used variable and the build warning below. warning: unused variable ‘view’ [-Wunused-variable] No new tests, no new behaviour changes. * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEvent): 2020-04-29 Alicia Boya García <aboya@igalia.com> PlatformMediaResourceLoader should be destroyed on the main thread https://bugs.webkit.org/show_bug.cgi?id=211155 Reviewed by Xabier Rodriguez-Calvar. PlatformMediaResourceLoader is only safe to use from the main thread. A tricky detail is this includes its destruction. The same is true for PlatformMediaResource. Both classes are ThreadSafeRefCounted<> classes and therefore WTF::DestructionThread::Main can be used to ensure destruction is run in the correct thread with no need for additional client code. * platform/graphics/PlatformMediaResourceLoader.h: * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (WebKitWebSrcPrivate::StreamingMembers::~StreamingMembers): 2020-04-29 Rob Buis <rbuis@igalia.com> Make PolicyChecker an inner class of FrameLoader https://bugs.webkit.org/show_bug.cgi?id=211138 Reviewed by Alex Christensen. PolicyChecker HistoryController an inner class of FrameLoader, this allows us to move some methods only used by PolicyChecker out of the FrameLoader public API. Because it is not possible to forward declare an enum class in an inner class, move ShouldContinue out of the PolicyChecker class and rename it to ShouldContinuePolicyCheck. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::load): (WebCore::FrameLoader::loadPostRequest): (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): * loader/FrameLoader.h: * loader/FrameLoaderTypes.h: * loader/MediaResourceLoader.cpp: (WebCore::MediaResource::responseReceived): * loader/PolicyChecker.cpp: * loader/PolicyChecker.h: * platform/graphics/PlatformMediaResourceLoader.h: (WebCore::PlatformMediaResourceClient::responseReceived): * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: (WebCore::PlatformResourceMediaLoader::responseReceived): * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::responseReceived): * platform/network/cocoa/WebCoreNSURLSession.mm: (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived): (-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]): 2020-04-29 Adrian Perez de Castro <aperez@igalia.com> [GTK] Misplaced right click menu on web page due to deprecated gtk_menu_popup() https://bugs.webkit.org/show_bug.cgi?id=170553 Reviewed by Carlos Garcia Campos. * platform/gtk/GtkVersioning.h: Add replacements for GtkPopover functions which are no longet available in GTK4. (gtk_popover_menu_new): Added. (gtk_popover_bind_model): Added. (gtk_popover_set_relative_to): Added. 2020-04-29 Philippe Normand <pnormand@igalia.com> [GStreamer] Switch to audiointerleave https://bugs.webkit.org/show_bug.cgi?id=211124 Reviewed by Xabier Rodriguez-Calvar. The audiointerleave element is a drop-in replacement of interleave. It should behave a bit better in live. No new tests, existing webaudio tests cover this change. * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webKitWebAudioSrcConstructed): (webKitWebAudioSrcChangeState): 2020-04-23 Sergio Villar Senin <svillar@igalia.com> [WebXR][WPE] Implement XRTest::simulateDeviceConnection() https://bugs.webkit.org/show_bug.cgi?id=210912 Reviewed by Dean Jackson. This API gives tests the ability to spin up a simulated XR device which is an XR device which from the point of view of the WebXR API behaves like a normal XR device. These simulated XR devices can be controlled by the associated FakeXRDevice object. No new tests as this is machinery required to execute tests when implementing the WebXR API. * Modules/webxr/WebXRSystem.cpp: (WebCore::WebXRSystem::WebXRSystem): Initialize the default inline device. (WebCore::WebXRSystem::registerSimulatedXRDeviceForTesting): Add a newly created simulated XR device to the list of available devices. Update also the active immersive device and current inline device. (WebCore::WebXRSystem::unregisterSimulatedXRDeviceForTesting): Remove all simulated devices from the list of immersive XR devices. * Modules/webxr/WebXRSystem.h: New DummyInlineDevice which represents the default inline device which must not provide pose information. * Modules/webxr/WebXRView.cpp: (WebCore::WebXRView::WebXRView): Removed some methods that should be really part of a fake XRView instance. (WebCore::WebXRView::setProjectionMatrix): Add implementation. (WebCore::WebXRView::eye const): Deleted. (WebCore::WebXRView::projectionMatrix const): Deleted. (WebCore::WebXRView::transform const): Deleted. * Modules/webxr/WebXRView.h: (WebCore::WebXRView::eye const): Implemented. (WebCore::WebXRView::projectionMatrix const): Ditto. (WebCore::WebXRView::transform const): Ditto. (WebCore::WebXRView::setEye): Ditto. (WebCore::WebXRView::setTransform): Ditto. * Modules/webxr/XRReferenceSpaceType.h: Moved the definitions to PlatformXR. * platform/xr/PlatformXR.cpp: (PlatformXR::Instance::nextDeviceId): New method which returns uniquely defined ids for XR devices. (PlatformXR::Device::Device): * platform/xr/PlatformXR.h: (PlatformXR::Device::id const): New method. (PlatformXR::Device::supports const): Ditto. (PlatformXR::Device::setSupportedModes): Ditto. (PlatformXR::Device::setEnabledFeatures): Ditto. (PlatformXR::Device::operator== const): Ditto. * testing/FakeXRViewInit.h: fieldOfView is optional. * testing/WebFakeXRDevice.cpp: (WebCore::FakeXRView::setFieldOfView): Implemented. (WebCore::WebFakeXRDevice::setViews): Ditto. (WebCore::WebFakeXRDevice::setViewerOrigin): Ditto. (WebCore::WebFakeXRDevice::clearViewerOrigin): Ditto. (WebCore::WebFakeXRDevice::setFloorOrigin): Ditoo. (WebCore::WebFakeXRDevice::clearFloorOrigin): Ditto. (WebCore::WebFakeXRDevice::parseRigidTransform): Added. (WebCore::WebFakeXRDevice::parseView): Ditto. * testing/WebFakeXRDevice.h: Defined FakeXRView class which wraps a XRView adding some associated data as the field of view and viewport. Also defined the SimulatedXRDevice which is an PlatformXR::Device with some additional data useful for testing purpouses. * testing/WebXRTest.cpp: (WebCore::WebXRTest::simulateDeviceConnection): Create a new FakeXRDevice with an associated simulated XR device with the data provided by a FakeXRDeviceInit. (WebCore::WebXRTest::disconnectAllDevices): Remove all simulated devices from the list of immersive devices. * testing/WebXRTest.h: Call simulateDeviceConnection with ScriptExecutionContext. * testing/WebXRTest.idl: Ditto. 2020-04-29 Saam Barati <sbarati@apple.com> U_STRING_NOT_TERMINATED_WARNING ICU must be handled when using the output buffer as a C string https://bugs.webkit.org/show_bug.cgi?id=211142 <rdar://problem/62530860> Reviewed by Darin Adler. * editing/TextIterator.cpp: (WebCore::normalizeCharacters): * platform/text/LocaleICU.cpp: (WebCore::LocaleICU::decimalSymbol): (WebCore::LocaleICU::decimalTextAttribute): (WebCore::getDateFormatPattern): (WebCore::LocaleICU::createLabelVector): (WebCore::getFormatForSkeleton): * platform/text/LocaleToScriptMappingICU.cpp: (WebCore::localeToScriptCodeForFontSelection): * platform/text/TextCodecICU.cpp: (WebCore::TextCodecICU::decode): (WebCore::TextCodecICU::encode): 2020-04-29 Noam Rosenthal <noam@webkit.org> Add StringView::isAllSpecialCharacters() https://bugs.webkit.org/show_bug.cgi?id=211150 Reviewed by Darin Adler. Uses new StringView::isAllSpecialCharacters() instead of creating a StringImpl. No new tests. * rendering/TextPainter.cpp: (WebCore::TextPainter::paintTextOrEmphasisMarks): 2020-04-28 Said Abou-Hallawa <sabouhallawa@apple.com> Rendering update steps should use Seconds for the timestamps https://bugs.webkit.org/show_bug.cgi?id=210990 Unreviewed. serviceRequestAnimationFrameCallbacks() should return rounded milliseconds. This rounding was removed in r260736. So put it back. * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks): 2020-04-28 Carlos Garcia Campos <cgarcia@igalia.com> [GTK4] Add support for key events https://bugs.webkit.org/show_bug.cgi?id=211128 Reviewed by Adrian Perez de Castro. * platform/gtk/GtkVersioning.h: (gdk_event_get_keyval): (gdk_event_get_keycode): 2020-04-28 Wenson Hsieh <wenson_hsieh@apple.com> [Text manipulation] Add a userInfo dictionary to _WKTextManipulationToken https://bugs.webkit.org/show_bug.cgi?id=211151 <rdar://problem/62329534> Reviewed by Darin Adler. Add an extensible mechanism for the text manipulation controller to send additional metadata for each text manipulation token through to the WebKit client, for debugging purposes. Test: TextManipulation.StartTextManipulationExtractsUserInfo * editing/TextManipulationController.cpp: (WebCore::tokenInfo): (WebCore::TextManipulationController::observeParagraphs): * editing/TextManipulationController.h: Add TextManipulationTokenInfo, and add an optional TextManipulationTokenInfo member to TextManipulationToken. For now, just send over the document URL, element tag name, and the value of the role attribute. (WebCore::TextManipulationController::ManipulationTokenInfo::encode const): (WebCore::TextManipulationController::ManipulationTokenInfo::decode): (WebCore::TextManipulationController::ManipulationToken::encode const): (WebCore::TextManipulationController::ManipulationToken::decode): 2020-04-28 Simon Fraser <simon.fraser@apple.com> Update the xcfilelists. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: 2020-04-28 Simon Fraser <simon.fraser@apple.com> REGRESSION (r260808): Backdrops on music.apple.com are offset https://bugs.webkit.org/show_bug.cgi?id=211153 <rdar://problem/62543158> Reviewed by Zalan Bujtas. The border-radius code path failed to offset the rounded rect by contentOffsetInCompositingLayer(). Test: compositing/filters/backdrop-filter-rect-border-radius.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry): 2020-04-28 Daniel Bates <dabates@apple.com> Modernize EndPointsAdjustmentMode enumeration and fix misspelled enumerator https://bugs.webkit.org/show_bug.cgi?id=211141 Reviewed by Eric Carlson. Fix the misspelled enumerator DoNotAdjsutEndpoints. While I am here, make EndPointsAdjustmentMode an enum class sized as a bool and simplify the naming of its enumerators now that they have to be qualified. I also re-ordered them so that DoNotAdjust is the first enumerator (it will have value 0). This doesn't really matter, but I like it because it makes it so that this enumeration behaves more like an equivalent boolean should casts be involved. * editing/FrameSelection.cpp: (WebCore::FrameSelection::setSelectionByMouseIfDifferent): * editing/FrameSelection.h: * page/EventHandler.cpp: (WebCore::EventHandler::updateSelectionForMouseDrag): 2020-04-28 Daniel Bates <dabates@apple.com> [WebKitLegacy] Implement -hidePlaceholder and -showPlaceholderIfNecessary in terms of setCanShowPlaceholder() https://bugs.webkit.org/show_bug.cgi?id=211139 Reviewed by Simon Fraser. Remove hidePlaceholder() and showPlaceholderIfNecessary() as they are no longer needed. Callers should use setCanShowPlaceholder() instead. * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::hidePlaceholder): Deleted. (WebCore::HTMLTextFormControlElement::showPlaceholderIfNecessary): Deleted. * html/HTMLTextFormControlElement.h: 2020-04-28 ChangSeok Oh <changseok@webkit.org> [GTK] Fix build failures for ANGLE_WEBGL after r259589 https://bugs.webkit.org/show_bug.cgi?id=211116 Reviewed by Alex Christensen. The compiler is unhappy with coverting GCGLint64 (long long int) to GLInt64 (long int). Passing GCGLuint62 as GLuint64 is a similar issue. No new tests since no new functionalities. * platform/graphics/angle/ExtensionsGLANGLE.cpp: (WebCore::ExtensionsGLANGLE::getInteger64vRobustANGLE): (WebCore::ExtensionsGLANGLE::getInteger64i_vRobustANGLE): (WebCore::ExtensionsGLANGLE::getBufferParameteri64vRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryObjecti64vRobustANGLE): (WebCore::ExtensionsGLANGLE::getQueryObjectui64vRobustANGLE): * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp: (Nicosia::GC3DLayer::swapBuffersIfNeeded): Unaccelerated -> RenderingMode::Unaccelerated 2020-04-28 Noam Rosenthal <noam@webkit.org> Implement FCP (first contentful paint) https://bugs.webkit.org/show_bug.cgi?id=208499 Reviewed by Simon Fraser. Added the necessary interface, extensions to the performance interface and observer, new runtime flag. Detecting contentfulness after layout and before actual paint, by running a "dummy" paint, similar to invalidateControlTints() / invalidateImagesWithAsyncDecodes(). Save the result to the GraphicsContext and then to the document. This would run for every paint until we detect a contentful one. Note that it paints the entire frame contents, as FCP is not viewport-dependent. Also, paint timing is currently disabled for LFC (layout formatting context), and will be dealt with later. Tests: http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-num-chars.html http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-style.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-background-size.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-set.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-two-steps.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-canvas-context.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-gradient.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-3d-rotate-descendant.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-3d-rotate.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale-transition.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-text.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity-descendant.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds-translate.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-display.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-image.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-opacity.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-text.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-visibility.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-svg.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-text-input.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-typographic-pseudo.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-frame.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-poster.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-whitespace.html imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-with-rtl.html performance-api/paint-timing/paint-timing-apis.html performance-api/paint-timing/paint-timing-frames.html performance-api/paint-timing/paint-timing-with-worker.html performance-api/paint-timing/performance-observer-first-contentful-paint.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSPerformanceEntryCustom.cpp: (WebCore::toJSNewlyCreated): * bindings/js/WebCoreBuiltinNames.h: Add PerformancePaintTiming interface. https://w3c.github.io/paint-timing/#sec-PerformancePaintTiming * dom/Document.cpp: * dom/Document.h: (WebCore::Document::supportsPaintTiming const): We only report paint timing for document that can access the top level security origin, to avoid leakage of information to sandboxed iframes. (WebCore::Document::enqueuePaintTimingEntryIfNeeded): Enqueue a paint timing entry, according to https://w3c.github.io/paint-timing/#sec-reporting-paint-timing * page/FrameView.cpp: (WebCore::FrameView::paintContents): Disable FCP fake-paint in LFC mode. * page/Page.cpp: (WebCore::Page::doAfterUpdateRendering): * page/Performance.cpp: (WebCore::Performance::getEntries const): (WebCore::Performance::getEntriesByType const): (WebCore::Performance::getEntriesByName const): (WebCore::Performance::reportFirstContentfulPaint): * page/Performance.h: Support first-contentful-paint reporting. * page/PerformanceEntry.cpp: (WebCore::PerformanceEntry::parseEntryTypeString): * page/PerformanceEntry.h: (WebCore::PerformanceEntry::isPaint const): * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::supportedEntryTypes): * page/PerformanceObserver.h: * page/PerformanceObserver.idl: * page/PerformancePaintTiming.h: Added. (isType): * page/PerformancePaintTiming.idl: Added. Add paint performance entry type. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setPaintTimingEnabled): (WebCore::RuntimeEnabledFeatures::paintTimingEnabled const): New runtime flag for paint timing. * platform/graphics/GraphicsContext.h: (WebCore::GraphicsContext::detectingContentfulPaint const): (WebCore::GraphicsContext::setContentfulPaintDetected): (WebCore::GraphicsContext::contenfulPaintDetected const): Add a flag in GraphicsContext where different render operations can report if they're contentful. * rendering/ContentfulPaintChecker.cpp: Added. (WebCore::ContentfulPaintChecker::qualifiesForContentfulPaint): * rendering/ContentfulPaintChecker.h: Added. Run a "dummy" paint of the FrameView, to detect contentful elements. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintFillLayerExtended): * rendering/RenderHTMLCanvas.cpp: (WebCore::RenderHTMLCanvas::paintReplaced): * rendering/RenderImage.cpp: (WebCore::RenderImage::paintReplaced): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerContents): * rendering/RenderVideo.cpp: (WebCore::RenderVideo::paintReplaced): * rendering/TextPainter.cpp: (WebCore::TextPainter::paintTextOrEmphasisMarks): * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::paintReplaced): Report contentfulness when we reach anything that qualifies as contentful, based on https://w3c.github.io/paint-timing/#contentful. 2020-04-28 Simon Fraser <simon.fraser@apple.com> MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin log with no error https://bugs.webkit.org/show_bug.cgi?id=211145 Reviewed by Jer Noble. Don't log when MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin() returns 0. * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::setNowPlayingInfo): 2020-04-28 Ross Kirsling <ross.kirsling@sony.com> [JSC] Align upon the name isCallable instead of isFunction https://bugs.webkit.org/show_bug.cgi?id=211140 Reviewed by Darin Adler. * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected): * bindings/js/JSCustomElementRegistryCustom.cpp: (WebCore::getCustomElementCallback): * bindings/js/JSDOMConvertCallbacks.h: (WebCore::Converter<IDLCallbackFunction<T>>::convert): * bindings/js/JSDOMConvertScheduledAction.h: (WebCore::Converter<IDLScheduledAction>::convert): * bindings/js/JSDOMPromise.cpp: (WebCore::DOMPromise::whenPromiseIsSettled): * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::queueMicrotask): * bindings/js/JSWorkerGlobalScopeCustom.cpp: (WebCore::JSWorkerGlobalScope::queueMicrotask): * bindings/js/ReadableStream.cpp: (WebCore::ReadableStream::pipeTo): (WebCore::ReadableStream::tee): * bindings/js/ReadableStreamDefaultController.cpp: (WebCore::ReadableStreamDefaultController::invoke): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::callInWorld): * bindings/scripts/CodeGeneratorJS.pm: (GenerateOverloadDispatcher): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript): * testing/Internals.cpp: (WebCore::Internals::parserMetaData): (WebCore::Internals::cloneArrayBuffer): * worklets/PaintWorkletGlobalScope.cpp: (WebCore::PaintWorkletGlobalScope::registerPaint): 2020-04-28 Simon Fraser <simon.fraser@apple.com> Rewrite GraphicsLayerCA::updateSublayerList() https://bugs.webkit.org/show_bug.cgi?id=211137 Reviewed by Zalan Bujtas. This function was hard to understand, with aliasing of a layer list to handle the various configurations. Future patches will add a bit more complexity here. Rewrite using lambdas, which makes it easier to follow. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateSublayerList): 2020-04-28 Christopher Reid <chris.reid@sony.com> [Win] Bundle Inspector Resources in Release builds https://bugs.webkit.org/show_bug.cgi?id=210942 Reviewed by Fujii Hironori. * CMakeLists.txt: 2020-04-28 Rob Buis <rbuis@igalia.com> Remove downloadAttribute from DocumentLoader https://bugs.webkit.org/show_bug.cgi?id=210493 Reviewed by Darin Adler. Remove downloadAttribute from DocumentLoader since this can be obtained from the NavigationAction. * loader/DocumentLoader.h: (WebCore::DocumentLoader::downloadAttribute const): (WebCore::DocumentLoader::setDownloadAttribute): Deleted. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::loadWithNavigationAction): (WebCore::FrameLoader::loadPostRequest): * loader/FrameLoader.h: 2020-04-28 Jack Lee <shihchieh_lee@apple.com> Nullptr crash in EditCommand::EditCommand via CompositeEditCommand::removeNode https://bugs.webkit.org/show_bug.cgi?id=207600 <rdar://problem/56969450> Reviewed by Geoffrey Garen. Move FrameSelection and Editor objects from Frame to Document so when a document is detached in nested command executions, the next EditCommand would not fail in constructor. Test: editing/inserting/insert-list-then-edit-command-crash.html * dom/Document.cpp: (WebCore::m_selection): (WebCore::Document::willBeRemovedFromFrame): (WebCore::m_undoManager): Deleted. (WebCore::Document::prepareForDestruction): Deleted. * dom/Document.h: (WebCore::Document::editor): (WebCore::Document::editor const): (WebCore::Document::selection): (WebCore::Document::selection const): * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::AlternativeTextController): (WebCore::AlternativeTextController::stopPendingCorrection): (WebCore::AlternativeTextController::isSpellingMarkerAllowed const): (WebCore::AlternativeTextController::applyAutocorrectionBeforeTypingIfAppropriate): (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): (WebCore::AlternativeTextController::timerFired): (WebCore::AlternativeTextController::handleAlternativeTextUIResult): (WebCore::AlternativeTextController::rootViewRectForRange const): (WebCore::AlternativeTextController::respondToChangedSelection): (WebCore::AlternativeTextController::respondToAppliedEditing): (WebCore::AlternativeTextController::respondToUnappliedEditing): (WebCore::AlternativeTextController::editorClient): (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult): (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): (WebCore::AlternativeTextController::alternativeTextClient): (WebCore::AlternativeTextController::applyAlternativeTextToRange): (WebCore::AlternativeTextController::insertDictatedText): (WebCore::AlternativeTextController::applyDictationAlternative): * editing/AlternativeTextController.h: (WebCore::AlternativeTextController::UNLESS_ENABLED): * editing/CompositeEditCommand.cpp: (WebCore::EditCommandComposition::unapply): (WebCore::EditCommandComposition::reapply): (WebCore::CompositeEditCommand::willApplyCommand): (WebCore::CompositeEditCommand::didApplyCommand): (WebCore::CompositeEditCommand::targetRanges const): (WebCore::CompositeEditCommand::moveParagraphs): * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::saveTypingStyleState): (WebCore::DeleteSelectionCommand::mergeParagraphs): (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete): (WebCore::DeleteSelectionCommand::doApply): * editing/EditCommand.cpp: (WebCore::EditCommand::EditCommand): (WebCore::EditCommand::isEditingTextAreaOrTextInput const): (WebCore::EditCommand::postTextStateChangeNotification): (WebCore::EditCommand::frame): Deleted. (WebCore::EditCommand::frame const): Deleted. * editing/EditCommand.h: * editing/Editing.cpp: (WebCore::createDefaultParagraphElement): * editing/EditingStyle.cpp: (WebCore::StyleChange::StyleChange): * editing/Editor.cpp: (WebCore::ClearTextCommand::CreateAndApply): (WebCore::TemporarySelectionChange::TemporarySelectionChange): (WebCore::TemporarySelectionChange::~TemporarySelectionChange): (WebCore::TemporarySelectionChange::setSelection): (WebCore::Editor::selectionForCommand): (WebCore::Editor::behavior const): (WebCore::Editor::client const): (WebCore::Editor::canEdit const): (WebCore::Editor::canEditRichly const): (WebCore::Editor::canDHTMLCut): (WebCore::Editor::canDHTMLCopy): (WebCore::Editor::canCopy const): (WebCore::Editor::canPaste const): (WebCore::Editor::canDelete const): (WebCore::Editor::shouldSmartDelete): (WebCore::Editor::deleteWithDirection): (WebCore::Editor::deleteSelectionWithSmartDelete): (WebCore::Editor::clearText): (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::selectedRange): (WebCore::Editor::tryDHTMLCopy): (WebCore::Editor::tryDHTMLCut): (WebCore::Editor::shouldInsertText const): (WebCore::Editor::hasBidiSelection const): (WebCore::Editor::selectionUnorderedListState const): (WebCore::Editor::selectionOrderedListState const): (WebCore::Editor::increaseSelectionListLevel): (WebCore::Editor::increaseSelectionListLevelOrdered): (WebCore::Editor::increaseSelectionListLevelUnordered): (WebCore::Editor::decreaseSelectionListLevel): (WebCore::Editor::findEventTargetFromSelection const): (WebCore::Editor::applyStyle): (WebCore::Editor::applyParagraphStyle): (WebCore::Editor::applyStyleToSelection): (WebCore::Editor::applyParagraphStyleToSelection): (WebCore::Editor::selectionStartHasStyle const): (WebCore::Editor::selectionHasStyle const): (WebCore::Editor::selectionStartCSSPropertyValue): (WebCore::Editor::appliedEditing): (WebCore::Editor::Editor): (WebCore::Editor::clear): (WebCore::Editor::insertText): (WebCore::Editor::insertTextForConfirmedComposition): (WebCore::Editor::insertTextWithoutSendingTextEvent): (WebCore::Editor::insertLineBreak): (WebCore::Editor::insertParagraphSeparator): (WebCore::Editor::performCutOrCopy): (WebCore::Editor::paste): (WebCore::Editor::pasteAsQuotation): (WebCore::Editor::renderLayerDidScroll): (WebCore::Editor::setBaseWritingDirection): (WebCore::Editor::baseWritingDirectionForSelectionStart const): (WebCore::Editor::selectComposition): (WebCore::SetCompositionScope::SetCompositionScope): (WebCore::SetCompositionScope::~SetCompositionScope): (WebCore::Editor::setComposition): (WebCore::Editor::ignoreSpelling): (WebCore::Editor::learnSpelling): (WebCore::Editor::advanceToNextMisspelling): (WebCore::Editor::misspelledWordAtCaretOrRange const): (WebCore::Editor::isSelectionUngrammatical): (WebCore::Editor::guessesForMisspelledWord const): (WebCore::Editor::guessesForMisspelledOrUngrammatical): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::isSpellCheckingEnabledInFocusedNode const): (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): (WebCore::Editor::markAndReplaceFor): (WebCore::Editor::updateMarkersForWordsAffectedByEditing): (WebCore::Editor::rangeForPoint): (WebCore::Editor::revealSelectionAfterEditingOperation): (WebCore::Editor::setIgnoreSelectionChanges): (WebCore::Editor::getCompositionSelection const): (WebCore::Editor::transpose): (WebCore::Editor::changeSelectionAfterCommand): (WebCore::Editor::selectedText const): (WebCore::Editor::selectedTextForDataTransfer const): (WebCore::Editor::insertTextPlaceholder): (WebCore::Editor::removeTextPlaceholder): (WebCore::Editor::shouldChangeSelection const): (WebCore::Editor::computeAndSetTypingStyle): (WebCore::Editor::findString): (WebCore::Editor::countMatchesForText): (WebCore::Editor::respondToChangedSelection): (WebCore::Editor::shouldDetectTelephoneNumbers const): (WebCore::Editor::scanSelectionForTelephoneNumbers): (WebCore::Editor::editorUIUpdateTimerFired): (WebCore::Editor::selectionStartHasMarkerFor const): (WebCore::Editor::stringForCandidateRequest const): (WebCore::Editor::contextRangeForCandidateRequest const): (WebCore::Editor::fontAttributesAtSelectionStart const): (WebCore::Editor::notifyClientOfAttachmentUpdates): (WebCore::Editor::handleAcceptedCandidate): (WebCore::Editor::unifiedTextCheckerEnabled const): (WebCore::Editor::toggleOverwriteModeEnabled): (WebCore::Editor::fontForSelection const): (WebCore::Editor::canCopyExcludingStandaloneImages const): (WebCore::Editor::document const): Deleted. * editing/Editor.h: (WebCore::TemporarySelectionChange::TemporarySelectionChange): (WebCore::IgnoreSelectionChangeForScope::IgnoreSelectionChangeForScope): (WebCore::Editor::document const): * editing/EditorCommand.cpp: (WebCore::executeSwapWithMark): (WebCore::Editor::command): (WebCore::Editor::Command::Command): (WebCore::Editor::Command::execute const): * editing/FrameSelection.cpp: (WebCore::shouldAlwaysUseDirectionalSelection): (WebCore::FrameSelection::FrameSelection): (WebCore::FrameSelection::rootEditableElementOrDocumentElement const): (WebCore::FrameSelection::setSelectionByMouseIfDifferent): (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance): (WebCore::FrameSelection::setSelection): (WebCore::updateSelectionByUpdatingLayoutOrStyle): (WebCore::FrameSelection::setNeedsSelectionUpdate): (WebCore::FrameSelection::updateAndRevealSelection): (WebCore::FrameSelection::updateDataDetectorsForSelection): (WebCore::FrameSelection::positionForPlatform const): (WebCore::FrameSelection::nextWordPositionForPlatform): (WebCore::FrameSelection::modifyMovingRight): (WebCore::FrameSelection::modifyMovingLeft): (WebCore::FrameSelection::modify): (WebCore::FrameSelection::willBeRemovedFromFrame): (WebCore::FrameSelection::absoluteCaretBounds): (WebCore::FrameSelection::recomputeCaretRect): (WebCore::FrameSelection::contains const): (WebCore::FrameSelection::selectAll): (WebCore::FrameSelection::focusedOrActiveStateChanged): (WebCore::FrameSelection::isFocusedAndActive const): (WebCore::shouldStopBlinkingDueToTypingCommand): (WebCore::FrameSelection::updateAppearance): (WebCore::FrameSelection::setCaretVisibility): (WebCore::FrameSelection::setFocusedElementIfNeeded): (WebCore::FrameSelection::shouldDeleteSelection const): (WebCore::FrameSelection::selectionBounds const): (WebCore::FrameSelection::getClippedVisibleTextRectangles const): (WebCore::FrameSelection::currentForm const): (WebCore::FrameSelection::revealSelection): (WebCore::FrameSelection::setSelectionFromNone): (WebCore::FrameSelection::shouldChangeSelection const): (WebCore::FrameSelection::setShouldShowBlockCursor): (WebCore::FrameSelection::appearanceUpdateTimerFired): (WebCore::FrameSelection::updateAppearanceAfterLayoutOrStyleChange): (WebCore::FrameSelection::selectRangeOnElement): (WebCore::FrameSelection::setCaretBlinks): (WebCore::FrameSelection::prepareForDestruction): Deleted. * editing/FrameSelection.h: * editing/InsertIntoTextNodeCommand.cpp: (WebCore::InsertIntoTextNodeCommand::doApply): * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply): * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::doApply): * editing/ReplaceRangeWithTextCommand.cpp: (WebCore::ReplaceRangeWithTextCommand::doApply): * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply): * editing/SetSelectionCommand.cpp: (WebCore::SetSelectionCommand::doApply): (WebCore::SetSelectionCommand::doUnapply): * editing/SpellChecker.cpp: (WebCore::SpellChecker::SpellChecker): (WebCore::SpellChecker::client const): (WebCore::SpellChecker::isAsynchronousEnabled const): (WebCore::SpellChecker::invokeRequest): (WebCore::SpellChecker::didCheck): (WebCore::SpellChecker::didCheckSucceed): * editing/SpellChecker.h: * editing/SpellingCorrectionCommand.cpp: (WebCore::SpellingCorrectionCommand::doApply): * editing/TypingCommand.cpp: (WebCore::TypingCommand::deleteSelection): (WebCore::TypingCommand::deleteKeyPressed): (WebCore::TypingCommand::forwardDeleteKeyPressed): (WebCore::TypingCommand::updateSelectionIfDifferentFromCurrentSelection): (WebCore::TypingCommand::insertText): (WebCore::TypingCommand::insertLineBreak): (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent): (WebCore::TypingCommand::insertParagraphSeparator): (WebCore::TypingCommand::lastTypingCommandIfStillOpenForTyping): (WebCore::TypingCommand::closeTyping): (WebCore::TypingCommand::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping): (WebCore::TypingCommand::markMisspellingsAfterTyping): (WebCore::TypingCommand::willAddTypingToOpenCommand): (WebCore::TypingCommand::typingAddedToOpenCommand): (WebCore::TypingCommand::insertTextAndNotifyAccessibility): (WebCore::TypingCommand::insertTextRunWithoutNewlines): (WebCore::TypingCommand::insertLineBreakAndNotifyAccessibility): (WebCore::TypingCommand::insertParagraphSeparatorAndNotifyAccessibility): (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContentAndNotifyAccessibility): * editing/TypingCommand.h: * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::selectionInHTMLFormat): (WebCore::selectionAsAttributedString): (WebCore::Editor::writeSelectionToPasteboard): (WebCore::Editor::writeSelection): (WebCore::Editor::selectionInWebArchiveFormat): (WebCore::Editor::replaceSelectionWithAttributedString): (WebCore::Editor::webContentFromPasteboard): (WebCore::Editor::takeFindStringFromSelection): * editing/gtk/EditorGtk.cpp: (WebCore::Editor::pasteWithPasteboard): (WebCore::Editor::writeSelectionToPasteboard): (WebCore::Editor::webContentFromPasteboard): * editing/ios/EditorIOS.mm: (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection): (WebCore::Editor::removeUnchangeableStyles): (WebCore::Editor::pasteWithPasteboard): (WebCore::Editor::insertDictationPhrases): (WebCore::Editor::setDictationPhrasesAsChildOfElement): (WebCore::Editor::setTextAsChildOfElement): (WebCore::Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping): * editing/libwpe/EditorLibWPE.cpp: (WebCore::Editor::writeSelectionToPasteboard): (WebCore::Editor::pasteWithPasteboard): * editing/mac/EditorMac.mm: (WebCore::Editor::readSelectionFromPasteboard): (WebCore::Editor::replaceNodeFromPasteboard): (WebCore::Editor::selectionWillChange): * editing/win/EditorWin.cpp: (WebCore::Editor::pasteWithPasteboard): (WebCore::Editor::webContentFromPasteboard): * history/CachedFrame.cpp: (WebCore::CachedFrame::destroy): * loader/FrameLoader.cpp: (WebCore::FrameLoader::willTransitionToCommitted): (WebCore::FrameLoader::closeURL): (WebCore::FrameLoader::didOpenURL): (WebCore::FrameLoader::clear): * page/Frame.cpp: (WebCore::Frame::Frame): (WebCore::Frame::setView): (WebCore::Frame::setDocument): (WebCore::Frame::requestDOMPasteAccess): (WebCore::Frame::setPageAndTextZoomFactors): * page/Frame.h: * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): 2020-04-28 Antti Koivisto <antti@apple.com> msn.com: Header flickers when scrolling articles https://bugs.webkit.org/show_bug.cgi?id=211126 <rdar://problem/56439177> Reviewed by Simon Fraser. Test: compositing/fixed-with-clip-stability.html In case of fixed positioned elements the decision to create backing depends on clip rect. However RenderLayer::localClipRect() tests for backing in call to clippingRootForPainting(). This creates instability since clipping depends on backing decision, and backing decision depends on clipping. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::localClipRect const): Specifically the result of clipExceedsBounds test here is affected by computed offsetFromRoot: "clipRect.contains(cssClipRect)" test fails for zero sized clips with different offsets. Compute clipExceedsBounds by looking at the clip sizes only and ignoring the position (which should match). 2020-04-28 Zalan Bujtas <zalan@apple.com> [LFC] Introduce FormattingContext::ConstraintsForOutOfFlowContent https://bugs.webkit.org/show_bug.cgi?id=211125 Reviewed by Antti Koivisto. Horizontal and vertical out-of-flow constraints are always computed and used in pairs. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::constraintsForOutOfFlowContent): (WebCore::Layout::FormattingContext::Geometry::horizontalConstraintsForOutOfFlow): Deleted. (WebCore::Layout::FormattingContext::Geometry::verticalConstraintsForOutOfFlow): Deleted. * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/LayoutUnits.h: * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutInFlowContent): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): 2020-04-28 Zalan Bujtas <zalan@apple.com> [LFC] Introduce FormattingContext::ConstraintsForInFlowContent https://bugs.webkit.org/show_bug.cgi?id=211113 Reviewed by Antti Koivisto. This makes the layoutInFlowContent() related code look simpler. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowContent): * layout/FormattingContext.h: * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutInFlowContent): * layout/blockformatting/BlockFormattingContext.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): (WebCore::Layout::InlineFormattingContext::lineLayout): * layout/inlineformatting/InlineFormattingContext.h: * layout/integration/LayoutIntegrationLineLayout.cpp: (WebCore::LayoutIntegration::LineLayout::layout): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutInFlowContent): (WebCore::Layout::TableFormattingContext::layoutCell): * layout/tableformatting/TableFormattingContext.h: 2020-04-28 Philippe Normand <pnormand@igalia.com> media/track/track-load-error-readyState.html passes only when accompanied by some other tests https://bugs.webkit.org/show_bug.cgi?id=210976 Reviewed by Xabier Rodriguez-Calvar. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Reset caption display mode, which might have been overriden by a previous test. 2020-04-28 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes late April 2020 edition https://bugs.webkit.org/show_bug.cgi?id=211099 Unreviewed build fix. No new tests needed. * Modules/cache/DOMCacheStorage.cpp: Sprinkle DOMCacheEngine:: namespace prefixes as needed. (WebCore::DOMCacheStorage::findCacheOrCreate): (WebCore::DOMCacheStorage::retrieveCaches): (WebCore::DOMCacheStorage::doOpen): (WebCore::DOMCacheStorage::doRemove): * bindings/js/JSExecStateInstrumentation.h: Ditto for JSC:: namespace prefixes. (WebCore::JSExecState::instrumentFunction): * dom/ScriptedAnimationController.h: Add missing ReducedResolutionSeconds.h header. * editing/TextCheckingHelper.h: Add missing forward declaration for Position. * html/URLSearchParams.h: Add missing ExceptionOr.h header. 2020-04-28 Charlie Turner <cturner@igalia.com> [EME][CDMProxy] Default initialize m_numDecryptorsWaitingForKey member https://bugs.webkit.org/show_bug.cgi?id=210970 Reviewed by Xabier Rodriguez-Calvar. This was causing non-deterministic reads of the m_numDecryptorsWaitingForKey member. Sometimes a waiting for key event would fail to fire and cause test failures. I thought std::atomic<int> would default initialize to zero, but after spec-diving I realise now I was wrong about that. Test: encrypted-media/clearkey-mp4-waiting-for-a-key.https.html * platform/encryptedmedia/CDMProxy.h: 2020-04-28 Youenn Fablet <youenn@apple.com> RTCPeerConnection should not remove its created remote MediaStream objects until getting close https://bugs.webkit.org/show_bug.cgi?id=211070 Reviewed by Alex Christensen. Remove no longer needed code. This aligns with the spec and Firefox implementation. Test: webrtc/direction-change.html * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::transceiverBackendFromSender): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: 2020-04-28 Youenn Fablet <youenn@apple.com> Ensure remote track event gets unmuted after the track event is fired https://bugs.webkit.org/show_bug.cgi?id=211071 Reviewed by Alex Christensen. This code was made obsolete by the setMuted(false) call done just after firing the track event. Given the setMuted(false) in addPendingTrackEvent was done asynchronously and was triggering firing the muted event asynchronously, this change should not be observable from JS. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::addPendingTrackEvent): 2020-04-28 Rob Buis <rbuis@igalia.com> Make HistoryController an inner class of FrameLoader https://bugs.webkit.org/show_bug.cgi?id=211090 Reviewed by Darin Adler. Make HistoryController an inner class of FrameLoader, this allows us to move some methods only used by HistoryController out of the FrameLoader public API. * loader/FrameLoader.h: * loader/HistoryController.cpp: * loader/HistoryController.h: 2020-04-27 Simon Fraser <simon.fraser@apple.com> Do correct clipping of composited replaced elements with border-radius https://bugs.webkit.org/show_bug.cgi?id=211114 Reviewed by Zalan Bujtas. For replaced elements with composited content (video, WebGL), RenderLayerBacking incorrectly used the rounded inner border rect to clip the contents. This doesn't match painted replaced elements, which clip to the inside of the padding box. Fix by implementing RenderReplaced::roundedContentBoxRect() and calling it from compositing code. Also add a helper to get the rounded border box rect, and call it in various places. Test: compositing/clipping/border-radius-on-webgl.html * rendering/RenderBox.cpp: (WebCore::RenderBox::roundedBorderBoxRect const): * rendering/RenderBox.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry): (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::updateGeometry): (WebCore::RenderLayerBacking::updateContentsRects): (WebCore::RenderLayerBacking::resetContentsRect): (WebCore::RenderLayerBacking::updateChildClippingStrategy): (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage): (WebCore::RenderLayerBacking::updateImageContents): (WebCore::backgroundRectForBox): * rendering/RenderLayerBacking.h: * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::roundedContentBoxRect const): * rendering/RenderReplaced.h: 2020-04-27 Said Abou-Hallawa <sabouhallawa@apple.com> Timestamps should be the same for all rendering update steps https://bugs.webkit.org/show_bug.cgi?id=207153 Reviewed by Simon Fraser. The HTML 5 event loop sepcs states that timestamps should be the same for all rendering update steps. Specs link (step 9): https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model This patch also fixes some issues in IntersectionObserver. Test: intersection-observer/intersection-observer-callback-timestamp.html * dom/Document.cpp: (WebCore::Document::updateIntersectionObservations): (WebCore::Document::notifyIntersectionObserversTimerFired): Deleted. * dom/Document.h: -- Handle the case when two floats are areEssentiallyEqual(). -- Execute the IntersectionObserver immediately and do not wait until the next CFRunLoop event since this does not implement the specs. * page/DOMWindow.cpp: (WebCore::DOMWindow::freezeNowTimestamp): (WebCore::DOMWindow::unfreezeNowTimestamp): (WebCore::DOMWindow::frozenNowTimestamp const): * page/DOMWindow.h: Provide a frozen now() timestamp in seconds to be used internally only. * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::nowTimestamp const): Use the frozenNowTimestamp(). * page/Page.cpp: (WebCore::Page::updateRendering): Freeze the timestamps while serving the rendering update steps. 2020-04-27 Dean Jackson <dino@apple.com> getShaderPrecisionFormat returns the wrong values https://bugs.webkit.org/show_bug.cgi?id=211013 <rdar://problem/62378056> Reviewed by Darin Adler. Gregg pointed out that our code hardcodes values for getShaderPrecisionFormat. The fix is simply to call into the underlying GL function. Covered by the existing test: webgl/1.0.3/conformance/misc/shader-precision-format.html However, that just tests minimum values. Devices have different actual results. * platform/graphics/angle/GraphicsContextGLANGLE.cpp: (WebCore::GraphicsContextGLOpenGL::getShaderPrecisionFormat): 2020-04-27 Simon Fraser <simon.fraser@apple.com> Rename scrollableAreaForScrollLayerID to scrollableAreaForScrollingNodeID https://bugs.webkit.org/show_bug.cgi?id=211091 Reviewed by Myles C. Maxfield. The argument to scrollableAreaForScrollLayerID() is a ScrollingNodeID, not a layerID. * page/FrameView.cpp: (WebCore::FrameView::scrollableAreaForScrollingNodeID const): (WebCore::FrameView::scrollableAreaForScrollLayerID const): Deleted. * page/FrameView.h: * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): (WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::scrollableAreaForScrollingNodeID const): (WebCore::RenderLayerCompositor::scrollableAreaForScrollLayerID const): Deleted. * rendering/RenderLayerCompositor.h: 2020-04-27 Ryan Haddad <ryanhaddad@apple.com> [Cocoa] stop using out arguments for document attributes when converting to attributed strings https://bugs.webkit.org/show_bug.cgi?id=211048 Unreviewed partial revert of r260739 to remove unexpected logging that broke Catalina-Release-WK2-Perf tests. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::policyProperties): * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::siteForCookies): 2020-04-27 Wenson Hsieh <wenson_hsieh@apple.com> Text manipulation should not aggregate text from different navigation anchor elements https://bugs.webkit.org/show_bug.cgi?id=211081 <rdar://problem/59553658> Reviewed by Megan Gardner. Tweak the item boundary heuristic in `TextManipulationController::observeParagraphs` to separate text in links and list items under navigation elements (either nav elements, or elements with the "navigation" accessibility role) into separate paragraphs. Also, extend the item boundary rule for button elements to apply to elements with the "button" accessibility role as well. Test: TextManipulation.StartTextManipulationTreatsInlineBlockLinksAndButtonsAsParagraphs TextManipulation.StartTextManipulationTreatsLinksInNavigationElementsAsParagraphs * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::observeParagraphs): 2020-04-27 Antoine Quint <graouts@apple.com> Clean up some useless includes of CSSAnimationController.h https://bugs.webkit.org/show_bug.cgi?id=211066 Reviewed by Antti Koivisto. These files don't actually use any of the CSSAnimationController APIs. * page/ios/FrameIOS.mm: * rendering/RenderObject.cpp: 2020-04-27 Antoine Quint <graouts@apple.com> Rename CSSAnimationController accessors from animation() to legacyAnimation() https://bugs.webkit.org/show_bug.cgi?id=211082 Reviewed by Simon Fraser. * css/CSSComputedStyleDeclaration.cpp: (WebCore::computeRenderStyleForProperty): * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::Document::didBecomeCurrentDocumentInFrame): (WebCore::Document::prepareForDestruction): (WebCore::Document::implicitClose): (WebCore::Document::resume): * dom/Element.cpp: (WebCore::Element::removedFromAncestor): * dom/PseudoElement.cpp: (WebCore::PseudoElement::clearHostElement): * history/CachedFrame.cpp: (WebCore::CachedFrame::destroy): * page/Frame.cpp: (WebCore::Frame::clearTimers): (WebCore::Frame::resumeActiveDOMObjectsAndAnimations): * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::didDestroyRenderTree): (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layout): * page/Page.cpp: (WebCore::Page::handleLowModePowerChange): (WebCore::Page::setIsVisibleInternal): (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged): * page/animation/CSSAnimationController.cpp: (WebCore::CSSAnimationControllerPrivate::updateThrottlingState): (WebCore::CSSAnimationControllerPrivate::suspendAnimations): (WebCore::CSSAnimationControllerPrivate::resumeAnimations): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::currentTransform const): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): (WebCore::RenderLayerBacking::notifyAnimationStarted): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::flushPendingLayerChanges): (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): (WebCore::RenderLayerCompositor::isRunningTransformAnimation const): * rendering/RenderObject.h: (WebCore::RenderObject::legacyAnimation const): (WebCore::RenderObject::animation const): Deleted. * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::tearDownRenderers): * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): * testing/Internals.cpp: (WebCore::Internals::numberOfActiveAnimations const): (WebCore::Internals::animationsAreSuspended const): (WebCore::Internals::animationsInterval const): (WebCore::Internals::suspendAnimations const): (WebCore::Internals::resumeAnimations const): (WebCore::Internals::pauseAnimationAtTimeOnElement): (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): (WebCore::Internals::pauseTransitionAtTimeOnElement): (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): 2020-04-27 Per Arne Vollan <pvollan@apple.com> [Cocoa] After r258891, r255119 can be reverted https://bugs.webkit.org/show_bug.cgi?id=211083 <rdar://problem/60714318> Unreviewed revert of r255119. Copying a MIME type map from the UI process to the WebContent process on startup is not needed anymore, since r258891 will map the Launch Services database in the WebContent process. * platform/MIMETypeRegistry.cpp: (WebCore::commonMimeTypesMap): (WebCore::typesForCommonExtension): (WebCore::overriddenMimeTypesMap): Deleted. * platform/MIMETypeRegistry.h: * testing/Internals.cpp: (WebCore::Internals::mediaMIMETypeForExtension): Deleted. * testing/Internals.h: * testing/Internals.idl: 2020-04-27 Darin Adler <darin@apple.com> Improve performance of commonInclusiveAncestor for deeply nested nodes https://bugs.webkit.org/show_bug.cgi?id=211078 Reviewed by Antti Koivisto. * dom/Node.cpp: (WebCore::depth): Added. (WebCore::commonInclusiveAncestor): Replaced implementation that walks the parent chain of the second node repeatedly with one that walks the parent chain of each node twice. 2020-04-27 Daniel Bates <dabates@apple.com> Caret may be placed in the wrong spot for text input context that is a form control https://bugs.webkit.org/show_bug.cgi?id=210939 <rdar://problem/61943089> Reviewed by Darin Adler. Add a helper function that returns the closest editable position inside an element for a given point (if any). * editing/Editing.cpp: (WebCore::closestEditablePositionInElementForAbsolutePoint): Added. * editing/Editing.h: 2020-04-27 Alicia Boya García <aboya@igalia.com> [GStreamer] Rework WebKitWebSrc threading https://bugs.webkit.org/show_bug.cgi?id=210284 Reviewed by Xabier Rodriguez-Calvar. WebKitWebSrc as it is in master has a number of race conditions leading to occasional starvation (due to cancelling the wrong request) or data corruption (due to pushing data from a cancelled request). The threading situation wasn't easy to follow, as it wasn't clear access to what members should be protected by what mutex, in what circumstances. Also, some parts of the design were also introducing addicional complexity, such as the first request being sent from the main thread whereas the rest were being sent from the streaming thread or basesrc async start. In response, this patch reworks all the locking in WebKitWebSrc to use WTF::DataMutex. This ensures all accesses to its (now explicit) protected members are locked. The two mutexes and condition variables have been simplified into one, as there was no obvious need or benefit for two of each in this case. Requests have been numbered, which allows to safely and atomically ignore results from cancelled requests, avoiding data corruption races, and makes following them in debug logs much easier. The conditions for making and cancelling requests have been simplified to a simpler and safer model: There is at most only one active request at anytime, flushes cancel the request, and the first create() call always makes the new request (both at startup and after a flush). Debug asserts and notes about the flow of operations during basesrc seeks have been provided. As this effort needed a review of the entire WebKitWebSrc, cleanups, corrections and documentation comments have been provided where appropriate. This patch introduces no visible behavior changes, just stability improvements. * platform/graphics/gstreamer/GRefPtrGStreamer.h: * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (WebKitWebSrcPrivate::~WebKitWebSrcPrivate): (webkit_web_src_class_init): (webkitWebSrcReset): (webKitWebSrcConstructed): (webKitWebSrcSetProperty): (webKitWebSrcGetProperty): (webKitWebSrcSetContext): (webKitWebSrcSendEvent): (restartLoaderIfNeeded): (stopLoaderIfNeeded): (webKitWebSrcCreate): (webKitWebSrcStart): (webKitWebSrcMakeRequest): (webKitWebSrcStop): (webKitWebSrcGetSize): (webKitWebSrcIsSeekable): (webKitWebSrcDoSeek): (webKitWebSrcQuery): (webKitWebSrcUnLock): (webKitWebSrcUnLockStop): (webKitWebSrcSetUri): (webKitWebSrcSetMediaPlayer): (webKitSrcPassedCORSAccessCheck): (CachedResourceStreamingClient::CachedResourceStreamingClient): (CachedResourceStreamingClient::checkUpdateBlocksize): (CachedResourceStreamingClient::responseReceived): (CachedResourceStreamingClient::dataReceived): (CachedResourceStreamingClient::accessControlCheckFailed): (CachedResourceStreamingClient::loadFailed): (CachedResourceStreamingClient::loadFinished): (webKitSrcWouldTaintOrigin): * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: 2020-04-26 Darin Adler <darin@apple.com> Replace more uses of live ranges with SimpleRange https://bugs.webkit.org/show_bug.cgi?id=211058 Reviewed by Antti Koivisto. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::textUnderElement const): Use SimpleRange. * dom/BoundaryPoint.h: Moved makeBoundaryPointAfterNodeContents here so it can be used more places. * dom/Node.cpp: (WebCore::commonInclusiveAncestor): Moved the commonAncestorContainer function here from Range, decided to use the "inclusive ancestor" naming from the DOM specification, and used RefPtr for the result since it's part of our modern safer design to always use smart pointers for return values. * dom/Node.h: Added commonInclusiveAncestor. * dom/Position.cpp: (WebCore::commonShadowIncludingAncestor): Call commonInclusiveAncestor. * dom/Range.cpp: (WebCore::Range::commonAncestorContainer): Deleted. (WebCore::Range::isPointInRange): Call commonInclusiveAncestor. (WebCore::Range::comparePoint const): Ditto. (WebCore::Range::compareBoundaryPoints): Ditto. (WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines const): Ditto. * dom/Range.h: (WebCore::Range::commonAncestorContainer const): Call commonInclusiveAncestor. * dom/SimpleRange.cpp: (WebCore::makeBoundaryPointAfterNodeContents): Moved to BoundaryPoint.h. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Use SimpleRange instead of live range. (WebCore::AlternativeTextController::respondToUnappliedEditing): Ditto. (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): Ditto. (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult): Ditto. * editing/ChangeListTypeCommand.cpp: (WebCore::listConversionTypeForSelection): use commonInclusiveAncestor. * editing/Editing.cpp: (WebCore::isNodeVisiblyContainedWithin): Take a SimpleRange argument. * editing/Editing.h: Updated for the above. * editing/Editor.cpp: (WebCore::Editor::addRangeToKillRing): Take a SimpleRange argument. (WebCore::Editor::shouldDetectTelephoneNumbers const): Made this const and tweaked coding style a bit. (WebCore::scanForTelephoneNumbers): Moved this, made it a non-member function, renamed from scanRangeForTelephoneNumbers, use SimpleRange. (WebCore::extendSelection): Added. Factored out some logic from the function below. (WebCore::Editor::scanSelectionForTelephoneNumbers): Use SimpleRange. Removed some unnecessary code that subtracts 1 and then adds 1 again. * editing/Editor.h: Updated for the above. * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::replace): Use commonInclusiveAncestor. * editing/VisibleSelection.cpp: (WebCore::makeSearchRange): Return a SimpleRange. (WebCore::VisibleSelection::appendTrailingWhitespace): Use SimpleRange. * editing/WebContentReader.h: Use SimpleRange instead of a live range. * editing/cocoa/DataDetection.h: Use a struct, DetectedItem, for the return value from the detection functions. Also changed DataDetectorTypes to an enum class so it can be forward-declared instead of having to include this header. * editing/cocoa/DataDetection.mm: (WebCore::detectItem): Renamed from detectItemAtPositionWithRange. Return the DetectedItem struct, with a SimpleRange rather than an out argument live range. (WebCore::DataDetection::detectItemAroundHitTestResult): Ditto. (WebCore::contains): Added a helper function for testing bits in the DataDetectorType enum. Later we can make this better using OptionSet. (WebCore::constructURLStringForResult): Refactored a bit, updated for the new DataDetectorTypes enum class, and to use CFEqual instead of CFStringCompare. (WebCore::DataDetection::detectContentInRange): Ditto. * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::webContentFromPasteboard): Use SimpleRange. * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::WebContentReader::readPlainText): Updated since context is SimpleRange. * editing/gtk/EditorGtk.cpp: (WebCore::createFragmentFromPasteboardData): Use SimpleRange. (WebCore::Editor::webContentFromPasteboard): Use SimpleRange. * editing/win/EditorWin.cpp: (WebCore::Editor::webContentFromPasteboard): Use SimpleRange. * editing/mac/EditorMac.mm: (WebCore::Editor::replaceNodeFromPasteboard): Use SimpleRange. * loader/FrameLoader.cpp: (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Use SimpleRange. * page/EventHandler.cpp: (WebCore::targetNodeForClickEvent): Use commonInclusiveAncestor. Also updated to return a RefPtr. (WebCore::EventHandler::handleMouseReleaseEvent): Updated for the above. * page/Settings.yaml: Changed the default for DataDetectorTypes to be the empty string rather than a named constant. * page/SettingsBase.h: Forward-declare DataDetectorTypes instead of including the DataDetection.h header. * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): Take a SimpleRange. (WebCore::TextIndicator::createWithSelectionInFrame): Ditto. (WebCore::hasNonInlineOrReplacedElements): Ditto. (WebCore::selectionRects): Ditto. Also renamed from getSelectionRectsForRange. (WebCore::styleContainsComplexBackground): Tweaked implementation. (WebCore::estimatedTextColorsForRange): Take a SimpleRange. (WebCore::absoluteBoundingRectForRange): Ditto. (WebCore::estimatedBackgroundColorForRange): Ditto. (WebCore::containsOnlyWhiteSpaceText): Ditto. (WebCore::initializeIndicator): Ditto. * page/TextIndicator.h: Updated for the above. * page/mac/ServicesOverlayController.h: Use SimpleRange instead of a live range for highlights. * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::createForSelection): Take SimpleRange. (WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber): Ditto. (WebCore::ServicesOverlayController::Highlight::Highlight): Ditto. (WebCore::ServicesOverlayController::buildPhoneNumberHighlights): Ditto. (WebCore::ServicesOverlayController::buildSelectionHighlight): Ditto. (WebCore::ServicesOverlayController::telephoneNumberRangesForFocusedFrame): Ditto. (WebCore::ServicesOverlayController::highlightsAreEquivalent): Ditto. (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): Ditto. (WebCore::ServicesOverlayController::handleClick): Ditto. * platform/ios/DragImageIOS.mm: (WebCore::createDragImageForLink): Use SimpleRange. (WebCore::createDragImageForSelection): Tweaked a bit. 2020-04-27 Carlos Garcia Campos <cgarcia@igalia.com> [GTK4] Make it possible to build with GTK4 without errors https://bugs.webkit.org/show_bug.cgi?id=210967 Reviewed by Adrian Perez de Castro. * platform/PlatformPasteboard.h: * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor): * platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp: * platform/graphics/gtk/DisplayRefreshMonitorGtk.h: * platform/graphics/gtk/GdkCairoUtilities.cpp: (WebCore::getDefaultCairoFontOptions): * platform/gtk/CursorGtk.cpp: (WebCore::createCustomCursor): * platform/gtk/DragImageGtk.cpp: (WebCore::dissolveDragImageToFraction): * platform/gtk/GRefPtrGtk.cpp: * platform/gtk/GRefPtrGtk.h: * platform/gtk/GUniquePtrGtk.h: * platform/gtk/GtkVersioning.h: (gdk_event_copy): (gtk_widget_size_allocate): (gtk_widget_queue_resize_no_redraw): (gdk_event_get_state): (gdk_event_get_coords): (gdk_event_get_root_coords): (gdk_event_is_scroll_stop_event): (gdk_event_get_scroll_direction): (gdk_event_get_scroll_deltas): (gdk_event_get_button): * platform/gtk/PasteboardHelper.cpp: * platform/gtk/PasteboardHelper.h: * platform/gtk/PlatformKeyboardEventGtk.cpp: (WebCore::PlatformKeyboardEvent::modifiersContainCapsLock): * platform/gtk/PlatformPasteboardGtk.cpp: (WebCore::PlatformPasteboard::PlatformPasteboard): (WebCore::PlatformPasteboard::writeToClipboard): (WebCore::PlatformPasteboard::readFromClipboard): * platform/gtk/PlatformScreenGtk.cpp: (WebCore::getCurrentScreenMonitor): 2020-04-27 Rob Buis <rbuis@igalia.com> Make loadURLIntoChildFrame private and non-exported https://bugs.webkit.org/show_bug.cgi?id=211051 Reviewed by Darin Adler. Make loadURLIntoChildFrame private and non-exported to reduce the amount of public API functions that start loads. In order to do this loadURLIntoChildFrame is being called from SubframeLoader and SubframeLoader is made an inner class of FrameLoader. Because this simplifies createFrame (and makes createFrame behave strictly like its name) url and referrer do not have to be passed. * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::parametersForPlugin): * loader/EmptyClients.cpp: (WebCore::EmptyFrameLoaderClient::createFrame): * loader/EmptyFrameLoaderClient.h: * loader/FrameLoader.h: * loader/FrameLoaderClient.h: * loader/SubframeLoader.cpp: (WebCore::FrameLoader::SubframeLoader::SubframeLoader): (WebCore::FrameLoader::SubframeLoader::clear): (WebCore::FrameLoader::SubframeLoader::requestFrame): (WebCore::FrameLoader::SubframeLoader::resourceWillUsePlugin): (WebCore::FrameLoader::SubframeLoader::pluginIsLoadable): (WebCore::FrameLoader::SubframeLoader::requestPlugin): (WebCore::FrameLoader::SubframeLoader::requestObject): (WebCore::FrameLoader::SubframeLoader::createJavaAppletWidget): (WebCore::FrameLoader::SubframeLoader::loadOrRedirectSubframe): (WebCore::FrameLoader::SubframeLoader::loadSubframe): (WebCore::FrameLoader::SubframeLoader::shouldUsePlugin): (WebCore::FrameLoader::SubframeLoader::loadPlugin): (WebCore::FrameLoader::SubframeLoader::completeURL const): (WebCore::FrameLoader::SubframeLoader::shouldConvertInvalidURLsToBlank const): (WebCore::SubframeLoader::SubframeLoader): Deleted. (WebCore::SubframeLoader::clear): Deleted. (WebCore::SubframeLoader::requestFrame): Deleted. (WebCore::SubframeLoader::resourceWillUsePlugin): Deleted. (WebCore::SubframeLoader::pluginIsLoadable): Deleted. (WebCore::SubframeLoader::requestPlugin): Deleted. (WebCore::SubframeLoader::requestObject): Deleted. (WebCore::SubframeLoader::createJavaAppletWidget): Deleted. (WebCore::SubframeLoader::loadOrRedirectSubframe): Deleted. (WebCore::SubframeLoader::loadSubframe): Deleted. (WebCore::SubframeLoader::shouldUsePlugin): Deleted. (WebCore::SubframeLoader::loadPlugin): Deleted. (WebCore::SubframeLoader::completeURL const): Deleted. (WebCore::SubframeLoader::shouldConvertInvalidURLsToBlank const): Deleted. * loader/SubframeLoader.h: (WebCore::SubframeLoader::containsPlugins const): Deleted. 2020-04-27 Alberto Garcia <berto@igalia.com> [GTK] [2.28.0] The Yelp build crashes if DISPLAY is not set https://bugs.webkit.org/show_bug.cgi?id=209431 Reviewed by Carlos Garcia Campos. Don't create a PlatformDisplayLibWPE as a fallback when using Wayland or X11. * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::createPlatformDisplay): 2020-04-27 Claudio Saavedra <csaavedra@igalia.com> Unreviewed compile-warning fix. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): 2020-04-27 Diego Pino Garcia <dpino@igalia.com> Unreviewed, GTK LTS build fix after r260744 https://bugs.webkit.org/show_bug.cgi?id=211069 * bindings/js/JSDOMBuiltinConstructor.h: (WebCore::JSDOMBuiltinConstructor<JSClass>::getConstructData): 2020-04-27 Claudio Saavedra <csaavedra@igalia.com> [GTK4] GdkRGBA has float members instead of double Unreviewed warning fix. * platform/graphics/gtk/ColorGtk.cpp: (WebCore::Color::operator GdkRGBA const): 2020-04-27 Ross Kirsling <ross.kirsling@sony.com> [JSC] CallData/ConstructData should include CallType/ConstructType https://bugs.webkit.org/show_bug.cgi?id=211059 Reviewed by Darin Adler. * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::QuickTimePluginReplacement::installReplacement): * bindings/js/JSCallbackData.cpp: (WebCore::JSCallbackData::invokeCallback): * bindings/js/JSCustomElementInterface.cpp: (WebCore::constructCustomElementSynchronously): (WebCore::JSCustomElementInterface::upgradeElement): (WebCore::JSCustomElementInterface::invokeCallback): * bindings/js/JSCustomXPathNSResolver.cpp: (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI): * bindings/js/JSDOMBuiltinConstructor.h: (WebCore::JSDOMBuiltinConstructor<JSClass>::getConstructData): * bindings/js/JSDOMBuiltinConstructorBase.cpp: (WebCore::JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments): * bindings/js/JSDOMConstructor.h: (WebCore::JSDOMConstructor<JSClass>::getConstructData): * bindings/js/JSDOMConstructorBase.cpp: (WebCore::JSDOMConstructorBase::getCallData): * bindings/js/JSDOMConstructorBase.h: * bindings/js/JSDOMConstructorNotConstructable.h: * bindings/js/JSDOMIterator.h: (WebCore::iteratorForEach): * bindings/js/JSDOMMapLike.cpp: (WebCore::clearBackingMap): (WebCore::setToBackingMap): (WebCore::forwardFunctionCallToBackingMap): (WebCore::forwardForEachCallToBackingMap): * bindings/js/JSDOMNamedConstructor.h: (WebCore::JSDOMNamedConstructor<JSClass>::getConstructData): * bindings/js/JSDOMPromise.cpp: (WebCore::DOMPromise::whenPromiseIsSettled): * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::createRejectedPromiseWithTypeError): * bindings/js/JSDOMSetLike.cpp: (WebCore::clearBackingSet): (WebCore::addToBackingSet): (WebCore::forwardFunctionCallToBackingSet): (WebCore::forwardForEachCallToBackingSet): * bindings/js/JSErrorHandler.cpp: (WebCore::JSErrorHandler::handleEvent): * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent): * bindings/js/JSExecState.cpp: (WebCore::functionCallHandlerFromAnyThread): * bindings/js/JSExecState.h: (WebCore::JSExecState::call): (WebCore::JSExecState::profiledCall): * bindings/js/JSExecStateInstrumentation.h: (WebCore::JSExecState::instrumentFunction): (WebCore::JSExecState::instrumentFunctionInternal): Deleted. (WebCore::JSExecState::instrumentFunctionCall): Deleted. (WebCore::JSExecState::instrumentFunctionConstruct): Deleted. * bindings/js/JSNavigatorCustom.cpp: (WebCore::JSNavigator::getUserMedia): * bindings/js/JSPluginElementFunctions.cpp: (WebCore::callPlugin): (WebCore::pluginElementCustomGetCallData): * bindings/js/JSPluginElementFunctions.h: * bindings/js/ReadableStream.cpp: (WebCore::ReadableStream::create): (WebCore::ReadableStreamInternal::callFunction): (WebCore::ReadableStream::lock): * bindings/js/ReadableStreamDefaultController.cpp: (WebCore::readableStreamCallFunction): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::executeFunctionInContext): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::callInWorld): (WebCore::ScriptController::executeAsynchronousUserAgentScriptInWorld): * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePluginCall): (GenerateLegacyCallerDefinitions): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObj::getCallData): * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestPluginInterface.cpp: (WebCore::JSTestPluginInterface::getCallData): * bindings/scripts/test/JS/JSTestPluginInterface.h: * bridge/NP_jsobject.cpp: * bridge/objc/WebScriptObject.mm: (-[WebScriptObject callWebScriptMethod:withArguments:]): * bridge/objc/objc_runtime.h: * bridge/objc/objc_runtime.mm: (JSC::Bindings::ObjcFallbackObjectImp::getCallData): * bridge/runtime_object.cpp: (JSC::Bindings::RuntimeObject::getCallData): (JSC::Bindings::RuntimeObject::getConstructData): * bridge/runtime_object.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updateCaptionContainer): (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange): (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus): * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): * testing/Internals.cpp: (WebCore::Internals::cloneArrayBuffer): 2020-04-27 Diego Pino Garcia <dpino@igalia.com> Unreviewed, reverting r260672. [GTK] WebInspector tests are timing out after r260672 Reverted changeset: "[Win] Bundle Inspector Resources in Release builds" https://bugs.webkit.org/show_bug.cgi?id=210942 https://trac.webkit.org/changeset/260672 2020-04-27 Kenneth Russell <kbr@chromium.org> Build failure in WebGL2RenderingContext after r260588 https://bugs.webkit.org/show_bug.cgi?id=211057 Reviewed by Darin Adler. Fix non-ANGLE build failure in WebGL2RenderingContext after r260588. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::texStorage2D): 2020-04-26 Darin Adler <darin@apple.com> [Cocoa] stop using out arguments for document attributes when converting to attributed strings https://bugs.webkit.org/show_bug.cgi?id=211048 Reviewed by Sam Weinig. * DerivedSources-input.xcfilelist: Building modified this file automatically. Uploading the new version. * WebCore.xcodeproj/project.pbxproj: Added AttributedString.h. * editing/cocoa/AttributedString.h: Added. Moved this from WebKit, but removed a lot of inessentials. * editing/cocoa/DictionaryLookup.mm: Removed unneeded include. * editing/cocoa/EditorCocoa.mm: (WebCore::selectionAsAttributedString): Updated for change to the return value of the attributedString function, and use init instead of initWithString:@"". * editing/cocoa/HTMLConverter.h: Changed to an Objective-C-only header, omitting things like #pramga once. Return the AttributedString struct from the functions instead of using an out argument for document attributes. * editing/cocoa/HTMLConverter.mm: (HTMLConverter::convert): Return an AttributedString and drop the out argument. (WebCore::attributedString): Ditto. (WebCore::editingAttributedString): Ditto. Also refactor a little bit. * editing/ios/EditorIOS.mm: Removed unneeded include. * editing/mac/DictionaryLookupLegacy.mm: Removed unneeded include. * editing/mac/EditorMac.mm: (WebCore::Editor::dataSelectionForPasteboard): Updated since attributedString now returns a structure. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::policyProperties): Use init instead of initWithString:@"". * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::siteForCookies): Use init instead of initWithString:@"". 2020-04-26 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com> [PlayStation] Enable TestWTF and TestWebCore https://bugs.webkit.org/show_bug.cgi?id=208849 Reviewed by Don Olmstead. * PlatformPlayStation.cmake: Add WebCore_CopySharedLibs to install dependencies. 2020-04-26 Said Abou-Hallawa <sabouhallawa@apple.com> Rendering update steps should use Seconds for the timestamps https://bugs.webkit.org/show_bug.cgi?id=210990 Reviewed by Daniel Bates. Make DOMWindow::nowTimestamp() return ReducedResolutionSeconds and change the callers accordingly. ReducedResolutionSeconds is a new type but it's just an alias of the type Seconds. It indicates that the returned value is a web-safe seconds. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::suspendAnimations): (WebCore::DocumentTimeline::liveCurrentTime const): (WebCore::DocumentTimeline::cacheCurrentTime): (WebCore::DocumentTimeline::documentWillUpdateAnimationsAndSendEvents): * animation/DocumentTimeline.h: * animation/DocumentTimelinesController.cpp: (WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents): * animation/DocumentTimelinesController.h: * dom/Document.cpp: (WebCore::Document::serviceRequestAnimationFrameCallbacks): (WebCore::Document::updateIntersectionObservations): * dom/Document.h: * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks): (WebCore::ScriptedAnimationController::scheduleAnimation): * dom/ScriptedAnimationController.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::getVideoPlaybackQuality): * page/DOMWindow.cpp: (WebCore::DOMWindow::nowTimestamp const): * page/DOMWindow.h: * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::nowTimestamp const): (WebCore::IntersectionObserver::createTimestamp const): Deleted. * page/IntersectionObserver.h: * page/Page.cpp: (WebCore::Page::updateRendering): * page/Performance.cpp: (WebCore::Performance::now const): (WebCore::Performance::nowInReducedResolutionSeconds const): * page/Performance.h: * page/ReducedResolutionSeconds.h: Added. 2020-04-26 Alexey Shvayka <shvaikalesh@gmail.com> InternalFunction::createSubclassStructure should use newTarget's globalObject https://bugs.webkit.org/show_bug.cgi?id=202599 Reviewed by Yusuke Suzuki. Accounts for InternalFunction::createSubclassStructure() signature change and utilizes getFunctionRealm() helper to handle cross-realm JSBoundFunction and ProxyObject instances as NewTarget value. Tests: web-platform-tests/WebIDL/ecmascript-binding/constructors.html web-platform-tests/custom-elements/htmlconstructor/newtarget.html * bindings/js/JSDOMWrapperCache.h: (WebCore::setSubclassStructureIfNeeded): * bindings/js/JSHTMLElementCustom.cpp: (WebCore::constructJSHTMLElement): 2020-04-26 Yusuke Suzuki <ysuzuki@apple.com> Use `static Lock` instead of `static NeverDestroyed<Lock>` https://bugs.webkit.org/show_bug.cgi?id=211036 Reviewed by Darin Adler. * platform/GenericTaskQueue.cpp: (WebCore::TaskDispatcher<Timer>::sharedLock): 2020-04-26 Peng Liu <peng.liu6@apple.com> Remove unused class PlaybackSessionInterface https://bugs.webkit.org/show_bug.cgi?id=211031 Reviewed by Daniel Bates. No new tests, no functional changes. * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/PlaybackSessionInterface.h: Removed. * platform/cocoa/PlaybackSessionModelMediaElement.h: * platform/ios/PlaybackSessionInterfaceAVKit.h: * platform/mac/PlaybackSessionInterfaceMac.h: 2020-04-26 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Compute and distribute extra vertical space for rows https://bugs.webkit.org/show_bug.cgi?id=211046 Reviewed by Antti Koivisto. When the table computed height is bigger than the sum of the row heigts, we need to distribute the extra vertical space among the non-fixed height rows. The distribution is based on the preferred height of those non-fixed rows. * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): 2020-04-11 Darin Adler <darin@apple.com> Stop using live ranges in functions that return range of the selection https://bugs.webkit.org/show_bug.cgi?id=210396 Reviewed by Sam Weinig. - Added makeRangeSelectingNode, to create a range that selects a node and all its descendants. - Improved intersectingNodes so it can now easily be used in a while loop style as well as the range-for loop style. Also made it more robust against tree changes while iterating; it will now always stop at the end of the document. - Changed functions that work with selection to get a SimpleRange, and then either do all the work without a live range, or call createLiveRange right where it's needed, making it clearer when we can delete that call later as we cut down live ranges even more. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::selectionRange const): Return a SimpleRange instead of a live range. (WebCore::AccessibilityObject::findTextRanges const): Use createLiveRange on the result of selectionRange since this still mostly uses live ranges. * accessibility/AccessibilityObject.h: Updated for the above. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange const): Updated to create a live range only in the one place we need to call a Range class member function. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]): Use createLiveRange here. * dom/SimpleRange.cpp: (WebCore::makeRangeSelectingNode): Added. For use when we need to make a range that selects a node, not just the node's contents. (WebCore::firstIntersectingNode): Renamed from IntersectingNodeRange::first since this is now used in the iterator class, not the range class. Also letting it be a non-member function so we can tweak it without touching the haeder file. (WebCore::nodePastLastIntersectingNode): Ditto. (WebCore::IntersectingNodeIterator::IntersectingNodeIterator): Changed this constructor to take a SimpleRange. To add the advanceSkippingChildren feature, had to build the termination condition into the iterator rather than basing it on the value of the sentinel. (WebCore::IntersectingNodeIterator::advance): Added. Contains the logic from the ++ operator, so it can be called in a more straightforward way when this is being used with a while loop rather than a range-for loop. (WebCore::IntersectingNodeIterator::advanceSkippingChildren): Added. * dom/SimpleRange.h: Updated for the changes to IntersectingNodeIterator and IntersectingNodeRange. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::timerFired): Use createLiveRange. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::targetRanges const): Use WTFMove in a place where the old code was copying instead. * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss): Use intersectingNodes to make the function's logic easier to understand. * editing/Editing.cpp: (WebCore::visibleImageElementsInRangeWithNonLoadedImages): Changed the argument type to SimpleRange. * editing/Editing.h: Updated for the change above. * editing/EditingStyle.cpp: (WebCore::EditingStyle::styleAtSelectionStart): Use createLiveRange. * editing/Editor.cpp: (WebCore::Editor::selectedRange): Use createLiveRange. (WebCore::Editor::applyStyleToSelection): Ditto. (WebCore::Editor::applyParagraphStyleToSelection): Ditto. (WebCore::Editor::insertTextWithoutSendingTextEvent): Ditto. (WebCore::Editor::insertLineBreak): Ditto. (WebCore::Editor::insertParagraphSeparator): Ditto. (WebCore::Editor::ignoreSpelling): Remove use of live range. (WebCore::Editor::learnSpelling): Ditto. (WebCore::Editor::misspelledWordAtCaretOrRange const): Ditto. (WebCore::Editor::isSelectionUngrammatical): Ditto. (WebCore::Editor::guessesForMisspelledOrUngrammatical): Ditto. (WebCore::Editor::markMisspellingsAfterTypingToWord): Use createLiveRange. (WebCore::Editor::markMisspellingsOrBadGrammar): Ditto. (WebCore::Editor::markMisspellingsAndBadGrammar): Ditto. (WebCore::Editor::rangeForPoint): Ditto. (WebCore::Editor::insertTextPlaceholder): Ditto. (WebCore::Editor::shouldChangeSelection const): Ditto. (WebCore::Editor::findString): Ditto. (WebCore::Editor::rangeOfString): Ditto. (WebCore::Editor::scanSelectionForTelephoneNumbers): Ditto. (WebCore::Editor::editorUIUpdateTimerFired): Remove use of live range. (WebCore::candidateRangeForSelection): Deleted. (WebCore::Editor::stringForCandidateRequest const): Use createLiveRange and merged in the logic from candidateRangeForSelection. (WebCore::Editor::fontForSelection const): Remove use of live range. * editing/EditorCommand.cpp: (WebCore::expandSelectionToGranularity): Use createLiveRange. (WebCore::executeDeleteToMark): Ditto. (WebCore::executeSelectToMark): Ditto. (WebCore::valueFormatBlock): Ditto. * editing/FrameSelection.cpp: (WebCore::FrameSelection::respondToNodeModification): Use createLiveRange. (WebCore::FrameSelection::shouldDeleteSelection const): Ditto. (WebCore::FrameSelection::getClippedVisibleTextRectangles const): Do the work without a live range. (WebCore::FrameSelection::expandSelectionToElementContainingCaretSelection): Ditto. (WebCore::FrameSelection::elementRangeContainingCaretSelection const): Changed to return a SimpleRange rather than a live range. Also removed redundant checks and renamed locals to streamline the function. (WebCore::FrameSelection::wordRangeContainingCaretSelection): Return a SimpleRange instead of a live range. (WebCore::FrameSelection::rangeByMovingCurrentSelection const): Ditto. (WebCore::FrameSelection::rangeByExtendingCurrentSelection const): Ditto. (WebCore::FrameSelection::rangeByAlteringCurrentSelection const): Ditto. * editing/FrameSelection.h: Removed the toNormalizedRange function, since the VisibleSelection class has a comment claiming most callers should not call it. Updated forthe other changes above. * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::doApply): Use createLiveRange. * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplacementFragment::ReplacementFragment): Ditto. * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::TextCheckingHelper): Remove use of live range, changing the type of m_range to SimpleRange. (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): Reduce use of live range. (WebCore::TextCheckingHelper::findFirstGrammarDetail const): Use createLiveRange. (WebCore::TextCheckingHelper::findFirstBadGrammar const): Ditto. (WebCore::TextCheckingHelper::isUngrammatical const): Remove use of live range. (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const): Use createLiveRange. (WebCore::TextCheckingHelper::unifiedTextCheckerEnabled const): Updated for different interface to get the document for a SimpleRange. * editing/TextCheckingHelper.h: Change constructor to take a SimpleRange. * editing/TypingCommand.cpp: (WebCore::TypingCommand::deleteKeyPressed): Use createLiveRange. (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto. * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::firstRange const): Return a SimpleRange. (WebCore::VisibleSelection::toNormalizedRange const): Ditto. * editing/VisibleSelection.h: Updated for the above. * editing/cocoa/DictionaryLookup.mm: Removed an uneeded check of the selection range against null. Code already guards against null endpoints. * editing/cocoa/EditorCocoa.mm: (WebCore::selectionAsAttributedString): Added. Uses the attributedString function with it's new argument and return value types. There's no longer a special function for the selection in the HTMLConverter header, so we put it here instead. (WebCore::Editor::writeSelectionToPasteboard): Updated to use the function above and to deal with RetainPtr. (WebCore::Editor::writeSelection): Ditto. * editing/cocoa/HTMLConverter.h: Removed attributedStringFromSelection and attributedStringBetweenStartAndEnd. Renamed attributedStringFromRange to just attributedString and renamed editingAttributedStringFromRange to just editingAttributedString. Also renamed IncludeImagesInAttributedString to just IncludeImages. * editing/cocoa/HTMLConverter.mm: (HTMLConverter::HTMLConverter): Use a SimpleRange rther than two Position arguments to the constructor. (HTMLConverter::convert): Use RetainPtr for the return value and the optional out argument. (WebCore::attributedStringFromSelection): Deleted. (WebCore::attributedStringBetweenStartAndEnd): Deleted. (WebCore::attributedString): Renamed the version that takes a range and made it take a SimpleRange, not a live range. (WebCore::editingAttributedString): Ditto. * editing/mac/EditorMac.mm: (WebCore::Editor::dataSelectionForPasteboard): Updated for changes to attributedString. * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent const): Changed to not use live ranges any more. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): Use createLiveRange. * page/DOMSelection.cpp: (WebCore::DOMSelection::getRangeAt): Use createLiveRange. (WebCore::DOMSelection::addRange): Use Ditto. (WebCore::DOMSelection::deleteFromDocument): Ditto. * page/DragController.cpp: (WebCore::setSelectionToDragCaret): Removed in/out argument that was used to update a range that was never looked at afterward. (WebCore::DragController::concludeEditDrag): Use createLiveRange. (WebCore::DragController::draggableElement const): Ditto. (WebCore::DragController::startDrag): Ditto. * page/EventHandler.cpp: (WebCore::EventHandler::dispatchMouseEvent): Use createLiveRange. (WebCore::EventHandler::sendContextMenuEventForKey): Ditto. (WebCore::EventHandler::didStartDrag): Remove use of live range. * page/Page.cpp: (WebCore::Page::findStringMatchingRanges): Use createLiveRange. * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): Ditto. (WebCore::TextIndicator::createWithSelectionInFrame): Ditto. * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::buildSelectionHighlight): Use createLiveRange. (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): Use createLiveRange. * rendering/HitTestResult.cpp: (WebCore::HitTestResult::selectedText const): Remove use of live range. 2020-04-26 Darin Adler <darin@apple.com> Remove unnecessary inlining and templates for URL decomposition DOM functions https://bugs.webkit.org/show_bug.cgi?id=211025 Reviewed by Alex Christensen. * Headers.cmake: Renamed URLUtils.h to URLDecomposition.h. * Modules/cache/DOMCacheStorage.cpp: Updated include and using namespace. * Sources.txt: Added URLDecomposition.cpp. * WebCore.xcodeproj/project.pbxproj: Added URLDecomposition.cpp and renamed URLUtils.h to URLDecomposition.h. * html/DOMURL.h: Removed the WEBCORE_EXPORT on this class. Added final. Derive from URLDecomposition instead of URLUtils. Changed return type of href to const&. Moved toJSON here from URLUtils. Added overrides of the fullURL and setFullURL functions for URLDecomposition. * html/DOMURL.idl: Removed ImplementationLacksVTable. * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::HTMLAnchorElement): Moved initialization of boolean data members to the class definition. * html/HTMLAnchorElement.h: Derive from URLDecomposition instead of URLUtils. Added overrides of the fullURL and setFullURL functions for URLDecomposition. Initialize data members here in the class definition. * html/HTMLMediaElement.cpp: Removed unnecessary include of DOMURL.h. * html/URLDecomposition.cpp: Added. Contains most of the code from the URLUtils class template, which no longer needs to be in a header. * html/URLDecomposition.h: Renamed URLUtils.h to this. It's now an abstract base class rather than a class template using the curiously recurring template pattern. * html/URLSearchParams.h: Forward-declare DOMURL rather than including the DOMURL.h header. * html/URLUtils.h: Removed. Renamed to URLDecompostion.h. * page/DOMWindow.cpp: Removed unneeded include of DOMURL.h. * testing/Internals.cpp: Added include of DOMURL.h. 2020-04-26 Cathie Chen <cathiechen@igalia.com> fast/scrolling/scroll-behavior-invalidate-if-disabled.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=210917 Reviewed by Darin Adler. The flaky failure is caused by reusing the CSSPropertyInfo value cached propertyInfoCache after experimental flags changed. Add propertyInfoFromJavaScriptCSSPropertyName to perform disabled checking after parsing. If the property is disabled, it will return an invalid CSSPropertyInfo instead. * css/CSSStyleDeclaration.cpp: (WebCore::CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName): (WebCore::CSSStyleDeclaration::namedItem): (WebCore::CSSStyleDeclaration::setNamedItem): 2020-04-25 Ross Kirsling <ross.kirsling@sony.com> [JSC] isCallable is redundant with isFunction https://bugs.webkit.org/show_bug.cgi?id=211037 Reviewed by Yusuke Suzuki. * bindings/js/JSDOMConvertScheduledAction.h: (WebCore::Converter<IDLScheduledAction>::convert): * worklets/PaintWorkletGlobalScope.cpp: (WebCore::PaintWorkletGlobalScope::registerPaint): Don't use getCallData if you don't need CallData. 2020-04-25 Alex Christensen <achristensen@webkit.org> Build fix. https://bugs.webkit.org/show_bug.cgi?id=210521 * Modules/applepay/ApplePaySetupFeature.mm: 2020-04-25 Alex Christensen <achristensen@webkit.org> Move ApplePay code from WebKitAdditions to WebCore and WebKit https://bugs.webkit.org/show_bug.cgi?id=210521 I accidentally committed an older version of the patch. This is the diff between the two to fix the internal build. 2020-04-25 Alex Christensen <achristensen@webkit.org> Move ApplePay code from WebKitAdditions to WebCore and WebKit https://bugs.webkit.org/show_bug.cgi?id=210521 Reviewed by Andy Estes. Only 4 minor modifications were necessary, as follows: 1. PaymentSetupFeatures's RetainPtr<NSArray<PKPaymentSetupFeature *>> was changed to RetainPtr<NSArray> to work with C++. 2. WebPaymentCoordinatorProxyAdditions messages were moved to WebPaymentCoordinatorProxy, removing the need for the extra message receiver, the Optional<WebPaymentCoordinatorProxyAdditions>, and the finishConstruction. 3. WebMediaSessionManager.cpp's macros that collided with other macros were renamed. This was necessary because of different source unification. 4. PaymentSetupFeatures.h was renamed to ApplePayPaymentSetupFeatures.h to be able to build with PaymentSetupFeatures.h in the SDK. The rest is just copy and paste. There isn't a good way to land this without breaking the build without removing the files from WebKitAdditions at the same time, so I'll do the two at the same time late at night to not cause disruption. * DerivedSources.make: * Modules/applepay/ApplePayInstallmentConfiguration.h: Added. * Modules/applepay/ApplePayInstallmentConfiguration.idl: Added. * Modules/applepay/ApplePayPayment.h: * Modules/applepay/ApplePayPayment.idl: * Modules/applepay/ApplePayPaymentMethod.h: * Modules/applepay/ApplePayPaymentMethod.idl: * Modules/applepay/ApplePayPaymentMethodUpdate.h: * Modules/applepay/ApplePayPaymentMethodUpdate.idl: * Modules/applepay/ApplePayRequestBase.cpp: (WebCore::finishConverting): (WebCore::requiresSupportedNetworks): * Modules/applepay/ApplePayRequestBase.h: * Modules/applepay/ApplePaySession.cpp: (WebCore::finishConverting): * Modules/applepay/ApplePaySessionPaymentRequest.h: (WebCore::ApplePaySessionPaymentRequest::installmentConfiguration const): (WebCore::ApplePaySessionPaymentRequest::setInstallmentConfiguration): * Modules/applepay/ApplePaySetup.cpp: Added. (WebCore::shouldDiscloseFeatures): (WebCore::ApplePaySetup::getSetupFeatures): (WebCore::ApplePaySetup::begin): (WebCore::ApplePaySetup::ApplePaySetup): (WebCore::ApplePaySetup::stop): (WebCore::ApplePaySetup::suspend): * Modules/applepay/ApplePaySetup.h: Added. (WebCore::ApplePaySetup::create): * Modules/applepay/ApplePaySetup.idl: Added. * Modules/applepay/ApplePaySetupFeature.h: Added. (WebCore::ApplePaySetupFeature::create): (WebCore::ApplePaySetupFeature::platformFeature const): * Modules/applepay/ApplePaySetupFeature.idl: Added. * Modules/applepay/ApplePaySetupFeature.mm: Added. (WebCore::ApplePaySetupFeature::type const): (WebCore::ApplePaySetupFeature::state const): (WebCore::ApplePaySetupFeature::supportsInstallments const): (WebCore::ApplePaySetupFeature::ApplePaySetupFeature): * Modules/applepay/ApplePaySetupFeatureType.h: Added. * Modules/applepay/ApplePaySetupFeatureType.idl: Added. * Modules/applepay/PaymentCoordinatorClient.h: (WebCore::PaymentCoordinatorClient::getSetupFeatures): (WebCore::PaymentCoordinatorClient::beginApplePaySetup): (WebCore::PaymentCoordinatorClient::endApplePaySetup): * Modules/applepay/PaymentInstallmentConfiguration.h: Added. * Modules/applepay/PaymentInstallmentConfiguration.mm: Added. (WebCore::toDecimalNumber): (WebCore::platformFeatureType): (WebCore::createPlatformConfiguration): (WebCore::PaymentInstallmentConfiguration::PaymentInstallmentConfiguration): (WebCore::PaymentInstallmentConfiguration::platformConfiguration const): * Modules/applepay/PaymentMethodUpdate.h: * Modules/applepay/cocoa/PaymentCocoa.mm: (WebCore::finishConverting): * Modules/applepay/cocoa/PaymentMethodCocoa.mm: (WebCore::finishConverting): * Modules/applepay/cocoa/PaymentMethodUpdateCocoa.mm: (WebCore::PaymentMethodUpdate::setInstallmentGroupIdentifier): * Modules/applepay/cocoa/PaymentSessionErrorCocoa.mm: (WebCore::additionalError): * Modules/applepay/paymentrequest/ApplePayRequest.idl: * Modules/mediasession/WebMediaSessionManager.cpp: (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerEnabled): (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState): (WebCore::WebMediaSessionManager::mockMediaPlaybackTargetPickerDismissPopup): (WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient): (WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient): (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients): (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): (WebCore::WebMediaSessionManager::clientStateDidChange): (WebCore::WebMediaSessionManager::setPlaybackTarget): (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange): (WebCore::WebMediaSessionManager::playbackTargetPickerWasDismissed): (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): (WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring): (WebCore::WebMediaSessionManager::configureWatchdogTimer): (WebCore::WebMediaSessionManager::watchdogTimerFired): * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/WebCoreAdditions.mm: 2020-04-25 Simon Fraser <simon.fraser@apple.com> Commit the scrolling tree from the main thread https://bugs.webkit.org/show_bug.cgi?id=211026 <rdar://problem/62374855> Reviewed by Darin Adler. ScrollingCoordinatorMac::commitTreeStateIfNeeded() passed the new state tree to the scrolling thread which then did the commit (which updates the scrolling tree from the state tree). However, applyLayerPositions() immediately waited for that commit to complete, blocking the main thread anyway. We might as well just commit the scrolling tree on the main thread. ScrollingTree::commitTreeState() locks m_treeMutex, so this is still safe. Lock contention with the scrolling or event dispatcher threads should be rare; those threads are both mostly responsive. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::scrollingTreeAsText const): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::commitTreeState): * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::waitForScrollingTreeCommit): Deleted. * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::commitTreeState): Deleted. (WebCore::ThreadedScrollingTree::incrementPendingCommitCount): Deleted. (WebCore::ThreadedScrollingTree::decrementPendingCommitCount): Deleted. (WebCore::ThreadedScrollingTree::waitForPendingCommits): Deleted. (WebCore::ThreadedScrollingTree::waitForScrollingTreeCommit): Deleted. (WebCore::ThreadedScrollingTree::applyLayerPositions): Deleted. * page/scrolling/ThreadedScrollingTree.h: * page/scrolling/mac/ScrollingCoordinatorMac.mm: (WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded): * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: (WebCore::ScrollingCoordinatorNicosia::commitTreeState): 2020-04-25 Yusuke Suzuki <ysuzuki@apple.com> Use static initialized Lock instead of LazyNeverDestroyed<Lock> https://bugs.webkit.org/show_bug.cgi?id=211010 Reviewed by Mark Lam. WTF::Lock can be static-initialized, so no need to use LazyNeverDestroyed<Lock>. * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::instancesMutex): * Modules/webgpu/WebGPUPipeline.cpp: (WebCore::WebGPUPipeline::instancesMutex): * html/canvas/CanvasRenderingContext.cpp: (WebCore::CanvasRenderingContext::instancesMutex): * html/canvas/WebGLProgram.cpp: (WebCore::WebGLProgram::instancesMutex): 2020-04-25 Darin Adler <darin@apple.com> [Cocoa] Deal with another round of Xcode upgrade checks https://bugs.webkit.org/show_bug.cgi?id=211027 Reviewed by Alexey Proskuryakov. * WebCore.xcodeproj/project.pbxproj: Bump the upgrade check version. 2020-04-25 Alex Christensen <achristensen@webkit.org> Prepare to remove automatic URL->String conversion operators https://bugs.webkit.org/show_bug.cgi?id=211007 Reviewed by Darin Adler. * Modules/cache/DOMCache.cpp: (WebCore::DOMCache::requestFromInfo): * Modules/fetch/FetchRequest.cpp: (WebCore::FetchRequest::urlString const): * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::fetch): * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::create): * accessibility/AccessibilityImageMapLink.cpp: (WebCore::AccessibilityImageMapLink::stringValueForMSAA const): * bindings/IDLTypes.h: (WebCore::IDLString::isNullValue): * bindings/js/CachedScriptSourceProvider.h: (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider): * bindings/js/JSDOMConvertStrings.h: (WebCore::JSConverter<IDLDOMString>::convert): (WebCore::Converter<IDLUSVString>::convert): (WebCore::JSConverter<IDLUSVString>::convert): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::evaluateInWorld): (WebCore::ScriptController::evaluateModule): (WebCore::ScriptController::callInWorld): (WebCore::ScriptController::executeIfJavaScriptURL): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneSerializer::write): * css/CSSCursorImageValue.cpp: (WebCore::CSSCursorImageValue::updateCursorElement): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::customCSSText const): (WebCore::CSSImageValue::createDeprecatedCSSOMWrapper const): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeFontFaceSrcURI): * dom/Document.cpp: (WebCore::Document::processHttpEquiv): * dom/ExtensionStyleSheets.cpp: (WebCore::createExtensionsStyleSheet): * dom/InlineStyleSheetOwner.cpp: (WebCore::InlineStyleSheetOwner::createSheet): * dom/ScriptElement.cpp: (WebCore::ScriptElement::requestModuleScript): (WebCore::ScriptElement::executeClassicScript): * dom/StyledElement.cpp: (WebCore::StyledElement::styleAttributeChanged): * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::sanitizeMarkupWithArchive): (WebCore::WebContentReader::readWebArchive): * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::formAction const): * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::canLoadURL const): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::shouldLoadLink): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::selectNextSourceChild): * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::canLoadURL const): * html/parser/XSSAuditor.cpp: (WebCore::XSSAuditor::filterToken): * inspector/InspectorAuditResourcesObject.cpp: (WebCore::InspectorAuditResourcesObject::getResources): * inspector/InspectorStyleSheet.cpp: (WebCore::buildArrayForGroupings): * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::responseReceived): * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildObjectForCachedResource): (WebCore::InspectorNetworkAgent::willSendRequest): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::getCookies): (WebCore::InspectorPageAgent::searchInResources): (WebCore::InspectorPageAgent::buildObjectForFrameTree): * inspector/agents/InspectorWorkerAgent.cpp: (WebCore::InspectorWorkerAgent::connectToWorkerInspectorProxy): * inspector/agents/WebConsoleAgent.cpp: (WebCore::WebConsoleAgent::didFailLoading): * inspector/agents/worker/ServiceWorkerAgent.cpp: (WebCore::ServiceWorkerAgent::getInitializationInfo): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::subresources const): * loader/DocumentLoader.h: (WebCore::DocumentLoader::clientRedirectDestinationForHistory const): (WebCore::DocumentLoader::serverRedirectDestinationForHistory const): * loader/FrameLoader.cpp: (WebCore::FrameLoader::submitForm): (WebCore::FrameLoader::receivedFirstData): (WebCore::FrameLoader::loadInSameDocument): (WebCore::FrameLoader::loadedResourceFromMemoryCache): (WebCore::createWindow): * loader/HistoryController.cpp: (WebCore::HistoryController::currentItemShouldBeReplaced const): * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent): * loader/LinkLoader.cpp: (WebCore::LinkLoader::preloadIfNeeded): (WebCore::LinkLoader::prefetchIfNeeded): * loader/MixedContentChecker.cpp: (WebCore::MixedContentChecker::checkFormForMixedContent const): * loader/NavigationScheduler.cpp: (WebCore::NavigationScheduler::shouldScheduleNavigation const): (WebCore::NavigationScheduler::scheduleLocationChange): * loader/PingLoader.cpp: (WebCore::PingLoader::loadImage): (WebCore::PingLoader::sendPing): * loader/ResourceLoadNotifier.cpp: (WebCore::ResourceLoadNotifier::dispatchWillSendRequest): * loader/SubframeLoader.cpp: (WebCore::SubframeLoader::requestObject): * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::load): * loader/appcache/ApplicationCache.cpp: (WebCore::ApplicationCache::addResource): (WebCore::ApplicationCache::resourceForRequest): * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::selectCache): (WebCore::ApplicationCacheGroup::finishedLoadingMainResource): (WebCore::ApplicationCacheGroup::didFinishLoadingEntry): (WebCore::ApplicationCacheGroup::didFailLoadingEntry): (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): * loader/appcache/ApplicationCacheHost.cpp: (WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache): (WebCore::ApplicationCacheHost::getApplicationCacheFallbackResource): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::loadCacheGroup): (WebCore::ApplicationCacheStorage::findOrCreateCacheGroup): (WebCore::ApplicationCacheStorage::findInMemoryCacheGroup const): (WebCore::ApplicationCacheStorage::cacheGroupForURL): (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL): (WebCore::ApplicationCacheStorage::cacheGroupDestroyed): (WebCore::ApplicationCacheStorage::cacheGroupMadeObsolete): (WebCore::ApplicationCacheStorage::store): (WebCore::ApplicationCacheStorage::deleteCacheForOrigin): * loader/archive/ArchiveResourceCollection.cpp: (WebCore::ArchiveResourceCollection::addAllResources): (WebCore::ArchiveResourceCollection::addResource): (WebCore::ArchiveResourceCollection::archiveResourceForURL): * loader/cache/CachedCSSStyleSheet.cpp: (WebCore::CachedCSSStyleSheet::didAddClient): (WebCore::CachedCSSStyleSheet::checkNotify): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::cachedResource const): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::determineRevalidationPolicy const): (WebCore::CachedResourceLoader::notifyFinished): * loader/cache/CachedXSLStyleSheet.cpp: (WebCore::CachedXSLStyleSheet::didAddClient): (WebCore::CachedXSLStyleSheet::checkNotify): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::checkOrEnableIfNeeded const): * page/DOMWindow.cpp: (WebCore::DOMWindow::setLocation): (WebCore::DOMWindow::createWindow): (WebCore::DOMWindow::open): * page/Location.cpp: (WebCore::Location::reload): * page/PageSerializer.cpp: (WebCore::PageSerializer::retrieveResourcesForProperties): * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::shouldIgnoreHost): * page/SecurityPolicy.cpp: (WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner): (WebCore::SecurityPolicy::isBaseURLSchemeAllowed): * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::reportViolation const): * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: (WebCore::MediaPlayerPrivateAVFoundation::assetURL const): * platform/network/BlobRegistryImpl.cpp: (WebCore::BlobRegistryImpl::writeBlobToFilePath): * platform/network/mac/ResourceErrorMac.mm: (WebCore::ResourceError::platformLazyInit): * storage/StorageEventDispatcher.cpp: (WebCore::StorageEventDispatcher::dispatchSessionStorageEvents): (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents): * svg/SVGImageLoader.cpp: (WebCore::SVGImageLoader::sourceURI const): * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::loadSynchronously): * workers/service/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::scope const): * workers/service/ServiceWorkerRegistrationKey.cpp: (WebCore::ServiceWorkerRegistrationKey::hash const): (WebCore::ServiceWorkerRegistrationKey::isMatching const): * workers/service/context/ServiceWorkerDebuggable.cpp: (WebCore::ServiceWorkerDebuggable::ServiceWorkerDebuggable): * workers/service/server/SWServer.cpp: (WebCore::SWServer::startScriptFetch): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::send): 2020-04-25 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add vertical-align: baseline support https://bugs.webkit.org/show_bug.cgi?id=211024 Reviewed by Antti Koivisto. Adjust the padding with the baseline offset when the cell is baseline aligned (as opposed to the initial value of 'middle'). Test: fast/layoutformattingcontext/table-basic-row-vertical-align-baseline.html * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): * layout/tableformatting/TableGrid.h: (WebCore::Layout::TableGrid::Cell::setBaselineOffset): (WebCore::Layout::TableGrid::Cell::baselineOffset const): 2020-04-25 Darin Adler <darin@apple.com> Move URL to use StringView when returning substrings of the URL https://bugs.webkit.org/show_bug.cgi?id=210431 Reviewed by Anders Carlsson. * Modules/cache/DOMCacheEngine.cpp: (WebCore::DOMCacheEngine::matchURLs): Removed unneeded calls to hasQuery. * Modules/fetch/FetchRequest.cpp: (WebCore::FetchRequest::initializeWith): Use hasCredentials. * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::redirect): Use hasCredentials. * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::isValidURLBasedPaymentMethodIdentifier): Use hasCredentials. * Modules/plugins/YouTubePluginReplacement.cpp: (WebCore::createYouTubeURL): Take StringView. (WebCore::queryKeysAndValues): Take StringView. (WebCore::processAndCreateYouTubeURL): Use auto since URL pieces are now returned as StringView. (WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL): Use StringView and makeString rather than StringBuilder. * Modules/websockets/WebSocketHandshake.cpp: (WebCore::resourceName): Use queryWithLeadingQuestionMark. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::internalLinkElement const): Use StringView. * dom/Document.cpp: (WebCore::Document::setURL): Use setHostAndPort. * dom/Element.cpp: (WebCore::Element::findAnchorElementForLink): Update since fragmentIdentifier returns StringView. * dom/TreeScope.cpp: Added a comment. * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::replaceRichContentWithAttachments): Update since lastPathComponent returns a StringView. Also got rid of some strange use of AtomString that was not necessary and used WTFMove more. * editing/ios/EditorIOS.mm: (WebCore::Editor::writeImageToPasteboard): Update since lastPathComponent returns a StringView. * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::attachmentTitleForDisplay const): Use makeString instead of StringBuilder, and StringView instead of String for name and extension values. * html/HTMLPlugInElement.cpp: (WebCore::pluginReplacementForType): Update since lastPathComponent returns a StringView. * html/MediaFragmentURIParser.cpp: (WebCore::MediaFragmentURIParser::parseFragments): Update since fragmentIdentifier returns a StringView. * html/URLUtils.h: Changed many functions to take a StringView, changed various other functions to call toString, since the underlying URL function now returns a StringView. Updated names since "pass" is now "password". (WebCore::countASCIIDigits): Added. Replaces unusual function named parsePortFromStringPosition because we can use StringView now and so don't need such an unusual function. * loader/AdClickAttribution.cpp: (WebCore::AdClickAttribution::parseConversionRequest): Use hasCredentials. Also removed unnecessary use of ASCIILiteral that hurts performance a tiny bit. (WebCore::AdClickAttribution::urlForTesting const): Use makeString instead of StringBuilder. * loader/CrossOriginAccessControl.cpp: (WebCore::validateCrossOriginRedirectionURL): Use hasCredentials. * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): Use hasCredentials. * loader/FormSubmission.cpp: (WebCore::appendMailtoPostFormDataToURL): Update since query returns StringView. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadInSameDocument): Use equalRespectingNullity on fragment identifiers to preserve behavior, since at this time StringView == StringView does not respect nullity, but String == String does. * loader/appcache/ApplicationCacheHost.cpp: (WebCore::ApplicationCacheHost::createFileURL): Use fileURLWithFileSystemPath. * loader/appcache/ManifestParser.cpp: (WebCore::manifestPath): Return a StringView. (WebCore::parseManifest): Use StringView. * loader/cache/CachedFont.cpp: (WebCore::CachedFont::calculateItemInCollection const): Update since fragmentIdentifer returns a StringView. * loader/cache/CachedResourceRequest.cpp: (WebCore::CachedResourceRequest::splitFragmentIdentifierFromRequestURL): Ditto. * page/FrameView.cpp: (WebCore::FrameView::scrollToFragment): Ditto. (WebCore::FrameView::scrollToFragmentInternal): Updated log message. * page/History.cpp: (WebCore::History::stateObjectAdded): Updated for URL::password name change and to use the new stringWithoutQueryOrFragmentIdentifier rather than the old equalIgnoringQueryAndFragment. * page/Location.cpp: (WebCore::Location::href const): Use removeCredentials. (WebCore::Location::port const): Streamlined. (WebCore::Location::pathname const): Use an ASCIILiteral. (WebCore::Location::search const): Use queryWithLeadingQuestionMark. (WebCore::Location::hash const): Use fragmentIdentifierWithLeadingNumberSign. (WebCore::Location::setPort): Use parseUInt16. * page/UserContentURLPattern.cpp: Coding style tweaks. * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary): Use contains instead of reverseFind to check for a period in the filename. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::load): Updated since lastPathComponent is a StringView. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::convertToInternalProtocol): Updated to use makeString since setProtocol takes a StringView. * platform/network/ResourceHandleInternal.h: Renamed m_pass to m_password and call password instead of pass. * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::removeCredentials): Use removeCredentials. * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::createCFURLConnection): Updated for m_password name change. (WebCore::ResourceHandle::willSendRequest): Updated for m_password and password name changes. (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication): Ditto. * platform/network/curl/CurlProxySettings.cpp: (WebCore::CurlProxySettings::setUserPass): Updated for setPassword name change. (WebCore::createProxyUrl): Use hasCredentials, updated for password name change. * platform/network/curl/CurlProxySettings.h: (WebCore::CurlProxySettings::password const): Updated for password name change. * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Updated for m_password name change. (WebCore::ResourceHandle::getCredential): Ditto. (WebCore::ResourceHandle::willSendRequest): Updated for m_password and password name changes. * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::createNSURLConnection): Updated for m_password and setPassword name changes. (WebCore::ResourceHandle::willSendRequest): Ditto. (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication): Ditto. * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::createSoupURI const): Updated for password name change. * platform/network/soup/URLSoup.cpp: (WebCore::soupURIToURL): Updated for setPassword name change. * platform/win/PasteboardWin.cpp: (WebCore::writeURL): Updated since lastPathComponent returns a StringView. (WebCore::filesystemPathFromUrlOrTitle): Ditto. (WebCore::Pasteboard::write): Ditto. * style/StyleBuilderState.cpp: (WebCore::Style::BuilderState::createFilterOperations): Updated since fragmentIdentifier returns a StringView. * workers/WorkerLocation.cpp: (WebCore::WorkerLocation::port const): Streamlined. (WebCore::WorkerLocation::pathname const): Use an ASCIILiteral. (WebCore::WorkerLocation::search const): Use queryWithLeadingQuestionMark. (WebCore::WorkerLocation::hash const): Use fragmentIdentifierWithLeadingNumberSign. * workers/service/ServiceWorkerRegistrationKey.cpp: (WebCore::ServiceWorkerRegistrationKey::ServiceWorkerRegistrationKey): Updated for hasFragmentIdentifier name change. * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::topOriginURL): Simplified code to set port. * workers/service/server/SWServer.cpp: (WebCore::originURL): Ditto. * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::open): Updated for setPassword name change. 2020-04-25 Chris Fleizach <cfleizach@apple.com> AX: Improve tracking of Element* pointers in AXObjectCache with WeakHashSet https://bugs.webkit.org/show_bug.cgi?id=210879 Reviewed by Daniel Bates. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::handleFocusedUIElementChanged): (WebCore::filterListForRemoval): (WebCore::AXObjectCache::performDeferredCacheUpdate): * accessibility/AXObjectCache.h: 2020-04-25 Antoine Quint <graouts@apple.com> [Web Animations] KeyframeEffect should ensure its target remains alive https://bugs.webkit.org/show_bug.cgi?id=211019 Reviewed by Daniel Bates. Test: webanimations/keyframe-effect-target-kept-alive.html Make KeyframeEffect::m_target a RefPtr so that assigning an element to effect.target guarantees that element is kept alive even if there are no other references to that element. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::KeyframeEffect): (WebCore::KeyframeEffect::setTarget): * animation/KeyframeEffect.h: 2020-04-25 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Cleanup TableFormattingContext::layoutInFlowContent https://bugs.webkit.org/show_bug.cgi?id=211023 Reviewed by Sam Weinig. Move some code to dedicated functions. * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutInFlowContent): (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): (WebCore::Layout::TableFormattingContext::setUsedGeometryForRows): (WebCore::Layout::TableFormattingContext::setUsedGeometryForSections): (WebCore::Layout::TableFormattingContext::layoutCell): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): (WebCore::Layout::TableFormattingContext::initializeDisplayBoxToBlank const): Deleted. (WebCore::Layout::TableFormattingContext::setComputedGeometryForRows): Deleted. (WebCore::Layout::TableFormattingContext::setComputedGeometryForSections): Deleted. * layout/tableformatting/TableFormattingContext.h: * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const): (WebCore::Layout::TableFormattingContext::Geometry::computedColumnWidth const): (WebCore::Layout::TableFormattingContext::Geometry::tableCellHeightAndMargin const): Deleted. 2020-04-25 Joonghun Park <jh718.park@samsung.com> Unreviewed. Remove the build warning below since r260247. warning: unused parameter ‘foo’ [-Wunused-parameter] No new tests, no new behaviors. * testing/Internals.cpp: (WebCore::Internals::hasSandboxIOKitOpenAccessToClass): 2020-04-24 Chris Dumez <cdumez@apple.com> [iOS] Unable to sign up on twitter.com https://bugs.webkit.org/show_bug.cgi?id=211003 <rdar://problem/58804852> Reviewed by Darin Adler. This is similar to the bug we had on nytimes.com and that was fixed in r258767. However, instead of a 'resize' event, it is a 'change' event on a MediaQueryList that is getting twitter.com in a bad state. The issue is that when we home out of Safari, SpringBoard takes does a snapshot sequence at various sizes / orientations and this causes many JS events to get fired (e.g. 'resize', 'orientationchange', 'change', ...), which can get some sites in a bad state. To address the issue, we now prevent firing of ALL JS events during the SpringBoard snapshot, instead of merely preventing the 'resize' ones. * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): * page/FrameView.cpp: (WebCore::FrameView::sendResizeEventIfNeeded): * page/Page.h: (WebCore::Page::shouldFireEvents const): (WebCore::Page::setShouldFireEvents): (WebCore::Page::shouldFireResizeEvents const): Deleted. (WebCore::Page::setShouldFireResizeEvents): Deleted. 2020-04-24 Saam Barati <sbarati@apple.com> Return BigInt32 whenever we can https://bugs.webkit.org/show_bug.cgi?id=210922 Reviewed by Yusuke Suzuki. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readBigInt): 2020-04-24 Yusuke Suzuki <ysuzuki@apple.com> [WTF] allThreads registration is racy with allThreads unregistration https://bugs.webkit.org/show_bug.cgi?id=210995 <rdar://problem/61609690> Reviewed by Keith Miller. * page/cocoa/ResourceUsageThreadCocoa.mm: (WebCore::ResourceUsageThread::platformCollectCPUData): 2020-04-24 Wenson Hsieh <wenson_hsieh@apple.com> Make some more adjustments to TextManipulationController's paragraph boundary heuristic https://bugs.webkit.org/show_bug.cgi?id=210993 <rdar://problem/61571299> Reviewed by Tim Horton. Adjust the heuristic added in r260583 to account for a few more common scenarios where we currently consider text as a part of the same paragraph. This can lead to many issues during text manipulation where text is moved between these elements, when it should not be. The new scenarios include block and inline-block links, as well as button elements. Test: TextManipulation.StartTextManipulationTreatsInlineBlockLinksAndButtonsAsParagraphs * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::observeParagraphs): Additionally rename "paragraph boundary element" to "item boundary element", to avoid colliding with the existing notion of paragraph boundaries in editing code. 2020-04-24 Christopher Reid <chris.reid@sony.com> [Win] Bundle Inspector Resources in Release builds https://bugs.webkit.org/show_bug.cgi?id=210942 Reviewed by Fujii Hironori. * CMakeLists.txt: 2020-04-24 Antoine Quint <graouts@apple.com> [Web Animations] Ensure calling Web Animations APIs override future CSS Animations style properties https://bugs.webkit.org/show_bug.cgi?id=210988 Reviewed by Dean Jackson. The CSS Animations Level 2 spec specifies how the Web Animations APIs and the CSS Animations style properties should interact in https://drafts.csswg.org/css-animations-2/#animations. This patch implements the specified behavior and this is reflected by progress on the relevant WPT tests. The gist of this change is that once a Web Animations API is called on an animation created using CSS Animations, any changes made to related CSS Animations style properties on the target element will be ignored so that the overrides applied via the Web Animations API remain in effect. For instance, calling pause() or play() in a way that changes the playback state of the CSS Animation will mean that future changes to the CSS animation-play-state property are ignored. To do this we make more IDL properties and methods use dedicated methods to distinguish between the bindings entry-point and internal usage of the same methods to integrate the behavior only when the API itself is being used. * animation/AnimationEffect.cpp: (WebCore::AnimationEffect::getBindingsTiming const): Ensure we flush styles when animation.effect.getTiming() is called. (WebCore::AnimationEffect::getBindingsComputedTiming const): Ensure we flush styles when animation.effect.getComputedTiming() is called. (WebCore::AnimationEffect::bindingsUpdateTiming): Notify the associated CSSAnimation object, if any, when animation.effect.updateTiming() is called such that the CSSAnimation may apply the relevant overrides. * animation/AnimationEffect.h: * animation/AnimationEffect.idl: * animation/CSSAnimation.cpp: (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation): Only apply new values of CSS Animations style properties if there are no overrides for them resulting from calling related Web Animations APIs. (WebCore::CSSAnimation::bindingsPlay): Mark animation-play-state as overridden if play() is called. (WebCore::CSSAnimation::bindingsPause): Mark animation-play-state as overridden if pause() is called. (WebCore::CSSAnimation::setBindingsEffect): Mark all animation style properties, except for animation-name and animation-play-state as overridden if animation.effect is set. (WebCore::CSSAnimation::setBindingsStartTime): Mark animation-play-state as overridden if animation.startTime is set. (WebCore::CSSAnimation::bindingsReverse): Mark animation-play-state as overridden if reverse() is called. (WebCore::CSSAnimation::effectTimingWasUpdatedUsingBindings): Mark each CSS property associated with a key found on the timing object passed to animation.effect.updateTiming() as overridden. (WebCore::CSSAnimation::effectKeyframesWereSetUsingBindings): Mark animation-timing-function as overridden if animation.effect.setKeyframes() is called. * animation/CSSAnimation.h: * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::bindingsStartTime const): (WebCore::DeclarativeAnimation::setBindingsStartTime): (WebCore::DeclarativeAnimation::startTime const): Deleted. (WebCore::DeclarativeAnimation::setStartTime): Deleted. * animation/DeclarativeAnimation.h: * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::getBindingsKeyframes): Ensure we flush styles when animation.effect.getKeyframes() is called. (WebCore::KeyframeEffect::getKeyframes): Only use the CSS-originated animation path if we don't have JS-originated keyframes. (WebCore::KeyframeEffect::setBindingsKeyframes): Notify the associated CSSAnimation object, if any, when animation.effect.setKeyframes() is called such that the CSSAnimation may apply the relevant overrides. (WebCore::KeyframeEffect::processKeyframes): Correctly return early if part of the processing yields an exception. * animation/KeyframeEffect.h: * animation/KeyframeEffect.idl: * animation/WebAnimation.cpp: (WebCore::WebAnimation::setBindingsEffect): (WebCore::WebAnimation::setBindingsStartTime): (WebCore::WebAnimation::bindingsReverse): * animation/WebAnimation.h: (WebCore::WebAnimation::bindingsEffect const): (WebCore::WebAnimation::bindingsStartTime const): * animation/WebAnimation.idl: 2020-04-24 Chris Dumez <cdumez@apple.com> ASSERTION FAILED: m_wrapper under HTMLMediaElement::setIsPlayingToWirelessTarget https://bugs.webkit.org/show_bug.cgi?id=210983 <rdar://problem/61611994> Reviewed by Eric Carlson. The issue was that we were trying to fire a JS event as a result of ActiveDOMObject::stop() getting called, which is not allowed. To address the issue, we avoid firing the event if the context is already stopped. No new tests, already covered by: media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget): 2020-04-24 Tim Horton <timothy_horton@apple.com> iPad: "Pocket City" interaction does not work with trackpad https://bugs.webkit.org/show_bug.cgi?id=210985 <rdar://problem/62273077> Reviewed by Wenson Hsieh. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isPocketCity): 2020-04-24 Tomoki Imai <Tomoki.Imai@sony.com> [OpenSSL] Implement WebCrypto APIs for HMAC https://bugs.webkit.org/show_bug.cgi?id=210902 Reviewed by Don Olmstead. Support WebCrypto HMAC sign/verify with OpenSSL. The design and some functions are inherited from the other ports. * crypto/openssl/CryptoAlgorithmHMACOpenSSL.cpp: (WebCore::HMACAlgorithm): Added. Helper function to map CryptoAlgorithmIdentifier to OpenSSL EVP_MD type. (WebCore::calculateSignature): Added. Helper function to calculate the signature for sign/verify. (WebCore::CryptoAlgorithmHMAC::platformSign): Implemented, mostly same as the other ports. (WebCore::CryptoAlgorithmHMAC::platformVerify): Implemented, mostly same as the other ports. * crypto/openssl/CryptoAlgorithmRegistryOpenSSL.cpp: (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Added CryptoAlgorithmHMAC support. * crypto/openssl/OpenSSLCryptoUniquePtr.h: Added specialized unique_ptrs for EVP_MD_CTX and EVP_PKEY. (WebCore::OpenSSLCryptoPtrDeleter<EVP_MD_CTX>::operator() const): (WebCore::OpenSSLCryptoPtrDeleter<EVP_PKEY>::operator() const): 2020-04-24 Brian Burg <bburg@apple.com> Web Automation: timeout underneath Automation.evaluateJavaScriptFunction in Selenium test frame_switching_tests.py::testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs[Safari] https://bugs.webkit.org/show_bug.cgi?id=210162 <rdar://problem/60561009> Reviewed by Devin Rousso. * page/DOMWindow.h: Expose DOMWindow::{register, unregister}Observer. 2020-04-24 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Take first in-flow table-row baseline into account when computing cell baseline https://bugs.webkit.org/show_bug.cgi?id=210972 Reviewed by Antti Koivisto. Check if the cell has a nested table and use its first row as the baseline for the cell (unless there's an IFC before). Test: fast/layoutformattingcontext/table-basic-row-baseline-with-nested-table.html * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutCell): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): * layout/tableformatting/TableFormattingContext.h: * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell): * layout/tableformatting/TableGrid.h: (WebCore::Layout::TableGrid::Row::setBaselineOffset): (WebCore::Layout::TableGrid::Row::baselineOffset const): 2020-04-24 Antti Koivisto <antti@apple.com> Nullptr crash in objc_msgSend under WebCore::genericFamily https://bugs.webkit.org/show_bug.cgi?id=210911 <rdar://problem/61510208> Reviewed by Geoffrey Garen. Speculative fix. * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: (WebCore::genericFamily): Test that CTFontDescriptorCopyAttribute is really returning CFStringRef. Also explicitly return String from lambda to clarify lifetimes. 2020-04-24 Simon Fraser <simon.fraser@apple.com> Move some post-renderingUpdate code into WebCore https://bugs.webkit.org/show_bug.cgi?id=210952 Reviewed by Antti Koivisto. Factor some code called by the various DrawingArea subclasses into Page::finalizeRenderingUpdate(), with some flags to control behavior that differs between drawing areas. ScrollingCoordinator::commitTreeStateIfNeeded() is a no-op for RemoteScrollingCoordinator so it's fine to always call it. * page/Page.cpp: (WebCore::Page::passiveTouchEventListenerRectsForTesting): (WebCore::Page::finalizeRenderingUpdate): * page/Page.h: 2020-04-24 Adrian Perez de Castro <aperez@igalia.com> Add missing HTMLNames:: namespace prefix to usage of liTag object Unreviewed build fix. No new tests needed. * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::observeParagraphs): 2020-04-23 Rob Buis <rbuis@igalia.com> Make CachedResourceLoader more conforming to Fetch specification https://bugs.webkit.org/show_bug.cgi?id=210925 Reviewed by Alex Christensen. Make CachedResourceLoader more conforming to Fetch specification by fixing links, re-ordering steps to match main fetch [1] and do early exit code paths earlier. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestImage): adjust to parameter change. (WebCore::CachedResourceLoader::canRequest): replace CachedResourceRequest param with ResourceLoaderOptions. (WebCore::CachedResourceLoader::prepareFetch): fix comment. (WebCore::CachedResourceLoader::requestResource): re-order. * loader/cache/CachedResourceLoader.h: 2020-04-23 Simon Fraser <simon.fraser@apple.com> Move the storage of DisplayID from Chrome to Page https://bugs.webkit.org/show_bug.cgi?id=210943 Reviewed by Tim Horton. The less Chrome knows about Frames and Documents the better. At some point Page is going to talk to ScrollingCoordinator in this callback too. * page/Chrome.cpp: (WebCore::Chrome::displayID const): (WebCore::Chrome::windowScreenDidChange): * page/Chrome.h: * page/Page.cpp: (WebCore::Page::windowScreenDidChange): * page/Page.h: (WebCore::Page::displayID const): 2020-04-23 Simon Fraser <simon.fraser@apple.com> EventHandler::selectCursor() has broken resize over coordinate conversion code https://bugs.webkit.org/show_bug.cgi?id=210778 Reviewed by Zalan Bujtas. EventHandler::selectCursor() appeared to make a local hit-test point from window to content coordinates, which made no sense, but this happened to work because RenderLayer::hitTestLayer() set the HitTestResult localPoint to a global point if you hit the resizer. Clean up this mess by having all resizer-related geometry queries be in local coordinates. As a bonus, actually set the cursor to a resize cursor when over the resizer. Test: fast/events/cursors/mouse-cursor-over-resizer.html * page/EventHandler.cpp: (WebCore::EventHandler::selectCursor): (WebCore::EventHandler::handleMousePressEvent): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::resize): (WebCore::RenderLayer::offsetFromResizeCorner const): (WebCore::RenderLayer::isPointInResizeControl const): (WebCore::RenderLayer::hitTestLayer): (WebCore::RenderLayer::hitTestResizerInFragments const): * rendering/RenderLayer.h: 2020-04-23 Wenson Hsieh <wenson_hsieh@apple.com> Text manipulation does not account for text in fully clipped containers https://bugs.webkit.org/show_bug.cgi?id=210940 <rdar://problem/61137648> Reviewed by Tim Horton. Allow text manipulation to find both text in `visibility: hidden;` containers, as well as text in fully clipped overflow containers. In both cases, renderers exist for these nodes, but TextIterator ignores them by default. If these containers become visible in the future, we don't want to skip out on performing text manipulation on them. An alternative would be to detect when any element that has not undergone text manipulation has become visible (i.e. no longer clipped by an ancestor), but this is likely more complicated (and possibly less performant) than just eagerly extracting text from hidden containers, once they gain renderers. TextManipulation.StartTextManipulationIncludesFullyClippedText * editing/TextManipulationController.cpp: (WebCore::ParagraphContentIterator::ParagraphContentIterator): (WebCore::TextManipulationController::didCreateRendererForElement): (WebCore::TextManipulationController::scheduleObservationUpdate): (WebCore::TextManipulationController::scheduleObservartionUpdate): Deleted. While I'm here, also rename scheduleObservartionUpdate to scheduleObservationUpdate. * editing/TextManipulationController.h: 2020-04-23 Alex Christensen <achristensen@webkit.org> Allow credentials for same-origin css mask images https://bugs.webkit.org/show_bug.cgi?id=210895 <rdar://problem/60093888> Reviewed by Brent Fulgham. Test: http/tests/security/css-mask-image-credentials.html r230006 went a step too far in restricting what is allowed with css mask images. Basic authentication credentials should be allowed with such requests as they are in Chrome and Firefox. This can be seen by doing run-webkit-httpd then opening http://127.0.0.1:8000/security/css-mask-image-credentials.html In Chrome and Firefox you'll see it forward to a page that has a blue square. In Safari before this change you'll see a yellow square and a basic authentication prompt. In Safari after this change you'll see the same blue square you see in Chrome and Firefox. * style/StylePendingResources.cpp: (WebCore::Style::loadPendingImage): 2020-04-23 Alex Christensen <achristensen@webkit.org> Jesus Calling app needs more WebSQL https://bugs.webkit.org/show_bug.cgi?id=210889 <rdar://problem/61795507> Reviewed by Chris Dumez. Manually verified this fixes the issue in the radar. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowInstanceFunctionOpenDatabaseBody): 2020-04-23 Rob Buis <rbuis@igalia.com> Move applyUserAgentIfNeeded calls to a more central place https://bugs.webkit.org/show_bug.cgi?id=209587 Reviewed by Darin Adler. Make main resource loads stop calling applyUserAgentIfNeeded and instead do it in the CachedResourceLoader. * loader/FrameLoader.cpp: (WebCore::FrameLoader::addExtraFieldsToRequest): (WebCore::FrameLoader::loadResourceSynchronously): * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::createRequest): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::updateHTTPRequestHeaders): (WebCore::CachedResourceLoader::requestResource): * loader/cache/CachedResourceLoader.h: * loader/cache/CachedResourceRequest.cpp: (WebCore::CachedResourceRequest::updateReferrerAndOriginHeaders): (WebCore::CachedResourceRequest::updateUserAgentHeader): (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders): Deleted. * loader/cache/CachedResourceRequest.h: 2020-04-23 Kenneth Russell <kbr@chromium.org> [WebGL2] Update texture packing code for software uploads from DOM https://bugs.webkit.org/show_bug.cgi?id=209515 Reviewed by Dean Jackson. Update the bottommost DOM-to-texture packing code in GraphicsContextGLOpenGL and FormatConverter to full WebGL 2.0 capability. Reorganize some code to make side-by-side comparisons easier with other WebGL 2.0 implementations. Added NEEDS_PORT comments to areas in the calling code which need particular attention in subsequent patches. Roughly two more patches will be needed on top of this one in order to fully pass the associated conformance tests. Fix a bug in the non-ANGLE ENABLE(WEBGL2) code path which accidentally disabled WebGL entirely in this configuration. Covered by the WebGL 2.0 conformance tests. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): (WebCore::WebGLRenderingContextBase::copyTexSubImage2D): (WebCore::WebGLRenderingContextBase::readPixels): (WebCore::WebGLRenderingContextBase::texImageSource2D): (WebCore::WebGLRenderingContextBase::texImage2DImpl): (WebCore::WebGLRenderingContextBase::texImage2D): (WebCore::WebGLRenderingContextBase::texSubImage2DImpl): (WebCore::WebGLRenderingContextBase::texSubImage2D): (WebCore::WebGLRenderingContextBase::validateTexFuncData): (WebCore::WebGLRenderingContextBase::getPackPixelStoreParams const): (WebCore::WebGLRenderingContextBase::getUnpackPixelStoreParams const): * html/canvas/WebGLRenderingContextBase.h: * platform/graphics/FormatConverter.cpp: (WebCore::convertFloatToHalfFloat): (WebCore::float>): (WebCore::uint8_t>): (WebCore::uint16_t>): (WebCore::int8_t>): (WebCore::int16_t>): (WebCore::uint32_t>): (WebCore::int32_t>): (WebCore::FormatConverter::convert): * platform/graphics/FormatConverter.h: (WebCore::FormatConverter::FormatConverter): * platform/graphics/GraphicsContextGL.h: (WebCore::GraphicsContextGL::hasAlpha): (WebCore::GraphicsContextGL::hasColor): * platform/graphics/opengl/GraphicsContextGLOpenGL.cpp: (WebCore::GraphicsContextGLOpenGL::texImage2DResourceSafe): (WebCore::GraphicsContextGLOpenGL::computeFormatAndTypeParameters): (WebCore::GraphicsContextGLOpenGL::computeImageSizeInBytes): (WebCore::GraphicsContextGLOpenGL::PixelStoreParams::PixelStoreParams): (WebCore::GraphicsContextGLOpenGL::packImageData): (WebCore::GraphicsContextGLOpenGL::extractImageData): (WebCore::GraphicsContextGLOpenGL::extractTextureData): (WebCore::TexelBytesForFormat): (WebCore::GraphicsContextGLOpenGL::packPixels): * platform/graphics/opengl/GraphicsContextGLOpenGL.h: 2020-04-23 Wenson Hsieh <wenson_hsieh@apple.com> Add a heuristic for text manipulation to treat some list items as paragraph boundaries https://bugs.webkit.org/show_bug.cgi?id=210915 <rdar://problem/61907080> Reviewed by Megan Gardner. Adds a mechanism to allow text manipulation to emit an item containing the current list of text manipulation tokens early, in the case where the paragraph content iterator crosses the boundary of an element that encloses a paragraph. Currently, the only enclosing paragraph element will be list items that have `display: block;`, which we can take as a hint that the text in these list items should be vended as separate items, rather than as tokens in a single item. This may be extended in the future to other situations by adjusting logic in `isEnclosingParagraphElement`. Test: TextManipulation.StartTextManipulationBreaksParagraphInBetweenListItems * editing/TextManipulationController.cpp: (WebCore::TextManipulationController::observeParagraphs): 2020-04-23 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add support for basic baseline align inside a table row https://bugs.webkit.org/show_bug.cgi?id=210918 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-basic-row-baseline-align.html The minimum height of a row is defined as the height of an hypothetical linebox containing the cells originating in the row. In this hypothetical linebox, we use baseline alignment to align the cells vertically. Use these vertically aligned cells to compute the final row height. * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::verticalMarginBorderAndPadding const): (WebCore::Display::Box::setVerticalPadding): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutInFlowContent): (WebCore::Layout::TableFormattingContext::layoutCell): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): * layout/tableformatting/TableFormattingContext.h: 2020-04-23 Sihui Liu <sihui_liu@apple.com> TextManipulationController should set range of paragraph using token's positions https://bugs.webkit.org/show_bug.cgi?id=210866 <rdar://problem/60646283> Reviewed by Wenson Hsieh. Set the range of paragraph using positions of first token and last token in the paragraph because: 1. Accurate range makes token matching in TextManipulationController::replace() easier, as TextIterator could visit different positions with different ranges or different conditions. For example, in our previous implementation, start of a paragraph can be set as the first visible position of document, while position of first token is after that. Then in replace(), TextManipulationController may extract a word before the position of first token and return error. See added test TextManipulation.CompleteTextManipulationCorrectParagraphRange. 2. TextManipulationController can handle fewer content and this is less error-prone. For example, svg elements before/after the paragraph text will not be identified as tokens [] in a paragraph now. See updated API tests for example. New test: TextManipulation.CompleteTextManipulationCorrectParagraphRange * editing/TextManipulationController.cpp: (WebCore::ParagraphContentIterator::moveCurrentNodeForward): m_currentNodeForFindingInvisibleContent should not be advanced if it is already at the end. (WebCore::containsOnlyHTMLSpaces): (WebCore::TextManipulationController::observeParagraphs):Set the paragraph start as the position of the first token and end as the position of last token. If the paragraph is split with <br>, the end will be extended to position of <br> so that we can add this node back later; otherwise, <br> can be removed after original text of paragraph is removed in TextManipulationController::replace(). Also, stop identifying spaces as tokens because non-text Node can emit spaces. (WebCore::TextManipulationController::replace): Only identify tokens from content with meaningful text. 2020-04-23 Chris Dumez <cdumez@apple.com> [ Mac wk2 ] imported/w3c/web-platform-tests/notifications/event-onclose.html is flaky failing. https://bugs.webkit.org/show_bug.cgi?id=209483 <rdar://problem/60830377> Reviewed by Geoff Garen. Align garbage collection of Notification JS wrapper with the specification: - https://notifications.spec.whatwg.org/#garbage-collection [1] In particular, the following changes were made: 1. Instead of using the legacy setPendingActivity() / unsetPendingActivity(), override ActiveDOMObject::virtualHasPendingActivity() to implement the behavior documented in the specification. 2. Keep the wrapper alive as long as the notification is showing and as long as there are relevant event listeners, as per [1]. Previously, we failed to check for event listeners, which was suboptimal. 3. Update the constructor to queue a task on the event loop in order to show the notification asynchronously, instead of relying on a SuspendableTimer for this purpose. Previously, the JS wrapper could get collected between construction and the notification getting shown, which was leading to the test flakiness. No new tests, unskipped existing test. * Modules/notifications/Notification.cpp: (WebCore::Notification::Notification): (WebCore::Notification::show): (WebCore::Notification::finalize): (WebCore::Notification::dispatchShowEvent): (WebCore::Notification::dispatchClickEvent): (WebCore::Notification::dispatchCloseEvent): (WebCore::Notification::dispatchErrorEvent): (WebCore::Notification::eventListenersDidChange): (WebCore::Notification::virtualHasPendingActivity const): * Modules/notifications/Notification.h: 2020-04-23 Andres Gonzalez <andresg_22@apple.com> Correction for patch 397001. https://bugs.webkit.org/show_bug.cgi?id=210914 Reviewed by Chris Fleizach. - No need to check for isEmpty when retrieving the primary screen size, as pointed out by Darin Adler in bug 210760, patch 397001. - Added some helpful AXLOGing. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper primaryScreenHeight]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]): 2020-04-23 Don Olmstead <don.olmstead@sony.com> [CMake] Add WebKit::WebCoreTestSupport target https://bugs.webkit.org/show_bug.cgi?id=210867 Unreviewed build fix. Make the dependencies explicit. * CMakeLists.txt: 2020-04-22 Simon Fraser <simon.fraser@apple.com> In the scrolling tree, separate wheel event handling from layer updating https://bugs.webkit.org/show_bug.cgi?id=210899 Reviewed by Antti Koivisto. Working towards webkit.org/b/210884, it needs to be possible to have the scrolling tree handle a wheelEvent and update its internal state about scroll positions, but not immediately map those scroll positions onto CALayers. To achieve this, have ScrollingTreeScrollingNode::currentScrollPositionChanged() not call applyLayerPositions(), or notifyRelatedNodesAfterScrollPositionChange() which just applies layer positions on related nodes. Instead, at the end of wheel event handling, do a full scrolling tree traversal and update all the layer positions there. Delegated scrolling (iOS) still needs notifyRelatedNodesAfterScrollPositionChange() so it can't be removed. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::handleWheelEvent): (WebCore::ScrollingTree::applyLayerPositions): (WebCore::ScrollingTree::applyLayerPositionsInternal): * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged): 2020-04-23 Charlie Turner <cturner@igalia.com> [EME][CDMProxy] Sort key status array lexicographically by key IDs https://bugs.webkit.org/show_bug.cgi?id=210659 Reviewed by Xabier Rodriguez-Calvar. This is required by section 6.1 of https://www.w3.org/TR/encrypted-media/. Test: encrypted-media/clearkey-keystatuses.https.html * platform/encryptedmedia/CDMProxy.cpp: (WebCore::KeyStore::add): We could use a set here and keep it sorted by design, but this is more complexity than needed. The store has for practical purposes an upper limit of 2 items. Sorting such a vector lowers to either a noop or a swap. So the simple approach here wins over using some kind of self-sorting set structure. I also considered only sorting on-demand, since it only has to appear sorted from the perspective of JS, we could sort the array in convertToJSKeyStatusVector. However, that is semantically a const method, so sorting here felt too surprising. * platform/encryptedmedia/CDMProxy.h: (WebCore::Key::operator<): Add a lexicographic comparator to Key. 2020-04-23 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] excessive wakeups/polling due to gdk_frame_clock_begin_updating https://bugs.webkit.org/show_bug.cgi?id=210561 Reviewed by Žan Doberšek. The problem is that we are destroying the display refresh monitor from the frame clock update callback, and GTK schedules another update from the callback itself in some cases, which ends up happening forever. We were assuming that destroying the window of immediately destroy the frame clock as well, but the paint source idle keeps a reference of the frame clock. At the end of the source idle callback the source is scheduled again, taking a new reference. We need to call gdk_frame_clock_end_updating() to ensure the idle is not scheduled again. * platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp: (WebCore::DisplayRefreshMonitorGtk::~DisplayRefreshMonitorGtk): Disconnect the update signal and call gdk_frame_clock_end_updating(). (WebCore::DisplayRefreshMonitorGtk::requestRefreshCallback): Toplevel window should always have a frame clock, so remove the early return and add an assert instead. 2020-04-23 Youenn Fablet <youenn@apple.com> getDisplayMedia is not respecting aspect ratio with max constraints https://bugs.webkit.org/show_bug.cgi?id=210858 Reviewed by Eric Carlson. Add computation of exact frame size to respect aspect ratio in DisplayCaptureSourceCocoa::updateFrameSize. Refactor code to have one source class DisplayCaptureSourceCocoa and specific capturer for screen and window. This simplifies code and allows reusing DisplayCaptureSourceCocoa with a mock capturer. Update mock code to use DisplayCaptureSourceCocoa. Tests: fast/mediastream/getDisplayMedia-max-constraints.html fast/mediastream/getDisplayMedia-max-constraints1.html fast/mediastream/getDisplayMedia-max-constraints2.html fast/mediastream/getDisplayMedia-max-constraints3.html * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp: (WebCore::DisplayCaptureManagerCocoa::updateDisplayCaptureDevices): (WebCore::DisplayCaptureManagerCocoa::updateWindowCaptureDevices): (WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID): (WebCore::DisplayCaptureManagerCocoa::windowCaptureDeviceWithPersistentID): * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::create): (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): (WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa): (WebCore::DisplayCaptureSourceCocoa::capabilities): (WebCore::DisplayCaptureSourceCocoa::settings): (WebCore::DisplayCaptureSourceCocoa::startProducingData): (WebCore::DisplayCaptureSourceCocoa::stopProducingData): (WebCore::DisplayCaptureSourceCocoa::updateFrameSize): (WebCore::DisplayCaptureSourceCocoa::emitFrame): (WebCore::DisplayCaptureSourceCocoa::Capturer::setLogger): (WebCore::DisplayCaptureSourceCocoa::Capturer::logChannel const): * platform/mediastream/mac/DisplayCaptureSourceCocoa.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSourceMac::createForMockDisplayCapturer): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: * platform/mediastream/mac/ScreenDisplayCapturerMac.h: Added. * platform/mediastream/mac/ScreenDisplayCapturerMac.mm: Added. (WebCore::ScreenDisplayCapturerMac::create): (WebCore::ScreenDisplayCapturerMac::ScreenDisplayCapturerMac): (WebCore::ScreenDisplayCapturerMac::~ScreenDisplayCapturerMac): (WebCore::ScreenDisplayCapturerMac::createDisplayStream): (WebCore::ScreenDisplayCapturerMac::start): (WebCore::ScreenDisplayCapturerMac::stop): (WebCore::ScreenDisplayCapturerMac::generateFrame): (WebCore::ScreenDisplayCapturerMac::startDisplayStream): (WebCore::ScreenDisplayCapturerMac::commitConfiguration): (WebCore::ScreenDisplayCapturerMac::displayWasReconfigured): (WebCore::ScreenDisplayCapturerMac::displayReconfigurationCallBack): (WebCore::ScreenDisplayCapturerMac::newFrame): (WebCore::ScreenDisplayCapturerMac::screenCaptureDeviceWithPersistentID): (WebCore::ScreenDisplayCapturerMac::screenCaptureDevices): * platform/mediastream/mac/WindowDisplayCapturerMac.h: Added. * platform/mediastream/mac/WindowDisplayCapturerMac.mm: ddedAdded. (WebCore::WindowDisplayCapturerMac::create): (WebCore::WindowDisplayCapturerMac::WindowDisplayCapturerMac): (WebCore::WindowDisplayCapturerMac::windowImage): (WebCore::WindowDisplayCapturerMac::generateFrame): (WebCore::WindowDisplayCapturerMac::windowCaptureDeviceWithPersistentID): (WebCore::WindowDisplayCapturerMac::windowCaptureDevices): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockDisplayCapturer::MockDisplayCapturer): (WebCore::MockDisplayCapturer::start): (WebCore::MockDisplayCapturer::generateFrame): * platform/mock/MockRealtimeVideoSource.h: (isType): 2020-04-22 Simon Fraser <simon.fraser@apple.com> Make it possible to eagerly apply scrolling tree state from the main thread https://bugs.webkit.org/show_bug.cgi?id=210883 Reviewed by Tim Horton. Work towards fixing webkit.org/b/210884: at the beginning of Page::updateRendering(), we are going to need to pull the current state of the scrolling tree back to the main thread, so that JS-exposed scroll offsets match scrolling tree state. To this end, expose a scrolling tree traversal function from ScrollingTree, which takes the lock and then calls a visitor function for each node. For scrolling nodes, the visitor gets the scroll position and optional layout viewport origin. These match the data passed back currently via AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll(). The new code is not called yet. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::synchronizeStateFromScrollingTree): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::synchronizeStateFromScrollingTree): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::traverseScrollingTree): (WebCore::ScrollingTree::traverseScrollingTreeRecursive): * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged): applyLayerPositions() calls these two functions, so just call it instead. 2020-04-22 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r260535. https://bugs.webkit.org/show_bug.cgi?id=210897 Causes crashes in WK1 (Requested by smfr on #webkit). Reverted changeset: "[ Mac wk2 ] imported/w3c/web-platform-tests/notifications /event-onclose.html is flaky failing." https://bugs.webkit.org/show_bug.cgi?id=209483 https://trac.webkit.org/changeset/260535 2020-04-22 Darin Adler <darin@apple.com> [Cocoa] Build with UChar as char16_t even in builds that use Apple's internal SDK https://bugs.webkit.org/show_bug.cgi?id=210845 Reviewed by Anders Carlsson. * Configurations/WebCore.xcconfig: Move ICU-configuring macros to Platform.h. * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::connect): Get rid of an obsolete cast to unsigned to work around uint16_t not being treated as a number by makeString. * rendering/svg/SVGTextLayoutEngineBaseline.cpp: (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const): Remove deprecated U_EA_COUNT. 2020-04-22 Andres Gonzalez <andresg_22@apple.com> Add logging to core accessibility. https://bugs.webkit.org/show_bug.cgi?id=210564 <rdar://problem/61863477> Reviewed by Simon Fraser and Chris Fleizach. - Use LOG and LOG_WITH_STREAM macros instead of WTF::Logger directly. - Added logging of AXCoreObjects. * accessibility/AXLogger.cpp: (WebCore::AXLogger::AXLogger): (WebCore::AXLogger::~AXLogger): (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AccessibilityObjectInterface.h: 2020-04-22 Daniel Bates <dabates@apple.com> Support toggling debug overlay for touch action region and editable element region independent from non-fast scrollable region https://bugs.webkit.org/show_bug.cgi?id=210774 Reviewed by Dean Jackson. Break out the touch action region and editable element region debug overlays into their own flags that can be passed to Settings::setVisibleDebugOverlayRegions() to toggle these overlays, respectively. Currently both of these overlays piggyback on whether the engine will paint the non-fast scrollable region. * page/SettingsBase.h: Add two more enumerators. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::invalidateEventRegion const): Update the code to be more precise now that we can target the update paint overlay hack to when we are painting touch-action or editable element regions. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintDebugOverlays): Condition the painting of touch action region on one enumerator and the painting of editable element region on another. (WebCore::RenderLayerBacking::paintContents): Update the code to be more precise. 2020-04-22 Chris Dumez <cdumez@apple.com> [ Mac wk2 ] imported/w3c/web-platform-tests/notifications/event-onclose.html is flaky failing. https://bugs.webkit.org/show_bug.cgi?id=209483 <rdar://problem/60830377> Reviewed by Geoffrey Garen. Align garbage collection of Notification JS wrapper with the specification: - https://notifications.spec.whatwg.org/#garbage-collection [1] In particular, the following changes were made: 1. Instead of using the legacy setPendingActivity() / unsetPendingActivity(), override ActiveDOMObject::virtualHasPendingActivity() to implement the behavior documented in the specification. 2. Keep the wrapper alive as long as the notification is showing and as long as there are relevant event listeners, as per [1]. Previously, we failed to check for event listeners, which was suboptimal. 3. Update the constructor to queue a task on the event loop in order to show the notification asynchronously, instead of relying on a SuspendableTimer for this purpose. Previously, the JS wrapper could get collected between construction and the notification getting shown, which was leading to the test flakiness. No new tests, unskipped existing test. * Modules/notifications/Notification.cpp: (WebCore::Notification::Notification): (WebCore::Notification::show): (WebCore::Notification::finalize): (WebCore::Notification::dispatchShowEvent): (WebCore::Notification::dispatchClickEvent): (WebCore::Notification::dispatchCloseEvent): (WebCore::Notification::dispatchErrorEvent): (WebCore::Notification::eventListenersDidChange): (WebCore::Notification::virtualHasPendingActivity const): * Modules/notifications/Notification.h: 2020-04-22 Don Olmstead <don.olmstead@sony.com> [CMake] Add WebKit::WebCoreTestSupport target https://bugs.webkit.org/show_bug.cgi?id=210867 Reviewed by Michael Catanzaro. Add the WebKit::WebCoreTestSupport target. Modify WebCoreTestSupport to only have a dependency on WebCore if WebCore is built as a shared library. * CMakeLists.txt: 2020-04-22 Eric Carlson <eric.carlson@apple.com> fast/events/event-handler-detached-document-dispatchEvent.html is crashing https://bugs.webkit.org/show_bug.cgi?id=210859 <rdar://problem/62072269> Reviewed by Jer Noble. A media session may not have a Page when it is created, so register with the MediaUsageManager in inActiveDocumentChanged if necessary. No new tests, fixes an existing test. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::MediaElementSession): (WebCore::MediaElementSession::~MediaElementSession): (WebCore::MediaElementSession::addedMediaUsageManagerSessionIfNecessary): (WebCore::MediaElementSession::inActiveDocumentChanged): (WebCore::MediaElementSession::updateMediaUsageIfChanged): * html/MediaElementSession.h: 2020-04-22 Antti Koivisto <antti@apple.com> REGRESSION (r249160): Deleting newline after pasting text ending in a newline results in a discontinuity https://bugs.webkit.org/show_bug.cgi?id=210677 <rdar://problem/61954169> Reviewed by Zalan Bujtas. Test: fast/text/delete-line-break-in-pre.html * rendering/RenderTextLineBoxes.cpp: (WebCore::RenderTextLineBoxes::dirtyRange): r249160 changed InlineTextBox end offset to be consistently first-past-end. The code here that updates lineBreakPos needs to take this into account too. 2020-04-22 Antoine Quint <graouts@apple.com> [Web Animations] Coordinate "update animations and send events" procedure across multiple timelines https://bugs.webkit.org/show_bug.cgi?id=202109 <rdar://problem/59470821> Reviewed by Dean Jackson. So far, although we did manage multiple animation timelines per document, we mostly operated under the assumption that there really was a single timeline. In this patch we make the "update animations and send events" procedure, which is central to the lifecycle of animations, work with multiple timelines such that a single microtask checkpoint is performed even with multiple timelines, whereas we would perform one per timeline before. To do this, we move much of the logic DocumentTimeline::updateAnimationsAndSendEvents() to DocumentTimelinesController where each step is run across each timeline, rather than running all steps for each timeline one after the other, respecting the single microtask checkpoint in the middle of the process. To minimize code churn at this stage, we still keep a fair bit of logic in DocumentTimeline and, while we remove updateAnimationsAndSendEvents(), internalUpdateAnimationsAndSendEvents() and updateCurrentTime(), we expose three methods that allow to run the pre-flight sequence in documentWillUpdateAnimationsAndSendEvents(), collect pending events in prepareForPendingAnimationEventsDispatch() and run the post-flight sequence in documentDidUpdateAnimationsAndSendEvents(). None of the logic changes, this is just moving code around. In the future, more patches will move code from DocumentTimeline up to DocumentTimelinesController such that events are enqueued there, and animation scheduling as well. But this already lets us pass a new test that used to flakily reject promises in the WPT test web-animations/timing-model/timelines/update-and-send-events.html. * animation/AnimationTimeline.h: (WebCore::AnimationTimeline::relevantAnimations const): (WebCore::AnimationTimeline::allAnimations const): * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::documentWillUpdateAnimationsAndSendEvents): (WebCore::DocumentTimeline::documentDidUpdateAnimationsAndSendEvents): (WebCore::DocumentTimeline::prepareForPendingAnimationEventsDispatch): (WebCore::DocumentTimeline::updateCurrentTime): Deleted. (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Deleted. (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents): Deleted. * animation/DocumentTimeline.h: * animation/DocumentTimelinesController.cpp: (WebCore::DocumentTimelinesController::DocumentTimelinesController): (WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents): * animation/DocumentTimelinesController.h: * animation/WebAnimationTypes.h: * dom/Document.cpp: (WebCore::Document::ensureTimelinesController): 2020-04-22 Eric Carlson <eric.carlson@apple.com> [iOS] Add a quirk to keep gizmodo videos visible when playing in fullscreen. https://bugs.webkit.org/show_bug.cgi?id=210857 <rdar://problem/58875327> Reviewed by Jer Noble. * page/Quirks.cpp: (WebCore::Quirks::needsFullscreenDisplayNoneQuirk const): * page/Quirks.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Drive-by fix: always set the layer name to make debugging in release builds easier. * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm: (WebCore::VideoLayerManagerObjC::setVideoLayer): Ditto. * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const): Change `display:none` into `display:block` on div with class "instream-native-video--mobile" when child video element with id "vjs_video_3_html5_api" is in fullscreen. 2020-04-22 Chris Dumez <cdumez@apple.com> Unreviewed, commit updated xcfilelist files. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: 2020-04-22 Chris Dumez <cdumez@apple.com> Unreviewed, reverting r259116. Broke login flow on some apple-internal sites (rdar://problem/61905262) Reverted changeset: "Move applyUserAgentIfNeeded calls to a more central place" https://bugs.webkit.org/show_bug.cgi?id=209587 https://trac.webkit.org/changeset/259116 2020-04-22 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Introduce TableFormattingContext::computeAndDistributeExtraVerticalSpace https://bugs.webkit.org/show_bug.cgi?id=210830 Reviewed by Antti Koivisto. Add a dedicated function to compute preferred heights for the table rows. This is in preparation for the 2 pass layout required to finalize row height. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeBorderAndPadding): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedPadding const): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutInFlowContent): (WebCore::Layout::TableFormattingContext::layoutCell): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace): (WebCore::Layout::TableFormattingContext::setComputedGeometryForRows): (WebCore::Layout::TableFormattingContext::setComputedGeometryForSections): (WebCore::Layout::TableFormattingContext::positionTableCells): Deleted. * layout/tableformatting/TableFormattingContext.h: 2020-04-22 Claudio Saavedra <csaavedra@igalia.com> [GTK4] Several fixes to GdkEvent APIs for GTK4 https://bugs.webkit.org/show_bug.cgi?id=210856 Reviewed by Carlos Garcia Campos. No tests needed. Several fixes to GdkEvent API changes for GTK4. This is far from complete but it allows the GTK4 build to move forward. When possible, add GTK3-API replacements to GtkVersioning.h to avoid #ifdef blocks, where the API changes are too complex, just #ifdef. * platform/gtk/GtkUtilities.cpp: (WebCore::wallTimeForEvent): * platform/gtk/GtkVersioning.h: (gdk_event_get_state): (gdk_event_get_coords): (gdk_event_get_root_coords): (gdk_event_is_scroll_stop_event): (gdk_event_get_scroll_direction): (gdk_event_get_scroll_deltas): (gdk_event_get_button): (gdk_keymap_get_for_display): Deleted as it was wrong and it's not needed. * platform/gtk/PlatformKeyboardEventGtk.cpp: (WebCore::PlatformKeyboardEvent::currentCapsLockState): (WebCore::PlatformKeyboardEvent::getCurrentModifierState): (WebCore::PlatformKeyboardEvent::modifiersContainCapsLock): * platform/gtk/PlatformWheelEventGtk.cpp: (WebCore::PlatformWheelEvent::PlatformWheelEvent): 2020-04-22 Youenn Fablet <youenn@apple.com> Simplify SWServerWorker::whenActivated logic https://bugs.webkit.org/show_bug.cgi?id=210795 Reviewed by Alex Christensen. Improve logging and ensure whenActivated can be called whatever the worker state is. No change of behavior. * workers/service/server/SWServer.cpp: (WebCore::SWServer::didFinishInstall): (WebCore::SWServer::fireInstallEvent): (WebCore::SWServer::fireActivateEvent): * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::whenActivated): 2020-04-22 Enrique Ocaña González <eocanha@igalia.com> [GStreamer][MSE] Youtube 'live stream'/H264 URLs fail to play, VP8/9 URLs play OK https://bugs.webkit.org/show_bug.cgi?id=209119 Reviewed by Xabier Rodriguez-Calvar. The fix consists of removing the initial avoiding of seeking and just issuing the proper segment instead of seeking (seeks in GStreamer can't be done before prerolling anyway). Appsrc doesn't make easy to emit our own custom segment, so what I did was to use a segment fixer probe to modify the original [0, infinity] segment issued by appsrc and use a [startTime, stopTime] with proper values depending on the seek target and rate. Covered by existing tests. * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::checkShouldDelaySeek): Don't hold seeks on startup, when changing from READY to PAUSED. (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek): Refactored seek delay condition. Also, don't do a regular gst_element_seek() for initial seeks, just proceed with a special case in that situation. * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: (initialSeekSegmentFixerProbe): Probe that fixes the segment. (webKitMediaSrcPrepareInitialSeek): Behave much like a regular seek, but also compute the right GstSegment, install the segment fixer probe and setReadyForMoreSamples() on the SourceBufferPrivates. * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h: 2020-04-21 Sergio Villar Senin <svillar@igalia.com> [WebXR] Test IDLs and stubs https://bugs.webkit.org/show_bug.cgi?id=209859 Reviewed by Dean Jackson and Youenn Fablet. WebXR testing is hard as it might involve interaction with actual devices. That's why the WebXR testing API (https://immersive-web.github.io/webxr-test-api/) was proposed. In fact, all the current WebXR tests from web-platform-tests are using that testing API. This new testing API supplements navigator.xr and is accessed through navigator.xr.test. In order not to expose the API to the web we're adding the XRTest interface to Internals instead. The mapping from internals.xrTest to navigator.xr.test happens in the WPT code. We're adding the required IDLs and very basic (mostly empty) implementations for testing methods. We're adding testing infrastructure, adding tests make no sense for this change. * CMakeLists.txt: Added new files. * DerivedSources.make: Ditto. * Modules/webxr/NavigatorWebXR.h: Export API to be used in testing code. * Modules/webxr/WebXRSystem.h: Export ::from and ::xr methods. * WebCore.xcodeproj/project.pbxproj: Ditto. * bindings/js/WebCoreBuiltinNames.h: Added some new macros. * testing/FakeXRBoundsPoint.h: Added. * testing/FakeXRBoundsPoint.idl: Added. * testing/FakeXRButtonStateInit.h: Added. * testing/FakeXRButtonStateInit.idl: Added. * testing/FakeXRInputSourceInit.h: Added. * testing/FakeXRInputSourceInit.idl: Added. * testing/FakeXRRigidTransformInit.h: Added. * testing/FakeXRRigidTransformInit.idl: Added. * testing/FakeXRViewInit.h: Added. * testing/FakeXRViewInit.idl: Added. * testing/Internals.cpp: (WebCore::Internals::xrTest): Added WebXRTest to Internals. * testing/Internals.h: Added xrTest() accessor. * testing/Internals.idl: Added xrTest attribute. * testing/WebFakeXRDevice.cpp: Added. (WebCore::WebFakeXRDevice::setViews): (WebCore::WebFakeXRDevice::disconnect): (WebCore::WebFakeXRDevice::setViewerOrigin): (WebCore::WebFakeXRDevice::clearViewerOrigin): (WebCore::WebFakeXRDevice::simulateVisibilityChange): (WebCore::WebFakeXRDevice::setBoundsGeometry): (WebCore::WebFakeXRDevice::setFloorOrigin): (WebCore::WebFakeXRDevice::clearFloorOrigin): (WebCore::WebFakeXRDevice::simulateResetPose): (WebCore::WebFakeXRDevice::simulateInputSourceConnection): * testing/WebFakeXRDevice.h: Added. * testing/WebFakeXRDevice.idl: Added. * testing/WebFakeXRInputController.cpp: Added. (WebCore::WebFakeXRInputController::setHandedness): (WebCore::WebFakeXRInputController::setTargetRayMode): (WebCore::WebFakeXRInputController::setProfiles): (WebCore::WebFakeXRInputController::setGripOrigin): (WebCore::WebFakeXRInputController::clearGripOrigin): (WebCore::WebFakeXRInputController::setPointerOrigin): (WebCore::WebFakeXRInputController::disconnect): (WebCore::WebFakeXRInputController::reconnect): (WebCore::WebFakeXRInputController::startSelection): (WebCore::WebFakeXRInputController::endSelection): (WebCore::WebFakeXRInputController::simulateSelect): (WebCore::WebFakeXRInputController::setSupportedButtons): (WebCore::WebFakeXRInputController::updateButtonState): * testing/WebFakeXRInputController.h: Added. * testing/WebFakeXRInputController.idl: Added. * testing/WebXRTest.cpp: Added. (WebCore::WebXRTest::simulateDeviceConnection const): (WebCore::WebXRTest::simulateUserActivation): (WebCore::WebXRTest::disconnectAllDevices): * testing/WebXRTest.h: Added. (WebCore::WebXRTest::create): * testing/WebXRTest.idl: Added. * testing/XRSimulateUserActivationFunction.h: Added. * testing/XRSimulateUserActivationFunction.idl: Ditto. 2020-04-21 Antoine Quint <graouts@apple.com> [Web Animations] Add a supporting object for Document to manage timelines https://bugs.webkit.org/show_bug.cgi?id=210817 Reviewed by Dean Jackson. Add a new DocumentTimelinesController object owned by Document to manage DocumentTimelines created for it. This simple piece of refactoring is the first step towards a coordinated "update animations and send events" procedure where all timelines are updated at once with a single microtask checkpoint instead of each timeline running one. No change in behavior, so no new tests. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::DocumentTimeline): (WebCore::DocumentTimeline::~DocumentTimeline): (WebCore::DocumentTimeline::controller const): (WebCore::DocumentTimeline::detachFromDocument): * animation/DocumentTimeline.h: * animation/DocumentTimelinesController.cpp: Added. (WebCore::DocumentTimelinesController::DocumentTimelinesController): (WebCore::DocumentTimelinesController::~DocumentTimelinesController): (WebCore::DocumentTimelinesController::addTimeline): (WebCore::DocumentTimelinesController::removeTimeline): (WebCore::DocumentTimelinesController::detachFromDocument): (WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents): * animation/DocumentTimelinesController.h: Added. * dom/Document.cpp: (WebCore::Document::commonTeardown): (WebCore::Document::ensureTimelinesController): (WebCore::Document::updateAnimationsAndSendEvents): Deleted. (WebCore::Document::addTimeline): Deleted. (WebCore::Document::removeTimeline): Deleted. * dom/Document.h: (WebCore::Document::timelinesController const): * page/Page.cpp: (WebCore::Page::updateRendering): 2020-04-21 Cathie Chen <cathiechen@igalia.com> REGRESSION (r254790): No longer get smooth scrolling on music.apple.com https://bugs.webkit.org/show_bug.cgi?id=210634 Reviewed by Darin Adler. The page uses the access of "scrollBehavior" in CSSStyleDeclaration as the support of scroll-behavior. If supported, it will use scroll-behavior. Otherwise, it will perform a JS smooth scroll. Currently, "scrollBehavior" is still available when CSSOMViewSmoothScrolling is off, only the value "smooth" is invalidated. In order to fix this, CSSStyleDeclaration will take account of CSSOMViewSmoothScrolling in Settings. This patch also tries to provide an interface which let flags in Settings can enable/disable a property. However, it is not complete, for there are some scenarios that Settings isn't accessible. By adding "settings-flag" to CSSProperties.json, it would be effective to control the property access in CSSStyleDeclaration. Tests: fast/scrolling/scroll-behavior-invalidate-if-disabled.html fast/scrolling/scroll-behavior-validate-if-enabled.html * css/CSSProperties.json: * css/CSSStyleDeclaration.cpp: (WebCore::CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName): (WebCore::CSSStyleDeclaration::namedItem): (WebCore::CSSStyleDeclaration::setNamedItem): (WebCore::CSSStyleDeclaration::supportedPropertyNames const): * css/makeprop.pl: (addProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::cssPropertyID): * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyle::collectProperties const): * inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::getSupportedCSSProperties): 2020-04-21 Yusuke Suzuki <ysuzuki@apple.com> Canonicalize JSBigInt generated by structured-cloning by calling rightTrim https://bugs.webkit.org/show_bug.cgi?id=210816 Reviewed by Keith Miller and Darin Adler. Let's assume that the serialized data is slightly different. JSBigInt's internal representation has various invariants. For example, if JSBigInt is zero, it should have zero length, and its sign should be false. But there are various ways of representing zero JSBigInt in serialization format. For example, we can set sign = true, length = 0. Current code strongly assumes that dumped data meets this JSBigInt's internal invariant. This is not good: for example, if we add a new invariant into JSBigInt, already serialized data would not meet this invariant. In this patch, we call `JSBigInt::rightTrim(VM&)` when finishing JSBigInt deserialization. This means that we canonicalize JSBigInt when finishing creation, and this makes this serialization format free from JSBigInt's internal invariants. This makes JSBigInt serialization/deserialization robust. And we also add lengthInUint64 == 0 path not to call rightTrim when it is zero. This makes deserialization robust for zero-length & signed corrupted JSBigInt zero. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpBigInt32Data): (WebCore::CloneDeserializer::readBigInt): 2020-04-21 Peng Liu <peng.liu6@apple.com> platform/mac/media/audio-session-category-audio-autoplay.html is timing out https://bugs.webkit.org/show_bug.cgi?id=210826 Reviewed by Jer Noble. For WebKitLegacy, AudioSession::setCategory() needs to set the category when m_routingArbitrationClient is nullptr. This patch also fixes an error regarding setupArbitrationOngoing. * platform/audio/mac/AudioSessionMac.mm: (WebCore::AudioSession::setCategory): 2020-04-21 Peng Liu <peng.liu6@apple.com> Fix MACCATALYST build failures https://bugs.webkit.org/show_bug.cgi?id=210815 Reviewed by Tim Horton. No new tests, no functional change. * Configurations/FeatureDefines.xcconfig: * platform/ios/WebVideoFullscreenControllerAVKit.mm: 2020-04-19 Darin Adler <darin@apple.com> [Cocoa] Use createNSArray in many more places that build NSArray objects from C++ collections https://bugs.webkit.org/show_bug.cgi?id=210702 Reviewed by Alex Christensen. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityFlowToElements]): Use createNSArray. (-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]): Ditto. (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]): Deleted. Merged into the method above. * accessibility/mac/WebAccessibilityObjectWrapperBase.h: Take const references instead of references when passing Path and FloatRect. * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (convertMathPairsToNSArray): Use createNSArray. Also use arrays on the stack to create NSDictionary rather than using NSMutableDictionary. (addChildToArray): Deleted. (convertToNSArray): Uses createNSArray. Rolled addChildToArray in. (-[WebAccessibilityObjectWrapperBase convertPathToScreenSpace:]): Take const reference instead of reference. (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]): Ditto. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): Use createNSArray. * editing/cocoa/FontAttributesCocoa.mm: (WebCore::FontAttributes::createDictionary const): Ditto. * page/ios/FrameIOS.mm: (WebCore::Frame::interpretationsForCurrentRoot const): Ditto. * platform/cocoa/SearchPopupMenuCocoa.mm: (WebCore::saveRecentSearches): Ditto. * platform/cocoa/SharedBufferCocoa.mm: (WebCore::SharedBuffer::createNSDataArray const): Ditto. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense): Ditto. * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: (WebCore::CDMSessionAVContentKeySession::update): Ditto. * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): Ditto. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto. * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: (WebCore::PlatformCAAnimationCocoa::setValues): Ditto. (WebCore::PlatformCAAnimationCocoa::setKeyTimes): Ditto. (WebCore::PlatformCAAnimationCocoa::setTimingFunctions): Ditto. * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: (WebCore::PlatformCAFilters::setFiltersOnLayer): Moved almost the whole function into a call to createNSArray. Removed the default case from the switch so we get a warning if we miss any filter operation types. * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::setSublayers): Use createNSArray. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::write): Ditto. * platform/ios/PlaybackSessionInterfaceAVKit.mm: (WebCore::mediaSelectionOptions): Ditto. * platform/mac/PlatformPasteboardMac.mm: (WebCore::PlatformPasteboard::write): Ditto. * platform/mac/WebPlaybackControlsManager.mm: (mediaSelectionOptions): Ditto. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::setCookies): Ditto. * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::doUpdatePlatformRequest): Ditto. * platform/network/cocoa/WebCoreNSURLSession.h: Use the Objective-C type WebCoreNSURLSessionDataTask in the _dataTasks set rather than using CFTypeRef. * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSession dealloc]): Remove now-unneeded typecast. (-[WebCoreNSURLSession taskCompleted:]): Ditto. (-[WebCoreNSURLSession finishTasksAndInvalidate]): Use a more idiomatic form of capturing strongSelf in a lambda. (-[WebCoreNSURLSession invalidateAndCancel]): Updated the type on a local variable and removed now-unneeded typecast. (-[WebCoreNSURLSession getTasksWithCompletionHandler:]): Use RetainPtr to cut down on autorelease. Use createNSArray, taking advantage of the fact that it works on HashSet. Removed now-unneeded typecast. (-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]): Ditto. (-[WebCoreNSURLSession dataTaskWithRequest:]): Remove now-unneeded typecast. (-[WebCoreNSURLSession dataTaskWithURL:]): Ditto. 2020-04-21 Alexey Shvayka <shvaikalesh@gmail.com> The visibilitychange event should bubble https://bugs.webkit.org/show_bug.cgi?id=210829 Reviewed by Darin Adler. This change makes `visibilitychange` event bubble as per spec [1], aligning WebKit with Blink and Gecko. Also fixes broken spec link to `visibilityState` attribute. [1] https://w3c.github.io/page-visibility/#dfn-now-visible-algorithm (step 2) Test: fast/events/page-visibility-transition-test.html * dom/Document.cpp: (WebCore::Document::visibilityStateChanged): (WebCore::Document::visibilityState const): 2020-04-21 Simon Fraser <simon.fraser@apple.com> Composited layers are misplaced inside RTL overflow scroller with visible scrollbar https://bugs.webkit.org/show_bug.cgi?id=210820 Reviewed by Zalan Bujtas. RenderLayerBacking::computeParentGraphicsLayerRect() used renderBox.paddingBoxRectIncludingScrollbar() to position layers inside composited overflow scroll, but this is wrong if the RTL left-side scrollbar takes space. Fix by making some static functions that we can call from the various places that ask about box geometry, and using them. Test: compositing/scrolling/async-overflow-scrolling/position-inside-rtl-overflow.html * rendering/RenderBox.cpp: (WebCore::RenderBox::overflowClipRect const): (WebCore::RenderBox::clipRect const): (WebCore::RenderBox::overflowClipRect): Deleted. (WebCore::RenderBox::clipRect): Deleted. * rendering/RenderBox.h: (WebCore::RenderBox::overflowClipRectForChildLayers const): (WebCore::RenderBox::overflowClipRectForChildLayers): Deleted. * rendering/RenderLayerBacking.cpp: (WebCore::scrollContainerLayerBox): (WebCore::clippingLayerBox): (WebCore::overflowControlsHostLayerBox): (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const): (WebCore::RenderLayerBacking::updateGeometry): (WebCore::clipBox): Deleted. * rendering/RenderTable.cpp: (WebCore::RenderTable::overflowClipRect const): (WebCore::RenderTable::overflowClipRect): Deleted. * rendering/RenderTable.h: 2020-04-21 Simon Fraser <simon.fraser@apple.com> [Async overflow scroll] Overflow that's hidden on one axis is scrollable on that axis https://bugs.webkit.org/show_bug.cgi?id=210771 <rdar://problem/62080331> Reviewed by Tim Horton. eventCanScrollContents() should check the presence of enabled scrollbars, like ScrollAnimator::handleWheelEvent() does. Test: fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::eventCanScrollContents const): 2020-04-21 Daniel Bates <dabates@apple.com> [iOS] -_didFinishTextInteractionInTextInputContext should only zoom to reveal focused element if it changed https://bugs.webkit.org/show_bug.cgi?id=210697 <rdar://problem/60997530> Reviewed by Wenson Hsieh. For now, add a comment about the return value of setFocusedElement: it returns whether focus was blocked. If focused wasn't blocked then it will return true even if the element wasn't actually focused. For example, it will return true for non-focusable elements: <input disabled>. I was tempted to fix setFocusedElement() to return true when it actually focused the element or if the element was already focused, but I decided to defer this until I audit the callers and run some tests. * dom/Document.h: 2020-04-21 Andres Gonzalez <andresg_22@apple.com> Fix for remoteParentObject and platformWidget not being stored properly in the AXIsolatedObject attributes variant. https://bugs.webkit.org/show_bug.cgi?id=210809 Reviewed by Chris Fleizach. Adding these properties to the AXIsolatedObject attributes variant as WeakPtr<void*> fails. So they are now cached as member variables. * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): (WebCore::AXIsolatedObject::platformWidget const): * accessibility/isolatedtree/AXIsolatedObject.h: (WebCore::AXIsolatedObject::propertyValue const): Deleted. * accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm: (WebCore::AXIsolatedObject::initializePlatformProperties): (WebCore::AXIsolatedObject::remoteParentObject const): 2020-04-20 Simon Fraser <simon.fraser@apple.com> Horizontal overflow overlay scrollbar is misplaced in RTL https://bugs.webkit.org/show_bug.cgi?id=210673 <rdar://problem/61950751> Reviewed by Antti Koivisto. Code for positioning RenderLayer overflow controls (scrollbars and scroll corner) was scattered across lots of different functions, making it hard to follow, and prone to bugs. Fix by making one source of truth, overflowControlsRects(), which computes rects for the two scrollbars, the "scroll corner" (the square in the corner which shows, only for non-overlay scrollbars, when both scrollbars or the resize control is visible), and the resize control which shows when style specifies the "resize" property. Call this function in all the places that need to know about overflow control geometry. RenderLayer::hitTestResizerInFragments() is a little tricky because it wants the resize control relative to the fragment rect; achieve this by computing the position of the resizer rect relative to the border box, then shifting it into position relative to the fragment bounds (which include border). Test: compositing/overflow/rtl-scrollbar-layer-positioning.html * page/EventHandler.cpp: (WebCore::EventHandler::selectCursor): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollCornerRect const): (WebCore::RenderLayer::overflowControlsRects const): (WebCore::RenderLayer::scrollbarOffset const): (WebCore::RenderLayer::invalidateScrollbarRect): (WebCore::RenderLayer::positionOverflowControls): (WebCore::RenderLayer::overflowControlsIntersectRect const): (WebCore::RenderLayer::paintResizer): (WebCore::RenderLayer::isPointInResizeControl const): (WebCore::RenderLayer::hitTestOverflowControls): (WebCore::RenderLayer::hitTestResizerInFragments const): (WebCore::cornerStart): Deleted. (WebCore::cornerRect): Deleted. (WebCore::resizerCornerRect): Deleted. (WebCore::RenderLayer::scrollCornerAndResizerRect const): Deleted. (WebCore::RenderLayer::rectForHorizontalScrollbar const): Deleted. (WebCore::RenderLayer::rectForVerticalScrollbar const): Deleted. (WebCore::RenderLayer::verticalScrollbarStart const): Deleted. (WebCore::RenderLayer::horizontalScrollbarStart const): Deleted. * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::requiresScrollCornerLayer const): (WebCore::RenderLayerBacking::positionOverflowControlsLayers): (WebCore::RenderLayerBacking::paintContents): 2020-04-21 Sergio Villar Senin <svillar@igalia.com> Unreviewed, reverting r260432. Broke WPE build Reverted changeset: "[WebXR] Test IDLs and stubs" https://bugs.webkit.org/show_bug.cgi?id=209859 https://trac.webkit.org/changeset/260432 2020-04-21 Chris Dumez <cdumez@apple.com> REGRESSION (r256808): “A problem repeatedly occurred” when attempting to load https://bungalow.com/listings/bay-area https://bugs.webkit.org/show_bug.cgi?id=210801 <rdar://problem/61658940> Reviewed by Antti Koivisto. Even though the page uses the 'async' attribute on the mapbox-gl.js script, deferring the execution of this script gets the page into a bad state, causing it to use a lot of CPU & memory until the process crashes. Since we don't have any other evidence of breakage from r256808 yet and since r256808 was a massive PLT progression, I am opting to add a quirk to disable the async script optimization on bungalow.com for now. * dom/Document.cpp: (WebCore::Document::shouldDeferAsynchronousScriptsUntilParsingFinishes const): * page/Quirks.cpp: (WebCore::Quirks::shouldBypassAsyncScriptDeferring const): * page/Quirks.h: * platform/RegistrableDomain.h: (WebCore::RegistrableDomain::operator== const): 2020-04-16 Sergio Villar Senin <svillar@igalia.com> [WebXR] Test IDLs and stubs https://bugs.webkit.org/show_bug.cgi?id=209859 Reviewed by Dean Jackson and Youenn Fablet. WebXR testing is hard as it might involve interaction with actual devices. That's why the WebXR testing API (https://immersive-web.github.io/webxr-test-api/) was proposed. In fact, all the current WebXR tests from web-platform-tests are using that testing API. This new testing API supplements navigator.xr and is accessed through navigator.xr.test. In order not to expose the API to the web we're adding the XRTest interface to Internals instead. The mapping from internals.xrTest to navigator.xr.test happens in the WPT code. We're adding the required IDLs and very basic (mostly empty) implementations for testing methods. We're adding testing infrastructure, adding tests make no sense for this change. * CMakeLists.txt: Added new files. * DerivedSources.make: Ditto. * Modules/webxr/NavigatorWebXR.h: Export API to be used in testing code. * Modules/webxr/WebXRSystem.h: Export ::from and ::xr methods. * Sources.txt: Added new files. * WebCore.xcodeproj/project.pbxproj: Ditto. * bindings/js/WebCoreBuiltinNames.h: Added some new macros. * testing/FakeXRBoundsPoint.h: Added. * testing/FakeXRBoundsPoint.idl: Added. * testing/FakeXRButtonStateInit.h: Added. * testing/FakeXRButtonStateInit.idl: Added. * testing/FakeXRInputSourceInit.h: Added. * testing/FakeXRInputSourceInit.idl: Added. * testing/FakeXRRigidTransformInit.h: Added. * testing/FakeXRRigidTransformInit.idl: Added. * testing/FakeXRViewInit.h: Added. * testing/FakeXRViewInit.idl: Added. * testing/Internals.cpp: (WebCore::Internals::xrTest): Added WebXRTest to Internals. * testing/Internals.h: Added xrTest() accessor. * testing/Internals.idl: Added xrTest attribute. * testing/WebFakeXRDevice.cpp: Added. (WebCore::WebFakeXRDevice::setViews): (WebCore::WebFakeXRDevice::disconnect): (WebCore::WebFakeXRDevice::setViewerOrigin): (WebCore::WebFakeXRDevice::clearViewerOrigin): (WebCore::WebFakeXRDevice::simulateVisibilityChange): (WebCore::WebFakeXRDevice::setBoundsGeometry): (WebCore::WebFakeXRDevice::setFloorOrigin): (WebCore::WebFakeXRDevice::clearFloorOrigin): (WebCore::WebFakeXRDevice::simulateResetPose): (WebCore::WebFakeXRDevice::simulateInputSourceConnection): * testing/WebFakeXRDevice.h: Added. * testing/WebFakeXRDevice.idl: Added. * testing/WebFakeXRInputController.cpp: Added. (WebCore::WebFakeXRInputController::setHandedness): (WebCore::WebFakeXRInputController::setTargetRayMode): (WebCore::WebFakeXRInputController::setProfiles): (WebCore::WebFakeXRInputController::setGripOrigin): (WebCore::WebFakeXRInputController::clearGripOrigin): (WebCore::WebFakeXRInputController::setPointerOrigin): (WebCore::WebFakeXRInputController::disconnect): (WebCore::WebFakeXRInputController::reconnect): (WebCore::WebFakeXRInputController::startSelection): (WebCore::WebFakeXRInputController::endSelection): (WebCore::WebFakeXRInputController::simulateSelect): (WebCore::WebFakeXRInputController::setSupportedButtons): (WebCore::WebFakeXRInputController::updateButtonState): * testing/WebFakeXRInputController.h: Added. * testing/WebFakeXRInputController.idl: Added. * testing/WebXRTest.cpp: Added. (WebCore::WebXRTest::simulateDeviceConnection const): (WebCore::WebXRTest::simulateUserActivation): (WebCore::WebXRTest::disconnectAllDevices): * testing/WebXRTest.h: Added. (WebCore::WebXRTest::create): * testing/WebXRTest.idl: Added. * testing/XRSimulateUserActivationFunction.h: Added. * testing/XRSimulateUserActivationFunction.idl: Ditto. 2020-04-21 Claudio Saavedra <csaavedra@igalia.com> [GTK4] Adapt to GtkIconTheme API changes https://bugs.webkit.org/show_bug.cgi?id=210745 Reviewed by Adrian Perez de Castro. No new tests needed. GtkIconTheme changes in GTK and since we're no longer following the theme we can drop the missing image from the icon theme, so remove now unnecessary code. * platform/graphics/gtk/ImageGtk.cpp: (WebCore::Image::loadPlatformResource): Directly load image from compiled GResource. (WebCore::loadResourceSharedBuffer): Deleted. (WebCore::loadMissingImageIconFromTheme): Deleted. 2020-04-21 Rob Buis <rbuis@igalia.com> Exit early in FrameLoader::loadURL when redirecting to another frame https://bugs.webkit.org/show_bug.cgi?id=210751 Reviewed by Geoffrey Garen. Exit early in FrameLoader::loadURL when redirecting to another frame, previously we were preparing request needlessly, doing it twice in case of frame redirecting. Also move some variables to where they are actually used. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): * loader/FrameLoader.h: 2020-04-21 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Remove PlatformMouseEventGtk https://bugs.webkit.org/show_bug.cgi?id=210743 Reviewed by Adrian Perez de Castro. It's unused, we no longer create PlatformMouseEvent from a GdkEvent since WebKit2. * SourcesGTK.txt: * platform/PlatformMouseEvent.h: * platform/gtk/PlatformMouseEventGtk.cpp: Removed. 2020-04-21 Claudio Saavedra <csaavedra@igalia.com> [GTK4] Fix platform GDK includes https://bugs.webkit.org/show_bug.cgi?id=210746 Reviewed by Carlos Garcia Campos. * platform/graphics/PlatformDisplay.cpp: Wayland, X11, etc. platform includes changed path, so update accordingly. 2020-04-21 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes late February 2020 edition https://bugs.webkit.org/show_bug.cgi?id=210767 Unreviewed build fix. No new tests needed. * css/MediaQueryListEvent.cpp: Add missing wtf/IsoMallocInlines.h header. * css/MediaQueryMatcher.cpp: Add missing MediaQueryListEvent.h header. * platform/graphics/FloatQuad.cpp: Add missing wtf/text/TextStream.h header. 2020-04-20 Ross Kirsling <ross.kirsling@sony.com> Classes marked final should not use protected access specifier https://bugs.webkit.org/show_bug.cgi?id=210775 Reviewed by Daniel Bates. * Modules/applepay/ApplePayPaymentMethodSelectedEvent.h: * Modules/applepay/ApplePayValidateMerchantEvent.h: * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h: * Modules/webaudio/BiquadDSPKernel.h: * Modules/webaudio/WaveShaperDSPKernel.h: * Modules/websockets/WebSocketChannel.h: * Modules/websockets/WorkerThreadableWebSocketChannel.h: * Modules/webxr/WebXRSession.h: * Modules/webxr/WebXRSystem.h: * accessibility/AccessibilityARIAGridCell.h: * accessibility/AccessibleSetValueEvent.h: * animation/CSSAnimation.h: * bindings/js/ReadableStream.h: * bridge/objc/objc_runtime.h: * bridge/runtime_array.h: * css/CSSImageSetValue.h: * html/HTMLKeygenElement.cpp: * html/canvas/WebGLBuffer.h: * html/canvas/WebGLFramebuffer.h: * html/canvas/WebGLProgram.h: * html/canvas/WebGLQuery.h: * html/canvas/WebGLRenderbuffer.h: * html/canvas/WebGLSampler.h: * html/canvas/WebGLSync.h: * html/canvas/WebGLTransformFeedback.h: * html/canvas/WebGLUniformLocation.h: * html/shadow/TextControlInnerElements.h: * inspector/InspectorStyleSheet.h: * inspector/WebInjectedScriptManager.h: * loader/cache/CachedCSSStyleSheet.h: * page/Frame.h: * page/FrameView.h: * page/PageConsoleClient.h: * page/animation/KeyframeAnimation.h: * page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.h: * platform/audio/AudioBus.h: * platform/cocoa/PlaybackSessionModelMediaElement.h: * platform/graphics/BitmapImage.h: * platform/graphics/CrossfadeGeneratedImage.h: * platform/graphics/NamedImageGeneratedImage.h: * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h: * platform/graphics/ca/win/PlatformCAAnimationWin.h: * platform/graphics/cg/ImageDecoderCG.h: * platform/graphics/iso/ISOOriginalFormatBox.h: * platform/graphics/iso/ISOProtectionSchemeInfoBox.h: * platform/graphics/iso/ISOSchemeInformationBox.h: * platform/graphics/iso/ISOSchemeTypeBox.h: * platform/graphics/iso/ISOTrackEncryptionBox.h: * platform/graphics/iso/ISOVTTCue.cpp: * platform/graphics/iso/ISOVTTCue.h: * platform/graphics/win/ImageDecoderDirect2D.h: * platform/mediastream/mac/AVCaptureDeviceManager.h: * platform/mock/mediasource/MockBox.h: * platform/mock/mediasource/MockSourceBufferPrivate.cpp: * rendering/RenderFullScreen.h: * rendering/RenderGrid.h: * rendering/RenderMultiColumnSet.h: * rendering/RenderRuby.h: * rendering/RenderScrollbarPart.h: * rendering/RenderScrollbarTheme.h: * rendering/RenderTableCell.h: * rendering/RenderTableSection.h: * rendering/RenderThemeIOS.h: * rendering/RenderView.h: * rendering/svg/RenderSVGResourceClipper.h: * svg/SVGTextPathElement.h: * workers/WorkerConsoleClient.h: * worklets/Worklet.h: 2020-04-20 Peng Liu <peng.liu6@apple.com> Fix build failures when video fullscreen and picture-in-picture is disabled https://bugs.webkit.org/show_bug.cgi?id=210777 Reviewed by Eric Carlson. Wrap video fullscreen and picture-in-picture related code with "#if ENABLE(VIDEO_PRESENTATION_MODE)". * Configurations/FeatureDefines.xcconfig: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity): * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h: * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm: (WebCore::VideoLayerManagerObjC::setVideoLayer): (WebCore::VideoLayerManagerObjC::requiresTextTrackRepresentation const): (WebCore::VideoLayerManagerObjC::syncTextTrackBounds): (WebCore::VideoLayerManagerObjC::setTextTrackRepresentation): 2020-04-20 Nikos Mouchtaris <nmouchtaris@apple.com> WK2 Quicklook for attachments https://bugs.webkit.org/show_bug.cgi?id=208891 Reviewed by Darin Adler. Added to HTMLAttachmentElement to have member image representing QuickLook thumbnail. Added code to render this image on both iOS and Mac. No new tests. Test will be added after additions to test infrastructure. * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::updateThumbnailRepresentation): Allow setting of thumbnail member. * html/HTMLAttachmentElement.h: * rendering/RenderThemeIOS.mm: Added rendering of image member of attachment element. (WebCore::RenderAttachmentInfo::RenderAttachmentInfo): (WebCore::paintAttachmentIcon): (WebCore::RenderThemeIOS::paintAttachment): * rendering/RenderThemeMac.mm: (WebCore::paintAttachmentIcon): 2020-04-20 Yusuke Suzuki <ysuzuki@apple.com> Add more structure-cloning tests for BigInt https://bugs.webkit.org/show_bug.cgi?id=210765 Reviewed by Mark Lam. This patch adds safe-guard for future JSC primitive extension for structure-cloning. We throw DataCloneError if we see unknown primitive value, which can happen if JSC extends primitive value. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpImmediate): (WebCore::CloneSerializer::dumpIfTerminal): 2020-04-20 Simon Fraser <simon.fraser@apple.com> Scrolling with background-attachment: fixed needs to trigger repaints https://bugs.webkit.org/show_bug.cgi?id=193893 <rdar://problem/47587017> Reviewed by Dean Jackson. When scrolling an overflow scroll which has "background-atttachment:fixed" in the content, the node will have non-empty synchronous scrolling reasons. In this case we need to send the scroll to the main thread, and trigger a repaint on scroll. If handling the wheel event on the scrolling thread determines that the scroll must be sent to the main thread, EventDispatcher::wheelEvent() does so in the callback function. To trigger the repaint, RenderLayer::scrollTo() asks the composited layers backing whether the node has synchronous scrolling reasons; this is implemented by asking the scrolling coordinator. Test: scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow-repaint.html * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::hasSynchronousScrollingReasons const): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::hasSynchronousScrollingReasons const): * page/scrolling/ScrollingStateScrollingNode.h: (WebCore::ScrollingStateScrollingNode::hasSynchronousScrollingReasons const): * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::handleWheelEvent): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged): * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent): Return SendToMainThread if this node needs to do synchronous scrolling. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollTo): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::needsRepaintOnCompositedScroll const): (WebCore::RenderLayerBacking::setRequiresOwnBackingStore): (WebCore::RenderLayerBacking::setContentsNeedDisplay): * rendering/RenderLayerBacking.h: 2020-04-20 Fujii Hironori <Hironori.Fujii@sony.com> MSVC: LayoutUnits.h(248): warning C4245: 'argument': conversion from 'const int' to 'size_t', signed/unsigned mismatch https://bugs.webkit.org/show_bug.cgi?id=210592 Reviewed by Zalan Bujtas. * layout/LayoutUnits.h: (WTF::HashTraits<WebCore::Layout::SlotPosition>::emptyValue): (WTF::HashTraits<WebCore::Layout::SlotPosition>::constructDeletedValue): (WTF::HashTraits<WebCore::Layout::SlotPosition>::isDeletedValue): Use std::numeric_limits<size_t>::max() for empty and deleted values instead of WebCore::intMinForLayoutUnit. 2020-04-20 Wenson Hsieh <wenson_hsieh@apple.com> Text manipulation sometimes fails to replace text in title elements https://bugs.webkit.org/show_bug.cgi?id=210750 <rdar://problem/61066103> Reviewed by Tim Horton and Darin Adler. Internal clients using WebKit text manipulation APIs currently fail to replace text in title and option elements in the case where text manipulation has been completed with more than one token. These are elements for which we want to replace the entire text as a single token, even if the text manipulation client ends up breaking the token into multiple chunks. To handle this case, pull the `title || option` check out into a helper function, and consult it when completing text manipulation in the case where the manipulation data lacks either start or end positions. If `canPerformTextManipulationByReplacingEntireTextContent` is true and there are multiple replacement tokens, allow ourselves to process the replacement by combining the replacement tokens into a space-separated string. Test: TextManipulation.CompleteTextManipulationShouldReplaceTextContentWithMultipleTokens * editing/TextManipulationController.cpp: (WebCore::canPerformTextManipulationByReplacingEntireTextContent): (WebCore::TextManipulationController::observeParagraphs): (WebCore::TextManipulationController::replace): 2020-04-20 Andres Gonzalez <andresg_22@apple.com> The rect for the primary screen should be retrieved on the main thread. https://bugs.webkit.org/show_bug.cgi?id=210760 Reviewed by Chris Fleizach. - Call to screenRectForPrimaryScreen is dispatched to main thread. - This value is cached since it is very unlikely to change in normal usage and this would avoid hitting the main thread repeatedly. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper primaryScreenHeight]): 2020-04-15 Sergio Villar Senin <svillar@igalia.com> [WebXR] Update WebXRSession and WebXRSystem interfaces https://bugs.webkit.org/show_bug.cgi?id=210553 Reviewed by Žan Doberšek. Update WebXRSession and WebXRSystem to the latest changes in the specs. * Modules/webxr/WebXRSession.idl: Added 3 new events. * Modules/webxr/WebXRSystem.idl: Interface name is XR not XRSystem. * bindings/js/WebCoreBuiltinNames.h: Renamed macro. * dom/EventNames.h: Added 3 new events. 2020-04-20 Chris Dumez <cdumez@apple.com> Sending beacons when Fetch KeepAlive feature is disabled crashes the WebProcess https://bugs.webkit.org/show_bug.cgi?id=210753 <rdar://problem/61896221> Reviewed by Geoffrey Garen. Test: http/wpt/beacon/beacon-legacy-code-path.html * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::setFetchAPIKeepAliveEnabled): * testing/InternalSettings.h: * testing/InternalSettings.idl: Add internal settings to disable Fetch Keep Alive for layout testing. 2020-04-20 Youenn Fablet <youenn@apple.com> MediaPlayerPrivateMediaStreamAVFObjC should start play a newly added audio track if it is playing https://bugs.webkit.org/show_bug.cgi?id=210740 Reviewed by Eric Carlson. Before the patch, MediaPlayerPrivateMediaStreamAVFObjC was not calling play on the audio renderer when the audio renderer was added after the MediaPlayerPrivateMediaStreamAVFObjC was asked to play. This patch makes it so that, on configuration of an audio track, it will be asked to play if its MediaPlayerPrivateMediaStreamAVFObjC is playing. Add internals API to be able to write a test. Test: fast/mediastream/play-newly-added-audio-track.html * html/track/AudioTrack.h: * html/track/AudioTrack.idl: * platform/graphics/AudioTrackPrivate.h: (WebCore::AudioTrackPrivate::isBackedByMediaStreamTrack const): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): * platform/mediastream/AudioTrackPrivateMediaStream.cpp: (WebCore::AudioTrackPrivateMediaStream::play): * platform/mediastream/AudioTrackPrivateMediaStream.h: (isType): * testing/Internals.cpp: (WebCore::Internals::isMockRealtimeMediaSourceCenterEnabled): (WebCore::Internals::shouldAudioTrackPlay): * testing/Internals.h: * testing/Internals.idl: 2020-04-20 Youenn Fablet <youenn@apple.com> Use a WeakHashSet to store MediaStreamPrivate observers https://bugs.webkit.org/show_bug.cgi?id=210494 Reviewed by Eric Carlson. Remove observers from the MediaStream and migrate existing client (MediaRecorder) to MediaStreamPrivate::Observer. Make use of WeakHashSet in MediaStreamPrivate to improve robustness of the code. Any time the MediaStreamPrivate tracks are modified, observers will be notified. MediaStream needs now to decide when to send an event when its MediaStreamPrivate notifies of new/deleted tracks, Modernize a bit the code to use more references. Covered by existing tests. * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::~MediaRecorder): (WebCore::MediaRecorder::handleTrackChange): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediastream/MediaStream.cpp: (WebCore::createTrackPrivateVector): (WebCore::MediaStream::MediaStream): (WebCore::MediaStream::~MediaStream): (WebCore::MediaStream::addTrack): (WebCore::MediaStream::removeTrack): (WebCore::MediaStream::getTrackById): (WebCore::MediaStream::didAddTrack): (WebCore::MediaStream::didRemoveTrack): (WebCore::MediaStream::addTrackFromPlatform): (WebCore::MediaStream::internalAddTrack): (WebCore::MediaStream::internalTakeTrack): * Modules/mediastream/MediaStream.h: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack): * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::MediaStreamPrivate): (WebCore::MediaStreamPrivate::addObserver): (WebCore::MediaStreamPrivate::removeObserver): (WebCore::MediaStreamPrivate::forEachObserver): (WebCore::MediaStreamPrivate::computeActiveState): (WebCore::MediaStreamPrivate::updateActiveState): (WebCore::MediaStreamPrivate::addTrack): (WebCore::MediaStreamPrivate::removeTrack): (WebCore::MediaStreamPrivate::trackEnded): * platform/mediastream/MediaStreamPrivate.h: * testing/Internals.cpp: (WebCore::Internals::removeMediaStreamTrack): 2020-04-19 Simon Fraser <simon.fraser@apple.com> Content disappears on CSS parallax example https://bugs.webkit.org/show_bug.cgi?id=210732 <rdar://problem/61997636> Reviewed by Darin Adler. If scrolling affects the computation of coverage rect of a TiledBacking, we plumb that expanded coverage back into TransformState which is maintained during GraphicsLayer flushing, and it's used to compute coverage rect for descendants. It's passed into TransformState::setLastPlanarSecondaryQuad(), which has to map it back into the coordinate system of the last flattening ancestor. However, TransformState::mapQuad() had a missing return and the quad mapping was wrong. The new code is now the same as TransformState::mappedPoint() (you can see where the copy/paste error came from). Test: compositing/tiling/coverage-adjustment-secondary-quad-mapping.html * platform/graphics/transforms/TransformState.cpp: (WebCore::TransformState::mapQuad const): (WebCore::TransformState::flattenWithTransform): 2020-04-20 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add support for border-collapse: collapse. https://bugs.webkit.org/show_bug.cgi?id=210747 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-flex-width-border-collapse.html * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::ensureTableGrid): 2020-04-20 Wenson Hsieh <wenson_hsieh@apple.com> Oversized caret and selection rects in text fields on ganji.com and netflix.com/login https://bugs.webkit.org/show_bug.cgi?id=210622 <rdar://problem/45945636> Reviewed by Darin Adler. Currently, selection and caret rects in text fields on some web pages can be excessively tall. This patch makes a small adjustment to allow the top of the caret or selection rect to snap to the top of the inline box instead of being at the end of the previous line, in the case where there is no previous inline box. In the case where we compute the caret rect for an empty renderer (i.e. no children), we make an additional tweak so that the caret rect's height is based on the computed font height instead of line height, and then we ensure that the caret is (logically) vertically centered. See below for more details. Test: editing/selection/selection-and-caret-do-not-extend-to-line-height.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::positionForPointWithInlineChildren): Specify ForHitTesting::Yes when asking for selectionTop(). * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::localCaretRectForEmptyElement): Use FontMetric's height when computing the height of the caret rect, and then center it vertically in the renderer. * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::positionForPoint): Specify ForHitTesting::Yes when asking for selectionTop(). See below for more information. * rendering/RenderTextLineBoxes.cpp: (WebCore::RenderTextLineBoxes::positionForPoint const): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::selectionTop const): When computing selectionTop(), we currently fall back to using the top of the containing RenderBlockFlow (`blockFlow().borderAndPaddingBefore()`) in the case where there is no previous root box. However, this can lead to selection and caret rects being taller than expected; instead, we can use the max of the `selectionTop` (that is, the top of the line box, adjusted for annotations) and the top of the RenderBlockFlow. This has the effect of allowing the caret and selection to visually snap to the top of a run of text, provided there is not already a line of text that precedes it. Taking the maximum of the two values ensures that we don't unintentionally make the selection or caret rects even larger, if the line top is above the top of the block. Note that we also avoid shrinking the selection and caret rects when hit-testing renderers for positions and ranges. This allows users to still click and drag to select text in the extra line-height area above a piece of text, even if the selection is only painted over the text (and not in the region containing the line-height). This behavior was established in the fix for webkit.org/b/14911, and is covered by the layout test `editing/selection/inline-closest-leaf-child.html`. * rendering/RootInlineBox.h: 2020-04-20 Darin Adler <darin@apple.com> Use #import instead of #include in Objective-C and don't use #pragma once https://bugs.webkit.org/show_bug.cgi?id=210724 Reviewed by David Kilzer. * page/cocoa/SettingsBaseCocoa.mm: (WebCore::sansSerifTraditionalHanFontFamily): Deleted. (WebCore::sansSerifSimplifiedHanFontFamily): Deleted. (WebCore::SettingsBase::initializeDefaultFontFamilies): Just use font name strings directly since there are no conditionals any more. * Modules/applepay/PaymentRequestValidator.mm: * Modules/applepay/cocoa/PaymentContactCocoa.mm: * accessibility/ios/WebAccessibilityObjectWrapperIOS.h: * accessibility/mac/AXObjectCacheMac.mm: * accessibility/mac/WebAccessibilityObjectWrapperBase.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.h: * bridge/objc/WebScriptObjectPrivate.h: * bridge/objc/objc_class.mm: * bridge/testbindings.mm: * crypto/mac/SerializedCryptoKeyWrapMac.mm: * editing/cocoa/WebArchiveResourceFromNSAttributedString.h: * editing/cocoa/WebArchiveResourceWebResourceHandler.h: * editing/cocoa/WebContentReaderCocoa.mm: * history/mac/HistoryItemMac.mm: * loader/cocoa/DiskCacheMonitorCocoa.mm: * loader/cocoa/SubresourceLoaderCocoa.mm: * loader/mac/ResourceLoaderMac.mm: * page/cocoa/MemoryReleaseCocoa.mm: * page/cocoa/ResourceUsageOverlayCocoa.mm: * page/cocoa/ResourceUsageThreadCocoa.mm: * page/ios/WebEventRegion.h: * page/mac/ChromeMac.mm: * page/mac/EventHandlerMac.mm: * page/mac/WheelEventDeltaFilterMac.mm: * page/scrolling/cocoa/ScrollingStateNode.mm: * page/scrolling/mac/ScrollingCoordinatorMac.mm: * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm: * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm: * page/scrolling/mac/ScrollingThreadMac.mm: * page/scrolling/mac/ScrollingTreeMac.mm: * platform/audio/cocoa/MediaSessionManagerCocoa.mm: * platform/audio/mac/AudioSampleDataSource.mm: * platform/cocoa/DataDetectorsCoreSoftLink.mm: * platform/cocoa/PasteboardCocoa.mm: * platform/cocoa/ScrollSnapAnimatorState.mm: * platform/cocoa/SystemVersion.mm: * platform/gamepad/cocoa/GameControllerGamepad.mm: * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm: * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: * platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: * platform/graphics/ca/cocoa/WebSystemBackdropLayer.h: * platform/graphics/ca/cocoa/WebTiledBackingLayer.h: * platform/graphics/ca/cocoa/WebVideoContainerLayer.h: * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: * platform/graphics/cocoa/IOSurfacePoolCocoa.mm: * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm: * platform/graphics/cocoa/WebGLLayer.h: * platform/graphics/cocoa/WebGLLayer.mm: * platform/graphics/cocoa/WebGPULayer.h: * platform/graphics/cocoa/WebGPULayer.mm: * platform/graphics/cv/ImageRotationSessionVT.mm: * platform/graphics/cv/ImageTransferSessionVT.mm: * platform/graphics/cv/TextureCacheCV.mm: * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: * platform/graphics/mac/ComplexTextControllerCoreText.mm: * platform/graphics/mac/FloatPointMac.mm: * platform/graphics/mac/FloatSizeMac.mm: * platform/graphics/mac/IntPointMac.mm: * platform/graphics/mac/IntSizeMac.mm: * platform/graphics/mac/WebLayer.h: * platform/graphics/mac/WebLayer.mm: * platform/ios/LegacyTileCache.mm: * platform/ios/LegacyTileGrid.mm: * platform/ios/LegacyTileGridTile.mm: * platform/ios/LegacyTileLayer.h: * platform/ios/LegacyTileLayer.mm: * platform/ios/LegacyTileLayerPool.mm: * platform/ios/LocalCurrentTraitCollection.mm: * platform/ios/LocalizedDeviceModel.mm: * platform/ios/ScrollbarThemeIOS.mm: * platform/ios/WebCoreMotionManager.h: * platform/ios/WebItemProviderPasteboard.mm: * platform/ios/WebVideoFullscreenControllerAVKit.h: * platform/mac/LocalCurrentGraphicsContext.mm: * platform/mac/LocalDefaultSystemAppearance.mm: * platform/mac/LoggingMac.mm: * platform/mac/PlatformEventFactoryMac.mm: * platform/mac/RemoteCommandListenerMac.mm: * platform/mac/ScrollAnimatorMac.mm: * platform/mac/SerializedPlatformDataCueMac.mm: * platform/mac/WebCoreFullScreenPlaceholderView.mm: * platform/mac/WebCoreFullScreenWarningView.h: * platform/mac/WebCoreFullScreenWarningView.mm: * platform/mac/WebCoreFullScreenWindow.h: * platform/mac/WebCoreObjCExtras.mm: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: * platform/mediasession/mac/MediaSessionInterruptionProviderMac.mm: * platform/mediastream/ios/AVAudioSessionCaptureDevice.mm: * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm: * platform/mediastream/mac/RealtimeVideoUtilities.mm: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: * platform/network/cocoa/CertificateInfoCocoa.mm: * platform/network/cocoa/WebCoreNSURLSession.h: * platform/network/mac/BlobDataFileReferenceMac.mm: * platform/network/mac/CredentialStorageMac.mm: * platform/network/mac/SynchronousLoaderClient.mm: * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h: * platform/text/cocoa/LocaleCocoa.mm: * testing/ServiceWorkerInternals.mm: * testing/cocoa/WebViewVisualIdentificationOverlay.h: More #import, less #pragma once. 2020-04-20 Youenn Fablet <youenn@apple.com> Safari doesn't apply frameRate limit when request stream from Camera https://bugs.webkit.org/show_bug.cgi?id=210186 <rdar://problem/61452794> Reviewed by Eric Carlson. Add support to RealtimeVideoSource to decimate the video samples based on the observed frame rate of its capture source. This allows supporting two tracks using the same capture device, one track being low frame rate and the other one high frame rate. Clean-up refactoring to make RealtimeVideoSource directly inherit from RealtimeVideoCaptureSource. Migrate size and format of frame adaptation from RealtimeVideoCaptureSource to RealtimeVideoSource. Fix mock capture source to update its frame rate when asked by applyConstraints. Tests: fast/mediastream/mediastreamtrack-video-frameRate-clone-decreasing.html fast/mediastream/mediastreamtrack-video-frameRate-clone-increasing.html fast/mediastream/mediastreamtrack-video-frameRate-decreasing.html fast/mediastream/mediastreamtrack-video-frameRate-increasing.html * platform/mediastream/RealtimeVideoCaptureSource.cpp: (WebCore::RealtimeVideoCaptureSource::dispatchMediaSampleToObservers): (WebCore::RealtimeVideoCaptureSource::clientUpdatedSizeAndFrameRate): * platform/mediastream/RealtimeVideoCaptureSource.h: (WebCore::RealtimeVideoCaptureSource::observedFrameRate const): * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::RealtimeVideoSource): (WebCore::m_source): (WebCore::RealtimeVideoSource::adaptVideoSample): (WebCore::RealtimeVideoSource::videoSampleAvailable): * platform/mediastream/RealtimeVideoSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::setFrameRateWithPreset): * testing/Internals.cpp: (WebCore::Internals::observeMediaStreamTrack): 2020-04-20 Antoine Quint <graouts@apple.com> WebAnimations API doesn't properly apply keyframe easings to transforms https://bugs.webkit.org/show_bug.cgi?id=210526 <rdar://problem/61800424> Reviewed by Antti Koivisto. GraphicsLayerCA has code that determines whether an animation can be accelerated looking at the timing function of its keyframes and excluding animations that use a steps timing function as one of its values. However, we we would fail to set the timing function on the KeyframeValue for each keyframe in the KeyframeList we create for a JS-originated animation. We now do this correctly. Test: webanimations/transform-animation-with-steps-timing-function-not-accelerated.html * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::updateBlendingKeyframes): 2020-04-20 Yusuke Suzuki <ysuzuki@apple.com> StructuredClone algorithm should be aware of BigInt https://bugs.webkit.org/show_bug.cgi?id=210728 Reviewed by Mark Lam. This patch adds structured-cloning for BigInt and BigIntObject. The logic is adding BigIntTag & BigIntObjectTag. And then we put content of BigInt with length. And deserialization reads them to reconstruct BigInt or BigIntObject. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpImmediate): (WebCore::CloneSerializer::dumpBigIntData): (WebCore::CloneSerializer::dumpBigInt32Data): (WebCore::CloneSerializer::dumpHeapBigIntData): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneDeserializer::readBigInt): (WebCore::CloneDeserializer::readTerminal): 2020-04-20 Carlos Garcia Campos <cgarcia@igalia.com> [GTK][WPE] Enable resource load statistics https://bugs.webkit.org/show_bug.cgi?id=210184 Reviewed by Žan Doberšek. * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::NetworkStorageSession::setCookiesFromDOM const): Return early if cookies are blocked and update the persistent cookies expiration if needed. (WebCore::NetworkStorageSession::deleteCookiesForHostnames): Implement this when receiving IncludeHttpOnlyCookies parameter. (WebCore::NetworkStorageSession::hasCookies const): Implement this. (WebCore::NetworkStorageSession::getRawCookies const): Honor shouldAskITP parameter. (WebCore::cookiesForSession): Ditto. (WebCore::NetworkStorageSession::cookiesForDOM const): Ditto. (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): Ditto. 2020-04-19 Simon Fraser <simon.fraser@apple.com> Use Optional<FloatQuad> in TransformState https://bugs.webkit.org/show_bug.cgi?id=144226 Reviewed by Sam Weinig. Use Optional<> instead of pointers in TransformState, make it loggable, make FloatQuad loggable. * platform/graphics/FloatQuad.cpp: (WebCore::operator<<): * platform/graphics/FloatQuad.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::flushCompositingState): (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect const): (WebCore::GraphicsLayerCA::recursiveCommitChanges): * platform/graphics/transforms/TransformState.cpp: (WebCore::TransformState::operator=): (WebCore::TransformState::mappedSecondaryQuad const): (WebCore::TransformState::setLastPlanarSecondaryQuad): (WebCore::TransformState::flattenWithTransform): (WebCore::operator<<): * platform/graphics/transforms/TransformState.h: (WebCore::TransformState::setSecondaryQuad): (WebCore::TransformState::lastPlanarSecondaryQuad const): (WebCore::TransformState::isMappingSecondaryQuad const): (WebCore::TransformState::accumulatedTransform const): 2020-04-19 Rob Buis <rbuis@igalia.com> Remove unneeded code from FrameLoader::loadURL https://bugs.webkit.org/show_bug.cgi?id=210696 Reviewed by Darin Adler. Remove unneeded code from FrameLoader::loadURL, since the only way the load type can be Reload is if loadFrameRequest set it, and the only way loadFrameRequest can set it is if cachePolicy is ReloadIgnoringCacheData, so no need to set it again in FrameLoader::loadURL. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): 2020-04-19 Brady Eidson <beidson@apple.com> Add WKScriptMessageHandler API that asynchronously responds with a promise. rdar://problem/57243492 and https://bugs.webkit.org/show_bug.cgi?id=206398 Reviewed by Andy Estes. Covered by new API tests. Updated for moving an #include into implementation files: * bindings/js/JSDOMPromiseDeferred.cpp: * bindings/js/JSDOMPromiseDeferred.h: * html/HTMLMediaElement.cpp: * page/DOMWindow.cpp: * workers/service/ServiceWorkerGlobalScope.cpp: * page/UserMessageHandler.cpp: (WebCore::UserMessageHandler::postMessage): Return a promise to be fulfilled by the API client. * page/UserMessageHandler.h: * page/UserMessageHandler.idl: * page/UserMessageHandlerDescriptor.h: 2020-04-19 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add column spanning support for flexible table width https://bugs.webkit.org/show_bug.cgi?id=210713 Reviewed by Antti Koivisto. Test: fast/layoutformattingcontext/table-flex-width-colspans.html This patch slightly changes the extra space distribution logic by using either the minimum or the maximum width as the base initial width for the columns. * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutInFlowContent): (WebCore::Layout::TableFormattingContext::computeColumnWidths): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): Deleted. * layout/tableformatting/TableFormattingContext.h: 2020-04-19 Emilio Cobos Álvarez <emilio@crisal.io> Don't use the inherited custom properties to store environment variables. https://bugs.webkit.org/show_bug.cgi?id=210707 Reviewed by Antti Koivisto. It leaks this implementation detail when enumerating the computed style. Tests: imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml.xhtml imported/w3c/web-platform-tests/css/cssom/getComputedStyle-logical-enumeration.html * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): (WebCore::resolveTokenRange): * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): 2020-04-19 Antti Koivisto <antti@apple.com> [CSS selectors] :is() / :where() should not allow pseudo-elements at parse-time https://bugs.webkit.org/show_bug.cgi?id=210701 Reviewed by Anders Carlsson. https://drafts.csswg.org/selectors/#matches: "Pseudo-elements cannot be represented by the matches-any pseudo-class; they are not valid within :is()." Test: fast/selectors/pseudo-element-in-is-where.html * css/parser/CSSSelectorParser.cpp: (WebCore::CSSSelectorParser::consumePseudo): 2020-04-19 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Take border spacing into account when distributing column spanners width. https://bugs.webkit.org/show_bug.cgi?id=210712 Reviewed by Antti Koivisto. While distributing the column spanner extra space among individual columns, the spacing between these columns (set by border-spacing) should be taken into account and subtract it from the width to distribute. <table style="border-spacing: 50px"><tr><td colspan=2>long long text</td></tr><tr><td>lo</td><td>xt</td><tr></table> [long long text] [lo] [xt] The individual columns don't require any extra space from the spanner. * layout/FormattingContext.h: (WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::operator+=): (WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::operator-=): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints): (WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): * layout/tableformatting/TableGrid.h: (WebCore::Layout::TableGrid::horizontalSpacing const): (WebCore::Layout::TableGrid::totalHorizontalSpacing const): Deleted. 2020-04-19 Emilio Cobos Álvarez <emilio@crisal.io> Fix the logic to decide whether a property is enumerated in a computed style declaration. https://bugs.webkit.org/show_bug.cgi?id=210695 Reviewed by Antti Koivisto. Fix the logic to decide whether a property is enumerated in a computed style declaration. Logical properties don't need stylebuilder code, but still should be generated. Using the specification->category for this seems a bit hacky, but unclear if it's worse than adding a new flag. Tests: fast/css/getComputedStyle/computed-style-enumeration.html imported/w3c/web-platform-tests/css/cssom/getComputedStyle-logical-enumeration.html * css/makeprop.pl: (skippedFromComputedStyle): (isLogical): (sortWithPrefixedPropertiesLast): 2020-04-18 Antti Koivisto <antti@apple.com> [CSS selectors] Support :where() pseudo class https://bugs.webkit.org/show_bug.cgi?id=210690 Reviewed by Sam Weinig. "The Specificity-adjustment pseudo-class, :where(), is a functional pseudo-class with the same syntax and functionality as :is(). Unlike :is(), neither the :where pseudo-class, nor any of its arguments contribute to the specificity of the selector—its specificity is always zero. This is useful for introducing filters in a selector while keeping the associated style declarations easy to override." https://drafts.csswg.org/selectors-4/#zero-matches In terms of implementation this is just another alias for :is() with different (always 0) specificity. Test: fast/selectors/where-specificity.html * css/CSSSelector.cpp: (WebCore::simpleSelectorSpecificityInternal): Here is where it differs from PseudoClassIs. (WebCore::CSSSelector::selectorText const): * css/CSSSelector.h: * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne const): * css/SelectorPseudoClassAndCompatibilityElementMap.in: * css/parser/CSSSelectorParser.cpp: (WebCore::isOnlyPseudoClassFunction): (WebCore::CSSSelectorParser::consumePseudo): * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::addPseudoClassType): 2020-04-18 Rob Buis <rbuis@igalia.com> Reduce parameter list of the FrameLoadRequest constructor https://bugs.webkit.org/show_bug.cgi?id=210668 Reviewed by Darin Adler. Reduce parameter list of the FrameLoadRequest constructor by instead using various setters. By choosing the most common defaults the actual number of setters to call are minimized. * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::openInNewTab): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::navigate): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::handleProvisionalLoadFailureFromContentFilter): * loader/FrameLoadRequest.cpp: (WebCore::FrameLoadRequest::FrameLoadRequest): * loader/FrameLoadRequest.h: (WebCore::FrameLoadRequest::FrameLoadRequest): (WebCore::FrameLoadRequest::disableShouldReplaceDocumentIfJavaScriptURL): * loader/FrameLoader.cpp: (WebCore::FrameLoader::changeLocation): (WebCore::FrameLoader::loadURLIntoChildFrame): * loader/NavigationScheduler.cpp: (WebCore::NavigationScheduler::scheduleLocationChange): * page/ContextMenuController.cpp: (WebCore::openNewWindow): (WebCore::ContextMenuController::contextMenuItemSelected): * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): * page/DragController.cpp: (WebCore::DragController::performDragOperation): 2020-04-18 David Kilzer <ddkilzer@apple.com> Attempt #3 to fix tvOS build Unreviewed. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback): - Use !PLATFORM(APPLETV) to comment out functions declared within ENABLE(VIDEO_PRESENTATION_MODE) from r260307 and r260308. 2020-04-18 Yusuke Suzuki <ysuzuki@apple.com> [WTF] Move DataRef.h from WebCore to WTF to utilize it in JSC https://bugs.webkit.org/show_bug.cgi?id=210689 Reviewed by Anders Carlsson. No behavior change, just moving header from WebCore to WTF. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * rendering/style/NinePieceImage.h: * rendering/style/RenderStyle.h: * rendering/style/SVGRenderStyle.h: * rendering/style/StyleRareInheritedData.cpp: * rendering/style/StyleRareInheritedData.h: * rendering/style/StyleRareNonInheritedData.h: 2020-04-18 David Kilzer <ddkilzer@apple.com> Attempt #2 to fix tvOS build Unreviewed. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: - Add #if ENABLE(VIDEO_PRESENTATION_MODE)/#endif to protect methods defined in MediaPlayerPrivate.h. - The previous commit was (r260307) also to fix tvOS, not watchOS. 2020-04-18 David Kilzer <ddkilzer@apple.com> Attempt to fix watchOS build Unreviewed. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: - Add #if ENABLE(VIDEO_PRESENTATION_MODE)/#endif to protect methods defined in MediaPlayerPrivate.h. 2020-04-17 Simon Fraser <simon.fraser@apple.com> Group overflow controls layers into a single container layer https://bugs.webkit.org/show_bug.cgi?id=210675 Reviewed by Zalan Bujtas. Overflow control layers are going to change z-order in a future change. To make this easier, group the overflow controls layer into their own container layer. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateDebugIndicators): (WebCore::RenderLayerBacking::updateGeometry): Size the overflow controls layer using paddingBoxRectIncludingScrollbar(). (WebCore::RenderLayerBacking::updateInternalHierarchy): New parenting. (WebCore::RenderLayerBacking::updateOverflowControlsLayers): Some refactoring with a nice lambda. (WebCore::RenderLayerBacking::positionOverflowControlsLayers): Lovely lambda here. Nice. * rendering/RenderLayerBacking.h: 2020-04-17 Kate Cheney <katherine_cheney@apple.com> Enable service workers for app-bound domains https://bugs.webkit.org/show_bug.cgi?id=210451 <rdar://problem/61479474> Reviewed by Brent Fulgham. SWServer now retrieves the app-bound domains from the UI Process and only continues with the load if the proper entitlement is present or the load is coming from an app-bound domain. * workers/service/server/SWServer.cpp: (WebCore::SWServer::addRegistrationFromStore): (WebCore::SWServer::SWServer): (WebCore::SWServer::validateRegistrationDomain): (WebCore::SWServer::scheduleJob): * workers/service/server/SWServer.h: 2020-04-17 Dean Jackson <dino@apple.com> [WebGL] Confirm there are no errors when setting up framebuffers https://bugs.webkit.org/show_bug.cgi?id=210632 <rdar://problem/61916680> Reviewed by Simon Fraser. We're seeing crashes on macOS inside GraphicsContextGL::reshape(). Specifically when we submit work at the end of the function via glFlush. At the moment the cause is a mystery, because we should bail out before then if the multisample renderbuffer was not complete. In the hope that it helps somewhat, add a call to glGetError to double check that there isn't anything horribly wrong before we talk to the GPU. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::WebGL2RenderingContext): If the underlying GCGL context was marked as "LOST" during initialization, skip the rest of our initialization. * html/canvas/WebGLRenderingContext.cpp: Ditto. (WebCore::WebGLRenderingContext::WebGLRenderingContext): * html/canvas/WebGLRenderingContextBase.cpp: Ditto. (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): * platform/graphics/angle/GraphicsContextGLANGLE.cpp: Check for a GL error during setup and, if there is one, skip directly into a LOST state. (WebCore::GraphicsContextGLOpenGL::reshape): * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp: (WebCore::GraphicsContextGLOpenGL::reshape): 2020-04-17 Peng Liu <peng.liu6@apple.com> Cleanup the macros for video fullscreen and picture-in-picture https://bugs.webkit.org/show_bug.cgi?id=210638 Reviewed by Eric Carlson. A follow-up patch to fix build failures of r260259. * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: * platform/ios/WebVideoFullscreenControllerAVKit.mm: 2020-04-17 David Kilzer <ddkilzer@apple.com> REGRESSION (r234105): [iOS] WKColorButton leaks a UIColor <https://webkit.org/b/210658> <rdar://problem/61938137> Reviewed by Darin Adler. * html/ColorInputType.cpp: (WebCore::ColorInputType::isKeyboardFocusable const): * page/Chrome.cpp: (WebCore::Chrome::createColorChooser): - Drive-by fix of unreachable code on PLATFORM(IOS_FAMILY). 2020-04-17 Don Olmstead <don.olmstead@sony.com> [CMake] Add WebKit::WebCore target https://bugs.webkit.org/show_bug.cgi?id=210445 Reviewed by Michael Catanzaro. Add a WebKit::WebCore target. Remove the WebCoreHeaderInterface target since the WebKit::WebCore target is functionaly the same. * CMakeLists.txt: 2020-04-17 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r260245. The tests added with this change are frequently failing on macOS bots. Reverted changeset: "Safari doesn't apply frameRate limit when request stream from Camera" https://bugs.webkit.org/show_bug.cgi?id=210186 https://trac.webkit.org/changeset/260245 2020-04-17 Per Arne Vollan <pvollan@apple.com> Unreviewed build fix. * platform/cocoa/AGXCompilerService.cpp: 2020-04-17 Antoine Quint <graouts@apple.com> Stop including style rules related to media controls in the UA style sheet when Modern Media Controls are enabled https://bugs.webkit.org/show_bug.cgi?id=210606 Reviewed by Antti Koivisto and Daniel Bates. There is no need to insert style rules related to media controls in the UA stylesheet when Modern Media Controls are enabled. There is one rule from mediaControlsApple.css for the default sizing of <audio> that makes sense broadly for content on the Web so we move that to html.css. We also set the background-color property for media documents in html.css. * Modules/mediacontrols/mediaControlsApple.css: (audio): Deleted. (body:-webkit-full-page-media): Deleted. * Modules/mediacontrols/mediaControlsiOS.css: (body:-webkit-full-page-media): Deleted. * Modules/modern-media-controls/controls/media-document.css: (:host(.media-document)): * css/html.css: (body:-webkit-full-page-media): (audio): * css/mediaControls.css: (body:-webkit-full-page-media): Deleted. * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement): 2020-04-17 Peng Liu <peng.liu6@apple.com> Cleanup the macros for video fullscreen and picture-in-picture https://bugs.webkit.org/show_bug.cgi?id=210638 Reviewed by Eric Carlson. Replace some "#if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))" and all "#if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))" with "#if ENABLE(VIDEO_PRESENTATION_MODE)". No new tests, no functional change. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaEngineWasUpdated): (WebCore::HTMLMediaElement::setVideoFullscreenStandby): * html/HTMLMediaElement.h: * html/HTMLVideoElement.cpp: * html/HTMLVideoElement.h: * platform/PictureInPictureSupport.h: * platform/cocoa/VideoFullscreenChangeObserver.h: * platform/cocoa/VideoFullscreenModel.h: * platform/cocoa/VideoFullscreenModelVideoElement.h: * platform/cocoa/VideoFullscreenModelVideoElement.mm: * platform/graphics/MediaPlayer.cpp: * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (WebCore::supportsPictureInPicture): 2020-04-17 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Resolve the minimum width for overlapping spanner columns https://bugs.webkit.org/show_bug.cgi?id=210654 Reviewed by Antti Koivisto. The extra horizontal space distribution is based on the columns' minimum widths. In case of column spanners, first we need to distribute the spanner's minimum width across the columns using the non-spanning minimum widths as the distribution ratio. When there's no non-spanning minimum width for a column (all rows have column spanners for tbis particular column) the minimum width gets distributed equally across the spanned columns. This distribution starts with the shortest columns spans so that we can use these resolved column widths to compute the wider ones. * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): 2020-04-17 Claudio Saavedra <csaavedra@igalia.com> [GTK] Update for GdkKeymap API changes https://bugs.webkit.org/show_bug.cgi?id=210642 Reviewed by Adrian Perez de Castro. No new tests needed. gdk_keymap_get_default() is deprecated in GTK+ 3.22, so use gdk_keymap_get_for_display() instead. Since in GTK4 this method is removed to gdk_display_get_keymap(), add a helper to GtkVersioning.h to avoid cluttering with ifdefs all over the place. * platform/gtk/GtkVersioning.h: (gdk_keymap_get_for_display): * platform/gtk/PlatformKeyboardEventGtk.cpp: (WebCore::PlatformKeyboardEvent::currentCapsLockState): (WebCore::PlatformKeyboardEvent::modifiersContainCapsLock): 2020-04-17 Oriol Brufau <obrufau@igalia.com> Revert "[css-grid] Exclude implicit grid tracks from the resolved value" https://bugs.webkit.org/show_bug.cgi?id=210617 Reviewed by Manuel Rego Casasnovas. Revert r254561 since it appears to be breaking site authoring tools which were relying on the previous behaviour. Tests: fast/css-grid-layout/grid-auto-columns-rows-get-set.html fast/css-grid-layout/grid-columns-rows-get-set.html fast/css-grid-layout/grid-template-shorthand-get-set.html fast/css-grid-layout/mark-as-infinitely-growable.html fast/css-grid-layout/named-grid-lines-computed-style-implicit-tracks.html fast/css-grid-layout/negative-growth-share-as-infinity-crash.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-support-flexible-lengths-001.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-support-grid-template-columns-rows-001.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-support-named-grid-lines-001.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-support-repeat-001.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-template-columns-rows-resolved-values-001.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-flexible-lengths-001.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-grid-template-columns-rows-001.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-named-grid-lines-001.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-001.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-template-columns-rows-resolved-values-001.html imported/w3c/web-platform-tests/css/css-grid/grid-layout-properties.html imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-withcontent.html imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-withcontent.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForGridTrackList): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::trackSizesForComputedStyle const): 2020-04-17 Per Arne Vollan <pvollan@apple.com> [iOS] Deny iokit open access to graphics related classes https://bugs.webkit.org/show_bug.cgi?id=210616 Reviewed by Darin Adler. Deny iokit open access to graphics related classes in the WebContent process on iOS, but issue extensions for these for some devices which still need access to them. API test: WebKit.IOKitOpenSandboxAccessForDeviceWithAGXCompilerService * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/AGXCompilerService.cpp: Added. (WebCore::setDeviceHasAGXCompilerServiceForTesting): (WebCore::deviceHasAGXCompilerService): * platform/cocoa/AGXCompilerService.h: Added. * testing/Internals.cpp: (WebCore::Internals::hasSandboxIOKitOpenAccessToClass): * testing/Internals.h: * testing/Internals.idl: * testing/Internals.mm: (WebCore::Internals::hasSandboxIOKitOpenAccessToClass): 2020-04-17 Youenn Fablet <youenn@apple.com> Safari doesn't apply frameRate limit when request stream from Camera https://bugs.webkit.org/show_bug.cgi?id=210186 <rdar://problem/61452794> Reviewed by Eric Carlson. Add support to RealtimeVideoSource to decimate the video samples based on the observed frame rate of its capture source. This allows supporting two tracks using the same capture device, one track being low frame rate and the other one high frame rate. Clean-up refactoring to make RealtimeVideoSource directly inherit from RealtimeVideoCaptureSource. Migrate size and format of frame adaptation from RealtimeVideoCaptureSource to RealtimeVideoSource. Fix mock capture source to update its frame rate when asked by applyConstraints. Tests: fast/mediastream/mediastreamtrack-video-frameRate-clone-decreasing.html fast/mediastream/mediastreamtrack-video-frameRate-clone-increasing.html fast/mediastream/mediastreamtrack-video-frameRate-decreasing.html fast/mediastream/mediastreamtrack-video-frameRate-increasing.html * platform/mediastream/RealtimeVideoCaptureSource.cpp: (WebCore::RealtimeVideoCaptureSource::dispatchMediaSampleToObservers): (WebCore::RealtimeVideoCaptureSource::clientUpdatedSizeAndFrameRate): * platform/mediastream/RealtimeVideoCaptureSource.h: (WebCore::RealtimeVideoCaptureSource::observedFrameRate const): * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::RealtimeVideoSource): (WebCore::m_source): (WebCore::RealtimeVideoSource::adaptVideoSample): (WebCore::RealtimeVideoSource::videoSampleAvailable): * platform/mediastream/RealtimeVideoSource.h: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::setFrameRateWithPreset): * testing/Internals.cpp: (WebCore::Internals::observeMediaStreamTrack): 2020-04-17 Alexey Shvayka <shvaikalesh@gmail.com> MediaQueryList should extend EventTarget https://bugs.webkit.org/show_bug.cgi?id=203288 Reviewed by Darin Adler. Initially, CSSOM View Module specification [1] had a custom callback mechanism with addListener() and removeListener(), and the callback was invoked with the associated MediaQueryList as argument. Now the normal event mechanism [2] is used instead. For backwards compatibility, addListener() and removeListener() methods are basically aliases for addEventListener() and removeEventListener(), respectively, and the "change" event masquerades as a MediaQueryList. This patch implements new event mechanism, aligning WebKit with Blink and SpiderMonkey, and also fixes a few minor spec incompatibilities: mandatory listener argument, "handleEvent" support, and listeners call order. [1]: https://www.w3.org/TR/2011/WD-cssom-view-20110804/#mediaquerylist [2]: https://www.w3.org/TR/cssom-view-1/#mediaquerylist Tests: fast/media/media-query-list-07.html web-platform-tests/css/cssom-view/MediaQueryList-addListener-handleEvent.html web-platform-tests/css/cssom-view/MediaQueryList-addListener-removeListener.html web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget.html web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget-interop.html web-platform-tests/css/cssom-view/MediaQueryListEvent.html web-platform-tests/css/cssom-view/idlharness.html web-platform-tests/css/cssom-view/matchMedia.html * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * bindings/scripts/test/JS/*: Updated. * css/MediaQueryList.cpp: (WebCore::MediaQueryList::MediaQueryList): (WebCore::MediaQueryList::create): (WebCore::MediaQueryList::~MediaQueryList): (WebCore::MediaQueryList::addListener): (WebCore::MediaQueryList::removeListener): * css/MediaQueryList.h: * css/MediaQueryList.idl: * css/MediaQueryListEvent.cpp: Added. (WebCore::MediaQueryListEvent::MediaQueryListEvent): * css/MediaQueryListEvent.h: Added. * css/MediaQueryListEvent.idl: Added. * css/MediaQueryListListener.h: Removed. * css/MediaQueryListListener.idl: Removed. * css/MediaQueryMatcher.cpp: (WebCore::MediaQueryMatcher::documentDestroyed): (WebCore::MediaQueryMatcher::addMediaQueryList): (WebCore::MediaQueryMatcher::removeMediaQueryList): (WebCore::MediaQueryMatcher::matchMedia): (WebCore::MediaQueryMatcher::evaluateAll): (WebCore::MediaQueryMatcher::addListener): Deleted. (WebCore::MediaQueryMatcher::removeListener): Deleted. * css/MediaQueryMatcher.h: * dom/EventNames.in: * dom/EventTarget.h: (WebCore::EventTarget::removeEventListener): * dom/EventTargetFactory.in: 2020-04-17 Adrian Perez de Castro <aperez@igalia.com> Unreviewed build fix after r260123 No new tests needed. * platform/gtk/CursorGtk.cpp: (WebCore::createCustomCursor): Pass missing pixel buffer data pointer to gdk_memory_texture_new(). 2020-04-17 Youenn Fablet <youenn@apple.com> Make use of WeakHashSet for MediaStreamTrackPrivate and RealtimeMediaSource observers https://bugs.webkit.org/show_bug.cgi?id=210492 Reviewed by Geoffrey Garen. We are making use of WeakHashSet to improve the robustness of the code. For that purpose we use the new WeakHashSet::forEach method. No change of behavior. * Modules/mediarecorder/MediaRecorder.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::forEachObserver const): * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::forEachObserver): (WebCore::MediaStreamTrackPrivate::addObserver): (WebCore::MediaStreamTrackPrivate::removeObserver): (WebCore::MediaStreamTrackPrivate::forEachObserver const): Deleted. * platform/mediastream/MediaStreamTrackPrivate.h: (WebCore::MediaStreamTrackPrivate::hasObserver const): Deleted. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::addAudioSampleObserver): (WebCore::RealtimeMediaSource::removeAudioSampleObserver): (WebCore::RealtimeMediaSource::addObserver): (WebCore::RealtimeMediaSource::removeObserver): (WebCore::RealtimeMediaSource::forEachObserver): (WebCore::RealtimeMediaSource::notifyMutedObservers): (WebCore::RealtimeMediaSource::requestToEnd): (WebCore::RealtimeMediaSource::forEachObserver const): Deleted. (WebCore::RealtimeMediaSource::notifyMutedObservers const): Deleted. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.h: 2020-04-17 Rob Buis <rbuis@igalia.com> Move allowPlugins to FrameLoader https://bugs.webkit.org/show_bug.cgi?id=205876 Reviewed by Darin Adler. Move allowPlugins to FrameLoader to reduce pointer dereferences and lessen dependency on SubframeLoader. Also rename to arePluginsEnabled since the method is asking the Setting with the same name. * dom/DOMImplementation.cpp: (WebCore::DOMImplementation::createDocument): * html/HTMLElement.cpp: (WebCore::HTMLElement::rendererIsEverNeeded): * loader/FrameLoader.cpp: (WebCore::FrameLoader::arePluginsEnabled): * loader/FrameLoader.h: * loader/SubframeLoader.cpp: (WebCore::SubframeLoader::createJavaAppletWidget): (WebCore::SubframeLoader::allowPlugins): Deleted. * loader/SubframeLoader.h: * plugins/DOMMimeType.cpp: (WebCore::DOMMimeType::enabledPlugin const): 2020-04-17 Tomoki Imai <Tomoki.Imai@sony.com> Fix an integer overflow in WebCrypto AES-CTR Mac implementation, which may detect a false loop https://bugs.webkit.org/show_bug.cgi?id=210540 (1 << counterLength) causes an integer overflow, and the undefined behavior. The longest valid counterLength on 64 bit machine is 63, and the literal 1 is considered as 32-bit signed integer. Left shifting 1 beyond or to sign-bit is undefined behavior in C++ spec. - https://en.cppreference.com/w/cpp/language/integer_literal - https://en.cppreference.com/w/cpp/language/operator_arithmetic#Bitwise_shift_operators This issue is originally found in https://bugs.webkit.org/show_bug.cgi?id=208186#c2 Reviewed by Jiewen Tan. Test: crypto/subtle/aes-ctr-import-key-encrypt.html * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp: (WebCore::transformAES_CTR): 2020-04-16 Simon Fraser <simon.fraser@apple.com> Scrolling-tree hit-testing is off by top content inset https://bugs.webkit.org/show_bug.cgi?id=210629 <rdar://problem/61848883> Reviewed by Tim Horton. r259936 added a point conversion from the superlayer of the root content layer, to fix RTL, but this also pulled in top content inset, which we don't want. Instead, do the RTL fix by factoring in scroll origin. Test: fast/scrolling/mac/async-scroll-overflow-top-inset.html * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/mac/ScrollingTreeMac.mm: (ScrollingTreeMac::scrollingNodeForPoint): 2020-04-16 Sergio Villar Senin <svillar@igalia.com> Unreviewed build fix for non unified builds. * html/OffscreenCanvas.cpp: Added missing include. * html/canvas/CanvasRenderingContext2DBase.cpp: Ditto. * layout/tableformatting/TableFormattingContextGeometry.cpp: Ditto. * workers/WorkerAnimationController.cpp: (WebCore::WorkerAnimationController::requestAnimationFrame): Added namespace. * workers/WorkerAnimationController.h: Added missing include. 2020-04-16 Simon Fraser <simon.fraser@apple.com> A slow-starting swipe always latches on the root node https://bugs.webkit.org/show_bug.cgi?id=210618 Reviewed by Tim Horton. If the first event in a wheel event gesture had zero delta, scrolling thread logic would always latch on the root node and the rest of the gesture would scroll the document. Fix by not latching for events with zero delta. Test: scrollingcoordinator/mac/latching/zero-delta-began-should-not-latch.html * page/scrolling/ScrollingTreeLatchingController.cpp: (WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent): * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::canScrollWithWheelEvent const): (WebCore::ScrollingTreeScrollingNode::eventCanScrollContents const): (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const): Deleted. * page/scrolling/ScrollingTreeScrollingNode.h: * platform/PlatformWheelEvent.h: (WebCore::PlatformWheelEvent::shouldConsiderLatching const): FIXME comment. Ideally this would check delta() that that's too scarey at the moment. 2020-04-16 Jer Noble <jer.noble@apple.com> Unreviewed build-fix after r260182; guard call to fullscreenManager() for ports which do not ENABLE(FULLSCREEN_API). * html/MediaElementSession.cpp: (WebCore::MediaElementSession::updateMediaUsageIfChanged): 2020-04-16 Claudio Saavedra <csaavedra@igalia.com> [GTK] Deprecation-guards fixes https://bugs.webkit.org/show_bug.cgi?id=210600 Reviewed by Adrian Perez de Castro. No new tests needed. * platform/gtk/RenderThemeGadget.cpp: (WebCore::RenderThemeGadget::backgroundColor const): Add missing deprecation guards for deprecated GtkStyleContext API. * platform/gtk/ThemeGtk.cpp: (WebCore::ThemeGtk::ensurePlatformColors const): Switch to WK deprecation guards from glib ones. 2020-04-16 Jack Lee <shihchieh_lee@apple.com> ASSERTION FAILED: candidate.isCandidate() in WebCore::canonicalizeCandidate https://bugs.webkit.org/show_bug.cgi?id=130844 <rdar://59535009> Reviewed by Geoffrey Garen. Call Position::isCandidate() in PositionIterator::isCandidate so behavior of candidate search become identical in both classes. Test: editing/inserting/insert-in-br.html * dom/PositionIterator.cpp: (WebCore::PositionIterator::isCandidate const): 2020-04-16 Rob Buis <rbuis@igalia.com> Remove outdated comment from FrameLoader https://bugs.webkit.org/show_bug.cgi?id=210607 Reviewed by Darin Adler. Remove comment from FrameLoader that is not valid/important anymore because addExtraFieldsToRequest does not set the Origin header since r259036. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadDifferentDocumentItem): 2020-04-16 Chris Fleizach <cfleizach@apple.com> AX: Need method for setting selected range from NSRange https://bugs.webkit.org/show_bug.cgi?id=210593 Reviewed by Darin Adler. Allow setSelection to work outside of text controls. Test: accessibility/ios-simulator/non-textcontrol-set-selection.html * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _accessibilitySetSelectedTextRange:]): 2020-04-16 Jer Noble <jer.noble@apple.com> [macOS] Update ScreenTime as playback state changes https://bugs.webkit.org/show_bug.cgi?id=210518 <rdar://problem/61181092> Reviewed by Eric Carlson. Follow up to r260182; Pass a WeakPtr into our task queue in sessionWillEndPlayback rather than a bare pointer. * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::sessionWillEndPlayback): 2020-04-16 Said Abou-Hallawa <sabouhallawa@apple.com> Captured ThreadedScrollingTree should check its m_scrollingCoordinator before calling its methods https://bugs.webkit.org/show_bug.cgi?id=210570 Reviewed by Simon Fraser. m_scrollingCoordinator may be nullified before asynchronously calling its method scheduleUpdateScrollPositionAfterAsyncScroll(). Check if it is not null before calling this method. * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll): 2020-04-16 Zalan Bujtas <zalan@apple.com> Crash in IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded when min-size can not be resolved https://bugs.webkit.org/show_bug.cgi?id=210584 <rdar://problem/56685237> Reviewed by Manuel Rego Casasnovas. Use the initial value of 0 when the min-height can't be resolved. Test: fast/css-grid-layout/crash-when-min-height-cant-be-resolved.html * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded const): 2020-04-16 Adrian Perez de Castro <aperez@igalia.com> Non-unified build fixes mid April 2020 edition https://bugs.webkit.org/show_bug.cgi?id=210599 Unreviewed build fix. No new tests needed. * bindings/js/JSNavigatorCustom.cpp: Add missing JavaScriptCore/JSCJSValue.h header. (WebCore::JSNavigator::getUserMedia): Prefix with the JSC:: namespace where needed. * dom/ShadowRoot.cpp: Add missing WebAnimation.h header. * dom/SimpleRange.cpp: Add missing NodeTraversal.h header. * editing/RemoveNodePreservingChildrenCommand.cpp: Add missing Editing.h header. * page/MemoryRelease.cpp: Add missing JavaScriptCore/VM.h header. * page/PageConfiguration.cpp: Add missing UserContentURLPattern.h header. * page/scrolling/ScrollingTree.h: Add missing EventTrackingRegions.h header. * page/scrolling/ScrollingTreeLatchingController.cpp: Add missing Logging.h header. * page/scrolling/ScrollingTreeLatchingController.h: Add missing ScrollTypes.h header, and forward declaration for WebCore::PlatformWheelEvent. * workers/service/server/SWServerJobQueue.cpp: Add missing Logging.h header. 2020-04-16 Simon Fraser <simon.fraser@apple.com> [Async overflow scrolling] Slow-repaint overflow scroll have force their enclosing scrollers to be slow too https://bugs.webkit.org/show_bug.cgi?id=210591 Reviewed by Antti Koivisto. If an overflow:scroll has background-attachment:fixed in the contents, then both it and all its containing-block scrolling ancestors have to be slow-scrolling too, because scrolling any of them affects the local geometry of the fixed backgrounds which paint on scroll. Implement this by having the scrolling tree do a post-commit pass over the nodes with sync scrolling reasons (which we collect during the commit phase). For each slow-scrolling node, walk its ancestor chain (via proxy nodes when necessary) and mark the scrolling node ancestors with the "DescendantScrollersHaveSynchronousScrolling" reason. For testing, expose internals.scrollingTreeAsText(), which needs a bit of synchronization via waitForScrollingTreeCommit() since the commit happens on the scrolling thread. Tests: scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-nested-non-cb-overflow.html scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-nested-overflow.html scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-nested-overflow2.html * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText const): (WebCore::AsyncScrollingCoordinator::scrollingTreeAsText const): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::scrollingStateTreeAsText const): (WebCore::ScrollingCoordinator::scrollingTreeAsText const): (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText): * page/scrolling/ScrollingCoordinator.h: * page/scrolling/ScrollingCoordinatorTypes.h: * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::commitTreeState): (WebCore::ScrollingTree::updateTreeFromStateNodeRecursive): (WebCore::ScrollingTree::propagateSynchronousScrollingReasons): (WebCore::ScrollingTree::updateTreeFromStateNode): Deleted. * page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::waitForScrollingTreeCommit): * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::commitStateAfterChildren): * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::waitForScrollingTreeCommit): * page/scrolling/ThreadedScrollingTree.h: * testing/Internals.cpp: (WebCore::Internals::scrollingTreeAsText const): * testing/Internals.h: * testing/Internals.idl: 2020-04-16 Claudio Saavedra <csaavedra@igalia.com> Clean a couple of unused-parameters warnings https://bugs.webkit.org/show_bug.cgi?id=210596 Unreviewed. No new tests needed. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const): Remove a spurious UNUSED_PARAM() for an actually used parameter. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::updateSecurityDiscCharacters): 2020-04-16 Eric Carlson <eric.carlson@apple.com> [macOS] Update ScreenTime as playback state changes https://bugs.webkit.org/show_bug.cgi?id=210518 <rdar://problem/61181092> Reviewed by Jer Noble. Test: media/media-usage-state.html Pass media element state to the UI process whenever it changes. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::mediaSessionUniqueIdentifier const): * html/HTMLMediaElement.h: * html/MediaElementSession.cpp: (WebCore::MediaElementSession::MediaElementSession): (WebCore::MediaElementSession::~MediaElementSession): (WebCore::MediaElementSession::updateMediaUsageIfChanged): * html/MediaElementSession.h: * page/ChromeClient.h: (WebCore::ChromeClient::addMediaUsageManagerSession): (WebCore::ChromeClient::updateMediaUsageManagerSessionState): (WebCore::ChromeClient::removeMediaUsageManagerSession): * platform/audio/PlatformMediaSession.cpp: (WebCore::PlatformMediaSession::PlatformMediaSession): * platform/audio/PlatformMediaSession.h: (WebCore::PlatformMediaSession::updateMediaUsageIfChanged): (WebCore::PlatformMediaSession::mediaSessionIdentifier const): * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): * platform/audio/PlatformMediaSessionManager.h: (WebCore::PlatformMediaSessionManager::scheduleUpdateSessionStatus): (WebCore::PlatformMediaSessionManager::sessionDidEndRemoteScrubbing): (WebCore::PlatformMediaSessionManager::scheduleUpdateNowPlayingInfo): Deleted. * platform/audio/cocoa/MediaSessionManagerCocoa.h: * platform/audio/cocoa/MediaSessionManagerCocoa.mm: (WebCore::MediaSessionManagerCocoa::scheduleUpdateSessionStatus): (WebCore::MediaSessionManagerCocoa::sessionWillBeginPlayback): (WebCore::MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing): (WebCore::MediaSessionManagerCocoa::removeSession): (WebCore::MediaSessionManagerCocoa::sessionWillEndPlayback): (WebCore::MediaSessionManagerCocoa::clientCharacteristicsChanged): (WebCore::MediaSessionManagerCocoa::sessionCanProduceAudioChanged): (WebCore::MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo): Deleted. * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::resetRestrictions): (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): * platform/graphics/MediaUsageInfo.h: Added. (WebCore::MediaUsageInfo::operator== const): (WebCore::MediaUsageInfo::operator!= const): (WebCore::MediaUsageInfo::encode const): (WebCore::MediaUsageInfo::decode): * testing/Internals.cpp: (WebCore::Internals::setMediaElementRestrictions): (WebCore::Internals::mediaUsageState const): * testing/Internals.h: * testing/Internals.idl: 2020-04-16 Yusuke Suzuki <ysuzuki@apple.com> [JSC] Implement JSMapIterator/JSSetIterator with JSInternalFieldObjectImpl https://bugs.webkit.org/show_bug.cgi?id=210023 Reviewed by Keith Miller. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): 2020-04-16 Philippe Normand <pnormand@igalia.com> Unreviewed, fix GStreamer build warnings. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::cdmInstanceDetached): * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::handleErrorConditionFromStreamingThread): 2020-04-16 Carlos Alberto Lopez Perez <clopez@igalia.com> [GTK] MiniBrowser opens new windows too small causing failures on some WPT tests https://bugs.webkit.org/show_bug.cgi?id=210206 Reviewed by Carlos Garcia Campos. Some WPT tests (when executed with the WPT runner via WebDriver) open new browser windows via JavaScript invoking Window.open() and then run the test on this new window. The size of the new window is not specified, and we were failing to provide a default window size, so it was using the minimum of 100x100 which its just too small for some test that later call document.elementFromPoint() on some coordinates that are outside of that size. To fix that provide the size of the default GTK window to WebCore if the application sets one via gtk_window_set_default_size(). And if not, then use the size of the previous window. Also change the way we position the new window to work better when the system uses more than one monitor. Previously to get the default coordinates of the new window we were using gdk_display_get_monitor() with just the first monitor available. This causes issues in the calculation of the available space when using several monitors. Instead get the monitor in use by looking at the current GDK root window. Tests: TestWebKitAPI/WebKit2Gtk/TestUIClient:/webkit/WebKitWebView/open-window-default-size and TestWebKitAPI/WebKit2Gtk/TestUIClient:/webkit/WebKitWebView/open-window-no-default-size * loader/FrameLoader.cpp: (WebCore::createWindow): * platform/gtk/PlatformScreenGtk.cpp: (WebCore::getCurrentScreenMonitor): (WebCore::screenRect): (WebCore::screenAvailableRect): 2020-04-16 Tomoki Imai <Tomoki.Imai@sony.com> TextureMapper renders video element with "object-fit: cover" incorrectly https://bugs.webkit.org/show_bug.cgi?id=210544 Reviewed by Žan Doberšek. Propagate GraphicsLayer::contentsClippingRect information to TextureMapperLayer to properly clip the outside of DOM element when the element has "object-fit: cover". Unfortunately, the test is disabled on WebKitGTK due to bug 177536, bug 163528. Test: compositing/video/video-object-fit.html * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::CompositionLayer::flushState): * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintSelf): Clip using propagated contentsClippingRect when rendering m_contentsLayer. (WebCore::TextureMapperLayer::setContentsClippingRect): * platform/graphics/texmap/TextureMapperLayer.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::setContentsClippingRect): (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: 2020-04-15 Myles C. Maxfield <mmaxfield@apple.com> [Cocoa] Password obscuring dots drawn with the system font are too small https://bugs.webkit.org/show_bug.cgi?id=209692 <rdar://problem/60788385> Reviewed by Darin Adler. The system font's U+2022 BULLET glyph got smaller. Instead, we should match the native platform's behavior of using U+F79A. However, U+F79A is a PUA character, meaning different fonts will draw it in arbitrary different ways. Therefore, we should only use this character if we're drawing it with the system font. Otherwise, we can take the old codepath and use U+2022 BULLET. Tests: fast/text/text-security-disc-bullet-pua.html platform/mac/fast/text/text-security-disc-bullet-pua-mac.html platform/ios/fast/text/text-security-disc-bullet-pua-ios-new.html platform/ios/fast/text/text-security-disc-bullet-pua-ios-old.html * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::text const): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::constructTextRun): * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::canUseForStyle): * rendering/SimpleLineLayoutCoverage.cpp: (WebCore::SimpleLineLayout::printReason): * rendering/SimpleLineLayoutCoverage.h: * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::computeTextSecurityDiscShouldUsePUACodePoint const): * rendering/style/RenderStyle.h: 2020-04-15 Jer Noble <jer.noble@apple.com> REGRESSION (r260102): ASSERTION FAILED: m_arbitrators.contains(proxy) in WebKit::SharedArbitrator::endRoutingArbitrationForArbitrator https://bugs.webkit.org/show_bug.cgi?id=210589 <rdar://problem/61844208> Reviewed by Eric Carlson. Track whether the session successfully entered routing arbitration and only call leaveRoutingAbritration() if entering was sucessful. * platform/audio/mac/AudioSessionMac.mm: (WebCore::AudioSession::setCategory): 2020-04-15 Simon Fraser <simon.fraser@apple.com> [Async overflow scroll] background-attachment:fixed needs to disable async overflow scrolling https://bugs.webkit.org/show_bug.cgi?id=210581 Reviewed by Zalan Bujtas. Start setting synchronousScrollingReasons on overflow scrolling nodes if the scrolling would move content that has background-attachment:fixed (we can't use async scrolling there, because such content needs painting on each scroll). When style changes, we call FrameView::{add|remove}SlowRepaintObject(). That sets the "needsScrollingTreeUpdate" compositing bit on the enclosing RenderLayer (note, any RenderLayer, not necessarily a scrolling one). Setting that bit will ensure that RenderLayerCompositor does an "update backing and hierarchy" traversal, and during this traversal, if we see a layer with the bit set, scrollingTreeState.needSynchronousScrollingReasonsUpdate becomes true. At the end of the traversal this is used as a signal to call updateSynchronousScrollingNodes(). updateSynchronousScrollingNodes() needs to clear synchronousScrollingReasons on nodes that no longer need to slow-scroll, and set it on those that do. To achieve this we use the set of slow-repaint renders from FrameView, and the set of layers with scrolling nodes from RenderLayerCompositor, starting with the set of all nodes, and pruning those known to be slow. synchronousScrollingReasons are cleared on the remainder. Tests: scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow-dynamic.html scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow.html scrollingcoordinator/mac/fixed-backgrounds/fixed-background-on-overflow.html * page/FrameView.cpp: (WebCore::FrameView::addSlowRepaintObject): (WebCore::FrameView::removeSlowRepaintObject): * page/FrameView.h: * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): (WebCore::RenderLayerCompositor::updateSynchronousScrollingNodes): * rendering/RenderLayerCompositor.h: 2020-04-15 Andres Gonzalez <andresg_22@apple.com> Add logging to core accessibility. https://bugs.webkit.org/show_bug.cgi?id=210564 Reviewed by Chris Fleizach. Added AXLogger class and AXTRACE macro. Used them in AXIsolatedTree. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXLogger.cpp: Added. (WebCore::AXLogger::AXLogger): (WebCore::AXLogger::~AXLogger): * accessibility/AXLogger.h: Added. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::AXIsolatedTree): (WebCore::AXIsolatedTree::~AXIsolatedTree): (WebCore::AXIsolatedTree::create): (WebCore::AXIsolatedTree::nodeInTreeForID): (WebCore::AXIsolatedTree::treeForID): (WebCore::AXIsolatedTree::createTreeForPageID): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::treeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::objectsForIDs const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updateSubtree): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::focusedUIElement): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNode): (WebCore::AXIsolatedTree::setFocusedNode): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::appendNodeChanges): (WebCore::AXIsolatedTree::applyPendingChanges): * platform/Logging.h: 2020-04-15 Simon Fraser <simon.fraser@apple.com> Lay the groundwork for SynchronousScrollingReason on overflow nodes https://bugs.webkit.org/show_bug.cgi?id=210565 Reviewed by Tim Horton. Make setSynchronousScrollingReasons() public on ScrollingCoordinator because we're going to be calling it for overflow scrolling nodes. Call ScrollingCoordinator::slowRepaintObjectsDidChange() not just when we go between none some some slow-repaint objects, but whenever the set changes. slowRepaintObjectsDidChange() is lightweight. Minor cleanup in FrameView to avoid testing Page* nullness every time. * page/FrameView.cpp: (WebCore::FrameView::prepareForDetach): (WebCore::FrameView::isScrollSnapInProgress const): (WebCore::FrameView::usesAsyncScrolling const): (WebCore::FrameView::addSlowRepaintObject): (WebCore::FrameView::removeSlowRepaintObject): (WebCore::FrameView::addViewportConstrainedObject): (WebCore::FrameView::removeViewportConstrainedObject): (WebCore::FrameView::scrollingCoordinator const): (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling const): (WebCore::FrameView::isRubberBandInProgress const): (WebCore::FrameView::requestScrollPositionUpdate): (WebCore::FrameView::layoutOrVisualViewportChanged): (WebCore::FrameView::performPostLayoutTasks): (WebCore::FrameView::scrollableAreaSetChanged): (WebCore::FrameView::wheelEvent): (WebCore::FrameView::setScrollPinningBehavior): * page/FrameView.h: * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::slowRepaintObjectsDidChange): (WebCore::ScrollingCoordinator::synchronousScrollingReasonsForFrameView const): (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons): (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously const): (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText const): (WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange): Deleted. (WebCore::ScrollingCoordinator::synchronousScrollingReasons const): Deleted. * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::setSynchronousScrollingReasons): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBacking): 2020-04-15 Jack Lee <shihchieh_lee@apple.com> ASSERTION FAILED: !selectionToDelete.isNone() in TypingCommand::forwardDeleteKeyPressed when deleting a UserSelect::None element. https://bugs.webkit.org/show_bug.cgi?id=210530 <rdar://problem/58591480> Reviewed by Geoffrey Garen. Quit forwardDeleteKeyPressed() if FrameSelection::modify() returns empty selection. Test: editing/deleting/forward-delete-UserSelect-None-element.html * editing/TypingCommand.cpp: (WebCore::TypingCommand::forwardDeleteKeyPressed): 2020-04-15 Peng Liu <peng.liu6@apple.com> Video elements don't return to the correct position when exiting fullscreen https://bugs.webkit.org/show_bug.cgi?id=210529 Reviewed by Jer Noble. Add WEBCORE_EXPORT to the function setNeedsDOMWindowResizeEvent(). * dom/Document.h: 2020-04-15 Wenson Hsieh <wenson_hsieh@apple.com> [iPadOS] Some pages indefinitely zoom in and out due to idempotent text autosizing https://bugs.webkit.org/show_bug.cgi?id=210551 <rdar://problem/56820674> Reviewed by Tim Horton. Rename m_initialScale and initialScale() on Page to m_initialScaleIgnoringContentSize and initialScaleIgnoringContentSize(), respectively. See WebKit/ChangeLog for more details. Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-reaches-stable-state.html * page/Page.cpp: (WebCore::Page::setInitialScaleIgnoringContentSize): (WebCore::Page::setInitialScale): Deleted. * page/Page.h: (WebCore::Page::initialScaleIgnoringContentSize const): (WebCore::Page::initialScale const): Deleted. * style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::adjustmentForTextAutosizing): 2020-04-15 Chris Dumez <cdumez@apple.com> REGRESSION (r258977): Crash under Document::visibilityStateChanged https://bugs.webkit.org/show_bug.cgi?id=210555 Reviewed by Youenn Fablet. Re-introduce null check of page in Document::visibilityStateChanged() which got inadvertently dropped in r258977. * dom/Document.cpp: (WebCore::Document::visibilityStateChanged): 2020-04-15 Zalan Bujtas <zalan@apple.com> REGRESSION( r260114): [ Mac and iOS ] imported/w3c/web-platform-tests/web-animations/timing-model/timelines/document-timelines.html is failing. https://bugs.webkit.org/show_bug.cgi?id=210549 <rdar://problem/61828495> Unreviewed. Partial revert of r260114. See webkit.org/b/210559 for details. * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks): 2020-04-15 Antoine Quint <graouts@apple.com> [Web Animations] Add support for `pseudoElement` on `KeyframeEffect` and `KeyframeEffectOptions` https://bugs.webkit.org/show_bug.cgi?id=207290 <rdar://problem/59199003> Reviewed by Antti Koivisto. We add the required IDL bindings such that JS-originated Web Animations can target pseudo-elements, either via the KeyframeEffect.pseudoElement property, or via the KeyframeEffectOptions.pseudoElement property, which is set on the object passed to the KeyframeEffect constrcutor and Element.animate(). This means that a PseudoElement can be targeted by an animation even if it's not been created through style resolution by virtue of a ::before or ::after selector and a "content" style rule. This means that when either the "target" or "pseudoElement" property of KeyframeEffect is set, we ensure a PseudoElement is created and set on the host element if required. And additionally, we ensure that during style resolution, animations are applied to such pseudo-elements with a new PseudoElement::isTargetedByKeyframeEffectRequiringPseudoElement() method that indicates that a JS-originated KeyframeEffect targets this pseudo-element. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::create): Handle the new KeyframeEffectOptions.pseudoElement property in the KeyframeEffect constructor. (WebCore::KeyframeEffect::targetsPseudoElement const): Indicates whether this effect targets a pseudo-element and not a regular element or a null target. (WebCore::KeyframeEffect::targetElementOrPseudoElement const): Use the new targetsPseudoElement() method to determine whether a pseudo-element is targeted. We also remove an assertion that only made sense when m_pseudoId could only be set via a CSS-originated animation and another one when the only possible m_pseudoId values were PseudoId::Before and PseudoId::After. (WebCore::KeyframeEffect::setTarget): Call the new didChangeTargetElementOrPseudoElement() method if the provided value differs from the stored value for m_target. (WebCore::KeyframeEffect::pseudoElement const): Return the matching normalized string with a `::` prefix for m_pseudoId if the target is a pseudo-element. Note that PseudoElement::pseudoElementNameForEvents() will only return a string for "::before" and "::after" since we only know how to animate these pseudo-elements. (WebCore::KeyframeEffect::setPseudoElement): Determine a matching PseudoId, if any, for the provided string, and call the new didChangeTargetElementOrPseudoElement() method if the provided value differs from the stored value for m_pseudoId. (WebCore::KeyframeEffect::didChangeTargetElementOrPseudoElement): New method called when either m_target or m_pseudoId is changed such that we can ensure the required PseudoElement is created if the animation targets a pseudo-element. Then we run the same logic that we used to in KeyframeEffect::setTarget(). (WebCore::KeyframeEffect::requiresPseudoElement const): Indicates whether a PseudoElement must remain created for this KeyframeEffect, which is only necessary for JS-originated effects targeting a pseudo-element. * animation/KeyframeEffect.h: * animation/KeyframeEffect.idl: * animation/KeyframeEffectOptions.h: * animation/KeyframeEffectOptions.idl: * animation/KeyframeEffectStack.cpp: (WebCore::KeyframeEffectStack::requiresPseudoElement const): Indicates whether one or more JS-originated keyframe effects in the stack target the PseudoElement owning this stack. * animation/KeyframeEffectStack.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::commitStyles): Use KeyframeEffect::targetsPseudoElement() to determine whether the animation's effect's target is a pseudo-element, in which case we need to throw a NoModificationAllowedError exception. * dom/PseudoElement.cpp: (WebCore::PseudoElement::rendererIsNeeded): Return true also when one or more JS-originated keyframe effects in the stack target this pseudo-element. (WebCore::PseudoElement::isTargetedByKeyframeEffectRequiringPseudoElement): Return true when one or more JS-originated keyframe effects in the stack target this pseudo-element. * dom/PseudoElement.h: * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp: (WebCore::createContentRenderers): Remove the assertion that the "content" property was set since it's valid for this function to now be called due to JS-originated keyframe effects targeting the given pseudo-element. Instead we add an assertion that there are such keyframe effects in case no "content" property was set. (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement): Only remove pseudo-elements if there are no JS-originated keyframe effects targeting the specified pseudo-element. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolvePseudoStyle): Allow animated style resolution for pseudo-elements targeted by JS-originated keyframe effects. 2020-04-15 Carlos Garcia Campos <cgarcia@igalia.com> [GTK4] Fix use of gtk init functions https://bugs.webkit.org/show_bug.cgi?id=210550 Reviewed by Adrian Perez de Castro. Add gtk_init and gtk_init_check receiving parameters to GtkVersioning. * PlatformGTK.cmake: * platform/graphics/PlatformDisplay.cpp: * platform/gtk/GtkVersioning.h: (gtk_init): (gtk_init_check): 2020-04-15 Yusuke Suzuki <ysuzuki@apple.com> import.meta.url: baseURL for a module script should be response URL, not request URL https://bugs.webkit.org/show_bug.cgi?id=205294 Reviewed by Youenn Fablet. The module should expose response URL as `import.meta.url` instead of request URL. If redirection happens, this URL should be redirected one. * bindings/js/ScriptModuleLoader.cpp: (WebCore::ScriptModuleLoader::resolve): (WebCore::ScriptModuleLoader::responseURLFromRequestURL): (WebCore::ScriptModuleLoader::createImportMetaProperties): (WebCore::ScriptModuleLoader::notifyFinished): * bindings/js/ScriptModuleLoader.h: 2020-04-15 Jer Noble <jer.noble@apple.com> isNullFunctionPointer() can fail for symbols not explicitly marked as weakly linked. https://bugs.webkit.org/show_bug.cgi?id=210532 Reviewed by Tim Horton. Symbols whose declarations are explicitly marked as weakly imported are guaranteed to be NULL when the library containing those symbols is not available at runtime, or when the symbol itself isn't present in the version of the library which is available at runtime. For symbols which are not explicitly marked as weakly imported (because, e.g., the framework itself is weakly imported), this technique can fail. Rather than test the nullity of a random static C++ class method with isNullFunctionPointer(), explicitly mark as weak_import a utility method added by the WebKit project, which conveniently is already used from within LibWebRTCProviderCocoa, and test the nullity of that method instead. * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProvider::webRTCAvailable): 2020-04-15 Claudio Saavedra <csaavedra@igalia.com> [GTK] Make PlatformScreen::screenDPI() GTK4-ready https://bugs.webkit.org/show_bug.cgi?id=210543 Reviewed by Adrian Perez de Castro. No new tests needed. This method is using deprecated and removed APIs from GDK. Guard the removed API usage so that it's only used in GTK3 and update to use the replacement APIs otherwise. Also, make it to also use the gtk-xft-dpi GtkSettings property. This method is mostly used in response to a change in this property, so ignoring its value doesn't seem a good idea. The following priority is used: 1. (GTK3 only) query gdk_screen_get_resolution(). 2. Use the GtkSettings::gtk-xft-dpi property. 3. Calculate the actual DPI from the monitor 0's properties. 4. If none of these succeed, use the default DPI, 96. * platform/gtk/PlatformScreenGtk.cpp: (WebCore::screenDPI): 2020-04-15 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Remove IconGtk https://bugs.webkit.org/show_bug.cgi?id=210546 Reviewed by Adrian Perez de Castro. It's currently unused in GTK port since we never show an icon for file uploads. * SourcesGTK.txt: * platform/graphics/Icon.cpp: * platform/graphics/Icon.h: * platform/graphics/gtk/IconGtk.cpp: Removed. 2020-04-15 Adrian Perez de Castro <aperez@igalia.com> [GTK4] Provide an alternative to gtk_widget_{get,is}_toplevel() https://bugs.webkit.org/show_bug.cgi?id=210463 Reviewed by Carlos Garcia Campos. Adapt utility functions to GTK4, and provide replacement implementations for the gtk_widget_get_tolevel() and gtk_widget_is_toplevel() functions for GTK4 builds. No new tests needed. * platform/gtk/GtkUtilities.cpp: (WebCore::gtkWindowGetOrigin): Added. (WebCore::convertWidgetPointToScreenPoint): Move code used to find the window position into a separate function, and use it to avoid the USE(GTK4) conditional here. (WebCore::widgetIsOnscreenToplevelWindow): Adapt to make it work with GTK4. * platform/gtk/GtkVersioning.h: Added. (gtk_widget_is_toplevel): Alternative implementation for GTK4. (gtk_widget_get_toplevel): Ditto. (gtk_window_get_position): Ditto. 2020-04-15 Adrian Perez de Castro <aperez@igalia.com> [GTK4] Adapt to cursor API changes https://bugs.webkit.org/show_bug.cgi?id=210453 Reviewed by Carlos Garcia Campos. No new tests needed. * platform/gtk/CursorGtk.cpp: (WebCore::fallbackCursor): Utility function which returns the "default" cursor for GTK4. (WebCore::createNamedCursor): Adapt to the changes in the gdk_cursor_new_from_name(). (WebCore::createCustomCursor): Create a GdkTexture directly when the given Cairo surface is in one of the pixel formats supported by gdk_memory_texture_new(), otherwise convert first; then create a GdkCursor from the GdkTexture. 2020-04-14 Simon Fraser <simon.fraser@apple.com> [Async overflow scroll] Backgrounds missing on gmail sometimes https://bugs.webkit.org/show_bug.cgi?id=210506 <rdar://problem/60523869> Reviewed by Zalan Bujtas. When painting the scrolled contents layers of accelerated overflow:scroll, RenderBlock::paint() needs to not short-circuit when the dirty rect is outside a clipping rect, because accelerated overflow involves overdraw for tiles outside the visible area. There were two code paths that made this mostly work: overflowRectForPaintRejection() tested for usesCompositedScrolling(), and the #if PLATFORM(IOS_FAMILY) made it work on iOS. For content involving flexbox, overflowRectForPaintRejection() gave the wrong answer because flex layout would sometimes clear m_overflow, even on an overflow:scroll element. So remove overflowRectForPaintRejection(), and instead revert to the simple visualOverflowRect(), but first check a bit that's passed down from compositing code that indicates that we're painting the contents of composited scroll Test: compositing/scrolling/async-overflow-scrolling/mac/overflow-in-flex-empty-tiles.html * rendering/PaintPhase.h: * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paint): * rendering/RenderBox.cpp: (WebCore::RenderBox::overflowRectForPaintRejection const): Deleted. * rendering/RenderBox.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintForegroundForFragments): 2020-04-14 Zalan Bujtas <zalan@apple.com> Content expanding is broken on icourse163.org https://bugs.webkit.org/show_bug.cgi?id=210510 <rdar://problem/45951820> Reviewed by Simon Fraser. www.icourse163.org's animation code expects a decimal point in the rAF timestamp (millisecond resolution). * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks): * page/Quirks.cpp: (WebCore::Quirks::needsMillisecondResolutionForHighResTimeStamp const): * page/Quirks.h: 2020-04-14 Peng Liu <peng.liu6@apple.com> Adopt interface AVAudioRoutingArbiter for Mac https://bugs.webkit.org/show_bug.cgi?id=210167 Reviewed by Eric Carlson. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/ios/AudioSessionIOS.mm: (WebCore::AudioSession::setCategory): (WebCore::categoryName): Deleted. * platform/audio/mac/AudioSessionMac.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSessionMac.cpp. (WebCore::AudioSession::setCategory): (WebCore::AudioSession::categoryOverride const): (WebCore::AudioSession::setCategoryOverride): Fix unified build failures. * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h: 2020-04-14 Youenn Fablet <youenn@apple.com> ReadableStreamDefaultController::enqueue should check for worker terminated exception https://bugs.webkit.org/show_bug.cgi?id=210485 Reviewed by Mark Lam. Make sure to not assert in case of enqueue exception if we are in a terminating worker. This is covered by WPT fetch/api/basic/stream-response.any.worker.html and fetch/api/basic/stream-safe-creation.any.worker.html. * bindings/js/ReadableStreamDefaultController.h: (WebCore::ReadableStreamDefaultController::enqueue): 2020-04-14 Youenn Fablet <youenn@apple.com> Protect MediaStreamTrackPrivate and RealtimeMediaSource when iterating its observers https://bugs.webkit.org/show_bug.cgi?id=210488 Reviewed by Eric Carlson. Making sure explicitly that the track private and source remain alive while looping from its observers. * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::forEachObserver const): * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::forEachObserver const): 2020-04-14 James Craig <jcraig@apple.com> AX: Smart Invert doesn't handle the picture elements on foxnews.com <https://webkit.org/b/210472> Reviewed by Chris Fleizach. Tests: accessibilty/smart-invert.html accessibilty/smart-invert-reference.html Filled out more variants in the test cases, and removed the unnecessary :not() selector. * css/html.css: (@media (inverted-colors) img, picture, video): (@media (inverted-colors) img:not(picture>img), picture, video): Deleted. 2020-04-14 Wenson Hsieh <wenson_hsieh@apple.com> [iPadOS] Wikipedia articles lay out incorrectly in 1/3 multitasking window https://bugs.webkit.org/show_bug.cgi?id=210501 <rdar://problem/54856323> Reviewed by Tim Horton. In a 1/3 multitasking window, Safari currently uses the `-[WKWebView _allowsViewportShrinkToFit]` SPI to force pages to shrink down by fitting the content width to the view width. This legacy method of shrinking to fit involves laying the page out at the normal view width (320px in 1/3 multitasking), and then scaling the page down such that any amount of horizontal overflow fits within the view. In iOS 13, a new style of shrinking to fit was introduced in support of two new features: page zoom controls (accessible via the page formatting menu), and on-by-default page scaling when loading desktop sites on certain models of iPad where the page width is less than cutoffs of 1112px (in landscape) and 1024px (in portrait). This new method of shrinking to fit involves laying out at a larger width (computed from a combination of the minimum effective device width and layout size scale factor), and scaling to fit the effective layout size scale factor instead of the entire contents of the page. This means that while we may still get horizontal scrolling after shrinking to fit, the overall layout of the page is preserved. Currently, in 1/3 multitasking, Safari still relies on the former to scale pages down to fit, which means that Wikipedia articles (among other websites) do not lay out sensibly. Moreover, even if Safari adopted the second mechanism for shrinking to fit, layout issues would still exist (albeit to a lesser degree), since we'd still attempt to shrink the content width down to fit due to the fact that the desktop version of Wikipedia doesn't have a meta viewport. While we wouldn't get a broken layout, we'd still have a blank column running down the right side of the page, which is less than ideal. It's clear that in this case, attempting to shrink page content down to fit the view is suboptimal (at best, it leads to a large portion of the page being blank; at worst, it completely breaks page layout). To address this bug for now, add a parallel minimumEffectiveDeviceWidth value that takes effect when ignoring scaling constraints (i.e. when we're in a multitasking window), and scale the page down to fit this value instead of fitting the full content width when computing initial scale in `ViewportConfiguration::initialScaleFromSize`. Maintaining this value separately from m_minimumEffectiveDeviceWidth makes it much easier to ensure that the effects of this change are only ever active when the quirk is applied, and also when the view is embedded in a multitasking window. * page/Quirks.cpp: (WebCore::Quirks::shouldLayOutAtMinimumWindowWidthWhenIgnoringScalingConstraints const): Introduce a quirk to fix layout issues in multitasking mode on the desktop version of Wikipedia. * page/Quirks.h: * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::initialScaleFromSize const): (WebCore::ViewportConfiguration::setMinimumEffectiveDeviceWidth): (WebCore::ViewportConfiguration::setMinimumEffectiveDeviceWidthWhenIgnoringScalingConstraints): * page/ViewportConfiguration.h: Add a minimum effective device width value that only takes effect when ignoring scaling constraints, and update `shouldIgnoreMinimumEffectiveDeviceWidth()` and `minimumEffectiveDeviceWidth()` to not always return `true` and `0` (respectively) when ignoring scaling constraints, if m_minimumEffectiveDeviceWidthWhenIgnoringScalingConstraints is set. (WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const): (WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const): (WebCore::ViewportConfiguration::shouldShrinkToFitMinimumEffectiveDeviceWidthWhenIgnoringScalingConstraints const): 2020-04-14 Antoine Quint <graouts@apple.com> Factor PseudoElement creation calls into a single Element::ensurePseudoElement(pseudoId) method https://bugs.webkit.org/show_bug.cgi?id=210495 Reviewed by Antti Koivisto. To support webkit.org/b/207290 we need a way to ensure a PseudoElement is available for ::before and ::after pseudo-elements on a given Element. We now use a Element::ensurePseudoElement(pseudoId) method to do this and replace existing places where we would do something similar. * dom/Element.cpp: (WebCore::Element::ensurePseudoElement): * dom/Element.h: * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp: (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement): * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolvePseudoStyle): 2020-04-14 Simon Fraser <simon.fraser@apple.com> Scroll snap in subframes is often broken https://bugs.webkit.org/show_bug.cgi?id=210503 Reviewed by Darin Adler. RenderBox::findEnclosingScrollableContainer() incorrectly consulted the scrollability of the main frame, causing snapping in subframes to be broken any time the main frame was not scrollable. Test: tiled-drawing/scrolling/scroll-snap/scroll-snap-async-iframe.html * rendering/RenderBox.cpp: (WebCore::RenderBox::findEnclosingScrollableContainer const): 2020-04-14 Andres Gonzalez <andresg_22@apple.com> Make WTR::AccessibilityUIElements calls to accessibilitySetValue run on AX secondary thread. web content https://bugs.webkit.org/show_bug.cgi?id=210500 Reviewed by Chris Fleizach. Removed _accessibilitySetTestValue since it is no longer used, use _accessibilitySetValue instead. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper _accessibilitySetTestValue:forAttribute:]): Deleted. 2020-04-14 David Kilzer <ddkilzer@apple.com> Add WARN_UNUSED_RETURN to decode methods in Source/WebCore <https://webkit.org/b/210416> <rdar://problem/61693462> Reviewed by Alex Christensen. * Modules/geolocation/GeolocationPositionData.h: * Modules/indexeddb/IDBGetAllResult.h: * Modules/indexeddb/IDBGetResult.h: * Modules/indexeddb/IDBKeyData.h: * Modules/indexeddb/IDBKeyRangeData.h: * Modules/indexeddb/server/IDBSerialization.cpp: (WebCore::decodeKey): * Modules/indexeddb/shared/IDBCursorInfo.h: * Modules/indexeddb/shared/IDBCursorRecord.h: * Modules/indexeddb/shared/IDBDatabaseInfo.h: * Modules/indexeddb/shared/IDBError.h: * Modules/indexeddb/shared/IDBGetAllRecordsData.h: * Modules/indexeddb/shared/IDBGetRecordData.h: * Modules/indexeddb/shared/IDBIndexInfo.h: * Modules/indexeddb/shared/IDBIterateCursorData.h: * Modules/indexeddb/shared/IDBObjectStoreInfo.h: * Modules/indexeddb/shared/IDBRequestData.h: * Modules/indexeddb/shared/IDBResourceIdentifier.h: * Modules/indexeddb/shared/IDBTransactionInfo.h: * Modules/mediasource/SourceBuffer.cpp: (WebCore::decodeTimeComparator): * dom/EventInit.h: * dom/ExceptionData.h: * dom/SecurityPolicyViolationEvent.h: * editing/FontAttributeChanges.h: * editing/FontShadow.h: * loader/CanvasActivityRecord.h: * loader/FetchOptions.h: (WebCore::FetchOptions::decodePersistent): * platform/ContentFilterUnblockHandler.h: * platform/DragItem.h: * platform/KeyedCoding.h: * platform/LinkIcon.h: * platform/ThreadSafeDataBuffer.h: * platform/audio/mac/CAAudioStreamDescription.h: * platform/cf/KeyedDecoderCF.h: * platform/generic/KeyedDecoderGeneric.h: * platform/glib/KeyedDecoderGlib.h: * platform/graphics/Region.h: * platform/graphics/RemoteVideoSample.h: (WebCore::RemoteVideoSample::decode): * platform/mediastream/MediaConstraints.h: (WebCore::MediaConstraint::decode): (WebCore::NumericConstraint::decode): (WebCore::StringConstraint::decode): * platform/mediastream/RealtimeMediaSourceCapabilities.h: * platform/mediastream/RealtimeMediaSourceSettings.h: * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h: * platform/network/HTTPHeaderMap.h: * platform/network/NetworkLoadMetrics.h: * platform/network/ResourceRequestBase.h: * platform/network/ResourceResponseBase.h: (WebCore::ResourceResponseBase::decode): * platform/network/SameSiteInfo.h: * platform/network/SocketStreamError.h: * platform/network/curl/ResourceRequest.h: * platform/network/soup/ResourceRequest.h: * platform/network/soup/ResourceResponse.h: * rendering/EventRegion.h: * workers/service/ServiceWorkerFetchResult.h: - Add WARN_UNUSED_RETURN to all decode functions. 2020-04-14 Antoine Quint <graouts@apple.com> [Web Animations] Store an Element / PseudoId pair to define the KeyframeEffect target https://bugs.webkit.org/show_bug.cgi?id=210491 Reviewed by Antti Koivisto. In preparation for webkit.org/b/207290 where we will expose the `pseudoElement` JS API on KeyframeEffect we now use an Element / PseudoId (m_target / m_pseudoId) pair to specify an effect's target. In the cases where it matters, such as accessing the various animation collections exposed through Element and the KeyframeEffectStack, we now use the new KeyframeEffect::targetElementOrPseudoElement() method to access the Element or PseudoElement targeted with the Element / PseudoId pair. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::removeAnimation): * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::initialize): * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::transitionDidComplete): (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange): * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): (WebCore::KeyframeEffect::copyPropertiesFromSource): (WebCore::KeyframeEffect::getKeyframes): (WebCore::KeyframeEffect::forceLayoutIfNeeded): (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes): (WebCore::KeyframeEffect::animationTimelineDidChange): (WebCore::KeyframeEffect::updateEffectStackMembership): (WebCore::KeyframeEffect::targetElementOrPseudoElement const): (WebCore::KeyframeEffect::setTarget): (WebCore::KeyframeEffect::apply): (WebCore::KeyframeEffect::invalidate): (WebCore::KeyframeEffect::getAnimatedStyle): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): (WebCore::KeyframeEffect::document const): (WebCore::KeyframeEffect::renderer const): * animation/KeyframeEffect.h: * animation/KeyframeEffectStack.cpp: (WebCore::KeyframeEffectStack::addEffect): * animation/WebAnimation.cpp: (WebCore::WebAnimation::setEffectInternal): (WebCore::WebAnimation::setTimeline): (WebCore::WebAnimation::persist): * dom/Document.cpp: (WebCore::Document::matchingAnimations): * inspector/agents/InspectorAnimationAgent.cpp: (WebCore::buildObjectForKeyframes): (WebCore::InspectorAnimationAgent::requestEffectTarget): 2020-04-14 Simon Fraser <simon.fraser@apple.com> [Async overflow scroll] Custom scrollbars on gmail don't show https://bugs.webkit.org/show_bug.cgi?id=210438 <rdar://problem/61722541> Reviewed by Tim Horton. Custom scrollbars painted into the backing store of the scrolling element, but that might have become an empty "simple container layer" causing the scroll bars to not be painted anywhere. Fix by making compositing layers for custom scrollbars. This is better than giving backing store to the scroller's element, because that might be huge. Test: scrollbars/async-overflow-custom-scrollbar.html * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::requiresLayerForScrollbar const): (WebCore::RenderLayerBacking::requiresHorizontalScrollbarLayer const): (WebCore::RenderLayerBacking::requiresVerticalScrollbarLayer const): (WebCore::RenderLayerBacking::requiresScrollCornerLayer const): * rendering/RenderLayerBacking.h: 2020-04-14 Claudio Saavedra <csaavedra@igalia.com> [GTK] Adapt to GdkVisual deprecation and removal https://bugs.webkit.org/show_bug.cgi?id=210489 Reviewed by Adrian Perez de Castro. No new tests needed. Update the GdkVisual used to get the screen depth per component in GTK3 and use default values for GTK4, as visuals as an abstraction are gone from GTK4. The use in WK is very limited so there's no much gain from peeking into backend-specific values. * platform/gtk/PlatformScreenGtk.cpp: (WebCore::screenDepth): Guard GdkVisual call and leave default value for GTK4. (WebCore::screenDepthPerComponent): Update API and ditto. 2020-04-14 Carlos Garcia Campos <cgarcia@igalia.com> [GTK][WPE] Scrollbar handle has no minimum size https://bugs.webkit.org/show_bug.cgi?id=209962 Reviewed by Adrian Perez de Castro. Set a minimum thumb length. * platform/adwaita/ScrollbarThemeAdwaita.cpp: (WebCore::ScrollbarThemeAdwaita::minimumThumbLength): 2020-04-14 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] New scrollbar click behavior https://bugs.webkit.org/show_bug.cgi?id=210002 Reviewed by Adrian Perez de Castro. Use the same bahavior for mouse events when not rendering native scrollbars. * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::ScrollbarThemeGtk::handleMousePressEvent): 2020-04-14 Antti Koivisto <antti@apple.com> [CSS Selectors] Selectors Level 4 specificity calculation for pseudo classes https://bugs.webkit.org/show_bug.cgi?id=210419 Reviewed by Simon Fraser. CSS selector specification drafts at some point had a concept of "dynamic specificity" where the specificity of a selector depended on the element it matched. It was only ever used with :matches and :nth-child pseudo classes and has subsequently been removed. Selector specificity can now always be computed statically. There is a ton of code to support this obsolete feature. Remove it. https://drafts.csswg.org/selectors-4/#specificity-rules "The specificity of an :is(), :not(), or :has() pseudo-class is replaced by the specificity of the most specific complex selector in its selector list argument. Analogously, the specificity of an :nth-child() or :nth-last-child() selector is the specificity of the pseudo class itself (counting as one pseudo-class selector) plus the specificity of the most specific complex selector in its selector list argument (if any)." * css/html.css: Reorganize a :matches rule into a selector list to keep the exact specificites. It matters here to select between listbox and menulist correctly based on the 'size' and 'multiple' attributes. * css/CSSSelector.cpp: (WebCore::selectorSpecificity): (WebCore::maxSpecificity): (WebCore::simpleSelectorSpecificityInternal): (WebCore::CSSSelector::simpleSelectorSpecificity const): Also handle nth here. (WebCore::CSSSelector::specificity const): (WebCore::simpleSelectorFunctionalPseudoClassStaticSpecificity): Deleted. (WebCore::functionalPseudoClassStaticSpecificity): Deleted. (WebCore::staticSpecificityInternal): Deleted. (WebCore::CSSSelector::staticSpecificity const): Deleted. Rename to just computeSpecificity(), there is no other kind than static. * css/CSSSelector.h: * css/SelectorChecker.cpp: (WebCore::SelectorChecker::match const): (WebCore::SelectorChecker::matchHostPseudoClass const): (WebCore::SelectorChecker::matchRecursively const): (WebCore::SelectorChecker::checkOne const): (WebCore::SelectorChecker::matchSelectorList const): SelectorChecker doesn't need to deal with specificity anymore. * css/SelectorChecker.h: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::addNthChildType): (WebCore::SelectorCompiler::addPseudoClassType): (WebCore::SelectorCompiler::constructFragmentsInternal): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching): Neither does SelectorCompiler. * cssjit/SelectorCompiler.h: * dom/SelectorQuery.cpp: (WebCore::SelectorDataList::selectorMatches const): (WebCore::SelectorDataList::selectorClosest const): * inspector/InspectorStyleSheet.cpp: (WebCore::buildObjectForSelectorHelper): (WebCore::selectorsFromSource): (WebCore::InspectorStyleSheet::buildObjectForSelector): (WebCore::InspectorStyleSheet::buildObjectForSelectorList): (WebCore::InspectorStyleSheet::buildObjectForRule): (WebCore::InspectorStyleSheet::buildArrayForRuleList): (WebCore::hasDynamicSpecificity): Deleted. * inspector/InspectorStyleSheet.h: * inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::setRuleSelector): (WebCore::InspectorCSSAgent::addRule): (WebCore::InspectorCSSAgent::buildObjectForRule): (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::highlightSelector): * style/ElementRuleCollector.cpp: (WebCore::Style::ElementRuleCollector::ruleMatches): Switch to get the specificity from the selector instead of computing it during selector checking. * style/ElementRuleCollector.h: 2020-04-14 Carlos Garcia Campos <cgarcia@igalia.com> [GLIB] Fix race condition in FileMonitor implementation https://bugs.webkit.org/show_bug.cgi?id=210483 Reviewed by Adrian Perez de Castro. This is causing flaky timeouts when running resource load statistics layout tests. The problem is that we assume FileMonitor has the last reference of the platform monitor and it's deleted on g_object_unref(), but GLib keeps another reference that is released later on a different thread if the monitor is still active. We just need to ensure we cancel the monitor before calling g_object_unref(). * platform/FileMonitor.h: * platform/glib/FileMonitorGLib.cpp: (WebCore::FileMonitor::~FileMonitor): (WebCore::FileMonitor::didChange): (WebCore::FileMonitor::cancel): 2020-04-14 Charlie Turner <cturner@igalia.com> [EME][CDMProxy] Fix waitingForKey logic https://bugs.webkit.org/show_bug.cgi?id=210437 Reviewed by Xabier Rodriguez-Calvar. startedWaitingForKey() was incorrectly flagged. It needs to signal on the 0->1 transition, here it was only signalling on N->N+1 where N>0. Also break ASSERTs into separate statements, it makes it easier in a crash dump to see which conjuct fired. Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-waiting-for-a-key.https.html * platform/encryptedmedia/CDMProxy.cpp: (WebCore::CDMInstanceProxy::startedWaitingForKey): (WebCore::CDMInstanceProxy::stoppedWaitingForKey): 2020-04-14 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Bring back support for rendering scrollbars using the system appearance https://bugs.webkit.org/show_bug.cgi?id=209805 Reviewed by Michael Catanzaro. Bring back ScrollbarThemeGtk, RenderThemeGadget and RenderThemeWidget (renamed as RenderThemeScrollbar), including only the code needed to render the scrollbars. ScrollbarThemeGtk inherits from ScrollbarThemeAdwaita that is used when system appearance is disabled. * PlatformGTK.cmake: * SourcesGTK.txt: * platform/adwaita/ScrollbarThemeAdwaita.cpp: * platform/adwaita/ScrollbarThemeAdwaita.h: * platform/gtk/RenderThemeGadget.cpp: Added. (WebCore::RenderThemeGadget::create): (WebCore::createStyleContext): (WebCore::appendElementToPath): (WebCore::RenderThemeGadget::RenderThemeGadget): (WebCore::RenderThemeGadget::marginBox const): (WebCore::RenderThemeGadget::borderBox const): (WebCore::RenderThemeGadget::paddingBox const): (WebCore::RenderThemeGadget::contentsBox const): (WebCore::RenderThemeGadget::color const): (WebCore::RenderThemeGadget::backgroundColor const): (WebCore::RenderThemeGadget::opacity const): (WebCore::RenderThemeGadget::state const): (WebCore::RenderThemeGadget::setState): (WebCore::RenderThemeGadget::minimumSize const): (WebCore::RenderThemeGadget::preferredSize const): (WebCore::RenderThemeGadget::render): (WebCore::RenderThemeBoxGadget::RenderThemeBoxGadget): (WebCore::RenderThemeBoxGadget::preferredSize const): (WebCore::RenderThemeScrollbarGadget::RenderThemeScrollbarGadget): (WebCore::RenderThemeScrollbarGadget::renderStepper): * platform/gtk/RenderThemeGadget.h: Added. (WebCore::RenderThemeGadget::context const): * platform/gtk/RenderThemeScrollbar.cpp: Added. (WebCore::widgetMap): (WebCore::RenderThemeScrollbar::getOrCreate): (WebCore::RenderThemeScrollbar::clearCache): (WebCore::RenderThemeScrollbar::RenderThemeScrollbar): (WebCore::RenderThemeScrollbar::stepper): * platform/gtk/RenderThemeScrollbar.h: Added. (WebCore::RenderThemeScrollbar::scrollbar const): (WebCore::RenderThemeScrollbar::contents const): (WebCore::RenderThemeScrollbar::slider const): (WebCore::RenderThemeScrollbar::trough const): * platform/gtk/ScrollbarThemeGtk.cpp: Added. (WebCore::ScrollbarTheme::nativeTheme): (WebCore::themeChangedCallback): (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk): (WebCore::ScrollbarThemeGtk::setUseSystemAppearance): (WebCore::ScrollbarThemeGtk::themeChanged): (WebCore::ScrollbarThemeGtk::updateThemeProperties): (WebCore::ScrollbarThemeGtk::hasButtons): (WebCore::scrollbarPartStateFlags): (WebCore::widgetTypeForScrollbar): (WebCore::contentsRectangle): (WebCore::ScrollbarThemeGtk::trackRect): (WebCore::ScrollbarThemeGtk::backButtonRect): (WebCore::ScrollbarThemeGtk::forwardButtonRect): (WebCore::ScrollbarThemeGtk::paint): (WebCore::ScrollbarThemeGtk::handleMousePressEvent): (WebCore::ScrollbarThemeGtk::scrollbarThickness): (WebCore::ScrollbarThemeGtk::minimumThumbLength): * platform/gtk/ScrollbarThemeGtk.h: Added. 2020-04-14 Youenn Fablet <youenn@apple.com> Add a timer to AVVideoCaptureSource to verify reception of frames https://bugs.webkit.org/show_bug.cgi?id=210335 Reviewed by Eric Carlson. Count the number of frames being captured. Add a timer repeating every 3 seconds. Timer starts/stops based on whether the session is running/is interrupted. If the number of frames did not increase, fail the source. Manually tested. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::captureFailed): Explicitly call stop() instead of just setting m_isProducingData. This ensures we release all resources and that we may not restart capturing after captureFailed(). * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::verifyIsCapturing): (WebCore::AVVideoCaptureSource::updateVerifyCapturingTimer): (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): (WebCore::AVVideoCaptureSource::captureSessionIsRunningDidChange): 2020-04-14 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r260024. https://bugs.webkit.org/show_bug.cgi?id=210480 Regressed performance due to loss of specificity caching (Requested by anttik on #webkit). Reverted changeset: "[CSS Selectors] Selectors Level 4 specificity calculation for pseudo classes" https://bugs.webkit.org/show_bug.cgi?id=210419 https://trac.webkit.org/changeset/260024 2020-04-13 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r260052. https://bugs.webkit.org/show_bug.cgi?id=210479 Breaks iOS tests, needs more work (Requested by smfr on #webkit). Reverted changeset: "Add ENABLE_CUSTOM_SCROLLBARS and define it for macOS and for non-Cocoa platforms" https://bugs.webkit.org/show_bug.cgi?id=210460 https://trac.webkit.org/changeset/260052 2020-04-13 Adrian Perez de Castro <aperez@igalia.com> [GTK4] Use ThemeAdwaita instead of ThemeGtk https://bugs.webkit.org/show_bug.cgi?id=210334 Reviewed by Carlos Garcia Campos. No new tests needed. * platform/adwaita/ThemeAdwaita.cpp: Build the Theme::singleton() factory also with USE(GTK4). * platform/gtk/ThemeGtk.cpp: Conditionally build if !USE(GTK4). (WebCore::ThemeGtk::ensurePlatformColors const): Add deprecation ignore guards. * platform/gtk/ThemeGtk.h: Conditionally build if !USE(GTK4). 2020-04-13 Simon Fraser <simon.fraser@apple.com> [Async overflow] Get scroll-snap working with async overflow scrolling on macOS https://bugs.webkit.org/show_bug.cgi?id=210471 <rdar://problem/61643199> Reviewed by Wenson Hsieh. Obey the FIXME and move scroll-snap related code to the delegate so that it works for both frame and overflow nodes. Tests: tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-async-overflow-stateless.html tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-async-overflow.html * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren): (WebCore::convertToLayoutUnits): Deleted. * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::convertToLayoutUnits): (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode): 2020-04-13 Zalan Bujtas <zalan@apple.com> Do not cache definite height against perpendicular flex items. https://bugs.webkit.org/show_bug.cgi?id=207603 <rdar://problem/59135373> Reviewed by Simon Fraser. RenderFlexibleBox::m_hasDefiniteHeight should not be set when the child we check against is a perpendicular item because a perpendicular box's height is resolved against the containing block's width. Test: fast/flexbox/unresolved-height-percentage-crash.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild): 2020-04-13 David Kilzer <ddkilzer@apple.com> Replace use of Checked<size_t, RecordOverflow> with CheckedSize <https://webkit.org/b/210461> Reviewed by Mark Lam. * platform/audio/ios/AudioFileReaderIOS.cpp: (WebCore::createAudioBufferList): * platform/graphics/ImageBufferBackend.cpp: (WebCore::ImageBufferBackend::calculateBackendSize): * platform/graphics/win/Direct2DUtilities.cpp: (WebCore::Direct2D::createDirect2DImageSurfaceWithData): * platform/graphics/win/ImageBufferDirect2DBackend.cpp: (WebCore::ImageBufferDirect2DBackend::copyNativeImage const): 2020-04-13 Simon Fraser <simon.fraser@apple.com> Add ENABLE_CUSTOM_SCROLLBARS and define it for macOS and for non-Cocoa platforms https://bugs.webkit.org/show_bug.cgi?id=210460 Reviewed by Tim Horton. Wrap all custom scrollbar and custom scroll corner code in ENABLE(CUSTOM_SCROLLBARS). * page/FrameView.cpp: (WebCore::FrameView::createScrollbar): (WebCore::FrameView::updateScrollCorner): * page/FrameView.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::createScrollbar): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerCompositor.cpp: * rendering/RenderListBox.cpp: (WebCore::RenderListBox::createScrollbar): * rendering/RenderMenuList.cpp: (RenderMenuList::createScrollbar): * rendering/RenderObject.cpp: (WebCore::RenderObject::containingBlock const): * rendering/RenderObject.h: * rendering/RenderScrollbar.cpp: * rendering/RenderScrollbar.h: * rendering/RenderScrollbarPart.cpp: * rendering/RenderScrollbarPart.h: * rendering/RenderScrollbarTheme.cpp: * rendering/RenderScrollbarTheme.h: * rendering/RenderSearchField.cpp: (WebCore::RenderSearchField::createScrollbar): * rendering/RenderTextControlSingleLine.cpp: * style/StyleResolver.cpp: 2020-04-13 Kenneth Russell <kbr@chromium.org> Clean up more resources during WebGLLayer teardown https://bugs.webkit.org/show_bug.cgi?id=210222 Reviewed by Dean Jackson. Release OpenGL resources just before destruction of the underlying OpenGL context. * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): * platform/graphics/cocoa/WebGLLayer.h: * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer releaseGLResources]): (-[WebGLLayer dealloc]): Deleted. 2020-04-13 Noam Rosenthal <noam@webkit.org> Background images should figure into visually non empty heuristic https://bugs.webkit.org/show_bug.cgi?id=208501 Reviewed by Simon Fraser. This makes the visually non-empty heuristic treat background images the same as it treats regular images. This is in line with first contentful paint spec in paint timing: https://w3c.github.io/paint-timing/. Note that the pixel count is computed based on the image size rather than the box size, as the box size might not be known at this time. This is equivalent to the pixel reporting done for RenderImage. Border-images and masks are excluded, as per the spec. * rendering/RenderBox.cpp: (WebCore::RenderBox::imageChanged): Call incrementVisuallyNonEmptyPixelCountIfNeeded for background images * rendering/RenderElement.cpp: (WebCore::RenderElement::RenderElement): * rendering/RenderBox.cpp: (WebCore::RenderElement::incrementVisuallyNonEmptyPixelCountIfNeeded): * rendering/RenderBox.h: * rendering/RenderImage.cpp: (WebCore::RenderImage::incrementVisuallyNonEmptyPixelCountIfNeeded): Deleted. * rendering/RenderImage.h: Moved incrementVisuallyNonEmptyPixelCountIfNeeded from RenderImage to RenderElement 2020-04-13 Yusuke Suzuki <ysuzuki@apple.com> module's default cross-origin value should be "anonymous" https://bugs.webkit.org/show_bug.cgi?id=210326 Reviewed by Sam Weinig. Tests: http/tests/security/cookie-module-import-propagate.html http/tests/security/cookie-module-import.html http/tests/security/cookie-module-propagate.html http/tests/security/cookie-module.html The original spec was using "omit" crossorigin for modules when crossorigin is not set / empty. However, the spec is changed to sending requests with "same-origin" credentials ("anonymous" crossorigin mode) by default. We should follow it. * dom/ScriptElement.cpp: (WebCore::ScriptElement::requestModuleScript): * dom/ScriptElementCachedScriptFetcher.cpp: (WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const): * dom/ScriptElementCachedScriptFetcher.h: * html/parser/HTMLResourcePreloader.cpp: (WebCore::PreloadRequest::resourceRequest): * loader/cache/CachedScript.cpp: (WebCore::CachedScript::script): While this is not directly related to this patch, added new tests found that we are returning null StringView if the resource is zero byte. This totally works, but JSC::Parser has assertion that this is non-null StringView. For zero byte CachedScript resource, we should return non-null empty StringView instead. 2020-04-13 Dean Jackson <dino@apple.com> Add Apple's Reality files to AR System Preview https://bugs.webkit.org/show_bug.cgi?id=210449 <rdar://problem/61732793> Reviewed by Sam Weinig. Add support for Apples .reality AR files - both the vendor MIME Type and our UTI. These have been supported by WebKitAdditions for a while. Move them into Open Source. * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::systemPreviewMIMETypes): * platform/network/mac/UTIUtilities.mm: (WebCore::UTIFromUnknownMIMEType): 2020-04-13 Per Arne Vollan <pvollan@apple.com> [iOS] Remove unused UTType swizzler code https://bugs.webkit.org/show_bug.cgi?id=210435 Unreviewed rollout of r258120. * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/UTTypeRecordSwizzler.h: Removed. * platform/cocoa/UTTypeRecordSwizzler.mm: Removed. 2020-04-13 Commit Queue <commit-queue@webkit.org> Unreviewed, reverting r260003. https://bugs.webkit.org/show_bug.cgi?id=210441 Avoid using basic-authentication for tests (Requested by yusukesuzuki on #webkit). Reverted changeset: "module's default cross-origin value should be "anonymous"" https://bugs.webkit.org/show_bug.cgi?id=210326 https://trac.webkit.org/changeset/260003 2020-04-13 Antti Koivisto <antti@apple.com> [CSS Selectors] Selectors Level 4 specificity calculation for pseudo classes https://bugs.webkit.org/show_bug.cgi?id=210419 Reviewed by Simon Fraser. CSS selector specification drafts at some point had a concept of "dynamic specificity" where the specificity of a selector depended on the element it matched. It was only ever used with :matches and :nth-child pseudo classes and has subsequently been removed. Selector specificity can now always be computed statically. There is a ton of code to support this obsolete feature. Remove it. https://drafts.csswg.org/selectors-4/#specificity-rules "The specificity of an :is(), :not(), or :has() pseudo-class is replaced by the specificity of the most specific complex selector in its selector list argument. Analogously, the specificity of an :nth-child() or :nth-last-child() selector is the specificity of the pseudo class itself (counting as one pseudo-class selector) plus the specificity of the most specific complex selector in its selector list argument (if any)." * css/html.css: Reorganize a :matches rule into a selector list to keep the exact specificites. It matters here to select between listbox and menulist correctly based on the 'size' and 'multiple' attributes. * css/CSSSelector.cpp: (WebCore::selectorSpecificity): (WebCore::maxSpecificity): (WebCore::simpleSelectorSpecificityInternal): (WebCore::CSSSelector::simpleSelectorSpecificity const): Also handle nth here. (WebCore::CSSSelector::specificity const): (WebCore::simpleSelectorFunctionalPseudoClassStaticSpecificity): Deleted. (WebCore::functionalPseudoClassStaticSpecificity): Deleted. (WebCore::staticSpecificityInternal): Deleted. (WebCore::CSSSelector::staticSpecificity const): Deleted. Rename to just computeSpecificity(), there is no other kind than static. * css/CSSSelector.h: * css/SelectorChecker.cpp: (WebCore::SelectorChecker::match const): (WebCore::SelectorChecker::matchHostPseudoClass const): (WebCore::SelectorChecker::matchRecursively const): (WebCore::SelectorChecker::checkOne const): (WebCore::SelectorChecker::matchSelectorList const): SelectorChecker doesn't need to deal with specificity anymore. * css/SelectorChecker.h: * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::addNthChildType): (WebCore::SelectorCompiler::addPseudoClassType): (WebCore::SelectorCompiler::constructFragmentsInternal): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching): Neither does SelectorCompiler. * cssjit/SelectorCompiler.h: * dom/SelectorQuery.cpp: (WebCore::SelectorDataList::selectorMatches const): (WebCore::SelectorDataList::selectorClosest const): * inspector/InspectorStyleSheet.cpp: (WebCore::buildObjectForSelectorHelper): (WebCore::selectorsFromSource): (WebCore::InspectorStyleSheet::buildObjectForSelector): (WebCore::InspectorStyleSheet::buildObjectForSelectorList): (WebCore::InspectorStyleSheet::buildObjectForRule): (WebCore::InspectorStyleSheet::buildArrayForRuleList): (WebCore::hasDynamicSpecificity): Deleted. * inspector/InspectorStyleSheet.h: * inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::setRuleSelector): (WebCore::InspectorCSSAgent::addRule): (WebCore::InspectorCSSAgent::buildObjectForRule): (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::highlightSelector): * style/ElementRuleCollector.cpp: (WebCore::Style::ElementRuleCollector::ruleMatches): (WebCore::Style::ElementRuleCollector::collectMatchingRulesForList): Switch to get the specificity from the selector instead of computing it during selector checking. * style/ElementRuleCollector.h: * style/RuleData.cpp: (WebCore::Style::computeMatchesBasedOnRuleHash): (WebCore::Style::RuleData::RuleData): (WebCore::Style::computeMatchBasedOnRuleHash): Deleted. * style/RuleData.h: (WebCore::Style::RuleData::matchesBasedOnRuleHash const): (WebCore::Style::RuleData::matchBasedOnRuleHash const): Deleted. This can be a bit instead of an enum since there is no need to communicate specificity. 2020-04-13 David Kilzer <ddkilzer@apple.com> KeyedDecoder functions in ResourceLoadStatistics.{cpp,h} should return bool and use WARN_UNUSED_RETURN <https://webkit.org/b/210414> <rdar://problem/61693118> Reviewed by Alex Christensen. * loader/ResourceLoadStatistics.cpp: (WebCore::decodeHashCountedSet): (WebCore::decodeHashSet): (WebCore::decodeOptionSet): (WebCore::decodeFontHashSet): (WebCore::decodeCanvasActivityRecord): (WebCore::ResourceLoadStatistics::decode): * loader/ResourceLoadStatistics.h: - Change decode functions to return `bool`. - Add WARN_UNUSED_RETURN to all decode functions. - Check the return value of all decode functions. 2020-04-13 Said Abou-Hallawa <sabouhallawa@apple.com> When drawing an image srcRect and imageRect have to be in the orientation of destRect https://bugs.webkit.org/show_bug.cgi?id=210364 Reviewed by Darin Adler. * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::drawImage): Use the renderer to get the orientation of the image if it is available. Otherwise fall back to computedStyle(). * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::draw): For async image decoding, we will use the none oriented size as the sizeForDrawing. imageRect must be in the same orientation as destRect. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawImage): srcRect must be in the same orientation as destRect. 2020-04-13 Joonghun Park <jh718.park@samsung.com> Unreviewed. Remove redundant move in return statement. Return statement already returns rvalue, so we don't need move here. This patch removes the build warning below since r259922. warning: redundant move in return statement [-Wredundant-move] No new tests, no new behaviours. * page/csp/ContentSecurityPolicyResponseHeaders.h: (WebCore::ContentSecurityPolicyResponseHeaders::decode): * platform/network/cf/CertificateInfoCFNet.cpp: (WTF::Persistence::decodeSecTrustRef): 2020-04-13 Youenn Fablet <youenn@apple.com> Fix mute/unmute of CoreAudioCapture sources after revision 257914 https://bugs.webkit.org/show_bug.cgi?id=210381 Reviewed by Eric Carlson. Revert part of revision 257914 since we still need the active source registration/unregistration when capturing in web process. Make sure mock factory delegates all active source handling to CoreAudioCaptureSourceFactory, now that the mock factory is using CoreAudioCaptureSources with a mock share dunit. Tests: platform/ios/mediastream/audio-muted-in-background-tab-gpu-process.html platform/ios/mediastream/getUserMedia-single-capture-gpu-process.html * platform/mediastream/RealtimeMediaSourceFactory.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::startProducingData): * platform/mock/MockRealtimeMediaSourceCenter.cpp: 2020-04-13 Michael Catanzaro <mcatanzaro@gnome.org> Fix various build warnings https://bugs.webkit.org/show_bug.cgi?id=210429 Reviewed by Mark Lam. Fix -Wunused-parameter warning. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::texImage2DBase): 2020-04-13 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Pre-fill columnIntrinsicWidths vector https://bugs.webkit.org/show_bug.cgi?id=210415 Reviewed by Antti Koivisto. Vector<ColumnMinimumWidth> has a fixed number of entries (number of columns in the table). (This patch also flips the shouldFlex flag to isFixedWidth. It reads better in the context of minimum _widths_). Test: fast/layoutformattingcontext/table-with-column-spanner-first-row.html * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): 2020-04-13 Adrian Perez de Castro <aperez@igalia.com> [GTK4] Fix usage of GDK event functions in PlatformWheelEventGtk https://bugs.webkit.org/show_bug.cgi?id=210160 Reviewed by Michael Catanzaro. No new tests needed. * platform/gtk/PlatformWheelEventGtk.cpp: (WebCore::PlatformWheelEvent::PlatformWheelEvent): Conditionally use the new GDK event functions when building with GTK4. 2020-04-13 Yusuke Suzuki <ysuzuki@apple.com> module's default cross-origin value should be "anonymous" https://bugs.webkit.org/show_bug.cgi?id=210326 Reviewed by Sam Weinig. The original spec was using "omit" crossorigin for modules when crossorigin is not set / empty. However, the spec is changed to sending requests with "same-origin" credentials ("anonymous" crossorigin mode) by default. We should follow it. * dom/ScriptElement.cpp: (WebCore::ScriptElement::requestModuleScript): * dom/ScriptElementCachedScriptFetcher.cpp: (WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const): * dom/ScriptElementCachedScriptFetcher.h: * html/parser/HTMLResourcePreloader.cpp: (WebCore::PreloadRequest::resourceRequest): * loader/cache/CachedScript.cpp: (WebCore::CachedScript::script): While this is not directly related to this patch, added new tests found that we are returning null StringView if the resource is zero byte. This totally works, but JSC::Parser has assertion that this is non-null StringView. For zero byte CachedScript resource, we should return non-null empty StringView instead. 2020-04-13 Charlie Turner <cturner@igalia.com> [EME][GStreamer] remove m_cdmInstance ASSERT in cdmInstanceDetached https://bugs.webkit.org/show_bug.cgi?id=210331 Reviewed by Xabier Rodriguez-Calvar. In tests that reset the src very quickly, the MediaKeys can be installed and then the src is reset before an attachment message is sent. Hence, detachment can result in no CDM currently existing. Covered by imported/w3c/web-platform-tests/encrypted-media. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::cdmInstanceDetached): Only assert if the CDM instance has been set before detachment. (WebCore::MediaPlayerPrivateGStreamer::attemptToDecryptWithInstance): Do not need the .get(), the operator== overload in RefPtr does this for us, and it makes the code more consistent. 2020-04-13 Rob Buis <rbuis@igalia.com> Remove return parameter from FrameLoader::closeURL https://bugs.webkit.org/show_bug.cgi?id=210404 Reviewed by Manuel Rego Casasnovas. Remove return parameter from FrameLoader::closeURL since it always returns true and is never tested. * loader/FrameLoader.cpp: (WebCore::FrameLoader::closeURL): * loader/FrameLoader.h: 2020-04-13 Rob Buis <rbuis@igalia.com> Remove addExtraFieldsToSubresourceRequest https://bugs.webkit.org/show_bug.cgi?id=210407 Reviewed by Darin Adler. Remove addExtraFieldsToSubresourceRequest since it can be replaced by calling addExtraFieldsToRequest. The loadType parameter is not taken into account by defaultRequestCachingPolicy so FrameLoadType::Standard rather than m_loadType is passed. This patch also replaces the isMainResource boolean parameter with an enum. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::load): (WebCore::FrameLoader::addExtraFieldsToRequest): (WebCore::FrameLoader::loadPostRequest): (WebCore::FrameLoader::loadResourceSynchronously): (WebCore::FrameLoader::loadDifferentDocumentItem): (WebCore::FrameLoader::addExtraFieldsToSubresourceRequest): Deleted. * loader/FrameLoader.h: * loader/PingLoader.cpp: (WebCore::PingLoader::loadImage): (WebCore::PingLoader::sendPing): (WebCore::PingLoader::sendViolationReport): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): 2020-04-12 Darin Adler <darin@apple.com> Fix a few mispellings of descendant and propagation https://bugs.webkit.org/show_bug.cgi?id=210409 Reviewed by Mark Lam. * dom/Element.cpp: (WebCore::Element::dispatchWheelEvent): "propagation" * dom/TreeScopeOrderedMap.cpp: (WebCore::TreeScopeOrderedMap::getAllElementsById const): "descendants". Also refactored this function a bit. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::canShowControlsManager const): "descendants" * rendering/RenderFrameSet.cpp: (WebCore::resetFrameRendererAndDescendants): "descendants" (WebCore::RenderFrameSet::positionFrames): "descendants" (WebCore::RenderFrameSet::positionFramesWithFlattening): "descendants" 2020-04-12 Darin Adler <darin@apple.com> Refactor and tighten up the CSSVariableReferenceValue class https://bugs.webkit.org/show_bug.cgi?id=210406 Reviewed by Anders Carlsson. * css/CSSCustomPropertyValue.h: Remove uneeded forward declaration of CSSVariableReferenceValue, since it's not used here. Added inclde of CSSVariableData.h since the use of Variant in this class does require that header, which we were getting indirectly before from CSSVariableReferenceValue.h in some translation units. * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::CSSVariableReferenceValue): Moved here from the header. (WebCore::CSSVariableReferenceValue::create): Ditto. (WebCore::CSSVariableReferenceValue::equals const): Ditto. (WebCore::CSSVariableReferenceValue::customCSSText const): Use non-null to indicate this is not serialized. * css/CSSVariableReferenceValue.h: Reduced includes, inlining, marked constructor explicit, removed unneeded m_serialized boolean. * rendering/style/StyleCustomPropertyData.h: Remove unneeded include of CSSVariableReferenceValue.h, not used here. 2020-04-12 Darin Adler <darin@apple.com> Fix some strange uses of start/endOfDocument https://bugs.webkit.org/show_bug.cgi?id=210408 Reviewed by Wenson Hsieh. * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity): Call startOfDocument and endOfDocument without unnecessarily turning a Position into a VisiblePostion, since those functions just require any node from the document. 2020-04-12 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add support for column spanners https://bugs.webkit.org/show_bug.cgi?id=210403 Reviewed by Antti Koivisto. Table width constraint computation with spanner support is as follows: 1. Collect each cells' width constraints. 2. Collect fixed column widths set by <colgroup>'s and <col>s. 3. Find the min/max width for each columns using the cell constraints and the <col> fixed widths but ignore column spans. 4. Distribute column spanning cells min/max widths. 5. Add them all up and return the computed min/max widths. * layout/FormattingContext.h: (WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::operator-=): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell): * layout/tableformatting/TableGrid.cpp: (WebCore::Layout::TableGrid::Columns::hasFixedColumnsOnly const): * layout/tableformatting/TableGrid.h: 2020-04-12 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Column, Row and Cell boxes are always ContainerBoxes https://bugs.webkit.org/show_bug.cgi?id=210402 Reviewed by Antti Koivisto. These boxes are always ContainerBox types. * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutCell): (WebCore::Layout::TableFormattingContext::ensureTableGrid): (WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns): * layout/tableformatting/TableGrid.cpp: (WebCore::Layout::TableGrid::Column::Column): (WebCore::Layout::TableGrid::Columns::addColumn): (WebCore::Layout::TableGrid::Rows::addRow): (WebCore::Layout::TableGrid::Row::Row): (WebCore::Layout::TableGrid::Cell::Cell): (WebCore::Layout::TableGrid::appendCell): (WebCore::Layout::TableGrid::insertCell): (WebCore::Layout::TableGrid::removeCell): * layout/tableformatting/TableGrid.h: (WebCore::Layout::TableGrid::Column::box const): (WebCore::Layout::TableGrid::Row::box const): (WebCore::Layout::TableGrid::Cell::box const): 2020-04-12 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add support for fixed width columns https://bugs.webkit.org/show_bug.cgi?id=210401 Reviewed by Antti Koivisto. This is in preparation for adding support for spanner cells. Fixed width columns (<col> and <td>) don't participate in the spanner width distribution. * layout/FormattingContext.h: (WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::operator-=): * layout/Verification.cpp: (WebCore::Layout::areEssentiallyEqual): (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree): * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints): (WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): Deleted. (WebCore::Layout::TableFormattingContext::useAsContentLogicalWidth): Deleted. * layout/tableformatting/TableFormattingContext.h: * layout/tableformatting/TableFormattingContextGeometry.cpp: (WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell): * layout/tableformatting/TableGrid.cpp: (WebCore::Layout::TableGrid::Column::isFixedWidth const): (WebCore::Layout::TableGrid::Cell::isFixedWidth const): (WebCore::Layout::TableGrid::Slot::Slot): (WebCore::Layout::TableGrid::appendCell): (WebCore::Layout::TableGrid::Column::setWidthConstraints): Deleted. (WebCore::Layout::TableGrid::Column::widthConstraints const): Deleted. (WebCore::Layout::TableGrid::Column::hasFixedWidth const): Deleted. (WebCore::Layout::TableGrid::widthConstraints): Deleted. * layout/tableformatting/TableGrid.h: (WebCore::Layout::TableGrid::setWidthConstraints): (WebCore::Layout::TableGrid::widthConstraints): (WebCore::Layout::TableGrid::Column::setHasFixedWidthCell): (WebCore::Layout::TableGrid::Column::hasFixedWidthCell const): (WebCore::Layout::TableGrid::Slot::cell const): (WebCore::Layout::TableGrid::Slot::cell): (WebCore::Layout::TableGrid::Slot::widthConstraints const): (WebCore::Layout::TableGrid::Slot::setWidthConstraints): (WebCore::Layout::TableGrid::Slot::hasColumnSpan const): (WebCore::Layout::TableGrid::Slot::hasRowSpan const): (WebCore::Layout::TableGrid::Slot::isColumnSpanned const): (WebCore::Layout::TableGrid::Slot::isRowSpanned const): (WebCore::Layout::TableGrid::hasComputedWidthConstraints const): Deleted. 2020-04-12 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Introduce dedicated SlotPosition/CellSpan structs https://bugs.webkit.org/show_bug.cgi?id=210399 Reviewed by Antti Koivisto. SlotPosition.column/row and CellSpan.column/row read better. * layout/LayoutUnits.h: (WebCore::Layout::SlotPosition::SlotPosition): (WebCore::Layout::operator==): (WTF::SlotPositionHash::hash): (WTF::SlotPositionHash::equal): (WTF::HashTraits<WebCore::Layout::SlotPosition>::emptyValue): (WTF::HashTraits<WebCore::Layout::SlotPosition>::constructDeletedValue): (WTF::HashTraits<WebCore::Layout::SlotPosition>::isDeletedValue): * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::setRowSpan): (WebCore::Layout::Box::setColumnSpan): (WebCore::Layout::Box::rowSpan const): (WebCore::Layout::Box::columnSpan const): * layout/layouttree/LayoutBox.h: * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): * layout/tableformatting/TableGrid.cpp: (WebCore::Layout::TableGrid::Cell::Cell): (WebCore::Layout::TableGrid::appendCell): * layout/tableformatting/TableGrid.h: (WebCore::Layout::TableGrid::Cell::startColumn const): (WebCore::Layout::TableGrid::Cell::endColumn const): (WebCore::Layout::TableGrid::Cell::startRow const): (WebCore::Layout::TableGrid::Cell::endRow const): (WebCore::Layout::TableGrid::Cell::columnSpan const): (WebCore::Layout::TableGrid::Cell::rowSpan const): (WebCore::Layout::TableGrid::Cell::span const): (WebCore::Layout::TableGrid::Cell::size const): Deleted. 2020-04-12 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Add table support to BlockFormattingContext::Geometry::inFlowWidthAndMargin https://bugs.webkit.org/show_bug.cgi?id=210400 Reviewed by Antti Koivisto. Use a slightly modified shrink-to-fit logic to compute the table width. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): 2020-04-12 Zalan Bujtas <zalan@apple.com> [LFC][TFC] Cleanup class/struct/variable names in TableGrid/TableFormattingContext https://bugs.webkit.org/show_bug.cgi?id=210397 Reviewed by Antti Koivisto. This is in preparation for the column spanner work. * layout/tableformatting/TableFormattingContext.cpp: (WebCore::Layout::TableFormattingContext::layoutInFlowContent): (WebCore::Layout::TableFormattingContext::layoutCell): (WebCore::Layout::TableFormattingContext::positionTableCells): (WebCore::Layout::TableFormattingContext::setComputedGeometryForRows): (WebCore::Layout::TableFormattingContext::setComputedGeometryForSections): (WebCore::Layout::TableFormattingContext::ensureTableGrid): (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): (WebCore::Layout::TableFormattingContext::useAsContentLogicalWidth): (WebCore::Layout::TableFormattingContext::layoutTableCellBox): Deleted. * layout/tableformatting/TableFormattingContext.h: * layout/tableformatting/TableGrid.cpp: (WebCore::Layout::TableGrid::Column::Column): (WebCore::Layout::TableGrid::Column::hasFixedWidth const): (WebCore::Layout::TableGrid::Columns::addColumn): (WebCore::Layout::TableGrid::Columns::addAnonymousColumn): (WebCore::Layout::TableGrid::Rows::addRow): (WebCore::Layout::TableGrid::Row::Row): (WebCore::Layout::TableGrid::Cell::Cell): (WebCore::Layout::TableGrid::Slot::Slot): (WebCore::Layout::TableGrid::slot): (WebCore::Layout::TableGrid::appendCell): (WebCore::Layout::TableGrid::insertCell): (WebCore::Layout::TableGrid::removeCell): (WebCore::Layout::TableGrid::widthConstraints): (WebCore::Layout::TableGrid::ColumnsContext::addColumn): Deleted. (WebCore::Layout::TableGrid::CellInfo::CellInfo): Deleted. (WebCore::Layout::TableGrid::SlotInfo::SlotInfo): Deleted. * layout/tableformatting/TableGrid.h: (WebCore::Layout::TableGrid::totalHorizontalSpacing const): (WebCore::Layout::TableGrid::hasComputedWidthConstraints const): (WebCore::Layout::TableGrid::Column::box const): (WebCore::Layout::TableGrid::Columns::list): (WebCore::Layout::TableGrid::Columns::list const): (WebCore::Layout::TableGrid::Columns::size const): (WebCore::Layout::TableGrid::Columns::logicalWidth const): (WebCore::Layout::TableGrid::Row::logicalBottom const): (WebCore::Layout::TableGrid::Row::box const): (WebCore::Layout::TableGrid::Rows::list): (WebCore::Layout::TableGrid::Rows::rowList const): (WebCore::Layout::TableGrid::Rows::size const): (WebCore::Layout::TableGrid::Cell::startColumn const): (WebCore::Layout::TableGrid::Cell::endColumn const): (WebCore::Layout::TableGrid::Cell::startRow const): (WebCore::Layout::TableGrid::Cell::endRow const): (WebCore::Layout::TableGrid::Cell::columnSpan const): (WebCore::Layout::TableGrid::Cell::rowSpan const): (WebCore::Layout::TableGrid::Cell::position const): (WebCore::Layout::TableGrid::Cell::size const): (WebCore::Layout::TableGrid::Cell::box const): (WebCore::Layout::TableGrid::columns const): (WebCore::Layout::TableGrid::columns): (WebCore::Layout::TableGrid::rows const): (WebCore::Layout::TableGrid::rows): (WebCore::Layout::TableGrid::cells): (WebCore::Layout::TableGrid::CellInfo::startColumn const): Deleted. (WebCore::Layout::TableGrid::CellInfo::endColumn const): Deleted. (WebCore::Layout::TableGrid::CellInfo::startRow const): Deleted. (WebCore::Layout::TableGrid::CellInfo::endRow const): Deleted. (WebCore::Layout::TableGrid::CellInfo::columnSpan const): Deleted. (WebCore::Layout::TableGrid::CellInfo::rowSpan const): Deleted. (WebCore::Layout::TableGrid::Column::columnBox const): Deleted. (WebCore::Layout::TableGrid::ColumnsContext::columns): Deleted. (WebCore::Layout::TableGrid::ColumnsContext::columns const): Deleted. (WebCore::Layout::TableGrid::ColumnsContext::logicalWidth const): Deleted. (WebCore::Layout::TableGrid::columnsContext const): Deleted. (WebCore::Layout::TableGrid::columnsContext): Deleted. 2020-04-11 Jack Lee <shihchieh_lee@apple.com> Infinite loop in InsertListCommand::doApply() https://bugs.webkit.org/show_bug.cgi?id=210354 <rdar://problem/61427778> Reviewed by Darin Adler. Function startOfNextParagraph may return an empty position. Added null check to exit the while loop and stop looking for next paragraph. Test: editing/inserting/insert-list-end-of-table.html * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::doApply): 2020-04-11 Wenson Hsieh <wenson_hsieh@apple.com> [macOS] [WK1] Touch Bar flashes when typing in Vietnamese in Mail https://bugs.webkit.org/show_bug.cgi?id=210394 <rdar://problem/60099560> Reviewed by Tim Horton. See WebKitLegacy/mac/ChangeLog for more details. Currently, many users of TemporarySelectionChange use it to temporarily avoid propagating selection changes to the client layer during temporary selection changes. This involves creating a TemporarySelectionChange without a new selection, but with the `IgnoreSelectionChanges` option specified, which makes us call `Editor:: setIgnoreSelectionChanges` to suppress selection change notifications. Do a bit of cleanup in this area by introducing IgnoreSelectionChangeForScope, which wraps a TemporarySelectionChange and makes it easier for a handful of call sites that currently use TemporarySelectionChange to hide selection changes from the client layer to get their desired behavior. Test: CandidateTests.DoNotHideCandidatesDuringTextReplacement * editing/Editor.cpp: (WebCore::Editor::respondToChangedSelection): * editing/Editor.h: (WebCore::TemporarySelectionChange::TemporarySelectionChange): (WebCore::IgnoreSelectionChangeForScope::IgnoreSelectionChangeForScope): * page/DragController.cpp: (WebCore::DragController::performDragOperation): (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret): Replace these: `TemporarySelectionChange ignoreSelectionChanges { frame, WTF::nullopt, TemporarySelectionOption::IgnoreSelectionChanges };` ...with these instead: `IgnoreSelectionChangeForScope ignoreSelectionChanges { *frame };` 2020-04-11 Simon Fraser <simon.fraser@apple.com> [Async overflow] Can't scroll overflow:scroll in sideways-scrollable RTL document https://bugs.webkit.org/show_bug.cgi?id=210389 Reviewed by Tim Horton. ScrollingTree::handleWheelEvent() converts the event coordinates from view to "content" coordinates, but we then jump into hit-testing on CALayers. In a sideways-scrollable RTL document, the root content layer has a negative X offset which corresponds to scrollOrigin; we need to map the point into the coordinate space of this layer before entering layer-based hit-testing. Tests: fast/scrolling/mac/async-scroll-overflow-rtl-zoomed.html fast/scrolling/mac/async-scroll-overflow-rtl.html * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::handleWheelEvent): * page/scrolling/mac/ScrollingTreeMac.mm: (ScrollingTreeMac::scrollingNodeForPoint): 2020-04-10 Darin Adler <darin@apple.com> Move more from live range to SimpleRange: callers of absoluteTextRects https://bugs.webkit.org/show_bug.cgi?id=210369 Reviewed by Anders Carlsson. * dom/Node.cpp: (WebCore::Node::textRects const): Deleted. * dom/Node.h: Updated for the above. * dom/Range.cpp: (WebCore::Range::absoluteBoundingBox const): Updated since absoluteTextRects no longer has a RangeInFixedPosition* argument. (WebCore::Range::absoluteTextRects const): Removed the unused RangeInFixedPosition* argument. * dom/Range.h: Got rid of unused RangeInFixedPosition type and also removed RangeInFixedPosition* argument from the absoluteTextRects function. Later will remove absoluteTextRects entirely. * editing/Editor.cpp: (WebCore::Editor::firstRectForRange const): Use RenderObject::absoluteTextQuads and unitedBoundingBoxes rather than using RenderObject::absoluteBoundingBoxRectForRange. * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): Use SimpleRange rather than live ranges. * html/HTMLTextFormControlElement.cpp: (WebCore::setContainerAndOffsetForRange): Moved from int to unsigned. (WebCore::HTMLTextFormControlElement::selection const): Return Optional<SimpleRange> rather than a live range. * html/HTMLTextFormControlElement.h: Updated for the change above. * page/TextIndicator.cpp: (WebCore::initializeIndicator): Updated since absoluteTextRects no longer takes a RangeInFixedPosition* argument. * rendering/HighlightData.h: Removed stray obsolete declaration. * rendering/RenderObject.cpp: (WebCore::RenderObject::absoluteBoundingBoxRectForRange): Deleted. Callers can use absoluteTextQuads directly. We need to cut down on the number of separate functions that are not really separate concepts, and this was used in only one place. (WebCore::RenderObject::absoluteTextRects): Added. Replaces Range::absoluteTextRects for all callers outside the live range class and will eventually replace it entirely. * rendering/RenderObject.h: Updated for the above. 2020-04-11 Devin Rousso <drousso@apple.com> REGRESSION (Safari 13.1?): Web Inspector: Debugger hang at breakpoint when using Keyboard Maestro https://bugs.webkit.org/show_bug.cgi?id=210177 <rdar://problem/61485723> Reviewed by Joseph Pecoraro. Partial revert of r251036 <https://webkit.org/b/202716> to go back to using AppKit APIs instead of `CFRunLoopRunInMode`. Only seems to affect WebKitLegacy. * inspector/PageScriptDebugServer.h: * inspector/PageScriptDebugServer.cpp: (WebCore::PageScriptDebugServer::runEventLoopWhilePausedInternal): (WebCore::PageScriptDebugServer::platformShouldContinueRunningEventLoopWhilePaused): * inspector/mac/PageScriptDebugServerMac.mm: Added. (WebCore::PageScriptDebugServer::platformShouldContinueRunningEventLoopWhilePaused): * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: 2020-04-08 Darin Adler <darin@apple.com> Use Node::length to replace Node::maxCharacterOffset and lastOffsetInNode; switch more offsets from int to unsigned https://bugs.webkit.org/show_bug.cgi?id=210246 Reviewed by Antti Koivisto. - The recently-added Node::length, which matches the DOM specification terminology for node offsets as used in ranges, is the same as the existing maxCharacterOffset and lastOffsetInNode functions. Deleted all uses of those and replaced them with calls to Node::length. One of the benefits of this is that Node::length is implemented more efficiently and is not a virtual function. Another is consistently matching the DOM specification terminology. - Many offsets, including the ones in live ranges, are currently implemented as signed in WebKit, but are specified as unsigned in the DOM and HTML specifications. This has very little observable effect from JavaScript that can affect website compatibility, but it's still helpful to be consistent both with the specification and internally. Accordingly, changed some of these to unsigned; more to come later. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::previousBoundary): Use length instead of maxCharacterOffset. * dom/CharacterData.cpp: (WebCore::CharacterData::maxCharacterOffset const): Deleted. * dom/CharacterData.h: Deleted maxCharacterOffset override. * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::shiftMarkers): Use length instead of maxCharacterOffset. * dom/Node.cpp: (WebCore::Node::maxCharacterOffset const): Deleted. * dom/Node.h: Deleted maxCharacterOffset. * dom/Position.cpp: (WebCore::Position::computeOffsetInContainerNode const): Use length instead of lastOffsetInNode. * dom/Position.h: (WebCore::lastOffsetInNode): Deleted. (WebCore::lastPositionInNode): Use length instead of lastOffsetInNode. (WebCore::minOffsetForNode): Use length instead of maxCharacterOffset. (WebCore::offsetIsBeforeLastNodeOffset): Ditto. * dom/RangeBoundaryPoint.h: (WebCore::RangeBoundaryPoint::setToEndOfNode): Use length instead of maxCharacterOffset. * editing/ApplyBlockElementCommand.cpp: (WebCore::isNewLineAtPosition): Use length instead of maxCharacterOffset. (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded): Ditto. * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::removeInlineStyle): Use length instead of maxCharacterOffset. * editing/Editing.cpp: (WebCore::lastOffsetForEditing): Use length instead of mmaxCharacterOffset and countChildNodes. Also improved the comment here. * editing/EditingStyle.cpp: (WebCore::EditingStyle::styleAtSelectionStart): Use length instead of maxCharacterOffset. * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::doApplyForSingleParagraph): Use length instead of lastOffsetInNode. * editing/TextIterator.cpp: (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): USe length instead of lastOffsetInNode. * editing/VisibleUnits.cpp: (WebCore::previousBoundary): Use length instead of maxCharacterOffset. 2020-04-10 Alex Christensen <achristensen@webkit.org> PersistentCoders should use modern decoding syntax https://bugs.webkit.org/show_bug.cgi?id=207497 Reviewed by Darin Adler. * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::showCertificate): * loader/FetchOptions.h: (WebCore::FetchOptions::decodePersistent): * page/csp/ContentSecurityPolicyResponseHeaders.h: (WebCore::ContentSecurityPolicyResponseHeaders::encode const): (WebCore::ContentSecurityPolicyResponseHeaders::decode): * platform/PasteboardCustomData.cpp: (WebCore::PasteboardCustomData::fromSharedBuffer): * platform/network/ResourceLoadPriority.h: * platform/network/ResourceRequestBase.h: (WebCore::ResourceRequestBase::encodeBase const): (WebCore::ResourceRequestBase::decodeBase): * platform/network/cf/CertificateInfo.h: (WTF::Persistence::decodeCFData): (WTF::Persistence::decodeSecTrustRef): (WTF::Persistence::decodeCertificateChain): (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::doPushChanges): (WebCore::RegistrationDatabase::importRecords): 2020-04-10 Simon Fraser <simon.fraser@apple.com> [macOS] Fix scrollbar display for async-scrolling overflow https://bugs.webkit.org/show_bug.cgi?id=194101 Reviewed by Tim Horton. We need to call positionOverflowControlsLayers() from RenderLayerBacking::updateGeometry(), otherwise, on first load, scrollbar layers have no size because we try to position them before we've created them. Test: fast/scrolling/mac/overflow-scrollbars-should-be-visible.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::positionOverflowControls): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): 2020-04-10 Simon Fraser <simon.fraser@apple.com> [Async overflow] Can't scroll vertically while over a horizontal scroller in this content https://bugs.webkit.org/show_bug.cgi?id=210356 <rdar://problem/60523731> Reviewed by Tim Horton. https://dozermapper.github.io/gitbook/documentation/customconverter.html has style that triggers mismatched containing block and z-order layer trees, triggering the creation of an "overflow scroll proxy node" in the scrolling tree. If we encounter such a node in our ancestor tree walk while deciding which node to send a wheel event too, we need to jump to the node that the proxy node is representing. Test: fast/scrolling/mac/nested-overflow-proxy-node.html * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::handleWheelEvent): 2020-04-10 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, reverting r259764. Causes layout test crashes under GuardMalloc Reverted changeset: "Release WebGLLayer earlier in ~GraphicsContextGLOpenGL" https://bugs.webkit.org/show_bug.cgi?id=210213 https://trac.webkit.org/changeset/259764 2020-04-10 Peng Liu <peng.liu6@apple.com> REGRESSION: (r259850)[ Mac wk1 Debug ] media/track/track-user-stylesheet.html is flaky failing. https://bugs.webkit.org/show_bug.cgi?id=210350 Reviewed by Daniel Bates. Revert the change in r259850. * page/CaptionUserPreferences.cpp: (WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride): 2020-04-10 Pinki Gyanchandani <pgyanchandani@apple.com> Null ptr Deref in RadioButtonGroups::updateCheckedState https://bugs.webkit.org/show_bug.cgi?id=210353 Reviewed by Chris Dumez. This crash happened when the default checked setter was called for an input element and RadioButtonGroup was NULL. Added condition to dereference the group only if it is non-null. Test: fast/forms/input-element-default-checked-setter-crash.html * dom/RadioButtonGroups.cpp: (WebCore::RadioButtonGroups::updateCheckedState): 2020-04-10 Jack Lee <shihchieh_lee@apple.com> ASSERTION FAILED: selection.isRange() in InsertListCommand::doApply https://bugs.webkit.org/show_bug.cgi?id=210170 <rdar://problem/61410397> Reviewed by Wenson Hsieh. If selectionForParagraphIteration returns a non-range selection, there is no need for finding multiple paragraphs. And since non-range selection is handled, the assertion can be removed. Test: editing/inserting/insert-list-in-table-assert.html * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::doApply): 2020-04-10 Antti Koivisto <antti@apple.com> [CSS Shadow Parts] Bad style sharing between sibling elements with different part attributes https://bugs.webkit.org/show_bug.cgi?id=210249 <rdar://problem/61547528> Reviewed by Daniel Bates. Style sharing optimization was unconditionally allowed for elements that were styled with part pseudo element. This could lead to miscomputed style. Test case by Justin Fagnani. Test: fast/css/shadow-parts/shadow-part-style-sharing.html * style/StyleSharingResolver.cpp: (WebCore::Style::SharingResolver::canShareStyleWithElement): Only allow style sharing if parts match. == Rolled over to ChangeLog-2020-04-10 ==