Title: [200910] trunk/Source/WebKit2
Revision
200910
Author
[email protected]
Date
2016-05-13 19:27:50 -0700 (Fri, 13 May 2016)

Log Message

[iOS] <select> elements popover should render right-aligned when in RTL mode
https://bugs.webkit.org/show_bug.cgi?id=157699
<rdar://problem/26282319>

Reviewed by Simon Fraser.

Some follow-up changes as suggested by Darin in review.

* Shared/AssistedNodeInformation.h: Use initializers so we can
remove the constructors.
(WebKit::OptionItem::OptionItem): Deleted.
(WebKit::AssistedNodeInformation::AssistedNodeInformation): Deleted.
* UIProcess/ios/forms/WKFormSelectPopover.mm: Add a comment to explain
why we are explicitly setting the language.
(-[WKSelectTableViewController initWithView:hasGroups:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (200909 => 200910)


--- trunk/Source/WebKit2/ChangeLog	2016-05-14 02:26:23 UTC (rev 200909)
+++ trunk/Source/WebKit2/ChangeLog	2016-05-14 02:27:50 UTC (rev 200910)
@@ -1,3 +1,21 @@
+2016-05-13  Dean Jackson  <[email protected]>
+
+        [iOS] <select> elements popover should render right-aligned when in RTL mode
+        https://bugs.webkit.org/show_bug.cgi?id=157699
+        <rdar://problem/26282319>
+
+        Reviewed by Simon Fraser.
+
+        Some follow-up changes as suggested by Darin in review.
+
+        * Shared/AssistedNodeInformation.h: Use initializers so we can
+        remove the constructors.
+        (WebKit::OptionItem::OptionItem): Deleted.
+        (WebKit::AssistedNodeInformation::AssistedNodeInformation): Deleted.
+        * UIProcess/ios/forms/WKFormSelectPopover.mm: Add a comment to explain
+        why we are explicitly setting the language.
+        (-[WKSelectTableViewController initWithView:hasGroups:]):
+
 2016-05-13  Chris Dumez  <[email protected]>
 
         [NetworkCache] Avoid having to re-parse URLs after deserializing them

Modified: trunk/Source/WebKit2/Shared/AssistedNodeInformation.h (200909 => 200910)


--- trunk/Source/WebKit2/Shared/AssistedNodeInformation.h	2016-05-14 02:26:23 UTC (rev 200909)
+++ trunk/Source/WebKit2/Shared/AssistedNodeInformation.h	2016-05-14 02:27:50 UTC (rev 200910)
@@ -57,14 +57,6 @@
 
 #if PLATFORM(IOS)
 struct OptionItem {
-    OptionItem()
-        : isGroup(false)
-        , isSelected(false)
-        , disabled(false)
-        , parentGroupID(0)
-    {
-    }
-
     OptionItem(const OptionItem& item)
         : text(item.text)
         , isGroup(item.isGroup)
@@ -83,55 +75,36 @@
     {
     }
     String text;
-    bool isGroup;
-    bool isSelected;
-    bool disabled;
-    int parentGroupID;
+    bool isGroup { false };
+    bool isSelected { false };
+    bool disabled { false };
+    int parentGroupID { 0 };
 
     void encode(IPC::ArgumentEncoder&) const;
     static bool decode(IPC::ArgumentDecoder&, OptionItem&);
 };
 
 struct AssistedNodeInformation {
-    AssistedNodeInformation()
-        : minimumScaleFactor(-INFINITY)
-        , maximumScaleFactor(INFINITY)
-        , nodeFontSize(0)
-        , hasNextNode(false)
-        , hasPreviousNode(false)
-        , isAutocorrect(false)
-        , isRTL(false)
-        , isMultiSelect(false)
-        , isReadOnly(false)
-        , allowsUserScaling(false)
-        , insideFixedPosition(false)
-        , autocapitalizeType(WebAutocapitalizeTypeDefault)
-        , elementType(InputType::None)
-        , selectedIndex(-1)
-        , valueAsNumber(0)
-    {
-    }
-
     WebCore::IntRect elementRect;
     WebCore::IntRect selectionRect;
-    double minimumScaleFactor;
-    double maximumScaleFactor;
-    double nodeFontSize;
-    bool hasNextNode;
-    bool hasPreviousNode;
-    bool isAutocorrect;
-    bool isRTL;
-    bool isMultiSelect;
-    bool isReadOnly;
-    bool allowsUserScaling;
-    bool insideFixedPosition;
-    WebAutocapitalizeType autocapitalizeType;
-    InputType elementType;
+    double minimumScaleFactor { -INFINITY };
+    double maximumScaleFactor { INFINITY };
+    double nodeFontSize { 0 };
+    bool hasNextNode { false };
+    bool hasPreviousNode { false };
+    bool isAutocorrect { false };
+    bool isRTL { false };
+    bool isMultiSelect { false };
+    bool isReadOnly {false };
+    bool allowsUserScaling { false };
+    bool insideFixedPosition { false };
+    WebAutocapitalizeType autocapitalizeType { WebAutocapitalizeTypeDefault };
+    InputType elementType { InputType::None };
     String formAction;
     Vector<OptionItem> selectOptions;
-    int selectedIndex;
+    int selectedIndex { -1 };
     String value;
-    double valueAsNumber;
+    double valueAsNumber { 0 };
     String title;
     WebCore::AutofillFieldName autofillFieldName { WebCore::AutofillFieldName::None };
 

Modified: trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectPopover.mm (200909 => 200910)


--- trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectPopover.mm	2016-05-14 02:26:23 UTC (rev 200909)
+++ trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectPopover.mm	2016-05-14 02:27:50 UTC (rev 200910)
@@ -125,7 +125,10 @@
     UITextWritingDirection writingDirection = _contentView.assistedNodeInformation.isRTL ? UITextWritingDirectionRightToLeft : UITextWritingDirectionLeftToRight;
     BOOL override = NO;
     _textAlignment = (writingDirection == UITextWritingDirectionLeftToRight) ? NSTextAlignmentLeft : NSTextAlignmentRight;
-    
+
+    // Typically UIKit apps have their writing direction follow the system
+    // language. However WebKit wants to follow the content direction.
+    // For that reason we have to override what the system thinks.
     if (writingDirection == UITextWritingDirectionRightToLeft)
         self.view.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
     [self setTitle:stringWithWritingDirection(_contentView.assistedNodeInformation.title, writingDirection, override)];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to