Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/html/semantics/grouping-content/the-ol-element/grouping-ol.html

Issue 2446483002: Import wpt@c5a14f553cba5f197743b9af605a84eddd8692a2 (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <title>the ol element</title> 5 <title>the ol element</title>
6 <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com"> 6 <link rel="author" title="dzenana" href="mailto:dzenana.trenutak@gmail.com">
7 <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-elemen t"> 7 <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-ol-elemen t">
8 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharness.js"></script>
9 <script src="/resources/testharnessreport.js"></script> 9 <script src="/resources/testharnessreport.js"></script>
10 </head> 10 </head>
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 }, "Changing IDL 'reversed' property changes list's reversed property.") ; 223 }, "Changing IDL 'reversed' property changes list's reversed property.") ;
224 224
225 225
226 // If the start attribute is present, user agents must parse it as an in teger, in order to determine the attribute's value. 226 // If the start attribute is present, user agents must parse it as an in teger, in order to determine the attribute's value.
227 // The default value, used if the attribute is missing or 227 // The default value, used if the attribute is missing or
228 // if the value cannot be converted to a number according to the referenced algorithm, 228 // if the value cannot be converted to a number according to the referenced algorithm,
229 // is 1 if the element has no reversed attribute, and 229 // is 1 if the element has no reversed attribute, and
230 // is the number of child li elements otherwise." 230 // is the number of child li elements otherwise."
231 // "The start IDL attribute has the same default as its content attribut e." 231 // "The start IDL attribute has the same default as its content attribut e."
232 232
233 // basic - default should be 1
234 test(function() { 233 test(function() {
235 assert_equals(document.getElementById("basic").start, 1, "no start a ttribute provided -> 1"); 234 assert_equals(document.getElementById("basic").start, 1);
236 }, "Default start value for non-reversed list should be 1"); 235 }, "Default start value for non-reversed list should be 1");
237 236
238 // decimal's first element has value of .5 which should return 1
239 test(function() { 237 test(function() {
240 assert_equals(document.getElementById("decimal").start, 1, "start of .5 -> 1 (default)"); 238 assert_equals(document.getElementById("decimal").start, 1);
241 }, "IDL and content attribute parse start of '.5' correctly."); 239 }, "IDL and content attribute parse start of '.5' correctly.");
242 240
243 // letter's first element has value of A which should return 1
244 test(function() { 241 test(function() {
245 assert_equals(document.getElementById("letter").start, 1, "start of A -> 1 (default)"); 242 assert_equals(document.getElementById("letter").start, 1);
246 }, "IDL and content attribute parse start of 'A' correctly."); 243 }, "IDL and content attribute parse start of 'A' correctly.");
247 244
248 // basicRevGoodName - default should be 3
249 test(function() { 245 test(function() {
250 assert_equals(document.getElementById("basicRevGoodName").start, 3, "no start attribute provided -> 3"); 246 assert_equals(document.getElementById("basicRevGoodName").start, 1);
251 }, "Default start value (if none provided) for reversed list = child li elements."); 247 }, "Default start value (if none provided) for reversed list = 1.");
252 248
253 // basicRevEmpty - default should be 3
254 test(function() { 249 test(function() {
255 assert_equals(document.getElementById("basicRevEmpty").start, 3, "st art of A -> 3 (default)"); 250 assert_equals(document.getElementById("basicRevEmpty").start, 1);
256 }, "Default start value (if failed to parse) for reversed list = child l i elements."); 251 }, "Default start value (if failed to parse) for reversed list = 1.");
257 252
258 // lots - default should be 3
259 test(function() { 253 test(function() {
260 assert_equals(document.getElementById("lots").start, 3, "no start at tribute -> 3 (default)"); 254 assert_equals(document.getElementById("lots").start, 1);
261 }, "Default start value for reversed list = child li elements (even with tons of other child elements)."); 255 }, "Default start value for reversed list = 1 (even with tons of other c hild elements).");
262 256
263 // adding child element changes default start value for reversed list
264 test(function() { 257 test(function() {
265 var myList = document.getElementById("basicRevGoodName"), myLI = doc ument.createElement("li"); 258 var myList = document.getElementById("basicRevGoodName"), myLI = doc ument.createElement("li");
266 myList.appendChild(myLI); 259 myList.appendChild(myLI);
267 assert_equals(document.getElementById("basicRevGoodName").start, 4, "Adding child element to reversed list adds 1 to start value"); 260 assert_equals(document.getElementById("basicRevGoodName").start, 1);
268 }, "Adding child element to reversed list adds 1 to start value"); 261 }, "Adding child element to reversed list does not change start value");
269 262
270 // removing child element changes default start value for reversed list
271 test(function() { 263 test(function() {
272 var myList = document.getElementById("basicRevTrue"); 264 var myList = document.getElementById("basicRevTrue");
273 myList.removeChild(myList.children[0]); 265 myList.removeChild(myList.children[0]);
274 assert_equals(document.getElementById("basicRevTrue").start, 2, "Del eting child element from reversed list reduces start value by 1"); 266 assert_equals(document.getElementById("basicRevTrue").start, 1);
275 }, "Deleting child element from reversed list reduces start value by 1") ; 267 }, "Deleting child element from reversed list does not change start valu e");
276 268
277 // start2's first element has value of 2
278 test(function() { 269 test(function() {
279 assert_equals(document.getElementById("start2").start, 2, "start of 2 -> 2"); 270 assert_equals(document.getElementById("start2").start, 2);
280 }, "IDL and content attribute parse start of '2' correctly."); 271 }, "IDL and content attribute parse start of '2' correctly.");
281 272
282 // negative's first element has value of -10
283 test(function() { 273 test(function() {
284 assert_equals(document.getElementById("negative").start, -10, "start of -10 -> -10"); 274 assert_equals(document.getElementById("negative").start, -10);
285 }, "IDL and content attribute parse start of '-10' correctly."); 275 }, "IDL and content attribute parse start of '-10' correctly.");
286 276
287 // posFloatDown's first element has value of 4.03 which should return 4
288 test(function() { 277 test(function() {
289 assert_equals(document.getElementById("posFloatDown").start, 4, "sta rt of 4.03 -> 4"); 278 assert_equals(document.getElementById("posFloatDown").start, 4);
290 }, "IDL and content attribute parse start of '4.03' correctly."); 279 }, "IDL and content attribute parse start of '4.03' correctly.");
291 280
292 // negFloatDown's first element has value of -4.03 which should return - 4
293 test(function() { 281 test(function() {
294 assert_equals(document.getElementById("negFloatDown").start, -4, "st art of -4.03 -> -4"); 282 assert_equals(document.getElementById("negFloatDown").start, -4);
295 }, "IDL and content attribute parse start of '-4.03' correctly."); 283 }, "IDL and content attribute parse start of '-4.03' correctly.");
296 284
297 // posFloatUp's first element has value of 4.9 which should return 4
298 test(function() { 285 test(function() {
299 assert_equals(document.getElementById("posFloatUp").start, 4, "start of 4.9 -> 4"); 286 assert_equals(document.getElementById("posFloatUp").start, 4);
300 }, "IDL and content attribute parse start of '4.9' correctly."); 287 }, "IDL and content attribute parse start of '4.9' correctly.");
301 288
302 // negFloatUp's first element has value of -4.9 which should return -4
303 test(function() { 289 test(function() {
304 assert_equals(document.getElementById("negFloatUp").start, -4, "star t of -4.9 -> -4"); 290 assert_equals(document.getElementById("negFloatUp").start, -4);
305 }, "IDL and content attribute parse start of '-4.9' correctly."); 291 }, "IDL and content attribute parse start of '-4.9' correctly.");
306 292
307 // exponent's first element has value of 7e2 which should return 7
308 test(function() { 293 test(function() {
309 assert_equals(document.getElementById("exponent").start, 7, "start o f 7e2 -> 7"); 294 assert_equals(document.getElementById("exponent").start, 7);
310 }, "IDL and content attribute parse start of '7e2' correctly."); 295 }, "IDL and content attribute parse start of '7e2' correctly.");
311 296
312 </script> 297 </script>
313 </body> 298 </body>
314 </html> 299 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698