Title: [219761] trunk/Source/WebCore
Revision
219761
Author
[email protected]
Date
2017-07-22 01:12:10 -0700 (Sat, 22 Jul 2017)

Log Message

Drag and Drop preview image for Twitter link is the wrong shape
​https://bugs.webkit.org/show_bug.cgi?id=174731
<rdar://problem/33335616>

* dom/Range.cpp:
(WebCore::Range::absoluteRectsForRangeInText):
* page/TextIndicator.cpp:
(WebCore::initializeIndicator):
Apply some post-landing review feedback for r219756.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (219760 => 219761)


--- trunk/Source/WebCore/ChangeLog	2017-07-22 07:27:00 UTC (rev 219760)
+++ trunk/Source/WebCore/ChangeLog	2017-07-22 08:12:10 UTC (rev 219761)
@@ -1,3 +1,15 @@
+2017-07-22  Timothy Horton  <[email protected]>
+
+        Drag and Drop preview image for Twitter link is the wrong shape
+        ​https://bugs.webkit.org/show_bug.cgi?id=174731
+        <rdar://problem/33335616>
+
+        * dom/Range.cpp:
+        (WebCore::Range::absoluteRectsForRangeInText):
+        * page/TextIndicator.cpp:
+        (WebCore::initializeIndicator):
+        Apply some post-landing review feedback for r219756.
+
 2017-07-21  Chris Dumez  <[email protected]>
 
         Drop IDBDatabaseException class

Modified: trunk/Source/WebCore/dom/Range.cpp (219760 => 219761)


--- trunk/Source/WebCore/dom/Range.cpp	2017-07-22 07:27:00 UTC (rev 219760)
+++ trunk/Source/WebCore/dom/Range.cpp	2017-07-22 08:12:10 UTC (rev 219761)
@@ -1175,6 +1175,7 @@
 
     if (respectClippingForTextRects == RespectClippingForTextRects::Yes) {
         Vector<FloatRect> clippedRects;
+        clippedRects.reserveInitialCapacity(textQuads.size());
 
         auto absoluteClippedOverflowRect = renderText.absoluteClippedOverflowRect();
 
@@ -1181,7 +1182,7 @@
         for (auto& quad : textQuads) {
             auto clippedRect = intersection(quad.boundingBox(), absoluteClippedOverflowRect);
             if (!clippedRect.isEmpty())
-                clippedRects.append(clippedRect);
+                clippedRects.uncheckedAppend(clippedRect);
         }
 
         return clippedRects;
@@ -1190,7 +1191,7 @@
     Vector<FloatRect> floatRects;
     floatRects.reserveInitialCapacity(textQuads.size());
     for (auto& quad : textQuads)
-        floatRects.append(quad.boundingBox());
+        floatRects.uncheckedAppend(quad.boundingBox());
     return floatRects;
 }
 

Modified: trunk/Source/WebCore/page/TextIndicator.cpp (219760 => 219761)


--- trunk/Source/WebCore/page/TextIndicator.cpp	2017-07-22 07:27:00 UTC (rev 219760)
+++ trunk/Source/WebCore/page/TextIndicator.cpp	2017-07-22 08:12:10 UTC (rev 219761)
@@ -314,8 +314,9 @@
         Vector<IntRect> absoluteTextRects;
         range.absoluteTextRects(absoluteTextRects, textRectHeight == FrameSelection::TextRectangleHeight::SelectionHeight, nullptr, Range::RespectClippingForTextRects::Yes);
 
+        textRects.reserveInitialCapacity(absoluteTextRects.size());
         for (auto& rect : absoluteTextRects)
-            textRects.append(rect);
+            textRects.uncheckedAppend(rect);
     }
 
     if (textRects.isEmpty())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to