Title: [225811] trunk
- Revision
- 225811
- Author
- mmaxfi...@apple.com
- Date
- 2017-12-12 15:11:19 -0800 (Tue, 12 Dec 2017)
Log Message
IPC code doesn't understand NSDictionaries with non-NSString keys
https://bugs.webkit.org/show_bug.cgi?id=180307
<rdar://problem/35812382>
Reviewed by Alex Christensen.
Source/WebKit:
Variable fonts have a dictionary inside its descriptor which represents the values
of all the axes of the variable font. Our IPC code wasn't expecting this.
* Shared/mac/ArgumentCodersMac.mm:
(IPC::encode):
(IPC::decode):
LayoutTests:
* fast/text/variations/ipc-expected.txt: Added.
* fast/text/variations/ipc.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (225810 => 225811)
--- trunk/LayoutTests/ChangeLog 2017-12-12 23:10:00 UTC (rev 225810)
+++ trunk/LayoutTests/ChangeLog 2017-12-12 23:11:19 UTC (rev 225811)
@@ -1,3 +1,14 @@
+2017-12-12 Myles C. Maxfield <mmaxfi...@apple.com>
+
+ IPC code doesn't understand NSDictionaries with non-NSString keys
+ https://bugs.webkit.org/show_bug.cgi?id=180307
+ <rdar://problem/35812382>
+
+ Reviewed by Alex Christensen.
+
+ * fast/text/variations/ipc-expected.txt: Added.
+ * fast/text/variations/ipc.html: Added.
+
2017-12-12 Brian Burg <bb...@apple.com>
Web Inspector: add InspectorTest.expectException() and use it
Added: trunk/LayoutTests/fast/text/variations/ipc-expected.txt (0 => 225811)
--- trunk/LayoutTests/fast/text/variations/ipc-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/text/variations/ipc-expected.txt 2017-12-12 23:11:19 UTC (rev 225811)
@@ -0,0 +1,2 @@
+This makes sure that variable fonts can be sent across IPC. The test passes if there is no crash.
+Hello
Added: trunk/LayoutTests/fast/text/variations/ipc.html (0 => 225811)
--- trunk/LayoutTests/fast/text/variations/ipc.html (rev 0)
+++ trunk/LayoutTests/fast/text/variations/ipc.html 2017-12-12 23:11:19 UTC (rev 225811)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: "Boxis";
+ src: url("resources/Boxis-VF.ttf") format("truetype");
+}
+</style>
+<script>
+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();
+}
+</script>
+</head>
+<body>
+This makes sure that variable fonts can be sent across IPC. The test passes if there is no crash.
+<div style="font: 48px 'Boxis'; font-variation-settings: 'hght' 600, 'wdth' 600;"><span id="target">Hello</span></div>
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+window.addEventListener("load", test);
+</script>
+</body>
+</html>
Modified: trunk/Source/WebKit/ChangeLog (225810 => 225811)
--- trunk/Source/WebKit/ChangeLog 2017-12-12 23:10:00 UTC (rev 225810)
+++ trunk/Source/WebKit/ChangeLog 2017-12-12 23:11:19 UTC (rev 225811)
@@ -1,3 +1,18 @@
+2017-12-12 Myles C. Maxfield <mmaxfi...@apple.com>
+
+ IPC code doesn't understand NSDictionaries with non-NSString keys
+ https://bugs.webkit.org/show_bug.cgi?id=180307
+ <rdar://problem/35812382>
+
+ Reviewed by Alex Christensen.
+
+ Variable fonts have a dictionary inside its descriptor which represents the values
+ of all the axes of the variable font. Our IPC code wasn't expecting this.
+
+ * Shared/mac/ArgumentCodersMac.mm:
+ (IPC::encode):
+ (IPC::decode):
+
2017-12-12 Brent Fulgham <bfulg...@apple.com>
Unreviewed build fix after r225763.
Modified: trunk/Source/WebKit/Shared/mac/ArgumentCodersMac.mm (225810 => 225811)
--- trunk/Source/WebKit/Shared/mac/ArgumentCodersMac.mm 2017-12-12 23:10:00 UTC (rev 225810)
+++ trunk/Source/WebKit/Shared/mac/ArgumentCodersMac.mm 2017-12-12 23:11:19 UTC (rev 225811)
@@ -367,7 +367,6 @@
id key = [keys objectAtIndex:i];
id value = [values objectAtIndex:i];
ASSERT(key);
- ASSERT([key isKindOfClass:[NSString class]]);
ASSERT(value);
ASSERT(isSerializableValue(value));
@@ -375,7 +374,7 @@
if (typeFromObject(value) == NSType::Unknown)
continue;
- encode(encoder, (NSString *)key);
+ encode(encoder, key);
encode(encoder, value);
}
}
@@ -389,7 +388,7 @@
RetainPtr<NSMutableDictionary> dictionary = adoptNS([[NSMutableDictionary alloc] initWithCapacity:size]);
for (uint64_t i = 0; i < size; ++i) {
// Try to decode the key name.
- RetainPtr<NSString> key;
+ RetainPtr<id> key;
if (!decode(decoder, key))
return false;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes