Re: [webkit-dev] FontPlatformData, FontCache and HashMap

2010-02-20 Thread n179911
I have a related question about SimpleFontData and FontPlatformData.

When does Webkit create a FontPlatformData and SimpleFontData?
I too put debug printfs in these classes constructors. And I see
Webkit creates different FontPlatformData and SimpleFontData for same
font family and same font size.

Thank you for any tip in helping me understanding.

On Thu, Feb 18, 2010 at 12:28 PM, Stephan Assmus supersti...@gmx.de wrote:

 On 2010-02-18 at 18:43:08 [+0100], Stephan Assmus supersti...@gmx.de wrote:
 Hi all,

 currently, I am investigating some weirdness with regards to
 FontPlatformData and the FontCache which I see in my debugging output on
 the Haiku port. I am not even 100% sure that what I see is a weirdness, but
 at least I don't understand it and I was wondering if anyone could help me
 shed some light into this.

 So I understand these things:

 1) SimpleFontData has a member m_platformData of type FontPlatformData,
 which is always instantiated by passing it a const reference of another
 FontPlatformData.

 2) The FontCache maintains SimplaFontData instances in a HashMap, and looks
 these up and compares them by using FontPlatformData objects as keys into
 the map.

 3) FontCache has a static empty FontPlatformData instance in
 FontDataCacheKeyTraits:

     static const FontPlatformData emptyValue()
     {
         DEFINE_STATIC_LOCAL(FontPlatformData, key, (0.f, false, false));
         return key;
     }

 Don't yet know how this comes into play, but possibly it's of relevance.


 My analysis is a bit awkward, since I cannot use a source level debugger on
 Haiku, and I won't bore you with the embarrasing details of why. So I added
 printf() statements in all my constructors of FontPlatformData, and printed
 among other things the memory address of the FontPlatformData instance
 (this). Also, I am printing this in a number of other places, operator=()
 for example. The output I am getting is a little weird, since it shows that
 operator=() is called on objects, for which no constructor has been called.
 Basically, I've narrowed it down to SimpleFontData*
 FontCache::getCachedFontData(const FontPlatformData* platformData) in
 FontCache.cpp. In this method, a new SimpleFontData instance is to be
 created and inserted into the HashMap. I will show you the output from the
 program start. It printed which FontPlatformData instances have been
 created up to Kill Thread (I let it drop into the debugger from the first
 invokation of FontPlatformData::operator=()):

 The first font is created:

 getCachedFontPlatformData(0)
 createFontPlatformData(const FontDescription)
   0x18018660-FontPlatformData(const FontDescription(16.0, Myriad Pro))
     0x18019bf0-FontPlatformDataPrivate()
   created result: 0x18018660
 getCachedFontPlatformData() - done: 0x18018660

 Next, getCachedFontData() is called to insert a new SimpleFontData for this
 FontDescription:

 getCachedFontData(0x18018660)

 Next comes the output from line 289 of FontCache.cpp:
 pairSimpleFontData*, unsigned newValue(new SimpleFontData(*platformData),
 1);
 A new SimpleFontData object is created with it's m_fontData member at
 address 0x2f4c6a8:

   0x2f4c6a8-FontPlatformData(const FontPlatformData 0x18018660)
     0x18019bf0-addRef()
   new: 0x2f4c680

 Next comes the call to HashMap::set(), which results in this output:

   0x18018970-FontPlatformData(0.0, 0, 0)

 This is probably the key created from HashMap::inlineAdd(). And next,
 HashMap::set() invokes operator=() on the key (line 250) which gives this
 output:

   0x2ec8594 ((nil), 0.0, 0, 0) -operator=(0x18018660, 0x18019bf0)

 nil is a pointer to FontPlatformDataPrivate, which is ok. But 0x2ec8594
 should be the pointer to the FontPlatformData instance created in
 inlineAdd().

 How can I be doing something wrong there? Nothing happens in my constructor
 for FontPlatformData() when the empty key values are used. Maybe the usage
 of the HashMap is broken in FontCache, since it would seem that such a
 low-level utility class as HashMap would not likely contain any bugs.

 Ok, I've finally figured it out. FontCache.cpp defines the following for use
 in the HashMap:

 struct FontDataCacheKeyTraits : WTF::GenericHashTraitsFontPlatformData {
    static const bool emptyValueIsZero = true;
    static const bool needsDestruction = true;
    static const FontPlatformData emptyValue()
    {
        DEFINE_STATIC_LOCAL(FontPlatformData, key, (0.f, false, false));
        return key;
    }
    static void constructDeletedValue(FontPlatformData slot)
    {
        new (slot) FontPlatformData(HashTableDeletedValue);
    }
    static bool isDeletedValue(const FontPlatformData value)
    {
        return value.isHashTableDeletedValue();
    }
 };

 The emptyValueIsZero means the HashTable implementation will not call
 constructors for new slots. IMHO, this is a dangerous assumption, since the
 porters may not realize this and that this actually works is completely
 implementation specific.

 Best 

[webkit-dev] RenderContainer class in webkit source code

2009-07-03 Thread n179911
Hi,

Can you please tell me if the RenderContainer class in webkit source
code got removed?
I notice this class in android's webkit source, but when I check the
code in webkit trunk, that class is not there.

Can you please if that class got removed? Thank you
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] RenderContainer class in webkit source code

2009-07-03 Thread n179911
Thanks. I am not sure how to use ChangeLogs.

On Fri, Jul 3, 2009 at 5:58 PM, Simon Frasersimon.fra...@apple.com wrote:
 On Jul 3, 2009, at 5:41 PM, n179911 wrote:

 Hi,

 Can you please tell me if the RenderContainer class in webkit source
 code got removed?
 I notice this class in android's webkit source, but when I check the
 code in webkit trunk, that class is not there.

 Can you please if that class got removed? Thank you

 Use those ChangeLogs that you've heard so much about. They show
 that RenderContainer was eliminated on 2009-02-04.

 Simon


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


[webkit-dev] WebKit graphics library abstract layer

2009-06-29 Thread n179911
Webkit supports on multiple platform (e.g. Windows, MacOS, linux).
And when Webkit paints content on screen, it needs to call native
graphics api to paint (e.g. draw text, draw image, draw line, draw
rect).

Does Webkit code has an abstract layer, which hides the platform
dependent graphics API.  And the render engine just calls this
abstract layer graphics api and this abstract layer api
will handle, or link in platform dependent implementation of those
draw text, draw rect calls?

If yes, can you least tell me where can I find this abstract layer code.

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


[webkit-dev] Dimension of Render Containers

2009-06-25 Thread n179911
Hi,

Does the dimension (width X height) of Render Containers (e.g.
RenderBlock, RenderTableRow, RenderTableCell) always encompass all its
children?

For example,
The Render Block is 145 x 14 which encompasses its children
RenderInline (145x12), RenderText (145x12)

 RenderBlock (floating) {DIV} at (458,5) size 145x14 [color=#CC]
{467.00,212.00}
 RenderInline {A} at (0,0) size 145x12 [color=#004276]
{467.00,212.00}
RenderText {#text} at (0,1) size 145x12 {467.00,212.00}
  text run at (0,1) width 145: Make CNN Your Home Page

Is this always the case? Or there are exceptions to such rule?
e.g. nested DIV Tags, does the outermost DIV Tag encompasses the inner
one and and the inner one encompasses the one inside it?

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


Re: [webkit-dev] Dimension of Render Containers

2009-06-25 Thread n179911
On Thu, Jun 25, 2009 at 9:50 AM, n179911n179...@gmail.com wrote:
 Hi,

 Does the dimension (width X height) of Render Containers (e.g.
 RenderBlock, RenderTableRow, RenderTableCell) always encompass all its
 children?

 For example,
 The Render Block is 145 x 14 which encompasses its children
 RenderInline (145x12), RenderText (145x12)

  RenderBlock (floating) {DIV} at (458,5) size 145x14 [color=#CC]
 {467.00,212.00}
             RenderInline {A} at (0,0) size 145x12 [color=#004276]
 {467.00,212.00}
                        RenderText {#text} at (0,1) size 145x12 {467.00,212.00}
                          text run at (0,1) width 145: Make CNN Your Home 
 Page

 Is this always the case? Or there are exceptions to such rule?
 e.g. nested DIV Tags, does the outermost DIV Tag encompasses the inner
 one and and the inner one encompasses the one inside it?

 Thank you.

I found a case which does not follow this rule (The Render container
encompasses its children dimension:

RenderBlock (anonymous) at (2,0) size 980x0 {11.00,147.00}
  RenderInline {A} at (0,0) size 0x0
[color=#004276] {11.00,147.00}
RenderImage {IMG} at (956,0) size 24x27 {967.00,147.00}


The container is 980x0, but it has a child 24x27.

Not sure if the RenderBlock is 'anonymous' (like in this case) means
it break such rule.
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] Tab key Navigation

2009-06-17 Thread n179911
Hi,
Is 'Tab key Navigation a browser functionality or Webkit functionally?
For example, I load google.com, I put my mouse on the search input box click
once. The search input box should have focus.
And then i press 'Tab', the focus should moved.

But what I find out is the way Safari moves focus is different from Chromium
(both uses Webkit but may be using different versions). So I would like to
know if the Tab key navigation a Webkit functionality or a Browser
functionality?

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