Summary: | [JSC] Implement Intl.DateTimeFormat.formatRangeToParts | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||||||||||||||||||||||||||||||||
Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||||||||||||||||||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||||||||||||||||||||||
Severity: | Normal | CC: | benjamin, cdumez, cmarcelo, ews-watchlist, keith_miller, mark.lam, mcatanzaro, msaboff, ross.kirsling, saam, ticaiolima, tzagallo, webkit-bug-importer | ||||||||||||||||||||||||||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||||||||||||||||||||||||||
Version: | WebKit Nightly Build | ||||||||||||||||||||||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||||||||||||||||||||||
OS: | Unspecified | ||||||||||||||||||||||||||||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=209778 | ||||||||||||||||||||||||||||||||||||
Bug Depends on: | |||||||||||||||||||||||||||||||||||||
Bug Blocks: | 213425 | ||||||||||||||||||||||||||||||||||||
Attachments: |
|
Description
Yusuke Suzuki
2020-06-30 17:06:15 PDT
Created attachment 413573 [details]
Patch
Created attachment 413574 [details]
Patch
Created attachment 413575 [details]
Patch
Created attachment 413576 [details]
Patch
Created attachment 413578 [details]
Patch
Created attachment 413611 [details]
Patch
Created attachment 413657 [details]
Patch
Created attachment 413674 [details]
Patch
Created attachment 413780 [details]
Patch
Created attachment 413783 [details]
Patch
Created attachment 413788 [details]
Patch
Created attachment 413805 [details]
Patch
Comment on attachment 413805 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=413805&action=review > JSTests/stress/intl-datetimeformat-formatrangetoparts.js:454 > +if ($vm.icuHeaderVersion() >= 64) I need to insert `useAppleInternalSDK()` check here. Comment on attachment 413783 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=413783&action=review r=me. Such a complex feature, even before having to worry about ICU versions and Gregorian vs. Julian... I really appreciate the detailed comments and thorough tests. #マジ乙 > Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp:1647 > + auto sourceType = [&](int32_t index) -> JSString* { Seems like you could actually move this into createPart? > Source/WTF/wtf/Range.h:118 > + bool subsumes(const Range& other) const Is this used implicitly somewhere, or did it end up unnecessary? > JSTests/ChangeLog:33 > + * test262/expectations.yaml: Let's add a note here about the version-dependent failures. Comment on attachment 413805 [details]
Patch
Oops, I r+ed an obsolete patch. r+ing the latest one, contingent on making EWS happy.
Comment on attachment 413783 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=413783&action=review Thanks! >> Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp:1647 >> + auto sourceType = [&](int32_t index) -> JSString* { > > Seems like you could actually move this into createPart? That's good. Changed. >> Source/WTF/wtf/Range.h:118 >> + bool subsumes(const Range& other) const > > Is this used implicitly somewhere, or did it end up unnecessary? Yeah, originally, I thought ICU was producing right interval and we can split "literal" into ranges, but I ensured it isn't. So this function is not used. I'll drop it for now. >> JSTests/ChangeLog:33 >> + * test262/expectations.yaml: > > Let's add a note here about the version-dependent failures. Added. Created attachment 413862 [details]
Patch
Comment on attachment 413862 [details]
Patch
Oops, cleared Ross's r+ accidentally.
Created attachment 413866 [details]
Patch for landing
Created attachment 413876 [details]
Patch
Only failed test was stress/intl-datetimeformat-formatrangetoparts.js, and this is because it is using formatRangeToParts in OSS WebKit. I've fixed the test, and ensured it pass. Created attachment 413883 [details]
Patch for landing
Committed r269707: <https://trac.webkit.org/changeset/269707> Hi, this reverted r269667. Was that an accident? It breaks all the tests that commit fixed. All the new tests are broken too (on Fedora 32 with ICU 65.1) since the code checks for ICU >= 67 rather than >= 65. E.g.: Running stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default: Exception: Error: bad value: – expected value: – stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default: shouldBe@intl-datetimeformat-formatrangetoparts-relevant-extensions.js:3:24 stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default: compareParts@intl-datetimeformat-formatrangetoparts-relevant-extensions.js:10:17 stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default: test@intl-datetimeformat-formatrangetoparts-relevant-extensions.js:57:17 stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default: global code@intl-datetimeformat-formatrangetoparts-relevant-extensions.js:1776:9 stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default: ERROR: Unexpected exit code: 3 FAIL: stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default Comment on attachment 413876 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=413876&action=review > JSTests/stress/intl-datetimeformat-formatrange.js:40 > + if ($vm.icuVersion() >= 67) This branch is making such test fail for ARMv7 and MIPS. This test passes if we have line #41 assignment running. We are using a very old ICU version (ICU 60) on buildbots and EWS. (In reply to Michael Catanzaro from comment #26) > Hi, this reverted r269667. Was that an accident? It breaks all the tests > that commit fixed. All the new tests are broken too (on Fedora 32 with ICU > 65.1) since the code checks for ICU >= 67 rather than >= 65. E.g.: > > Running > stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default > stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default: > Exception: Error: bad value: – expected value: – > stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default: > shouldBe@intl-datetimeformat-formatrangetoparts-relevant-extensions.js:3:24 > stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default: > compareParts@intl-datetimeformat-formatrangetoparts-relevant-extensions.js: > 10:17 > stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default: > test@intl-datetimeformat-formatrangetoparts-relevant-extensions.js:57:17 > stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default: > global > code@intl-datetimeformat-formatrangetoparts-relevant-extensions.js:1776:9 > stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default: > ERROR: Unexpected exit code: 3 > FAIL: > stress/intl-datetimeformat-formatrangetoparts-relevant-extensions.js.default Please skip them, or just adjust it. I have no ability to support all ICU versions. The supported ones are ICU 64, 66, and 67 in my patch. Committed r269791: <https://trac.webkit.org/changeset/269791> |