Filter out empty ID in attribute changed callback
Per spec [1], empty ID attributes must be treated identically as nonexistent. This CL implements these steps faithfully, and results in DocumentFragment::getElementById() always returning nullptr when the empty string is given, thus fixing bug 1068580. Additionally, previously Document::getElementById() explicitly returned nullptr when the empty string or the null string is given. The empty string handling is no longer necessary after this CL, and thus removed. (The null string handling is still necessary for internal C++ code that relies on the short-circuiting behavior). [1]: https://dom.spec.whatwg.org/#concept-id Change-Id: Ia65024efef9e5ef54d9db233590a17b372282ed1 Fixed: 1068580 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2140054Reviewed-by:Kent Tamura <tkent@chromium.org> Commit-Queue: Timothy Gu <timothygu@chromium.org> Cr-Commit-Position: refs/heads/master@{#757310}
Showing
Please register or sign in to comment