-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
Implement parsing of the meta[name="viewport"] tag in HTMLMetaElement according to the MDN specification.
Requirements:
- Parse the
contentattribute of<meta name="viewport">, extracting values such aswidth,height,initial-scale,maximum-scale,minimum-scale, anduser-scalablefollowing 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
widthandheightvalues 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.
Copilot
Metadata
Metadata
Assignees
Labels
No labels