Null dereference loading Blink layout test scrollbars/custom-scrollbar-appearance...
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Nov 2015 00:05:21 +0000 (00:05 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Nov 2015 00:05:21 +0000 (00:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=149312
<rdar://problem/22748910>

Reviewed by Darin Adler.

Source/WebCore:

This is a merge from Blink r167503:
https://codereview.chromium.org/173433002

Test: scrollbars/custom-scrollbar-appearance-property.html

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):

LayoutTests:

* scrollbars/custom-scrollbar-appearance-property-expected.txt: Added.
* scrollbars/custom-scrollbar-appearance-property.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/scrollbars/custom-scrollbar-appearance-property-expected.txt [new file with mode: 0644]
LayoutTests/scrollbars/custom-scrollbar-appearance-property.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderThemeMac.mm

index 914081b..ba4afd5 100644 (file)
@@ -1,3 +1,14 @@
+2015-11-03  Jiewen Tan  <jiewen_tan@apple.com>
+
+        Null dereference loading Blink layout test scrollbars/custom-scrollbar-appearance-property.html
+        https://bugs.webkit.org/show_bug.cgi?id=149312
+        <rdar://problem/22748910>
+
+        Reviewed by Darin Adler.
+
+        * scrollbars/custom-scrollbar-appearance-property-expected.txt: Added.
+        * scrollbars/custom-scrollbar-appearance-property.html: Added.
+
 2015-11-03  Ryan Haddad  <ryanhaddad@apple.com>
 
         Correcting win test expectation for flaky test fast/text/multiple-feature-properties.html
diff --git a/LayoutTests/scrollbars/custom-scrollbar-appearance-property-expected.txt b/LayoutTests/scrollbars/custom-scrollbar-appearance-property-expected.txt
new file mode 100644 (file)
index 0000000..fbc7ebe
--- /dev/null
@@ -0,0 +1,2 @@
+PASS, WebKit didn't crash.
+
diff --git a/LayoutTests/scrollbars/custom-scrollbar-appearance-property.html b/LayoutTests/scrollbars/custom-scrollbar-appearance-property.html
new file mode 100644 (file)
index 0000000..73171c7
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+::-webkit-scrollbar {
+    width: 16px;
+    height: 16px;
+    -webkit-appearance: searchfield-results-decoration;
+}
+
+::-webkit-scrollbar-track {
+    background-color: #E3E3E3;
+    -webkit-appearance: searchfield-cancel-button;
+}
+
+::-webkit-scrollbar-thumb {
+    background: black;
+}
+
+.scroll-container {
+    overflow: scroll;
+    width: 50px;
+    height: 50px;
+}
+
+.overflowing {
+    width: 200px;
+    height: 200px;
+}
+</style>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+</head>
+<body>
+PASS, WebKit didn't crash.
+<div class="scroll-container"><div class="overflowing"></div></div>
+</body>
+</html>
index 9ae2d92..dd93eb0 100644 (file)
@@ -1,3 +1,20 @@
+2015-11-03  Jiewen Tan  <jiewen_tan@apple.com>
+
+        Null dereference loading Blink layout test scrollbars/custom-scrollbar-appearance-property.html
+        https://bugs.webkit.org/show_bug.cgi?id=149312
+        <rdar://problem/22748910>
+
+        Reviewed by Darin Adler.
+
+        This is a merge from Blink r167503:
+        https://codereview.chromium.org/173433002
+
+        Test: scrollbars/custom-scrollbar-appearance-property.html
+
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
+        (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
+
 2015-11-03  Andreas Kling  <akling@apple.com>
 
         ResourceUsageOverlay should show GC-owned malloc memory.
index 2b75588..92af0cf 100644 (file)
@@ -1689,6 +1689,8 @@ void RenderThemeMac::adjustSearchFieldStyle(StyleResolver& styleResolver, Render
 
 bool RenderThemeMac::paintSearchFieldCancelButton(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
+    if (!o.node())
+        return false;
     Element* input = o.node()->shadowHost();
     if (!input)
         input = downcast<Element>(o.node());
@@ -1771,6 +1773,8 @@ void RenderThemeMac::adjustSearchFieldResultsDecorationPartStyle(StyleResolver&,
 
 bool RenderThemeMac::paintSearchFieldResultsDecorationPart(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
+    if (!o.node())
+        return false;
     Node* input = o.node()->shadowHost();
     if (!input)
         input = o.node();