2009/8/12 TianShijun <tiansjun@hotmail.com>
Hi Simon,
I cannot find this method in either Node.h or RenderStyle.h.
I wonder that why we cannot get the attribute of an element node just by invoking some member function of the node?

Line 440 of Node.h
virtual RenderStyle* computedStyle();

This gives you renderStyle.  If you do position.computedStyle(), you'll obtain CSSComputedStyleDeclaration.

A node could be anything, so you need to first check whether it's an HTML element or not.  You can do so by calling node->isElementNode().

Once node->isElementNode() returned, true, you cast the node into Element and call getAttribute there as in:
static_cast<Element*>(node)->getAttribute(qualifiedName)

Please post the questions like this on webkit-help.

Ryosuke