revisit(Gadget gadget,
List<Node> nodes)
For css:
Link tags are first split into buckets separated by tags with mediaType == "all"
/ title attribute different from their previous link tag / nodes that are
not 'link' tags.
For css:
Link tags are first split into buckets separated by tags with mediaType == "all"
/ title attribute different from their previous link tag / nodes that are
not 'link' tags.
This ensures that the buckets can be processed separately without losing title /
"all" mediaType information.
Link tags with same mediaType are concatenated within each bucket.
This exercise ensures that css information is loaded in the same relative order
as that of the original html page, and that the css information within
mediaType=="all" is retained and applies to all media types.
Look at the areLinkNodesBucketable method for details on mediaType=="all" and
title attribute
Example: Assume we have the following node list. (all have same parent,
nodes between Node6 and Node12 are non link nodes, and hence did not come
to revisit() call)
-- Node1
-- Node2
-- Node3
-- Node4
-- Node5
-- Node6
-- Node12
-- Node13
First we split to buckets bassed on the adjacency and other conditions.
buckets - [ [ Node1, Node2, Node3 ], [ Node4, Node 5 ], [ Node6 ], [ Node12, Node13 ]
Within each bucket we group them based on media type.
batches - [ Node1, Node2, Node3 ] --> [ [Node1, Node3], [Node2] ]
- [ Node4, Node 5 ] --> [ [ Node4, Node 5 ] ]
- [ Node6 ] --> [ [ Node6 ] ]
- [ Node12, Node13 ] --> [ [ Node12, Node13 ] ]
Refer Tests for more examples.