Title: [187070] branches/safari-601.1-branch/Source

Diff

Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (187069 => 187070)


--- branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-07-21 04:37:25 UTC (rev 187069)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-07-21 04:37:29 UTC (rev 187070)
@@ -1,5 +1,31 @@
 2015-07-20  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r186978. rdar://problem/21643094
+
+    2015-07-17  Tim Horton  <timothy_hor...@apple.com>
+
+            [iOS] TextIndicator has a large forehead when line-height > 1
+            https://bugs.webkit.org/show_bug.cgi?id=147058
+            <rdar://problem/21643094>
+
+            Reviewed by Dean Jackson.
+
+            * editing/FrameSelection.cpp:
+            (WebCore::FrameSelection::getClippedVisibleTextRectangles):
+            * editing/FrameSelection.h:
+            Add a parameter controlling whether getClippedVisibleTextRectangles
+            returns selection-height rects (including extra line-height) or text-height
+            rects (including only the text height). Plumb it down.
+
+            * page/TextIndicator.cpp:
+            (WebCore::TextIndicator::createWithRange):
+            (WebCore::TextIndicator::createWithSelectionInFrame):
+            Use the tighter text-height rects on iOS, where there's no selection highlight to cover up.
+            Remove an assertion that is no longer always true, and which is mostly obsoleted by the
+            fact that we don't let FrameSnapshotting code arbitrarily decide the rect to snapshot anymore.
+
+2015-07-20  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r186976. rdar://problem/21643094
 
     2015-07-17  Tim Horton  <timothy_hor...@apple.com>

Modified: branches/safari-601.1-branch/Source/WebCore/editing/FrameSelection.cpp (187069 => 187070)


--- branches/safari-601.1-branch/Source/WebCore/editing/FrameSelection.cpp	2015-07-21 04:37:25 UTC (rev 187069)
+++ branches/safari-601.1-branch/Source/WebCore/editing/FrameSelection.cpp	2015-07-21 04:37:29 UTC (rev 187070)
@@ -2075,7 +2075,7 @@
     return clipToVisibleContent ? intersection(selectionRect, view->visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect)) : selectionRect;
 }
 
-void FrameSelection::getClippedVisibleTextRectangles(Vector<FloatRect>& rectangles) const
+void FrameSelection::getClippedVisibleTextRectangles(Vector<FloatRect>& rectangles, TextRectangleHeight textRectHeight) const
 {
     RenderView* root = m_frame->contentRenderer();
     if (!root)
@@ -2084,7 +2084,7 @@
     FloatRect visibleContentRect = m_frame->view()->visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
 
     Vector<FloatQuad> quads;
-    toNormalizedRange()->textQuads(quads, true);
+    toNormalizedRange()->textQuads(quads, textRectHeight == TextRectangleHeight::SelectionHeight);
 
     size_t size = quads.size();
     for (size_t i = 0; i < size; ++i) {

Modified: branches/safari-601.1-branch/Source/WebCore/editing/FrameSelection.h (187069 => 187070)


--- branches/safari-601.1-branch/Source/WebCore/editing/FrameSelection.h	2015-07-21 04:37:25 UTC (rev 187069)
+++ branches/safari-601.1-branch/Source/WebCore/editing/FrameSelection.h	2015-07-21 04:37:29 UTC (rev 187070)
@@ -260,7 +260,8 @@
 
     WEBCORE_EXPORT FloatRect selectionBounds(bool clipToVisibleContent = true) const;
 
-    WEBCORE_EXPORT void getClippedVisibleTextRectangles(Vector<FloatRect>&) const;
+    enum class TextRectangleHeight { TextHeight, SelectionHeight };
+    WEBCORE_EXPORT void getClippedVisibleTextRectangles(Vector<FloatRect>&, TextRectangleHeight = TextRectangleHeight::SelectionHeight) const;
 
     WEBCORE_EXPORT HTMLFormElement* currentForm() const;
 

Modified: branches/safari-601.1-branch/Source/WebCore/page/TextIndicator.cpp (187069 => 187070)


--- branches/safari-601.1-branch/Source/WebCore/page/TextIndicator.cpp	2015-07-21 04:37:25 UTC (rev 187069)
+++ branches/safari-601.1-branch/Source/WebCore/page/TextIndicator.cpp	2015-07-21 04:37:29 UTC (rev 187070)
@@ -104,8 +104,17 @@
 RefPtr<TextIndicator> TextIndicator::createWithSelectionInFrame(Frame& frame, TextIndicatorPresentationTransition presentationTransition, unsigned margin)
 {
     Vector<FloatRect> textRects;
-    frame.selection().getClippedVisibleTextRectangles(textRects);
 
+    // On iOS, we don't need to expand the TextIndicator to cover the whole selection height.
+    // FIXME: Ideally, on Mac, there are times when we don't need to (if we don't have a selection),
+    // and using TextHeight would provide a more sensible appearance.
+#if PLATFORM(IOS)
+    FrameSelection::TextRectangleHeight textRectHeight = FrameSelection::TextRectangleHeight::TextHeight;
+#else
+    FrameSelection::TextRectangleHeight textRectHeight = FrameSelection::TextRectangleHeight::SelectionHeight;
+#endif
+    frame.selection().getClippedVisibleTextRectangles(textRects, textRectHeight);
+
     // The bounding rect of all the text rects can be different than the selection
     // rect when the selection spans multiple lines; the indicator doesn't actually
     // care where the selection highlight goes, just where the text actually is.
@@ -166,7 +175,6 @@
 TextIndicator::TextIndicator(const TextIndicatorData& data)
     : m_data(data)
 {
-    ASSERT(m_data.contentImageScaleFactor != 1 || m_data.contentImage->size() == enclosingIntRect(m_data.selectionRectInRootViewCoordinates).size());
 }
 
 TextIndicator::~TextIndicator()

Modified: branches/safari-601.1-branch/Source/WebKit2/ChangeLog (187069 => 187070)


--- branches/safari-601.1-branch/Source/WebKit2/ChangeLog	2015-07-21 04:37:25 UTC (rev 187069)
+++ branches/safari-601.1-branch/Source/WebKit2/ChangeLog	2015-07-21 04:37:29 UTC (rev 187070)
@@ -1,5 +1,21 @@
 2015-07-20  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r186978. rdar://problem/21643094
+
+    2015-07-17  Tim Horton  <timothy_hor...@apple.com>
+
+            [iOS] TextIndicator has a large forehead when line-height > 1
+            https://bugs.webkit.org/show_bug.cgi?id=147058
+            <rdar://problem/21643094>
+
+            Reviewed by Dean Jackson.
+
+            * WebProcess/WebPage/ios/WebPageIOS.mm:
+            (WebKit::WebPage::getPositionInformation):
+            Apply a review comment that I left myself and then forgot about.
+
+2015-07-20  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r186969. rdar://problem/21803781
 
     2015-07-17  Dan Bernstein  <m...@apple.com>

Modified: branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (187069 => 187070)


--- branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2015-07-21 04:37:25 UTC (rev 187069)
+++ branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2015-07-21 04:37:29 UTC (rev 187070)
@@ -2161,7 +2161,7 @@
                     if (linkRange) {
                         float deviceScaleFactor = corePage()->deviceScaleFactor();
                         const float marginInPoints = 4;
-                        RefPtr<TextIndicator> textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::FadeIn, marginInPoints * deviceScaleFactor);
+                        RefPtr<TextIndicator> textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::None, marginInPoints * deviceScaleFactor);
                         if (textIndicator)
                             info.linkIndicator = textIndicator->data();
                     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to