WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
171388
Update DOMTokenList.replace() to match the latest DOM specification
https://bugs.webkit.org/show_bug.cgi?id=171388
Summary
Update DOMTokenList.replace() to match the latest DOM specification
Chris Dumez
Reported
2017-04-27 12:48:21 PDT
Update DOMTokenList.replace() to match the latest DOM specification after: -
https://github.com/whatwg/dom/issues/442
-
https://github.com/whatwg/infra/pull/126
Test: -
https://github.com/w3c/web-platform-tests/pull/5725
Basically, (a, b, c).replace(a, c) should return (c, b) instead of (b, c).
Attachments
Patch
(13.39 KB, patch)
2017-04-27 14:51 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(13.59 KB, patch)
2017-04-27 18:39 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2017-04-27 14:51:51 PDT
Created
attachment 308450
[details]
Patch
Build Bot
Comment 2
2017-04-27 14:54:24 PDT
Attachment 308450
[details]
did not pass style-queue: ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:566: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:567: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:570: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:571: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:572: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:573: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:574: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:575: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:601: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:604: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:607: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:609: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:643: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:645: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:647: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:650: More than one command on the same line [whitespace/newline] [4] Total errors found: 16 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alex Christensen
Comment 3
2017-04-27 15:56:52 PDT
Comment on
attachment 308450
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=308450&action=review
> Source/WebCore/html/DOMTokenList.cpp:181 > + tokens.removeFirstMatching(matchesItemOrReplacement, index + 1);
Do we only want to remove the first one? Can the lists have duplicate values? Can we test this? Can we assert that there aren't duplicates?
Chris Dumez
Comment 4
2017-04-27 16:10:27 PDT
Comment on
attachment 308450
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=308450&action=review
>> Source/WebCore/html/DOMTokenList.cpp:181 >> + tokens.removeFirstMatching(matchesItemOrReplacement, index + 1); > > Do we only want to remove the first one? Can the lists have duplicate values? Can we test this? Can we assert that there aren't duplicates?
I can assert, yes. a DOMTokenList is meant to wrap an ordered set as per the spec, so there should be no duplicate.
Chris Dumez
Comment 5
2017-04-27 18:39:38 PDT
Created
attachment 308490
[details]
Patch
Chris Dumez
Comment 6
2017-04-27 18:40:09 PDT
(In reply to Chris Dumez from
comment #4
)
> Comment on
attachment 308450
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=308450&action=review
> > >> Source/WebCore/html/DOMTokenList.cpp:181 > >> + tokens.removeFirstMatching(matchesItemOrReplacement, index + 1); > > > > Do we only want to remove the first one? Can the lists have duplicate values? Can we test this? Can we assert that there aren't duplicates? > > I can assert, yes. a DOMTokenList is meant to wrap an ordered set as per the > spec, so there should be no duplicate.
I added assertions in this latest iteration.
Build Bot
Comment 7
2017-04-27 18:42:08 PDT
Attachment 308490
[details]
did not pass style-queue: ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:566: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:567: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:570: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:571: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:572: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:573: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:574: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:575: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:601: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:604: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:607: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:609: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:643: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:645: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:647: More than one command on the same line [whitespace/newline] [4] ERROR: Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:650: More than one command on the same line [whitespace/newline] [4] Total errors found: 16 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Chris Dumez
Comment 8
2017-04-28 13:52:32 PDT
Comment on
attachment 308490
[details]
Patch Clearing flags on attachment: 308490 Committed
r215943
: <
http://trac.webkit.org/changeset/215943
>
Chris Dumez
Comment 9
2017-04-28 13:52:35 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug