Changeset 225779 in webkit


Ignore:
Timestamp:
Dec 12, 2017 6:29:01 AM (6 years ago)
Author:
Ms2ger@igalia.com
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:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r225776 r225779  
     12017-12-12  Ms2ger  <Ms2ger@igalia.com>
     2
     3        Implement {DOMMimeTypeArray, DOMPluginArray}::supportedPropertyNames().
     4        https://bugs.webkit.org/show_bug.cgi?id=180471
     5
     6        Reviewed by Darin Adler.
     7
     8        Remove failure expectation for test that now matches the expectation file.
     9
     10        * platform/gtk/TestExpectations:
     11
    1122017-12-11  Manuel Rego Casasnovas  <rego@igalia.com>
    213
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r225776 r225779  
     12017-12-12  Ms2ger  <Ms2ger@igalia.com>
     2
     3        Implement {DOMMimeTypeArray, DOMPluginArray}::supportedPropertyNames().
     4        https://bugs.webkit.org/show_bug.cgi?id=180471
     5
     6        Reviewed by Darin Adler.
     7
     8        Update test expectation. It will now work better if "WebKit built-in PDF"
     9        is not present or not the only available plugin.
     10
     11        * web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray-expected.txt:
     12
    1132017-12-11  Manuel Rego Casasnovas  <rego@igalia.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray-expected.txt

    r222307 r225779  
    11
    2 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"]
     2PASS Tests that named properties are not enumerable in navigator.plugins and navigator.mimeTypes
    33FAIL 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]"
    44PASS Tests that navigator.plugins and navigator.mimeTypes does not return the same object on different frames.
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r225678 r225779  
    32343234webkit.org/b/143702 media/progress-events-generated-correctly.html [ Failure Pass ]
    32353235
    3236 webkit.org/b/173413 imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray.html [ Failure ]
    3237 
    32383236webkit.org/b/174460 fast/canvas/canvas-blend-image.html [ Failure ]
    32393237webkit.org/b/174460 fast/canvas/canvas-blend-solid.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r225778 r225779  
     12017-12-12  Ms2ger  <Ms2ger@igalia.com>
     2
     3        Implement {DOMMimeTypeArray, DOMPluginArray}::supportedPropertyNames().
     4        https://bugs.webkit.org/show_bug.cgi?id=180471
     5
     6        Reviewed by Darin Adler.
     7
     8        Test: imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray.html
     9
     10        * plugins/DOMMimeTypeArray.cpp:
     11        (WebCore::DOMMimeTypeArray::supportedPropertyNames):
     12        * plugins/DOMPluginArray.cpp:
     13        (WebCore::DOMPluginArray::supportedPropertyNames):
     14
    1152017-12-12  Yusuke Suzuki  <utatane.tea@gmail.com>
    216
  • trunk/Source/WebCore/plugins/DOMMimeTypeArray.cpp

    r223728 r225779  
    8181Vector<AtomicString> DOMMimeTypeArray::supportedPropertyNames()
    8282{
    83     // FIXME: Should be implemented.
    84     return Vector<AtomicString>();
     83    PluginData* data = getPluginData();
     84    if (!data)
     85        return { };
     86
     87    Vector<MimeClassInfo> mimes;
     88    Vector<size_t> mimePluginIndices;
     89    data->getWebVisibleMimesAndPluginIndices(mimes, mimePluginIndices);
     90
     91    Vector<AtomicString> result;
     92    result.reserveInitialCapacity(mimes.size());
     93    for (auto& info : mimes)
     94        result.uncheckedAppend(WTFMove(info.type));
     95
     96    return result;
    8597}
    8698
  • trunk/Source/WebCore/plugins/DOMPluginArray.cpp

    r223728 r225779  
    7272Vector<AtomicString> DOMPluginArray::supportedPropertyNames()
    7373{
    74     // FIXME: Should be implemented.
    75     return Vector<AtomicString>();
     74    PluginData* data = pluginData();
     75    if (!data)
     76        return { };
     77
     78    const auto& plugins = data->publiclyVisiblePlugins();
     79
     80    Vector<AtomicString> result;
     81    result.reserveInitialCapacity(plugins.size());
     82    for (auto& plugin : plugins)
     83        result.uncheckedAppend(plugin.name);
     84
     85    return result;
    7686}
    7787
Note: See TracChangeset for help on using the changeset viewer.