Remove LayoutAssertionDisableScope after r241289
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Mar 2019 07:37:24 +0000 (07:37 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Mar 2019 07:37:24 +0000 (07:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195848

Reviewed by Antti Koivisto.

Remove LayoutAssertionDisableScope for good now that the underlying bug has been fixed in r241289.

* dom/Document.cpp:
(WebCore::isSafeToUpdateStyleOrLayout):
* dom/ScriptDisallowedScope.h:
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Deleted.
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layout):

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

Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/ScriptDisallowedScope.h
Source/WebCore/page/FrameViewLayoutContext.cpp

index d725095..491ba04 100644 (file)
@@ -1,3 +1,19 @@
+2019-03-16  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Remove LayoutAssertionDisableScope after r241289
+        https://bugs.webkit.org/show_bug.cgi?id=195848
+
+        Reviewed by Antti Koivisto.
+
+        Remove LayoutAssertionDisableScope for good now that the underlying bug has been fixed in r241289.
+
+        * dom/Document.cpp:
+        (WebCore::isSafeToUpdateStyleOrLayout):
+        * dom/ScriptDisallowedScope.h:
+        (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Deleted.
+        * page/FrameViewLayoutContext.cpp:
+        (WebCore::FrameViewLayoutContext::layout):
+
 2019-03-15  Eric Carlson  <eric.carlson@apple.com>
 
         Add media stream release logging
index a0c2d51..2c317a0 100644 (file)
@@ -333,8 +333,6 @@ using namespace WTF::Unicode;
 static const unsigned cMaxWriteRecursionDepth = 21;
 bool Document::hasEverCreatedAnAXObjectCache = false;
 
-unsigned ScriptDisallowedScope::LayoutAssertionDisableScope::s_layoutAssertionDisableCount = 0;
-
 // DOM Level 2 says (letters added):
 //
 // a) Name start characters must have one of the categories Ll, Lu, Lo, Lt, Nl.
@@ -2031,8 +2029,7 @@ static bool isSafeToUpdateStyleOrLayout(const Document& document)
     bool isSafeToExecuteScript = ScriptDisallowedScope::InMainThread::isScriptAllowed();
     auto* frameView = document.view();
     bool isInFrameFlattening = frameView && frameView->isInChildFrameWithFrameFlattening();
-    bool isAssertionDisabled = ScriptDisallowedScope::LayoutAssertionDisableScope::shouldDisable();
-    return isSafeToExecuteScript || isInFrameFlattening || !isInWebProcess() || isAssertionDisabled;
+    return isSafeToExecuteScript || isInFrameFlattening || !isInWebProcess();
 }
 
 bool Document::updateStyleIfNeeded()
index 873bebf..9d5ec69 100644 (file)
@@ -162,25 +162,6 @@ public:
         unsigned m_originalCount { 0 };
     };
 
-    // FIXME: Remove all uses of this class.
-    class LayoutAssertionDisableScope {
-    public:
-        LayoutAssertionDisableScope()
-        {
-            s_layoutAssertionDisableCount++;
-        }
-
-        ~LayoutAssertionDisableScope()
-        {
-            s_layoutAssertionDisableCount--;
-        }
-
-        static bool shouldDisable() { return s_layoutAssertionDisableCount; }
-
-    private:
-        static unsigned s_layoutAssertionDisableCount;
-    };
-
 private:
     WEBCORE_EXPORT static unsigned s_count;
 };
index 32427e1..fb46bb5 100644 (file)
@@ -148,7 +148,7 @@ void FrameViewLayoutContext::layout()
 {
     LOG_WITH_STREAM(Layout, stream << "FrameView " << &view() << " FrameViewLayoutContext::layout() with size " << view().layoutSize());
 
-    RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!frame().document()->inRenderTreeUpdate() || ScriptDisallowedScope::LayoutAssertionDisableScope::shouldDisable());
+    RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(!frame().document()->inRenderTreeUpdate());
     ASSERT(LayoutDisallowedScope::isLayoutAllowed());
     ASSERT(!view().isPainting());
     ASSERT(frame().view() == &view());