WebKit-https.git
4 months agoExtended Color: Move ColorMatrix to its own files
weinig@apple.com [Wed, 27 May 2020 21:40:09 +0000 (21:40 +0000)]
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262218 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION(r260318): [WPE][GTK] Uninitialized memory read in MemoryPressureMonitor
commit-queue@webkit.org [Wed, 27 May 2020 21:27:12 +0000 (21:27 +0000)]
REGRESSION(r260318): [WPE][GTK] Uninitialized memory read in MemoryPressureMonitor
https://bugs.webkit.org/show_bug.cgi?id=212412

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2020-05-27
Reviewed by Adrian Perez de Castro.

I think this is a false-positive, but let's suppress the warning by zero-initializing this
buffer.

* UIProcess/linux/MemoryPressureMonitor.cpp:
(WebKit::systemMemoryUsedAsPercentage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262217 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAdd OptionSetTraits<> and use with WebCore::DragDestinationAction
ddkilzer@apple.com [Wed, 27 May 2020 21:04:41 +0000 (21:04 +0000)]
Add OptionSetTraits<> and use with WebCore::DragDestinationAction
<https://webkit.org/b/212397>

Reviewed by Alex Christensen.

Source/WebCore:

* page/DragActions.h:
(WTF::OptionSetTraits<WebCore::DragDestinationAction>):
- Add for use with OptionSet<>.

Source/WTF:

Add OptionSetTraits<> (similar to EnumTraits<>) to define all
valid values for a given enum type.  This allows us to use that
bitmask with OptionSet<>::fromRaw() to clear undefined bits, and
to validate enum values used with the OptionSet<> constructors.

Note that the extra validation possible with OptionSetTraits<>
is enabled based on the existence of that type using the new
WTF::is_type_complete_v<> type trait.  Other OptionSet<> enums
fall back to the original validation checks.

Finally, typename <T> is changed to <E> for OptionSet<> to
emphasize that it's an enum typename.

* wtf/OptionSet.h:
(WTF::is_type_complete_v): Add.
(WTF::OptionSetTraits): Add.
(WTF::OptionSetValues): Add.
(WTF::OptionSetValueChecker): Add.
(WTF::isValidOptionSetEnum): Add.
(WTF::maskRawValue): Add.
(WTF::OptionSet::Iterator::operator* const):
(WTF::OptionSet::fromRaw):
(WTF::OptionSet::OptionSet):
(WTF::OptionSet::contains const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262216 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoApp-bound sessions should be for iOS only
katherine_cheney@apple.com [Wed, 27 May 2020 20:54:59 +0000 (20:54 +0000)]
App-bound sessions should be for iOS only
https://bugs.webkit.org/show_bug.cgi?id=212426
<rdar://problem/63678147>

Reviewed by Darin Adler.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::SessionWrapper::initialize):
(WebKit::NetworkSessionCocoa::sessionWrapperForTask):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262215 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[WPE] Avoid possible WTR event timing going back in time and fix conversion from...
lmoura@igalia.com [Wed, 27 May 2020 20:45:43 +0000 (20:45 +0000)]
[WPE] Avoid possible WTR event timing going back in time and fix conversion from s to ms
https://bugs.webkit.org/show_bug.cgi?id=212338

Reviewed by Michael Catanzaro.

Source/WebKit:

When converting the input timestamps to WallTime, we must somehow
adjust them to give meaningful timestamps (due to Dom::Event
conversion from timestamp wall time to the time origin from document
loading).

As WPE timestamps are just intended to be compared among themselves,
we use the first processed event as the origin, comparing the
following events to it to get an actual time.

Test: fast/events/monotonic-event-time.html

* Shared/libwpe/WebEventFactory.cpp:
(WebKit::wallTimeForEventTime):

Tools:

Make sure we cast the double m_time timestamp from seconds to uint32_t
milliseconds expected by WPE input events.

* WebKitTestRunner/wpe/EventSenderProxyWPE.cpp:
(WTR::secToMsTimestamp):
(WTR::EventSenderProxy::EventSenderProxy): Use monotonic time instead
of zero as the time origin. This is used only in a relative manner,
and we need monotonic behavior so conversion to DOM event timestamps
makes sense.
(WTR::EventSenderProxy::mouseDown):
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):
(WTR::EventSenderProxy::mouseScrollBy):
(WTR::EventSenderProxy::updateTouchPoint):
(WTR::EventSenderProxy::prepareAndDispatchTouchEvent):
(WTR::EventSenderProxy::releaseTouchPoint):

LayoutTests:

Added new test to check if input events timestamps are actually
monotonically increasing since the start.

* fast/events/monotonic-event-time-expected.txt: Added.
* fast/events/monotonic-event-time.html: Added.
* platform/ios/TestExpectations: Skipped the test as it relies on
mouseDown

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262214 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[ Mac wk2 ] http/tests/eventsource/eventsource-reconnect-during-navigate-crash.html...
youenn@apple.com [Wed, 27 May 2020 20:42:40 +0000 (20:42 +0000)]
[ Mac wk2 ] http/tests/eventsource/eventsource-reconnect-during-navigate-crash.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=209622
<rdar://problem/60938860>

Reviewed by Darin Adler.

The test is flaky by nature as the event source load and navigation load are happening asynchronously.
In most cases but not always, the loading of the CachedResource will fail synchronously and will trigger the console message.
Do not output the console log message since the goal of the test is to not crash.

* http/tests/eventsource/eventsource-reconnect-during-navigate-crash-expected.txt:
* http/tests/eventsource/eventsource-reconnect-during-navigate-crash.html:
* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262213 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoMake sure bundle identifier testing override is set in the network process
katherine_cheney@apple.com [Wed, 27 May 2020 20:38:43 +0000 (20:38 +0000)]
Make sure bundle identifier testing override is set in the network process
https://bugs.webkit.org/show_bug.cgi?id=212288
<rdar://problem/63539061>

Reviewed by Chris Dumez.

Set the bundle identifier in the network process if a layout test
updates it. This value usually only gets updated when a new network
process is initialized, which does not happen for every test. So it
should be set/cleared as needed.

Source/WebKit:

No new tests, will fix http/tests/in-app-browser-privacy/ tests.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::updateBundleIdentifierInNetworkProcess):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreUpdateBundleIdentifierInNetworkProcess):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::updateBundleIdentifierInNetworkProcess):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::updateBundleIdentifierInNetworkProcess):
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::updateBundleIdentifierInNetworkProcess):
* WebKitTestRunner/TestController.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262212 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago-Wdeprecated-copy caused by Bitmap copy assignment operator
commit-queue@webkit.org [Wed, 27 May 2020 20:15:47 +0000 (20:15 +0000)]
-Wdeprecated-copy caused by Bitmap copy assignment operator
https://bugs.webkit.org/show_bug.cgi?id=212421

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2020-05-27
Reviewed by Mark Lam.

This copy assignment operator is not needed, and causes warnings because we do not have a
corresponding copy constructor. We could add a copy constructor, but it's easiest to just
remove the copy assignment operator.

* wtf/Bitmap.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262211 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviwed, catch expected exception in new test.
keith_miller@apple.com [Wed, 27 May 2020 20:08:26 +0000 (20:08 +0000)]
Unreviwed, catch expected exception in new test.

* stress/for-in-in-structure-property-constant-virtual-register.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262210 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[Clipboard API] Support reading "image/png" on ClipboardItem
wenson_hsieh@apple.com [Wed, 27 May 2020 19:50:42 +0000 (19:50 +0000)]
[Clipboard API] Support reading "image/png" on ClipboardItem
https://bugs.webkit.org/show_bug.cgi?id=212339
<rdar://problem/63588957>

Reviewed by Tim Horton.

Source/WebCore:

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):

Source/WebCore/PAL:

Soft link `UIImagePNGRepresentation`.

* pal/ios/UIKitSoftLink.h:
* pal/ios/UIKitSoftLink.mm:

Tools:

Add a new API test to verify that TIFF images on the system pasteboard on macOS are automatically converted to
PNG data, and is accessible through `ClipboardItem` through the "image/png" type.

* TestWebKitAPI/Tests/WebKitCocoa/ClipboardTests.mm:

LayoutTests:

Add a new layout test to verify that `Clipboard.write` and `Clipboard.read` can be used to copy and then read
back PNG image data.

* editing/async-clipboard/clipboard-read-write-images-expected.txt: Added.
* editing/async-clipboard/clipboard-read-write-images.html: Added.
* editing/async-clipboard/resources/async-clipboard-helpers.js:
(sampleBase64PNGImageData1):
(sampleBase64PNGImageData2):
(imageBlob):
(sampleBase64PNGImageData): Deleted.
* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262209 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION (r254541): Valid mime types can only be added to the HashSet of the suppor...
commit-queue@webkit.org [Wed, 27 May 2020 19:48:51 +0000 (19:48 +0000)]
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

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-05-27
Reviewed by Darin Adler.

Add back a check for the mime type validity which was removed in r254541.

* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::createMIMETypeRegistryThreadGlobalData):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262208 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed, reverting r260840.
pvollan@apple.com [Wed, 27 May 2020 19:35:15 +0000 (19:35 +0000)]
Unreviewed, reverting r260840.

This patch is no longer needed after preferences root cause
has been fixed.

Reverted changeset:

"[Cocoa] Global preferences are not accessible in the
WebContent process when CFPrefs direct mode is enabled"
https://bugs.webkit.org/show_bug.cgi?id=211075
https://trac.webkit.org/changeset/260840

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262207 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed, fix -Wcomment build warning after r261986
commit-queue@webkit.org [Wed, 27 May 2020 19:10:39 +0000 (19:10 +0000)]
Unreviewed, fix -Wcomment build warning after r261986
https://bugs.webkit.org/show_bug.cgi?id=211950
<rdar://problem/63482718>

If we replace the /* with /&ast; then GCC won't complain that it looks like a comment.

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2020-05-27

* UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_class_init):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262205 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAdjust HTTP3 label to the more correct HTTP/3
bfulgham@apple.com [Wed, 27 May 2020 18:18:39 +0000 (18:18 +0000)]
Adjust HTTP3 label to the more correct HTTP/3
https://bugs.webkit.org/show_bug.cgi?id=212416
<rdar://problem/63514072>

Reviewed by Darin Adler.

No new tests. No change in behavior.

* Shared/WebPreferences.yaml: Correct label.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262204 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: replace `featureGuard` and `availability` with a combined `condition...
drousso@apple.com [Wed, 27 May 2020 18:09:46 +0000 (18:09 +0000)]
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.

Source/JavaScriptCore:

* inspector/protocol/CPUProfiler.json:
* inspector/protocol/Canvas.json:
* inspector/protocol/DOM.json:
* inspector/protocol/IndexedDB.json:
* inspector/protocol/Inspector.json:
* inspector/protocol/Memory.json:
* inspector/protocol/Page.json:
* inspector/protocol/ServiceWorker.json:

* Scripts/generate-derived-sources.sh:
Set `CC` if it hasn't already been set.

* DerivedSources.make:
* DerivedSources-input.xcfilelist:
Preprocess `InspectorBackendCommands.js.in` to get an accurate `InspectorBackendCommands.js`
that follows the logic/description above.

* CMakeLists.txt:
Create a new `InspectorBackendCommands` target now that `InspectorBackendCommands.js` is
generated seprately from the rest of the protocol files.

* Configurations/FeatureDefines.xcconfig:
Add `ENABLE_WEB_ARCHIVE` since it's always enabled in wtf/PlatformEnableCocoa.h.

* inspector/scripts/generate-inspector-protocol-bindings.py:
(generate_from_specification):
(generate_from_specification.load_specification):
* inspector/scripts/codegen/generator.py:
(Generator.__init__):
(Generator.model):
(Generator.set_generator_setting):
(Generator.type_declarations_for_domain):
(Generator.commands_for_domain):
(Generator.events_for_domain):
(Generator.wrap_with_guard_for_condition): Added.
(Generator.platform): Deleted.
(Generator.can_generate_platform): Deleted.
(Generator.wrap_with_guard_for_domain): Deleted.
(Generator.wrap_with_guard): Deleted.
* inspector/scripts/codegen/models.py:
(Frameworks):
(Protocol.parse_domain):
(Protocol.parse_type_declaration):
(Protocol.parse_command):
(Protocol.parse_event):
(Domain.__init__):
(TypeDeclaration.__init__):
(Command.__init__):
(Event.__init__):
(Platform): Deleted.
(Platform.__init__): Deleted.
(Platform.fromString): Deleted.
(Platforms): Deleted.
(Platforms.__metaclass__): Deleted.
(Platforms.__metaclass__.__iter__): Deleted.
* inspector/scripts/codegen/generator_templates.py:
Remove `platform` as it is handled by `condition`.

* inspector/scripts/codegen/preprocess.pl: Copied from Source/WebCore/bindings/scripts/preprocessor.pm.

* inspector/scripts/codegen/generate_js_backend_commands.py:
(JSBackendCommandsGenerator.output_filename):
(JSBackendCommandsGenerator.generate_domain):
Output to `InspectorBackendCommands.js.in` that includes `#if` for preprocessing.

* inspector/scripts/codegen/cpp_generator_templates.py:
* inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py:
(CppAlternateBackendDispatcherHeaderGenerator.generate_output):
(CppAlternateBackendDispatcherHeaderGenerator._generate_handler_declarations_for_domain):
(CppAlternateBackendDispatcherHeaderGenerator._generate_handler_declaration_for_command):
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py:
(CppBackendDispatcherHeaderGenerator._generate_alternate_handler_forward_declarations_for_domains.Alternate):
(CppBackendDispatcherHeaderGenerator._generate_handler_declarations_for_domain):
(CppBackendDispatcherHeaderGenerator._generate_handler_declaration_for_command):
(CppBackendDispatcherHeaderGenerator._generate_async_handler_declaration_for_command):
(CppBackendDispatcherHeaderGenerator._generate_dispatcher_declarations_for_domain):
(CppBackendDispatcherHeaderGenerator._generate_dispatcher_declaration_for_command):
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:
(CppBackendDispatcherImplementationGenerator.generate_output):
(CppBackendDispatcherImplementationGenerator._generate_handler_class_destructor_for_domain):
(CppBackendDispatcherImplementationGenerator._generate_dispatcher_implementations_for_domain):
(CppBackendDispatcherImplementationGenerator._generate_small_dispatcher_switch_implementation_for_domain):
(CppBackendDispatcherImplementationGenerator._generate_large_dispatcher_switch_implementation_for_domain):
(CppBackendDispatcherImplementationGenerator._generate_async_dispatcher_class_for_domain):
(CppBackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command):
* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py:
(CppFrontendDispatcherHeaderGenerator._generate_dispatcher_declarations_for_domain):
(CppFrontendDispatcherHeaderGenerator._generate_dispatcher_declaration_for_event):
* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py:
(CppFrontendDispatcherImplementationGenerator._generate_dispatcher_implementations_for_domain):
(CppFrontendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_event):
* inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
(CppProtocolTypesHeaderGenerator._generate_versions):
* inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
(CppProtocolTypesImplementationGenerator._generate_enum_conversion_methods_for_domain.generate_conversion_method_body):
(CppProtocolTypesImplementationGenerator._generate_enum_conversion_methods_for_domain):
(CppProtocolTypesImplementationGenerator._generate_open_field_names):
(CppProtocolTypesImplementationGenerator._generate_builders_for_domain):
* inspector/scripts/codegen/objc_generator_templates.py:
* inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py:
(ObjCBackendDispatcherHeaderGenerator._generate_objc_handler_declarations_for_domain):
(ObjCBackendDispatcherHeaderGenerator._generate_objc_handler_declaration_for_command):
* inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py:
(ObjCBackendDispatcherImplementationGenerator._generate_handler_implementation_for_domain):
(ObjCBackendDispatcherImplementationGenerator._generate_handler_implementation_for_command):
* inspector/scripts/codegen/generate_objc_header.py:
(add_newline):
(ObjCHeaderGenerator.generate_output):
(ObjCHeaderGenerator._generate_forward_declarations):
(ObjCHeaderGenerator._generate_enums):
(ObjCHeaderGenerator._generate_types):
(ObjCHeaderGenerator._generate_type_interface):
(ObjCHeaderGenerator._generate_command_protocols):
(ObjCHeaderGenerator._generate_single_command_protocol):
(ObjCHeaderGenerator._generate_event_interfaces):
(ObjCHeaderGenerator._generate_single_event_interface):
(ObjCHeaderGenerator._generate_enum_for_platforms): Deleted.
* inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py:
(add_newline):
(ObjCProtocolTypeConversionsHeaderGenerator.generate_output):
(ObjCProtocolTypeConversionsHeaderGenerator._generate_enum_conversion_functions):
(ObjCProtocolTypeConversionsHeaderGenerator._generate_enum_conversion_for_platforms): Deleted.
* inspector/scripts/codegen/generate_objc_protocol_type_conversions_implementation.py:
(add_newline):
(ObjCProtocolTypeConversionsImplementationGenerator._generate_type_factory_category_interface):
(ObjCProtocolTypeConversionsImplementationGenerator._generate_type_factory_method_declaration):
(ObjCProtocolTypeConversionsImplementationGenerator._generate_type_factory_category_implementation):
(ObjCProtocolTypeConversionsImplementationGenerator._generate_type_factory_method_implementation):
* inspector/scripts/codegen/generate_objc_protocol_types_implementation.py:
(add_newline):
(ObjCProtocolTypesImplementationGenerator.generate_type_implementations):
(ObjCProtocolTypesImplementationGenerator.generate_type_implementation):
Wrap each domain, type, command, and event with the associated `condition` (if it exists).

* inspector/scripts/tests/command-targetType-matching-domain-debuggableType.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/command-targetType-matching-domain-debuggableType.json.
* inspector/scripts/tests/commands-with-async-attribute.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/commands-with-async-attribute.json.
* inspector/scripts/tests/commands-with-optional-call-return-parameters.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/commands-with-optional-call-return-parameters.json.
* inspector/scripts/tests/definitions-with-mac-platform.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/mac/definitions-with-mac-platform.json.
* inspector/scripts/tests/domain-debuggableTypes.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/domain-debuggableTypes.json.
* inspector/scripts/tests/domain-targetType-matching-domain-debuggableType.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/domain-targetType-matching-domain-debuggableType.json.
* inspector/scripts/tests/domain-targetTypes.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/domain-targetTypes.json.
* inspector/scripts/tests/domains-with-varying-command-sizes.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/domains-with-varying-command-sizes.json.
* inspector/scripts/tests/enum-values.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/enum-values.json.
* inspector/scripts/tests/event-targetType-matching-domain-debuggableType.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/event-targetType-matching-domain-debuggableType.json.
* inspector/scripts/tests/events-with-optional-parameters.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/events-with-optional-parameters.json.
* inspector/scripts/tests/expected/command-targetType-matching-domain-debuggableType.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/command-targetType-matching-domain-debuggableType.json-result.
* inspector/scripts/tests/expected/commands-with-async-attribute.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result.
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result.
* inspector/scripts/tests/expected/definitions-with-mac-platform.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result.
* inspector/scripts/tests/expected/domain-debuggableTypes.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-debuggableTypes.json-result.
* inspector/scripts/tests/expected/domain-targetType-matching-domain-debuggableType.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-targetType-matching-domain-debuggableType.json-result.
* inspector/scripts/tests/expected/domain-targetTypes.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-targetTypes.json-result.
* inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result.
* inspector/scripts/tests/expected/enum-values.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/enum-values.json-result.
* inspector/scripts/tests/expected/event-targetType-matching-domain-debuggableType.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/event-targetType-matching-domain-debuggableType.json-result.
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result.
* inspector/scripts/tests/expected/fail-on-command-targetType-matching-domain-debuggableType.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-command-targetType-matching-domain-debuggableType.json-error.
* inspector/scripts/tests/expected/fail-on-command-targetTypes-type.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-command-targetTypes-type.json-error.
* inspector/scripts/tests/expected/fail-on-command-targetTypes-value.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-command-targetTypes-value.json-error.
* inspector/scripts/tests/expected/fail-on-domain-debuggableTypes-type.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-debuggableTypes-type.json-error.
* inspector/scripts/tests/expected/fail-on-domain-debuggableTypes-value.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-debuggableTypes-value.json-error.
* inspector/scripts/tests/expected/fail-on-domain-targetType-matching-domain-debuggableType.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-targetType-matching-domain-debuggableType.json-error.
* inspector/scripts/tests/expected/fail-on-domain-targetTypes-type.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-targetTypes-type.json-error.
* inspector/scripts/tests/expected/fail-on-domain-targetTypes-value.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-targetTypes-value.json-error.
* inspector/scripts/tests/expected/fail-on-duplicate-command-call-parameter-names.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-command-call-parameter-names.json-error.
* inspector/scripts/tests/expected/fail-on-duplicate-command-return-parameter-names.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-command-return-parameter-names.json-error.
* inspector/scripts/tests/expected/fail-on-duplicate-event-parameter-names.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-event-parameter-names.json-error.
* inspector/scripts/tests/expected/fail-on-duplicate-type-declarations.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-type-declarations.json-error.
* inspector/scripts/tests/expected/fail-on-duplicate-type-member-names.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-duplicate-type-member-names.json-error.
* inspector/scripts/tests/expected/fail-on-enum-with-no-values.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-enum-with-no-values.json-error.
* inspector/scripts/tests/expected/fail-on-event-targetType-matching-domain-debuggableType.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-event-targetType-matching-domain-debuggableType.json-error.
* inspector/scripts/tests/expected/fail-on-event-targetTypes-type.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-event-targetTypes-type.json-error.
* inspector/scripts/tests/expected/fail-on-event-targetTypes-value.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-event-targetTypes-value.json-error.
* inspector/scripts/tests/expected/fail-on-number-typed-optional-parameter-flag.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-number-typed-optional-parameter-flag.json-error.
* inspector/scripts/tests/expected/fail-on-number-typed-optional-type-member.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-number-typed-optional-type-member.json-error.
* inspector/scripts/tests/expected/fail-on-string-typed-optional-parameter-flag.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-string-typed-optional-parameter-flag.json-error.
* inspector/scripts/tests/expected/fail-on-string-typed-optional-type-member.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-string-typed-optional-type-member.json-error.
* inspector/scripts/tests/expected/fail-on-type-declaration-using-type-reference.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-declaration-using-type-reference.json-error.
* inspector/scripts/tests/expected/fail-on-type-reference-as-primitive-type.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-reference-as-primitive-type.json-error.
* inspector/scripts/tests/expected/fail-on-type-with-lowercase-name.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-type-with-lowercase-name.json-error.
* inspector/scripts/tests/expected/fail-on-unknown-type-reference-in-type-declaration.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-unknown-type-reference-in-type-declaration.json-error.
* inspector/scripts/tests/expected/fail-on-unknown-type-reference-in-type-member.json-error: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-unknown-type-reference-in-type-member.json-error.
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result.
* inspector/scripts/tests/expected/same-type-id-different-domain.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result.
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result.
* inspector/scripts/tests/expected/should-strip-comments.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/should-strip-comments.json-result.
* inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result.
* inspector/scripts/tests/expected/type-declaration-array-type.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result.
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result.
* inspector/scripts/tests/expected/type-declaration-object-type.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result.
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result.
* inspector/scripts/tests/expected/type-with-open-parameters.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-with-open-parameters.json-result.
* inspector/scripts/tests/expected/version.json-result: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/version.json-result.
* inspector/scripts/tests/fail-on-command-targetType-matching-domain-debuggableType.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-command-targetType-matching-domain-debuggableType.json.
* inspector/scripts/tests/fail-on-command-targetTypes-type.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-command-targetTypes-type.json.
* inspector/scripts/tests/fail-on-command-targetTypes-value.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-command-targetTypes-value.json.
* inspector/scripts/tests/fail-on-domain-debuggableTypes-type.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-debuggableTypes-type.json.
* inspector/scripts/tests/fail-on-domain-debuggableTypes-value.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-debuggableTypes-value.json.
* inspector/scripts/tests/fail-on-domain-targetType-matching-domain-debuggableType.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-targetType-matching-domain-debuggableType.json.
* inspector/scripts/tests/fail-on-domain-targetTypes-type.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-targetTypes-type.json.
* inspector/scripts/tests/fail-on-domain-targetTypes-value.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-targetTypes-value.json.
* inspector/scripts/tests/fail-on-duplicate-command-call-parameter-names.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-command-call-parameter-names.json.
* inspector/scripts/tests/fail-on-duplicate-command-return-parameter-names.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-command-return-parameter-names.json.
* inspector/scripts/tests/fail-on-duplicate-event-parameter-names.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-event-parameter-names.json.
* inspector/scripts/tests/fail-on-duplicate-type-declarations.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-type-declarations.json.
* inspector/scripts/tests/fail-on-duplicate-type-member-names.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-duplicate-type-member-names.json.
* inspector/scripts/tests/fail-on-enum-with-no-values.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-enum-with-no-values.json.
* inspector/scripts/tests/fail-on-event-targetType-matching-domain-debuggableType.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-event-targetType-matching-domain-debuggableType.json.
* inspector/scripts/tests/fail-on-event-targetTypes-type.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-event-targetTypes-type.json.
* inspector/scripts/tests/fail-on-event-targetTypes-value.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-event-targetTypes-value.json.
* inspector/scripts/tests/fail-on-number-typed-optional-parameter-flag.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-number-typed-optional-parameter-flag.json.
* inspector/scripts/tests/fail-on-number-typed-optional-type-member.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-number-typed-optional-type-member.json.
* inspector/scripts/tests/fail-on-string-typed-optional-parameter-flag.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-string-typed-optional-parameter-flag.json.
* inspector/scripts/tests/fail-on-string-typed-optional-type-member.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-string-typed-optional-type-member.json.
* inspector/scripts/tests/fail-on-type-declaration-using-type-reference.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-declaration-using-type-reference.json.
* inspector/scripts/tests/fail-on-type-reference-as-primitive-type.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-reference-as-primitive-type.json.
* inspector/scripts/tests/fail-on-type-with-lowercase-name.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-type-with-lowercase-name.json.
* inspector/scripts/tests/fail-on-unknown-type-reference-in-type-declaration.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-unknown-type-reference-in-type-declaration.json.
* inspector/scripts/tests/fail-on-unknown-type-reference-in-type-member.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-unknown-type-reference-in-type-member.json.
* inspector/scripts/tests/generate-domains-with-feature-guards.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/generate-domains-with-feature-guards.json.
* inspector/scripts/tests/same-type-id-different-domain.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/same-type-id-different-domain.json.
* inspector/scripts/tests/shadowed-optional-type-setters.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/shadowed-optional-type-setters.json.
* inspector/scripts/tests/should-strip-comments.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/should-strip-comments.json.
* inspector/scripts/tests/type-declaration-aliased-primitive-type.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-aliased-primitive-type.json.
* inspector/scripts/tests/type-declaration-array-type.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-array-type.json.
* inspector/scripts/tests/type-declaration-enum-type.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-enum-type.json.
* inspector/scripts/tests/type-declaration-object-type.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/type-declaration-object-type.json.
* inspector/scripts/tests/type-requiring-runtime-casts.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/type-requiring-runtime-casts.json.
* inspector/scripts/tests/type-with-open-parameters.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/type-with-open-parameters.json.
* inspector/scripts/tests/version.json: Renamed from Source/JavaScriptCore/inspector/scripts/tests/generic/version.json.
* inspector/scripts/tests/generic/definitions-with-mac-platform.json: Removed.
* inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result: Removed.
* inspector/scripts/tests/generic/fail-on-command-with-invalid-platform.json: Removed.
* inspector/scripts/tests/generic/expected/fail-on-command-with-invalid-platform.json-error: Removed.
* inspector/scripts/tests/generic/fail-on-type-with-invalid-platform.json: Removed.
* inspector/scripts/tests/generic/expected/fail-on-type-with-invalid-platform.json-error: Removed.
* inspector/scripts/tests/ios/definitions-with-mac-platform.json: Removed.
* inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result: Removed.
* inspector/scripts/tests/all/definitions-with-mac-platform.json: Removed.
* inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result: Removed.
Don't separate the inspector generator tests by platform.

Source/WebCore:

* 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=]`.
Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:
Add `ENABLE_WEB_ARCHIVE` since it's always enabled in wtf/PlatformEnableCocoa.h.

Source/WebInspectorUI:

* CMakeLists.txt:
Add a dependency on the new `InspectorBackendCommands` target.

* UserInterface/Base/Main.js:
(WI._updateDownloadTabBarButton):

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
Add `ENABLE_WEB_ARCHIVE` since it's always enabled in wtf/PlatformEnableCocoa.h.

* DerivedSources.make:
* PlatformMac.cmake:
Remove `platform` as it is handled by `condition`.

* UIProcess/Automation/Automation.json:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:
Add `ENABLE_WEB_ARCHIVE` since it's always enabled in wtf/PlatformEnableCocoa.h.

Tools:

* Configurations/FeatureDefines.xcconfig:
Add `ENABLE_WEB_ARCHIVE` since it's always enabled in wtf/PlatformEnableCocoa.h.

* Scripts/webkitpy/inspector/main.py:
(InspectorGeneratorTests.generate_from_json):
(InspectorGeneratorTests.run_tests):
(InspectorGeneratorTests.main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262203 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[ macOS ] http/tests/media/now-playing-info.html is flaky failing
ryanhaddad@apple.com [Wed, 27 May 2020 18:04:10 +0000 (18:04 +0000)]
[ macOS ] http/tests/media/now-playing-info.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=206699

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations: Remove flaky expectation since the test is consistently passing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262202 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[GTK] Manette_INCLUDE_DIR and Manette_LIBRARY are undefined.
changseok@webkit.org [Wed, 27 May 2020 17:52:36 +0000 (17:52 +0000)]
[GTK] Manette_INCLUDE_DIR and Manette_LIBRARY are undefined.
https://bugs.webkit.org/show_bug.cgi?id=212236

Reviewed by Michael Catanzaro.

The cmake complains Manette_INCLUDE_DIR and Manette_LIBRARY are missing
in finding the manette package where GAMEPAD is enabled for the gtk port.
In r261965, we thought they would be automatically defined with IMPORTED_TARGET
but they seem not. We explicitly find the header and library paths, following FindOpenJPEG.cmake.

* Source/cmake/FindManette.cmake:
* Source/cmake/OptionsGTK.cmake: REQUIRED removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262201 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[Quirk] Remove stackoverflow.com desktop content quirk.
zalan@apple.com [Wed, 27 May 2020 17:40:32 +0000 (17:40 +0000)]
[Quirk] Remove stackoverflow.com desktop content quirk.
https://bugs.webkit.org/show_bug.cgi?id=212414

Reviewed by Antti Koivisto.

Mobile content is fixed now.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::desktopClassBrowsingRecommendedForRequest):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262200 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoSort PlatformEnableCocoa.h and add definitions for the simple cases from FeatureDefin...
darin@apple.com [Wed, 27 May 2020 17:22:31 +0000 (17:22 +0000)]
Sort PlatformEnableCocoa.h and add definitions for the simple cases from FeatureDefines.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=212389

Reviewed by Anders Carlsson.

Added more PlatformEnableCocoa.h; allowing us to later remove things from
FeatureDefines.xcconfig (patch forthcoming).

* wtf/PlatformEnableCocoa.h: Added definitions from FeatureDefines.xcconfig that
were simple, and that differ from the defaults in PlatformEnable.h. That includes
3D_TRANSFORMS, ACCESSIBILITY_ISOLATED_TREE (macOS >= 10.6), APPLICATION_MANIFEST,
ASYNC_SCROLLING, ATTACHMENT_ELEMENT, AVF_CAPTIONS, CACHE_PARTITIONING,
CSS_COMPOSITING, CSS_PAINTING_API, CSS_SCROLL_SNAP, CSS_SELECTORS_LEVEL4,
CSS_TRAILING_WORD, CSS_TYPED_OM, DATACUE_VALUE, DATALIST_ELEMENT, FILTERS_LEVEL_2,
GPU_PROCESS, INDEXED_DATABASE, INDEXED_DATABASE_IN_WORKERS, INSPECTOR_TELEMETRY,
INTERSECTION_OBSERVER, LAYOUT_FORMATTING_CONTEXT, LEGACY_CSS_VENDOR_PREFIXES,
LEGACY_CUSTOM_PROTOCOL_MANAGER, MEDIA_CONTROLS_SCRIPT, MEMORY_SAMPLER,
MOUSE_CURSOR_SCALE (macOS), NETWORK_CACHE_SPECULATIVE_REVALIDATION,
NETWORK_CACHE_STALE_WHILE_REVALIDATE, NOTIFICATIONS (macOS), PDFKIT_PLUGIN (macOS),
PERIODIC_MEMORY_MONITOR (macOS), PUBLIC_SUFFIX_LIST, RESIZE_OBSERVER,
RESOURCE_LOAD_STATISTICS, RUBBER_BANDING (macOS), SANDBOX_EXTENSIONS,
SERVER_PRECONNECT, SERVICE_CONTROLS (macOS), SHAREABLE_RESOURCE,
TELEPHONE_NUMBER_DETECTION, TEXT_AUTOSIZING, USERSELECT_ALL, USER_MESSAGE_HANDLERS,
VARIATION_FONTS, VIDEO, VIDEO_USES_ELEMENT_FULLSCREEN (macOS),
WEBDRIVER_KEYBOARD_INTERACTIONS, WEBDRIVER_MOUSE_INTERACTIONS (macOS),
WEBGL, WEBGL2, WEB_AUDIO, WEB_CRYPTO, and WIRELESS_PLAYBACK_TARGET. Sorted and
merged all the existing settings.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262199 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION: [ Mac wk2 ] fast/mediastream/mock-media-source-webaudio.html is flaky...
lawrence.j@apple.com [Wed, 27 May 2020 16:59:38 +0000 (16:59 +0000)]
REGRESSION: [ Mac wk2 ] fast/mediastream/mock-media-source-webaudio.html is flaky timing out.
https://bugs.webkit.org/show_bug.cgi?id=212413

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262198 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoin_structure_property needs to handle constants on the RHS of the "in"
keith_miller@apple.com [Wed, 27 May 2020 16:28:50 +0000 (16:28 +0000)]
in_structure_property needs to handle constants on the RHS of the "in"
https://bugs.webkit.org/show_bug.cgi?id=212399

Reviewed by Saam Barati.

JSTests:

* stress/for-in-in-structure-property-constant-virtual-register.js: Added.

Source/JavaScriptCore:

* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262197 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoCrash under WebNotificationManager::removeNotificationFromContextMap()
cdumez@apple.com [Wed, 27 May 2020 16:11:07 +0000 (16:11 +0000)]
Crash under WebNotificationManager::removeNotificationFromContextMap()
https://bugs.webkit.org/show_bug.cgi?id=212410
<rdar://63496726>

Reviewed by Alex Christensen.

Source/WebKit:

Protect the notification object in WebNotificationManager::didDestroyNotification() since
removing it from m_notificationIDMap will deref it and may end up destroying the notification
object otherwise.

Test: http/tests/notifications/crash-on-navigation.html

* WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit::WebNotificationManager::didDestroyNotification):

LayoutTests:

Add layout test coverage.

* http/tests/notifications/crash-on-navigation-expected.txt: Added.
* http/tests/notifications/crash-on-navigation.html: Added.
* http/tests/notifications/resources/crash-on-navigation-iframe.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262196 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[ Catalina wk2 ] webrtc/video-autoplay1.html is flaky failing.
lawrence.j@apple.com [Wed, 27 May 2020 15:45:06 +0000 (15:45 +0000)]
[ Catalina wk2 ] webrtc/video-autoplay1.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=209018

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262195 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[WPE] REGRESSION(r253675) Crash when using threaded rendering
magomez@igalia.com [Wed, 27 May 2020 13:25:45 +0000 (13:25 +0000)]
[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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262194 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed. [GTK] Make webkitWebViewBaseSnapshot static
carlosgc@webkit.org [Wed, 27 May 2020 12:04:50 +0000 (12:04 +0000)]
Unreviewed. [GTK] Make webkitWebViewBaseSnapshot static

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseSnapshot):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262193 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed. Fix build warning with GTK4
carlosgc@webkit.org [Wed, 27 May 2020 12:03:31 +0000 (12:03 +0000)]
Unreviewed. Fix build warning with GTK4

* platform/gtk/GtkUtilities.cpp:
(WebCore::widgetRootCoords):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262192 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[Flatpak SDK] Update openxr recipe
commit-queue@webkit.org [Wed, 27 May 2020 10:34:26 +0000 (10:34 +0000)]
[Flatpak SDK] Update openxr recipe
https://bugs.webkit.org/show_bug.cgi?id=212403

Patch by Philippe Normand <pnormand@igalia.com> on 2020-05-27
Reviewed by Sergio Villar Senin.

* buildstream/elements/sdk/openxr.bst: Explicitely list dependencies and bump to latest git master.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262191 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUse OptionSet<DragDestinationAction> for mask values
ddkilzer@apple.com [Wed, 27 May 2020 10:23:17 +0000 (10:23 +0000)]
Use OptionSet<DragDestinationAction> for mask values
<https://webkit.org/b/212115>
<rdar://problem/63423380>

Reviewed by Alex Christensen.

Source/WebCore:

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):

Source/WebKit:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DragData>::encode):
(IPC::ArgumentCoder<DragData>::decode):
- Switch from decodeEnum() and encodeEnum() to modern
  equivalents that check for valid enum values.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::draggingEntered):
(WebKit::WebViewImpl::draggingUpdated):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView dragDataForDropSession:dragDestinationAction:]):
* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::willPerformDragDestinationAction):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebDragClient.mm:
(WebDragClient::willPerformDragDestinationAction):
* WebView/WebView.mm:
(-[WebView dragDataForSession:client:global:operation:]):
(-[WebView actionMaskForDraggingInfo:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262190 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoVideo freezes when attaching a local MediaStream to multiple elements
youenn@apple.com [Wed, 27 May 2020 09:38:28 +0000 (09:38 +0000)]
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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262189 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[WebXR] Implement XRSession::requestAnimationFrame()
svillar@igalia.com [Wed, 27 May 2020 09:36:47 +0000 (09:36 +0000)]
[WebXR] Implement XRSession::requestAnimationFrame()
https://bugs.webkit.org/show_bug.cgi?id=212099

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/webxr/xrSession_cancelAnimationFrame.https-expected.txt: Added.
* web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https-expected.txt: Added.
* web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https-expected.txt: Added.

Source/WebCore:

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:

LayoutTests:

* platform/wpe/TestExpectations: Unskipped several tests that are now passing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262188 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[GTK4] Make PointerLock work
carlosgc@webkit.org [Wed, 27 May 2020 08:09:35 +0000 (08:09 +0000)]
[GTK4] Make PointerLock work
https://bugs.webkit.org/show_bug.cgi?id=212314

Reviewed by Adrian Perez de Castro.

Source/WebCore:

* platform/gtk/GtkUtilities.cpp:
(WebCore::widgetDevicePosition): Helper function to avoid #ifdefs due to GTK version differences.
* platform/gtk/GtkUtilities.h:

Source/WebKit:

Use XLib API for warp and grab, since they are no longer available in GTK4. The grab was not actuially needed
under Wayland. Also stop using GdkEvent to keep track of motion events and create the PointerLockManager to be
able to test pointer lock and movement delta.

* Shared/NativeWebMouseEvent.h:
* Shared/gtk/NativeWebMouseEventGtk.cpp:
(WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Use FloatSize instead of FloatPoint for movement delta.
* Shared/gtk/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebMouseEvent): Ditto.
* Shared/gtk/WebEventFactory.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(MotionEvent::MotionEvent): Helper struct to keep track of motion events without using GdkEvent.
(MotionEvent::delta): Return the movement delta for the given current event.
(webkitWebViewBaseHandleMouseEvent): Use MotionEvent instead of GdkEvent.
(webkitWebViewBaseMotionNotifyEvent): Pass the event coordinates to the pointer lock manager since that's the
only thing needed.
(webkitWebViewBaseRequestPointerLock): Use MotionEvent instead of GdkEvent.
(webkitWebViewBaseDidLosePointerLock): Remove GTK4 ifdefs.
(webkitWebViewBaseSynthesizeMouseEvent): Forward the event to the pointer lock manager if present. Also keep
track of the motion event and set the movement delta.
* UIProcess/gtk/PointerLockManager.cpp:
(WebKit::PointerLockManager::create): Receive event information as parameters instead of using GdkEvent.
(WebKit::PointerLockManager::PointerLockManager): Ditto.
(WebKit::PointerLockManager::~PointerLockManager):
(WebKit::PointerLockManager::lock): Remove the grab.
(WebKit::PointerLockManager::unlock): Remove the ungrab.
(WebKit::PointerLockManager::handleMotion): Use NativeWebMouseEvent constructor taking all information as parameters.
* UIProcess/gtk/PointerLockManager.h:
* UIProcess/gtk/PointerLockManagerWayland.cpp:
(WebKit::PointerLockManagerWayland::PointerLockManagerWayland): Receive event information as parameters instead of using GdkEvent.
(WebKit::PointerLockManagerWayland::lock): Hide the cursor.
(WebKit::PointerLockManagerWayland::unlock): Unhide the cursor.
* UIProcess/gtk/PointerLockManagerWayland.h:
* UIProcess/gtk/PointerLockManagerX11.cpp:
(WebKit::PointerLockManagerX11::PointerLockManagerX11): Receive event information as parameters instead of using GdkEvent.
(WebKit::PointerLockManagerX11::lock): Use XGrabPointer.
(WebKit::PointerLockManagerX11::unlock): Use XUngrabPointer.
(WebKit::PointerLockManagerX11::didReceiveMotionEvent): Use XWarpPointer.
* UIProcess/gtk/PointerLockManagerX11.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262187 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed, build warning fix after r261986
philn@webkit.org [Wed, 27 May 2020 07:53:39 +0000 (07:53 +0000)]
Unreviewed, build warning fix after r261986

* UIProcess/API/glib/WebKitSettings.cpp: A colon is needed after the transfer annotation.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262186 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoVideoFullscreenInterfaceAVKit is leaking when a video element enters and exits fullsc...
peng.liu6@apple.com [Wed, 27 May 2020 07:50:44 +0000 (07:50 +0000)]
VideoFullscreenInterfaceAVKit is leaking when a video element enters and exits fullscreen/picture-in-picture
https://bugs.webkit.org/show_bug.cgi?id=212293

Source/WebCore:

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):

Source/WebKit:

VideoFullscreenManagerProxy::ensureInterface() makes sure a fullscreen interface object exists (an object
will be created if it does not exit). That means an extra object will be created by an IPC message from
the Web process after the original video fullscreen interface object has been destroyed (thats happens
when a video element is returning to inline from fullscreen or picture-in-picture).

Reviewed by Youenn Fablet.

* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::setHasVideo):
Don't call VideoFullscreenInterface[AVKit|Mac]::hasVideoChanged() before the instance of
VideoFullscreenInterface[AVKit|Mac] is ready.
(WebKit::VideoFullscreenManagerProxy::setVideoDimensions):
Don't call VideoFullscreenInterface[AVKit|Mac]::videoDimensionsChanged() after the instance of
VideoFullscreenInterface[AVKit|Mac] is destroyed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262185 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[GTK][WTR] EventSender: stop using GdkEvent API in preparation for GTK4
carlosgc@webkit.org [Wed, 27 May 2020 07:49:41 +0000 (07:49 +0000)]
[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.

Source/WebCore:

Add helpers to GtkUtilities to avoid #ifdefs due to GTK version differences.

* platform/gtk/GtkUtilities.cpp:
(WebCore::widgetRootCoords):
(WebCore::widgetKeyvalToKeycode):
* platform/gtk/GtkUtilities.h:

Source/WebKit:

Add internal API to WebKitWebViewBase to synthesize events, because with GTK4 it's not possible to
create events. In the case of layout tests, the web view is always the target of the events, so we don't really
need to send the events to GTK to process them.

* Shared/NativeWebKeyboardEvent.h: Add new constructor that doesn't receive a GdkEvent.
* Shared/NativeWebMouseEvent.h: Ditto.
* Shared/NativeWebWheelEvent.h: Ditto.
* Shared/gtk/NativeWebKeyboardEventGtk.cpp:
(WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Create without a GdkEvent.
* Shared/gtk/NativeWebMouseEventGtk.cpp:
(WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Ditto.
* Shared/gtk/NativeWebWheelEventGtk.cpp:
(WebKit::NativeWebWheelEvent::NativeWebWheelEvent): Ditto.
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::doneWithKeyEvent): Return early if event doesn't have a GdkEvent.
(WebKit::PageClientImpl::doneWithTouchEvent): Ditto.
(WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Ditto.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(toWebKitModifiers):
(webkitWebViewBaseSynthesizeMouseEvent):
(webkitWebViewBaseSynthesizeKeyEvent):
(toWebKitWheelEventPhase):
(webkitWebViewBaseSynthesizeWheelEvent):
* UIProcess/API/gtk/WebKitWebViewBaseInternal.h: Added.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::activePopupMenu const): Return the active popup menu proxy.
* UIProcess/gtk/KeyBindingTranslator.cpp:
(WebKit::handleKeyBindingsForMap): Make it generic by receiving the map as parameter.
(WebKit::handleCustomKeyBindings): Call handleKeyBindingsForMap() passing the custom key bindings map.
(WebKit::KeyBindingTranslator::commandsForKeyval): Get commands for the predefined key bindings. This is used
only when synthesizing key events since we don't have a GdkEVent to forward to the GtkTextView.
* UIProcess/gtk/KeyBindingTranslator.h:
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::popupMenuWidget): Take a ref of the GdkWindow when creating the GdkEvent, since the event will unref it
on destroy.
* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
(WebKit::WebPopupMenuProxyGtk::handleKeyPress): Handle a key press event from its keyval and timestamp.
(WebKit::WebPopupMenuProxyGtk::activateSelectedItem): Activate the currently selected item.
(WebKit::WebPopupMenuProxyGtk::keyPressEventCallback): Call handleKeyPress().
(WebKit::WebPopupMenuProxyGtk::typeAheadFindIndex): Receive a keyval and timestamp instead of a GdkEvent.
(WebKit::WebPopupMenuProxyGtk::typeAheadFind): Ditto.
* UIProcess/gtk/WebPopupMenuProxyGtk.h:

Tools:

Use WebKitWebViewBase internal API to synthesize events instead of GdkEvents. The touch events support has been
removed because we are no longer testing touch events, since they need an actual touchscreen.

* WebKitTestRunner/EventSenderProxy.h:
* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::getGDKKeySymForKeyRef):
(WTR::toWebKitGLibAPI):
(WTR::EventSenderProxy::keyDown):
(WTR::EventSenderProxy::mouseDown):
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):
(WTR::EventSenderProxy::mouseScrollBy):
(WTR::EventSenderProxy::continuousMouseScrollBy):
(WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSenderProxy::leapForward):
(WTR::EventSenderProxy::addTouchPoint):
(WTR::EventSenderProxy::updateTouchPoint):
(WTR::EventSenderProxy::touchStart):
(WTR::EventSenderProxy::touchMove):
(WTR::EventSenderProxy::touchEnd):
(WTR::EventSenderProxy::touchCancel):
(WTR::EventSenderProxy::clearTouchPoints):
(WTR::EventSenderProxy::releaseTouchPoint):
(WTR::EventSenderProxy::cancelTouchPoint):
(WTR::EventSenderProxy::setTouchPointRadius):
(WTR::EventSenderProxy::setTouchModifier):

LayoutTests:

Update expectations for tests that are passing now.

* platform/gtk/TestExpectations:
* platform/gtk/editing/selection/5195166-1-expected.txt: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262184 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION (r261277): [ Mac iOS ] webrtc/datachannel/gather-candidates-networkprocess...
youenn@apple.com [Wed, 27 May 2020 07:48:17 +0000 (07:48 +0000)]
REGRESSION (r261277): [ Mac iOS ] webrtc/datachannel/gather-candidates-networkprocess-crash.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=212218
<rdar://problem/63496692>

Reviewed by Eric Carlson.

* webrtc/datachannel/gather-candidates-networkprocess-crash.html:
Create a new peer connection after the network process crash to validate it does not stay hanging.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262183 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoEnable the use of XCBuild by default in Apple builds
krollin@apple.com [Wed, 27 May 2020 07:40:41 +0000 (07:40 +0000)]
Enable the use of XCBuild by default in Apple builds
https://bugs.webkit.org/show_bug.cgi?id=209890
<rdar://problem/44182078>

Unreviewed build fix. Check the value of XCODE_VERSION_ACTUAL rather
than XCODE_VERSION_MAJOR when determining whether to use the XCBuild
or non-XCBuild method of running header post-processing scripts.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:

Source/ThirdParty/ANGLE:

* ANGLE.xcodeproj/project.pbxproj:

Source/WebKit:

No new tests -- this is a build fix.

* WebKit.xcodeproj/project.pbxproj:

Source/WebKitLegacy:

* WebKitLegacy.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262182 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[WinCairo] Unreviewed test gardening
Hironori.Fujii@sony.com [Wed, 27 May 2020 07:13:56 +0000 (07:13 +0000)]
[WinCairo] Unreviewed test gardening

* platform/wincairo/css2.1/t0804-c5509-padn-l-03-f-g-expected.txt:
* platform/wincairo/css3/flexbox/flexbox-baseline-expected.txt:
* platform/wincairo/fast/css-generated-content/details-summary-before-after-expected.txt:
* platform/wincairo/fast/gradients/list-item-gradient-expected.txt:
* platform/wincairo/fast/html/details-add-child-1-expected.txt:
* platform/wincairo/fast/html/details-add-child-2-expected.txt:
* platform/wincairo/fast/html/details-add-details-child-1-expected.txt:
* platform/wincairo/fast/html/details-add-details-child-2-expected.txt:
* platform/wincairo/fast/html/details-add-summary-1-and-click-expected.txt:
* platform/wincairo/fast/html/details-add-summary-1-expected.txt:
* platform/wincairo/fast/html/details-add-summary-10-and-click-expected.txt:
* platform/wincairo/fast/html/details-add-summary-10-expected.txt:
* platform/wincairo/fast/html/details-add-summary-2-and-click-expected.txt:
* platform/wincairo/fast/html/details-add-summary-2-expected.txt:
* platform/wincairo/fast/html/details-add-summary-3-and-click-expected.txt:
* platform/wincairo/fast/html/details-add-summary-3-expected.txt:
* platform/wincairo/fast/html/details-add-summary-4-and-click-expected.txt:
* platform/wincairo/fast/html/details-add-summary-4-expected.txt:
* platform/wincairo/fast/html/details-add-summary-5-and-click-expected.txt:
* platform/wincairo/fast/html/details-add-summary-5-expected.txt:
* platform/wincairo/fast/html/details-add-summary-6-and-click-expected.txt:
* platform/wincairo/fast/html/details-add-summary-6-expected.txt:
* platform/wincairo/fast/html/details-add-summary-7-and-click-expected.txt:
* platform/wincairo/fast/html/details-add-summary-7-expected.txt:
* platform/wincairo/fast/html/details-add-summary-8-and-click-expected.txt:
* platform/wincairo/fast/html/details-add-summary-8-expected.txt:
* platform/wincairo/fast/html/details-add-summary-9-and-click-expected.txt:
* platform/wincairo/fast/html/details-add-summary-9-expected.txt:
* platform/wincairo/fast/html/details-add-summary-child-1-expected.txt:
* platform/wincairo/fast/html/details-add-summary-child-2-expected.txt:
* platform/wincairo/fast/html/details-marker-style-expected.txt:
* platform/wincairo/fast/html/details-nested-1-expected.txt:
* platform/wincairo/fast/html/details-nested-2-expected.txt:
* platform/wincairo/fast/html/details-no-summary1-expected.txt:
* platform/wincairo/fast/html/details-no-summary2-expected.txt:
* platform/wincairo/fast/html/details-no-summary3-expected.txt:
* platform/wincairo/fast/html/details-no-summary4-expected.txt:
* platform/wincairo/fast/html/details-open-javascript-expected.txt:
* platform/wincairo/fast/html/details-open1-expected.txt:
* platform/wincairo/fast/html/details-open2-expected.txt:
* platform/wincairo/fast/html/details-open3-expected.txt:
* platform/wincairo/fast/html/details-open4-expected.txt:
* platform/wincairo/fast/html/details-open5-expected.txt:
* platform/wincairo/fast/html/details-open6-expected.txt:
* platform/wincairo/fast/html/details-position-expected.txt:
* platform/wincairo/fast/html/details-remove-child-1-expected.txt:
* platform/wincairo/fast/html/details-remove-child-2-expected.txt:
* platform/wincairo/fast/html/details-remove-summary-1-and-click-expected.txt:
* platform/wincairo/fast/html/details-remove-summary-1-expected.txt:
* platform/wincairo/fast/html/details-remove-summary-2-and-click-expected.txt:
* platform/wincairo/fast/html/details-remove-summary-2-expected.txt:
* platform/wincairo/fast/html/details-remove-summary-3-and-click-expected.txt:
* platform/wincairo/fast/html/details-remove-summary-3-expected.txt:
* platform/wincairo/fast/html/details-remove-summary-4-and-click-expected.txt:
* platform/wincairo/fast/html/details-remove-summary-4-expected.txt:
* platform/wincairo/fast/html/details-remove-summary-5-and-click-expected.txt:
* platform/wincairo/fast/html/details-remove-summary-5-expected.txt:
* platform/wincairo/fast/html/details-remove-summary-6-and-click-expected.txt:
* platform/wincairo/fast/html/details-remove-summary-6-expected.txt:
* platform/wincairo/fast/html/details-remove-summary-child-1-expected.txt:
* platform/wincairo/fast/html/details-remove-summary-child-2-expected.txt:
* platform/wincairo/fast/html/details-replace-summary-child-expected.txt:
* platform/wincairo/fast/html/details-replace-text-expected.txt:
* platform/wincairo/fast/html/details-writing-mode-expected.txt:
* platform/wincairo/fast/text/international/text-combine-image-test-expected.txt:
* platform/wincairo/ietestcenter/css3/bordersbackgrounds/border-radius-applies-to-012-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262181 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoSMILTimeContainer must protect its m_scheduledAnimations while it does updateAnimations()
commit-queue@webkit.org [Wed, 27 May 2020 06:05:32 +0000 (06:05 +0000)]
SMILTimeContainer must protect its m_scheduledAnimations while it does updateAnimations()
https://bugs.webkit.org/show_bug.cgi?id=212192
<rdar://problem/56717734>

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-05-26
Reviewed by Youenn Fablet.

Source/WebCore:

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:

LayoutTests:

* svg/animations/css-animation-reinsert-target-expected.txt: Added.
* svg/animations/css-animation-reinsert-target.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262180 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoMacApplication::isSafari should allow safari bundle id variants
commit-queue@webkit.org [Wed, 27 May 2020 05:19:45 +0000 (05:19 +0000)]
MacApplication::isSafari should allow safari bundle id variants
https://bugs.webkit.org/show_bug.cgi?id=212401

Patch by Alex Christensen <achristensen@webkit.org> on 2020-05-26
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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262179 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed WPE build fix after r262155.
zandobersek@gmail.com [Wed, 27 May 2020 05:19:00 +0000 (05:19 +0000)]
Unreviewed WPE build fix after r262155.

* UIProcess/API/wpe/WebKitColor.cpp:
(webkit_color_parse): Use CSSParser::parseColor() to do the color parsing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262178 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoRendering artifacts when scrolling overlays
simon.fraser@apple.com [Wed, 27 May 2020 05:10:19 +0000 (05:10 +0000)]
Rendering artifacts when scrolling overlays
https://bugs.webkit.org/show_bug.cgi?id=204120
<rdar://problem/57121358>

Reviewed by Zalan Bujtas.

Source/WebCore:

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):

LayoutTests:

* compositing/repaint/compositing-toggle-in-overflow-scroll-repaint-expected.txt: Added.
* compositing/repaint/compositing-toggle-in-overflow-scroll-repaint.html: Added.
* platform/ios-wk2/compositing/repaint/compositing-toggle-in-overflow-scroll-repaint-expected.txt: Added.
* platform/mac-wk1/compositing/repaint/compositing-toggle-in-overflow-scroll-repaint-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262177 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoJSC stress tests that require --useLLInt=0 should be skipped on --no-jit test runs.
mark.lam@apple.com [Wed, 27 May 2020 04:44:51 +0000 (04:44 +0000)]
JSC stress tests that require --useLLInt=0 should be skipped on --no-jit test runs.
https://bugs.webkit.org/show_bug.cgi?id=212400

Reviewed by Saam Barati.

That's because using --useLLInt=0 and --useJIT=0 together is not a "coherent"
(read "valid") configuration.  We should be able to do a --no-jit test run with
the JSC_useJIT=0 environmental variable set.  Before this patch, the following
tests will all fail.  This patch skips them.

* stress/delete-property-poly-proto.js:
* stress/dfg-compare-eq-via-nonSpeculativeNonPeepholeCompareNullOrUndefined.js:
* stress/getter-setter-inlining-should-emit-movhint.js:
* stress/merging-ic-variants-should-bail-if-structures-overlap.js:
* stress/poly-proto-setter-adds-setter-in-middle.js:
* stress/poly-proto-setter-changes-setter-2.js:
* stress/poly-proto-setter-changes-setter.js:
* stress/racy-gc-cleanup-of-identifier-after-mutator-stops-running.js:
* stress/regress-192717.js:
* stress/retry-cache-later.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262176 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAn SVG animated property animator can stop animation while other animators are still...
commit-queue@webkit.org [Wed, 27 May 2020 04:01:19 +0000 (04:01 +0000)]
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>

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-05-26
Reviewed by Simon Fraser.

Source/WebCore:

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:

LayoutTests:

* svg/animations/animated-enum-mutiple-animators-expected.txt: Added.
* svg/animations/animated-enum-mutiple-animators.svg: Added.
* svg/animations/animated-length-mutiple-animators-expected.txt: Added.
* svg/animations/animated-length-mutiple-animators.svg: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262175 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION (async oveflow): scrubber missing from inline video inside overflow scroll
simon.fraser@apple.com [Wed, 27 May 2020 03:36:46 +0000 (03:36 +0000)]
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.

Source/WebCore:

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):

LayoutTests:

* compositing/layer-creation/overlap-in-scroller-expected.html: Added.
* compositing/layer-creation/overlap-in-scroller.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262174 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: ⌘G should not override the current query of the find banner if it...
drousso@apple.com [Wed, 27 May 2020 02:42:14 +0000 (02:42 +0000)]
Web Inspector: ⌘G should not override the current query of the find banner if it's visible
https://bugs.webkit.org/show_bug.cgi?id=212395

Reviewed by Simon Fraser.

* UserInterface/Views/ContentBrowser.js:
(WI.ContentBrowser.prototype.async handleFindNextShortcut):
(WI.ContentBrowser.prototype.async handleFindPreviousShortcut):
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype.highlightPreviousSearchMatch):
(WI.LogContentView.prototype.highlightNextSearchMatch):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262173 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[WinCairo] Unreviewed clang-cl build fix after r262158
Hironori.Fujii@sony.com [Wed, 27 May 2020 02:09:54 +0000 (02:09 +0000)]
[WinCairo] Unreviewed clang-cl build fix after r262158
https://bugs.webkit.org/show_bug.cgi?id=211883

std::unique_ptr<WebCore::TextureMapper> can't delete an incomplete type TextureMapper.

* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp:
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262172 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUTF-8 encode strings of invalid URLs when converting WTF::URL to NSURL instead of...
commit-queue@webkit.org [Wed, 27 May 2020 01:48:56 +0000 (01:48 +0000)]
UTF-8 encode strings of invalid URLs when converting WTF::URL to NSURL instead of truncating the UTF-16 encoding
https://bugs.webkit.org/show_bug.cgi?id=212393
<rdar://problem/63095503>

Patch by Alex Christensen <achristensen@webkit.org> on 2020-05-26
Reviewed by Tim Horton.

Source/WTF:

This only changes behavior in code that is marked as UNLIKELY because it can only be reached by invalid unicode URLs,
but it can be reached and should behave in a reasonable manner in those cases.  This makes Safari behave more similarly
to Firefox in this case instead of doing something similar to no other browser.

* wtf/URL.cpp:
(WTF::copyASCII): Deleted.
(WTF::URL::copyToBuffer const): Deleted.
* wtf/URL.h:
* wtf/cf/URLCF.cpp:
(WTF::URL::createCFURL const):
* wtf/cocoa/URLCocoa.mm:
(WTF::URL::createCFURL const):

Tools:

* TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262171 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[PlayStation] Disable LLINT_EMBEDDED_OPCODE_ID
yoshiaki.jitsukawa@sony.com [Wed, 27 May 2020 00:36:38 +0000 (00:36 +0000)]
[PlayStation] Disable LLINT_EMBEDDED_OPCODE_ID
https://bugs.webkit.org/show_bug.cgi?id=212387

Reviewed by Don Olmstead.

* wtf/CMakeLists.txt:
* wtf/PlatformEnable.h:
* wtf/PlatformEnablePlayStation.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262170 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoCan't scrub video on https://www.judiciary.senate.gov
jer.noble@apple.com [Wed, 27 May 2020 00:21:59 +0000 (00:21 +0000)]
Can't scrub video on https://judiciary.senate.gov
https://bugs.webkit.org/show_bug.cgi?id=212270
<rdar://problem/57922919>

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/media-elements/seeking/seek-to-negative-time-expected.txt:

Source/WebCore:

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):

LayoutTests:

* media/video-duration-seekable-expected.txt: Added.
* media/video-duration-seekable.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262169 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAdd some new emitters to the X86_64 and ARM64 MacroAssemblers.
mark.lam@apple.com [Tue, 26 May 2020 23:37:26 +0000 (23:37 +0000)]
Add some new emitters to the X86_64 and ARM64 MacroAssemblers.
https://bugs.webkit.org/show_bug.cgi?id=212385

Reviewed by Robin Morisset.

This patch adds these MacroAssembler emitters:
    clearBit64
    clearBits64WithMask
    countTrailingZeros64WithoutNullCheck

clearBit64 clears a bit.

clearBits64WithMask does the equivalent of and64 with the 1's complement of the
provided mask.

countTrailingZeros64WithoutNullCheck does the same thing as countTrailingZeros64,
except that it assumes that the word in the register it is processing will never
be null, and therefore skips the null check.  This is useful in code generation
that already does a null check ahead of time.  So, there's no need to do a
redundant null check.

Also added testmasm tests for these emitters.

* assembler/AbortReason.h:
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::clearBit64):
(JSC::MacroAssemblerARM64::clearBits64WithMask):
(JSC::MacroAssemblerARM64::countTrailingZeros64WithoutNullCheck):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::countTrailingZeros64WithoutNullCheck):
(JSC::MacroAssemblerX86_64::clearBit64):
(JSC::MacroAssemblerX86_64::clearBits64WithMask):
* assembler/X86Assembler.h:
(JSC::X86Assembler::btrq_rr):
* assembler/testmasm.cpp:
(JSC::testClearBit64):
(JSC::testClearBits64WithMask):
(JSC::testClearBits64WithMaskTernary):
(JSC::testCountTrailingZeros64Impl):
(JSC::testCountTrailingZeros64):
(JSC::testCountTrailingZeros64WithoutNullCheck):
(JSC::run):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262168 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoEnhance Bitmap::setEachNthBit() to also take an end index.
mark.lam@apple.com [Tue, 26 May 2020 23:33:09 +0000 (23:33 +0000)]
Enhance Bitmap::setEachNthBit() to also take an end index.
https://bugs.webkit.org/show_bug.cgi?id=212386
<rdar://problem/63643324>

Reviewed by Robin Morisset.

Source/WTF:

Previously, it was only taking the n interval, and the start index.
Also fixed isEmpty() and isFull() to return a bool instead of size_t.

* wtf/Bitmap.h:
(WTF::WordType>::isEmpty const):
(WTF::WordType>::isFull const):
(WTF::WordType>::setEachNthBit):

Tools:

* TestWebKitAPI/Tests/WTF/Bitmap.cpp:
(TestWebKitAPI::testBitmapSetEachNthBitImpl):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262167 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[PlayStation] Enable RemoteWebInspector
yoshiaki.jitsukawa@sony.com [Tue, 26 May 2020 22:43:40 +0000 (22:43 +0000)]
[PlayStation] Enable RemoteWebInspector
https://bugs.webkit.org/show_bug.cgi?id=212312

Reviewed by Don Olmstead.

* API/JSRemoteInspectorServer.cpp:
Fix compile error.
* PlatformPlayStation.cmake:
Add JSRemoteInspectorServer.h to the public header list.
* inspector/remote/socket/posix/RemoteInspectorSocketPOSIX.cpp:
Set PlayStation specific socket option.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262166 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoIteratorClose should suppress GetMethod errors
shvaikalesh@gmail.com [Tue, 26 May 2020 22:16:10 +0000 (22:16 +0000)]
IteratorClose should suppress GetMethod errors
https://bugs.webkit.org/show_bug.cgi?id=212378

Reviewed by Keith Miller.

JSTests:

* stress/custom-iterators.js:
* stress/iterator-return-abrupt-lookup-builtins.js: Added.
* test262/expectations.yaml: Mark 4 test cases as passing.

Source/JavaScriptCore:

This patch implements recent spec change [1] that prevents "return" method lookup error
from overriding outer exception, aligning JSC with V8 and SpiderMonkey.

It is accomplished by moving pushTry() before emitGetById() in BytecodeGenerator.cpp
(covered by test262 suite) and removal of RETURN_IF_EXCEPTION in IteratorOperations.cpp
(added a stress test).

Before this patch, JSC partly implemented the spec change [1] by suppressing TypeError
if "return" method of iterator was not callable.

BytecodeGenerator::emitDelegateYield() is intentionally left unchanged.
Also, this patch utilizes emitIteratorGenericClose() to avoid code duplication.
for/of microbenchmarks are neutral.

[1]: https://github.com/tc39/ecma262/pull/1408

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitGenericEnumeration):
(JSC::BytecodeGenerator::emitEnumeration):
* runtime/IteratorOperations.cpp:
(JSC::iteratorClose):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262165 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoRegression(?): [ iOS wk2 ] http/tests/resourceLoadStatistics/cookie-deletion.html...
lawrence.j@apple.com [Tue, 26 May 2020 22:02:23 +0000 (22:02 +0000)]
Regression(?): [ iOS wk2 ] http/tests/resourceLoadStatistics/cookie-deletion.html is flaky failing and crashing.
https://bugs.webkit.org/show_bug.cgi?id=207197

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262164 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[ iOS wk2 ] http/wpt/beacon/cors/crossorigin-arraybufferview-no-preflight.html is...
lawrence.j@apple.com [Tue, 26 May 2020 21:56:13 +0000 (21:56 +0000)]
[ iOS wk2 ] http/wpt/beacon/cors/crossorigin-arraybufferview-no-preflight.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=207583

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262163 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: Network: Timing: gaps around the "An error occurred trying to load...
drousso@apple.com [Tue, 26 May 2020 21:34:58 +0000 (21:34 +0000)]
Web Inspector: Network: Timing: gaps around the "An error occurred trying to load this resource" message
https://bugs.webkit.org/show_bug.cgi?id=212384

Reviewed by Timothy Hatcher.

* UserInterface/Views/NetworkTableContentView.css:
(.content-view.network-table > .message-text-view): Added.
(.content-view.network-table > .message-text-view > .message): Added.
(.content-view.network .message-text-view): Deleted.
(.content-view.network .message-text-view > .message): Deleted.
Be more specific with the selector so it doesn't apply as broadly.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262162 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoSamplingProfiler::takeSample() should not assume that ENABLE(WEBASSEMBLY) means Wasm...
mark.lam@apple.com [Tue, 26 May 2020 21:32:50 +0000 (21:32 +0000)]
SamplingProfiler::takeSample() should not assume that ENABLE(WEBASSEMBLY) means Wasm is enabled.
https://bugs.webkit.org/show_bug.cgi?id=212382

Reviewed by Saam Barati.

Wasm can still be disabled at runtime with JSC options.  Fixing this will allow
sampling profiler tests to run with JSC_useJIT=0 without crashing.

* runtime/SamplingProfiler.cpp:
(JSC::FrameWalker::FrameWalker):
(JSC::FrameWalker::recordJITFrame):
(JSC::CFrameWalker::CFrameWalker):
(JSC::SamplingProfiler::takeSample):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262161 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION: [ iOS wk2 Debug ] multiple fast/text/international/system-language tests...
katherine_cheney@apple.com [Tue, 26 May 2020 20:38:26 +0000 (20:38 +0000)]
REGRESSION: [ iOS wk2 Debug ] multiple fast/text/international/system-language tests are flaky crashing - WTFCrashWithInfo - WebKit::ResourceLoadStatisticsDatabaseStore::openAndUpdateSchemaIfNecessary()
https://bugs.webkit.org/show_bug.cgi?id=211958
<rdar://problem/63275549>

Reviewed by Darin Adler.

Tests no longer crashing.

* platform/ios-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262160 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoFix the engineering build on internal SDKs
aestes@apple.com [Tue, 26 May 2020 20:32:25 +0000 (20:32 +0000)]
Fix the engineering build on internal SDKs

* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Silenced a deprecation warning.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262159 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[WinCairo][WK2] Use GraphicsLayerTextureMapper for Accelerated Compositing mode
Hironori.Fujii@sony.com [Tue, 26 May 2020 20:30:55 +0000 (20:30 +0000)]
[WinCairo][WK2] Use GraphicsLayerTextureMapper for Accelerated Compositing mode
https://bugs.webkit.org/show_bug.cgi?id=211883

Reviewed by Don Olmstead.

.:

* Source/cmake/OptionsWinCairo.cmake: Added a new build option
USE_GRAPHICS_LAYER_TEXTURE_MAPPER, and set ON as the default.

Source/WebKit:

GraphicsLayerTextureMapper is a simple GraphicsLayer
implementation using TextureMapper which is used for WinCairo WebKit1.

Add a new LayerTreeHost implementation for
GraphicsLayerTextureMapper by copying WinCairo WebKit1's
AcceleratedCompositingContext.

Windows WebKitTestRunner can't capture the window content for
pixel dump tests yet.

* PlatformWin.cmake:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* UIProcess/win/WebView.cpp:
(WebKit::WebView::WebView):
* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect):
(WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp: Added.
(WebKit::LayerTreeHost::prepareForRendering):
(WebKit::LayerTreeHost::compositeLayersToContext):
(WebKit::LayerTreeHost::flushPendingLayerChanges):
(WebKit::LayerTreeHost::layerFlushTimerFired):
(WebKit::LayerTreeHost::LayerTreeHost):
(WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
(WebKit::LayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush):
(WebKit::LayerTreeHost::scheduleLayerFlush):
(WebKit::LayerTreeHost::cancelPendingLayerFlush):
(WebKit::LayerTreeHost::setRootCompositingLayer):
(WebKit::LayerTreeHost::setViewOverlayRootLayer):
(WebKit::LayerTreeHost::setNonCompositedContentsNeedDisplay):
(WebKit::LayerTreeHost::scrollNonCompositedContents):
(WebKit::LayerTreeHost::flushAndRenderLayers):
(WebKit::LayerTreeHost::forceRepaint):
(WebKit::LayerTreeHost::forceRepaintAsync):
(WebKit::LayerTreeHost::sizeDidChange):
(WebKit::LayerTreeHost::pauseRendering):
(WebKit::LayerTreeHost::resumeRendering):
(WebKit::LayerTreeHost::graphicsLayerFactory):
(WebKit::LayerTreeHost::contentsSizeChanged):
(WebKit::LayerTreeHost::didChangeViewportAttributes):
(WebKit::LayerTreeHost::setIsDiscardable):
(WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
(WebKit::LayerTreeHost::createDisplayRefreshMonitor):
(WebKit::LayerTreeHost::window):
(WebKit::LayerTreeHost::enabled):
(WebKit::LayerTreeHost::paintContents):
(WebKit::LayerTreeHost::deviceScaleFactor const):
(WebKit::LayerTreeHost::applyDeviceScaleFactor):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.h: Added.
(WebKit::LayerTreeHost::layerTreeContext const):
(WebKit::LayerTreeHost::displayID const):
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::nativeWindowHandle):
* WebProcess/win/WebProcessMainWin.cpp:

Tools:

* MiniBrowser/win/WebKitBrowserWindow.cpp:
(WebKitBrowserWindow::setPreference): Call WKPreferencesSet* for
menu items IDM_ACC_COMPOSITING, IDM_COMPOSITING_BORDERS and
IDM_DEBUG_INFO_LAYER.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262158 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[CMake] Add static analyzers
don.olmstead@sony.com [Tue, 26 May 2020 19:29:29 +0000 (19:29 +0000)]
[CMake] Add static analyzers
https://bugs.webkit.org/show_bug.cgi?id=212280

Reviewed by David Kilzer.

.:

Add support for static analyzers within CMake builds. Supported analyzers are
clang-tidy, iwyu (include-what-you-use) and lwyu (link-what-you-use). They can
be enabled by passing a semicolon separated list to CMake through the ANALYZERS
option.

* Source/cmake/WebKitCommon.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/WebKitMacros.cmake:
* Source/cmake/WebKitStaticAnalysis.cmake: Added.

Source/WTF:

Export headers from Plaform.h so include-what-you-use does not suggest they be
included directly. The headers being exported will #error when included outside of
Platform.h

* wtf/Platform.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262156 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoEliminate Color constructors that take strings, moving color parsing entirely into...
darin@apple.com [Tue, 26 May 2020 19:16:13 +0000 (19:16 +0000)]
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.

Source/WebCore:

* 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.

Source/WebKit:

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetComposition): Use WebCore::CSSParser::parseColor.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262155 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoHardware fill-forwards animation and transitions don't interact correctly
graouts@webkit.org [Tue, 26 May 2020 19:12:22 +0000 (19:12 +0000)]
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.

LayoutTests/imported/w3c:

Mark a progression for a WPT test.

* web-platform-tests/web-animations/interfaces/Animation/style-change-events-expected.txt:

Source/WebCore:

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):

LayoutTests:

Add a new test that reproduces the issue shown by the original test case for this bug. While an animation is running
for a CSS property, we change the underlying value for that animated property which is also set as the transition-property
value. The correct behavior is to not start a CSS Transition either when changing the underlying value during the
CSS Animation nor at the end of the CSS Animation.

* webanimations/updating-property-targeted-by-css-transition-during-css-animation-expected.txt: Added.
* webanimations/updating-property-targeted-by-css-transition-during-css-animation.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262154 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed, skip revoke-blob-url-after-navigation.html on Windows.
cdumez@apple.com [Tue, 26 May 2020 18:50:40 +0000 (18:50 +0000)]
Unreviewed, skip revoke-blob-url-after-navigation.html on Windows.

Windows port is lacking blob support.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262153 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoExtended Color Cleanup: Remove red()/green()/blue() accessors from ExtendedColor...
weinig@apple.com [Tue, 26 May 2020 17:56:34 +0000 (17:56 +0000)]
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.

Source/WebCore:

* 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.

Tools:

* TestWebKitAPI/Tests/WebCore/ExtendedColorTests.cpp:
(TestWebKitAPI::TEST):
Update tests to pull values from the channels rather than from the red()/green()/blue() accessors.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262151 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoASSERTION FAILED: m_clientCounts.contains(contextId) - WebKit::VideoFullscreenManager...
peng.liu6@apple.com [Tue, 26 May 2020 16:56:59 +0000 (16:56 +0000)]
ASSERTION FAILED: m_clientCounts.contains(contextId) - WebKit::VideoFullscreenManagerProxy::removeClientForContext()
https://bugs.webkit.org/show_bug.cgi?id=212308

Source/WebCore:

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):

Source/WebKit:

Refactor the implementation of the callback hasVideoInPictureInPictureDidChange().

Reviewed by Jer Noble.

* UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenModelContext::didEnterPictureInPicture):
(WebKit::VideoFullscreenModelContext::didExitPictureInPicture):

(WebKit::VideoFullscreenManagerProxy::hasVideoInPictureInPictureDidChange):
Add this function to wrap m_page->uiClient().hasVideoInPictureInPictureDidChange().

(WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
Remove the call to hasVideoInPictureInPictureDidChange() because it is too early to do so.

(WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
Add a call to hasVideoInPictureInPictureDidChange() on Mac as well. This fixes the timeout of
TestWebKitAPI.PictureInPicture.ExitPiPOnSuspendVideoElement on Mac.

(WebKit::VideoFullscreenManagerProxy::fullscreenModeChanged):
Remove the call to hasVideoInPictureInPictureDidChange() because it is not necessary.

Tools:

Disable TestWebKitAPI.PictureInPicture.ExitPiPOnSuspendVideoElement for old iOS versions
due to an issue of AVKit.

In addition, don't run the test if Picture-in-Picture is not supported.

Reviewed by Jer Noble.

* TestWebKitAPI/Tests/WebKitCocoa/ExitPiPOnSuspendVideoElement.mm:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262149 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[LFC][TFC] Use padding to space out sections
zalan@apple.com [Tue, 26 May 2020 16:53:11 +0000 (16:53 +0000)]
[LFC][TFC] Use padding to space out sections
https://bugs.webkit.org/show_bug.cgi?id=212377

Reviewed by Antti Koivisto.

Source/WebCore:

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):

LayoutTests:

* fast/layoutformattingcontext/table-simple-multiple-sections-with-border-spacing-and-collapse-expected.html: Added.
* fast/layoutformattingcontext/table-simple-multiple-sections-with-border-spacing-and-collapse.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262148 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoEnable the use of XCBuild by default in Apple builds
krollin@apple.com [Tue, 26 May 2020 16:17:44 +0000 (16:17 +0000)]
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.

.:

* Makefile.shared:
* WebKit.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:

Source/JavaScriptCore:

* Configurations/JavaScriptCore.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj:

Source/ThirdParty/ANGLE:

* ANGLE.xcodeproj/project.pbxproj:
* Configurations/ANGLE.xcconfig:

Source/ThirdParty/libwebrtc:

* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

No new tests -- no changed functionality.

* WebCore.xcodeproj/project.pbxproj:

Source/WebKit:

* Configurations/WebKit.xcconfig:
* WebKit.xcodeproj/project.pbxproj:

Source/WebKitLegacy:

* WebKitLegacy.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

* Configurations/WebKitLegacy.xcconfig:

Tools:

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* Scripts/build-webkit:
* Scripts/webkitdirs.pm:
(canUseXCBuild):
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262147 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnskip fast/events/form-onchange.html after r262145.
cdumez@apple.com [Tue, 26 May 2020 16:17:16 +0000 (16:17 +0000)]
Unskip fast/events/form-onchange.html after r262145.

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262146 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed, drop a few beforeload event tests that no longer make sense after r261971.
cdumez@apple.com [Tue, 26 May 2020 16:15:18 +0000 (16:15 +0000)]
Unreviewed, drop a few beforeload event tests that no longer make sense after r261971.

We dropped support for the BeforeLoadEvent in r261971 so these tests do not make
sense anymore. Those tests also cause flakiness such as <rdar://63623324> now that
they no longer run as expected.

* fast/events/form-iframe-target-before-load-crash-expected.txt: Removed.
* fast/events/form-iframe-target-before-load-crash.html: Removed.
* fast/events/form-iframe-target-before-load-crash2-expected.txt: Removed.
* fast/events/form-iframe-target-before-load-crash2.html: Removed.
* fast/events/form-iframe-target-before-load-crash3-expected.txt: Removed.
* fast/events/form-iframe-target-before-load-crash3.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262145 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[LFC][TFC] Add support for multiple sections
zalan@apple.com [Tue, 26 May 2020 15:54:06 +0000 (15:54 +0000)]
[LFC][TFC] Add support for multiple sections
https://bugs.webkit.org/show_bug.cgi?id=212354

Reviewed by Antti Koivisto.

Source/WebCore:

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.

LayoutTests:

* fast/layoutformattingcontext/table-simple-multiple-sections-expected.html: Added.
* fast/layoutformattingcontext/table-simple-multiple-sections.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262144 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agowebkitpy: simctl list may have stderr logging
jbedard@apple.com [Tue, 26 May 2020 15:42:09 +0000 (15:42 +0000)]
webkitpy: simctl list may have stderr logging
https://bugs.webkit.org/show_bug.cgi?id=212376
<rdar://problem/63517635>

Unreviewed infrastructure fix.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDeviceManager.populate_available_devices): Only parse stdout, log error when
json decoding fails.
(SimulatedDevice.is_usable): Only parse stdout.
(SimulatedDevice.launch_app): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262143 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoREGRESSION: [ Mac wk1 ] fast/events/form-onchange.html is flaky failing.
lawrence.j@apple.com [Tue, 26 May 2020 14:46:14 +0000 (14:46 +0000)]
REGRESSION: [ Mac wk1 ] fast/events/form-onchange.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=212375

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262142 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[WPE] Gardening, update pending baselines after r262127
dpino@igalia.com [Tue, 26 May 2020 10:43:36 +0000 (10:43 +0000)]
[WPE] Gardening, update pending baselines after r262127
https://bugs.webkit.org/show_bug.cgi?id=212370

Unrevewed gardening.

* platform/wpe/fast/borders/fieldsetBorderRadius-expected.txt: Added.
* platform/wpe/fast/html/details-marker-style-mixed-expected.txt: Added.
* platform/wpe/mathml/presentation/roots-expected.txt:
* platform/wpe/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt:
* platform/wpe/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262141 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[GTK] Gardening, update pending baselines after r262127
dpino@igalia.com [Tue, 26 May 2020 10:23:13 +0000 (10:23 +0000)]
[GTK] Gardening, update pending baselines after r262127
https://bugs.webkit.org/show_bug.cgi?id=212369

Unreviewed gardening.

* platform/gtk/fast/borders/fieldsetBorderRadius-expected.png:
* platform/gtk/fast/borders/fieldsetBorderRadius-expected.txt: Added.
* platform/gtk/fast/html/details-marker-style-mixed-expected.txt: Renamed from LayoutTests/platform/glib/fast/html/details-marker-style-mixed-expected.txt.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262140 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[css-flexbox] WPT Test css/css-flexbox/flex-lines/multi-line-wrap-reverse-column...
clopez@igalia.com [Tue, 26 May 2020 08:46:45 +0000 (08:46 +0000)]
[css-flexbox] WPT Test css/css-flexbox/flex-lines/multi-line-wrap-reverse-column-reverse.html fails
https://bugs.webkit.org/show_bug.cgi?id=212054

Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Update the test to use the Ahem font, and rely on different font colors (instead of different glyps)
to check that each box of the test is placed correctly.

* web-platform-tests/css/css-flexbox/flex-lines/multi-line-wrap-reverse-column-reverse-expected.html:
* web-platform-tests/css/css-flexbox/flex-lines/multi-line-wrap-reverse-column-reverse.html:

LayoutTests:

Remove expectations for passing test.

* TestExpectations:
* platform/glib/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262139 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[GTK4] Use screen font options as default
carlosgc@webkit.org [Tue, 26 May 2020 08:01:14 +0000 (08:01 +0000)]
[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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262138 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[GTK4] Fix context menu
carlosgc@webkit.org [Tue, 26 May 2020 07:59:30 +0000 (07:59 +0000)]
[GTK4] Fix context menu
https://bugs.webkit.org/show_bug.cgi?id=212344

Reviewed by Adrian Perez de Castro.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseSizeAllocate): Call gtk_native_check_resize() on the popover to make it appear.
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::destroyMenuWidget): There's no gtk_widget_destroy() in GTK4 so we can just unparent it.
(WebKit::bindModelToMenuWidget): Do not set the action namespace because that's not possible in GTK4.
(WebKit::WebContextMenuProxyGtk::append): Use group.name again for the action name passed to
g_menu_item_set_action_and_target_value().
(WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk): Use destroyMenuWidget().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262137 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[iOS] ActionSheetTests.DataDetectorsLinkIsNotPresentedAsALink is failing consistently
wenson_hsieh@apple.com [Tue, 26 May 2020 04:48:57 +0000 (04:48 +0000)]
[iOS] ActionSheetTests.DataDetectorsLinkIsNotPresentedAsALink is failing consistently
https://bugs.webkit.org/show_bug.cgi?id=212363
<rdar://problem/63508866>

Reviewed by Tim Horton.

This test began to consistently throw an exception after <https://trac.webkit.org/r261157>, due to how
UserInterfaceSwizzler always instantiates the shared UIApplication. This apparently causes -[WKContentView
resizableSnapshotViewFromRect:afterScreenUpdates:withCapInsets:] to return `nil` instead of a replica view. As a
result, we crash under `createFallbackTargetedPreview` as we're attempting to assemble a targeted preview for
the context menu interaction.

Since this seems to only affect this particular API test, work around it by swizzling out
`-resizableSnapshotViewFromRect:afterScreenUpdates:withCapInsets:` in this API test to return a non-null UIView.

* TestWebKitAPI/Tests/ios/ActionSheetTests.mm:
(TestWebKitAPI::swizzledResizableSnapshotViewFromRect):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262136 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[WPE] Gardening, update baselines after r262127
dpino@igalia.com [Tue, 26 May 2020 03:44:12 +0000 (03:44 +0000)]
[WPE] Gardening, update baselines after r262127
https://bugs.webkit.org/show_bug.cgi?id=212365

Unreviewed gardening.

* platform/wpe/fast/html/details-no-summary4-expected.txt:
* platform/wpe/fast/html/details-open-javascript-expected.txt:
* platform/wpe/fast/html/details-open2-expected.txt:
* platform/wpe/fast/html/details-open4-expected.txt:
* platform/wpe/fast/html/details-replace-summary-child-expected.txt:
* platform/wpe/fast/html/details-replace-text-expected.txt:
* platform/wpe/fast/html/details-writing-mode-expected.txt:
* platform/wpe/fast/html/details-writing-mode-mixed-expected.txt:
* platform/wpe/fast/writing-mode/fieldsets-expected.txt:
* platform/wpe/svg/zoom/page/zoom-hixie-mixed-009-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262135 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[GTK] Gardening, update baselines after r262127
dpino@igalia.com [Tue, 26 May 2020 03:30:18 +0000 (03:30 +0000)]
[GTK] Gardening, update baselines after r262127
https://bugs.webkit.org/show_bug.cgi?id=212364

Unreviewed gardening.

* platform/glib/css2.1/t0804-c5509-padn-l-03-f-g-expected.txt:
* platform/glib/css3/flexbox/flexbox-baseline-expected.txt:
* platform/glib/fast/block/basic/fieldset-stretch-to-legend-expected.txt:
* platform/glib/fast/css-generated-content/details-summary-before-after-expected.txt:
* platform/glib/fast/html/details-add-child-1-expected.txt:
* platform/glib/fast/html/details-add-child-2-expected.txt:
* platform/glib/fast/html/details-add-details-child-1-expected.txt:
* platform/glib/fast/html/details-add-details-child-2-expected.txt:
* platform/glib/fast/html/details-add-summary-1-and-click-expected.txt:
* platform/glib/fast/html/details-add-summary-1-expected.txt:
* platform/glib/fast/html/details-add-summary-10-and-click-expected.txt:
* platform/glib/fast/html/details-add-summary-10-expected.txt:
* platform/glib/fast/html/details-add-summary-2-and-click-expected.txt:
* platform/glib/fast/html/details-add-summary-2-expected.txt:
* platform/glib/fast/html/details-add-summary-3-and-click-expected.txt:
* platform/glib/fast/html/details-add-summary-3-expected.txt:
* platform/glib/fast/html/details-add-summary-4-and-click-expected.txt:
* platform/glib/fast/html/details-add-summary-4-expected.txt:
* platform/glib/fast/html/details-add-summary-5-and-click-expected.txt:
* platform/glib/fast/html/details-add-summary-5-expected.txt:
* platform/glib/fast/html/details-add-summary-6-and-click-expected.txt:
* platform/glib/fast/html/details-add-summary-6-expected.txt:
* platform/glib/fast/html/details-add-summary-7-and-click-expected.txt:
* platform/glib/fast/html/details-add-summary-7-expected.txt:
* platform/glib/fast/html/details-add-summary-8-and-click-expected.txt:
* platform/glib/fast/html/details-add-summary-8-expected.txt:
* platform/glib/fast/html/details-add-summary-9-and-click-expected.txt:
* platform/glib/fast/html/details-add-summary-9-expected.txt:
* platform/glib/fast/html/details-add-summary-child-1-expected.txt:
* platform/glib/fast/html/details-add-summary-child-2-expected.txt:
* platform/glib/fast/html/details-marker-style-expected.txt:
* platform/glib/fast/html/details-nested-1-expected.txt:
* platform/glib/fast/html/details-nested-2-expected.txt:
* platform/glib/fast/html/details-no-summary1-expected.txt:
* platform/glib/fast/html/details-no-summary2-expected.txt:
* platform/glib/fast/html/details-no-summary3-expected.txt:
* platform/glib/fast/html/details-open1-expected.txt:
* platform/glib/fast/html/details-open3-expected.txt:
* platform/glib/fast/html/details-open5-expected.txt:
* platform/glib/fast/html/details-open6-expected.txt:
* platform/glib/fast/html/details-position-expected.txt:
* platform/glib/fast/html/details-remove-child-1-expected.txt:
* platform/glib/fast/html/details-remove-child-2-expected.txt:
* platform/glib/fast/html/details-remove-summary-1-and-click-expected.txt:
* platform/glib/fast/html/details-remove-summary-1-expected.txt:
* platform/glib/fast/html/details-remove-summary-2-and-click-expected.txt:
* platform/glib/fast/html/details-remove-summary-2-expected.txt:
* platform/glib/fast/html/details-remove-summary-3-and-click-expected.txt:
* platform/glib/fast/html/details-remove-summary-3-expected.txt:
* platform/glib/fast/html/details-remove-summary-4-and-click-expected.txt:
* platform/glib/fast/html/details-remove-summary-4-expected.txt:
* platform/glib/fast/html/details-remove-summary-5-and-click-expected.txt:
* platform/glib/fast/html/details-remove-summary-5-expected.txt:
* platform/glib/fast/html/details-remove-summary-6-and-click-expected.txt:
* platform/glib/fast/html/details-remove-summary-6-expected.txt:
* platform/glib/fast/html/details-remove-summary-child-1-expected.txt:
* platform/glib/fast/html/details-remove-summary-child-2-expected.txt:
* platform/glib/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt:
* platform/glib/svg/zoom/page/zoom-svg-through-object-with-huge-size-expected.txt:
* platform/gtk/fast/html/details-no-summary4-expected.txt:
* platform/gtk/fast/html/details-open-javascript-expected.txt:
* platform/gtk/fast/html/details-open2-expected.txt:
* platform/gtk/fast/html/details-open4-expected.txt:
* platform/gtk/fast/html/details-replace-summary-child-expected.txt:
* platform/gtk/fast/html/details-replace-text-expected.txt:
* platform/gtk/fast/html/details-writing-mode-expected.txt:
* platform/gtk/fast/html/details-writing-mode-mixed-expected.txt:
* platform/gtk/fast/writing-mode/fieldsets-expected.txt:
* platform/gtk/svg/zoom/page/zoom-hixie-mixed-009-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262134 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoUse an Optional<> for LayerFragment::boundingBox
simon.fraser@apple.com [Tue, 26 May 2020 00:27:12 +0000 (00:27 +0000)]
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262133 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoMake isTableRow() an inline function
simon.fraser@apple.com [Tue, 26 May 2020 00:26:39 +0000 (00:26 +0000)]
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262132 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoExpose more network metrics to WebCoreNSURLSession
commit-queue@webkit.org [Tue, 26 May 2020 00:03:15 +0000 (00:03 +0000)]
Expose more network metrics to WebCoreNSURLSession
https://bugs.webkit.org/show_bug.cgi?id=212359
<rdar://problem/62909440>

Patch by Alex Christensen <achristensen@webkit.org> on 2020-05-25
Reviewed by Darin Adler.

Source/WebCore:

* 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]):

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):

Source/WTF:

* wtf/PlatformHave.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262131 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[css-grid] Prevent grid-template-rows from serializing adjacent <line-names>
obrufau@igalia.com [Mon, 25 May 2020 20:39:45 +0000 (20:39 +0000)]
[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.

LayoutTests/imported/w3c:

Update test expectations.

* web-platform-tests/css/css-grid/parsing/grid-shorthand-expected.txt:
* web-platform-tests/css/css-grid/parsing/grid-shorthand-valid-expected.txt:
* web-platform-tests/css/css-grid/parsing/grid-template-shorthand-expected.txt:
* web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid-expected.txt:

Source/WebCore:

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):

LayoutTests:

Update test expectations.

* fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt:
* fast/css-grid-layout/grid-template-shorthand-get-set.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262130 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoExtended Color Cleanup: Assert !isExtended() in Color::asSimpleColor()...finally
weinig@apple.com [Mon, 25 May 2020 19:25:51 +0000 (19:25 +0000)]
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262129 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoExtended Color Cleanup: Use the name SimpleColor consistently
weinig@apple.com [Mon, 25 May 2020 18:30:16 +0000 (18:30 +0000)]
Extended Color Cleanup: Use the name SimpleColor consistently
https://bugs.webkit.org/show_bug.cgi?id=212337

Reviewed by Anders Carlsson.
Source/WebCore:

- 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):

Source/WebKit:

* UIProcess/ios/WKContentViewInteraction.mm:
(compositionHighlights):
Update for new name of CompositionHighlight::defaultCompositionFillColor.

Tools:

* TestWebKitAPI/Tests/WebCore/ColorTests.cpp:
(TestWebKitAPI::TEST):
Update test for rename of makeRGBAFromHSLA to makeSimpleColorFromHSLA.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262128 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[Subpixel layout] Bad scrolling on mercurynews.com article
zalan@apple.com [Mon, 25 May 2020 16:41:40 +0000 (16:41 +0000)]
[Subpixel layout] Bad scrolling on mercurynews.com article
https://bugs.webkit.org/show_bug.cgi?id=201038
<rdar://problem/28489812>

Reviewed by Dean Jackson.

Source/WebCore:

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):

LayoutTests:

* fast/inline/hidpi-inline-block-is-subpixel-while-line-is-not-expected.html: Added.
* fast/inline/hidpi-inline-block-is-subpixel-while-line-is-not.html: Added.
* platform/ios/css2.1/t0804-c5509-padn-l-03-f-g-expected.txt:
* platform/ios/css3/flexbox/flexbox-baseline-expected.txt:
* platform/ios/editing/selection/select-across-readonly-input-1-expected.txt: Added.
* platform/ios/editing/selection/select-across-readonly-input-2-expected.txt: Added.
* platform/ios/editing/selection/select-across-readonly-input-3-expected.txt: Added.
* platform/ios/editing/selection/select-across-readonly-input-4-expected.txt: Added.
* platform/ios/editing/selection/select-across-readonly-input-5-expected.txt: Added.
* platform/ios/fast/borders/fieldsetBorderRadius-expected.txt: Copied from LayoutTests/platform/mac/fast/borders/fieldsetBorderRadius-expected.txt.
* platform/ios/fast/forms/select-item-background-clip-expected.txt:
* platform/ios/fast/gradients/list-item-gradient-expected.txt:
* platform/ios/fast/html/details-add-child-1-expected.txt:
* platform/ios/fast/html/details-add-child-2-expected.txt:
* platform/ios/fast/html/details-add-details-child-1-expected.txt:
* platform/ios/fast/html/details-add-details-child-2-expected.txt:
* platform/ios/fast/html/details-add-summary-1-and-click-expected.txt:
* platform/ios/fast/html/details-add-summary-1-expected.txt:
* platform/ios/fast/html/details-add-summary-10-and-click-expected.txt:
* platform/ios/fast/html/details-add-summary-10-expected.txt:
* platform/ios/fast/html/details-add-summary-2-and-click-expected.txt:
* platform/ios/fast/html/details-add-summary-2-expected.txt:
* platform/ios/fast/html/details-add-summary-3-and-click-expected.txt:
* platform/ios/fast/html/details-add-summary-3-expected.txt:
* platform/ios/fast/html/details-add-summary-4-and-click-expected.txt:
* platform/ios/fast/html/details-add-summary-4-expected.txt:
* platform/ios/fast/html/details-add-summary-5-and-click-expected.txt:
* platform/ios/fast/html/details-add-summary-5-expected.txt:
* platform/ios/fast/html/details-add-summary-6-and-click-expected.txt:
* platform/ios/fast/html/details-add-summary-6-expected.txt:
* platform/ios/fast/html/details-add-summary-7-and-click-expected.txt:
* platform/ios/fast/html/details-add-summary-7-expected.txt:
* platform/ios/fast/html/details-add-summary-8-and-click-expected.txt:
* platform/ios/fast/html/details-add-summary-8-expected.txt:
* platform/ios/fast/html/details-add-summary-9-and-click-expected.txt:
* platform/ios/fast/html/details-add-summary-9-expected.txt:
* platform/ios/fast/html/details-add-summary-child-1-expected.txt:
* platform/ios/fast/html/details-add-summary-child-2-expected.txt:
* platform/ios/fast/html/details-marker-style-expected.txt:
* platform/ios/fast/html/details-marker-style-mixed-expected.txt:
* platform/ios/fast/html/details-nested-1-expected.txt:
* platform/ios/fast/html/details-nested-2-expected.txt:
* platform/ios/fast/html/details-no-summary1-expected.txt:
* platform/ios/fast/html/details-no-summary2-expected.txt:
* platform/ios/fast/html/details-no-summary3-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-open1-expected.txt:
* platform/ios/fast/html/details-open2-expected.txt:
* platform/ios/fast/html/details-open3-expected.txt:
* platform/ios/fast/html/details-open4-expected.txt:
* platform/ios/fast/html/details-open5-expected.txt:
* platform/ios/fast/html/details-open6-expected.txt:
* platform/ios/fast/html/details-position-expected.txt:
* platform/ios/fast/html/details-remove-child-1-expected.txt:
* platform/ios/fast/html/details-remove-child-2-expected.txt:
* platform/ios/fast/html/details-remove-summary-1-and-click-expected.txt:
* platform/ios/fast/html/details-remove-summary-1-expected.txt:
* platform/ios/fast/html/details-remove-summary-2-and-click-expected.txt:
* platform/ios/fast/html/details-remove-summary-2-expected.txt:
* platform/ios/fast/html/details-remove-summary-3-and-click-expected.txt:
* platform/ios/fast/html/details-remove-summary-3-expected.txt:
* platform/ios/fast/html/details-remove-summary-4-and-click-expected.txt:
* platform/ios/fast/html/details-remove-summary-4-expected.txt:
* platform/ios/fast/html/details-remove-summary-5-and-click-expected.txt:
* platform/ios/fast/html/details-remove-summary-5-expected.txt:
* platform/ios/fast/html/details-remove-summary-6-and-click-expected.txt:
* platform/ios/fast/html/details-remove-summary-6-expected.txt:
* platform/ios/fast/html/details-remove-summary-child-1-expected.txt:
* platform/ios/fast/html/details-remove-summary-child-2-expected.txt:
* platform/ios/fast/html/details-replace-summary-child-expected.txt:
* platform/ios/fast/html/details-replace-text-expected.txt:
* platform/ios/fast/html/details-writing-mode-expected.txt:
* platform/ios/fast/html/details-writing-mode-mixed-expected.txt:
* platform/ios/fast/writing-mode/fieldsets-expected.txt:
* platform/ios/mathml/opentype/opentype-stretchy-horizontal-expected.txt:
* platform/ios/mathml/presentation/mo-stretch-expected.txt:
* platform/ios/mathml/presentation/roots-expected.txt:
* platform/mac/css2.1/t0804-c5509-padn-l-03-f-g-expected.txt:
* platform/mac/fast/block/basic/fieldset-stretch-to-legend-expected.txt:
* platform/mac/fast/borders/fieldsetBorderRadius-expected.txt:
* platform/mac/fast/css-generated-content/details-summary-before-after-expected.txt:
* platform/mac/fast/forms/basic-buttons-expected.txt:
* platform/mac/fast/html/details-add-child-1-expected.txt:
* platform/mac/fast/html/details-add-child-2-expected.txt:
* platform/mac/fast/html/details-add-details-child-1-expected.txt:
* platform/mac/fast/html/details-add-details-child-2-expected.txt:
* platform/mac/fast/html/details-add-summary-1-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-1-expected.txt:
* platform/mac/fast/html/details-add-summary-10-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-10-expected.txt:
* platform/mac/fast/html/details-add-summary-2-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-2-expected.txt:
* platform/mac/fast/html/details-add-summary-3-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-3-expected.txt:
* platform/mac/fast/html/details-add-summary-4-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-4-expected.txt:
* platform/mac/fast/html/details-add-summary-5-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-5-expected.txt:
* platform/mac/fast/html/details-add-summary-6-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-6-expected.txt:
* platform/mac/fast/html/details-add-summary-7-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-7-expected.txt:
* platform/mac/fast/html/details-add-summary-8-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-8-expected.txt:
* platform/mac/fast/html/details-add-summary-9-and-click-expected.txt:
* platform/mac/fast/html/details-add-summary-9-expected.txt:
* platform/mac/fast/html/details-add-summary-child-1-expected.txt:
* platform/mac/fast/html/details-add-summary-child-2-expected.txt:
* platform/mac/fast/html/details-marker-style-expected.txt:
* platform/mac/fast/html/details-nested-1-expected.txt:
* platform/mac/fast/html/details-nested-2-expected.txt:
* platform/mac/fast/html/details-no-summary1-expected.txt:
* platform/mac/fast/html/details-no-summary2-expected.txt:
* platform/mac/fast/html/details-no-summary3-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-open1-expected.txt:
* platform/mac/fast/html/details-open2-expected.txt:
* platform/mac/fast/html/details-open3-expected.txt:
* platform/mac/fast/html/details-open4-expected.txt:
* platform/mac/fast/html/details-open5-expected.txt:
* platform/mac/fast/html/details-open6-expected.txt:
* platform/mac/fast/html/details-position-expected.txt:
* platform/mac/fast/html/details-remove-child-1-expected.txt:
* platform/mac/fast/html/details-remove-child-2-expected.txt:
* platform/mac/fast/html/details-remove-summary-1-and-click-expected.txt:
* platform/mac/fast/html/details-remove-summary-1-expected.txt:
* platform/mac/fast/html/details-remove-summary-2-and-click-expected.txt:
* platform/mac/fast/html/details-remove-summary-2-expected.txt:
* platform/mac/fast/html/details-remove-summary-3-and-click-expected.txt:
* platform/mac/fast/html/details-remove-summary-3-expected.txt:
* platform/mac/fast/html/details-remove-summary-4-and-click-expected.txt:
* platform/mac/fast/html/details-remove-summary-4-expected.txt:
* platform/mac/fast/html/details-remove-summary-5-and-click-expected.txt:
* platform/mac/fast/html/details-remove-summary-5-expected.txt:
* platform/mac/fast/html/details-remove-summary-6-and-click-expected.txt:
* platform/mac/fast/html/details-remove-summary-6-expected.txt:
* platform/mac/fast/html/details-remove-summary-child-1-expected.txt:
* platform/mac/fast/html/details-remove-summary-child-2-expected.txt:
* platform/mac/fast/html/details-replace-summary-child-expected.txt:
* platform/mac/fast/html/details-replace-text-expected.txt:
* platform/mac/fast/html/details-writing-mode-expected.txt:
* platform/mac/fast/writing-mode/fieldsets-expected.txt:
* platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt:
* platform/mac/mathml/presentation/mo-stretch-expected.txt:
* platform/mac/mathml/presentation/roots-expected.txt:
* platform/mac/svg/zoom/page/zoom-hixie-mixed-009-expected.txt:
* platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt:
* platform/mac/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt:
* platform/mac/svg/zoom/page/zoom-svg-through-object-with-huge-size-expected.txt:
* platform/mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262127 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[WPE] Gardening, update test expectations after r262120
dpino@igalia.com [Mon, 25 May 2020 16:03:59 +0000 (16:03 +0000)]
[WPE] Gardening, update test expectations after r262120
https://bugs.webkit.org/show_bug.cgi?id=212353

Unreviewed gardening.

* platform/glib/TestExpectations:
* platform/glib/fast/canvas/webgl/webgl-compressed-texture-astc-expected.txt: Renamed from LayoutTests/platform/gtk/fast/canvas/webgl/webgl-compressed-texture-astc-expected.txt.
* platform/gtk/TestExpectations:
* platform/gtk/fast/canvas/webgl/readPixels-float-expected.txt: Removed.
* platform/wpe/TestExpectations:
* platform/wpe/fast/dom/navigator-detached-no-crash-expected.txt: Emit baseline after r260075.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262126 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoUse child text content when determining whether to bail early in running a script
commit-queue@webkit.org [Mon, 25 May 2020 14:47:51 +0000 (14:47 +0000)]
Use child text content when determining whether to bail early in running a script
https://bugs.webkit.org/show_bug.cgi?id=182695

Patch by Rob Buis <rbuis@igalia.com> on 2020-05-25
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Update improved test results.

* web-platform-tests/html/semantics/scripting-1/the-script-element/emptyish-script-elements-expected.txt:

Source/WebCore:

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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262125 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[css-flex] Allow indefinite size flex items to be definite wrt resolving percentages...
svillar@igalia.com [Mon, 25 May 2020 14:18:22 +0000 (14:18 +0000)]
[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.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-flexbox/percentage-heights-003-expected.txt: There were 3 subtests
marked as failures. All of them work fine now.

Source/WebCore:

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.

LayoutTests:

* css3/flexbox/definite-main-size-expected.txt: Updated expectation.
* css3/flexbox/definite-main-size.html: Updated comment.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262124 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[GTK] Gardening, update test expectations after r262060
dpino@igalia.com [Mon, 25 May 2020 13:58:35 +0000 (13:58 +0000)]
[GTK] Gardening, update test expectations after r262060
https://bugs.webkit.org/show_bug.cgi?id=212346

Unreviewed gardening.

* platform/glib/TestExpectations:
* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262123 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoAVVideoCaptureSource should notify of video samples in a background thread
youenn@apple.com [Mon, 25 May 2020 13:34:48 +0000 (13:34 +0000)]
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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262122 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[Flatpak][GStreamer] compilation fails when GST_BUILD_PATH is defined
commit-queue@webkit.org [Mon, 25 May 2020 11:58:17 +0000 (11:58 +0000)]
[Flatpak][GStreamer] compilation fails when GST_BUILD_PATH is defined
https://bugs.webkit.org/show_bug.cgi?id=212343

Patch by Víctor Manuel Jáquez Leal <vjaquez@igalia.com> on 2020-05-25
Reviewed by Philippe Normand.

Flatpak's command has to be expressed before gst-env declaration.

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262121 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoNon-unified build fixes, late May 2020 edition
aperez@igalia.com [Mon, 25 May 2020 11:31:07 +0000 (11:31 +0000)]
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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262120 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[WPE][WKTR] Fix typo in EventSenderProxyWPE
aperez@igalia.com [Mon, 25 May 2020 10:10:32 +0000 (10:10 +0000)]
[WPE][WKTR] Fix typo in EventSenderProxyWPE
https://bugs.webkit.org/show_bug.cgi?id=212340

Reviewed by Carlos Garcia Campos.

Tools:

* WebKitTestRunner/wpe/EventSenderProxyWPE.cpp:
(WTR::wpeKeySymForKeyRef): Fix typo rightArror -> rightArrow.

LayoutTests:

* platform/wpe/TestExpectations: fast/events/keydown-numpad-keys.html is now passing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262119 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[GTK][WPE] Gardening, emit baselines for update-the-source-set.html after r261929.
dpino@igalia.com [Mon, 25 May 2020 08:37:41 +0000 (08:37 +0000)]
[GTK][WPE] Gardening, emit baselines for update-the-source-set.html after r261929.
https://bugs.webkit.org/show_bug.cgi?id=212216

Unreviewed gardening.

* platform/glib/TestExpectations:
* platform/gtk/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt: Added.
* platform/wpe/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262118 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoREGRESSION(r262057): [Flatpak SDK] sccache-dist server no longer starting
commit-queue@webkit.org [Mon, 25 May 2020 08:33:09 +0000 (08:33 +0000)]
REGRESSION(r262057): [Flatpak SDK] sccache-dist server no longer starting
https://bugs.webkit.org/show_bug.cgi?id=212326

Patch by Philippe Normand <pnormand@igalia.com> on 2020-05-25
Reviewed by Žan Doberšek.

A few mount points were missing in the sandbox created by
`flatpak run` preventing the sccache-dist server to start and keep running.

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox):
* flatpak/webkit-bwrap:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262117 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[Flatpak SDK] Fixup icecc support
commit-queue@webkit.org [Mon, 25 May 2020 08:31:38 +0000 (08:31 +0000)]
[Flatpak SDK] Fixup icecc support
https://bugs.webkit.org/show_bug.cgi?id=212301

Patch by Philippe Normand <pnormand@igalia.com> on 2020-05-25
Reviewed by Žan Doberšek.

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox): Allow homedir access from the
sandbox, this is needed because the icecc toolchains paths refer
to the host environment, not the sandbox.
(WebkitFlatpak.pack_toolchain): Fix byte-string formatting issue, happening in Python3.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262116 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[GTK4] SDK contains too old GTK4
commit-queue@webkit.org [Mon, 25 May 2020 08:16:57 +0000 (08:16 +0000)]
[GTK4] SDK contains too old GTK4
https://bugs.webkit.org/show_bug.cgi?id=212334

Patch by Philippe Normand <pnormand@igalia.com> on 2020-05-25
Reviewed by Adrian Perez de Castro.

* buildstream/elements/sdk/gtk.bst: Update GTK4 to 3.98.4.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262115 268f45cc-cd09-0410-ab3c-d52691b4dbfc