Changeset 289209 in webkit
- Timestamp:
- Feb 7, 2022 5:51:03 AM (5 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/range-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/RangeInputType.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r289194 r289209 1 2022-02-07 Ziran Sun <zsun@igalia.com> 2 3 [Forms] Use min as default value when min > max for input type="range" 4 https://bugs.webkit.org/show_bug.cgi?id=236223 5 6 Reviewed by Darin Adler. 7 8 Update the sub test expectation that is now passing. 9 * web-platform-tests/html/semantics/forms/the-input-element/range-expected.txt: 10 1 11 2022-02-06 Sam Weinig <weinig@apple.com> 2 12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/range-expected.txt
r289075 r289209 15 15 PASS default value when min and max attributes are given (= min plus half the difference between min and max) 16 16 PASS default value with step control when both min and max attributes are given 17 FAIL default value when both min and max attributes are given, while min > max assert_equals: expected "2" but got "51" 17 PASS default value when both min and max attributes are given, while min > max 18 18 PASS The default step scale factor is 1, unless min attribute has non-integer value 19 19 PASS Step scale factor behavior when min attribute has integer value but max attribute is non-integer -
trunk/Source/WebCore/ChangeLog
r289208 r289209 1 2022-02-07 Ziran Sun <zsun@igalia.com> 2 3 [Forms] Use min as default value when min > max for input type="range" 4 https://bugs.webkit.org/show_bug.cgi?id=236223 5 6 Reviewed by Darin Adler. 7 8 As per spec https://html.spec.whatwg.org/multipage/input.html#concept-input-value-default-range, 9 in the case of "the maximum is less than the minimum, in which case the default value is the minimum". 10 11 * html/RangeInputType.cpp: 12 (WebCore::ensureMaximum): 13 (WebCore::RangeInputType::createStepRange const): 14 1 15 2022-02-07 Joonghun Park <jh718.park@samsung.com> 2 16 -
trunk/Source/WebCore/html/RangeInputType.cpp
r284972 r289209 76 76 static const StepRange::StepDescription rangeStepDescription { rangeDefaultStep, rangeDefaultStepBase, rangeStepScaleFactor }; 77 77 78 static Decimal ensureMaximum(const Decimal& proposedValue, const Decimal& minimum , const Decimal& fallbackValue)79 { 80 return proposedValue >= minimum ? proposedValue : std::max(minimum, fallbackValue);78 static Decimal ensureMaximum(const Decimal& proposedValue, const Decimal& minimum) 79 { 80 return proposedValue >= minimum ? proposedValue : minimum; 81 81 } 82 82 … … 119 119 ASSERT(element()); 120 120 const Decimal minimum = parseToNumber(element()->attributeWithoutSynchronization(minAttr), rangeDefaultMinimum); 121 const Decimal maximum = ensureMaximum(parseToNumber(element()->attributeWithoutSynchronization(maxAttr), rangeDefaultMaximum), minimum , rangeDefaultMaximum);121 const Decimal maximum = ensureMaximum(parseToNumber(element()->attributeWithoutSynchronization(maxAttr), rangeDefaultMaximum), minimum); 122 122 123 123 const AtomString& precisionValue = element()->attributeWithoutSynchronization(precisionAttr);
Note: See TracChangeset
for help on using the changeset viewer.