Auto merge of #18243 - DominoTree:18224, r=stshine
Auto merge of #18243 - DominoTree:18224, r=stshine

[18224] Check if line_count is zero to calculate space around line

<!-- Please describe your changes on the following line: -->
Check line_count before attempting to calculate space around line

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #18224 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because changes are minimal and the error was triggered by a test

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18243)
<!-- Reviewable:end -->

avadacatavra/servo,SimonSapin/servo,canaltinova/servo,emilio/servo,mattnenterprise/servo,nnethercote/servo,nnethercote/servo,upsuper/servo,saneyuki/servo,fiji-flo/servo,cbrewster/servo,cbrewster/servo,KiChjang/servo,sadmansk/servo,mbrubeck/servo,SimonSapin/servo,thiagopnts/servo,fiji-flo/servo,nnethercote/servo,szeged/servo,KiChjang/servo,notriddle/servo,peterjoel/servo,CJ8664/servo,mattnenterprise/servo,cbrewster/servo,pyfisch/servo,pyfisch/servo,anthgur/servo,upsuper/servo,pyfisch/servo,avadacatavra/servo,dati91/servo,eddyb/servo,mattnenterprise/servo,rnestler/servo,notriddle/servo,saneyuki/servo,dati91/servo,cbrewster/servo,CJ8664/servo,mattnenterprise/servo,mattnenterprise/servo,dati91/servo,saneyuki/servo,mattnenterprise/servo,peterjoel/servo,ConnorGBrewster/servo,rnestler/servo,pyfisch/servo,mbrubeck/servo,dati91/servo,ConnorGBrewster/servo,DominoTree/servo,canaltinova/servo,SimonSapin/servo,emilio/servo,nnethercote/servo,dati91/servo,dsandeephegde/servo,sadmansk/servo,pyfisch/servo,dsandeephegde/servo,dsandeephegde/servo,peterjoel/servo,emilio/servo,mbrubeck/servo,nnethercote/servo,avadacatavra/servo,emilio/servo,upsuper/servo,mattnenterprise/servo,rnestler/servo,dsandeephegde/servo,canaltinova/servo,paulrouget/servo,emilio/servo,szeged/servo,paulrouget/servo,nnethercote/servo,mbrubeck/servo,peterjoel/servo,ConnorGBrewster/servo,eddyb/servo,CJ8664/servo,emilio/servo,saneyuki/servo,dati91/servo,larsbergstrom/servo,canaltinova/servo,splav/servo,splav/servo,cbrewster/servo,eddyb/servo,paulrouget/servo,szeged/servo,larsbergstrom/servo,paulrouget/servo,peterjoel/servo,larsbergstrom/servo,pyfisch/servo,larsbergstrom/servo,SimonSapin/servo,dsandeephegde/servo,upsuper/servo,KiChjang/servo,szeged/servo,szeged/servo,fiji-flo/servo,thiagopnts/servo,mattnenterprise/servo,jimberlage/servo,paulrouget/servo,SimonSapin/servo,nnethercote/servo,upsuper/servo,KiChjang/servo,sadmansk/servo,DominoTree/servo,anthgur/servo,pyfisch/servo,dati91/servo,cbrewster/servo,szeged/servo,KiChjang/servo,eddyb/servo,upsuper/servo,thiagopnts/servo,mbrubeck/servo,paulrouget/servo,KiChjang/servo,canaltinova/servo,canaltinova/servo,jimberlage/servo,notriddle/servo,dsandeephegde/servo,notriddle/servo,rnestler/servo,jimberlage/servo,ConnorGBrewster/servo,CJ8664/servo,emilio/servo,larsbergstrom/servo,avadacatavra/servo,SimonSapin/servo,anthgur/servo,splav/servo,larsbergstrom/servo,peterjoel/servo,cbrewster/servo,splav/servo,nnethercote/servo,DominoTree/servo,mbrubeck/servo,sadmansk/servo,avadacatavra/servo,KiChjang/servo,avadacatavra/servo,jimberlage/servo,sadmansk/servo,KiChjang/servo,eddyb/servo,splav/servo,cbrewster/servo,rnestler/servo,saneyuki/servo,DominoTree/servo,szeged/servo,saneyuki/servo,eddyb/servo,avadacatavra/servo,nnethercote/servo,CJ8664/servo,splav/servo,mbrubeck/servo,emilio/servo,emilio/servo,jimberlage/servo,saneyuki/servo,jimberlage/servo,eddyb/servo,szeged/servo,jimberlage/servo,notriddle/servo,sadmansk/servo,ConnorGBrewster/servo,notriddle/servo,rnestler/servo,canaltinova/servo,larsbergstrom/servo,ConnorGBrewster/servo,larsbergstrom/servo,eddyb/servo,SimonSapin/servo,rnestler/servo,notriddle/servo,upsuper/servo,splav/servo,notriddle/servo,thiagopnts/servo,emilio/servo,mbrubeck/servo,larsbergstrom/servo,paulrouget/servo,peterjoel/servo,saneyuki/servo,KiChjang/servo,pyfisch/servo,DominoTree/servo,splav/servo,peterjoel/servo,paulrouget/servo,peterjoel/servo,saneyuki/servo,szeged/servo,fiji-flo/servo,canaltinova/servo,notriddle/servo,CJ8664/servo,DominoTree/servo,ConnorGBrewster/servo,DominoTree/servo,CJ8664/servo,pyfisch/servo,dati91/servo,upsuper/servo,anthgur/servo,rnestler/servo,jimberlage/servo,dsandeephegde/servo,thiagopnts/servo,splav/servo,SimonSapin/servo,fiji-flo/servo,anthgur/servo,saneyuki/servo,dsandeephegde/servo,notriddle/servo,DominoTree/servo,jimberlage/servo,DominoTree/servo,pyfisch/servo,peterjoel/servo,szeged/servo,fiji-flo/servo,CJ8664/servo,paulrouget/servo,thiagopnts/servo,thiagopnts/servo,sadmansk/servo,anthgur/servo,larsbergstrom/servo,fiji-flo/servo,splav/servo,sadmansk/servo,nnethercote/servo,anthgur/servo,thiagopnts/servo,KiChjang/servo,anthgur/servo,fiji-flo/servo,DominoTree/servo,avadacatavra/servo,ConnorGBrewster/servo,paulrouget/servo