Changeset 247730 in webkit


Ignore:
Timestamp:
Jul 23, 2019 12:06:30 PM (5 years ago)
Author:
timothy_horton@apple.com
Message:

Long press hint of AirPods buy buttons are tall and narrow during animation
https://bugs.webkit.org/show_bug.cgi?id=200036
<rdar://problem/53145697>

Reviewed by Wenson Hsieh.

Source/WebCore:

New test: fast/text-indicator/text-indicator-with-tiny-child.html

  • dom/Range.cpp:

(WebCore::Range::borderAndTextRects const):

  • dom/Range.h:

Add a BoundingRectBehavior that ignores 1x1 and smaller rects.

  • page/TextIndicator.cpp:

(WebCore::absoluteBoundingRectForRange):
Enable IgnoreTinyRects.

LayoutTests:

  • fast/text-indicator/text-indicator-with-tiny-child-expected.txt: Added.
  • fast/text-indicator/text-indicator-with-tiny-child.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r247722 r247730  
     12019-07-23  Tim Horton  <timothy_horton@apple.com>
     2
     3        Long press hint of AirPods buy buttons are tall and narrow during animation
     4        https://bugs.webkit.org/show_bug.cgi?id=200036
     5        <rdar://problem/53145697>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        * fast/text-indicator/text-indicator-with-tiny-child-expected.txt: Added.
     10        * fast/text-indicator/text-indicator-with-tiny-child.html: Added.
     11
    1122019-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r247722 r247730  
     12019-07-23  Tim Horton  <timothy_horton@apple.com>
     2
     3        Long press hint of AirPods buy buttons are tall and narrow during animation
     4        https://bugs.webkit.org/show_bug.cgi?id=200036
     5        <rdar://problem/53145697>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        New test: fast/text-indicator/text-indicator-with-tiny-child.html
     10
     11        * dom/Range.cpp:
     12        (WebCore::Range::borderAndTextRects const):
     13        * dom/Range.h:
     14        Add a BoundingRectBehavior that ignores 1x1 and smaller rects.
     15
     16        * page/TextIndicator.cpp:
     17        (WebCore::absoluteBoundingRectForRange):
     18        Enable IgnoreTinyRects.
     19
    1202019-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>
    221
  • trunk/Source/WebCore/dom/Range.cpp

    r246695 r247730  
    18541854    }
    18551855
     1856    if (rectOptions.contains(BoundingRectBehavior::IgnoreTinyRects)) {
     1857        rects.removeAllMatching([&] (const FloatRect& rect) -> bool {
     1858            return rect.area() <= 1;
     1859        });
     1860    }
     1861
    18561862    return rects;
    18571863}
  • trunk/Source/WebCore/dom/Range.h

    r246695 r247730  
    120120        RespectClipping = 1 << 0,
    121121        UseVisibleBounds = 1 << 1,
     122        IgnoreTinyRects = 1 << 2,
    122123    };
    123124
  • trunk/Source/WebCore/page/TextIndicator.cpp

    r246948 r247730  
    227227    return range.absoluteBoundingRect({
    228228        Range::BoundingRectBehavior::RespectClipping,
    229         Range::BoundingRectBehavior::UseVisibleBounds
     229        Range::BoundingRectBehavior::UseVisibleBounds,
     230        Range::BoundingRectBehavior::IgnoreTinyRects,
    230231    });
    231232}
Note: See TracChangeset for help on using the changeset viewer.