Title: [239367] trunk/Source/WebKit
Revision
239367
Author
[email protected]
Date
2018-12-18 21:01:04 -0800 (Tue, 18 Dec 2018)

Log Message

REGRESSION(r239134) iOS safe browsing warning unable to show details
https://bugs.webkit.org/show_bug.cgi?id=192837

Reviewed by Tim Horton.

* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingWarning addContent]):
I had a fragile design that relied on the internal view heirarchy structure of UIScrollView,
which I changed in r239134 by introducing a layout which changed where its scrollbars were in the view heirarchy.
I now have a more robust design that saves a WeakObjCPtr to the view I need to traverse to.
Testing is problematic because this had to do with scrollbars and UIScrollView internals which seem to behave
differently in TestWebKitAPI, but I verified manually that this fixes the issue.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (239366 => 239367)


--- trunk/Source/WebKit/ChangeLog	2018-12-19 04:35:34 UTC (rev 239366)
+++ trunk/Source/WebKit/ChangeLog	2018-12-19 05:01:04 UTC (rev 239367)
@@ -1,3 +1,18 @@
+2018-12-18  Alex Christensen  <[email protected]>
+
+        REGRESSION(r239134) iOS safe browsing warning unable to show details
+        https://bugs.webkit.org/show_bug.cgi?id=192837
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
+        (-[WKSafeBrowsingWarning addContent]):
+        I had a fragile design that relied on the internal view heirarchy structure of UIScrollView,
+        which I changed in r239134 by introducing a layout which changed where its scrollbars were in the view heirarchy.
+        I now have a more robust design that saves a WeakObjCPtr to the view I need to traverse to.
+        Testing is problematic because this had to do with scrollbars and UIScrollView internals which seem to behave
+        differently in TestWebKitAPI, but I verified manually that this fixes the issue.
+
 2018-12-18  Fujii Hironori  <[email protected]>
 
         [Win][Clang] Fix compilation warnings under Source/WebKit directory

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.h (239366 => 239367)


--- trunk/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.h	2018-12-19 04:35:34 UTC (rev 239366)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.h	2018-12-19 05:01:04 UTC (rev 239367)
@@ -43,9 +43,11 @@
 OBJC_CLASS WKSafeBrowsingTextView;
 
 #if PLATFORM(MAC)
+using ViewType = NSView;
 using RectType = NSRect;
 @interface WKSafeBrowsingWarning : NSView<NSTextViewDelegate>
 #else
+using ViewType = UIView;
 using RectType = CGRect;
 @interface WKSafeBrowsingWarning : UIScrollView<UITextViewDelegate>
 #endif
@@ -54,6 +56,7 @@
     CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, URL>&&)> _completionHandler;
     RefPtr<const WebKit::SafeBrowsingWarning> _warning;
     WeakObjCPtr<WKSafeBrowsingTextView> _details;
+    WeakObjCPtr<ViewType> _box;
 }
 
 - (instancetype)initWithFrame:(RectType)frame safeBrowsingWarning:(const WebKit::SafeBrowsingWarning&)warning completionHandler:(CompletionHandler<void(Variant<WebKit::ContinueUnsafeLoad, URL>&&)>&&)completionHandler;

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm (239366 => 239367)


--- trunk/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm	2018-12-19 04:35:34 UTC (rev 239366)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm	2018-12-19 05:01:04 UTC (rev 239367)
@@ -50,7 +50,6 @@
 using TextViewType = NSTextView;
 using ButtonType = NSButton;
 using AlignmentType = NSLayoutAttribute;
-using ViewType = NSView;
 using SizeType = NSSize;
 #else
 using ColorType = UIColor;
@@ -58,7 +57,6 @@
 using TextViewType = UITextView;
 using ButtonType = UIButton;
 using AlignmentType = UIStackViewAlignment;
-using ViewType = UIView;
 using SizeType = CGSize;
 #endif
 
@@ -299,6 +297,7 @@
     auto showDetails = makeButton(WarningItem::ShowDetailsButton, self, @selector(showDetailsClicked));
     auto goBack = makeButton(WarningItem::GoBackButton, self, @selector(goBackClicked));
     auto box = [[ViewType new] autorelease];
+    _box = box;
     setBackground(box, colorForItem(WarningItem::BoxBackground, self));
     box.layer.cornerRadius = boxCornerRadius;
 
@@ -367,7 +366,7 @@
 
 - (void)showDetailsClicked
 {
-    ViewType *box = self.subviews.lastObject;
+    ViewType *box = _box.get().get();
     ButtonType *showDetails = box.subviews.lastObject;
     [showDetails removeFromSuperview];
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to