[Webkit-unassigned] [Bug 25413] [GTK] Please expose the level of headings.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Oct 17 03:22:37 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=25413


Xan Lopez <xan.lopez at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #41355|                            |review-
               Flag|                            |




--- Comment #3 from Xan Lopez <xan.lopez at gmail.com>  2009-10-17 03:22:37 PDT ---
(From update of attachment 41355)
This patch is amazing, great job!

A few small comments:

> +static AtkAttributeSet* addAttributeToSet(AtkAttributeSet* attributeSet, const char* name, const char* value)
> +{
> +    AtkAttribute* attribute = (AtkAttribute*)g_malloc(sizeof(AtkAttribute));

WebKit style guide tells us to use C++ style castings, so you need to do
something like:

AtkAttribute* attribute =
static_cast<AtkAttribute>(g_malloc(sizeof(AtkAttribute)));


> +    attribute->name = g_strdup(name);
> +    attribute->value = g_strdup(value);
> +    attributeSet = g_slist_prepend(attributeSet, attribute);
> +
> +    return attributeSet;
> +}
> +
> +static AtkAttributeSet* webkit_accessible_get_attributes(AtkObject* object)
> +{
> +    AtkAttributeSet* attributeSet = NULL;
> +
> +    int headingLevel = core(object)->headingLevel();
> +    if (headingLevel) {
> +        String value = String::number(headingLevel);
> +        attributeSet = addAttributeToSet(attributeSet, (const char*)"level", returnString(value));

- Is the (const char*) casting for "level" really needed? I think it should be
const char* already.
- Using returnString() here is a tiny hack, since the function was really
intended for return values in public APIs implementations. Do thinks work if
you pass value.utf8().data() to the function?

I'm marking it as r- while we work on those final details.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list