Skip to content

Get Element Tag Name case inconsistencies #1956

@juliandescottes

Description

@juliandescottes

Specification for Get Element Tag Name

Let qualified name be the result of getting element's tagName IDL attribute.

Specification for tagName

The tagName getter steps are to return this’s HTML-uppercased qualified name.

Based on this we should return an uppercase string. However historically, Chrome and Firefox have returned lowercase strings, while Safari was returning uppercase strings. This was illustrated by the test test_get_element_tag_name in. https://wpt.fyi/results/webdriver/tests/classic/get_element_tag_name/get.py?label=master&label=experimental&aligned&q=tests%2Fclassic%2Fget_element_tag_name which incorrectly expected a lowercase string until web-platform-tests/wpt#58756 and servo/servo#43673

For Firefox we started changing the implementation to align with the test at https://bugzilla.mozilla.org/show_bug.cgi?id=2026697. While doing so we also updated another wdspec test with wrong expectations: https://wpt.fyi/results/webdriver/tests/classic/get_element_tag_name/user_prompts.py?label=master&label=experimental&aligned&q=%2Fclassic%2Fget_element_tag_name%2Fuser_prompts.py

But due to regressions in existing 3rd party tests, we rolled back the change and we should probably discuss if we want to change the behavior or update the spec, either to add a Note that some implementations are incorrectly returning lowercase, or to say that the implementations can return either uppercase or lowercase. Ideally of course it would be better to just return uppercase everywhere, but at this point I'm not sure there is a clean path to update this for Chrome and Firefox without breaking a lot of consumers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions