On Wed, Aug 4, 2010 at 4:05 PM, Yuxiang Luo <lu...@google.com> wrote:
> Hi, > > I'm currently looking into a bug (42799), and find that class > CSSComputedStyleDeclaration has a property 'RefPtr<Node> m_node', which > means this class takes ownership of the Node to which the computedStyle > object belongs back to. Does this mean that if the computedStyle object get > released, the owner Node will be released too? > > For example, the class Position owns the node object 'RefPtr<Node> > m_anchorNode', and in method 'Position::computedStyle', it passed the raw > pointer m_anchorNode.get() to CSSComputedStyleDeclaration, after that, both > 'Position' and 'CSSComputedStyleDeclaration' own the Node pointer. Is this a > mistake in CSSComputedStyleDeclaration which incorrectly uses RefPtr to wrap > the Node? (another similar class CSSMutableStyleDeclaration only has the raw > pointer) > > Another question is, as the bug 42799 shows, when getting 'pixel*' or > 'pos*' properties, if the unit type is 'em' or 'ex', the result is not > multiplied with factor. The factor for these two unit types depends on the > RenderStyle of corresponding element, but the class CSSStyleDeclaration > does't provide any access to corresponding element/node. I find that > both CSSComputedStyleDeclaration and CSSMutableStyleDeclaration have the > field 'm_node’. So to fix the bug, we might need to put the field up to the > base class CSSStyleDeclaration. But I'm not very familiar with the code base > yet, and not sure whether the change will break other logic? Thanks in > advance for your help. > Or possibly define a pure virtual getter function for the node. > > Best Regards. > > -- > Yuxiang Luo > engin...@google > <lu...@google.com> > -- Yuxiang Luo engin...@google <lu...@google.com>
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev