Contradiction about outerWidth on window between API documentation and migration guide

オープン
#1,199 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
documentation

調査の方向性

outerWidth と outerHeight の API ドキュメントを、window のスクロールバーの寸法に関する jQuery 3.0 移行ガイドのセクションと併せて読みます。どの記述が矛盾しているかを確認し、window に対するこれらのメソッドの動作が移行ガイドと一貫して説明されるようにドキュメントを更新します。outerWidth() と outerHeight() の両方が扱われていることを確認します。

索引モデルが issue の本文から書いたものです。

説明

outerwidth() documentation currently states:

This method is not applicable to window and document objects; for these, use .width() instead.

But the jQuery 3.0 migration guide states:

Breaking change: .outerWidth() or .outerHeight() on window includes scrollbar width/height

Calls to $(window).width() return the "content width" which excludes any scrollbars that the browser has added if the content exceeds the height of the element. This is different from the width that CSS uses for media queries, which includes the width of the scrollbars. In order to provide a measure that is equivalent to the CSS media query concept of width, the $(window).outerWidth() method now returns the width including scrollbar width. This is equivalent to the DOM property window.innerWidth. The same applies for .outerHeight().

So it seems to me either the API documentation is obsolete about outerWidth() not being applicable to window, or the migration guide is wrong telling us to call outerWidth() on window to get its "CSS width". This is confusing.

There is the same trouble with .outerHeight() documentation.

主要言語
HTML
スター
324
フォーク
259
平均マージ
1日 30分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

jquery/api.jquery.com のほかの issue

jquery/api.jquery.com の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。