Re: [webkit-dev] Multiple views of the same RenderBlock

2009-05-23 Thread David Hyatt
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
(hy...@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@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Proposal for a new way to handle porting #ifdefs

2009-05-23 Thread David Kilzer
Another aspect of this proposal is how to handle source files that have #if 
ENABLE(FEATURE)/#endif guards around all of their source code, for example:

Bug 25756: Explicit guards for ENABLE_GEOLOCATION
https://bugs.webkit.org/show_bug.cgi?id=25756

There are essentially two options here:

1. Add #if/#endif guards to entire source files, but include every file in 
every build system.

2. Make each build system smart enough to exclude source files that implement a 
feature, thus pushing the policy decision down (up?) into the build system 
(which is where most of the decisions are made today anyway).

I think #2 is a much cleaner way to handle this since it removes clutter from 
the code (at the cost of duplicating knowledge of which files go with with 
features into each build system).

Does anyone else have an opinion on this?

Dave





From: Maciej Stachowiak 
To: WebKit Development 
Sent: Thursday, April 30, 2009 4:12:54 PM
Subject: [webkit-dev] Proposal for a new way to handle porting #ifdefs


I think our set of porting macros has become somewhat confused.

Originally, our idea was that a port represents primarily adaptation to a 
particular platform. However, over time it has become clear that most of what 
is decided by a port is not platform adaptation, but rather policy decisions. 
For example, ports decide to have different features enabled, or to use 
different sets of system functionality on the same underlying OS.

In addition, I think the catchall top-level PLATFORM create confusion, because 
it is not totally clear if they are policy decisions, platform adaptation 
decisions, or what.

Third, it seems wrong that the policy choices of every port are represented as 
a bunch of ifdef tomfoolery inside a single Platform.h file.

And fourth, many ports often run on the same OS, but with a different set of 
choices - for example on Mac OS X it is possible to build the Mac, Chromium, 
Gtk, Qt and Wx ports (at least).


Therefore, I propose that we change as follows:

1) Strictly separate platform adaptation (mandatory to run on a given OS, 
compiler, or CPU at all) from policy choices (what features to enable, what 
optional libraries to use).

2) Phase out PLATFORM macros completely - each use should be converted to a 
policy choice, or a platform adaptation decision.

3) Instead of ports being defined by a top-level PLATFORM macro, I propose that 
each port should have its own header file to define policy decisions. For 
example, I'd propose that the system Mac OS X WebKit should use PortCocoa.h, 
and the WebKit used by Safari for Windows should use PortWinCG.h. There may 
also be a PortIPhone.h. These port definition headers would live in their own 
top-level WebKit module. Each one would be completely owned by whoever is 
generally considered the "owner" of a given port. Because related ports on 
different platforms may wish to share policy choices, it's ok for Port headers 
to include shared headers for some choices. For example, all Apple-maintained 
ports may include PortApple.h. We could go even further and have PortDefault.h 
to make default choices of what features are enabled, that ports would have to 
explicitly override.

4) Platform adaptation macros would still be defined in Platform.h based on 
sniffing the environment, this would include things like the compiler, the 
underlying OS, available libc functions, and so forth.


Platform adaptation macros would be:

OS() - underlying operating system; only to be used for mandated low-level 
services like virtual memory, not to choose a GUI toolkit
Examples:
OS(UNIX) - Any Unix-like OS
OS(DARWIN) - Underlying OS is the base OS X environment
OS(FREEBSD) - FreeBSD
OS(WIN) - Any version of Windows
OS(WINCE) - The embedded version of Windows

COMPILER() - the compiler being used to build the project
Examples:
COMPILER(GCC) - GNU Compiler Collection
COMPILER(MSVC) - Microsoft Visual C++
COMPILER(RVCT) - ARM compiler

HAVE() - specific system features (headers, functions or similar) that are 
present or not
Examples:
HAVE(MMAP) - mmap() function is available
HAVE(ERRNO_H) - errno.h header is available
HAVE(MADV_FREE) - madvise(MADV_FREE) is available


Policy decision macros would be:

USE() - use a particular third-party library or optional OS service
Examples:
USE(SKIA) - Use the Skia graphics library
USE(CG) - Use CoreGraphics
USE(V8) - Use the V8 JavaScript implementation
USE(CFNET) - Use CFNetwork networking
USE(NSURL_NET) - Use NSURLConnection-based networking
USE(APPKIT) - Use AppKit views and events
USE(GTK) - Use Gtk+
USE(QT) - Use Qt
USE(QUICKTIME) - Use the QuickTime media engine
USE(QTKIT) - Use the QuickTime media engine via the Mac QTKit API
USE(QUICKTIME_WIN) - Use the QuickTime media engine via its Windows