Changeset 112077 in webkit


Ignore:
Timestamp:
Mar 26, 2012 4:56:53 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Qt] Assert in GestureTapHighlighter.
https://bugs.webkit.org/show_bug.cgi?id=82187

Patch by Allan Sandfeld Jensen <allan.jensen@nokia.com> on 2012-03-26
Reviewed by Kenneth Rohde Christiansen.

Adjust the boundaries of the center-rect before performing the intersection test,
since adjusting the boundary may cause a new intersection.

  • page/GestureTapHighlighter.cpp:
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112076 r112077  
     12012-03-26  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
     2
     3        [Qt] Assert in GestureTapHighlighter.
     4        https://bugs.webkit.org/show_bug.cgi?id=82187
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Adjust the boundaries of the center-rect before performing the intersection test,
     9        since adjusting the boundary may cause a new intersection.
     10
     11        * page/GestureTapHighlighter.cpp:
     12
    1132012-03-26  Antti Koivisto  <antti@apple.com>
    214
  • trunk/Source/WebCore/page/GestureTapHighlighter.cpp

    r111243 r112077  
    9696inline void shiftXEdgesToContainIfStrikes(LayoutRect& rect, const LayoutRect& other)
    9797{
     98    if (rect.isEmpty())
     99        return;
    98100    LayoutUnit leftSide = rect.x();
    99101    LayoutUnit rightSide = rect.maxX();
     
    157159    // Add the first box, but merge it with the center boxes if it intersects.
    158160    if (rects.size() && !rects.first().isEmpty()) {
     161        // Adjust center boxes to boundary of first
     162        if (drawableRects.size())
     163            shiftXEdgesToContainIfStrikes(drawableRects.last(), rects.first());
    159164        if (drawableRects.size() && drawableRects.last().intersects(rects.first()))
    160165            drawableRects.last().unite(rects.first());
     
    165170    // Add the last box, but merge it with the center boxes if it intersects.
    166171    if (rects.size() > 1 && !rects.last().isEmpty()) {
     172        // Adjust center boxes to boundary of last
     173        if (drawableRects.size())
     174            shiftXEdgesToContainIfStrikes(drawableRects.last(), rects.last());
    167175        if (drawableRects.size() && drawableRects.last().intersects(rects.last()))
    168176            drawableRects.last().unite(rects.last());
     
    171179    }
    172180
    173     // Adjust middle to boundaries of first and last.
    174     if (drawableRects.size() == 3) {
    175         LayoutRect& middle = drawableRects.at(1);
    176         shiftXEdgesToContainIfStrikes(middle, drawableRects.at(0));
    177         shiftXEdgesToContainIfStrikes(middle, drawableRects.at(2));
    178     }
    179 
    180181    for (size_t i = 0; i < drawableRects.size(); ++i) {
    181182        LayoutRect prev = i ? drawableRects.at(i - 1) : LayoutRect();
Note: See TracChangeset for help on using the changeset viewer.