Commit 3a4ee0f0 authored by Bhagirathi Satpathy's avatar Bhagirathi Satpathy Committed by Commit Bot

Added test to verify [TreatNullAs=EmptyString] behavior of |mediaText|

This patch contains
1. Test added to verify [TreatNullAs=EmptyString] behavior of |mediaText|
   attribute of MediaList.
2. Update MediaList |mediaText| IDL attribute to match the specification.
   https://drafts.csswg.org/cssom/#the-medialist-interface

Bug:

Change-Id: I6cf9380390113e3ec8f37c796b0f6fd68e2de6c8
Reviewed-on: https://chromium-review.googlesource.com/892718
Commit-Queue: Bhagirathi Satpathy <bhagirathi.s@samsung.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532817}
parent 2ab7c3e1
...@@ -40,6 +40,10 @@ ...@@ -40,6 +40,10 @@
assert_equals(media[3], undefined, "MediaList indexed getter with out of range after append method"); assert_equals(media[3], undefined, "MediaList indexed getter with out of range after append method");
assert_equals(media.item(2), "speech", "MediaList item method after append method"); assert_equals(media.item(2), "speech", "MediaList item method after append method");
assert_equals(media.item(3), null, "MediaList item method after append method"); assert_equals(media.item(3), null, "MediaList item method after append method");
media.mediaText = null;
assert_equals(media.mediaText, "", "MediaList mediaText attribute should be empty string in case of null");
assert_equals(media.toString(), "", "MediaList toString method should be empty string in case of null");
}); });
</script> </script>
</head> </head>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
[ [
Exposed=Window Exposed=Window
] interface MediaList { ] interface MediaList {
[TreatNullAs=EmptyString] stringifier attribute DOMString mediaText; stringifier attribute [TreatNullAs=EmptyString] DOMString mediaText;
readonly attribute unsigned long length; readonly attribute unsigned long length;
[Measure] getter DOMString? item(unsigned long index); [Measure] getter DOMString? item(unsigned long index);
// TODO(foolip): appendMedium() and deleteMedium() should never throw. // TODO(foolip): appendMedium() and deleteMedium() should never throw.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment