-
Notifications
You must be signed in to change notification settings - Fork 943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle case-sensitive attributes like viewBox. #376
Conversation
2eabf98
to
8829761
Compare
Looking good so far! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, need to fix a test
src/test/lit-html_test.ts
Outdated
assert.equal( | ||
stripExpressionDelimeters(container.innerHTML), | ||
'<svg viewBox="0 0 100 100"></svg>'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Edge test to pass, apparently need to strip the extra xmlns
attribute when asserting. And they helpfully render the innerHTML as a self-closing tag, apparently. Sigh.
expected '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" />' to equal '<svg viewBox="0 0 100 100"></svg>'
Maybe just change it to
assert.match(stripExpressionDelimeters(container.innerHTML), /viewBox="0 0 100 100"/);
src/lit-html.ts
Outdated
// so that on XML nodes with case-sensitive getAttribute() we can | ||
// still find the attribute, which will have been lower-cased by | ||
// the parser. | ||
const attributeLookupName = /^[a-zA-z-]*$/.test(attributeNameInPart) ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The A-z
looks like a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely. Nice catch
Fixes #374