For a very dilute acid solution,the contribution of $H_3O^+$ from the auto-ionization of water cannot be neglected.
$HCl_{(aq)} + H_2O_{(l)} \rightarrow H_3O^+_{(aq)} + Cl^-_{(aq)}$
$[H_3O^+]_{HCl} = 1.0 \times 10^{-8} \ M$
Let $x$ be the concentration of $H_3O^+$ produced by the auto-ionization of water: $2H_2O_{(l)} \rightleftharpoons H_3O^+_{(aq)} + OH^-_{(aq)}$.
Total $[H_3O^+] = (1.0 \times 10^{-8} + x)$ and $[OH^-] = x$.
$K_w = [H_3O^+][OH^-] = (1.0 \times 10^{-8} + x)(x) = 1.0 \times 10^{-14}$
$x^2 + 10^{-8}x - 10^{-14} = 0$
Using the quadratic formula $x = \frac{-b + \sqrt{b^2 - 4ac}}{2a}$:
$x = \frac{-10^{-8} + \sqrt{(10^{-8})^2 - 4(1)(-10^{-14})}}{2} = \frac{-10^{-8} + \sqrt{10^{-16} + 4 \times 10^{-14}}}{2} \approx 0.95 \times 10^{-7} \ M$
Total $[H_3O^+] = 1.0 \times 10^{-8} + 0.95 \times 10^{-7} = 1.05 \times 10^{-7} \ M$
$pH = -\log[H_3O^+] = -\log(1.05 \times 10^{-7}) \approx 6.98$.