ASSERTION FAILED: count >= 1 in WebCore::RenderMultiColumnSet::columnCount
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Dec 2016 23:21:27 +0000 (23:21 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Dec 2016 23:21:27 +0000 (23:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136365
<rdar://problem/27686727>

Reviewed by Simon Fraser.

Source/WebCore:

Margin value overflow ends up confusing the column count computing logic.

Test: fast/multicol/assert-on-column-count-when-zoomed-in.html

* css/StyleResolver.cpp:
(WebCore::addIntrinsicMargins):

LayoutTests:

* fast/multicol/assert-on-column-count-when-zoomed-in-expected.txt: Added.
* fast/multicol/assert-on-column-count-when-zoomed-in.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/multicol/assert-on-column-count-when-zoomed-in-expected.txt [new file with mode: 0644]
LayoutTests/fast/multicol/assert-on-column-count-when-zoomed-in.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/StyleResolver.cpp

index cf71592..452637f 100644 (file)
@@ -1,3 +1,14 @@
+2016-12-07  Zalan Bujtas  <zalan@apple.com>
+
+        ASSERTION FAILED: count >= 1 in WebCore::RenderMultiColumnSet::columnCount
+        https://bugs.webkit.org/show_bug.cgi?id=136365
+        <rdar://problem/27686727>
+
+        Reviewed by Simon Fraser.
+
+        * fast/multicol/assert-on-column-count-when-zoomed-in-expected.txt: Added.
+        * fast/multicol/assert-on-column-count-when-zoomed-in.html: Added.
+
 2016-12-07  Ryosuke Niwa  <rniwa@webkit.org>
 
         document.caretRangeFromPoint doesn't retarget the resultant Range correctly.
diff --git a/LayoutTests/fast/multicol/assert-on-column-count-when-zoomed-in-expected.txt b/LayoutTests/fast/multicol/assert-on-column-count-when-zoomed-in-expected.txt
new file mode 100644 (file)
index 0000000..34a3f4e
--- /dev/null
@@ -0,0 +1 @@
+PASS if no assert in debug. 
diff --git a/LayoutTests/fast/multicol/assert-on-column-count-when-zoomed-in.html b/LayoutTests/fast/multicol/assert-on-column-count-when-zoomed-in.html
new file mode 100644 (file)
index 0000000..77b7935
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we don't assert on huge zoom values for columns.</title>
+<style>
+* {
+    column-count: 2;
+    zoom: 8017;
+}
+</style>
+</head>
+<body>
+PASS if no assert in debug.
+<button></button>
+<script>
+if (window.testRunner)
+  testRunner.dumpAsText()
+</script>
+</body>
+</html>
index 03570b6..733313a 100644 (file)
@@ -1,3 +1,18 @@
+2016-12-07  Zalan Bujtas  <zalan@apple.com>
+
+        ASSERTION FAILED: count >= 1 in WebCore::RenderMultiColumnSet::columnCount
+        https://bugs.webkit.org/show_bug.cgi?id=136365
+        <rdar://problem/27686727>
+
+        Reviewed by Simon Fraser.
+
+        Margin value overflow ends up confusing the column count computing logic.
+
+        Test: fast/multicol/assert-on-column-count-when-zoomed-in.html
+
+        * css/StyleResolver.cpp:
+        (WebCore::addIntrinsicMargins):
+
 2016-12-07  Ryosuke Niwa  <rniwa@webkit.org>
 
         document.caretRangeFromPoint doesn't retarget the resultant Range correctly.
index b6055cc..b8955a9 100644 (file)
@@ -701,7 +701,7 @@ std::unique_ptr<RenderStyle> StyleResolver::defaultStyleForElement()
 static void addIntrinsicMargins(RenderStyle& style)
 {
     // Intrinsic margin value.
-    const int intrinsicMargin = 2 * style.effectiveZoom();
+    const int intrinsicMargin = clampToInteger(2 * style.effectiveZoom());
 
     // FIXME: Using width/height alone and not also dealing with min-width/max-width is flawed.
     // FIXME: Using "hasQuirk" to decide the margin wasn't set is kind of lame.