make pseudo-elements non-anonymous

David Hyatt hyatt at apple.com
Tue Mar 2 22:49:55 CET 2004


Consider this example:


<head>
<style>
p:first-letter { font-size: 150%; float: left; border: 3px solid green; 
padding: 5px; }
</style>
</head>
<body>
<p><a href="http://www.apple.com">Click here</a> to visit apple.com 
etc. etc.</p>


If the "C" first-letter container has <p> as its DOM element, then the 
DOM will deliver mouse events to the <p> when you're over the 
border/padding area of the first-letter, bypassing the anchor entirely.

Of course this also doesn't work right now (with the first-letter 
container being anonymous), but it feels conceptually cleaner to me to 
leave the generated content container for first-letter without a DOM 
element.

For before/after it seems ok to use the element(), although if you're 
only doing it for the container (and not also for the anonymous 
children), then I'm not sure what the benefit is... i.e., we still have 
to fix the problem of obtaining the innermost DOM node that is the 
ancestor of some anonymous child that has no DOM node (and doing that 
would fix all of these problems).

dave

On Mar 2, 2004, at 7:07 AM, Germain Garand wrote:

>
> Hello,
> As pseudo-elements are, from a logical standpoint, an intrinsic 
> extension of a
> given container and as such not really anonymous,  we'd like to make 
> them
> share said container's element().
>
> This has the benefit of avoiding the need for further arbitrary
> discriminations amongst anonymous blocks eligible for squeezing, and 
> to keep
> the relationship with said container clear in the render tree, even 
> when the
> pseudo-container isn't a direct child (case of first-letter).
>
> Is this something that could be shared accross our trees ( e.g 
> simplifying
> your isAnonymousBlock method into something that tests what it says it 
> test)
> or do you have a better idea?
>
> Greetings,
> Germain
> <pseudo.diff>_______________________________________________
> Khtml-devel at kde.org
> https://mail.kde.org/mailman/listinfo/khtml-devel



More information about the Khtml-devel mailing list