Skip to content

Implement viewport meta parsing in HTMLMetaElement and apply to window dimensions #236

@yorkie

Description

@yorkie

Implement parsing of the meta[name="viewport"] tag in HTMLMetaElement according to the MDN specification.

Requirements:

  • Parse the content attribute of <meta name="viewport">, extracting values such as width, height, initial-scale, maximum-scale, minimum-scale, and user-scalable following the rules and supported keywords as described by the MDN documentation.
  • Ensure the parser is robust, handling whitespace, missing values, and invalid input gracefully.
  • After parsing, apply the parsed width and height values to control the window's logical dimensions.
  • Support dynamic updates if the meta tag changes after initial parsing.
  • Provide tests for various viewport meta tag scenarios and expected window size changes.
  • Document the implementation and any limitations or differences from browser behavior.

Acceptance Criteria:

  • HTML containing <meta name="viewport" content="width=640,height=480"> sets window width to 640 and height to 480.
  • Changing the meta tag at runtime updates window dimensions accordingly.
  • Parsing is consistent with behavior described in MDN and common browser implementations.
  • Tests pass for a variety of valid and invalid viewport meta configurations.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions