JSDOMParser: Element is missing a lang accessor
@josuesto がすでに取り組んでいます。
2026年10月8日 から。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript
- 領域
- web-dev
調査の方向性
JSDOMParser の Element の属性アクセサーを見つけ、周辺の実装を調査します。issue に示されている lang プロパティの動作を追加し、その後 documentElement.lang が lang 属性を反映し、そこへの代入によって属性が更新されることを確認します。
索引モデルが issue の本文から書いたものです。
説明
JSDOMParser's Element reflects several HTML attributes as properties such as className, id, href, src, srcset, but not lang. Code that reads doc.documentElement.lang gets undefined on a JSDOMParser document, and the language tag on a real DOM document.
Readability itself is not broken by this. It reads the value with getAttribute("lang") (Readability.js:1071) and exposes it as lang on the parse result. The problem hits consumers that take a document back from JSDOMParser and read the DOM property.
Firefox for Android's Reader View hit exactly this. It caches a parsed document, reloads it through JSDOMParser, and read doc.documentElement.lang, which gave no language on the cached path. We worked around it with getAttribute, but the accessor is worth having so the parser matches the DOM.
See also: Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=2062976
Suggested fix
Add the accessor next to the others:
get lang() {
return this.getAttribute("lang") || "";
},
set lang(str) {
this.setAttribute("lang", str);
},
- 主要言語
- JavaScript
- スター
- 11.5k
- フォーク
- 737
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
mozilla/readability のほかの issue
-
PHRASING_ELEMS missing <u>, <s>, and <bdi> elements causes paragraph splitting対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mozilla/readability#997 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
mozilla/readability#1031 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
mozilla/readability#1029 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
mozilla/readability#1024 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
mozilla/readability#1021 ·
mozilla/readability の issue をすべて見る
似ている issue
-
Add: EUROTV NEWSオープンchannels:add check:passed
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
curriculum documentation quality
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
githubnext/gh-aw-workshop#4638 ·
メンテナーはふだん 1 日以内に返信
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
openclaw/openclaw-enterprise#2571 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fabriziosalmi/certmate#1247 ·
メンテナーはふだん 1 日以内に返信
-
[guide] docs/metrics/index.md names retired 'Import reference architectures' workflow as the metrics refresh path対応中かも @hivecommons-hive が今日担当しました。 オープンagent/guide documentation hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
cncf/endusers#1537 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信