Replace QSvgNode::document() by passing parameters
The old implementation traversed all nodes up to the root QSvgDocument
to find it. Because this happened again and again for each added node,
it could take a while in deeply nested documents.
Instead of that, we now pass the pointer to the document as parameter.
In most places, we do this as just another member to QSvgExtraStates
which was passed anyway.
The edited test demonstrates the faster execution.
Pick-to: 6.12
Change-Id: I1d2020ac9ced6d31a17bb3e085fe4833c2543378
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>