Changeset 286581 in webkit
- Timestamp:
- Dec 6, 2021 5:15:26 PM (8 months ago)
- Location:
- trunk
- Files:
-
- 12 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/forms/time/time-validity-rangeoverflow-expected.txt (modified) (1 diff)
-
LayoutTests/fast/forms/time/time-validity-rangeoverflow.html (modified) (1 diff)
-
LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeOverflow-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeOverflow-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/InputType.cpp (modified) (2 diffs)
-
Source/WebCore/html/StepRange.cpp (modified) (2 diffs)
-
Source/WebCore/html/StepRange.h (modified) (3 diffs)
-
Source/WebCore/html/TimeInputType.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r286577 r286581 1 2021-12-06 Chris Dumez <cdumez@apple.com> 2 3 <input type="time">'s range should be reversible 4 https://bugs.webkit.org/show_bug.cgi?id=233835 5 6 Reviewed by Darin Adler. 7 8 Rebaseline WPT tests that are now passing. 9 10 * platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeOverflow-expected.txt: 11 * platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow-expected.txt: 12 1 13 2021-12-06 Ryan Haddad <ryanhaddad@apple.com> 2 14 -
trunk/LayoutTests/fast/forms/time/time-validity-rangeoverflow-expected.txt
r286316 r286581 14 14 PASS The value "23:59:59.999" overflows the maximum value "13:16". 15 15 PASS The value "13:16" overflows the maximum value "12:00". 16 PASS The value "23:59:59.999" overflows the maximum value "13:16" when disabled. 16 PASS The value "23:59:59.999" doesn't overflow the maximum value "13:16" when disabled. 17 PASS The value "13:17:59.999" overflows the maximum value "13:16" when disabled. 17 18 PASS successfullyParsed is true 18 19 -
trunk/LayoutTests/fast/forms/time/time-validity-rangeoverflow.html
r286316 r286581 67 67 68 68 // Disabled 69 checkOverflow('23:59:59.999', '13:16', true); 69 checkNotOverflow('23:59:59.999', '13:16', true); 70 checkOverflow('13:17:59.999', '13:16', true); 70 71 </script> 71 72 <script src="../../../resources/js-test-post.js"></script> -
trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeOverflow-expected.txt
r286331 r286581 56 56 PASS [INPUT in TIME status] The time is max for reversed range 57 57 PASS [INPUT in TIME status] The time is outside the accepted range for reversed range 58 FAIL [INPUT in TIME status] The time is min for reversed range assert_false: The validity.rangeOverflow should be false. expected false got true59 FAIL [INPUT in TIME status] The time is inside the accepted range for reversed range assert_false: The validity.rangeOverflow should be false. expected false got true58 PASS [INPUT in TIME status] The time is min for reversed range 59 PASS [INPUT in TIME status] The time is inside the accepted range for reversed range 60 60 PASS [INPUT in NUMBER status] The max attribute is not set 61 61 PASS [INPUT in NUMBER status] Value is empty string -
trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow-expected.txt
r286331 r286581 52 52 PASS [INPUT in TIME status] The value is less than min(with millisecond in 3 digit) 53 53 PASS [INPUT in TIME status] The time missing second part is valid 54 FAIL [INPUT in TIME status] The time is max for reversed range assert_false: The validity.rangeUnderflow should be false. expected false got true54 PASS [INPUT in TIME status] The time is max for reversed range 55 55 PASS [INPUT in TIME status] The time is outside the accepted range for reversed range 56 56 PASS [INPUT in TIME status] The time is min for reversed range -
trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeOverflow-expected.txt
r286316 r286581 56 56 PASS [INPUT in TIME status] The time is max for reversed range 57 57 PASS [INPUT in TIME status] The time is outside the accepted range for reversed range 58 FAIL [INPUT in TIME status] The time is min for reversed range assert_false: The validity.rangeOverflow should be false. expected false got true59 FAIL [INPUT in TIME status] The time is inside the accepted range for reversed range assert_false: The validity.rangeOverflow should be false. expected false got true58 PASS [INPUT in TIME status] The time is min for reversed range 59 PASS [INPUT in TIME status] The time is inside the accepted range for reversed range 60 60 PASS [INPUT in NUMBER status] The max attribute is not set 61 61 PASS [INPUT in NUMBER status] Value is empty string -
trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow-expected.txt
r286316 r286581 52 52 PASS [INPUT in TIME status] The value is less than min(with millisecond in 3 digit) 53 53 PASS [INPUT in TIME status] The time missing second part is valid 54 FAIL [INPUT in TIME status] The time is max for reversed range assert_false: The validity.rangeUnderflow should be false. expected false got true54 PASS [INPUT in TIME status] The time is max for reversed range 55 55 PASS [INPUT in TIME status] The time is outside the accepted range for reversed range 56 56 PASS [INPUT in TIME status] The time is min for reversed range -
trunk/Source/WebCore/ChangeLog
r286578 r286581 1 2021-12-06 Chris Dumez <cdumez@apple.com> 2 3 <input type="time">'s range should be reversible 4 https://bugs.webkit.org/show_bug.cgi?id=233835 5 6 Reviewed by Darin Adler. 7 8 <input type="time">'s range should be reversible when checking for overflow / underflow: 9 - https://html.spec.whatwg.org/#has-a-periodic-domain 10 11 No new tests, rebaselined existing tests. 12 13 * html/InputType.cpp: 14 (WebCore::InputType::rangeUnderflow const): 15 (WebCore::InputType::rangeOverflow const): 16 * html/StepRange.cpp: 17 (WebCore::StepRange::StepRange): 18 * html/StepRange.h: 19 (WebCore::StepRange::isReversible const): 20 * html/TimeInputType.cpp: 21 (WebCore::TimeInputType::createStepRange const): 22 1 23 2021-12-06 Said Abou-Hallawa <said@apple.com> 2 24 -
trunk/Source/WebCore/html/InputType.cpp
r286560 r286581 270 270 return false; 271 271 272 return numericValue < createStepRange(AnyStepHandling::Reject).minimum(); 272 auto range = createStepRange(AnyStepHandling::Reject); 273 274 if (range.isReversible() && range.maximum() < range.minimum()) 275 return numericValue > range.maximum() && numericValue < range.minimum(); 276 277 return numericValue < range.minimum(); 273 278 } 274 279 … … 282 287 return false; 283 288 284 return numericValue > createStepRange(AnyStepHandling::Reject).maximum(); 289 auto range = createStepRange(AnyStepHandling::Reject); 290 291 if (range.isReversible() && range.maximum() < range.minimum()) 292 return numericValue > range.maximum() && numericValue < range.minimum(); 293 294 return numericValue > range.maximum(); 285 295 } 286 296 -
trunk/Source/WebCore/html/StepRange.cpp
r264600 r286581 51 51 } 52 52 53 StepRange::StepRange(const Decimal& stepBase, RangeLimitations rangeLimitations, const Decimal& minimum, const Decimal& maximum, const Decimal& step, const StepDescription& stepDescription )53 StepRange::StepRange(const Decimal& stepBase, RangeLimitations rangeLimitations, const Decimal& minimum, const Decimal& maximum, const Decimal& step, const StepDescription& stepDescription, IsReversible isReversible) 54 54 : m_maximum(maximum) 55 55 , m_minimum(minimum) … … 59 59 , m_hasRangeLimitations(rangeLimitations == RangeLimitations::Valid) 60 60 , m_hasStep(step.isFinite()) 61 , m_isReversible(isReversible == IsReversible::Yes) 61 62 { 62 63 ASSERT(m_maximum.isFinite()); -
trunk/Source/WebCore/html/StepRange.h
r264656 r286581 62 62 }; 63 63 64 enum class IsReversible : bool { No, Yes }; 65 64 66 StepRange(); 65 67 StepRange(const StepRange&); 66 StepRange(const Decimal& stepBase, RangeLimitations, const Decimal& minimum, const Decimal& maximum, const Decimal& step, const StepDescription& );68 StepRange(const Decimal& stepBase, RangeLimitations, const Decimal& minimum, const Decimal& maximum, const Decimal& step, const StepDescription&, IsReversible = IsReversible::No); 67 69 Decimal acceptableError() const; 68 70 Decimal alignValueForStep(const Decimal& currentValue, const Decimal& newValue) const; … … 77 79 int stepScaleFactor() const { return m_stepDescription.stepScaleFactor; } 78 80 bool stepMismatch(const Decimal&) const; 81 bool isReversible() const { return m_isReversible; } 79 82 80 83 // Clamp the middle value according to the step … … 110 113 const bool m_hasRangeLimitations { false }; 111 114 const bool m_hasStep { false }; 115 const bool m_isReversible { false }; 112 116 }; 113 117 -
trunk/Source/WebCore/html/TimeInputType.cpp
r283851 r286581 91 91 const Decimal maximum = parseToNumber(element()->attributeWithoutSynchronization(maxAttr), Decimal::fromDouble(DateComponents::maximumTime())); 92 92 const Decimal step = StepRange::parseStep(anyStepHandling, timeStepDescription, element()->attributeWithoutSynchronization(stepAttr)); 93 return StepRange(stepBase, RangeLimitations::Valid, minimum, maximum, step, timeStepDescription );93 return StepRange(stepBase, RangeLimitations::Valid, minimum, maximum, step, timeStepDescription, StepRange::IsReversible::Yes); 94 94 } 95 95
Note: See TracChangeset
for help on using the changeset viewer.