Title: [190732] trunk
Revision
190732
Author
[email protected]
Date
2015-10-08 10:40:09 -0700 (Thu, 08 Oct 2015)

Log Message

Add NULL check for renderBox::layer() on applying zoom level change
https://bugs.webkit.org/show_bug.cgi?id=149302
<rdar://problem/22747292>

Patch by Jiewen Tan <[email protected]> on 2015-10-08
Reviewed by Darin Adler.

Source/WebCore:

Test: fast/css/zoom-on-nested-scroll-crash.html

This is a merge of Blink r158238:
https://chromiumcodereview.appspot.com/23526081

* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):

LayoutTests:

* fast/css/zoom-on-nested-scroll-crash-expected.txt: Added.
* fast/css/zoom-on-nested-scroll-crash.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (190731 => 190732)


--- trunk/LayoutTests/ChangeLog	2015-10-08 17:35:25 UTC (rev 190731)
+++ trunk/LayoutTests/ChangeLog	2015-10-08 17:40:09 UTC (rev 190732)
@@ -1,3 +1,14 @@
+2015-10-08  Jiewen Tan  <[email protected]>
+
+        Add NULL check for renderBox::layer() on applying zoom level change
+        https://bugs.webkit.org/show_bug.cgi?id=149302
+        <rdar://problem/22747292>
+
+        Reviewed by Darin Adler.
+
+        * fast/css/zoom-on-nested-scroll-crash-expected.txt: Added.
+        * fast/css/zoom-on-nested-scroll-crash.html: Added.
+
 2015-10-08  Ryan Haddad  <[email protected]>
 
         Marking fast/events/scroll-after-click-on-tab-index.html as flaky on Mac

Added: trunk/LayoutTests/fast/css/zoom-on-nested-scroll-crash-expected.txt (0 => 190732)


--- trunk/LayoutTests/fast/css/zoom-on-nested-scroll-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/zoom-on-nested-scroll-crash-expected.txt	2015-10-08 17:40:09 UTC (rev 190732)
@@ -0,0 +1,3 @@
+Zooming in (ctrl++) should not crash. The test PASSES if it did not crash.
+
+

Added: trunk/LayoutTests/fast/css/zoom-on-nested-scroll-crash.html (0 => 190732)


--- trunk/LayoutTests/fast/css/zoom-on-nested-scroll-crash.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/zoom-on-nested-scroll-crash.html	2015-10-08 17:40:09 UTC (rev 190732)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<style>
+#elem {overflow: scroll;}
+#elem::-webkit-scrollbar {overflow: auto;}
+</style>
+<p>Zooming in (ctrl++) should not crash.
+The test PASSES if it did not crash.</p>
+<div id="elem"></div>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.eventSender)
+    eventSender.zoomPageIn();
+document.getElementById('elem').style.setProperty('zoom', 2);
+</script>

Modified: trunk/Source/WebCore/ChangeLog (190731 => 190732)


--- trunk/Source/WebCore/ChangeLog	2015-10-08 17:35:25 UTC (rev 190731)
+++ trunk/Source/WebCore/ChangeLog	2015-10-08 17:40:09 UTC (rev 190732)
@@ -1,3 +1,19 @@
+2015-10-08  Jiewen Tan  <[email protected]>
+
+        Add NULL check for renderBox::layer() on applying zoom level change
+        https://bugs.webkit.org/show_bug.cgi?id=149302
+        <rdar://problem/22747292>
+
+        Reviewed by Darin Adler.
+
+        Test: fast/css/zoom-on-nested-scroll-crash.html
+
+        This is a merge of Blink r158238:
+        https://chromiumcodereview.appspot.com/23526081
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::styleDidChange):
+
 2015-10-08  Brady Eidson  <[email protected]>
 
         Update Inspector to only work with Legacy IDB (for now).

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (190731 => 190732)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2015-10-08 17:35:25 UTC (rev 190731)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2015-10-08 17:40:09 UTC (rev 190732)
@@ -352,7 +352,7 @@
 
     // If our zoom factor changes and we have a defined scrollLeft/Top, we need to adjust that value into the
     // new zoomed coordinate space.
-    if (hasOverflowClip() && oldStyle && oldStyle->effectiveZoom() != newStyle.effectiveZoom()) {
+    if (hasOverflowClip() && oldStyle && oldStyle->effectiveZoom() != newStyle.effectiveZoom() && layer()) {
         if (int left = layer()->scrollXOffset()) {
             left = (left / oldStyle->effectiveZoom()) * newStyle.effectiveZoom();
             layer()->scrollToXOffset(left);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to