Skip to content
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

Using pageYOffset & pageXOffset #1176

Merged
merged 3 commits into from
Feb 25, 2018
Merged

Using pageYOffset & pageXOffset #1176

merged 3 commits into from
Feb 25, 2018

Conversation

arxpoetica
Copy link
Member

Okay, feeling a little apprehensive about this one. Discussion about this over here: https://gitter.im/sveltejs/svelte?at=5a859561d74ee9f50dcac27b

Normally I'd try to push up something more complete, but I need to just get my feet wet to learn; trial and error. I wanted to push this up to get eyes on it so I could learn through that process. Thanks for being patient with me.

Right now there's one failing test which I think actually makes sense <<js window-binding-scroll>>, but I need to dig into it a little more.

See: #1175

@Rich-Harris
Copy link
Member

thank you! Is there any reason to keep scrollX and scrollY (internally I mean, we should definitely keep bind:scrollX and bind:scrollY)? There doesn't seem to be any downside to replacing window.pageXOffset || window.scrollX with window.pageXOffset everywhere (since pageXOffset is usually zero, using both just means doing two property lookups instead of one in most cases).

@arxpoetica
Copy link
Member Author

According to MDN there's no reason—that's just my conservative caution. ;) Happy to just do the one if you think it's better.

@arxpoetica
Copy link
Member Author

Also, when you have a chance, can you spot check my changes? I don't know the code base well enough to know if I've touched anything that I shouldn't have.

@Rich-Harris
Copy link
Member

the changes are all 💯 — though yeah, I think we should just use pageXOffset and pageYOffset

@Rich-Harris
Copy link
Member

btw i think that one failing test relates to this block: https://github.com/sveltejs/svelte/blob/master/src/generators/nodes/Window.ts#L103-L105

@codecov-io
Copy link

codecov-io commented Feb 25, 2018

Codecov Report

Merging #1176 into master will increase coverage by <.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1176      +/-   ##
==========================================
+ Coverage   91.63%   91.63%   +<.01%     
==========================================
  Files         127      127              
  Lines        4565     4567       +2     
  Branches     1502     1503       +1     
==========================================
+ Hits         4183     4185       +2     
  Misses        160      160              
  Partials      222      222
Impacted Files Coverage Δ
src/generators/nodes/Window.ts 80.28% <66.66%> (+0.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0648998...e95a0b6. Read the comment docs.

@Rich-Harris Rich-Harris merged commit 8aaf92a into master Feb 25, 2018
@Rich-Harris Rich-Harris deleted the gh-1175 branch February 25, 2018 14:00
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.

3 participants