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>
commit0c06aa308fe1006ceb532fd61199309f42fb56df
parent9af24c8bfccabad8d1b9408a9dcab6f228a59d03
authorRobert Löhning <robert.loehning@qt.io>
committerRobert Löhning <robert.loehning@qt.io>
commit timeMon, 7 Sep 2026 06:36:37 +0000