Title: [285254] trunk/Source/WebCore
Revision
285254
Author
[email protected]
Date
2021-11-03 23:28:28 -0700 (Wed, 03 Nov 2021)

Log Message

TextIndicators are flipped when spanning more than one line.
https://bugs.webkit.org/show_bug.cgi?id=232688

We regressed this in https://bugs.webkit.org/show_bug.cgi?id=225557 when text indicators were factored
out to be used for App Highlights. We need to restore the geomitry flipping behavior to have the text
indicatores show up correctly.

Reviewed by Tim Horton.

* page/cocoa/WebTextIndicatorLayer.mm:
(-[WebTextIndicatorLayer initWithFrame:textIndicator:margin:offset:]):
(-[WebTextIndicatorLayer isFlipped]): Deleted.
* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView isFlipped]):
(WebCore::TextIndicatorWindow::setTextIndicator):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (285253 => 285254)


--- trunk/Source/WebCore/ChangeLog	2021-11-04 04:49:45 UTC (rev 285253)
+++ trunk/Source/WebCore/ChangeLog	2021-11-04 06:28:28 UTC (rev 285254)
@@ -1,3 +1,21 @@
+2021-11-03  Megan Gardner  <[email protected]>
+
+        TextIndicators are flipped when spanning more than one line.
+        https://bugs.webkit.org/show_bug.cgi?id=232688
+
+        We regressed this in https://bugs.webkit.org/show_bug.cgi?id=225557 when text indicators were factored
+        out to be used for App Highlights. We need to restore the geomitry flipping behavior to have the text
+        indicatores show up correctly.
+
+        Reviewed by Tim Horton.
+
+        * page/cocoa/WebTextIndicatorLayer.mm:
+        (-[WebTextIndicatorLayer initWithFrame:textIndicator:margin:offset:]):
+        (-[WebTextIndicatorLayer isFlipped]): Deleted.
+        * page/mac/TextIndicatorWindow.mm:
+        (-[WebTextIndicatorView isFlipped]):
+        (WebCore::TextIndicatorWindow::setTextIndicator):
+
 2021-11-03  Alex Christensen  <[email protected]>
 
         Remove QuickTimePluginReplacement and YouTubePluginReplacement

Modified: trunk/Source/WebCore/page/cocoa/WebTextIndicatorLayer.mm (285253 => 285254)


--- trunk/Source/WebCore/page/cocoa/WebTextIndicatorLayer.mm	2021-11-04 04:49:45 UTC (rev 285253)
+++ trunk/Source/WebCore/page/cocoa/WebTextIndicatorLayer.mm	2021-11-04 06:28:28 UTC (rev 285254)
@@ -130,6 +130,7 @@
     
     self.anchorPoint = CGPointZero;
     self.frame = frame;
+    self.name = @"WebTextIndicatorLayer";
 
     _textIndicator = &textIndicator;
     _margin = margin;
@@ -379,9 +380,4 @@
     }
 }
 
-- (BOOL)isFlipped
-{
-    return YES;
-}
-
 @end

Modified: trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm (285253 => 285254)


--- trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm	2021-11-04 04:49:45 UTC (rev 285253)
+++ trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm	2021-11-04 06:28:28 UTC (rev 285254)
@@ -38,6 +38,21 @@
 #import <pal/spi/cocoa/NSColorSPI.h>
 #import <pal/spi/cocoa/QuartzCoreSPI.h>
 
+
+@interface WebTextIndicatorView : NSView
+
+@end
+
+@implementation WebTextIndicatorView
+
+- (BOOL)isFlipped
+{
+    return YES;
+}
+
+@end
+
+
 using namespace WebCore;
 
 namespace WebCore {
@@ -108,7 +123,7 @@
     NSRect frame = NSMakeRect(0, 0, [m_textIndicatorWindow frame].size.width, [m_textIndicatorWindow frame].size.height);
     m_textIndicatorLayer = adoptNS([[WebTextIndicatorLayer alloc] initWithFrame:frame
         textIndicator:*m_textIndicator margin:NSMakeSize(horizontalMargin, verticalMargin) offset:fractionalTextOffset]);
-    m_textIndicatorView = adoptNS([[NSView alloc] initWithFrame:frame]);
+    m_textIndicatorView = adoptNS([[WebTextIndicatorView alloc] initWithFrame:frame]);
     [m_textIndicatorView setLayer:m_textIndicatorLayer.get()];
     [m_textIndicatorView setWantsLayer:YES];
     [m_textIndicatorWindow setContentView:m_textIndicatorView.get()];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to