Skip to content

Commit

Permalink
Treat <time> tag as a normal HTML tag. (#19951)
Browse files Browse the repository at this point in the history
<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 <shivam.sandbhor@gmail.com>
  • Loading branch information
sbs2001 committed Oct 6, 2020
1 parent 1992d97 commit 4ead6b5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
9 changes: 0 additions & 9 deletions packages/react-dom/src/__tests__/ReactDOMComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1273,10 +1273,6 @@ describe('ReactDOMComponent', () => {
if (this instanceof window.HTMLUnknownElement) {
return '[object HTMLUnknownElement]';
}
// Special case! Read explanation below in the test.
if (this instanceof window.HTMLTimeElement) {
return '[object HTMLUnknownElement]';
}
return realToString.apply(this, arguments);
};
Object.prototype.toString = wrappedToString; // eslint-disable-line no-extend-native
Expand All @@ -1289,11 +1285,6 @@ describe('ReactDOMComponent', () => {
'The tag <foo> is unrecognized in this browser',
);
ReactTestUtils.renderIntoDocument(<foo />);
// This is a funny case.
// Chrome is the only major browser not shipping <time>. But as of July
// 2017 it intends to ship it due to widespread usage. We intentionally
// *don't* warn for <time> even if it's unrecognized by Chrome because
// it soon will be, and many apps have been using it anyway.
ReactTestUtils.renderIntoDocument(<time />);
// Corner case. Make sure out deduplication logic doesn't break with weird tag.
expect(() =>
Expand Down
5 changes: 0 additions & 5 deletions packages/react-dom/src/client/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@ let normalizeHTML;

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

0 comments on commit 4ead6b5

Please sign in to comment.