Title: [225779] trunk
Revision
225779
Author
ms2...@igalia.com
Date
2017-12-12 06:29:01 -0800 (Tue, 12 Dec 2017)

Log Message

Implement {DOMMimeTypeArray, DOMPluginArray}::supportedPropertyNames().
https://bugs.webkit.org/show_bug.cgi?id=180471

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Update test expectation. It will now work better if "WebKit built-in PDF"
is not present or not the only available plugin.

* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray-expected.txt:

Source/WebCore:

Test: imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray.html

* plugins/DOMMimeTypeArray.cpp:
(WebCore::DOMMimeTypeArray::supportedPropertyNames):
* plugins/DOMPluginArray.cpp:
(WebCore::DOMPluginArray::supportedPropertyNames):

LayoutTests:

Remove failure expectation for test that now matches the expectation file.

* platform/gtk/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (225778 => 225779)


--- trunk/LayoutTests/ChangeLog	2017-12-12 10:35:39 UTC (rev 225778)
+++ trunk/LayoutTests/ChangeLog	2017-12-12 14:29:01 UTC (rev 225779)
@@ -1,3 +1,14 @@
+2017-12-12  Ms2ger  <ms2...@igalia.com>
+
+        Implement {DOMMimeTypeArray, DOMPluginArray}::supportedPropertyNames().
+        https://bugs.webkit.org/show_bug.cgi?id=180471
+
+        Reviewed by Darin Adler.
+
+        Remove failure expectation for test that now matches the expectation file.
+
+        * platform/gtk/TestExpectations:
+
 2017-12-11  Manuel Rego Casasnovas  <r...@igalia.com>
 
         [css-grid] Automatic minimum size is not clamped if min track sizing function is auto

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (225778 => 225779)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2017-12-12 10:35:39 UTC (rev 225778)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2017-12-12 14:29:01 UTC (rev 225779)
@@ -1,3 +1,15 @@
+2017-12-12  Ms2ger  <ms2...@igalia.com>
+
+        Implement {DOMMimeTypeArray, DOMPluginArray}::supportedPropertyNames().
+        https://bugs.webkit.org/show_bug.cgi?id=180471
+
+        Reviewed by Darin Adler.
+
+        Update test expectation. It will now work better if "WebKit built-in PDF"
+        is not present or not the only available plugin.
+
+        * web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray-expected.txt:
+
 2017-12-11  Manuel Rego Casasnovas  <r...@igalia.com>
 
         [css-grid] Automatic minimum size is not clamped if min track sizing function is auto

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray-expected.txt (225778 => 225779)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray-expected.txt	2017-12-12 10:35:39 UTC (rev 225778)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray-expected.txt	2017-12-12 14:29:01 UTC (rev 225779)
@@ -1,5 +1,5 @@
 
-FAIL Tests that named properties are not enumerable in navigator.plugins and navigator.mimeTypes assert_in_array: value "WebKit built-in PDF" not in array ["0"]
+PASS Tests that named properties are not enumerable in navigator.plugins and navigator.mimeTypes 
 FAIL Tests that navigator.plugins and navigator.mimeTypes returns the same object when queried multiple times. assert_equals: expected object "[object Plugin]" but got object "[object Plugin]"
 PASS Tests that navigator.plugins and navigator.mimeTypes does not return the same object on different frames. 
 FAIL Tests that navigator.plugins and navigator.mimeTypes returns plugins sorted in alphabetical order by plugin name. assert_less_than_equal: expected a number less than or equal to 0 but got 1

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (225778 => 225779)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2017-12-12 10:35:39 UTC (rev 225778)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2017-12-12 14:29:01 UTC (rev 225779)
@@ -3233,8 +3233,6 @@
 
 webkit.org/b/143702 media/progress-events-generated-correctly.html [ Failure Pass ]
 
-webkit.org/b/173413 imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray.html [ Failure ]
-
 webkit.org/b/174460 fast/canvas/canvas-blend-image.html [ Failure ]
 webkit.org/b/174460 fast/canvas/canvas-blend-solid.html [ Failure ]
 

Modified: trunk/Source/WebCore/ChangeLog (225778 => 225779)


--- trunk/Source/WebCore/ChangeLog	2017-12-12 10:35:39 UTC (rev 225778)
+++ trunk/Source/WebCore/ChangeLog	2017-12-12 14:29:01 UTC (rev 225779)
@@ -1,3 +1,17 @@
+2017-12-12  Ms2ger  <ms2...@igalia.com>
+
+        Implement {DOMMimeTypeArray, DOMPluginArray}::supportedPropertyNames().
+        https://bugs.webkit.org/show_bug.cgi?id=180471
+
+        Reviewed by Darin Adler.
+
+        Test: imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray.html
+
+        * plugins/DOMMimeTypeArray.cpp:
+        (WebCore::DOMMimeTypeArray::supportedPropertyNames):
+        * plugins/DOMPluginArray.cpp:
+        (WebCore::DOMPluginArray::supportedPropertyNames):
+
 2017-12-12  Yusuke Suzuki  <utatane....@gmail.com>
 
         [WTF] Thread::create should have Thread::tryCreate

Modified: trunk/Source/WebCore/plugins/DOMMimeTypeArray.cpp (225778 => 225779)


--- trunk/Source/WebCore/plugins/DOMMimeTypeArray.cpp	2017-12-12 10:35:39 UTC (rev 225778)
+++ trunk/Source/WebCore/plugins/DOMMimeTypeArray.cpp	2017-12-12 14:29:01 UTC (rev 225779)
@@ -80,8 +80,20 @@
 
 Vector<AtomicString> DOMMimeTypeArray::supportedPropertyNames()
 {
-    // FIXME: Should be implemented.
-    return Vector<AtomicString>();
+    PluginData* data = ""
+    if (!data)
+        return { };
+
+    Vector<MimeClassInfo> mimes;
+    Vector<size_t> mimePluginIndices;
+    data->getWebVisibleMimesAndPluginIndices(mimes, mimePluginIndices);
+
+    Vector<AtomicString> result;
+    result.reserveInitialCapacity(mimes.size());
+    for (auto& info : mimes)
+        result.uncheckedAppend(WTFMove(info.type));
+
+    return result;
 }
 
 PluginData* DOMMimeTypeArray::getPluginData() const

Modified: trunk/Source/WebCore/plugins/DOMPluginArray.cpp (225778 => 225779)


--- trunk/Source/WebCore/plugins/DOMPluginArray.cpp	2017-12-12 10:35:39 UTC (rev 225778)
+++ trunk/Source/WebCore/plugins/DOMPluginArray.cpp	2017-12-12 14:29:01 UTC (rev 225779)
@@ -71,8 +71,18 @@
 
 Vector<AtomicString> DOMPluginArray::supportedPropertyNames()
 {
-    // FIXME: Should be implemented.
-    return Vector<AtomicString>();
+    PluginData* data = ""
+    if (!data)
+        return { };
+
+    const auto& plugins = data->publiclyVisiblePlugins();
+
+    Vector<AtomicString> result;
+    result.reserveInitialCapacity(plugins.size());
+    for (auto& plugin : plugins)
+        result.uncheckedAppend(plugin.name);
+
+    return result;
 }
 
 void DOMPluginArray::refresh(bool reloadPages)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to