Changeset 229566 in webkit
- Timestamp:
- Mar 12, 2018 6:37:23 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r229559 r229566 1 2018-03-12 Chris Dumez <cdumez@apple.com> 2 3 Return boolean from DOMTokenList's replace() method 4 https://bugs.webkit.org/show_bug.cgi?id=183567 5 6 Reviewed by Youenn Fablet. 7 8 Rebaseline web platform test now that all checks are passing. 9 10 * web-platform-tests/dom/nodes/Element-classlist-expected.txt: 11 1 12 2018-03-12 Ryan Haddad <ryanhaddad@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-classlist-expected.txt
r229544 r229566 259 259 PASS classList.replace("b", " a") with attribute value null (HTML node) 260 260 PASS classList.replace("b", "a ") with attribute value null (HTML node) 261 FAIL classList.replace("a", "a") with attribute value "a" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 262 FAIL classList.replace("a", "b") with attribute value "a" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 263 FAIL classList.replace("A", "b") with attribute value "a" (HTML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 264 FAIL classList.replace("b", "A") with attribute value "a b" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 265 FAIL classList.replace("c", "a") with attribute value "a b" (HTML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 266 FAIL classList.replace("d", "e") with attribute value "a b c" (HTML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 267 FAIL classList.replace("a", "a") with attribute value "a a a b" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 268 FAIL classList.replace("c", "d") with attribute value "a a a b" (HTML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 269 FAIL classList.replace("a", "b") with attribute value null (HTML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 270 FAIL classList.replace("a", "b") with attribute value "" (HTML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 271 FAIL classList.replace("a", "b") with attribute value " " (HTML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 272 FAIL classList.replace("a", "b") with attribute value " a \f" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 273 FAIL classList.replace("b", "d") with attribute value "a b c" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 274 FAIL classList.replace("c", "a") with attribute value "a b c" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 275 FAIL classList.replace("c", "a") with attribute value "c b a" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 276 FAIL classList.replace("a", "c") with attribute value "a b a" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 277 FAIL classList.replace("b", "c") with attribute value "a b a" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 278 FAIL classList.replace("a", "c") with attribute value " a a b" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 279 FAIL classList.replace("b", "c") with attribute value " a a b" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 280 FAIL classList.replace("a", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 281 FAIL classList.replace("b", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 282 FAIL classList.replace(null, "b") with attribute value "a null" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 283 FAIL classList.replace("a", null) with attribute value "a b" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 284 FAIL classList.replace(undefined, "b") with attribute value "a undefined" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 285 FAIL classList.replace("a", undefined) with attribute value "a b" (HTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 261 PASS classList.replace("a", "a") with attribute value "a" (HTML node) 262 PASS classList.replace("a", "b") with attribute value "a" (HTML node) 263 PASS classList.replace("A", "b") with attribute value "a" (HTML node) 264 PASS classList.replace("b", "A") with attribute value "a b" (HTML node) 265 PASS classList.replace("c", "a") with attribute value "a b" (HTML node) 266 PASS classList.replace("d", "e") with attribute value "a b c" (HTML node) 267 PASS classList.replace("a", "a") with attribute value "a a a b" (HTML node) 268 PASS classList.replace("c", "d") with attribute value "a a a b" (HTML node) 269 PASS classList.replace("a", "b") with attribute value null (HTML node) 270 PASS classList.replace("a", "b") with attribute value "" (HTML node) 271 PASS classList.replace("a", "b") with attribute value " " (HTML node) 272 PASS classList.replace("a", "b") with attribute value " a \f" (HTML node) 273 PASS classList.replace("b", "d") with attribute value "a b c" (HTML node) 274 PASS classList.replace("c", "a") with attribute value "a b c" (HTML node) 275 PASS classList.replace("c", "a") with attribute value "c b a" (HTML node) 276 PASS classList.replace("a", "c") with attribute value "a b a" (HTML node) 277 PASS classList.replace("b", "c") with attribute value "a b a" (HTML node) 278 PASS classList.replace("a", "c") with attribute value " a a b" (HTML node) 279 PASS classList.replace("b", "c") with attribute value " a a b" (HTML node) 280 PASS classList.replace("a", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (HTML node) 281 PASS classList.replace("b", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (HTML node) 282 PASS classList.replace(null, "b") with attribute value "a null" (HTML node) 283 PASS classList.replace("a", null) with attribute value "a b" (HTML node) 284 PASS classList.replace(undefined, "b") with attribute value "a undefined" (HTML node) 285 PASS classList.replace("a", undefined) with attribute value "a b" (HTML node) 286 286 PASS Assigning to classList (XHTML node) 287 287 PASS .supports() must throw TypeError (XHTML node) … … 543 543 PASS classList.replace("b", " a") with attribute value null (XHTML node) 544 544 PASS classList.replace("b", "a ") with attribute value null (XHTML node) 545 FAIL classList.replace("a", "a") with attribute value "a" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 546 FAIL classList.replace("a", "b") with attribute value "a" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 547 FAIL classList.replace("A", "b") with attribute value "a" (XHTML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 548 FAIL classList.replace("b", "A") with attribute value "a b" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 549 FAIL classList.replace("c", "a") with attribute value "a b" (XHTML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 550 FAIL classList.replace("d", "e") with attribute value "a b c" (XHTML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 551 FAIL classList.replace("a", "a") with attribute value "a a a b" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 552 FAIL classList.replace("c", "d") with attribute value "a a a b" (XHTML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 553 FAIL classList.replace("a", "b") with attribute value null (XHTML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 554 FAIL classList.replace("a", "b") with attribute value "" (XHTML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 555 FAIL classList.replace("a", "b") with attribute value " " (XHTML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 556 FAIL classList.replace("a", "b") with attribute value " a \f" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 557 FAIL classList.replace("b", "d") with attribute value "a b c" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 558 FAIL classList.replace("c", "a") with attribute value "a b c" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 559 FAIL classList.replace("c", "a") with attribute value "c b a" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 560 FAIL classList.replace("a", "c") with attribute value "a b a" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 561 FAIL classList.replace("b", "c") with attribute value "a b a" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 562 FAIL classList.replace("a", "c") with attribute value " a a b" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 563 FAIL classList.replace("b", "c") with attribute value " a a b" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 564 FAIL classList.replace("a", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 565 FAIL classList.replace("b", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 566 FAIL classList.replace(null, "b") with attribute value "a null" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 567 FAIL classList.replace("a", null) with attribute value "a b" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 568 FAIL classList.replace(undefined, "b") with attribute value "a undefined" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 569 FAIL classList.replace("a", undefined) with attribute value "a b" (XHTML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 545 PASS classList.replace("a", "a") with attribute value "a" (XHTML node) 546 PASS classList.replace("a", "b") with attribute value "a" (XHTML node) 547 PASS classList.replace("A", "b") with attribute value "a" (XHTML node) 548 PASS classList.replace("b", "A") with attribute value "a b" (XHTML node) 549 PASS classList.replace("c", "a") with attribute value "a b" (XHTML node) 550 PASS classList.replace("d", "e") with attribute value "a b c" (XHTML node) 551 PASS classList.replace("a", "a") with attribute value "a a a b" (XHTML node) 552 PASS classList.replace("c", "d") with attribute value "a a a b" (XHTML node) 553 PASS classList.replace("a", "b") with attribute value null (XHTML node) 554 PASS classList.replace("a", "b") with attribute value "" (XHTML node) 555 PASS classList.replace("a", "b") with attribute value " " (XHTML node) 556 PASS classList.replace("a", "b") with attribute value " a \f" (XHTML node) 557 PASS classList.replace("b", "d") with attribute value "a b c" (XHTML node) 558 PASS classList.replace("c", "a") with attribute value "a b c" (XHTML node) 559 PASS classList.replace("c", "a") with attribute value "c b a" (XHTML node) 560 PASS classList.replace("a", "c") with attribute value "a b a" (XHTML node) 561 PASS classList.replace("b", "c") with attribute value "a b a" (XHTML node) 562 PASS classList.replace("a", "c") with attribute value " a a b" (XHTML node) 563 PASS classList.replace("b", "c") with attribute value " a a b" (XHTML node) 564 PASS classList.replace("a", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (XHTML node) 565 PASS classList.replace("b", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (XHTML node) 566 PASS classList.replace(null, "b") with attribute value "a null" (XHTML node) 567 PASS classList.replace("a", null) with attribute value "a b" (XHTML node) 568 PASS classList.replace(undefined, "b") with attribute value "a undefined" (XHTML node) 569 PASS classList.replace("a", undefined) with attribute value "a b" (XHTML node) 570 570 PASS Assigning to classList (MathML node) 571 571 PASS .supports() must throw TypeError (MathML node) … … 827 827 PASS classList.replace("b", " a") with attribute value null (MathML node) 828 828 PASS classList.replace("b", "a ") with attribute value null (MathML node) 829 FAIL classList.replace("a", "a") with attribute value "a" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 830 FAIL classList.replace("a", "b") with attribute value "a" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 831 FAIL classList.replace("A", "b") with attribute value "a" (MathML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 832 FAIL classList.replace("b", "A") with attribute value "a b" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 833 FAIL classList.replace("c", "a") with attribute value "a b" (MathML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 834 FAIL classList.replace("d", "e") with attribute value "a b c" (MathML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 835 FAIL classList.replace("a", "a") with attribute value "a a a b" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 836 FAIL classList.replace("c", "d") with attribute value "a a a b" (MathML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 837 FAIL classList.replace("a", "b") with attribute value null (MathML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 838 FAIL classList.replace("a", "b") with attribute value "" (MathML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 839 FAIL classList.replace("a", "b") with attribute value " " (MathML node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 840 FAIL classList.replace("a", "b") with attribute value " a \f" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 841 FAIL classList.replace("b", "d") with attribute value "a b c" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 842 FAIL classList.replace("c", "a") with attribute value "a b c" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 843 FAIL classList.replace("c", "a") with attribute value "c b a" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 844 FAIL classList.replace("a", "c") with attribute value "a b a" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 845 FAIL classList.replace("b", "c") with attribute value "a b a" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 846 FAIL classList.replace("a", "c") with attribute value " a a b" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 847 FAIL classList.replace("b", "c") with attribute value " a a b" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 848 FAIL classList.replace("a", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 849 FAIL classList.replace("b", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 850 FAIL classList.replace(null, "b") with attribute value "a null" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 851 FAIL classList.replace("a", null) with attribute value "a b" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 852 FAIL classList.replace(undefined, "b") with attribute value "a undefined" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 853 FAIL classList.replace("a", undefined) with attribute value "a b" (MathML node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 829 PASS classList.replace("a", "a") with attribute value "a" (MathML node) 830 PASS classList.replace("a", "b") with attribute value "a" (MathML node) 831 PASS classList.replace("A", "b") with attribute value "a" (MathML node) 832 PASS classList.replace("b", "A") with attribute value "a b" (MathML node) 833 PASS classList.replace("c", "a") with attribute value "a b" (MathML node) 834 PASS classList.replace("d", "e") with attribute value "a b c" (MathML node) 835 PASS classList.replace("a", "a") with attribute value "a a a b" (MathML node) 836 PASS classList.replace("c", "d") with attribute value "a a a b" (MathML node) 837 PASS classList.replace("a", "b") with attribute value null (MathML node) 838 PASS classList.replace("a", "b") with attribute value "" (MathML node) 839 PASS classList.replace("a", "b") with attribute value " " (MathML node) 840 PASS classList.replace("a", "b") with attribute value " a \f" (MathML node) 841 PASS classList.replace("b", "d") with attribute value "a b c" (MathML node) 842 PASS classList.replace("c", "a") with attribute value "a b c" (MathML node) 843 PASS classList.replace("c", "a") with attribute value "c b a" (MathML node) 844 PASS classList.replace("a", "c") with attribute value "a b a" (MathML node) 845 PASS classList.replace("b", "c") with attribute value "a b a" (MathML node) 846 PASS classList.replace("a", "c") with attribute value " a a b" (MathML node) 847 PASS classList.replace("b", "c") with attribute value " a a b" (MathML node) 848 PASS classList.replace("a", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (MathML node) 849 PASS classList.replace("b", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (MathML node) 850 PASS classList.replace(null, "b") with attribute value "a null" (MathML node) 851 PASS classList.replace("a", null) with attribute value "a b" (MathML node) 852 PASS classList.replace(undefined, "b") with attribute value "a undefined" (MathML node) 853 PASS classList.replace("a", undefined) with attribute value "a b" (MathML node) 854 854 PASS Assigning to classList (XML node with null namespace) 855 855 PASS .supports() must throw TypeError (XML node with null namespace) … … 1111 1111 PASS classList.replace("b", " a") with attribute value null (XML node with null namespace) 1112 1112 PASS classList.replace("b", "a ") with attribute value null (XML node with null namespace) 1113 FAIL classList.replace("a", "a") with attribute value "a" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1114 FAIL classList.replace("a", "b") with attribute value "a" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1115 FAIL classList.replace("A", "b") with attribute value "a" (XML node with null namespace) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 1116 FAIL classList.replace("b", "A") with attribute value "a b" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1117 FAIL classList.replace("c", "a") with attribute value "a b" (XML node with null namespace) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 1118 FAIL classList.replace("d", "e") with attribute value "a b c" (XML node with null namespace) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 1119 FAIL classList.replace("a", "a") with attribute value "a a a b" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1120 FAIL classList.replace("c", "d") with attribute value "a a a b" (XML node with null namespace) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 1121 FAIL classList.replace("a", "b") with attribute value null (XML node with null namespace) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 1122 FAIL classList.replace("a", "b") with attribute value "" (XML node with null namespace) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 1123 FAIL classList.replace("a", "b") with attribute value " " (XML node with null namespace) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 1124 FAIL classList.replace("a", "b") with attribute value " a \f" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1125 FAIL classList.replace("b", "d") with attribute value "a b c" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1126 FAIL classList.replace("c", "a") with attribute value "a b c" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1127 FAIL classList.replace("c", "a") with attribute value "c b a" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1128 FAIL classList.replace("a", "c") with attribute value "a b a" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1129 FAIL classList.replace("b", "c") with attribute value "a b a" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1130 FAIL classList.replace("a", "c") with attribute value " a a b" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1131 FAIL classList.replace("b", "c") with attribute value " a a b" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1132 FAIL classList.replace("a", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1133 FAIL classList.replace("b", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1134 FAIL classList.replace(null, "b") with attribute value "a null" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1135 FAIL classList.replace("a", null) with attribute value "a b" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1136 FAIL classList.replace(undefined, "b") with attribute value "a undefined" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1137 FAIL classList.replace("a", undefined) with attribute value "a b" (XML node with null namespace) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1113 PASS classList.replace("a", "a") with attribute value "a" (XML node with null namespace) 1114 PASS classList.replace("a", "b") with attribute value "a" (XML node with null namespace) 1115 PASS classList.replace("A", "b") with attribute value "a" (XML node with null namespace) 1116 PASS classList.replace("b", "A") with attribute value "a b" (XML node with null namespace) 1117 PASS classList.replace("c", "a") with attribute value "a b" (XML node with null namespace) 1118 PASS classList.replace("d", "e") with attribute value "a b c" (XML node with null namespace) 1119 PASS classList.replace("a", "a") with attribute value "a a a b" (XML node with null namespace) 1120 PASS classList.replace("c", "d") with attribute value "a a a b" (XML node with null namespace) 1121 PASS classList.replace("a", "b") with attribute value null (XML node with null namespace) 1122 PASS classList.replace("a", "b") with attribute value "" (XML node with null namespace) 1123 PASS classList.replace("a", "b") with attribute value " " (XML node with null namespace) 1124 PASS classList.replace("a", "b") with attribute value " a \f" (XML node with null namespace) 1125 PASS classList.replace("b", "d") with attribute value "a b c" (XML node with null namespace) 1126 PASS classList.replace("c", "a") with attribute value "a b c" (XML node with null namespace) 1127 PASS classList.replace("c", "a") with attribute value "c b a" (XML node with null namespace) 1128 PASS classList.replace("a", "c") with attribute value "a b a" (XML node with null namespace) 1129 PASS classList.replace("b", "c") with attribute value "a b a" (XML node with null namespace) 1130 PASS classList.replace("a", "c") with attribute value " a a b" (XML node with null namespace) 1131 PASS classList.replace("b", "c") with attribute value " a a b" (XML node with null namespace) 1132 PASS classList.replace("a", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (XML node with null namespace) 1133 PASS classList.replace("b", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (XML node with null namespace) 1134 PASS classList.replace(null, "b") with attribute value "a null" (XML node with null namespace) 1135 PASS classList.replace("a", null) with attribute value "a b" (XML node with null namespace) 1136 PASS classList.replace(undefined, "b") with attribute value "a undefined" (XML node with null namespace) 1137 PASS classList.replace("a", undefined) with attribute value "a b" (XML node with null namespace) 1138 1138 PASS Assigning to classList (foo node) 1139 1139 PASS .supports() must throw TypeError (foo node) … … 1395 1395 PASS classList.replace("b", " a") with attribute value null (foo node) 1396 1396 PASS classList.replace("b", "a ") with attribute value null (foo node) 1397 FAIL classList.replace("a", "a") with attribute value "a" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1398 FAIL classList.replace("a", "b") with attribute value "a" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1399 FAIL classList.replace("A", "b") with attribute value "a" (foo node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 1400 FAIL classList.replace("b", "A") with attribute value "a b" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1401 FAIL classList.replace("c", "a") with attribute value "a b" (foo node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 1402 FAIL classList.replace("d", "e") with attribute value "a b c" (foo node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 1403 FAIL classList.replace("a", "a") with attribute value "a a a b" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1404 FAIL classList.replace("c", "d") with attribute value "a a a b" (foo node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 1405 FAIL classList.replace("a", "b") with attribute value null (foo node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 1406 FAIL classList.replace("a", "b") with attribute value "" (foo node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 1407 FAIL classList.replace("a", "b") with attribute value " " (foo node) assert_equals: wrong return value expected (boolean) false but got (undefined) undefined 1408 FAIL classList.replace("a", "b") with attribute value " a \f" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1409 FAIL classList.replace("b", "d") with attribute value "a b c" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1410 FAIL classList.replace("c", "a") with attribute value "a b c" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1411 FAIL classList.replace("c", "a") with attribute value "c b a" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1412 FAIL classList.replace("a", "c") with attribute value "a b a" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1413 FAIL classList.replace("b", "c") with attribute value "a b a" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1414 FAIL classList.replace("a", "c") with attribute value " a a b" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1415 FAIL classList.replace("b", "c") with attribute value " a a b" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1416 FAIL classList.replace("a", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1417 FAIL classList.replace("b", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1418 FAIL classList.replace(null, "b") with attribute value "a null" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1419 FAIL classList.replace("a", null) with attribute value "a b" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1420 FAIL classList.replace(undefined, "b") with attribute value "a undefined" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1421 FAIL classList.replace("a", undefined) with attribute value "a b" (foo node) assert_equals: wrong return value expected (boolean) true but got (undefined) undefined 1397 PASS classList.replace("a", "a") with attribute value "a" (foo node) 1398 PASS classList.replace("a", "b") with attribute value "a" (foo node) 1399 PASS classList.replace("A", "b") with attribute value "a" (foo node) 1400 PASS classList.replace("b", "A") with attribute value "a b" (foo node) 1401 PASS classList.replace("c", "a") with attribute value "a b" (foo node) 1402 PASS classList.replace("d", "e") with attribute value "a b c" (foo node) 1403 PASS classList.replace("a", "a") with attribute value "a a a b" (foo node) 1404 PASS classList.replace("c", "d") with attribute value "a a a b" (foo node) 1405 PASS classList.replace("a", "b") with attribute value null (foo node) 1406 PASS classList.replace("a", "b") with attribute value "" (foo node) 1407 PASS classList.replace("a", "b") with attribute value " " (foo node) 1408 PASS classList.replace("a", "b") with attribute value " a \f" (foo node) 1409 PASS classList.replace("b", "d") with attribute value "a b c" (foo node) 1410 PASS classList.replace("c", "a") with attribute value "a b c" (foo node) 1411 PASS classList.replace("c", "a") with attribute value "c b a" (foo node) 1412 PASS classList.replace("a", "c") with attribute value "a b a" (foo node) 1413 PASS classList.replace("b", "c") with attribute value "a b a" (foo node) 1414 PASS classList.replace("a", "c") with attribute value " a a b" (foo node) 1415 PASS classList.replace("b", "c") with attribute value " a a b" (foo node) 1416 PASS classList.replace("a", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (foo node) 1417 PASS classList.replace("b", "c") with attribute value "\t\n\f\r a\t\n\f\r b\t\n\f\r " (foo node) 1418 PASS classList.replace(null, "b") with attribute value "a null" (foo node) 1419 PASS classList.replace("a", null) with attribute value "a b" (foo node) 1420 PASS classList.replace(undefined, "b") with attribute value "a undefined" (foo node) 1421 PASS classList.replace("a", undefined) with attribute value "a b" (foo node) 1422 1422 -
trunk/Source/WebCore/ChangeLog
r229564 r229566 1 2018-03-12 Chris Dumez <cdumez@apple.com> 2 3 Return boolean from DOMTokenList's replace() method 4 https://bugs.webkit.org/show_bug.cgi?id=183567 5 6 Reviewed by Youenn Fablet. 7 8 Have DOMTokenList's replace() method return a boolean indicating if the 9 token was replaced, as per: 10 - https://dom.spec.whatwg.org/#dom-domtokenlist-replace 11 12 This is a recent addition to the DOM specification: 13 - https://github.com/whatwg/dom/pull/582 14 15 No new tests, rebaselined existing test. 16 17 * html/DOMTokenList.cpp: 18 (WebCore::replaceInOrderedSet): 19 (WebCore::DOMTokenList::replace): 20 * html/DOMTokenList.h: 21 * html/DOMTokenList.idl: 22 1 23 2018-03-12 Brian Burg <bburg@apple.com> 2 24 -
trunk/Source/WebCore/html/DOMTokenList.cpp
r223330 r229566 158 158 } 159 159 160 static inline void replaceInOrderedSet(Vector<AtomicString>& tokens, size_t tokenIndex, const AtomicString& newToken) 161 { 162 ASSERT(tokenIndex != notFound); 163 ASSERT(tokenIndex < tokens.size()); 164 165 auto newTokenIndex = tokens.find(newToken); 166 if (newTokenIndex == notFound) { 167 tokens[tokenIndex] = newToken; 168 return; 169 } 170 171 if (newTokenIndex == tokenIndex) 172 return; 173 174 if (newTokenIndex > tokenIndex) { 175 tokens[tokenIndex] = newToken; 176 tokens.remove(newTokenIndex); 177 } else 178 tokens.remove(tokenIndex); 179 } 180 160 181 // https://dom.spec.whatwg.org/#dom-domtokenlist-replace 161 ExceptionOr< void> DOMTokenList::replace(const AtomicString& item, const AtomicString& replacement)162 { 163 if ( item.isEmpty() || replacement.isEmpty())182 ExceptionOr<bool> DOMTokenList::replace(const AtomicString& token, const AtomicString& newToken) 183 { 184 if (token.isEmpty() || newToken.isEmpty()) 164 185 return Exception { SyntaxError }; 165 186 166 if (tokenContainsHTMLSpace( item) || tokenContainsHTMLSpace(replacement))187 if (tokenContainsHTMLSpace(token) || tokenContainsHTMLSpace(newToken)) 167 188 return Exception { InvalidCharacterError }; 168 189 169 190 auto& tokens = this->tokens(); 170 191 171 auto matchesItemOrReplacement = [&](auto& token) { 172 return token == item || token == replacement; 173 }; 174 175 size_t index = tokens.findMatching(matchesItemOrReplacement); 176 if (index == notFound) 177 return { }; 178 179 tokens[index] = replacement; 180 tokens.removeFirstMatching(matchesItemOrReplacement, index + 1); 181 ASSERT(item == replacement || tokens.find(item) == notFound); 182 ASSERT(tokens.reverseFind(replacement) == index); 183 184 updateAssociatedAttributeFromTokens(); 185 186 return { }; 192 auto tokenIndex = tokens.find(token); 193 if (tokenIndex == notFound) 194 return false; 195 196 replaceInOrderedSet(tokens, tokenIndex, newToken); 197 ASSERT(token == newToken || tokens.find(token) == notFound); 198 199 updateAssociatedAttributeFromTokens(); 200 201 return true; 187 202 } 188 203 -
trunk/Source/WebCore/html/DOMTokenList.h
r222613 r229566 50 50 ExceptionOr<void> remove(const AtomicString&); 51 51 WEBCORE_EXPORT ExceptionOr<bool> toggle(const AtomicString&, std::optional<bool> force); 52 ExceptionOr< void> replace(const AtomicString& token, const AtomicString& newToken);52 ExceptionOr<bool> replace(const AtomicString& token, const AtomicString& newToken); 53 53 ExceptionOr<bool> supports(StringView token); 54 54 -
trunk/Source/WebCore/html/DOMTokenList.idl
r216339 r229566 34 34 [CEReactions, MayThrowException] void remove(DOMString... tokens); 35 35 [CEReactions, MayThrowException] boolean toggle(DOMString token, optional boolean force); 36 [CEReactions, MayThrowException] voidreplace(DOMString token, DOMString newToken);36 [CEReactions, MayThrowException] boolean replace(DOMString token, DOMString newToken); 37 37 [MayThrowException] boolean supports(DOMString token); 38 38 [CEReactions] stringifier attribute DOMString value;
Note: See TracChangeset
for help on using the changeset viewer.