Diff
Modified: trunk/LayoutTests/ChangeLog (252893 => 252894)
--- trunk/LayoutTests/ChangeLog 2019-11-26 20:15:39 UTC (rev 252893)
+++ trunk/LayoutTests/ChangeLog 2019-11-27 01:53:00 UTC (rev 252894)
@@ -1,3 +1,12 @@
+2019-11-26 Chris Dumez <[email protected]>
+
+ Drop ActiveDOMObject::shouldPreventEnteringBackForwardCache_DEPRECATED()
+ https://bugs.webkit.org/show_bug.cgi?id=204626
+
+ Reviewed by Ryosuke Niwa.
+
+ * http/tests/security/navigate-when-restoring-cached-page.html:
+
2019-11-26 Jonathan Bedard <[email protected]>
[WebGL] Garden dedicated queue (Part 5)
Modified: trunk/LayoutTests/http/tests/security/navigate-when-restoring-cached-page.html (252893 => 252894)
--- trunk/LayoutTests/http/tests/security/navigate-when-restoring-cached-page.html 2019-11-26 20:15:39 UTC (rev 252893)
+++ trunk/LayoutTests/http/tests/security/navigate-when-restoring-cached-page.html 2019-11-27 01:53:00 UTC (rev 252894)
@@ -61,9 +61,8 @@
clearInterval(interval_id);
- // Prevent entering PageCache.
if (w.internals)
- w.internals.preventDocumentForEnteringBackForwardCache();
+ w.internals.preventDocumentFromEnteringBackForwardCache();
child_frame = w.document.body.appendChild(document.createElement('iframe'));
child_frame.contentWindow._onunload_ = () => {
Modified: trunk/Source/WebCore/ChangeLog (252893 => 252894)
--- trunk/Source/WebCore/ChangeLog 2019-11-26 20:15:39 UTC (rev 252893)
+++ trunk/Source/WebCore/ChangeLog 2019-11-27 01:53:00 UTC (rev 252894)
@@ -1,3 +1,30 @@
+2019-11-26 Chris Dumez <[email protected]>
+
+ Drop ActiveDOMObject::shouldPreventEnteringBackForwardCache_DEPRECATED()
+ https://bugs.webkit.org/show_bug.cgi?id=204626
+
+ Reviewed by Ryosuke Niwa.
+
+ Drop ActiveDOMObject::shouldPreventEnteringBackForwardCache_DEPRECATED() now that it is no longer
+ used.
+
+ * dom/ActiveDOMObject.h:
+ * dom/Document.h:
+ (WebCore::Document::shouldPreventEnteringBackForwardCacheForTesting const):
+ (WebCore::Document::preventEnteringBackForwardCacheForTesting):
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::forEachActiveDOMObject const):
+ (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension): Deleted.
+ * dom/ScriptExecutionContext.h:
+ * history/BackForwardCache.cpp:
+ (WebCore::canCacheFrame):
+ * testing/Internals.cpp:
+ (WebCore::Internals::Internals):
+ (WebCore::Internals::preventDocumentFromEnteringBackForwardCache):
+ (WebCore::Internals::preventDocumentForEnteringBackForwardCache): Deleted.
+ * testing/Internals.h:
+ * testing/Internals.idl:
+
2019-11-26 Antti Koivisto <[email protected]>
[LFC][Render tree] Add LFC line layout path to RenderBlockFlow
Modified: trunk/Source/WebCore/dom/ActiveDOMObject.h (252893 => 252894)
--- trunk/Source/WebCore/dom/ActiveDOMObject.h 2019-11-26 20:15:39 UTC (rev 252893)
+++ trunk/Source/WebCore/dom/ActiveDOMObject.h 2019-11-27 01:53:00 UTC (rev 252894)
@@ -63,9 +63,8 @@
virtual const char* activeDOMObjectName() const = 0;
- // These three functions must not have a side effect of creating or destroying
+ // These functions must not have a side effect of creating or destroying
// any ActiveDOMObject. That means they must not result in calls to arbitrary _javascript_.
- virtual bool shouldPreventEnteringBackForwardCache_DEPRECATED() const { return false; } // Please do not add new overrides for this function.
virtual void suspend(ReasonForSuspension);
virtual void resume();
Modified: trunk/Source/WebCore/dom/Document.h (252893 => 252894)
--- trunk/Source/WebCore/dom/Document.h 2019-11-26 20:15:39 UTC (rev 252893)
+++ trunk/Source/WebCore/dom/Document.h 2019-11-27 01:53:00 UTC (rev 252894)
@@ -489,6 +489,9 @@
StandaloneStatus xmlStandaloneStatus() const { return m_xmlStandalone; }
bool hasXMLDeclaration() const { return m_hasXMLDeclaration; }
+ bool shouldPreventEnteringBackForwardCacheForTesting() const { return m_shouldPreventEnteringBackForwardCacheForTesting; }
+ void preventEnteringBackForwardCacheForTesting() { m_shouldPreventEnteringBackForwardCacheForTesting = true; }
+
void setXMLEncoding(const String& encoding) { m_xmlEncoding = encoding; } // read-only property, only to be set from XMLDocumentParser
WEBCORE_EXPORT ExceptionOr<void> setXMLVersion(const String&);
WEBCORE_EXPORT void setXMLStandalone(bool);
@@ -2078,6 +2081,7 @@
bool m_hasEvaluatedUserAgentScripts { false };
bool m_isRunningUserScripts { false };
bool m_mayBeDetachedFromFrame { true };
+ bool m_shouldPreventEnteringBackForwardCacheForTesting { false };
#if ENABLE(APPLE_PAY)
bool m_hasStartedApplePaySession { false };
#endif
Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.cpp (252893 => 252894)
--- trunk/Source/WebCore/dom/ScriptExecutionContext.cpp 2019-11-26 20:15:39 UTC (rev 252893)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.cpp 2019-11-27 01:53:00 UTC (rev 252894)
@@ -222,38 +222,11 @@
{
}
-bool ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension(Vector<ActiveDOMObject*>* unsuspendableObjects)
-{
- checkConsistency();
-
- bool canSuspend = true;
-
- forEachActiveDOMObject([&](auto& activeDOMObject) {
- if (activeDOMObject.shouldPreventEnteringBackForwardCache_DEPRECATED()) {
- canSuspend = false;
- if (unsuspendableObjects)
- unsuspendableObjects->append(&activeDOMObject);
- else
- return ShouldContinue::No;
- }
- return ShouldContinue::Yes;
- });
-
- if (unsuspendableObjects) {
- // Remove activeDOMObjects that have been destroyed while we were iterating above.
- unsuspendableObjects->removeAllMatching([&](auto* activeDOMObject) {
- return !m_activeDOMObjects.contains(activeDOMObject);
- });
- }
-
- return canSuspend;
-}
-
void ScriptExecutionContext::forEachActiveDOMObject(const Function<ShouldContinue(ActiveDOMObject&)>& apply) const
{
// It is not allowed to run arbitrary script or construct new ActiveDOMObjects while we are iterating over ActiveDOMObjects.
// An ASSERT_WITH_SECURITY_IMPLICATION or RELEASE_ASSERT will fire if this happens, but it's important to code
- // canSuspendActiveDOMObjectsForDocumentSuspension() / suspend() / resume() / stop() functions so it will not happen!
+ // suspend() / resume() / stop() functions so it will not happen!
ScriptDisallowedScope scriptDisallowedScope;
SetForScope<bool> activeDOMObjectAdditionForbiddenScope(m_activeDOMObjectAdditionForbidden, true);
Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (252893 => 252894)
--- trunk/Source/WebCore/dom/ScriptExecutionContext.h 2019-11-26 20:15:39 UTC (rev 252893)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h 2019-11-27 01:53:00 UTC (rev 252894)
@@ -126,11 +126,6 @@
PublicURLManager& publicURLManager();
- // Active objects are not garbage collected even if inaccessible, e.g. because their activity may result in callbacks being invoked.
- WEBCORE_EXPORT bool canSuspendActiveDOMObjectsForDocumentSuspension(Vector<ActiveDOMObject*>* unsuspendableObjects = nullptr);
-
- // Active objects can be asked to suspend even if canSuspendActiveDOMObjectsForDocumentSuspension() returns 'false' -
- // step-by-step JS debugging is one example.
virtual void suspendActiveDOMObjects(ReasonForSuspension);
virtual void resumeActiveDOMObjects(ReasonForSuspension);
virtual void stopActiveDOMObjects();
Modified: trunk/Source/WebCore/history/BackForwardCache.cpp (252893 => 252894)
--- trunk/Source/WebCore/history/BackForwardCache.cpp 2019-11-26 20:15:39 UTC (rev 252893)
+++ trunk/Source/WebCore/history/BackForwardCache.cpp 2019-11-27 01:53:00 UTC (rev 252894)
@@ -96,6 +96,11 @@
return false;
}
+ if (frame.document()->shouldPreventEnteringBackForwardCacheForTesting()) {
+ PCLOG(" -Back/Forward caching is disabled for testing");
+ return false;
+ }
+
if (!frame.document()->frame()) {
PCLOG(" -Document is detached from frame");
ASSERT_NOT_REACHED();
@@ -161,18 +166,6 @@
isCacheable = false;
}
- Vector<ActiveDOMObject*> unsuspendableObjects;
- if (frame.document() && !frame.document()->canSuspendActiveDOMObjectsForDocumentSuspension(&unsuspendableObjects)) {
- PCLOG(" -The document cannot suspend its active DOM Objects");
- for (auto* activeDOMObject : unsuspendableObjects) {
- PCLOG(" - Unsuspendable: ", activeDOMObject->activeDOMObjectName());
- diagnosticLoggingClient.logDiagnosticMessage(DiagnosticLoggingKeys::unsuspendableDOMObjectKey(), activeDOMObject->activeDOMObjectName(), ShouldSample::No);
- UNUSED_PARAM(activeDOMObject);
- }
- logBackForwardCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::cannotSuspendActiveDOMObjectsKey());
- isCacheable = false;
- }
-
// FIXME: We should investigating caching frames that have an associated
// application cache. <rdar://problem/5917899> tracks that work.
if (!documentLoader->applicationCacheHost().canCacheInBackForwardCache()) {
Modified: trunk/Source/WebCore/testing/Internals.cpp (252893 => 252894)
--- trunk/Source/WebCore/testing/Internals.cpp 2019-11-26 20:15:39 UTC (rev 252893)
+++ trunk/Source/WebCore/testing/Internals.cpp 2019-11-27 01:53:00 UTC (rev 252894)
@@ -580,8 +580,6 @@
}
#endif
- m_unsuspendableActiveDOMObject = nullptr;
-
#if PLATFORM(COCOA) && ENABLE(WEB_AUDIO)
AudioDestinationCocoa::createOverride = nullptr;
#endif
@@ -938,25 +936,10 @@
return BackForwardCache::singleton().pageCount();
}
-class UnsuspendableActiveDOMObject final : public ActiveDOMObject, public RefCounted<UnsuspendableActiveDOMObject> {
-public:
- static Ref<UnsuspendableActiveDOMObject> create(ScriptExecutionContext& context) { return adoptRef(*new UnsuspendableActiveDOMObject { &context }); }
-
-private:
- explicit UnsuspendableActiveDOMObject(ScriptExecutionContext* context)
- : ActiveDOMObject(context)
- {
- suspendIfNeeded();
- }
-
- bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final { return true; }
- const char* activeDOMObjectName() const { return "UnsuspendableActiveDOMObject"; }
-};
-
-void Internals::preventDocumentForEnteringBackForwardCache()
+void Internals::preventDocumentFromEnteringBackForwardCache()
{
- if (auto* context = contextDocument())
- m_unsuspendableActiveDOMObject = UnsuspendableActiveDOMObject::create(*context);
+ if (auto* document = contextDocument())
+ document->preventEnteringBackForwardCacheForTesting();
}
void Internals::disableTileSizeUpdateDelay()
Modified: trunk/Source/WebCore/testing/Internals.h (252893 => 252894)
--- trunk/Source/WebCore/testing/Internals.h 2019-11-26 20:15:39 UTC (rev 252893)
+++ trunk/Source/WebCore/testing/Internals.h 2019-11-27 01:53:00 UTC (rev 252894)
@@ -172,7 +172,7 @@
void clearBackForwardCache();
unsigned backForwardCacheSize() const;
- void preventDocumentForEnteringBackForwardCache();
+ void preventDocumentFromEnteringBackForwardCache();
void disableTileSizeUpdateDelay();
@@ -926,8 +926,6 @@
std::unique_ptr<InspectorStubFrontend> m_inspectorFrontend;
RefPtr<CacheStorageConnection> m_cacheStorageConnection;
-
- RefPtr<UnsuspendableActiveDOMObject> m_unsuspendableActiveDOMObject;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/testing/Internals.idl (252893 => 252894)
--- trunk/Source/WebCore/testing/Internals.idl 2019-11-26 20:15:39 UTC (rev 252893)
+++ trunk/Source/WebCore/testing/Internals.idl 2019-11-27 01:53:00 UTC (rev 252894)
@@ -218,7 +218,7 @@
void clearBackForwardCache();
unsigned long backForwardCacheSize();
- void preventDocumentForEnteringBackForwardCache();
+ void preventDocumentFromEnteringBackForwardCache();
CSSStyleDeclaration computedStyleIncludingVisitedInfo(Element element);
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (252893 => 252894)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2019-11-26 20:15:39 UTC (rev 252893)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2019-11-27 01:53:00 UTC (rev 252894)
@@ -1,3 +1,13 @@
+2019-11-26 Chris Dumez <[email protected]>
+
+ Drop ActiveDOMObject::shouldPreventEnteringBackForwardCache_DEPRECATED()
+ https://bugs.webkit.org/show_bug.cgi?id=204626
+
+ Reviewed by Ryosuke Niwa.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _cacheabilityDictionary]):
+
2019-11-21 Daniel Bates <[email protected]>
Remove unneeded code that annotated DOMHTMLElement as conforming to UITextInputTraits protocol
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm (252893 => 252894)
--- trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm 2019-11-26 20:15:39 UTC (rev 252893)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm 2019-11-27 01:53:00 UTC (rev 252894)
@@ -2059,8 +2059,6 @@
if (auto* document = _private->coreFrame->document()) {
if (WebCore::DatabaseManager::singleton().hasOpenDatabases(*document))
[result setObject:@YES forKey:WebFrameUsesDatabases];
- if (!document->canSuspendActiveDOMObjectsForDocumentSuspension())
- [result setObject:@YES forKey:WebFrameCanSuspendActiveDOMObjects];
}
return result;