Repository navigation
Generate reasonable markup even if tags have unexpected case. - #4188
Conversation
When you're done, can you squash your commits? |
|
@spicyj I think that covers everything. Let me know if there is anything else :) |
|
I'm not sure this is the right solution. The HTML DOM allows case insensitive definitions and it might even be encouraged to use capitalization for certain custom elements. Shouldn't we just make our |
|
@sebmarkbage while that would fix the actual bug, I think it would be confusing to users, that What would the error message say? Self closing elements must be lowercase!
Are custom elements even supported by React? I thought it was just these dom nodes If so, maybe allow the different cases but downcase the tag name when checking it here and here. Or only check case sensitivity on the dom nodes defined in the linked above. Either way, enforcing strict casing on a subset of the DOM, because of a bug feels wrong. |
|
I didn't mean that we should enforce a strict casing on a subset. We should not enforce it on anything. I.e. downcase here https://github.com/facebook/react/blob/master/src/renderers/dom/shared/ReactDOMComponent.js#L533 |
|
@sebmarkbage got it. Should I make that change now, or does @spicyj need to sign off? Just not sure how the process here works, and don't want to waste effort. Thanks! |
|
@sebmarkbage is the ultimate authority; a go-ahead from him is generally enough to do anything :). I'm fairly certain that @spicyj won't object to this proposed solution. Go ahead and make the change :). |
|
No objections here. |
|
@sebmarkbage doesn't always win! |
|
Haha, true, but he has a pretty good track record :P. |
|
$40 says I don't always win. |
|
That's true too. // Note to self: never bet against @spicyj. |
|
I'm always right because I change my mind. Doesn't mean you should listen to my initial inclination. Unlike American politics I think we should value new input. :) |
54ccc22 to
43a4d77
Compare
|
ok, ok, enough fun. New diff is up, back on topic. @jisaacks And also lint requires a trailing comma on line 459. |
|
All the switch statements too for custom form components (incl. |
|
OK new commit coming in just a minute. |
TIL. I guess we might want to support XHTML though. Sigh. Browsers. |
|
Is XHTML really a thing yet? Are browsers even supporting it? Maybe we should have a special build for that. If we support XHTML then they aren't insensitive anymore. |
8479e96 to
e28ea23
Compare
|
@sebmarkbage let me know if that looks good. |
|
To keep things maximally general, it seems intuitively better to avoid mangling the input whenever possible. The more transparent we can be (ie. the closer we can be to passing inputs straight through) the better. I could see people wanting case sensitivity, as we see with things like SVG and XHTML and WebComponents. That said, I'm not strongly attached to preserving case sensitivity. This one doesn't bother me quite as much as the unitless numbers bug does. In this latest diff, it looks like we're using upper case for the open tag and lower case for the closing tag? That can't be right :P, unless I'm miss-reading something? |
|
Yea, we should probably use the same for the closing tag too. I figured it didn't matter because of case-insensitive parsing and we only really want to preserve the case for purposes of debugging since it shouldn't matter for anything else. However, for safety, and our own well being we should probably use the same case in the closing case too. |
There was a problem hiding this comment.
There was a problem hiding this comment.
Yep Alright pushed that change up :)
|
@sebmarkbage @jimfb closing tag should match now :) |
Generate reasonable markup even if tags have unexpected case.
|
Ok, thanks @jisaacks! Sorry about all the back and forth, but this is a good change! Much appreciated! |
|
@jimfb no worries! Thanks! :) |
Generate reasonable markup even if tags have unexpected case.
Generate reasonable markup even if tags have unexpected case.
Fixes #2756