Title: [235910] trunk
Revision
235910
Author
[email protected]
Date
2018-09-11 12:30:46 -0700 (Tue, 11 Sep 2018)

Log Message

Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts
https://bugs.webkit.org/show_bug.cgi?id=188008

Reviewed by Alex Christensen.

Source/WebKit:

This patch is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=180307.
Variable fonts have CFDictionaries with non-string keys. We need to support that in our IPC code.

* Shared/cf/ArgumentCodersCF.cpp:
(IPC::encode):
(IPC::decode):

LayoutTests:

* fast/text/variations/ipc2-expected.txt: Added.
* fast/text/variations/ipc2.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (235909 => 235910)


--- trunk/LayoutTests/ChangeLog	2018-09-11 19:26:47 UTC (rev 235909)
+++ trunk/LayoutTests/ChangeLog	2018-09-11 19:30:46 UTC (rev 235910)
@@ -1,3 +1,13 @@
+2018-09-11  Myles C. Maxfield  <[email protected]>
+
+        Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts
+        https://bugs.webkit.org/show_bug.cgi?id=188008
+
+        Reviewed by Alex Christensen.
+
+        * fast/text/variations/ipc2-expected.txt: Added.
+        * fast/text/variations/ipc2.html: Added.
+
 2018-09-11  Woodrow Wang  <[email protected]>
 
         Add Web API Statistics Collection

Added: trunk/LayoutTests/fast/text/variations/ipc2-expected.txt (0 => 235910)


--- trunk/LayoutTests/fast/text/variations/ipc2-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/text/variations/ipc2-expected.txt	2018-09-11 19:30:46 UTC (rev 235910)
@@ -0,0 +1 @@
+This makes sure that variable fonts can be sent across IPC. The test passes if there is no crash. 

Added: trunk/LayoutTests/fast/text/variations/ipc2.html (0 => 235910)


--- trunk/LayoutTests/fast/text/variations/ipc2.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/variations/ipc2.html	2018-09-11 19:30:46 UTC (rev 235910)
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: "Boxis";
+    src: url("resources/Boxis-VF.ttf") format("truetype");
+}
+</style>
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+function test() {
+    let target = document.getElementById("target");
+    let x = target.offsetLeft + target.offsetWidth / 2;
+    let y = target.offsetTop + target.offsetHeight / 2;
+    if (window.eventSender) {
+        eventSender.mouseMoveTo(x, y);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+window.addEventListener("load", test);
+</script>
+</head>
+<body>
+This makes sure that variable fonts can be sent across IPC. The test passes if there is no crash.
+<select id="target" style="border:0; font-family: 'Boxis';">
+  <option>Select option</option>
+  <option>1</option>
+  <option>2</option>
+  <option>3</option>
+</select>
+</body>
+</html>

Modified: trunk/Source/WebKit/ChangeLog (235909 => 235910)


--- trunk/Source/WebKit/ChangeLog	2018-09-11 19:26:47 UTC (rev 235909)
+++ trunk/Source/WebKit/ChangeLog	2018-09-11 19:30:46 UTC (rev 235910)
@@ -1,3 +1,17 @@
+2018-09-11  Myles C. Maxfield  <[email protected]>
+
+        Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts
+        https://bugs.webkit.org/show_bug.cgi?id=188008
+
+        Reviewed by Alex Christensen.
+
+        This patch is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=180307.
+        Variable fonts have CFDictionaries with non-string keys. We need to support that in our IPC code.
+
+        * Shared/cf/ArgumentCodersCF.cpp:
+        (IPC::encode):
+        (IPC::decode):
+
 2018-09-11  Adrian Perez de Castro  <[email protected]>
 
         [WPE][GTK] API documentation is unclear about how to modify requests before sending them

Modified: trunk/Source/WebKit/Shared/cf/ArgumentCodersCF.cpp (235909 => 235910)


--- trunk/Source/WebKit/Shared/cf/ArgumentCodersCF.cpp	2018-09-11 19:26:47 UTC (rev 235909)
+++ trunk/Source/WebKit/Shared/cf/ArgumentCodersCF.cpp	2018-09-11 19:30:46 UTC (rev 235910)
@@ -427,7 +427,6 @@
 
     for (CFIndex i = 0; i < size; ++i) {
         ASSERT(keys[i]);
-        ASSERT(CFGetTypeID(keys[i]) == CFStringGetTypeID());
         ASSERT(values[i]);
 
         // Ignore values we don't recognize.
@@ -434,7 +433,7 @@
         if (typeFromCFTypeRef(values[i]) == Unknown)
             continue;
 
-        encode(encoder, static_cast<CFStringRef>(keys[i]));
+        encode(encoder, keys[i]);
         encode(encoder, values[i]);
     }
 }
@@ -456,7 +455,7 @@
     RetainPtr<CFMutableDictionaryRef> dictionary = adoptCF(CFDictionaryCreateMutable(0, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
     for (uint64_t i = 0; i < size; ++i) {
         // Try to decode the key name.
-        RetainPtr<CFStringRef> key;
+        RetainPtr<CFTypeRef> key;
         if (!decode(decoder, key))
             return false;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to