Title: [236134] releases/WebKitGTK/webkit-2.22
Revision
236134
Author
carlo...@webkit.org
Date
2018-09-18 08:39:55 -0700 (Tue, 18 Sep 2018)

Log Message

Merge r235602 - REGRESSION: Layout Test http/tests/security/bypassing-cors-checks-for-extension-urls.html is Flaky
https://bugs.webkit.org/show_bug.cgi?id=187658
<rdar://problem/42306442>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Test is flaky as a previous test was setting the isRunningUserScripts state on the Page and it was never reset.
This patch moves this state to the topDocument so that it will be reset for every navigation.
Covered by existing test being no longer flaky.

* dom/Document.h:
(WebCore::Document::setAsRunningUserScripts):
(WebCore::Document::isRunningUserScripts const):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
* page/Frame.cpp:
(WebCore::Frame::injectUserScriptImmediately):
* page/Page.h:
(WebCore::Page::setAsRunningUserScripts): Deleted.
(WebCore::Page::isRunningUserScripts const): Deleted.
* testing/Internals.cpp:
(WebCore::Internals::setAsRunningUserScripts):

LayoutTests:

* platform/mac-wk2/TestExpectations:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.22/LayoutTests/ChangeLog (236133 => 236134)


--- releases/WebKitGTK/webkit-2.22/LayoutTests/ChangeLog	2018-09-18 15:39:47 UTC (rev 236133)
+++ releases/WebKitGTK/webkit-2.22/LayoutTests/ChangeLog	2018-09-18 15:39:55 UTC (rev 236134)
@@ -1,3 +1,13 @@
+2018-09-03  Youenn Fablet  <you...@apple.com>
+
+        REGRESSION: Layout Test http/tests/security/bypassing-cors-checks-for-extension-urls.html is Flaky
+        https://bugs.webkit.org/show_bug.cgi?id=187658
+        <rdar://problem/42306442>
+
+        Reviewed by Alexey Proskuryakov.
+
+        * platform/mac-wk2/TestExpectations:
+
 2018-09-02  Zalan Bujtas  <za...@apple.com>
 
         REGRESSION (r191336): RenderFlexibleBox::adjustChildSizeForMinAndMax crashes in std::optional<>::value()

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog (236133 => 236134)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog	2018-09-18 15:39:47 UTC (rev 236133)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog	2018-09-18 15:39:55 UTC (rev 236134)
@@ -1,3 +1,28 @@
+2018-09-03  Youenn Fablet  <you...@apple.com>
+
+        REGRESSION: Layout Test http/tests/security/bypassing-cors-checks-for-extension-urls.html is Flaky
+        https://bugs.webkit.org/show_bug.cgi?id=187658
+        <rdar://problem/42306442>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Test is flaky as a previous test was setting the isRunningUserScripts state on the Page and it was never reset.
+        This patch moves this state to the topDocument so that it will be reset for every navigation.
+        Covered by existing test being no longer flaky.
+
+        * dom/Document.h:
+        (WebCore::Document::setAsRunningUserScripts):
+        (WebCore::Document::isRunningUserScripts const):
+        * loader/DocumentThreadableLoader.cpp:
+        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
+        * page/Frame.cpp:
+        (WebCore::Frame::injectUserScriptImmediately):
+        * page/Page.h:
+        (WebCore::Page::setAsRunningUserScripts): Deleted.
+        (WebCore::Page::isRunningUserScripts const): Deleted.
+        * testing/Internals.cpp:
+        (WebCore::Internals::setAsRunningUserScripts):
+
 2018-09-02  Zalan Bujtas  <za...@apple.com>
 
         REGRESSION (r191336): RenderFlexibleBox::adjustChildSizeForMinAndMax crashes in std::optional<>::value()

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/dom/Document.h (236133 => 236134)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/dom/Document.h	2018-09-18 15:39:47 UTC (rev 236133)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/dom/Document.h	2018-09-18 15:39:55 UTC (rev 236134)
@@ -1480,6 +1480,9 @@
     void updateMainArticleElementAfterLayout();
     bool hasMainArticleElement() const { return !!m_mainArticleElement; }
 
+    void setAsRunningUserScripts() { m_isRunningUserScripts = true; }
+    bool isRunningUserScripts() const { return m_isRunningUserScripts; }
+
 protected:
     enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 };
     Document(Frame*, const URL&, unsigned = DefaultDocumentClass, unsigned constructionFlags = 0);
@@ -1998,6 +2001,8 @@
 #endif
     
     std::unique_ptr<UserGestureIndicator> m_temporaryUserGesture;
+
+    bool m_isRunningUserScripts { false };
 };
 
 Element* eventTargetElementForDocument(Document*);

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/loader/DocumentThreadableLoader.cpp (236133 => 236134)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/loader/DocumentThreadableLoader.cpp	2018-09-18 15:39:47 UTC (rev 236133)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/loader/DocumentThreadableLoader.cpp	2018-09-18 15:39:55 UTC (rev 236134)
@@ -146,7 +146,7 @@
     if (shouldSetHTTPHeadersToKeep())
         m_options.httpHeadersToKeep = httpHeadersToKeepFromCleaning(request.httpHeaderFields());
 
-    if (document.page() && document.page()->isRunningUserScripts() && SchemeRegistry::isUserExtensionScheme(request.url().protocol().toStringWithoutCopying())) {
+    if (document.topDocument().isRunningUserScripts() && SchemeRegistry::isUserExtensionScheme(request.url().protocol().toStringWithoutCopying())) {
         m_options.mode = FetchOptions::Mode::NoCors;
         m_options.filteringPolicy = ResponseFilteringPolicy::Disable;
     }

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/page/Frame.cpp (236133 => 236134)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/page/Frame.cpp	2018-09-18 15:39:47 UTC (rev 236133)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/page/Frame.cpp	2018-09-18 15:39:55 UTC (rev 236134)
@@ -749,8 +749,8 @@
         return;
     if (!UserContentURLPattern::matchesPatterns(document->url(), script.whitelist(), script.blacklist()))
         return;
-    if (m_page)
-        m_page->setAsRunningUserScripts();
+
+    document->topDocument().setAsRunningUserScripts();
     loader().client().willInjectUserScript(world);
     m_script->evaluateInWorld(ScriptSourceCode(script.source(), script.url()), world);
 }

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/page/Page.h (236133 => 236134)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/page/Page.h	2018-09-18 15:39:47 UTC (rev 236133)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/page/Page.h	2018-09-18 15:39:55 UTC (rev 236134)
@@ -453,9 +453,6 @@
     void setResourceUsageOverlayVisible(bool);
 #endif
 
-    void setAsRunningUserScripts() { m_isRunningUserScripts = true; }
-    bool isRunningUserScripts() const { return m_isRunningUserScripts; }
-
     void setDebugger(JSC::Debugger*);
     JSC::Debugger* debugger() const { return m_debugger; }
 
@@ -908,7 +905,6 @@
     std::optional<ApplicationManifest> m_applicationManifest;
 #endif
 
-    bool m_isRunningUserScripts { false };
     bool m_shouldEnableICECandidateFilteringByDefault { true };
 };
 

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/testing/Internals.cpp (236133 => 236134)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/testing/Internals.cpp	2018-09-18 15:39:47 UTC (rev 236133)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/testing/Internals.cpp	2018-09-18 15:39:55 UTC (rev 236134)
@@ -4316,8 +4316,7 @@
 
 void Internals::setAsRunningUserScripts(Document& document)
 {
-    if (document.page())
-        document.page()->setAsRunningUserScripts();
+    document.topDocument().setAsRunningUserScripts();
 }
 
 #if ENABLE(WEBGL)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to