Changeset 83746 in webkit


Ignore:
Timestamp:
Apr 13, 2011 9:27:23 AM (13 years ago)
Author:
mario@webkit.org
Message:

2011-04-13 Mario Sanchez Prada <msanchez@igalia.com>

Reviewed by Martin Robinson.

[GTK] Missing nullchecks in GTK's a11y wrapper
https://bugs.webkit.org/show_bug.cgi?id=58429

Add missing nullchecks for coreObject->document().

  • accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: (atkParentOfRootObject): Add missing nullcheck. (getPangoLayoutForAtk): Ditto. (webkit_accessible_text_get_caret_offset): Ditto. (textExtents): Ditto. (webkit_accessible_editable_text_insert_text): Ditto. (webkit_accessible_editable_text_delete_text): Ditto.
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r83745 r83746  
     12011-04-13  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        [GTK] Missing nullchecks in GTK's a11y wrapper
     6        https://bugs.webkit.org/show_bug.cgi?id=58429
     7
     8        Add missing nullchecks for coreObject->document().
     9
     10        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
     11        (atkParentOfRootObject): Add missing nullcheck.
     12        (getPangoLayoutForAtk): Ditto.
     13        (webkit_accessible_text_get_caret_offset): Ditto.
     14        (textExtents): Ditto.
     15        (webkit_accessible_editable_text_insert_text): Ditto.
     16        (webkit_accessible_editable_text_delete_text): Ditto.
     17
    1182011-04-13  Thierry Reding  <thierry.reding@avionic-design.de>
    219
  • trunk/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp

    r83493 r83746  
    269269    // hierarchy all the way to the application. (Bug 30489)
    270270    if (!coreParent && isRootObject(coreObject)) {
    271         HostWindow* hostWindow = coreObject->document()->view()->hostWindow();
     271        Document* document = coreObject->document();
     272        if (!document)
     273            return 0;
     274
     275        HostWindow* hostWindow = document->view()->hostWindow();
    272276        if (hostWindow) {
    273277            PlatformPageClient scrollView = hostWindow->platformPageClient();
     
    11771181    AccessibilityObject* coreObject = core(textObject);
    11781182
    1179     HostWindow* hostWindow = coreObject->document()->view()->hostWindow();
     1183    Document* document = coreObject->document();
     1184    if (!document)
     1185        return 0;
     1186
     1187    HostWindow* hostWindow = document->view()->hostWindow();
    11801188    if (!hostWindow)
    11811189        return 0;
     
    12191227        return 0;
    12201228
     1229    Document* document = coreObject->document();
     1230    if (!document)
     1231        return 0;
     1232
    12211233    Node* focusedNode = coreObject->selection().end().deprecatedNode();
    12221234    if (!focusedNode)
     
    12241236
    12251237    RenderObject* focusedRenderer = focusedNode->renderer();
    1226     AccessibilityObject* focusedObject = coreObject->document()->axObjectCache()->getOrCreate(focusedRenderer);
     1238    AccessibilityObject* focusedObject = document->axObjectCache()->getOrCreate(focusedRenderer);
    12271239
    12281240    int offset;
     
    15421554    switch(coords) {
    15431555    case ATK_XY_SCREEN:
    1544         extents = coreObject->document()->view()->contentsToScreen(extents);
     1556        if (Document* document = coreObject->document())
     1557            extents = document->view()->contentsToScreen(extents);
    15451558        break;
    15461559    case ATK_XY_WINDOW:
     
    18141827    //coreObject->setSelectedText(String::fromUTF8(string));
    18151828
    1816     if (!coreObject->document() || !coreObject->document()->frame())
     1829    Document* document = coreObject->document();
     1830    if (!document || !document->frame())
    18171831        return;
     1832
    18181833    coreObject->setSelectedVisiblePositionRange(coreObject->visiblePositionRangeForRange(PlainTextRange(*position, 0)));
    18191834    coreObject->setFocused(true);
    18201835    // FIXME: We should set position to the actual inserted text length, which may be less than that requested.
    1821     if (coreObject->document()->frame()->editor()->insertTextWithoutSendingTextEvent(String::fromUTF8(string), false, 0))
     1836    if (document->frame()->editor()->insertTextWithoutSendingTextEvent(String::fromUTF8(string), false, 0))
    18221837        *position += length;
    18231838}
     
    18401855    //coreObject->setSelectedText(String());
    18411856
    1842     if (!coreObject->document() || !coreObject->document()->frame())
     1857    Document* document = coreObject->document();
     1858    if (!document || !document->frame())
    18431859        return;
     1860
    18441861    coreObject->setSelectedVisiblePositionRange(coreObject->visiblePositionRangeForRange(PlainTextRange(start_pos, end_pos - start_pos)));
    18451862    coreObject->setFocused(true);
    1846     coreObject->document()->frame()->editor()->performDelete();
     1863    document->frame()->editor()->performDelete();
    18471864}
    18481865
Note: See TracChangeset for help on using the changeset viewer.