1. A method implemented at least partially by a processor, the method comprising: sharing a resource between two or more different web entities that are contending for the resource, wherein a web entity includes a principal instance, the sharing being based at least in part on one or more of instructions from a resource allocation policy including: determining how much of the resource a contending principal instance receives; dividing the resource recursively along a principal embedding hierarchy of the web entity; assigning a fraction of the resource to the contending principal instance; subdividing the fraction of the resource share between the contending principal instance and an embedded content associated with the contending principal instance; and identifying resource allocations mechanisms to divide the resource based at least in part on: applying a scheduler to adjust CPU shares for principal instances; determining a fair-share bandwidth across the principal instances that are in contention; allocating memory to the principal instances through a browser kernel; and recalculating the resource share for a dynamic principal embedded content.