In the chi-squared test of independence for a $r\times c$ contingency table, the degrees of freedom are set as $(r-1)(c-1)$, which can be seen as a goodness-of-fit test with $n - 1 - s$ degrees of freedom where $n = rc$ is the number of categories and $s = (r-1) + (c-1)$ is due to fitting the row and column marginal probabilities to the data.
If the experiment is such that the row sums are pre-determined, I think the test becomes a test of homogeneity, which according to Wikipedia has the same degrees of freedom. However, as only the column marginal probabilities need to be fitted from the data, it seems like one should use $s = c - 1$. Why is this not the case? Maybe some other intuition than the analogy to the goodness-of-fit test is more adequate.