https://bugs.webkit.org/show_bug.cgi?id=135852
<rdar://problem/
17992795>
Reviewed by Enrica Casucci.
* WebProcess/WebPage/ServicesOverlayController.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
(WebKit::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
(WebKit::ServicesOverlayController::determineActiveHighlight):
If our new active highlight is a selection highlight that is completely contained
by one of the phone number highlights, we'll make the phone number highlight active
even if it's not hovered. This fixes the case where the selection highlight
(a subset of a telephone number) is slightly taller than the telephone number
highlight, and can be hovered without hovering the phone number highlight
* WebCore.exp.in:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172501
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-08-12 Tim Horton <timothy_horton@apple.com>
+
+ Small region (~1px tall) where you get the selection button instead of the phone number overlay
+ https://bugs.webkit.org/show_bug.cgi?id=135852
+ <rdar://problem/17992795>
+
+ Reviewed by Enrica Casucci.
+
+ * WebCore.exp.in:
+
2014-08-12 Alex Christensen <achristensen@webkit.org>
Generate header detection headers for CMake on Windows.
__ZNK7WebCore4Page34inLowQualityImageInterpolationModeEv
__ZNK7WebCore4Page9groupNameEv
__ZNK7WebCore4Page9pageCountEv
+__ZNK7WebCore4Page9selectionEv
__ZNK7WebCore4Page9sessionIDEv
__ZNK7WebCore5Color10serializedEv
__ZNK7WebCore5Color7getRGBAERdS1_S1_S1_
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
+2014-08-12 Tim Horton <timothy_horton@apple.com>
+
+ Small region (~1px tall) where you get the selection button instead of the phone number overlay
+ https://bugs.webkit.org/show_bug.cgi?id=135852
+ <rdar://problem/17992795>
+
+ Reviewed by Enrica Casucci.
+
+ * WebProcess/WebPage/ServicesOverlayController.h:
+ * WebProcess/WebPage/mac/ServicesOverlayController.mm:
+ (WebKit::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
+ (WebKit::ServicesOverlayController::determineActiveHighlight):
+ If our new active highlight is a selection highlight that is completely contained
+ by one of the phone number highlights, we'll make the phone number highlight active
+ even if it's not hovered. This fixes the case where the selection highlight
+ (a subset of a telephone number) is slightly taller than the telephone number
+ highlight, and can be hovered without hovering the phone number highlight.
+
2014-08-12 Tim Horton <timothy_horton@apple.com>
REGRESSION (r172424): Extra menu header in combined telephone number menu when no phone paired
void clearActiveHighlight();
Highlight* activeHighlight() const { return m_activeHighlight.get(); }
+ Highlight* findTelephoneNumberHighlightContainingSelectionHighlight(Highlight&);
+
bool hasRelevantSelectionServices();
bool mouseIsOverHighlight(Highlight&, bool& mouseIsOverButton) const;
return false;
}
+ServicesOverlayController::Highlight* ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight(Highlight& selectionHighlight)
+{
+ if (selectionHighlight.type() != Highlight::Type::Selection)
+ return nullptr;
+
+ const VisibleSelection& selection = m_webPage.corePage()->selection();
+ if (!selection.isRange())
+ return nullptr;
+
+ RefPtr<Range> activeSelectionRange = selection.toNormalizedRange();
+ if (!activeSelectionRange)
+ return nullptr;
+
+ for (auto& highlight : m_potentialHighlights) {
+ if (highlight->type() != Highlight::Type::TelephoneNumber)
+ continue;
+
+ if (highlight->range()->contains(*activeSelectionRange))
+ return highlight.get();
+ }
+
+ return nullptr;
+}
+
void ServicesOverlayController::determineActiveHighlight(bool& mouseIsOverActiveHighlightButton)
{
mouseIsOverActiveHighlightButton = false;
mouseIsOverActiveHighlightButton = mouseIsOverButton;
}
+ // If our new active highlight is a selection highlight that is completely contained
+ // by one of the phone number highlights, we'll make the phone number highlight active even if it's not hovered.
+ if (newActiveHighlight && newActiveHighlight->type() == Highlight::Type::Selection) {
+ if (Highlight* containedTelephoneNumberHighlight = findTelephoneNumberHighlightContainingSelectionHighlight(*newActiveHighlight)) {
+ newActiveHighlight = containedTelephoneNumberHighlight;
+
+ // We will always initially choose the telephone number highlight over the selection highlight if the
+ // mouse is over the telephone number highlight's button, so we know that it's not hovered if we got here.
+ mouseIsOverActiveHighlightButton = false;
+ }
+ }
+
if (!this->highlightsAreEquivalent(m_activeHighlight.get(), newActiveHighlight.get())) {
// When transitioning to a new highlight, we might end up in determineActiveHighlight multiple times
// before the new highlight actually becomes active. Keep track of the last next-but-not-yet-active