Changeset 50207 in webkit


Ignore:
Timestamp:
Oct 28, 2009 3:16:51 AM (14 years ago)
Author:
zecke@webkit.org
Message:

Fix assertion in SVGRenderBase::mapLocalToContainer resulting from HitTestResult::boundinBox()

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

The current HitTestResult methods are not using the (3d)
transformation aware routines. This can lead to an assertion
SVGRenderBase::mapLocalToContainer method.

Remove HitTestResult::boundingBox() as it is only used in
two places and conceptually doesn't belong into a HitTest
which is operating on points. Update the Qt and Win code
to determine the rect themselves in a (3d) transformation
fashion.

Change HitTestResult::imageRect to use the (3d) transformation
aware RenderBox::absoluteContentQuad to avoid running into
an assertion with SVG content.

  • rendering/HitTestResult.cpp:

(WebCore::HitTestResult::imageRect):

  • rendering/HitTestResult.h:
  • WebElementPropertyBag.cpp:

(WebElementPropertyBag::Read):

  • Api/qwebframe.cpp:

(QWebHitTestResultPrivate::QWebHitTestResultPrivate):

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r50206 r50207  
     12009-10-27  Holger Hans Peter Freyther  <zecke@selfish.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Change HitTestResult methods to use (3d) transformation aware methods
     6        https://bugs.webkit.org/show_bug.cgi?id=27347
     7
     8        The current HitTestResult methods are not using the (3d)
     9        transformation aware routines. This can lead to an assertion
     10        SVGRenderBase::mapLocalToContainer method.
     11
     12        Change HitTestResult::imageRect to use the (3d) transformation
     13        aware RenderBox::absoluteContentQuad to avoid running into
     14        an assertion with SVG content.
     15
     16        Remove HitTestResult::boundingBox() as it is only used in
     17        two places and conceptually doesn't belong into a HitTest
     18        which is operating on points.
     19
     20        A classic test case is not possible as the methods are not excercised
     21        from within HTML/SVG but from the WebKit API Layer. A unittest
     22        for Qt/Gtk+/Mac would need to be written but Qt/Gtk+ currently
     23        do not support 3d transformations making it impossible to write
     24        a reliable test case and the Mac port is currently not doing
     25        unit testing.
     26
     27
     28        * rendering/HitTestResult.cpp: Remove boundingBox() method
     29        (WebCore::HitTestResult::imageRect): Use transformation aware method
     30        * rendering/HitTestResult.h: Remove boundingBox()
     31
    1322009-10-26  Holger Hans Peter Freyther  <zecke@selfish.org>
    233
  • trunk/WebCore/rendering/HitTestResult.cpp

    r47367 r50207  
    124124}
    125125
    126 IntRect HitTestResult::boundingBox() const
    127 {
    128     if (m_innerNonSharedNode) {
    129         RenderObject* renderer = m_innerNonSharedNode->renderer();
    130         if (renderer)
    131             return renderer->absoluteBoundingBoxRect();
    132     }
    133    
    134     return IntRect();
    135 }
    136 
    137126bool HitTestResult::isSelected() const
    138127{
     
    247236    if (!image())
    248237        return IntRect();
    249     return m_innerNonSharedNode->renderBox()->absoluteContentBox();
     238    return m_innerNonSharedNode->renderBox()->absoluteContentQuad().enclosingBoundingBox();
    250239}
    251240
  • trunk/WebCore/rendering/HitTestResult.h

    r45991 r50207  
    6464
    6565    Frame* targetFrame() const;
    66     IntRect boundingBox() const;
    6766    bool isSelected() const;
    6867    String spellingToolTip(TextDirection&) const;
  • trunk/WebKit/qt/Api/qwebframe.cpp

    r50058 r50207  
    14301430        return;
    14311431    pos = hitTest.point();
    1432     boundingRect = hitTest.boundingBox();
    14331432    WebCore::TextDirection dir;
    14341433    title = hitTest.title(dir);
     
    14401439    innerNode = hitTest.innerNode();
    14411440    innerNonSharedNode = hitTest.innerNonSharedNode();
     1441    boundingRect = innerNonSharedNode ? innerNonSharedNode->renderer()->absoluteBoundingBoxRect(true) : IntRect();
    14421442    WebCore::Image *img = hitTest.image();
    14431443    if (img) {
  • trunk/WebKit/qt/ChangeLog

    r50166 r50207  
     12009-10-27  Holger Hans Peter Freyther  <zecke@selfish.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Change HitTestResult methods to use (3d) transformation aware methods
     6        https://bugs.webkit.org/show_bug.cgi?id=27347
     7
     8        The HitTestResult::boundingBox method was removed. The
     9        RenderObject must be used directly. In contrast to the
     10        old HitTestResult::boundingBox method this code must use
     11        a (3d) transformation aware method to not run into an
     12        assert in SVGRenderBase::mapLocalToContainer.
     13
     14        * Api/qwebframe.cpp:
     15        (QWebHitTestResultPrivate::QWebHitTestResultPrivate):
     16
    1172009-10-27  Kenneth Rohde Christiansen  <kenneth@webkit.org>
    218
  • trunk/WebKit/win/ChangeLog

    r50120 r50207  
     12009-10-27  Holger Hans Peter Freyther  <zecke@selfish.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        Change HitTestResult methods to use (3d) transformation aware methods
     6        https://bugs.webkit.org/show_bug.cgi?id=27347
     7
     8        The HitTestResult::boundingBox method was removed. The
     9        RenderObject must be used directly. In contrast to the
     10        old HitTestResult::boundingBox method this code must use
     11        a (3d) transformation aware method to not run into an
     12        assert in SVGRenderBase::mapLocalToContainer.
     13
     14        * WebElementPropertyBag.cpp:
     15        (WebElementPropertyBag::Read): Replace HitTestResult::boundingBox()
     16
    1172009-10-26  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
    218
  • trunk/WebKit/win/WebElementPropertyBag.cpp

    r45991 r50207  
    146146    } else if (isEqual(WebElementImageRectKey, key)) {
    147147        V_VT(pVar) = VT_ARRAY;
    148         V_ARRAY(pVar) = MarshallingHelpers::intRectToSafeArray(m_result->boundingBox());
     148        IntRect boundingBox = m_result->innerNonSharedNode() && m_result->innerNonSharedNode()->renderer() ?
     149                                m_result->innerNonSharedNode()->renderer()->absoluteBoundingBoxRect(true) : IntRect();
     150        V_ARRAY(pVar) = MarshallingHelpers::intRectToSafeArray(boundingBox);
    149151        return S_OK;
    150152    } else if (isEqual(WebElementImageURLKey, key))
Note: See TracChangeset for help on using the changeset viewer.