1. A method comprising: identifying, by a processor, a plurality of elements within a document, the plurality of elements comprising a first element and a second element, wherein the first element includes the second element; generating a first object corresponding only to the first element and comprising a first layout function for laying out the first element and a first render function for rendering the first element, the first object having a first status in a hierarchy, wherein: the first object is adapted to determine a location of the document, the first object is adapted to determine a second object corresponding only to the second element and associated with the determined location, wherein the second object comprises a second layout function for laying out the second element and a second render function for rendering the second element, the second object having a second status in the hierarchy different from the first status, and the first object is adapted to invoke the second object; invoking, by the processor, the first object to generate first layout data associated with the first element; rendering the first element based on the first layout data; determining, by the first object, a selected location within the document; and in response to determining the selected location: invoking, by the first object, the second object to generate second layout data associated with the second element, and rendering the second element based on the second layout data.
1. A method comprising: identifying, by a processor, a plurality of elements within a document, the plurality of elements comprising a first element and a second element, wherein the first element includes the second element; generating a first object corresponding only to the first element and comprising a first layout function for laying out the first element and a first render function for rendering the first element, the first object having a first status in a hierarchy, wherein: the first object is adapted to determine a location of the document, the first object is adapted to determine a second object corresponding only to the second element and associated with the determined location, wherein the second object comprises a second layout function for laying out the second element and a second render function for rendering the second element, the second object having a second status in the hierarchy different from the first status, and the first object is adapted to invoke the second object; invoking, by the processor, the first object to generate first layout data associated with the first element; rendering the first element based on the first layout data; determining, by the first object, a selected location within the document; and in response to determining the selected location: invoking, by the first object, the second object to generate second layout data associated with the second element, and rendering the second element based on the second layout data. 8. The method of claim 1 , wherein the first render function is adapted to modify a HyperText Markup Language (“HTML”) of a webpage based on the first layout data.