Skip to content

Final clean-ups in <input>#2789

Merged
domenic merged 3 commits intojsdom:masterfrom
TimothyGu:last-inputs
Feb 1, 2020
Merged

Final clean-ups in <input>#2789
domenic merged 3 commits intojsdom:masterfrom
TimothyGu:last-inputs

Conversation

@TimothyGu
Copy link
Copy Markdown
Member

This is rebased on top of #2786. Creating a draft for Travis to take a look at it first.

@TimothyGu TimothyGu marked this pull request as ready for review January 14, 2020 19:14
@domenic
Copy link
Copy Markdown
Member

domenic commented Jan 18, 2020

The tests are failing here, and I still think that we need tests for the decimal changes.

@TimothyGu
Copy link
Copy Markdown
Member Author

TimothyGu commented Jan 22, 2020

I spent quite a bit of time trying to make a test case for the decimal change but so far I haven’t been able to. I did uncover some discrepancies between Firefox and Chrome with regards to precision though, even they are both using a big decimal implementation. (The same test has the same results in jsdom before/after the change.) The tricky part is that the spec doesn’t seem to mandate a specific level of precision, so it’s unclear who exactly is correct.

I’ll fix the test failure when I get to it.

@TimothyGu
Copy link
Copy Markdown
Member Author

In light of whatwg/html#5207, I'd rather not add tests for the decimal change. We already know that it "works" in the sense that it doesn't regress what used to work. Otherwise, fixed the test failures.

@domenic
Copy link
Copy Markdown
Member

domenic commented Jan 24, 2020

But, why include it at all, if it doesn't help us in a testable observable way? What if we regress, with no tests to catch us? I'd rather remove that change, if we don't think it's worth testing.

@domenic
Copy link
Copy Markdown
Member

domenic commented Jan 25, 2020

I'm going to pull the other two commits into master :)

@domenic
Copy link
Copy Markdown
Member

domenic commented Jan 25, 2020

Oh, I guess that isn't so straightforward, since the third depends on the under-discussion second. Nevermind, for now!

This is more consistent with the rest of jsdom.

Also make sure there is no Unicode whitespace before the number appears.
stepMismatch currently has its own way of checking whether the value is
aligned, even though the _isStepAligned function was written for this
very purpose. Move the decimal.js-based modulo check to _isStepAligned,
and make stepMismatch use that function instead.

Also rename the parameter for _stepAlign so that it makes more sense.
It is not a concept in the spec, and the call sites were awkward with it
anyway.
@TimothyGu
Copy link
Copy Markdown
Member Author

Okay, I've removed the controversial change to _stepAlign and the commit is now a simple refactoring. See if this works better.

@domenic domenic merged commit 7597537 into jsdom:master Feb 1, 2020
@TimothyGu TimothyGu deleted the last-inputs branch February 1, 2020 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants