Title: [274407] trunk
- Revision
- 274407
- Author
- [email protected]
- Date
- 2021-03-14 17:57:22 -0700 (Sun, 14 Mar 2021)
Log Message
[Win][WK1] Add a new API IWebPreferences::startBatchingUpdates to defer WebPreferencesChangedNotification
https://bugs.webkit.org/show_bug.cgi?id=223109
Reviewed by Sam Weinig.
Source/WebKitLegacy/win:
Some JS tests are timing out for Windows WebKit1 Debug build since
r274111. Those tests generate very large pages. r274111 resets
WebPreferences to the initial state. Changing a preference causes
relayout. Thus, resetting preferences caused layouts repeatedly.
r274040 (Bug 218024) added _batchUpdatePreferencesInBlock to
WebPreferences for Mac WebKit1 to defer the notification.
* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferences.cpp:
(WebPreferences::postPreferencesChangesNotification):
(WebPreferences::startBatchingUpdates): Added.
(WebPreferences::stopBatchingUpdates): Added.
* WebPreferences.h:
Tools:
* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebViewToConsistentStateBeforeTesting):
Modified Paths
Diff
Modified: trunk/Source/WebKitLegacy/win/ChangeLog (274406 => 274407)
--- trunk/Source/WebKitLegacy/win/ChangeLog 2021-03-14 22:18:40 UTC (rev 274406)
+++ trunk/Source/WebKitLegacy/win/ChangeLog 2021-03-15 00:57:22 UTC (rev 274407)
@@ -1,3 +1,25 @@
+2021-03-14 Fujii Hironori <[email protected]>
+
+ [Win][WK1] Add a new API IWebPreferences::startBatchingUpdates to defer WebPreferencesChangedNotification
+ https://bugs.webkit.org/show_bug.cgi?id=223109
+
+ Reviewed by Sam Weinig.
+
+ Some JS tests are timing out for Windows WebKit1 Debug build since
+ r274111. Those tests generate very large pages. r274111 resets
+ WebPreferences to the initial state. Changing a preference causes
+ relayout. Thus, resetting preferences caused layouts repeatedly.
+
+ r274040 (Bug 218024) added _batchUpdatePreferencesInBlock to
+ WebPreferences for Mac WebKit1 to defer the notification.
+
+ * Interfaces/IWebPreferencesPrivate.idl:
+ * WebPreferences.cpp:
+ (WebPreferences::postPreferencesChangesNotification):
+ (WebPreferences::startBatchingUpdates): Added.
+ (WebPreferences::stopBatchingUpdates): Added.
+ * WebPreferences.h:
+
2021-03-10 Chris Dumez <[email protected]>
Unreviewed Window build fix after r274252.
Modified: trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl (274406 => 274407)
--- trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl 2021-03-14 22:18:40 UTC (rev 274406)
+++ trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl 2021-03-15 00:57:22 UTC (rev 274407)
@@ -278,6 +278,8 @@
HRESULT overscrollBehaviorEnabled([ out, retval ] BOOL*);
HRESULT setOverscrollBehaviorEnabled([in] BOOL enabled);
HRESULT resetForTesting();
+ HRESULT startBatchingUpdates();
+ HRESULT stopBatchingUpdates();
}
// NOTE: Please do not add any more preferences that are only for testing purposes. Instead,
Modified: trunk/Source/WebKitLegacy/win/WebPreferences.cpp (274406 => 274407)
--- trunk/Source/WebKitLegacy/win/WebPreferences.cpp 2021-03-14 22:18:40 UTC (rev 274406)
+++ trunk/Source/WebKitLegacy/win/WebPreferences.cpp 2021-03-15 00:57:22 UTC (rev 274407)
@@ -165,6 +165,10 @@
HRESULT WebPreferences::postPreferencesChangesNotification()
{
+ if (m_updateBatchCount) {
+ m_needsUpdateAfterBatch = true;
+ return S_OK;
+ }
IWebNotificationCenter* nc = WebNotificationCenter::defaultCenterInternal();
HRESULT hr = nc->postNotificationName(webPreferencesChangedNotification(), static_cast<IWebPreferences*>(this), 0);
if (FAILED(hr))
@@ -2621,3 +2625,23 @@
load();
return S_OK;
}
+
+HRESULT WebPreferences::startBatchingUpdates()
+{
+ m_updateBatchCount++;
+ return S_OK;
+}
+
+HRESULT WebPreferences::stopBatchingUpdates()
+{
+ if (!m_updateBatchCount)
+ return E_FAIL;
+ m_updateBatchCount--;
+ if (!m_updateBatchCount) {
+ if (m_needsUpdateAfterBatch) {
+ postPreferencesChangesNotification();
+ m_needsUpdateAfterBatch = false;
+ }
+ }
+ return S_OK;
+}
Modified: trunk/Source/WebKitLegacy/win/WebPreferences.h (274406 => 274407)
--- trunk/Source/WebKitLegacy/win/WebPreferences.h 2021-03-14 22:18:40 UTC (rev 274406)
+++ trunk/Source/WebKitLegacy/win/WebPreferences.h 2021-03-15 00:57:22 UTC (rev 274407)
@@ -316,6 +316,8 @@
virtual HRESULT STDMETHODCALLTYPE overscrollBehaviorEnabled(_Out_ BOOL*);
virtual HRESULT STDMETHODCALLTYPE setOverscrollBehaviorEnabled(BOOL);
virtual HRESULT STDMETHODCALLTYPE resetForTesting();
+ virtual HRESULT STDMETHODCALLTYPE startBatchingUpdates();
+ virtual HRESULT STDMETHODCALLTYPE stopBatchingUpdates();
// WebPreferences
@@ -377,6 +379,8 @@
bool m_autoSaves { false };
bool m_automaticallyDetectsCacheModel { true };
unsigned m_numWebViews { 0 };
+ unsigned m_updateBatchCount { 0 };
+ bool m_needsUpdateAfterBatch { false };
#if USE(CF)
RetainPtr<CFMutableDictionaryRef> m_privatePrefs;
Modified: trunk/Tools/ChangeLog (274406 => 274407)
--- trunk/Tools/ChangeLog 2021-03-14 22:18:40 UTC (rev 274406)
+++ trunk/Tools/ChangeLog 2021-03-15 00:57:22 UTC (rev 274407)
@@ -1,3 +1,13 @@
+2021-03-14 Fujii Hironori <[email protected]>
+
+ [Win][WK1] Add a new API IWebPreferences::startBatchingUpdates to defer WebPreferencesChangedNotification
+ https://bugs.webkit.org/show_bug.cgi?id=223109
+
+ Reviewed by Sam Weinig.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetWebViewToConsistentStateBeforeTesting):
+
2021-03-13 Sam Sneddon <[email protected]>
Move LayoutTestFinder.split_into_chunks to Manager._split_into_chunks
Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (274406 => 274407)
--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp 2021-03-14 22:18:40 UTC (rev 274406)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp 2021-03-15 00:57:22 UTC (rev 274407)
@@ -1047,8 +1047,13 @@
COMPtr<IWebPreferences> preferences;
if (SUCCEEDED(webView->preferences(&preferences))) {
+ COMPtr<IWebPreferencesPrivate8> prefsPrivate { Query, preferences };
+ prefsPrivate->startBatchingUpdates();
+
resetWebPreferencesToConsistentValues(preferences.get());
setWebPreferencesForTestOptions(preferences.get(), options);
+
+ prefsPrivate->stopBatchingUpdates();
}
TestRunner::setSerializeHTTPLoads(false);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes