Skip to content

Commit 4ead6b5

Browse files
authored
Treat <time> tag as a normal HTML tag. (#19951)
<time> tag has been supported by Chrome since Chrome 62.0. Remove workarounds which were in place to avoid friction with versions before Chrome 62. Signed-off-by: Shivam Sandbhor <[email protected]>
1 parent 1992d97 commit 4ead6b5

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

packages/react-dom/src/__tests__/ReactDOMComponent-test.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,10 +1273,6 @@ describe('ReactDOMComponent', () => {
12731273
if (this instanceof window.HTMLUnknownElement) {
12741274
return '[object HTMLUnknownElement]';
12751275
}
1276-
// Special case! Read explanation below in the test.
1277-
if (this instanceof window.HTMLTimeElement) {
1278-
return '[object HTMLUnknownElement]';
1279-
}
12801276
return realToString.apply(this, arguments);
12811277
};
12821278
Object.prototype.toString = wrappedToString; // eslint-disable-line no-extend-native
@@ -1289,11 +1285,6 @@ describe('ReactDOMComponent', () => {
12891285
'The tag <foo> is unrecognized in this browser',
12901286
);
12911287
ReactTestUtils.renderIntoDocument(<foo />);
1292-
// This is a funny case.
1293-
// Chrome is the only major browser not shipping <time>. But as of July
1294-
// 2017 it intends to ship it due to widespread usage. We intentionally
1295-
// *don't* warn for <time> even if it's unrecognized by Chrome because
1296-
// it soon will be, and many apps have been using it anyway.
12971288
ReactTestUtils.renderIntoDocument(<time />);
12981289
// Corner case. Make sure out deduplication logic doesn't break with weird tag.
12991290
expect(() =>

packages/react-dom/src/client/ReactDOMComponent.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ let normalizeHTML;
112112

113113
if (__DEV__) {
114114
warnedUnknownTags = {
115-
// Chrome is the only major browser not shipping <time>. But as of July
116-
// 2017 it intends to ship it due to widespread usage. We intentionally
117-
// *don't* warn for <time> even if it's unrecognized by Chrome because
118-
// it soon will be, and many apps have been using it anyway.
119-
time: true,
120115
// There are working polyfills for <dialog>. Let people use it.
121116
dialog: true,
122117
// Electron ships a custom <webview> tag to display external web content in

0 commit comments

Comments
 (0)