Changeset 261399 in webkit


Ignore:
Timestamp:
May 8, 2020, 10:57:54 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Fix urlsearchparams-delete.html
https://bugs.webkit.org/show_bug.cgi?id=211456

Patch by Rob Buis <rbuis@igalia.com> on 2020-05-08
Reviewed by Daniel Bates.

LayoutTests/imported/w3c:

Update improved test expectation.

  • web-platform-tests/url/urlsearchparams-delete-expected.txt:

Source/WebCore:

Step 2 of URLSearchParams.delete algorithm [1] indicates
we should run the update steps, even if no name-value
pairs were removed.

Behavior matches Chrome and Firefox.

[1] https://url.spec.whatwg.org/#dom-urlsearchparams-delete

Test: web-platform-tests/url/urlsearchparams-delete.html

  • html/URLSearchParams.cpp:

(WebCore::URLSearchParams::remove):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r261235 r261399  
     12020-05-08  Rob Buis  <rbuis@igalia.com>
     2
     3        Fix urlsearchparams-delete.html
     4        https://bugs.webkit.org/show_bug.cgi?id=211456
     5
     6        Reviewed by Daniel Bates.
     7
     8        Update improved test expectation.
     9
     10        * web-platform-tests/url/urlsearchparams-delete-expected.txt:
     11
    1122020-05-06  Alexey Shvayka  <shvaikalesh@gmail.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-delete-expected.txt

    r222307 r261399  
    33PASS Deleting appended multiple
    44PASS Deleting all params removes ? from URL
    5 FAIL Removing non-existent param removes ? from URL assert_equals: url.href does not have ? expected "http://example.com/" but got "http://example.com/?"
     5PASS Removing non-existent param removes ? from URL
    66
  • trunk/Source/WebCore/ChangeLog

    r261398 r261399  
     12020-05-08  Rob Buis  <rbuis@igalia.com>
     2
     3        Fix urlsearchparams-delete.html
     4        https://bugs.webkit.org/show_bug.cgi?id=211456
     5
     6        Reviewed by Daniel Bates.
     7
     8        Step 2 of URLSearchParams.delete algorithm [1] indicates
     9        we should run the update steps, even if no name-value
     10        pairs were removed.
     11
     12        Behavior matches Chrome and Firefox.
     13
     14        [1] https://url.spec.whatwg.org/#dom-urlsearchparams-delete
     15
     16        Test: web-platform-tests/url/urlsearchparams-delete.html
     17
     18        * html/URLSearchParams.cpp:
     19        (WebCore::URLSearchParams::remove):
     20
    1212020-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
    222
  • trunk/Source/WebCore/html/URLSearchParams.cpp

    r239427 r261399  
    128128void URLSearchParams::remove(const String& name)
    129129{
    130     if (m_pairs.removeAllMatching([&] (const auto& pair) { return pair.key == name; }))
    131         updateURL();
     130    m_pairs.removeAllMatching([&] (const auto& pair) {
     131        return pair.key == name;
     132    });
     133    updateURL();
    132134}
    133135
Note: See TracChangeset for help on using the changeset viewer.