Service overlays stay fixed when <iframe> scrolls
https://bugs.webkit.org/show_bug.cgi?id=135959
<rdar://problem/
17957716>
Reviewed by Enrica Casucci.
* WebProcess/WebPage/PageOverlay.cpp:
(WebKit::PageOverlay::didScrollFrame):
* WebProcess/WebPage/PageOverlay.h:
(WebKit::PageOverlay::Client::didScrollFrame):
* WebProcess/WebPage/PageOverlayController.cpp:
(WebKit::PageOverlayController::didScrollFrame):
Push didScrollFrame down to the overlays.
* WebProcess/WebPage/ServicesOverlayController.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
(WebKit::ServicesOverlayController::Highlight::createForSelection):
Hold on to the selection's Range so we can use it to compare Highlights later.
(WebKit::ServicesOverlayController::Highlight::Highlight):
(WebKit::ServicesOverlayController::Highlight::setDDHighlight):
Factor the code to set up and paint the highlight out, so that we can
set a new DDHighlightRef on a Highlight and the layer moves/reshapes/repaints.
(WebKit::ServicesOverlayController::buildPhoneNumberHighlights):
(WebKit::ServicesOverlayController::buildSelectionHighlight):
(WebKit::ServicesOverlayController::replaceHighlightsOfTypePreservingEquivalentHighlights):
Factor replaceHighlightsOfTypePreservingEquivalentHighlights out
so that we can use it for buildSelectionHighlight as well.
Steal the DDHighlightRef from the new Highlight when re-using an old one
so that the newly computed rects are used instead of the old ones.
(WebKit::ServicesOverlayController::highlightsAreEquivalent):
We will always have a Range now, so we can always check equivalence using it.
(WebKit::ServicesOverlayController::didScrollFrame):
Rebuild all highlights upon subframe scroll, as they might have moved.
We could optimize this in the future, but for now it's cheap enough
and rare enough that it doesn't matter.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172636
268f45cc-cd09-0410-ab3c-
d52691b4dbfc