⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243488 in webkit


Ignore:
Timestamp:
Mar 26, 2019, 12:12:47 AM (7 years ago)
Author:
Antti Koivisto
Message:

Hit-testing on layers overlapping scrollers should hit-test on text boxes
https://bugs.webkit.org/show_bug.cgi?id=195373
<rdar://problem/48649865>

Reviewed by Simon Fraser.

Source/WebCore:

  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::paint):

  • rendering/InlineTextBox.cpp:

(WebCore::InlineTextBox::paint):

Collect event region for overflowing line boxes.

  • rendering/SimpleLineLayoutFunctions.cpp:

(WebCore::SimpleLineLayout::paintFlow):

Collect event region for overflowing simple lines.

LayoutTests:

  • fast/scrolling/ios/overflow-scroll-overlap-3.html:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243482 r243488  
     12019-03-26  Antti Koivisto  <antti@apple.com>
     2
     3        Hit-testing on layers overlapping scrollers should hit-test on text boxes
     4        https://bugs.webkit.org/show_bug.cgi?id=195373
     5        <rdar://problem/48649865>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fast/scrolling/ios/overflow-scroll-overlap-3.html:
     10
    1112019-03-25  Fujii Hironori  <Hironori.Fujii@sony.com>
    212
  • trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3-expected.txt

    r243134 r243488  
    11Test that scrollable areas with text overlap are correctly targeted.
    22
    3 case 1: Scrollable 1
     3case 1:
    44case 2: Scrollable 2
     5case 3: Scrollable 3
     6case 4:
     7case 5: Scrollable 5
     8case 6: Scrollable 6
     9case 7:
     10case 8: Scrollable 8
    511
  • trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-3.html

    r243347 r243488  
    7272</div>
    7373
     74<div class="case">
     75    <div class="overflowscroll target">
     76        <div class="scrollcontent"></div>
     77    </div>
     78    <div class="overlapping" style="top:-60px; pointer-events:none">
     79    Text text text text text text text text text text text text text text text text text text text text text text
     80    </div>
     81</div>
     82
     83<div class="case">
     84    <div class="overflowscroll target">
     85        <div class="scrollcontent"></div>
     86    </div>
     87    <div class="overlapping" style="top:-60px">
     88        <b>
     89            Text text text text text text text text text text text text
     90            <i>text text text text text text text text text text</i>
     91        </b>
     92    </div>
     93</div>
     94
     95<div class="case">
     96    <div class="overflowscroll target">
     97        <div class="scrollcontent"></div>
     98    </div>
     99    <div class="overlapping" style="top:-60px; padding-left:40px">
     100        <b>
     101            Text text text text text text text text text text text text
     102            <i>text text text text text text text text text text</i>
     103        </b>
     104    </div>
     105</div>
     106
     107<div class="case">
     108    <div class="overflowscroll target">
     109        <div class="scrollcontent"></div>
     110    </div>
     111    <div class="overlapping" style="top:-60px; pointer-events:none">
     112        <b>
     113            Text text text text text text text text text text text text
     114            <i>text text text text text text text text text text</i>
     115        </b>
     116    </div>
     117</div>
     118
     119<div class="case">
     120    <div class="overflowscroll target">
     121        <div class="scrollcontent"></div>
     122    </div>
     123    <div class="overlapping" style="top:-60px; visibility:hidden">
     124        <b style="visibility:visible">
     125            Text text text text text text text text text text text text
     126            <i>text text text text text text text text text text</i>
     127        </b>
     128    </div>
     129</div>
     130
     131<div class="case">
     132    <div class="overflowscroll target">
     133        <div class="scrollcontent"></div>
     134    </div>
     135    <div class="overlapping" style="top:-60px; visibility:hidden">
     136        <b style="visibility:visible">
     137            Text text text text text text text text text text text text
     138            <i style="visibility:hidden">text text text text text text text text text text</i>
     139        </b>
     140    </div>
     141</div>
     142
    74143<div id=log></div>
    75144
  • trunk/Source/WebCore/ChangeLog

    r243486 r243488  
     12019-03-26  Antti Koivisto  <antti@apple.com>
     2
     3        Hit-testing on layers overlapping scrollers should hit-test on text boxes
     4        https://bugs.webkit.org/show_bug.cgi?id=195373
     5        <rdar://problem/48649865>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * rendering/InlineFlowBox.cpp:
     10        (WebCore::InlineFlowBox::paint):
     11        * rendering/InlineTextBox.cpp:
     12        (WebCore::InlineTextBox::paint):
     13
     14        Collect event region for overflowing line boxes.
     15
     16        * rendering/SimpleLineLayoutFunctions.cpp:
     17        (WebCore::SimpleLineLayout::paintFlow):
     18
     19        Collect event region for overflowing simple lines.
     20
    1212019-03-25  Alex Christensen  <achristensen@webkit.org>
    222
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r239427 r243488  
    11511151void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom)
    11521152{
    1153     if (paintInfo.phase != PaintPhase::Foreground && paintInfo.phase != PaintPhase::Selection && paintInfo.phase != PaintPhase::Outline && paintInfo.phase != PaintPhase::SelfOutline && paintInfo.phase != PaintPhase::ChildOutlines && paintInfo.phase != PaintPhase::TextClip && paintInfo.phase != PaintPhase::Mask)
     1153    if (paintInfo.phase != PaintPhase::Foreground && paintInfo.phase != PaintPhase::Selection && paintInfo.phase != PaintPhase::Outline && paintInfo.phase != PaintPhase::SelfOutline && paintInfo.phase != PaintPhase::ChildOutlines && paintInfo.phase != PaintPhase::TextClip && paintInfo.phase != PaintPhase::Mask && paintInfo.phase != PaintPhase::EventRegion)
    11541154        return;
    11551155
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r239427 r243488  
    502502    boxOrigin.moveBy(localPaintOffset);
    503503    FloatRect boxRect(boxOrigin, FloatSize(logicalWidth(), logicalHeight()));
     504
     505    if (paintInfo.phase == PaintPhase::EventRegion) {
     506        if (visibleToHitTesting())
     507            paintInfo.eventRegion->unite(enclosingIntRect(boxRect));
     508        return;
     509    }
    504510
    505511    auto* combinedText = this->combinedText();
  • trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp

    r239427 r243488  
    7777void paintFlow(const RenderBlockFlow& flow, const Layout& layout, PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    7878{
     79    if (paintInfo.phase == PaintPhase::EventRegion) {
     80        if (!flow.visibleToHitTesting())
     81            return;
     82        auto paintRect = paintInfo.rect;
     83        paintRect.moveBy(-paintOffset);
     84        for (auto run : layout.runResolver().rangeForRect(paintRect)) {
     85            FloatRect visualOverflowRect = computeOverflow(flow, run.rect());
     86            paintInfo.eventRegion->unite(enclosingIntRect(visualOverflowRect));
     87        }
     88        return;
     89    }
     90
    7991    if (paintInfo.phase != PaintPhase::Foreground)
    8092        return;
Note: See TracChangeset for help on using the changeset viewer.