WebKit-https.git
2 months agoWeb Inspector: Elements: show shadow DOM by default
mattbaker@apple.com [Tue, 25 Jun 2019 23:45:37 +0000 (23:45 +0000)]
Web Inspector: Elements: show shadow DOM by default
https://bugs.webkit.org/show_bug.cgi?id=199128

Reviewed by Devin Rousso.

* UserInterface/Base/Setting.js:

* UserInterface/Test/Test.js:
(WI.loaded):
Overriding the default value isn't necessary since the default is now true.

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

2 months agoClicking the up/down spin buttons for a number input increments/decrements by 2.
timothy@apple.com [Tue, 25 Jun 2019 23:42:03 +0000 (23:42 +0000)]
Clicking the up/down spin buttons for a number input increments/decrements by 2.
https://bugs.webkit.org/show_bug.cgi?id=198809

Reviewed by Tim Horton.

AppKit no longer registers NSScrollerButtonDelay and NSScrollerButtonPeriod in the base
NSUserDefaults for an app. This caused our use to always get 0s when setting the click
and hold timer, causing the value to increment quickly for a single press.

* platform/mac/ScrollbarThemeMac.h:
(WebCore::ScrollbarThemeMac::initialAutoscrollTimerDelay): Added. Hardcode 500ms.
(WebCore::ScrollbarThemeMac::autoscrollTimerDelay): Added. Hardcode 50ms.
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::preferencesChanged): Removed use of old user defaults.
(WebCore::ScrollbarThemeMac::initialAutoscrollTimerDelay): Deleted.
(WebCore::ScrollbarThemeMac::autoscrollTimerDelay): Deleted.

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

2 months agoNon-editable text selections should be modifiable with hardware keyboard
dbates@webkit.org [Tue, 25 Jun 2019 23:41:31 +0000 (23:41 +0000)]
Non-editable text selections should be modifiable with hardware keyboard
https://bugs.webkit.org/show_bug.cgi?id=199204
<rdar://problem/51651496>

Reviewed by Wenson Hsieh.

Source/WebKit:

UIKit changes are need for this to work, including <rdar://problem/48322899>.
Note that without these changes, -canPerformAction is never called for _move*
selectors.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformAction:withSender:]):

LayoutTests:

Add a test, skipped for now, until we have the fix for <rdar://problem/48322899>.

* editing/selection/ios/select-non-editable-text-using-keyboard-expected.txt: Added.
* editing/selection/ios/select-non-editable-text-using-keyboard.html: Added.
* platform/ios/TestExpectations:
* resources/ui-helper.js:
(window.UIHelper.callFunctionAndWaitForEvent): Added.

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

2 months agoREGRESSION(r246621): Web Inspector: Styles: property may get removed when editing...
nvasilyev@apple.com [Tue, 25 Jun 2019 23:40:14 +0000 (23:40 +0000)]
REGRESSION(r246621): Web Inspector: Styles: property may get removed when editing after deleting value
https://bugs.webkit.org/show_bug.cgi?id=199143
<rdar://problem/52042815>

Reviewed by Matt Baker.

r246621 affected when WI.CSSStyleDeclaration.Event.PropertiesChanged event is fired, which caused
SpreadsheetCSSStyleDeclarationEditor to possibly enter a state when `focused` property is
incorrectly set to false.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved): Removed.
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyWillRemove): Added.
Renamed from "removed" to "willRemove" since we need to call it before the property DOM element
is detached from the document.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.remove):
Don't set focused to false when the removed property wasn't focused.
This code need to exist because removing focused element from the DOM doesn't trigger blur event.

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

2 months ago[Win] MiniBrowser should default to webkit.org
ross.kirsling@sony.com [Tue, 25 Jun 2019 23:24:30 +0000 (23:24 +0000)]
[Win] MiniBrowser should default to webkit.org
https://bugs.webkit.org/show_bug.cgi?id=199201

Reviewed by Don Olmstead.

* MiniBrowser/win/BrowserWindow.h:
* MiniBrowser/win/MiniBrowserReplace.h:
* MiniBrowser/win/WebKitBrowserWindow.cpp:
(WebKitBrowserWindow::loadHTMLString): Deleted.
* MiniBrowser/win/WebKitBrowserWindow.h:
* MiniBrowser/win/WebKitLegacyBrowserWindow.cpp:
(WebKitLegacyBrowserWindow::loadHTMLString): Deleted.
* MiniBrowser/win/WebKitLegacyBrowserWindow.h:
* MiniBrowser/win/WinMain.cpp:
(wWinMain):

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

2 months agoUnreviewed, windows build fix.
keith_miller@apple.com [Tue, 25 Jun 2019 22:13:41 +0000 (22:13 +0000)]
Unreviewed, windows build fix.

* bindings/js/JSDOMGlobalObject.h:

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

2 months ago[iOS] Should not process key events in non-editable elements using IME
dbates@webkit.org [Tue, 25 Jun 2019 21:47:10 +0000 (21:47 +0000)]
[iOS] Should not process key events in non-editable elements using IME
https://bugs.webkit.org/show_bug.cgi?id=199122
<rdar://problem/52006654>

Reviewed by Brent Fulgham.

Source/WebKit:

Use the non-Input Method code path (the one we use for US keyboard input) for all key events
targeting a non-editable element. Such key events will never require Input Method support
(i.e. show candidate suggestions). Moreover, this behavior matches the behavior on Mac.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView handleKeyWebEvent:withCompletionHandler:]):

LayoutTests:

Add a test to ensure that we do not process key events as being handled by the Input Manager
when using a Chinese keyboard layout and targeting a non-editable element.

* fast/events/ios/keydown-keyup-keypress-keys-in-non-editable-using-chinese-keyboard-expected.txt: Added.
* fast/events/ios/keydown-keyup-keypress-keys-in-non-editable-using-chinese-keyboard.html: Added.

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

2 months ago[fuchsia] Update to newer zx_clock_get syscall
abarth@webkit.org [Tue, 25 Jun 2019 21:35:03 +0000 (21:35 +0000)]
[fuchsia] Update to newer zx_clock_get syscall
https://bugs.webkit.org/show_bug.cgi?id=199191

Reviewed by Sam Weinig.

Fuchsia has changed the zx_clock_get syscall to return the clock value
via an out parameter rather than via its return value. This change
makes zx_clock_get consistent with all the other syscalls.

This patch updates our use of zx_clock_get to use the new syscall. The
old syscall is no longer supported by Fuchsia.

* wtf/fuchsia/CPUTimeFuchsia.cpp:
(WTF::CPUTime::get): Switch to using the out parameter.
(WTF::CPUTime::forCurrentThread): Switch to using the out parameter.

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

2 months agoAdd didBecomePrototype() calls to global context prototypes
keith_miller@apple.com [Tue, 25 Jun 2019 21:19:21 +0000 (21:19 +0000)]
Add didBecomePrototype() calls to global context prototypes
https://bugs.webkit.org/show_bug.cgi?id=199202

Reviewed by Mark Lam.

This fixes some crashes related to asserting that all prototypes
have been marked as such in JSC from
https://trac.webkit.org/changeset/246801. It's ok to call
didBecomePrototype here as we setting up the world state right now
so we won't be having a bad time.

We don't automatically call didBecomePrototype() for
setPrototypeWithoutTransition because existing objects may already
have this structure so it seems more reasonable to be explicit
there.

* bindings/js/JSWindowProxy.cpp:
(WebCore::JSWindowProxy::setWindow):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::initScript):
* worklets/WorkletScriptController.cpp:
(WebCore::WorkletScriptController::initScriptWithSubclass):

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

2 months agoMake HTTPCookieAcceptPolicy an enum class
commit-queue@webkit.org [Tue, 25 Jun 2019 21:08:23 +0000 (21:08 +0000)]
Make HTTPCookieAcceptPolicy an enum class
https://bugs.webkit.org/show_bug.cgi?id=199081

Patch by Alex Christensen <achristensen@webkit.org> on 2019-06-25
Source/WebCore/PAL:

Reviewed by Michael Catanzaro

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

Reviewed by Michael Catanzaro.

Doing so reveals some interesting bugs in the C API that are also fixed:
WKPreferencesGetIncrementalRenderingSuppressionTimeout was using its toAPI function to convert a double to a double because HTTPCookieAcceptPolicy used to be an unsigned integer.
toAPI(WebCore::MouseButton) was also using the toAPI(HTTPCookieAcceptPolicy) because HTTPCookieAcceptPolicy used to be an unsigned integer.
Yikes!  Type safety is our friend.

* NetworkProcess/Cookies/WebCookieManager.messages.in:
* NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
(WebKit::toCFHTTPCookieStorageAcceptPolicy):
(WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
(WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
* Shared/HTTPCookieAcceptPolicy.h:
(): Deleted.
* UIProcess/API/C/WKAPICast.h:
(WebKit::toHTTPCookieAcceptPolicy):
(WebKit::toAPI):
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesGetIncrementalRenderingSuppressionTimeout):
* UIProcess/API/Cocoa/WKProcessPool.mm:
(toHTTPCookieAcceptPolicy):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebCookieManagerProxy.messages.in:

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

2 months ago[macOS WK2] REGRESSION (r242313): Layout Test scrollingcoordinator/mac/multiple-fixed...
tsavell@apple.com [Tue, 25 Jun 2019 20:51:19 +0000 (20:51 +0000)]
[macOS WK2] REGRESSION (r242313): Layout Test scrollingcoordinator/mac/multiple-fixed.html is a flaky time out and image diff
https://bugs.webkit.org/show_bug.cgi?id=195635

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 months agoWrong title for Data Detectors tap action menu
timothy_horton@apple.com [Tue, 25 Jun 2019 20:51:12 +0000 (20:51 +0000)]
Wrong title for Data Detectors tap action menu
https://bugs.webkit.org/show_bug.cgi?id=199198
<rdar://problem/51957842>

Reviewed by Wenson Hsieh.

* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant showDataDetectorsSheet]):
Always pass the results array through to DataDetectors; they need it
to figure out the title too!

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

2 months agoMigrate LayoutTests/http/tests/resourceLoadStatistics/clear-in-memory-and-persistent...
wilander@apple.com [Tue, 25 Jun 2019 20:48:36 +0000 (20:48 +0000)]
Migrate LayoutTests/http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store* test cases to setEnableFeature() and jsTestIsAsync
https://bugs.webkit.org/show_bug.cgi?id=199180
<rdar://problem/52085369>

Reviewed by Brent Fulgham.

* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-expected.txt:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-expected.txt:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html:

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

2 months agoStructure::create should call didBecomePrototype()
keith_miller@apple.com [Tue, 25 Jun 2019 19:49:22 +0000 (19:49 +0000)]
Structure::create should call didBecomePrototype()
https://bugs.webkit.org/show_bug.cgi?id=196315

Reviewed by Filip Pizlo.

Structure::create should also assert that the indexing type makes sense
for the prototype being used.

* runtime/JSObject.h:
* runtime/Structure.cpp:
(JSC::Structure::isValidPrototype):
(JSC::Structure::changePrototypeTransition):
* runtime/Structure.h:
(JSC::Structure::create): Deleted.
* runtime/StructureInlines.h:
(JSC::Structure::create):
(JSC::Structure::setPrototypeWithoutTransition):

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

2 months ago[iOS] Occasional crash under -[UIPreviewTarget initWithContainer:center:transform...
wenson_hsieh@apple.com [Tue, 25 Jun 2019 18:48:25 +0000 (18:48 +0000)]
[iOS] Occasional crash under -[UIPreviewTarget initWithContainer:center:transform:] when generating a drag preview
https://bugs.webkit.org/show_bug.cgi?id=199192
<rdar://problem/51554509>

Reviewed by Tim Horton.

Source/WebKit:

Tweak our preview generation code (for both the context menu and dragging) to be robust in the case where the
content view's unscaled view is nil; this may happen in the case after the web content process is terminated
and -cleanupInteraction is called, but before -setupInteraction is subsequently called.

Additionally, make our logic for creating targeted previews robust in the case where the view is removed from
the view hierarchy right before the platform asks for a targeted preview.

Test:   DragAndDropTests.WebProcessTerminationDuringDrag
        DragAndDropTests.WebViewRemovedFromViewHierarchyDuringDrag

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView containerViewForTargetedPreviews]):
(-[WKContentView _deliverDelayedDropPreviewIfPossible:]):
(-[WKContentView dragInteraction:previewForLiftingItem:session:]):
(-[WKContentView _ensureTargetedPreview]):

Tools:

Tweak the drag and drop simulator to ask for drag cancellation previews, and use this to write a couple tests to
verify that we gracefully handle web process termination and web view unparenting mid-drag.

* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/cocoa/DragAndDropSimulator.h:
* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
(-[DragAndDropSimulator _resetSimulatedState]):
(-[DragAndDropSimulator _concludeDropAndPerformOperationIfNecessary]):
(-[DragAndDropSimulator _advanceProgress]):
(-[DragAndDropSimulator liftPreviews]):
(-[DragAndDropSimulator cancellationPreviews]):
(-[DragAndDropSimulator setSessionWillBeginBlock:]):
(-[DragAndDropSimulator sessionWillBeginBlock]):
(-[DragAndDropSimulator _webView:dataInteraction:sessionWillBegin:]):

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

2 months agoLayout Test imported/mozilla/svg/text/textpath-selection.svg is flaky.
tsavell@apple.com [Tue, 25 Jun 2019 18:47:01 +0000 (18:47 +0000)]
Layout Test imported/mozilla/svg/text/textpath-selection.svg is flaky.
https://bugs.webkit.org/show_bug.cgi?id=199196

Unreviewed Test Gardening.

Patch by Russell Epstein <russell_e@apple.com> on 2019-06-25

* platform/ios-wk2/TestExpectations:

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

2 months agoWeb Inspector: Implement console.timeLog
pecoraro@apple.com [Tue, 25 Jun 2019 18:36:29 +0000 (18:36 +0000)]
Web Inspector: Implement console.timeLog
https://bugs.webkit.org/show_bug.cgi?id=199184

Reviewed by Devin Rousso.

Source/JavaScriptCore:

* inspector/JSGlobalObjectConsoleClient.cpp:
(Inspector::JSGlobalObjectConsoleClient::timeLog):
* inspector/JSGlobalObjectConsoleClient.h:
* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::logTiming):
(Inspector::InspectorConsoleAgent::stopTiming):
* inspector/agents/InspectorConsoleAgent.h:
* runtime/ConsoleClient.h:
* runtime/ConsoleObject.cpp:
(JSC::ConsoleObject::finishCreation):
(JSC::consoleProtoFuncTimeLog):

Source/WebCore:

Updated existing tests.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::logConsoleTimingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::logConsoleTiming):
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::timeLog):
* page/PageConsoleClient.h:
* workers/WorkerConsoleClient.cpp:
(WebCore::WorkerConsoleClient::timeLog):
* workers/WorkerConsoleClient.h:
* worklets/WorkletConsoleClient.cpp:
(WebCore::WorkletConsoleClient::timeLog):
* worklets/WorkletConsoleClient.h:

Source/WebInspectorUI:

* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
Time messages (like timeLog) do not include their messageText
in their parameters list. So to behave more like normal logs
build a parameter list that includes it at the front.

LayoutTests:

* inspector/console/console-time-expected.txt:
* inspector/console/console-time.html:
Add new timeLog tests.

* js/console-expected.txt:
New timeLog method.

* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
Unskip test.

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

2 months agoClose sockets with too high file descriptor
youenn@apple.com [Tue, 25 Jun 2019 18:09:32 +0000 (18:09 +0000)]
Close sockets with too high file descriptor
https://bugs.webkit.org/show_bug.cgi?id=199116

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

* Source/webrtc/rtc_base/physicalsocketserver.cc:
* WebKit/0001-Close-sockets-with-file-descriptors-above-FD_SETSIZE.patch: Added.

Source/WebKit:

Log the case of failing to open a socket.

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createSocket):

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

2 months agoWhen Caps Lock is enabled on the Smart Keyboard, can't scroll with space or arrow...
timothy_horton@apple.com [Tue, 25 Jun 2019 17:29:53 +0000 (17:29 +0000)]
When Caps Lock is enabled on the Smart Keyboard, can't scroll with space or arrow keys
https://bugs.webkit.org/show_bug.cgi?id=199187
<rdar://problem/51521709>

Reviewed by Anders Carlsson.

* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
When deciding whether a key event should start a scroll, ignore all
modifiers other than the ones we actually care about (including Caps Lock).

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

2 months ago[ews-build] UploadTestResults and ExtractTestResults clobber results in case of multi...
aakash_jain@apple.com [Tue, 25 Jun 2019 16:17:43 +0000 (16:17 +0000)]
[ews-build] UploadTestResults and ExtractTestResults clobber results in case of multiple layout test runs in a build
https://bugs.webkit.org/show_bug.cgi?id=199178

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(UploadTestResults.__init__): Add an optional identifier and append the identifier to the file name.
(ExtractTestResults.__init__): Ditto.
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit tests.

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

2 months agoREGRESSION(r245586): static assertion failed: Match result and EncodedMatchResult...
mcatanzaro@igalia.com [Tue, 25 Jun 2019 16:08:27 +0000 (16:08 +0000)]
REGRESSION(r245586): static assertion failed: Match result and EncodedMatchResult should be the same size
https://bugs.webkit.org/show_bug.cgi?id=198518

Reviewed by Keith Miller.

r245586 made some bad assumptions about the size of size_t, which we can solve using the
CPU(ADDRESS32) guard that I didn't know about.

This solution was developed by Mark Lam and Keith Miller. I'm just preparing the patch.

* runtime/MatchResult.h:

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

2 months agoAdd user agent quirk for bankofamerica.com
mcatanzaro@igalia.com [Tue, 25 Jun 2019 14:59:18 +0000 (14:59 +0000)]
Add user agent quirk for bankofamerica.com
https://bugs.webkit.org/show_bug.cgi?id=199154

Reviewed by Carlos Garcia Campos.

Source/WebCore:

This suppresses an unsupported browser warning.

* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):

Tools:

* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

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

2 months agoFully rename WebKitGTK+ -> WebKitGTK everywhere
mcatanzaro@igalia.com [Tue, 25 Jun 2019 14:56:39 +0000 (14:56 +0000)]
Fully rename WebKitGTK+ -> WebKitGTK everywhere
https://bugs.webkit.org/show_bug.cgi?id=199159

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/FindGLIB.cmake:

Source/WebCore:

* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(webkitAccessibleTextGetStringAtOffset):
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::saveCredentialToPersistentStorage):
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::adjustTextFieldStyle const):

Source/WebKit:

* UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:

Source/WTF:

* wtf/URLParser.cpp:
(WTF::URLParser::internationalDomainNameTranscoder):

Tools:

* BuildSlaveSupport/gtk/README:
* MiniBrowser/gtk/BrowserWindow.c:
* MiniBrowser/gtk/main.c:
(aboutURISchemeRequestCallback):
* Scripts/webkitpy/common/config/contributionareas.py:
* Scripts/webkitpy/common/config/contributors.json:
* Scripts/webkitpy/tool/commands/analyzechangelog_unittest.py:
* TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp:
* TestWebKitAPI/Tests/WebKitGLib/TestResources.cpp:
(testWebViewResources):
* TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
(testWebViewMouseTarget):
* TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp:
(testWebExtensionGetTitle):
(testDocumentLoadedSignal):
(testWebExtensionFormControlsAssociated):
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettingsUserAgent):
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewRunJavaScript):
* TestWebKitAPI/Tests/WebKitGtk/InspectorTestServer.cpp:
(main):
* TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp:
(prepareContextMenuTestView):
(testContextMenuPopulateMenu):
(testContextMenuCustomMenu):
(testContextMenuDisableMenu):
(testContextMenuSubMenu):
(testContextMenuDismissed):
(testContextMenuWebExtensionMenu):
(testContextMenuWebExtensionNode):
* TestWebKitAPI/Tests/WebKitGtk/TestInspector.cpp:
(testInspectorDefault):
(testInspectorManualAttachDetach):
(testInspectorCustomContainerDestroyed):
* TestWebKitAPI/Tests/WebKitGtk/TestPrinting.cpp:
(testWebViewPrint):
(testPrintOperationPrint):
(testPrintOperationErrors):
* gtk/install-dependencies:
* gtk/jhbuild.modules:
* gtkdoc/generate-gtkdoc:
* wpe/install-dependencies:

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

2 months agoRequire GCC 7
mcatanzaro@igalia.com [Tue, 25 Jun 2019 14:47:44 +0000 (14:47 +0000)]
Require GCC 7
https://bugs.webkit.org/show_bug.cgi?id=198914

Reviewed by Darin Adler.

.:

* CMakeLists.txt:

Source/WTF:

Remove now-stale GCC version check.

* wtf/Compiler.h:

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

2 months agoUnreviewed test gardening
Hironori.Fujii@sony.com [Tue, 25 Jun 2019 09:13:53 +0000 (09:13 +0000)]
Unreviewed test gardening

* TestExpectations: Added webkit.org/b/184066 to imported/w3c/web-platform-tests/IndexedDB/nested-cloning-large-multiple.html and others.
Added webkit.org/b/184065 to imported/w3c/web-platform-tests/IndexedDB/keypath-exceptions.htm.

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

2 months ago[WinCairo] Unreviewed test gardening
Hironori.Fujii@sony.com [Tue, 25 Jun 2019 09:00:53 +0000 (09:00 +0000)]
[WinCairo] Unreviewed test gardening

* platform/wincairo/TestExpectations: Added webkit.org/b/199186 to fonts/use-typo-metrics-1.html.
Removed duplicated storage/indexeddb/key-type-array-private.html and storage/indexeddb/key-type-array.html.

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

2 months agoIntroduce LinkLoadParameters
commit-queue@webkit.org [Tue, 25 Jun 2019 08:42:30 +0000 (08:42 +0000)]
Introduce LinkLoadParameters
https://bugs.webkit.org/show_bug.cgi?id=198960

Patch by Rob Buis <rbuis@igalia.com> on 2019-06-25
Reviewed by Frédéric Wang.

Avoid the long parameters lists in LinkLoader by moving them
to LinkLoadParameters.

No new tests because there is no behavior change.

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLinksFromHeader):
(WebCore::LinkLoader::preconnectIfNeeded):
(WebCore::LinkLoader::preloadIfNeeded):
(WebCore::LinkLoader::prefetchIfNeeded):
(WebCore::LinkLoader::loadLink):
* loader/LinkLoader.h:

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

2 months ago[Text autosizing] [iPadOS] Revise our heuristics to determine idempotent text autosiz...
wenson_hsieh@apple.com [Tue, 25 Jun 2019 04:06:51 +0000 (04:06 +0000)]
[Text autosizing] [iPadOS] Revise our heuristics to determine idempotent text autosizing candidates
https://bugs.webkit.org/show_bug.cgi?id=198763
<rdar://problem/51826266>

Reviewed by Simon Fraser.

Source/WebCore:

This patch adjusts existing text autosizing heuristics, based on a survey of text on websites in the Alexa top
500 that shrink down to fit the viewport when requesting the desktop version of the site. The new heuristic is
derived from training decision trees against the dataset obtained from this survey, and balances false positives
(cases where layout is broken due to autosizing) against overall accuracy (measured using cross-validation).

See below for more details. Additionally, please refer to the link in the radar for more details, as well as
resources used to generate, validate, and analyze these decision trees.

Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyleForTextAutosizing):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::isIdempotentTextAutosizingCandidate const):

Rename AutosizeStatus::shouldSkipSubtree to RenderStyle::isIdempotentTextAutosizingCandidate. We relocate this
logic to RenderStyle, such that we're able to ask the element's RenderStyle questions when determining whether
the element should be autosized.

Of course, this patch additionally revamps the heuristic used to determine whether it is safe to autosize an
element. Our current heuristic in trunk simply checks for the presence of inline block display, out of flow
positioning and a fixed height ancestor; if any of these conditions are satisfied, we opt the element out of
text autosizing. This is an excellent strategy for boosting some runs of text while avoiding autosizing in the
vast majority of cases where increasing font size may lead to layout breakage (e.g. overlapping or clipped text,
content unexpectedly flowing to the next line, etc.). However, it also avoids boosting font sizes in many
scenarios where boosting font sizes is desired; for concrete examples, see the (currently 24) radars about small
font sizes that are duped to <rdar://problem/51826266>.

To help analyze and identify trends in autosizable and non-autosizable text, we assembled a dataset of elements
with text from the Alexa top 500 that either: (1) were too small and could be boosted safely, or (2) would break
layout if boosted. With this labeled dataset, we then trained binary decision trees to classify the data. Each
decision tree was trained with a number of hyperparameters: namely, maximum depth, minimum leaf size, and the
amount of bias towards negative samples (i.e. the ratio of the weight of a non-autosizable sample relative to
the weight of an autosizable sample).

For each 3-tuple of these hyperparameters (800 in total: max depth between 3 and 10, min leaf size between 1 and
10 and bias between 1 and 10), for 5000 iterations each, we split the full dataset into a training dataset and
a cross-validation dataset, trained a decision tree using the training set, and tested against the cross-
validation set to compute average precision, recall, and overall accuracy for each tuple of hyperparameters.

The decision tree introduced in this patch was generated using a hand-picked set of hyperparameters (max depth
10, min leaf size 4, and negative bias 2) to provide a balance between precision scores (limiting layout
breakage) and recall score (ensuring that small text is mostly autosized), while optimizing for overall
accuracy. Cross-validation scores predict that the overall accuracy of this classifier is approximately 70%, up
from the current accuracy in trunk (~53%).

* rendering/style/RenderStyle.h:

Grow the width of `autosizeStatus` from 4 to 8 (notably, this does not increase the size of RenderStyle).

* rendering/style/TextSizeAdjustment.cpp:
(WebCore::AutosizeStatus::updateStatus):
(WebCore::AutosizeStatus::shouldSkipSubtree const): Deleted.
* rendering/style/TextSizeAdjustment.h:

Introduce new text autosizing state flags, and remove some existing ones.

LayoutTests:

Rebaseline an existing text autosizing test, and introduce some new test cases that correspond to several common
patterns of autosizable (or non-autosizable) text on websites that were surveyed.

* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-after-changing-initial-scale.html:
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates-expected.txt: Added.
* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-candidates.html: Renamed from LayoutTests/fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-skip.html.

Rename this existing layout test too, to avoid using the term "skip" in the name of a layout test.

* fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-skip-expected.txt: Removed.

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

2 months agoUnreviewed, rolling out r246714.
commit-queue@webkit.org [Tue, 25 Jun 2019 01:21:32 +0000 (01:21 +0000)]
Unreviewed, rolling out r246714.
https://bugs.webkit.org/show_bug.cgi?id=199179

revert to do patch in a different way. (Requested by keith_mi_
on #webkit).

Reverted changeset:

"All prototypes should call didBecomePrototype()"
https://bugs.webkit.org/show_bug.cgi?id=196315
https://trac.webkit.org/changeset/246714

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

2 months agoRevert "-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]...
beidson@apple.com [Tue, 25 Jun 2019 00:26:41 +0000 (00:26 +0000)]
Revert "-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials"

See <rdar://problem/52077293>

This reverts commit d86464be5509e2e6dbc7356cfd802e6b4e14b350.

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

2 months agoREGRESSION (r244436): IndexedDB Uint8Array returned as ArrayBuffer
sihui_liu@apple.com [Mon, 24 Jun 2019 23:45:41 +0000 (23:45 +0000)]
REGRESSION (r244436): IndexedDB Uint8Array returned as ArrayBuffer
https://bugs.webkit.org/show_bug.cgi?id=198738
<rdar://problem/51614053>

Reviewed by Brady Eidson.

In InexedDB, two binary keys are the same as long as their data is the same.

Modified tests: storage/indexeddb/key-type-binary.html
                storage/indexeddb/key-type-binary-private.html

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::injectIDBKeyIntoScriptValue):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readArrayBufferView):

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

2 months agoRemove WebSQL quirk for nytimes.com
sihui_liu@apple.com [Mon, 24 Jun 2019 23:26:36 +0000 (23:26 +0000)]
Remove WebSQL quirk for nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=199175

Reviewed by Geoffrey Garen.

Removed unused code.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* page/Quirks.cpp:
(WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
(WebCore::Quirks::hasWebSQLSupportQuirk const): Deleted.
* page/Quirks.h:

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

2 months agoNull deref in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad.
beidson@apple.com [Mon, 24 Jun 2019 23:00:22 +0000 (23:00 +0000)]
Null deref in WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad.
<rdar://problem/51535942> and https://bugs.webkit.org/show_bug.cgi?id=199123

Reviewed by Andy Estes.

Source/WebCore:

* loader/FrameLoaderStateMachine.h:
(WebCore::FrameLoaderStateMachine::stateForDebugging const):

Source/WebKit:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): Properly detect this null DocumentLoader
  and try to learn more about the state of things.

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

2 months agoREGRESSION (r246725 ): Crashes on twitch.tv
simon.fraser@apple.com [Mon, 24 Jun 2019 22:44:09 +0000 (22:44 +0000)]
REGRESSION (r246725 ): Crashes on twitch.tv
https://bugs.webkit.org/show_bug.cgi?id=199176
Source/WebCore:

rdar://problem/52071249

Reviewed by Zalan Bujtas.

With a composited negative z-index child inside a scroller, we can register the overflow scroll
proxy node before we've traversed the overflow layer, so it that layer hasn't got its OverflowScrollingNode
yet. Thus, AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes() can be called with an empty vector.
Avoid crashing when this happens.

Test: scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child.html

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes):
* page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
(WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):

LayoutTests:

Reviewed by Zalan Bujtas.

* scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/scroller-with-negative-z-child.html: Added.

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

2 months agoAdd Array.prototype.{flat,flatMap} to unscopables
commit-queue@webkit.org [Mon, 24 Jun 2019 22:29:00 +0000 (22:29 +0000)]
Add Array.prototype.{flat,flatMap} to unscopables
https://bugs.webkit.org/show_bug.cgi?id=194322

Patch by Alexey Shvayka <shvaikalesh@gmail.com> on 2019-06-24
Reviewed by Keith Miller.

JSTests:

* stress/unscopables.js: Fix test.
* test262/expectations.yaml: Mark 2 test cases as passing.

Source/JavaScriptCore:

* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::finishCreation):

LayoutTests:

* js/array-unscopables-properties-expected.txt:
* js/script-tests/array-unscopables-properties.js:

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

2 months agoPages using Google's anti-flicker optimization may take ~5 seconds to do initial...
cdumez@apple.com [Mon, 24 Jun 2019 22:22:42 +0000 (22:22 +0000)]
Pages using Google's anti-flicker optimization may take ~5 seconds to do initial paint
https://bugs.webkit.org/show_bug.cgi?id=199173
<rdar://problem/45968770>

Reviewed by Geoffrey Garen.

Source/WebCore:

Pages using Google's anti-flicker optimization [1] take ~5 seconds to do initial paint when
analytics.js load is blocked by a content blocker.

To address the issue, this patch introduces a quirk behind an experimental feature flag that
calls window.dataLayer.hide.end() on the page when the load of https://www.google-analytics.com/analytics.js
is blocked by a content blocker. Note that this is more robust than dropping the 'async-hide'
class from document.documentElement since the class name is customizable by the caller.
A message is logged in the console when the quirk causes window.dataLayer.hide.end() to get called
early.

[1] https://developers.google.com/optimize/

* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
* page/Settings.yaml:

Source/WebKit:

Add experimental feature for the quirk.

* Shared/WebPreferences.yaml:

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

2 months agoRemove IsITPFirstPartyWebsiteDataRemovalEnabled as runtime check
wilander@apple.com [Mon, 24 Jun 2019 21:37:26 +0000 (21:37 +0000)]
Remove IsITPFirstPartyWebsiteDataRemovalEnabled as runtime check
https://bugs.webkit.org/show_bug.cgi?id=199164
<rdar://problem/52061147>

Reviewed by Brent Fulgham.

Source/WebCore:

No new tests. Just a removal of a runtime feature check. The functionality
already has a layout test.

We've had this toggle as a safety thing since mid-March. No need for it any longer.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::isITPDatabaseEnabled const):
(WebCore::RuntimeEnabledFeatures::setIsITPFirstPartyWebsiteDataRemovalEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::isITPFirstPartyWebsiteDataRemovalEnabled const): Deleted.

Source/WebKit:

We've had this toggle as a safety thing since mid-March. No need for it any longer.

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* Shared/WebPreferences.yaml:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):

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

2 months agoiOS 12.2 Drawing portrait video to canvas is sideways
jer.noble@apple.com [Mon, 24 Jun 2019 19:57:46 +0000 (19:57 +0000)]
iOS 12.2 Drawing portrait video to canvas is sideways
https://bugs.webkit.org/show_bug.cgi?id=196772
<rdar://problem/49781802>

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-orientation-canvas.html

Move rotation code into its own ImageRotationSessionVT class for re-use across
all existing classes with rotation operations. Should slightly increase performance
for painting rotated media files, as the rotation only occurs once per frame, rather
than once per drawing operation.

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
(WebCore::ImageDecoderAVFObjC::RotationProperties::isIdentity const): Deleted.
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjC::readTrackMetadata):
(WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
(WebCore::ImageDecoderAVFObjC::setTrack):
(WebCore::transformToRotationProperties): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
* platform/graphics/cv/ImageRotationSessionVT.h: Added.
(WebCore::ImageRotationSessionVT::RotationProperties::isIdentity const):
(WebCore::ImageRotationSessionVT::rotationProperties const):
(WebCore::ImageRotationSessionVT::rotatedSize):
* platform/graphics/cv/ImageRotationSessionVT.mm: Added.
(WebCore::transformToRotationProperties):
(WebCore::ImageRotationSessionVT::ImageRotationSessionVT):
(WebCore::ImageRotationSessionVT::rotate):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
(WebCore::rotationToAngle):
(WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
(WebCore::computeRotatedWidthAndHeight): Deleted.

LayoutTests:

* media/content/no-rotation.mp4:
* media/media-source/only-bcp47-language-tags-accepted-as-valid-expected.txt:
* media/video-orientation-canvas-expected.txt: Added.
* media/video-orientation-canvas.html: Added.
* media/video-test.js:
(waitFor):

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

2 months agom_focusedElement != &element in WebPage::elementDidBlur() sometimes
dbates@webkit.org [Mon, 24 Jun 2019 19:47:31 +0000 (19:47 +0000)]
m_focusedElement != &element in WebPage::elementDidBlur() sometimes
https://bugs.webkit.org/show_bug.cgi?id=198928
<rdar://problem/51814327>

Reviewed by Brent Fulgham.

Source/WebKit:

This can happen when the focused editable element is inside a nested frame and a person
taps outside that frame. For reasons that seem lost to time, WebKit2 on iOS would mutate
the focused frame whenever computing selection positioning information (say, for a tap).
This "quirk" was added in r163476, but that code has go through multiple iterations and
is no longer comparable to the current code. Yet, the original mutation of the focused
frame remained. As a result the UI process and Web process go out of sync with respect
to what each thinks is the focused element and this visually manifest itself in at least
two ways:

    1. A non-sensical DOM focus event would be dispatched at the frame tapped, but
    we would keep the focused element focused.

    2. Because we would keep the focused element focused in (1), even though its frame
    is not focused, the keyboard would be active (software keyboard on screen or candidate bar
    on screen if a hardware keyboard is attached), but appear unresponsive: any keys pressed
    would not cause text to be typed into the editable field.

Because of (1) it was possible for m_focusedElement != &element in WebPage::elementDidBlur().
When this happens the UI process would never receive an ElementDidBlur message and hence would
not clear out the focused element state and hide the keyboard.

We neither do this frame focus mutation in Legacy WebKit on iOS nor Mac. Let's remove this quirk.
If it turns out that it causes a compatibility issue then we will be in a better position to
understand its purpose and consider bringing this quirk back, if needed.

* Shared/ios/InteractionInformationRequest.cpp:
(WebKit::InteractionInformationRequest::encode const):
(WebKit::InteractionInformationRequest::decode):
(WebKit::InteractionInformationRequest::isValidForRequest):
(WebKit::InteractionInformationRequest::isApproximatelyValidForRequest):
* Shared/ios/InteractionInformationRequest.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _requestActivatedElementAtPosition:completionBlock:]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _webTouchEventsRecognized:]):
Remove the readOnly field.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::selectionPositionInformation): Remove code to mutate the focused frame.

LayoutTests:

Update test result now that we do not mutate the focused frame on tap.

* TestExpectations: Skip problematic test editing/deleting/smart-delete-paragraph-003.html;
See <https://bugs.webkit.org/show_bug.cgi?id=198928#c16>, <https://bugs.webkit.org/show_bug.cgi?id=198928#c17>,
and <https://bugs.webkit.org/show_bug.cgi?id=199039> for more details.
* fast/events/ios/should-be-able-to-dismiss-form-accessory-after-tapping-outside-iframe-with-focused-field-expected.txt:

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

2 months ago[StyleResolver] Pass RenderStyle& instead of RenderStyle* to updateFont() related...
zalan@apple.com [Mon, 24 Jun 2019 19:37:59 +0000 (19:37 +0000)]
[StyleResolver] Pass RenderStyle& instead of RenderStyle* to updateFont() related functions.
https://bugs.webkit.org/show_bug.cgi?id=199167
<rdar://problem/52062669>

Reviewed by Antti Koivisto.

It is expected to have a valid RenderStyle object here (and existing code relies on it).

* css/StyleResolver.cpp:
(WebCore::checkForOrientationChange):
(WebCore::StyleResolver::updateFont):
(WebCore::StyleResolver::checkForTextSizeAdjust):
(WebCore::StyleResolver::checkForZoomChange):
(WebCore::StyleResolver::checkForGenericFamilyChange):
* css/StyleResolver.h:

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

2 months ago[Cocoa] Avoid creating a PlatformMediaSessionManager when the WebProcess is suspended...
pvollan@apple.com [Mon, 24 Jun 2019 19:32:03 +0000 (19:32 +0000)]
[Cocoa] Avoid creating a PlatformMediaSessionManager when the WebProcess is suspended or resumed
https://bugs.webkit.org/show_bug.cgi?id=199160

Reviewed by Brent Fulgham.

When the WebProcess suspends or resumes, the PlatformMediaSessionManager is notified about this.
Avoid creating a new PlatformMediaSessionManager if it does not already exist.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processDidResume):

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

2 months ago[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerlock...
graouts@webkit.org [Mon, 24 Jun 2019 19:02:40 +0000 (19:02 +0000)]
[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html
https://bugs.webkit.org/show_bug.cgi?id=197007

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Update the test from the Web Platform Tests repository following the fix for https://github.com/web-platform-tests/wpt/issues/16406.

* web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked-expected.txt: Added.
* web-platform-tests/pointerevents/pointerlock/pointerevent_coordinates_when_locked.html:

LayoutTests:

This test now works reliably, even if it fails the actual assertions.

* platform/mac/TestExpectations:

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

2 months ago[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointereven...
graouts@webkit.org [Mon, 24 Jun 2019 19:00:17 +0000 (19:00 +0000)]
[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html
https://bugs.webkit.org/show_bug.cgi?id=197005

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first-expected.txt: Added.
* web-platform-tests/resources/testdriver-vendor.js:
(dispatchMouseActions): We need to disable dragMode for the eventSender or else the "pointermove" events in the test will
not be dispatched as there is no mouseUp() call in the test's event sequence.

Source/WebCore:

We were calling processPendingPointerCapture() at the wrong time, calling in after dispatching a PointerEvent rather than before.
We now do this correctly in the consolidated PointerCaptureController::dispatchEvent() method, which we call for dispatching all
PointerEvents, save for gotpointercapture and lostpointercapture since these should not yield the processing of the pending pointer
capture per the spec.

This uncovered a couple of new issues. First, since we would now call processPendingPointerCapture() and dispatch a lostpointercapture
event earlier, the alternative lostpointercapture dispatch when an element is removed (which is dispatched asynchronously on the
document) would be dispatched *after* dispatching the event in processPendingPointerCapture(). We now check in processPendingPointerCapture()
whether the event target is connected to fix this. This makes sure pointerevent_lostpointercapture_for_disconnected_node.html doesn't regress.

Finally, we must also call processPendingPointerCapture() when implicitly releasing pointer capture during handling of a "pointerup" event.
This ensures that pointerevent_releasepointercapture_invalid_pointerid.html doesn't regress.

As a result of all these changes, we now pass imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html reliably.

* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
(WebCore::PointerCaptureController::dispatchEvent): We now more closely adhere to the spec when determining what the pointer capture target is by
only checking for the target override. We can now do this safely since we call processPendingPointerCapture() before and not after event dispatch.
(WebCore::PointerCaptureController::pointerEventWasDispatched):
(WebCore::PointerCaptureController::processPendingPointerCapture): Cache the pending target override to make sure that dispatching a "gotpointercapture"
or "lostpointercapture" event during this function does not alter it until the next call is made when the next event is dispatched.

LayoutTests:

* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Removed.
* platform/mac-highsierra-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Removed.
* platform/mac-highsierra/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Removed.
Since we've fixed the issue with event dispatch in WK1, we can remove these platform-specific expectations.
* platform/mac/TestExpectations: We no longer skip this test which works reliably.
* pointerevents/mouse/pointer-capture.html: We modify this test to correctly expect the "gotpointercapture" event only once the next
pointer event has been dispatched.

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

2 months agocontributors.json not canonicalized since r243297
mcatanzaro@igalia.com [Mon, 24 Jun 2019 18:59:41 +0000 (18:59 +0000)]
contributors.json not canonicalized since r243297
https://bugs.webkit.org/show_bug.cgi?id=199161

Reviewed by Alexey Proskuryakov.

Canonicalize it using 'validate-committer-lists --canonicalize'

* Scripts/webkitpy/common/config/contributors.json:

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

2 months ago[bmalloc] IsoHeap shared tier threshold is small
ysuzuki@apple.com [Mon, 24 Jun 2019 18:49:09 +0000 (18:49 +0000)]
[bmalloc] IsoHeap shared tier threshold is small
https://bugs.webkit.org/show_bug.cgi?id=199145

Reviewed by Saam Barati.

We accidentally picked 3 for the shared tier threshold. While this is OK because the important part of IsoHeap shared tier is putting
small # of shared objects before tiering up to the page-based allocation, increasing this threshold can potentially improve memory footprint.
This patch increases this threshold from 3 to 8. A/B test says that this offers stable 0.25% improvement in PLUM2.

* bmalloc/IsoHeapImpl.h:

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

2 months ago[perf.webkit.org] Update summary page calculations to use mean instead of median
dean_johnson@apple.com [Mon, 24 Jun 2019 18:20:43 +0000 (18:20 +0000)]
[perf.webkit.org] Update summary page calculations to use mean instead of median
https://bugs.webkit.org/show_bug.cgi?id=199050

Reviewed by Dewei Zhu.

* public/v3/pages/summary-page.js:
(SummaryPageConfigurationGroup): Updated 'median' references to 'mean'.
(SummaryPageConfigurationGroup.set _startAndEndPointForTimeRange): Factored out logic for finding data
points in a timeSeries, within a specified timeRange.
(SummaryPageConfigurationGroup.set _meanForTimeRange): New. Returns the mean of a timeSeries across a
given timeRange.

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

2 months agowebkitpy: Build style should be lower-case
jbedard@apple.com [Mon, 24 Jun 2019 18:18:46 +0000 (18:18 +0000)]
webkitpy: Build style should be lower-case
https://bugs.webkit.org/show_bug.cgi?id=199158

Reviewed by Aakash Jain.

* Scripts/webkitpy/test/main.py:
(Tester._run_tests): Make all styles lower-case.

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

2 months ago[ews-build] Remove iOS queue from old EWS and dashboard
aakash_jain@apple.com [Mon, 24 Jun 2019 18:06:02 +0000 (18:06 +0000)]
[ews-build] Remove iOS queue from old EWS and dashboard
https://bugs.webkit.org/show_bug.cgi?id=199150

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
* QueueStatusServer/config/queues.py:

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

2 months agoArraySlice needs to keep the source array alive.
mark.lam@apple.com [Mon, 24 Jun 2019 17:38:12 +0000 (17:38 +0000)]
ArraySlice needs to keep the source array alive.
https://bugs.webkit.org/show_bug.cgi?id=197374
<rdar://problem/50304429>

Reviewed by Michael Saboff and Filip Pizlo.

JSTests:

* stress/array-slice-must-keep-source-array-alive.js: Added.

Source/JavaScriptCore:

The implementation of the FTL ArraySlice intrinsics may GC while allocating the
result array and its butterfly.  Previously, ArraySlice already keeps the source
butterfly alive in order to copy from it to the new butterfly after the allocation.
Unfortunately, this is not enough.  We also need to keep the source array alive
so that GC will scan the values in the butterfly as well.  Note: the butterfly
does not have a visitChildren() method to do this scan.  It's the parent object's
responsibility to do the scanning.

This patch fixes this by introducing a keepAlive() utility method, and we use it
to keep the source array alive while allocating the result array and butterfly.

keepAlive() works by using a patchpoint to communicate to B3 that a value (the
source array in this case) is still in use.  It also uses a fence to keep B3 from
relocating the patchpoint, which may defeat the fix.

For the DFG's SpeculativeJIT::compileArraySlice(), we may have lucked out and the
source array cell is kept alive.  This patch makes it explicit that we should
keep its cell alive till after the result array has been allocated.

For the Baseline JIT and LLInt, we use the arrayProtoFuncSlice() runtime function
and there is no issue because the source array (in "thisObj") is in the element
copying loop that follows the allocation of the result array.  However, for
documentation purposes, this patch adds a call to HeapCell::use() to indicate that
the source array need to kept alive at least until after the allocation of the
result array.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArraySlice):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileArraySlice):
(JSC::FTL::DFG::LowerDFGToB3::allocateJSArray):
(JSC::FTL::DFG::LowerDFGToB3::keepAlive):
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncSlice):

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

2 months agoAPI Test [Mojave+ WK2 Debug ] TestWebKitAPI.WKAttachmentTestsMac.InsertDroppedFilePro...
ryanhaddad@apple.com [Mon, 24 Jun 2019 17:37:51 +0000 (17:37 +0000)]
API Test [Mojave+ WK2 Debug ] TestWebKitAPI.WKAttachmentTestsMac.InsertDroppedFilePromisesAsAttachments is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=198795

Unreviewed test gardening.

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(TestWebKitAPI::TEST): Disable flaky test.

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

2 months ago[ews-build] Enable iOS-12-Build queue on new EWS
aakash_jain@apple.com [Mon, 24 Jun 2019 15:26:49 +0000 (15:26 +0000)]
[ews-build] Enable iOS-12-Build queue on new EWS
https://bugs.webkit.org/show_bug.cgi?id=199149

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/config.json: Enable iOS-12-Build-EWS trigger. Also temporarily share ews152 and ews154 with
this queue.
* BuildSlaveSupport/ews-app/ews/views/statusbubble.py:
(StatusBubble): Enable ios status-bubble. Also display the ios bubble first (left). Going forward
will keep the builders to the left and testers to the right.

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

2 months ago[ews-build] Upload test results after running layout-tests
aakash_jain@apple.com [Mon, 24 Jun 2019 15:11:02 +0000 (15:11 +0000)]
[ews-build] Upload test results after running layout-tests
https://bugs.webkit.org/show_bug.cgi?id=199120

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(RunWebKitTests.evaluateCommand):
* BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.

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

2 months agoWeb Inspector: AXI: Audit: image label test is throwing spurious errors on elements...
commit-queue@webkit.org [Mon, 24 Jun 2019 15:03:46 +0000 (15:03 +0000)]
Web Inspector: AXI: Audit: image label test is throwing spurious errors on elements with existing alt attr, but no value: <img alt>
https://bugs.webkit.org/show_bug.cgi?id=194754

Patch by Greg Doolittle <gr3g@apple.com> on 2019-06-24
Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/img-alt-attribute-unassigned-value.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::computedRoleString const):

LayoutTests:

* accessibility/img-alt-attribute-unassigned-value-expected.txt: Added.
* accessibility/img-alt-attribute-unassigned-value.html: Added.
* inspector/dom/getAccessibilityPropertiesForNode-expected.txt:

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

2 months ago[ews-build] EWS should provide option to download layout test results zip file
aakash_jain@apple.com [Mon, 24 Jun 2019 14:58:25 +0000 (14:58 +0000)]
[ews-build] EWS should provide option to download layout test results zip file
https://bugs.webkit.org/show_bug.cgi?id=199121

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(ExtractTestResults.resultsDownloadURL): Method to return layout test result zip file url.
(ExtractTestResults.addCustomURLs): Add url to download layout test results zip file.

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

2 months ago[WPE][GTK] Fixes for compilation with unified builds disabled
aperez@igalia.com [Mon, 24 Jun 2019 14:52:53 +0000 (14:52 +0000)]
[WPE][GTK] Fixes for compilation with unified builds disabled
https://bugs.webkit.org/show_bug.cgi?id=199155

Reviewed by Michael Catanzaro.

Source/WebCore:

No new tests needed.

* rendering/LayerAncestorClippingStack.h: Add missing inclusion of RenderLayer.h

Source/WebKit:

* NetworkProcess/glib/DNSCache.cpp: Add missing inclusion of wtf/glib/RunLoopSourcePriority.h
* NetworkProcess/glib/DNSCache.h: Add missing forward declaration for GInetAddress

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

2 months agoAdd user agent quirk for Google Drive
mcatanzaro@igalia.com [Mon, 24 Jun 2019 14:35:42 +0000 (14:35 +0000)]
Add user agent quirk for Google Drive
https://bugs.webkit.org/show_bug.cgi?id=199153

Reviewed by Carlos Garcia Campos.

Source/WebCore:

This suppresses an unsupported browser warning.

* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::urlRequiresLinuxDesktopPlatform):

Tools:

* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

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

2 months ago[GTK] Navigation gesture should use dark fallback bg color on dark themes
commit-queue@webkit.org [Mon, 24 Jun 2019 14:34:47 +0000 (14:34 +0000)]
[GTK] Navigation gesture should use dark fallback bg color on dark themes
https://bugs.webkit.org/show_bug.cgi?id=199104

Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-06-24
Reviewed by Michael Catanzaro.

Use theme_base_color instead of white background for swipe gesture fallback if no snapshot is found and
the page did not specify a color. This allows it to use dark colors for dark themes. If the color was
not found, still fall back to white.

* UIProcess/gtk/ViewGestureControllerGtk.cpp:
(WebKit::ViewGestureController::beginSwipeGesture):

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

2 months ago[GStreamer][MSE] Pausing video sometimes causes skip to finish
cturner@igalia.com [Mon, 24 Jun 2019 11:33:30 +0000 (11:33 +0000)]
[GStreamer][MSE] Pausing video sometimes causes skip to finish
https://bugs.webkit.org/show_bug.cgi?id=197355

Reviewed by Philippe Normand.

Covered by existing tests.

* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime const):
Assuming that when m_eosPending is on and we're paused() that the
network resource is fully loaded and the end is reached is clearly
wrong. Whether this is now correct is unclear...

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

2 months ago[GStreamer] Volume level sometimes changes inappropriately
cturner@igalia.com [Mon, 24 Jun 2019 11:27:05 +0000 (11:27 +0000)]
[GStreamer] Volume level sometimes changes inappropriately
https://bugs.webkit.org/show_bug.cgi?id=197358

Reviewed by Xabier Rodriguez-Calvar.

Be consistent with our application of volume scaling. We were
setting volumes using cubic interpolation in setVolume() and using
the inverse in volume(); however setting initial volumes was done
linearly in setStreamVolumeElement, which was causing strange
jumps in the volume level at non-deterministic times. The fix
looks to be that we should use linear interpolation consistently,
since PulseAudio already applies cubic scaling to software
volumes.

Covered by existing tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::paused const): Bump the
logging here to LOG level, it's very spammy at DEBUG.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::setVolume): Switch to
linear interpolation.
(WebCore::MediaPlayerPrivateGStreamerBase::volume const): Ditto.
(WebCore::MediaPlayerPrivateGStreamerBase::notifyPlayerOfVolumeChange):
Ditto.
(WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
Ditto, and be consistent here with the API, do not set the raw
volume managed by MediaElement.

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

2 months ago[Pointer Events] Respect pointer capture when dispatching mouse boundary events and...
graouts@webkit.org [Mon, 24 Jun 2019 10:45:34 +0000 (10:45 +0000)]
[Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
https://bugs.webkit.org/show_bug.cgi?id=198999
<rdar://problem/51979477>

Unreviewed.

Rolling back all changes made for this bug (r246728 + r246716 + r246674) as it regressed one test
(imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame.html).

LayoutTests/imported/w3c:

* web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt:
* web-platform-tests/pointerevents/pointerevent_click_during_capture-expected.txt:
* web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt:
* web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget-expected.txt:

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::prepareMouseEvent):
(WebCore::Document::updateHoverActiveState):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::setCapturingMouseEventsElement):
* page/EventHandler.h:
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::releasePointerCapture):
(WebCore::PointerCaptureController::hasPointerCapture):
(WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
(WebCore::PointerCaptureController::dispatchEvent):
(WebCore::PointerCaptureController::processPendingPointerCapture):
(WebCore::PointerCaptureController::pointerCaptureElement): Deleted.
* page/PointerCaptureController.h:
* rendering/HitTestRequest.h:
(WebCore::HitTestRequest::includesAllElementsUnderPoint const):
(WebCore::HitTestRequest::pointerCaptureElementChanged const): Deleted.

LayoutTests:

* platform/mac-highsierra-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Added.
* platform/mac-highsierra/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_click_during_capture-expected.txt: Removed.
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget-expected.txt:

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

2 months ago[Pointer Events] Respect pointer capture when dispatching mouse boundary events and...
graouts@webkit.org [Mon, 24 Jun 2019 10:00:59 +0000 (10:00 +0000)]
[Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
https://bugs.webkit.org/show_bug.cgi?id=198999
<rdar://problem/52005663>

Reviewed by Dean Jackson.

We should only set the mouse events capturing element in EventHandler if we're dealing with mouse-originated Pointer Events (part 2).

* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::releasePointerCapture):

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

2 months ago[WinCairo] Unreviewed test gardening
Hironori.Fujii@sony.com [Mon, 24 Jun 2019 06:20:45 +0000 (06:20 +0000)]
[WinCairo] Unreviewed test gardening

* platform/wincairo/TestExpectations:

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

2 months agoPlatform font class gets needlessly initialized in the Networking process
mitz@apple.com [Mon, 24 Jun 2019 03:44:50 +0000 (03:44 +0000)]
Platform font class gets needlessly initialized in the Networking process
https://bugs.webkit.org/show_bug.cgi?id=199140

Reviewed by Tim Horton.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Revert a change that was made in
  r246702, which is not needed anymore.
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Ditto.

* Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::platformColorClass): Added getter that uses NSClassFromString, thereby avoiding
  initializing the class.
(IPC::platformFontClass): Ditto.
(IPC::typeFromObject): Changed to use the above getters instead of +class.

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

2 months ago[Async overflow scroll] Clipped composited layers inside overflow scroll jitter and...
simon.fraser@apple.com [Mon, 24 Jun 2019 03:09:40 +0000 (03:09 +0000)]
[Async overflow scroll] Clipped composited layers inside overflow scroll jitter and get incorrectly clipped
https://bugs.webkit.org/show_bug.cgi?id=199133
rdar://problem/43614439

Reviewed by Antti Koivisto.
Source/WebCore:

Currently a composited layer with an overflow:scroll ancestor (which is not a paint-order
ancestor) gets a single "ancestor clip layer" that represents the intersection of all the
clips provided by its containing-block ancestors with non-visible overflow (both scrolling
and non-scrolling ones).

To correctly update clips with async overflow scroll, this single clip layer needs to be
broken up into multiple clipping ancestors. We need a separate layer, and scrolling tree
node for each ancestor that is an overflow scroll, and layers that represent non-moving
clips (i.e. overflow:hidden and 'clip') between them. This patch adds
LayerAncestorClippingStack to represent this stack of clipping layers. For example with the
following content:

<div style="overflow:hidden"> <--- A
    <div style="overflow:scroll"> <--- B
        <div style="overflow:hidden"> <--- C
            <div style="overflow:hidden"> <--- D
                <div style="overflow:scroll">  <--- E
                    <div style="overflow:hidden"> <--- F
                        <div style="overflow:hidden"> <--- G
                            <div></div> <--- H
                        <div>
                    <div>
                <div>
            <div>
        <div>
    <div>
<div>

the composited RenderLayer for H owns a LayerAncestorClippingStack with the following contents:
    [clip - A]
    [scroller - B]
    [clip - intersection of C and D]
    [scroller - E]
    [clip - intersection of F and G]

Each stack entry has a 'masksToBounds' GraphicsLayer for clipping. Entries representing
overflow:scroll clips have a ScrollingNodeID for their OverflowScrollProxy scrolling tree
node (which references the actual OverflowScrollingNode). The non-scroller clips in this
stack are computed unconstrained by the enclosing overflow:scroll.

When the OverflowScrollingNode is scrolled, the boundsOrigin of related OverflowScrollProxy nodes
is adjusted to move the descendant layers (other clipping layers, or composited layers).

OverflowScrollProxy nodes thus take over the role that "Moves" ScrollingTreePositionedNode had.
With this patch, ScrollingTreePositionedNode are purely for absolute position inside non-containing-block
stacking context overflow scroll. LayoutConstraints is renamed to AbsolutePositionConstraints accordingly.

Tests: compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll.html
       compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested.html
       compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow.html
       compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden.html
       compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible.html
       compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer.html
       compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped.html
       compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer.html
       compositing/scrolling/async-overflow-scrolling/layer-in-overflow.html
       scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested.html
       scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setPositionedNodeConstraints):
(WebCore::AsyncScrollingCoordinator::setPositionedNodeGeometry): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingConstraints.cpp:
(WebCore::operator<<):
* page/scrolling/ScrollingConstraints.h:
(WebCore::AbsolutePositionConstraints::operator== const):
(WebCore::AbsolutePositionConstraints::operator!= const):
(WebCore::LayoutConstraints::operator== const): Deleted.
(WebCore::LayoutConstraints::operator!= const): Deleted.
(WebCore::LayoutConstraints::alignmentOffset const): Deleted.
(WebCore::LayoutConstraints::setAlignmentOffset): Deleted.
(WebCore::LayoutConstraints::layerPositionAtLastLayout const): Deleted.
(WebCore::LayoutConstraints::setLayerPositionAtLastLayout): Deleted.
(WebCore::LayoutConstraints::scrollPositioningBehavior const): Deleted.
(WebCore::LayoutConstraints::setScrollPositioningBehavior): Deleted.
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setPositionedNodeConstraints):
(WebCore::ScrollingCoordinator::setPositionedNodeGeometry): Deleted.
* page/scrolling/ScrollingStatePositionedNode.cpp:
(WebCore::ScrollingStatePositionedNode::updateConstraints):
* page/scrolling/ScrollingStatePositionedNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::nodesWithRelatedOverflow):
(WebCore::ScrollingTree::positionedNodesWithRelatedOverflow): Deleted.
* page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::applyLayerPositions):
* page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
(WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
* page/scrolling/cocoa/ScrollingTreePositionedNode.h:
(WebCore::ScrollingTreePositionedNode::scrollPositioningBehavior const): Deleted.
* page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
(WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
(WebCore::ScrollingTreePositionedNode::scrollDeltaSinceLastCommit const):
* page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::computeLayerPosition const):
* rendering/LayerAncestorClippingStack.cpp: Added.
(WebCore::LayerAncestorClippingStack::LayerAncestorClippingStack):
(WebCore::LayerAncestorClippingStack::equalToClipData const):
(WebCore::LayerAncestorClippingStack::hasAnyScrollingLayers const):
(WebCore::LayerAncestorClippingStack::clear):
(WebCore::LayerAncestorClippingStack::detachFromScrollingCoordinator):
(WebCore::LayerAncestorClippingStack::firstClippingLayer const):
(WebCore::LayerAncestorClippingStack::lastClippingLayer const):
(WebCore::LayerAncestorClippingStack::lastOverflowScrollProxyNodeID const):
(WebCore::LayerAncestorClippingStack::updateScrollingNodeLayers):
(WebCore::LayerAncestorClippingStack::updateWithClipData):
(WebCore::operator<<):
* rendering/LayerAncestorClippingStack.h: Added.
(WebCore::CompositedClipData::CompositedClipData):
(WebCore::CompositedClipData::operator== const):
(WebCore::CompositedClipData::operator!= const):
(WebCore::LayerAncestorClippingStack::stack):
(WebCore::LayerAncestorClippingStack::stack const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::~RenderLayerBacking):
(WebCore::RenderLayerBacking::updateDebugIndicators):
(WebCore::RenderLayerBacking::destroyGraphicsLayers):
(WebCore::RenderLayerBacking::updateTransform):
(WebCore::RenderLayerBacking::updateBlendMode):
(WebCore::RenderLayerBacking::updateAfterLayout):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::computeOffsetFromAncestorGraphicsLayer):
(WebCore::RenderLayerBacking::computePrimaryGraphicsLayerRect const):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateInternalHierarchy):
(WebCore::RenderLayerBacking::updateAncestorClippingStack):
(WebCore::RenderLayerBacking::updateAncestorClipping):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
(WebCore::RenderLayerBacking::scrollingNodeIDForChildren const):
(WebCore::RenderLayerBacking::childForSuperlayers const):
(WebCore::RenderLayerBacking::backingStoreMemoryEstimate const):
(WebCore::operator<<):
(WebCore::RenderLayerBacking::updateAncestorClippingLayer): Deleted.
(WebCore::RenderLayerBacking::coordinatedScrollingRoles const): Deleted.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::layerStyleChanged): We need to run the checks for changed
clipping whether or not this layer has backing, because a non-composited layer with clipping can be
represented in the clipping stack of some other layer.
(WebCore::RenderLayerCompositor::clippedByAncestor const):
(WebCore::RenderLayerCompositor::updateAncestorClippingStack const):
(WebCore::RenderLayerCompositor::computeAncestorClippingStack const): The output of this function
is a Vector<CompositedClipData> which represents the ancestor clipping stack, but without the proxy node
and GraphicsLayer information. It's input to LayerAncestorClippingStack::updateWithClipData() which does
the merging of old and new states.
(WebCore::collectRelatedCoordinatedScrollingNodes):
(WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
(WebCore::scrollCoordinationRoleForNodeType):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::registerScrollingNodeID):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::coordinatedScrollingRolesForLayer const): Code moved from RenderLayerBacking.
(WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingProxyRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
* rendering/RenderLayerCompositor.h:
(WebCore::allScrollCoordinationRoles):

Source/WebKit:

LayoutConstraints -> AbsolutePositionConstraints rename.

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStatePositionedNode>::decode):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<AbsolutePositionConstraints>::encode):
(IPC::ArgumentCoder<AbsolutePositionConstraints>::decode):
(IPC::ArgumentCoder<LayoutConstraints>::encode): Deleted.
(IPC::ArgumentCoder<LayoutConstraints>::decode): Deleted.
* Shared/WebCoreArgumentCoders.h:
* Shared/WebRenderLayer.cpp:
(WebKit::WebRenderLayer::WebRenderLayer):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations): ScrollingTreeOverflowScrollProxyNode
have overflow scroll relations now too.

LayoutTests:

New baselines for:
- clipping layers no longer have offsetFromRenderer(), which they didn't need.
- positioned nodes don't print scrollBehavior (they are always "Stationary")
- "Moves" positioned nodes are replaced with overflow scroll proxy nodes

* compositing/backing/backing-store-attachment-empty-keyframe-expected.txt:
* compositing/geometry/clip-expected.txt:
* compositing/geometry/clip-inside-expected.txt:
* compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt:
* compositing/layer-creation/clipping-scope/nested-scroller-overlap-expected.txt:
* compositing/layer-creation/clipping-scope/nested-scroller-overlap.html:
* compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller-expected.txt:
* compositing/layer-creation/clipping-scope/scroller-with-negative-z-children-expected.txt:
* compositing/overflow/clip-descendents-expected.txt:
* compositing/overflow/scrolling-content-clip-to-viewport-expected.txt:
* compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt:
* compositing/rtl/rtl-scrolling-with-transformed-descendants.html:
* compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll-expected.txt: Added.
* compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll.html: Added.
* compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-expected.txt: Added.
* compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested-expected.txt: Added.
* compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested.html: Added.
* compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow.html: Added.
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden-expected.txt: Added.
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden.html: Added.
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible-expected.txt: Added.
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible.html: Added.
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-expected.txt: Added.
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer-expected.txt: Added.
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer.html: Added.
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped-expected.txt: Added.
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped.html: Added.
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer-expected.txt: Added.
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer.html: Added.
* compositing/scrolling/async-overflow-scrolling/layer-in-overflow.html: Added.
* compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt:
* compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt:
* compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness.html:
* platform/ios-wk2/compositing/layer-creation/clipping-scope/nested-scroller-overlap-expected.txt:
* platform/ios-wk2/compositing/layer-creation/clipping-scope/overlap-constrained-inside-scroller-expected.txt:
* platform/ios-wk2/compositing/layer-creation/clipping-scope/scroller-with-negative-z-children-expected.txt:
* platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-clipped-by-scroll-expected.txt: Added.
* platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-expected.txt: Added.
* platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested-expected.txt: Added.
* platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-hidden-expected.txt: Added.
* platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-clip-to-visible-expected.txt: Added.
* platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-expected.txt: Added.
* platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-gain-clipping-layer-expected.txt: Added.
* platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-in-clipped-expected.txt: Added.
* platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-in-overflow-lose-clipping-layer-expected.txt: Added.
* platform/ios-wk2/compositing/shared-backing/overflow-scroll/composited-absolute-in-absolute-in-relative-in-scroller-expected.txt:
* platform/ios-wk2/compositing/shared-backing/overflow-scroll/previous-sibling-prevents-inclusiveness-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-in-nested-sc-scrollers-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-expected.txt: Copied from LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt.
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested-expected.txt: Copied from LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt.
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt:
* platform/ios/compositing/geometry/limit-layer-bounds-clipping-ancestor-expected.txt:
* platform/ios/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt:
* scrollingcoordinator/scrolling-tree/absolute-in-nested-sc-scrollers-expected.txt:
* scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt:
* scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-expected.txt: Copied from LayoutTests/scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt.
* scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested-expected.txt: Copied from LayoutTests/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt.
* scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested.html: Added.
* scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow.html: Added.
* scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt:
* scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt:
* scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt:
* scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
* scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt:
* scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt:
* scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt:
* scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt:

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

2 months agoWeb Inspector: REGRESSION (r246684): Dark Mode: dashboard buttons should have no...
mattbaker@apple.com [Sun, 23 Jun 2019 22:36:27 +0000 (22:36 +0000)]
Web Inspector: REGRESSION (r246684): Dark Mode: dashboard buttons should have no background
https://bugs.webkit.org/show_bug.cgi?id=199136
<rdar://problem/52035798>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DefaultDashboardView.css:
(@media (prefers-color-scheme: dark)):
(.toolbar .dashboard .item.button,):

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

2 months agoAdd OverflowScrollProxyNodes to the scrolling tree
simon.fraser@apple.com [Sun, 23 Jun 2019 19:34:44 +0000 (19:34 +0000)]
Add OverflowScrollProxyNodes to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=199132

Reviewed by Antti Koivisto.
Source/WebCore:

Add ScrollingStateOverflowScrollProxyNode and ScrollingTreeOverflowScrollProxyNode. These
nodes represent clip and scroll position for an overflow:scroll in the containing block chain,
but not the paint ancestor chain of a layer. They will be used to correctly manipulate clip
rects for composited layers in non-stacking-context scrollers, and in a future patch will
replace the functionality of "Moves" positioned nodes.

An OverflowScrollProxyNode has the ScrollingNodeID of the scrolling node that it relates to,
and we use the existing "related overflow nodes" to create the back references in the scrolling tree.

These nodes are not instantiated yet; a future patch will hook them up.

* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::operator<<):
* page/scrolling/ScrollingCoordinatorTypes.h:
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::isOverflowScrollProxyNode const):
* page/scrolling/ScrollingStateOverflowScrollProxyNode.cpp: Added.
(WebCore::ScrollingStateOverflowScrollProxyNode::create):
(WebCore::ScrollingStateOverflowScrollProxyNode::ScrollingStateOverflowScrollProxyNode):
(WebCore::ScrollingStateOverflowScrollProxyNode::clone):
(WebCore::ScrollingStateOverflowScrollProxyNode::setOverflowScrollingNode):
(WebCore::ScrollingStateOverflowScrollProxyNode::dumpProperties const):
* page/scrolling/ScrollingStateOverflowScrollProxyNode.h: Copied from Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp.
(WebCore::ScrollingStateOverflowScrollProxyNode::overflowScrollingNode const):
* page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::createNode):
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::isOverflowScrollProxyNode const):
* page/scrolling/ScrollingTreeOverflowScrollProxyNode.cpp: Added.
(WebCore::ScrollingTreeOverflowScrollProxyNode::create):
(WebCore::ScrollingTreeOverflowScrollProxyNode::ScrollingTreeOverflowScrollProxyNode):
(WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions):
(WebCore::ScrollingTreeOverflowScrollProxyNode::dumpProperties const):
* page/scrolling/ScrollingTreeOverflowScrollProxyNode.h: Copied from Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp.
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.h: Copied from Source/WebCore/page/scrolling/ScrollingStateOverflowScrollingNode.cpp.
(WebCore::ScrollingTreeOverflowScrollProxyNode::overflowScrollingNodeID const):
(WebCore::ScrollingTreeOverflowScrollProxyNode::layer const):
* page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm: Added.
(WebCore::ScrollingTreeOverflowScrollProxyNode::create):
(WebCore::ScrollingTreeOverflowScrollProxyNode::ScrollingTreeOverflowScrollProxyNode):
(WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeOverflowScrollProxyNode::scrollDeltaSinceLastCommit const):
(WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions):
(WebCore::ScrollingTreeOverflowScrollProxyNode::dumpProperties const):
* page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
* page/scrolling/mac/ScrollingTreeMac.cpp:
(ScrollingTreeMac::createScrollingTreeNode):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::scrollCoordinationRoleForNodeType):

Source/WebKit:

Add ScrollingStateOverflowScrollProxyNode and ScrollingTreeOverflowScrollProxyNode. These
nodes represent clip and scroll position for an overflow:scroll in the containing block chain,
but not the paint ancestor chain of a layer. They will be used to correctly manipulate clip
rects for composited layers in non-stacking-context scrollers, and in a future patch will
replace the functionality of "Moves" positioned nodes.

An OverflowScrollProxyNode has the ScrollingNodeID of the scrolling node that it relates to,
and we use the existing "related overflow nodes" to create the back references in the scrolling tree.

These nodes are not instantiated yet; a future patch will hook them up.

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateOverflowScrollProxyNode>::encode):
(ArgumentCoder<ScrollingStateOverflowScrollProxyNode>::decode):
(WebKit::encodeNodeAndDescendants):
(WebKit::RemoteScrollingCoordinatorTransaction::decode):
(WebKit::dump):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):

Source/WTF:

Setting indent is useful if you want to make a new stream with the indent of an
existing stream.

* wtf/text/TextStream.h:
(WTF::TextStream::setIndent):

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

2 months agoWeb Inspector: Styles: show green highlight for newly added properties only when...
nvasilyev@apple.com [Sun, 23 Jun 2019 18:32:51 +0000 (18:32 +0000)]
Web Inspector: Styles: show green highlight for newly added properties only when name and value are present
https://bugs.webkit.org/show_bug.cgi?id=199131

Reviewed by Matt Baker.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.updateStatus):

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

2 months ago[Pointer Events WPT] Unflake imported/w3c/web-platform-tests/pointerevents/pointereve...
graouts@webkit.org [Sun, 23 Jun 2019 16:56:07 +0000 (16:56 +0000)]
[Pointer Events WPT] Unflake imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame.html
https://bugs.webkit.org/show_bug.cgi?id=197058

Unreviewed test gardening.

LayoutTests/imported/w3c:

* web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame-expected.txt:

LayoutTests:

* platform/mac/TestExpectations:

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

2 months ago[Pointer Events WPT] Unflake imported/w3c/web-platform-tests/pointerevents/pointereve...
commit-queue@webkit.org [Sun, 23 Jun 2019 15:44:51 +0000 (15:44 +0000)]
[Pointer Events WPT] Unflake imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_invalid_pointerid.html
https://bugs.webkit.org/show_bug.cgi?id=197009

Unreviewed test gardening.

This test some being flaky as of r245809, the fix for wkb.ug/198191.

Patch by Antoine Quint <graouts@apple.com> on 2019-06-23

* platform/mac/TestExpectations:

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

2 months ago[LFC][IFC] Non-baseline aligned inline container should not mutate the baseline
zalan@apple.com [Sun, 23 Jun 2019 15:14:43 +0000 (15:14 +0000)]
[LFC][IFC] Non-baseline aligned inline container should not mutate the baseline
https://bugs.webkit.org/show_bug.cgi?id=199129
<rdar://problem/52022533>

Reviewed by Antti Koivisto.

Only baseline aligned inline container (<span style="vertical-aligned: baseline">) should adjust line's baseline.
This patch also fixes m_baselineTop's value when we apply the initial strut.

* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::isInlineContainerConsideredEmpty):
(WebCore::Layout::Line::isVisuallyEmpty const):
(WebCore::Layout::Line::adjustBaselineAndLineHeight):

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

2 months ago[LFC] Expand tests coverage (328 new tests -> 2652).
zalan@apple.com [Sun, 23 Jun 2019 05:05:10 +0000 (05:05 +0000)]
[LFC] Expand tests coverage (328 new tests -> 2652).

* LayoutReloaded/misc/LFC-passing-tests.txt:

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

2 months ago[LFC][IFC] The anonymous InlineBox wrapper for the text node should take the parent...
zalan@apple.com [Sat, 22 Jun 2019 21:09:51 +0000 (21:09 +0000)]
[LFC][IFC] The anonymous InlineBox wrapper for the text node should take the parent style.
https://bugs.webkit.org/show_bug.cgi?id=199127
<rdar://problem/52017744>

Reviewed by Antti Koivisto.

<span style="vertical-align: bottom">bottom aligned text</span>
The InlineBox wrapper for the "bottom aligned text" content should take the parent span's style.

* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):

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

2 months ago[Pointer Events] Respect pointer capture when dispatching mouse boundary events and...
graouts@webkit.org [Sat, 22 Jun 2019 20:09:50 +0000 (20:09 +0000)]
[Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
https://bugs.webkit.org/show_bug.cgi?id=198999
<rdar://problem/52005663>

Reviewed by Dean Jackson.

We should only set the mouse events capturing element in EventHandler if we're dealing with mouse-originated Pointer Events.

* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::processPendingPointerCapture):

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

2 months agoAccessibility objects contained in links should honor the aria-haspopup attribute...
commit-queue@webkit.org [Sat, 22 Jun 2019 18:59:18 +0000 (18:59 +0000)]
Accessibility objects contained in links should honor the aria-haspopup attribute in the ancestor link.
https://bugs.webkit.org/show_bug.cgi?id=199107
<rdar://problem/43663611>

Patch by Andres Gonzalez <andresg_22@apple.com> on 2019-06-22
Reviewed by Chris Fleizach.

Source/WebCore:

Tests: accessibility/ios-simulator/button-with-aria-haspopup-role.html
       accessibility/ios-simulator/element-haspopup.html

If an accessibility object is contained within an <a>, we should check
the aria-haspopup attribute on the ancestor <a> element. This was done
before in the iOS WebKit accessibility bunddle override.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::hasPopup const):

Tools:

iOS implementation for AccessibilityUIElement::hasPopup.
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::hasPopup const):

LayoutTests:

* accessibility/element-haspopup-expected.txt:
* accessibility/element-haspopup.html: Added cases for a <p> element contained within <a>.
* accessibility/ios-simulator/button-with-aria-haspopup-role-expected.txt: Added.
* accessibility/ios-simulator/button-with-aria-haspopup-role.html: Added. Existed for MacOS and now also for iOS.
* accessibility/ios-simulator/element-haspopup-expected.txt: Copied from LayoutTests/accessibility/element-haspopup-expected.txt.
* accessibility/ios-simulator/element-haspopup.html: Added.

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

2 months agoAll prototypes should call didBecomePrototype()
ysuzuki@apple.com [Sat, 22 Jun 2019 18:46:21 +0000 (18:46 +0000)]
All prototypes should call didBecomePrototype()
https://bugs.webkit.org/show_bug.cgi?id=196315

Reviewed by Saam Barati.

JSTests:

* stress/function-prototype-indexed-accessor.js: Added.

Source/JavaScriptCore:

Otherwise we won't remember to run haveABadTime() when someone adds to them an indexed accessor.

I added a check used in both Structure::finishCreation() and Structure::changePrototypeTransition to make sure we don't
create structures with invalid prototypes.
It found a lot of objects that are used as prototypes in JSGlobalObject and yet were missing didBecomePrototype() in their finishCreation().
Somewhat surprisingly, some of them have names like FunctionConstructor and not only FooPrototype.

* runtime/BigIntPrototype.cpp:
(JSC::BigIntPrototype::finishCreation):
* runtime/BooleanPrototype.cpp:
(JSC::BooleanPrototype::finishCreation):
* runtime/DatePrototype.cpp:
(JSC::DatePrototype::finishCreation):
* runtime/ErrorConstructor.cpp:
(JSC::ErrorConstructor::finishCreation):
* runtime/ErrorPrototype.cpp:
(JSC::ErrorPrototype::finishCreation):
* runtime/FunctionConstructor.cpp:
(JSC::FunctionConstructor::finishCreation):
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::finishCreation):
* runtime/IntlCollatorPrototype.cpp:
(JSC::IntlCollatorPrototype::finishCreation):
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatPrototype::finishCreation):
* runtime/IntlNumberFormatPrototype.cpp:
(JSC::IntlNumberFormatPrototype::finishCreation):
* runtime/IntlPluralRulesPrototype.cpp:
(JSC::IntlPluralRulesPrototype::finishCreation):
* runtime/JSArrayBufferPrototype.cpp:
(JSC::JSArrayBufferPrototype::finishCreation):
* runtime/JSDataViewPrototype.cpp:
(JSC::JSDataViewPrototype::finishCreation):
* runtime/JSGenericTypedArrayViewPrototypeInlines.h:
(JSC::JSGenericTypedArrayViewPrototype<ViewClass>::finishCreation):
* runtime/JSGlobalObject.cpp:
(JSC::createConsoleProperty):
* runtime/JSPromisePrototype.cpp:
(JSC::JSPromisePrototype::finishCreation):
* runtime/JSTypedArrayViewConstructor.cpp:
(JSC::JSTypedArrayViewConstructor::finishCreation):
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::JSTypedArrayViewPrototype::finishCreation):
* runtime/NumberPrototype.cpp:
(JSC::NumberPrototype::finishCreation):
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::finishCreation):
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):
* runtime/Structure.cpp:
(JSC::Structure::isValidPrototype):
(JSC::Structure::changePrototypeTransition):
* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::setPrototypeWithoutTransition):
* runtime/SymbolPrototype.cpp:
(JSC::SymbolPrototype::finishCreation):
* wasm/js/WebAssemblyCompileErrorPrototype.cpp:
(JSC::WebAssemblyCompileErrorPrototype::finishCreation):
* wasm/js/WebAssemblyInstancePrototype.cpp:
(JSC::WebAssemblyInstancePrototype::finishCreation):
* wasm/js/WebAssemblyLinkErrorPrototype.cpp:
(JSC::WebAssemblyLinkErrorPrototype::finishCreation):
* wasm/js/WebAssemblyMemoryPrototype.cpp:
(JSC::WebAssemblyMemoryPrototype::finishCreation):
* wasm/js/WebAssemblyModulePrototype.cpp:
(JSC::WebAssemblyModulePrototype::finishCreation):
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::WebAssemblyPrototype::finishCreation):
* wasm/js/WebAssemblyRuntimeErrorPrototype.cpp:
(JSC::WebAssemblyRuntimeErrorPrototype::finishCreation):
* wasm/js/WebAssemblyTablePrototype.cpp:
(JSC::WebAssemblyTablePrototype::finishCreation):

Source/WebCore:

* bindings/js/JSDOMIterator.h:
(WebCore::IteratorTraits>::finishCreation):
* bindings/js/JSDOMWindowProperties.h:
(WebCore::JSDOMWindowProperties::create): Deleted.
(WebCore::JSDOMWindowProperties::createStructure): Deleted.
(WebCore::JSDOMWindowProperties::JSDOMWindowProperties): Deleted.
* bindings/js/JSWindowProxy.cpp:
(WebCore::JSWindowProxy::setWindow):
* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePrototypeDeclaration):
(GenerateConstructorHelperMethods):
* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype):
* bindings/scripts/test/JS/JSMapLike.cpp:
(WebCore::JSMapLikePrototype::JSMapLikePrototype):
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
(WebCore::JSReadOnlyMapLikePrototype::JSReadOnlyMapLikePrototype):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::JSTestActiveDOMObjectPrototype::JSTestActiveDOMObjectPrototype):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::JSTestCEReactionsPrototype::JSTestCEReactionsPrototype):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::JSTestCEReactionsStringifierPrototype::JSTestCEReactionsStringifierPrototype):
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::JSTestCallTracerPrototype::JSTestCallTracerPrototype):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::JSTestClassWithJSBuiltinConstructorPrototype::JSTestClassWithJSBuiltinConstructorPrototype):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
(WebCore::JSTestDOMJITPrototype::JSTestDOMJITPrototype):
(WebCore::JSTestDOMJITConstructor::prototypeForStructure):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::JSTestEnabledBySettingPrototype::JSTestEnabledBySettingPrototype):
* bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
(WebCore::JSTestEnabledForContextPrototype::JSTestEnabledForContextPrototype):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorPrototype::JSTestEventConstructorPrototype):
(WebCore::JSTestEventConstructorConstructor::prototypeForStructure):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTargetPrototype::JSTestEventTargetPrototype):
(WebCore::JSTestEventTargetConstructor::prototypeForStructure):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestExceptionPrototype::JSTestExceptionPrototype):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachablePrototype::JSTestGenerateIsReachablePrototype):
* bindings/scripts/test/JS/JSTestGlobalObject.h:
(WebCore::JSTestGlobalObjectPrototype::JSTestGlobalObjectPrototype):
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
(WebCore::JSTestIndexedSetterNoIdentifierPrototype::JSTestIndexedSetterNoIdentifierPrototype):
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
(WebCore::JSTestIndexedSetterThrowingExceptionPrototype::JSTestIndexedSetterThrowingExceptionPrototype):
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
(WebCore::JSTestIndexedSetterWithIdentifierPrototype::JSTestIndexedSetterWithIdentifierPrototype):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype):
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
(WebCore::JSTestInterfaceLeadingUnderscorePrototype::JSTestInterfaceLeadingUnderscorePrototype):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::JSTestIterablePrototype::JSTestIterablePrototype):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructorPrototype::JSTestJSBuiltinConstructorPrototype):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::JSTestNamedAndIndexedSetterNoIdentifierPrototype):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::JSTestNamedAndIndexedSetterThrowingExceptionPrototype):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::JSTestNamedAndIndexedSetterWithIdentifierPrototype):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorPrototype::JSTestNamedConstructorPrototype):
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
(WebCore::JSTestNamedDeleterNoIdentifierPrototype::JSTestNamedDeleterNoIdentifierPrototype):
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
(WebCore::JSTestNamedDeleterThrowingExceptionPrototype::JSTestNamedDeleterThrowingExceptionPrototype):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
(WebCore::JSTestNamedDeleterWithIdentifierPrototype::JSTestNamedDeleterWithIdentifierPrototype):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
(WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::JSTestNamedDeleterWithIndexedGetterPrototype):
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
(WebCore::JSTestNamedGetterCallWithPrototype::JSTestNamedGetterCallWithPrototype):
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
(WebCore::JSTestNamedGetterNoIdentifierPrototype::JSTestNamedGetterNoIdentifierPrototype):
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
(WebCore::JSTestNamedGetterWithIdentifierPrototype::JSTestNamedGetterWithIdentifierPrototype):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::JSTestNamedSetterNoIdentifierPrototype::JSTestNamedSetterNoIdentifierPrototype):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::JSTestNamedSetterThrowingExceptionPrototype::JSTestNamedSetterThrowingExceptionPrototype):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::JSTestNamedSetterWithIdentifierPrototype::JSTestNamedSetterWithIdentifierPrototype):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::JSTestNamedSetterWithIndexedGetterPrototype::JSTestNamedSetterWithIndexedGetterPrototype):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::JSTestNamedSetterWithIndexedGetterAndSetterPrototype):
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
(WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::JSTestNamedSetterWithOverrideBuiltinsPrototype):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
(WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::JSTestNamedSetterWithUnforgablePropertiesPrototype):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
(WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodePrototype::JSTestNodePrototype):
(WebCore::JSTestNodeConstructor::prototypeForStructure):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::JSTestObjPrototype):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructorsPrototype::JSTestOverloadedConstructorsPrototype):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::JSTestOverloadedConstructorsWithSequencePrototype::JSTestOverloadedConstructorsWithSequencePrototype):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::JSTestOverrideBuiltinsPrototype::JSTestOverrideBuiltinsPrototype):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::JSTestPluginInterfacePrototype::JSTestPluginInterfacePrototype):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::JSTestPromiseRejectionEventPrototype::JSTestPromiseRejectionEventPrototype):
(WebCore::JSTestPromiseRejectionEventConstructor::prototypeForStructure):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::JSTestSerializationPrototype::JSTestSerializationPrototype):
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
(WebCore::JSTestSerializationIndirectInheritancePrototype::JSTestSerializationIndirectInheritancePrototype):
(WebCore::JSTestSerializationIndirectInheritanceConstructor::prototypeForStructure):
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
(WebCore::JSTestSerializationInheritPrototype::JSTestSerializationInheritPrototype):
(WebCore::JSTestSerializationInheritConstructor::prototypeForStructure):
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
(WebCore::JSTestSerializationInheritFinalPrototype::JSTestSerializationInheritFinalPrototype):
(WebCore::JSTestSerializationInheritFinalConstructor::prototypeForStructure):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype):
* bindings/scripts/test/JS/JSTestStringifier.cpp:
(WebCore::JSTestStringifierPrototype::JSTestStringifierPrototype):
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
(WebCore::JSTestStringifierAnonymousOperationPrototype::JSTestStringifierAnonymousOperationPrototype):
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
(WebCore::JSTestStringifierNamedOperationPrototype::JSTestStringifierNamedOperationPrototype):
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
(WebCore::JSTestStringifierOperationImplementedAsPrototype::JSTestStringifierOperationImplementedAsPrototype):
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
(WebCore::JSTestStringifierOperationNamedToStringPrototype::JSTestStringifierOperationNamedToStringPrototype):
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
(WebCore::JSTestStringifierReadOnlyAttributePrototype::JSTestStringifierReadOnlyAttributePrototype):
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
(WebCore::JSTestStringifierReadWriteAttributePrototype::JSTestStringifierReadWriteAttributePrototype):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsPrototype::JSTestTypedefsPrototype):

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

2 months agoREGRESSION(r241980): Web Inspector: Styles: Pressing Tab/Enter on last property no...
nvasilyev@apple.com [Sat, 22 Jun 2019 18:28:02 +0000 (18:28 +0000)]
REGRESSION(r241980): Web Inspector: Styles: Pressing Tab/Enter on last property no longer focuses on selector on next rule
https://bugs.webkit.org/show_bug.cgi?id=199125
<rdar://problem/52011182>

Reviewed by Matt Baker.

Since SpreadsheetSelectorField's focus handler was removed in r241980, focusing on the selector element
doesn't start editing it.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.startEditingRuleSelector):

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

2 months agoWeb Inspector: Styles: unbalanced quotes and parenthesis aren't displayed as property...
nvasilyev@apple.com [Sat, 22 Jun 2019 18:05:29 +0000 (18:05 +0000)]
Web Inspector: Styles: unbalanced quotes and parenthesis aren't displayed as property closed after editing values
https://bugs.webkit.org/show_bug.cgi?id=199090
<rdar://problem/51965431>

Reviewed by Matt Baker.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidBlur):
Unbalanced quotes and parenthesis are fixed inside of CSSProperty's rawValue setter.
Render the value from the model, not the view.

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

2 months agoUnreviewed, add myself to CMake watchlist
annulen@yandex.ru [Sat, 22 Jun 2019 16:14:06 +0000 (16:14 +0000)]
Unreviewed, add myself to CMake watchlist

* Scripts/webkitpy/common/config/watchlist:

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

2 months agowebkitgtk 2.24.2 fails to build w/gstreamer 1.12.5
commit-queue@webkit.org [Sat, 22 Jun 2019 15:51:00 +0000 (15:51 +0000)]
webkitgtk 2.24.2 fails to build w/gstreamer 1.12.5
https://bugs.webkit.org/show_bug.cgi?id=198080

Patch by Mike Gorse <mgorse@suse.com> on 2019-06-22
Reviewed by Philippe Normand.

No new tests (build fix only).

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
Move includes of gst/gl/gl.h and epoxy/gl.h into
MediaPlayerPrivateGStreamerBase.h.

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

2 months ago[JSC] Strict, Sloppy and Arrow functions should have different classInfo
ysuzuki@apple.com [Sat, 22 Jun 2019 07:48:08 +0000 (07:48 +0000)]
[JSC] Strict, Sloppy and Arrow functions should have different classInfo
https://bugs.webkit.org/show_bug.cgi?id=197631

Reviewed by Saam Barati.

JSTests:

* stress/has-own-property-arguments.js: Added.
(shouldBe):
(A):

Source/JavaScriptCore:

If a constructor inherits a builtin class, it creates a Structure which is subclassing the builtin class.
This is done by using InternalFunction::createSubclassStructure. But to accelerate the common cases, we
cache the created structure in InternalFunctionAllocationProfile. Whether the cache is valid is checked
by comparing classInfo of the cached structure and the given base structure. This implicitly assume that
each builtin class's InternalFunction creates an instance based on one structure.

However, Function constructor is an exception: Function constructor creates an instance which has different
structures based on a parameter. If a strict code is given (e.g. "'use strict'"), it creates a function
instance with strict function structure.

As a result, InternalFunctionAllocationProfile incorrectly caches the structure. Consider the following code.

    class A extends Function { };
    let a = new A("'use strict'");
    let b = new A("");

While `a` and `b` should have different structures, `A` caches the structure for `a`, and reuse it even the given
code is not a strict code. This is problematic: We are separating structures of strict, sloppy, and arrow functions
because they have different properties. However, in the above case, a and b have the same structure while they have
different properties. So it causes incorrect structure-based caching in JSC. One of the example is HasOwnPropertyCache.

In this patch, we introduce JSStrictFunction, JSSloppyFunction, and JSArrowFunction classes and classInfos. This design
works well and already partially accepted for JSGeneratorFunction, JSAsyncGeneratorFunction, and JSAsyncFunction. Each
structure now has a different classInfo so that InternalFunctionAllocationProfile correctly caches and invalidates the
cached one based on the classInfo. Since we already have different structures for these instances, and DFG and FTL
optimizations are based on JSFunctionType (not classInfo), introducing these three classInfo do not break the optimization.

Note that structures on ArrayConstructor does not cause the same problem. It only uses Undecided indexing typed array
structure in InternalFunctionAllocationProfile, and once haveABadTime happens, it clears InternalFunctionAllocationProfile.

* runtime/JSAsyncFunction.h: This subspaceFor is not necessary since it is defined in JSFunction. And we already ensure that
sizeof(JSAsyncFunction) == sizeof(JSFunction).
* runtime/JSAsyncGeneratorFunction.cpp:
* runtime/JSAsyncGeneratorFunction.h: Ditto.
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
* runtime/JSGeneratorFunction.h: Ditto.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):

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

2 months ago[JSC] ClassExpr should not store result in the middle of evaluation
ysuzuki@apple.com [Sat, 22 Jun 2019 07:16:34 +0000 (07:16 +0000)]
[JSC] ClassExpr should not store result in the middle of evaluation
https://bugs.webkit.org/show_bug.cgi?id=199106

Reviewed by Tadeu Zagallo.

JSTests:

* stress/class-expression-should-store-result-at-last.js: Added.
(shouldThrow):
(shouldThrow.let.a):

Source/JavaScriptCore:

Let's consider the case,

    let a = class A {
        static get[a=0x12345678]() {
        }
    };

When evaluating `class A` expression, we should not use the local register for `let a`
until we finally store it to that register. Otherwise, `a=0x12345678` will override it.
Out BytecodeGenerator does that this by using tempDestination and finalDestination, but
we did not do that in ClassExprNode.

This patch leverages tempDestination and finalDestination to store `class A` result finally,
while we attempt to reduce mov.

* bytecompiler/NodesCodegen.cpp:
(JSC::ClassExprNode::emitBytecode):

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

2 months agoopenDatabase should return an empty object when WebSQL is disabled
sihui_liu@apple.com [Sat, 22 Jun 2019 05:50:02 +0000 (05:50 +0000)]
openDatabase should return an empty object when WebSQL is disabled
https://bugs.webkit.org/show_bug.cgi?id=198805

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* runtime/JSFunction.cpp:
(JSC::JSFunction::createFunctionThatMasqueradesAsUndefined):
* runtime/JSFunction.h:

Source/WebCore:

Some websites rely on calling openDatabase with null parameters to check for private browsing. To not break
those sites, we now expose openDatabase interface even if Web SQL is disabled. When Web SQL is disabled,
window.openDatabase returns false, but it is callable and returns empty object.

Test: WebSQL.OpenDatabaseAlwaysExists

* Modules/webdatabase/DOMWindowWebDatabase.idl:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowInstanceFunctionOpenDatabaseBody):
(WebCore::IDLOperation<JSDOMWindow>::cast):
(WebCore::jsDOMWindowInstanceFunctionOpenDatabase):
(WebCore::JSDOMWindow::openDatabase const):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WebSQLBasics.mm: Added.
(-[WebSQLBasicsMessageHandler userContentController:didReceiveScriptMessage:]):
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/opendatabase-always-exists.html: Added.

LayoutTests:

Modify test expectation as openDatabase is not a function but an attribute of window now.

* js/dom/global-function-resolve-expected.txt:
* js/dom/script-tests/global-function-resolve.js:

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

2 months agoNullptr crash in DeleteSelectionCommand::handleGeneralDelete
rniwa@webkit.org [Sat, 22 Jun 2019 04:04:23 +0000 (04:04 +0000)]
Nullptr crash in DeleteSelectionCommand::handleGeneralDelete
https://bugs.webkit.org/show_bug.cgi?id=199126

Reviewed by Wenson Hsieh.

Added null checks to handleGeneralDelete as well as mergeParagraphs which runs after handleGeneralDelete to be defensive.

Unfortunately no new tests since there is no reproducible test case.

* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::handleGeneralDelete):
(WebCore::DeleteSelectionCommand::mergeParagraphs):

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

2 months agoUnreviewed, a build fix after r246701
jiewen_tan@apple.com [Sat, 22 Jun 2019 00:26:02 +0000 (00:26 +0000)]
Unreviewed, a build fix after r246701

* Shared/LoadParameters.h:
Add a default value for shouldOpenExternalURLsPolicy.

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

2 months agoResourceLoadNotifier should check whether its frame document loader is null
youenn@apple.com [Sat, 22 Jun 2019 00:11:00 +0000 (00:11 +0000)]
ResourceLoadNotifier should check whether its frame document loader is null
https://bugs.webkit.org/show_bug.cgi?id=199118

Reviewed by Geoffrey Garen.

* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchWillSendRequest):

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

2 months agoAdjust sandboxes based on seed feedback
bfulgham@apple.com [Fri, 21 Jun 2019 22:52:52 +0000 (22:52 +0000)]
Adjust sandboxes based on seed feedback
https://bugs.webkit.org/show_bug.cgi?id=199119
<rdar://problem/50164879>

Reviewed by Geoffrey Garen.

Update our sandboxes to address test failures and bugs encountered during initial iOS 13 and
macOS Catalina testing.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* WebProcess/com.apple.WebProcess.sb.in:

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

2 months agoWebPageProxy::loadData should accept ShouldOpenExternalURLsPolicy
jiewen_tan@apple.com [Fri, 21 Jun 2019 22:47:17 +0000 (22:47 +0000)]
WebPageProxy::loadData should accept ShouldOpenExternalURLsPolicy
https://bugs.webkit.org/show_bug.cgi?id=199114
<rdar://problem/51671674>

Reviewed by Youenn Fablet.

Source/WebCore:

Covered by new test content within existing tests.

* loader/FrameLoaderTypes.h:
Adds an EnumTraits for ShouldOpenExternalURLsPolicy.

Source/WebKit:

This patch teaches WebPageProxy::loadData to accept ShouldOpenExternalURLsPolicy policy,
and then utilize it in RedirectSOAuthorizationSession. Therefore, the response loaded after
successful interceptions will be able to propagate the same policy from the last navigation
as it were continuous loading.

Besides the above, this patch also fixes some minor issues.

* Shared/LoadParameters.h:
* UIProcess/Cocoa/SOAuthorization/NavigationSOAuthorizationSession.mm:
(WebKit::NavigationSOAuthorizationSession::shouldStartInternal):
(WebKit::NavigationSOAuthorizationSession::webViewDidMoveToWindow):
* UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.h:
* UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm:
(WebKit::PopUpSOAuthorizationSession::completeInternal):
* UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.h:
* UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.mm:
(WebKit::shouldOpenExternalURLsPolicy):
(WebKit::RedirectSOAuthorizationSession::completeInternal):
* UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h:
* UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
(WebKit::SOAuthorizationSession::complete):
* UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h:
* UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
(WebKit::SubFrameSOAuthorizationSession::fallBackToWebPathInternal):
(WebKit::SubFrameSOAuthorizationSession::completeInternal):
(WebKit::SubFrameSOAuthorizationSession::loadDataToFrame):
(WebKit::SubFrameSOAuthorizationSession::postDidCancelMessageToParent):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadRequestWithNavigationShared):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadDataWithNavigationShared):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadDataImpl):
(WebKit::WebPage::loadData):
* WebProcess/WebPage/WebPage.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
(-[TestSOAuthorizationNavigationDelegate init]):
(-[TestSOAuthorizationNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(configureSOAuthorizationWebView):
(TestWebKitAPI::TEST):

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

2 months ago[WHLSL] Code that accesses an undefined variable crashes
sbarati@apple.com [Fri, 21 Jun 2019 22:14:56 +0000 (22:14 +0000)]
[WHLSL] Code that accesses an undefined variable crashes
https://bugs.webkit.org/show_bug.cgi?id=198775

Reviewed by Myles C. Maxfield.

Source/WebCore:

Myles mostly fixed this in r246631 when he made NameResolver propagate
its error to its parent NameResolver. However, there was still one bug
where we ended up calling setError twice for an if statement. This patch
fixes that and adds tests.

Tests: webgpu/whlsl-use-undefined-variable-2.html
       webgpu/whlsl-use-undefined-variable.html

* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
(WebCore::WHLSL::NameResolver::visit):

LayoutTests:

* webgpu/whlsl-use-undefined-variable-2-expected.txt: Added.
* webgpu/whlsl-use-undefined-variable-2.html: Added.
* webgpu/whlsl-use-undefined-variable-expected.txt: Added.
* webgpu/whlsl-use-undefined-variable.html: Added.

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

2 months agoUnreviewed, rolling out r246611.
tsavell@apple.com [Fri, 21 Jun 2019 22:08:58 +0000 (22:08 +0000)]
Unreviewed, rolling out r246611.

Introduced a flakey test.

Reverted changeset:

"iOS 12.2 Drawing portrait video to canvas is sideways"
https://bugs.webkit.org/show_bug.cgi?id=196772
https://trac.webkit.org/changeset/246611

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

2 months ago[bmalloc] IsoTLS Layout extension initializes one IsoTLSEntry twice
ysuzuki@apple.com [Fri, 21 Jun 2019 21:31:17 +0000 (21:31 +0000)]
[bmalloc] IsoTLS Layout extension initializes one IsoTLSEntry twice
https://bugs.webkit.org/show_bug.cgi?id=199077

Reviewed by Saam Barati.

Found that IsoTLS::ensureEntries can construct the same IsoTLSEntry many times, it can leak memory because the construction clears previous fields including freelist.

1. We have oldLastEntry.
2. In that case, startEntry is oldLastEntry.
3. We find some targetEntry.
4. Finally, if startEntry exists, we newly construct [startEntry, targetEntry]
5. In the above sequence, oldLastEntry (== startEntry) is constructed again, while oldLastEntry is already constructed previously.

We fix this issue by changing the startEntry. We already have `RELEASE_BASSERT(!oldLastEntry || oldLastEntry->offset() < offset);`
assertion. This means that `oldLastEntry->m_next` must exist, otherwise the following loop would not find a `targetEntry`. And `layout.head()`
must return non nullptr at `IsoTLS::ensureEntries` because `IsoTLS::ensureEntries` requires that `IsoHeap<>` is initialized, and `IsoHeap<>`
must add at least one TLS entry to the IsoTLSLayout.

* bmalloc/IsoTLS.cpp:
(bmalloc::IsoTLS::ensureEntries):

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

2 months agoWebKit context menu highlights include extra padding
timothy_horton@apple.com [Fri, 21 Jun 2019 21:22:51 +0000 (21:22 +0000)]
WebKit context menu highlights include extra padding
https://bugs.webkit.org/show_bug.cgi?id=199080
<rdar://problem/51140126>

Reviewed by Dean Jackson.

* Shared/ios/InteractionInformationRequest.cpp:
(WebKit::InteractionInformationRequest::encode const):
(WebKit::InteractionInformationRequest::decode):
(WebKit::InteractionInformationRequest::isValidForRequest):
(WebKit::InteractionInformationRequest::isApproximatelyValidForRequest):
* Shared/ios/InteractionInformationRequest.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView positionInformationForActionSheetAssistant:]):
(-[WKContentView updatePositionInformationForActionSheetAssistant:]):
(-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::linkIndicatorPositionInformation):
Disable the margin going forward, but leave it if we're using the legacy
API, because there is no way to add margin at the platform level with
the legacy API.

In the future we should always have no margin in our indicator, and just
apply it in whatever consumes the indicator, so that there is no
disagreement between clients about the size of the margin.

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

2 months ago[WHLSL] read modify write expressions do no work as expected
mmaxfield@apple.com [Fri, 21 Jun 2019 21:02:41 +0000 (21:02 +0000)]
[WHLSL] read modify write expressions do no work as expected
https://bugs.webkit.org/show_bug.cgi?id=195864

Unreviewed test gardening.

* webgpu/whlsl-read-modify-write-expected.txt: Added.

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

2 months agoPreview of <picture> element doesn't match element bounds
timothy_horton@apple.com [Fri, 21 Jun 2019 20:52:44 +0000 (20:52 +0000)]
Preview of <picture> element doesn't match element bounds
https://bugs.webkit.org/show_bug.cgi?id=199049
<rdar://problem/51474402>

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/text-indicator/text-indicator-uses-img-size-inside-picture.html

* dom/DOMRectReadOnly.idl:
* dom/Range.cpp:
(WebCore::Range::absoluteRectsForRangeInText const):
(WebCore::Range::absoluteTextRects const):
(WebCore::Range::borderAndTextRects const):
(WebCore::Range::boundingRect const):
(WebCore::Range::absoluteBoundingRect const):
* dom/Range.h:
(WebCore::Range::absoluteTextRects):
(WebCore::Range::absoluteBoundingRect):
(WebCore::Range::borderAndTextRects):
(WebCore::Range::boundingRect):
* page/TextIndicator.cpp:
(WebCore::absoluteBoundingRectForRange):
(WebCore::estimatedBackgroundColorForRange):
(WebCore::initializeIndicator):
* rendering/RenderBlock.h:
* testing/Internals.cpp:
(WebCore::Internals::TextIndicatorData::TextIndicatorData):
(WebCore::Internals::TextIndicatorData::~TextIndicatorData):
(WebCore::Internals::textIndicatorForRange):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/text-indicator/text-indicator-uses-img-size-inside-picture-expected.txt: Added.
* fast/text-indicator/text-indicator-uses-img-size-inside-picture.html: Added.

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

2 months agoWebPageProxy should use the right path for sandbox extension
youenn@apple.com [Fri, 21 Jun 2019 20:36:57 +0000 (20:36 +0000)]
WebPageProxy should use the right path for sandbox extension
https://bugs.webkit.org/show_bug.cgi?id=198902
<rdar://problem/50772810>

Reviewed by Geoffrey Garen.

Source/WebKit:

Store the sandbox path, if any, in UIProcess for each page in its PageLoadState.
This allows proper sandbox handling for reload after crash and process swap cases.
Store the sandbox path, if any, in the b/w list so that the sandbox path can be properly computed
during b/f navigation works.

Add SPI for test purposes to check what is the current sandbox path.

* Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::resourceDirectoryURL const):
(WebKit::WebBackForwardListItem::setResourceDirectoryURL):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _resourceDirectoryURL]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::resourceDirectoryURL const):
(WebKit::PageLoadState::setPendingAPIRequestURL):
* UIProcess/PageLoadState.h:
(WebKit::PageLoadState::setPendingAPIRequestURL):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
(WebKit::WebPageProxy::loadRequestWithNavigationShared):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::backForwardAddItem):
(WebKit::WebPageProxy::backForwardGoToItemShared):
(WebKit::WebPageProxy::currentResourceDirectoryURL const):
* UIProcess/WebPageProxy.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/LoadFileURL.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

2 months ago[iOS] Compatibility mouse events aren't prevented by calling preventDefault() on...
graouts@webkit.org [Fri, 21 Jun 2019 20:31:57 +0000 (20:31 +0000)]
[iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
https://bugs.webkit.org/show_bug.cgi?id=198124
Source/WebKit:

<rdar://problem/50410863>

Reviewed by Dean Jackson.

Ensure we wait until completion of a tap before removing the pointer ID and the preventDefault() state along with it.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _singleTapDidReset:]):
(-[WKContentView _commitPotentialTapFailed]):
(-[WKContentView _didCompleteSyntheticClick]):
(-[WKContentView _singleTapRecognized:]):

LayoutTests:

Reviewed by Dean Jackson.

Add a new test that checks that calling preventDefault() within a "pointerdown" event handler correctly prevents
the dispatch of compatibility mouse events even with a slow tap.

* pointerevents/ios/pointer-events-no-mousedown-when-prevent-default-called-on-pointerdown-expected.txt: Added.
* pointerevents/ios/pointer-events-no-mousedown-when-prevent-default-called-on-pointerdown.html: Added.

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

2 months agoRemove extra check in RegExp @matchSlow
commit-queue@webkit.org [Fri, 21 Jun 2019 20:28:05 +0000 (20:28 +0000)]
Remove extra check in RegExp @matchSlow
https://bugs.webkit.org/show_bug.cgi?id=198846

Patch by Alexey Shvayka <shvaikalesh@gmail.com> on 2019-06-21
Reviewed by Joseph Pecoraro.

Type of RegExp `exec` result is already asserted in @regExpExec.

* builtins/RegExpPrototype.js:
(globalPrivate.matchSlow): Remove isObject check.

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

2 months agoLayout Test animations/change-one-anim.html is flaky.
tsavell@apple.com [Fri, 21 Jun 2019 19:50:49 +0000 (19:50 +0000)]
Layout Test animations/change-one-anim.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=190882

Unreviewed Test Gardening.

Patch by Russell Epstein <russell_e@apple.com> on 2019-06-21

* platform/ios-wk2/TestExpectations:
* platform/mac/TestExpectations:

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

2 months agoAddress reference to UIColor.groupTableViewBackgroundColor in WKPasswordView.mm
krollin@apple.com [Fri, 21 Jun 2019 19:12:44 +0000 (19:12 +0000)]
Address reference to UIColor.groupTableViewBackgroundColor in WKPasswordView.mm
https://bugs.webkit.org/show_bug.cgi?id=199111
<rdar://problem/51992107>

Reviewed by Timothy Hatcher.

WKPasswordView.mm is used on iOS-family devices. However, it doesn't
build on tvOS or watchOS when "treat deprecation warnings as errors"
is enabled. This build failure is due to a reference to
UIColor.groupTableViewBackgroundColor in a branch of non-dark-mode
code. Address this by surrounding the reference with
ALLOW_DEPRECATED_DECLARATIONS_* macros.

Attempting to address the build failure by unconditionally enabling
the dark-mode code works for tvOS, but fails for watchOS due to lack
of dark-mode support on that platform.

* UIProcess/ios/WKPasswordView.mm:
(-[WKPasswordView showInScrollView:]):

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

2 months agoWeb Inspector: remove unused DataGrid style .force-focus
mattbaker@apple.com [Fri, 21 Jun 2019 18:21:17 +0000 (18:21 +0000)]
Web Inspector: remove unused DataGrid style .force-focus
https://bugs.webkit.org/show_bug.cgi?id=199112
<rdar://problem/51993412>

Reviewed by Timothy Hatcher.

* UserInterface/Views/HeapAllocationsTimelineView.css:
(.timeline-view.heap-allocations > .data-grid:not(:focus) tr.selected.invalid):
(.timeline-view.heap-allocations > .data-grid:not(:focus, .force-focus) tr.selected.invalid): Deleted.

* UserInterface/Views/ResourceTreeElement.css:
(.item.resource.resource-type-websocket:not(.selected) .status .ready-state.open,):
(.item.resource.resource-type-websocket:not(.selected) .status .ready-state.connecting,):
Missed in https://bugs.webkit.org/show_bug.cgi?id=190480.

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

2 months agoSafari crashes after ~2028 OfflineAudioContext objects are created (they never get...
youenn@apple.com [Fri, 21 Jun 2019 18:01:13 +0000 (18:01 +0000)]
Safari crashes after ~2028 OfflineAudioContext objects are created (they never get garbage collected, consuming a thread each)
https://bugs.webkit.org/show_bug.cgi?id=198964
<rdar://problem/51891520>

Reviewed by Jer Noble.

Source/WebCore:

Move from setPendingActivity/unsetPendingActivity to an
m_pendingActivity member which is easier to manage.

Keep setting a pending activity for AudioContext at construction time
but do not do that for Offline contexts.
Instead, set the pending activity when startRendering is called.
Unset the pending activity when the rendering activity is finished.

Make m_audioDecoder a unique pointer so that it can lazily be initialized.
This removes the burden of creating an audio decoder thread for each context.

Test: webaudio/offlineaudiocontext-gc.html

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::AudioContext):
(WebCore::AudioContext::constructCommon):
(WebCore::AudioContext::clear):
(WebCore::AudioContext::decodeAudioData):
(WebCore::AudioContext::startRendering):
(WebCore::AudioContext::finishedRendering):
(WebCore::AudioContext::dispatchEvent):
(WebCore::AudioContext::clearPendingActivity):
(WebCore::AudioContext::makePendingActivity):
To keep it consistent with setPendingActivity/unsetPendingActivity, we
explicitly ref/unref the AudioContext. We should try to remove this ref/unref.
* Modules/webaudio/AudioContext.h:
* Modules/webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::startRendering):

LayoutTests:

* webaudio/offlineaudiocontext-gc-expected.txt: Added.
* webaudio/offlineaudiocontext-gc.html: Added.

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