Skip to content

Document conditions for popup-opening by window.open, and BarProp values - #10339

Merged
sideshowbarker merged 23 commits into
mdn:mainfrom
arai-a:window-open-popup
Nov 9, 2021
Merged

sideshowbarker merged 23 commits into
mdn:mainfrom
arai-a:window-open-popup

Conversation

@arai-a

@arai-a arai-a commented Nov 7, 2021 •

Copy link
Copy Markdown
Contributor

for whatwg/html#6530

  • Added popup feature
  • Added description about requesting popup
  • Changed examples not to use the backward-compat-only UI parts features
  • Updated BarProp.visible to reflect popup request
  • Moved outerWidth/outerHeight to obsolete features page

Summary

Update windowFeatures parameter behavior for window.open, and also BarProp.visible behavior, to follow the spec change in whatwg/html#6530.

Motivation

Reflect the latest spec.

Supporting details

Firefox: fixed in 96 (currently Nightly) https://bugzilla.mozilla.org/show_bug.cgi?id=1701001
Chrome: in progress https://bugs.chromium.org/p/chromium/issues/detail?id=1192701
Safari: bug is filed https://bugs.webkit.org/show_bug.cgi?id=223751

Related issues

Metadata

  • Adds a new document
  • Rewrites (or significantly expands) a document
  • Fixes a typo, bug, or other error

…Prop values

for whatwg/html#6530

 * Added popup feature
 * Added description about requesting popup
 * Changed examples not to use the backward-compat-only UI parts features
 * Updated BarProp.visible to reflect popup request
 * Moved outerWidth/outerHeight to obsolete features page
@arai-a
arai-a requested review from a team and sideshowbarker and removed request for a team November 7, 2021 01:25
@github-actions github-actions Bot added the Content:WebAPI Web API docs label Nov 7, 2021
@github-actions

github-actions Bot commented Nov 7, 2021 •

Copy link
Copy Markdown
Contributor

Preview URLs

Flaws

Note! 2 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/API/Window/open/Obsolete_features
Title: Obsolete features
on GitHub
Flaw count: 2

  • broken_links:
    • Is currently http:// but can become https://
    • Is currently http:// but can become https://

External URLs

URL: /en-US/docs/Web/API/BarProp/visible
Title: BarProp.visible
on GitHub

No new external URLs


URL: /en-US/docs/Web/API/Window/open
Title: Window.open()
on GitHub


URL: /en-US/docs/Web/API/Window/open/Obsolete_features
Title: Obsolete features
on GitHub

No new external URLs

(this comment was updated 2021-11-08 08:39:53.537455)

Remove unnecessary hash for fragment
@arai-a

arai-a commented Nov 7, 2021

Copy link
Copy Markdown
Contributor Author

Sorry, my description was unclear.

for "popup" feature, "not-present" and "present with disabled" has different semantics.
"not-present" fallback to other conditions, and "present with disabled" explicitly "don't request" without checking other features.
https://html.spec.whatwg.org/#popup-window-is-requested

@sideshowbarker

Copy link
Copy Markdown
Member

Sorry, my description was unclear.

for "popup" feature, "not-present" and "present with disabled" has different semantics.
"not-present" fallback to other conditions, and "present with disabled" explicitly "don't request" without checking other features.
https://html.spec.whatwg.org/#popup-window-is-requested

Ok, thanks ー I'll make another edit to re-correct that

@arai-a

arai-a commented Nov 7, 2021

Copy link
Copy Markdown
Contributor Author

the basic algorithm that the document is supposed to cover is that:

  • if "popup" is present, then:
    • if enabled (boolean value is true), then request popup
    • otherwise, do not request popup
  • otherwise:
    • if windowFeatures is empty, then do not request popup
    • otherwise:
      • if there's any other feature than noopener and noreferer, then request popup
        • (this has more complex backward-compat condition about UI features, but I don't want to describe it in the document, for simplicity)
      • otherwise, do not request popup

so I mentioned about popup in position and size (left/top/width/height),
and not mentioned about popup in noopener/noreferer.

the "not present" case is covered by "Otherwise" -> "Otherwise, no popup is requested.", that's after "Specifying any features in the _windowFeatures_ parameter other than `noopener` or `noreferer` has the effect of also requesting a popup." part.
so I think it's better omitting the "not present" case from the first section.
@arai-a

arai-a commented Nov 7, 2021

Copy link
Copy Markdown
Contributor Author

oh, I thought the description becomes comment instead of commit message.

anyway, thank you for reviewing :)
I think it's better omitting the "not present" case from the first section, and let the later "Otherwise" handle it,
so that it checks other features.

@arai-a

arai-a commented Nov 7, 2021

Copy link
Copy Markdown
Contributor Author

the difference is that:
width=500,height=500 (not present) requests popup, and
width=500,height=500,popup=no (present and disabled) doesn't request popup.

(in both case, whether to handle width/height, and whether to open new window or tab, are browser-dependent)

@sideshowbarker

Copy link
Copy Markdown
Member

oh, I thought the description becomes comment instead of commit message.

anyway, thank you for reviewing :) I think it's better omitting the "not present" case from the first section, and let the later "Otherwise" handle it, so that it checks other features.

Please go ahead and commit a change for that

@arai-a

arai-a commented Nov 7, 2021

Copy link
Copy Markdown
Contributor Author

done in dbd3667

@sideshowbarker

Copy link
Copy Markdown
Member

@arai-a Please re-review the current state of the content in the branch. If it all looks accurate to you, then I will merge it later this afternoon. (Right now I’m going to take a break for a couple hours or so.)

@arai-a

arai-a commented Nov 7, 2021

Copy link
Copy Markdown
Contributor Author

Thank you again!

tweaked the position/size description not to mention boolean feature handling.
otherwise it looks good :)

@sideshowbarker

Copy link
Copy Markdown
Member

Sorry! Only just now realized I’d forgotten to merge this…

@sideshowbarker sideshowbarker changed the title Standardize the condition for opening a popup by window.open, and BarProp values Document conditions for popup-opening by window.open, and BarProp values Nov 9, 2021
@sideshowbarker
sideshowbarker merged commit df7ff9b into mdn:main Nov 9, 2021
@sideshowbarker

Copy link
Copy Markdown
Member

@arai-a Really great work (including the related spec work you did) — congrats on landing your first docs change here, and welcome aboard 🎉

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Content:WebAPI Web API docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants