[CSS Regions] Improve the debugging infrastructure
authorabucur@adobe.com <abucur@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Apr 2014 12:30:22 +0000 (12:30 +0000)
committerabucur@adobe.com <abucur@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Apr 2014 12:30:22 +0000 (12:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132042

Reviewed by Mihnea Ovidenie.

This patch improves the debugging code for CSS Regions.

Tests: No function change. No new tests.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::showRegionsInformation): Print brackets around the region range when dumping
the render tree to the console.
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::containingRegion): Convert the ASSERT to an ASSERT_WITH_SECURITY_IMPLICATION.

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RootInlineBox.cpp

index 5a5ff19..4c71d70 100644 (file)
@@ -1,3 +1,20 @@
+2014-04-23  Andrei Bucur  <abucur@adobe.com>
+
+        [CSS Regions] Improve the debugging infrastructure
+        https://bugs.webkit.org/show_bug.cgi?id=132042
+
+        Reviewed by Mihnea Ovidenie.
+
+        This patch improves the debugging code for CSS Regions.
+
+        Tests: No function change. No new tests.
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::showRegionsInformation): Print brackets around the region range when dumping
+        the render tree to the console.
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::containingRegion): Convert the ASSERT to an ASSERT_WITH_SECURITY_IMPLICATION.
+
 2014-04-22  Ryosuke Niwa  <rniwa@webkit.org>
 
         Cursor doesn't change back to pointer when leaving the Safari window
index a00307c..59214d7 100644 (file)
@@ -1426,7 +1426,7 @@ void RenderObject::showRegionsInformation(int& printedCharacters) const
             RenderRegion* startRegion = nullptr;
             RenderRegion* endRegion = nullptr;
             flowThread->getRegionRangeForBox(box, startRegion, endRegion);
-            printedCharacters += fprintf(stderr, " Rs:%p Re:%p", startRegion, endRegion);
+            printedCharacters += fprintf(stderr, " [Rs:%p Re:%p]", startRegion, endRegion);
         }
     }
 }
index c7b8faa..76d539f 100644 (file)
@@ -218,14 +218,17 @@ void RootInlineBox::childRemoved(InlineBox* box)
 
 RenderRegion* RootInlineBox::containingRegion() const
 {
+    RenderRegion* region = m_hasContainingRegion ? containingRegionMap().get(this) : nullptr;
+
 #ifndef NDEBUG
     if (m_hasContainingRegion) {
         RenderFlowThread* flowThread = blockFlow().flowThreadContainingBlock();
         const RenderRegionList& regionList = flowThread->renderRegionList();
-        ASSERT(regionList.contains(containingRegionMap().get(this)));
+        ASSERT_WITH_SECURITY_IMPLICATION(regionList.contains(region));
     }
 #endif
-    return m_hasContainingRegion ? containingRegionMap().get(this) : nullptr;
+
+    return region;
 }
 
 void RootInlineBox::clearContainingRegion()