The 10-year-old John would have been the next king according to the line of succession.
The sentence implies that John's age and position within the line of succession would have made him the next monarch had he lived.