~ubuntu-branches/ubuntu/lucid/webkit/lucid-updates

« back to all changes in this revision

Viewing changes to WebCore/rendering/RenderInline.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-01-06 21:25:06 UTC
  • mfrom: (1.2.6 upstream) (4.3.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100106212506-gd0czn4zrwf1j19l
* New upstream release
- adds basic Content-Encoding support, thanks to soup
  (Closes: #529271)
- fixes over-advertising content types as supported by
  the media player (Closes: #559420)
* debian/control:
- updated libsoup build requirement (>= 2.28.2)
* debian/libwebkit-1.0-2.symbols:
- updated with new symbols
* debian/copyright:
- updated information since 1.1.17
* Imported patch from https://bugs.webkit.org/show_bug.cgi?id=30623
- I am shipping this patch because I believe it is correct, it is the
  way to go, it fixes a race, and it needs testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include "config.h"
24
24
#include "RenderInline.h"
25
25
 
 
26
#include "Chrome.h"
26
27
#include "FloatQuad.h"
27
28
#include "GraphicsContext.h"
28
29
#include "HitTestResult.h"
931
932
    repaint();
932
933
}
933
934
 
934
 
void RenderInline::addFocusRingRects(GraphicsContext* graphicsContext, int tx, int ty)
 
935
void RenderInline::addFocusRingRects(Vector<IntRect>& rects, int tx, int ty)
935
936
{
936
937
    for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
937
938
        RootInlineBox* root = curr->root();
938
939
        int top = max(root->lineTop(), curr->y());
939
940
        int bottom = min(root->lineBottom(), curr->y() + curr->height());
940
 
        graphicsContext->addFocusRingRect(IntRect(tx + curr->x(), ty + top, curr->width(), bottom - top));
 
941
        IntRect rect(tx + curr->x(), ty + top, curr->width(), bottom - top);
 
942
        if (!rect.isEmpty())
 
943
            rects.append(rect);
941
944
    }
942
945
 
943
946
    for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
948
951
                pos = curr->localToAbsolute();
949
952
            else if (curr->isBox())
950
953
                pos.move(toRenderBox(curr)->x(), toRenderBox(curr)->y());
951
 
           curr->addFocusRingRects(graphicsContext, pos.x(), pos.y());
 
954
           curr->addFocusRingRects(rects, pos.x(), pos.y());
952
955
        }
953
956
    }
954
957
 
955
958
    if (continuation()) {
956
959
        if (continuation()->isInline())
957
 
            continuation()->addFocusRingRects(graphicsContext, 
 
960
            continuation()->addFocusRingRects(rects, 
958
961
                                              tx - containingBlock()->x() + continuation()->containingBlock()->x(),
959
962
                                              ty - containingBlock()->y() + continuation()->containingBlock()->y());
960
963
        else
961
 
            continuation()->addFocusRingRects(graphicsContext, 
 
964
            continuation()->addFocusRingRects(rects, 
962
965
                                              tx - containingBlock()->x() + toRenderBox(continuation())->x(),
963
966
                                              ty - containingBlock()->y() + toRenderBox(continuation())->y());
964
967
    }
975
978
        if (!oc.isValid())
976
979
            oc = style()->color();
977
980
 
978
 
        graphicsContext->initFocusRing(ow, style()->outlineOffset());
979
 
        addFocusRingRects(graphicsContext, tx, ty);
 
981
        Vector<IntRect> focusRingRects;
 
982
        addFocusRingRects(focusRingRects, tx, ty);
980
983
        if (style()->outlineStyleIsAuto())
981
 
            graphicsContext->drawFocusRing(oc);
 
984
            graphicsContext->drawFocusRing(focusRingRects, ow, style()->outlineOffset(), oc);
982
985
        else
983
 
            addPDFURLRect(graphicsContext, graphicsContext->focusRingBoundingRect());
984
 
        graphicsContext->clearFocusRing();
 
986
            addPDFURLRect(graphicsContext, unionRect(focusRingRects));
985
987
    }
986
988
 
987
989
    if (style()->outlineStyleIsAuto() || style()->outlineStyle() == BNONE)