microsoft / microsoft/TypeScript
The type of Document.documentElement could be SVGSVGElement
オープン
まだ誰も着手していません。
Revisit
Suggestion
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
Currently, the type of Document.documentElement is HTMLElement:
But it is possible for a Document’s documentElement property to be of type SVGSVGElement which is not a subtype of HTMLElement:
Try to run the following code:
const d = (new DOMParser()).parseFromString('<svg xmlns="http://www.w3.org/2000/svg"></svg>', 'image/svg+xml');
const k = (d instanceof Document) && (d.documentElement instanceof SVGSVGElement);
the value of k should be true.
Also, why isn’t there a SVGDocument in TypeScript?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
lib/lib.dom.d.ts、Document.documentElement にリンクされた宣言から始め、DOMParser の SVG 例を再現します。DOM typings が示された SVG documentElement を正しく受け入れ、issue の SVGDocument に関する問題が解決され、関連する宣言チェックに合格すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- frontend
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100