Commit d89a7262 authored by Dong-hee Na's avatar Dong-hee Na Committed by Commit Bot

Fix IDL attributes of METER element to reflect values correctly

SerializeForNumberType() should be used instead of AtomicString::Number()
in Element::SetFloatingPointAttribute().

Bug: 894661
Change-Id: I6d4efd2d14fb7e01e0fb47cc703fd2d7d12cde18
Reviewed-on: https://chromium-review.googlesource.com/c/1288929
Commit-Queue: Dong-hee Na <donghee.na92@gmail.com>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601488}
parent dfc636b6
This is a testharness.js-based test. This is a testharness.js-based test.
Found 6725 tests; 6710 PASS, 15 FAIL, 0 TIMEOUT, 0 NOTRUN. Found 6725 tests; 6722 PASS, 3 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS form.title: 32 tests PASS form.title: 32 tests
PASS form.lang: 32 tests PASS form.lang: 32 tests
PASS form.dir: 62 tests PASS form.dir: 62 tests
...@@ -179,32 +179,17 @@ PASS meter.className (<meter class>): 32 tests ...@@ -179,32 +179,17 @@ PASS meter.className (<meter class>): 32 tests
PASS meter.hidden: 33 tests PASS meter.hidden: 33 tests
PASS meter.accessKey: 32 tests PASS meter.accessKey: 32 tests
PASS meter.tabIndex: 24 tests PASS meter.tabIndex: 24 tests
PASS meter.value: 2 tests PASS meter.value: 8 tests
FAIL meter.value: IDL set to -10000000000 assert_equals: getAttribute() expected "-10000000000" but got "-1.00000e+10" PASS meter.min: 8 tests
PASS meter.value: 4 tests
FAIL meter.value: IDL set to 10000000000 assert_equals: getAttribute() expected "10000000000" but got "1.00000e+10"
PASS meter.min: 2 tests
FAIL meter.min: IDL set to -10000000000 assert_equals: getAttribute() expected "-10000000000" but got "-1.00000e+10"
PASS meter.min: 4 tests
FAIL meter.min: IDL set to 10000000000 assert_equals: getAttribute() expected "10000000000" but got "1.00000e+10"
PASS meter.max: typeof IDL attribute PASS meter.max: typeof IDL attribute
FAIL meter.max: IDL get with DOM attribute unset assert_equals: expected 0 but got 1 FAIL meter.max: IDL get with DOM attribute unset assert_equals: expected 0 but got 1
FAIL meter.max: IDL set to -10000000000 assert_equals: getAttribute() expected "-10000000000" but got "-1.00000e+10" PASS meter.max: 6 tests
PASS meter.max: 4 tests PASS meter.low: 8 tests
FAIL meter.max: IDL set to 10000000000 assert_equals: getAttribute() expected "10000000000" but got "1.00000e+10"
PASS meter.low: 2 tests
FAIL meter.low: IDL set to -10000000000 assert_equals: getAttribute() expected "-10000000000" but got "-1.00000e+10"
PASS meter.low: 4 tests
FAIL meter.low: IDL set to 10000000000 assert_equals: getAttribute() expected "10000000000" but got "1.00000e+10"
PASS meter.high: typeof IDL attribute PASS meter.high: typeof IDL attribute
FAIL meter.high: IDL get with DOM attribute unset assert_equals: expected 0 but got 1 FAIL meter.high: IDL get with DOM attribute unset assert_equals: expected 0 but got 1
FAIL meter.high: IDL set to -10000000000 assert_equals: getAttribute() expected "-10000000000" but got "-1.00000e+10" PASS meter.high: 6 tests
PASS meter.high: 4 tests
FAIL meter.high: IDL set to 10000000000 assert_equals: getAttribute() expected "10000000000" but got "1.00000e+10"
PASS meter.optimum: typeof IDL attribute PASS meter.optimum: typeof IDL attribute
FAIL meter.optimum: IDL get with DOM attribute unset assert_equals: expected 0 but got 0.5 FAIL meter.optimum: IDL get with DOM attribute unset assert_equals: expected 0 but got 0.5
FAIL meter.optimum: IDL set to -10000000000 assert_equals: getAttribute() expected "-10000000000" but got "-1.00000e+10" PASS meter.optimum: 6 tests
PASS meter.optimum: 4 tests
FAIL meter.optimum: IDL set to 10000000000 assert_equals: getAttribute() expected "10000000000" but got "1.00000e+10"
Harness: the test ran to completion. Harness: the test ran to completion.
...@@ -4414,7 +4414,8 @@ double Element::GetFloatingPointAttribute(const QualifiedName& attribute_name, ...@@ -4414,7 +4414,8 @@ double Element::GetFloatingPointAttribute(const QualifiedName& attribute_name,
void Element::SetFloatingPointAttribute(const QualifiedName& attribute_name, void Element::SetFloatingPointAttribute(const QualifiedName& attribute_name,
double value) { double value) {
setAttribute(attribute_name, AtomicString::Number(value)); String serialized_value = SerializeForNumberType(value);
setAttribute(attribute_name, AtomicString(serialized_value));
} }
void Element::SetContainsFullScreenElement(bool flag) { void Element::SetContainsFullScreenElement(bool flag) {
......
...@@ -762,7 +762,7 @@ TEST_F(MediaControlsImplTest, TimelineSeekToRoundedEnd) { ...@@ -762,7 +762,7 @@ TEST_F(MediaControlsImplTest, TimelineSeekToRoundedEnd) {
// rounded up slightly to |rounded_up_duration| when setting the timeline's // rounded up slightly to |rounded_up_duration| when setting the timeline's
// |max| attribute (crbug.com/695065). // |max| attribute (crbug.com/695065).
double exact_duration = 596.586667; double exact_duration = 596.586667;
double rounded_up_duration = 596.587; double rounded_up_duration = 596.586667;
LoadMediaWithDuration(exact_duration); LoadMediaWithDuration(exact_duration);
// Simulate a click slightly past the end of the track of the timeline's // Simulate a click slightly past the end of the track of the timeline's
......
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