[webkit-dev] Multiple views of the same RenderBlock

David Hyatt hyatt at apple.com
Sat May 23 17:28:07 PDT 2009


This will be a fair bit of work to do cleanly, but basically you would  
need to enable a document to have multiple FrameViews.  In addition,  
each frame view would need its own unique render tree, so you'd have  
to move ownership of m_renderer member variables off of Node and into  
something held by the FrameView (a hashtable probably).

There is a whole lot of code in WebKit, though, that assumes you only  
have one view.  One of our reasons for not allowing multiple views of  
the same DOM is the DOM itself.  The DOM is already extremely muddled  
with view-specific properties placed right on Elements and Documents.   
(For example, if you have two views, what is element.offsetWidth  
supposed to return?)

Another option you have is paint time hackery.  You could basically  
use only one view and render tree but paint it in two different places.

dave
(hyatt at apple.com)

On May 18, 2009, at 3:05 PM, Yan wrote:

> Hello,
>
> I've been wanting to add a proof of concept feature to a browser,  
> and have been looking at the source of WebKit to find what I need to  
> modify. The core functionality of what I've been trying to create is  
> the ability to create two views, with potentially different clip  
> sizes and different scroll positions of the same content. The  
> initial goal is to have two side-by-side "frames" (not proper HTML  
> frames, but two Safari views of content alongside each other) that  
> are independently scrollable and whose content area is now half the  
> width of the original page. If I highlight content, fill input  
> fields or navigate through on one view, the other should refresh also.
>
> My initial stab at the problem, I tried adding a RenderBlock to two  
> distinct RenderViews and tried messing with the RenderBlock  
> hierarchy, but that just led me to core dumps. I also looked at  
> creating multiple WebFrameViews and WebDynamicScrollBarsViews, but  
> that led to similar results.
>
> Can someone point me in a better direction? The ideal scenario would  
> be to create a Safari plugin (if that functionality is even able to  
> be embedded in a plugin) with an added feature to split the current  
> view in two. Hacking the source directly would be acceptable also.
>
> Thank you in advance,
> Yan
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev



More information about the webkit-dev mailing list