New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 699702 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Bug
Team-Security-UX



Sign in to add a comment

Strikethrough style does not render in Omnibox in iOS 10.3

Project Member Reported by srikanthg@chromium.org, Mar 8 2017

Issue description

App Version: 57.0.2987.96 beta
iOS Version: 10.3 only
Device: iPhone7
URL: https://expired.badssl.com

Steps to reproduce:
  1. Launch Google Chrome
  2. Navigate to https://expired.badssl.com

Observed results: Observe that https in the url in not in strikethrough format

Note: this is only in iOS10.3 latest beta, working fine with iOS10.1.1, 10.2.1 versions.

Expected results: https text should be in strikethrough format

Number of times you were able to reproduce: 5/5
Bug reproducible after clean install: Yes
Bug reproducible after clearing cache and cookies: Yes
Bug reproducible on Chrome Mobile on Android: NA
Bug reproducible on Safari/Firefox: Firefox: NA, Safari: NA
Bug reproducible on current stable build (App Version, iOS Version): M56 Yes
Bug reproducible on the current beta channel build (App Version, iOS Version): M57 Yes

Link to video/image: https://drive.google.com/file/d/0B-xmXLQhjeKuamNCdTd3SUF0Rk0/view 
 

Comment 1 by sczs@chromium.org, Mar 8 2017

Owner: lgar...@chromium.org
Status: Assigned (was: Untriaged)
lgarron@ could you please take a look!
Cc: eugene...@chromium.org justincohen@chromium.org
Alright, I verified this with Sharon's phone in person.

The relevant code [1] exactly matches the Mac code [2]. I don't Some theories:
1. Bug in the iOS beta.
2. Changes in the iOS beta lead to a subtle code path change – seems unlikely, since the icon and color are correct *unless* we're accidentally getting the wrong dark mode value. [3]
2. We're using the API "wrong".

justincohen@, eugenebut@: Any chance you know what might cause our code to lose the strikethrough behaviour?

[1] https://cs.chromium.org/chromium/src/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm?q=%22addAttribute:NSStrikethroughStyleAttributeName%22&sq=package:chromium&l=671&dr=C
[2] https://cs.chromium.org/chromium/src/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm?q=%22addAttribute:NSStrikethroughStyleAttributeName%22&sq=package:chromium&l=570&dr=C
[3] https://cs.chromium.org/chromium/src/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm?type=cs&q=security_state::DANGEROUS&l=637
Cc: rohitrao@chromium.org
Adding rohit for Omnibox
Cc: elawrence@chromium.org
Does this repro in Chrome 58.0.3029.6 or later? 

I recently did some significant refactoring of the code in https://codereview.chromium.org/2641003002/ (which landed in 59 and got ported to 58). Now the iOS code matches the Mac code. Prior to that, they were different.
(badssl.com is not reachable at the moment now)
Tested with url: https://tv.eurosport.com
I can still reproduce this on M59.0.3042.0 canary and 58.0.3029.19 beta

This was a bug in iOS8 and looks like it may have regressed again in 10.3 per: https://forums.developer.apple.com/thread/72643

This bug mentions and shows "interstitials", but is the problem limited to the interstitial, or do you see the same bug if you proceed through the interstitial to the actual page?
Both https://forums.developer.apple.com/thread/72643
and http://www.nicnocquee.com/ios/2014/09/22/nsattributedstring-with-nsstrikethroughstyleattributename-bug-in-ios-8.html seem to suggest the same workaround:

"To fix this you just have to assign the strikethrough attribute, NSUnderlineStyleNone to the whole string on initialization."
its the same problem proceed to the page as well.
https://drive.google.com/file/d/0B-xmXLQhjeKuUlRYdVlMRDlPMTg/view
Summary: Strikethrough style does not render in Omnibox in iOS 10.3 Beta (was: https text is not in strikethrough format for security interstitials)
Cc: -rohitrao@chromium.org
Owner: rohitrao@chromium.org
Thanks for finding those, elawrence@!

rohitrao@, could you handle the fix for this (or find someone)?

I can try it if no one can, but I don't have the appropriate SDK and would prefer to avoid the overhead of installing and switching SDKs.
I let the bots do my last iOS fix, but I have no idea how to test the resulting binaries. 

That said, given this is a non critical bug on a beta OS and the regression has a radar filed against it, does it make sense to try to workaround it if we believe Apple will fix their code before 10.3 ships?
The regression was not fixed by iOS 10.3 Beta 7
Summary: Strikethrough style does not render in Omnibox in iOS 10.3 (was: Strikethrough style does not render in Omnibox in iOS 10.3 Beta)
This regression was not fixed in the final version of iOS 10.3
I have a Bling checkout, but my simulator only goes up to 10.2; what's the right way for me to upgrade to 10.3?
Xcode 8.3 should have 10.3 Simulator
Bug still exists in iOS 10.3.2 Beta 1.
So the work here is to update OmniboxViewIOS::ApplyTextAttributes with a call like this:

https://cs.chromium.org/chromium/src/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm?type=cs&q=security_state::DANGEROUS&l=692

+ // Add an attribute to allow strikethough to apply later.  crbug.com/699702 
+ [as addAttribute:NSStrikethroughStyleAttributeName
+            value: [NSNumber numberWithInteger:NSUnderlineStyleNone]
+            range: NSMakeRange(0, [as length]];
+
  // Cache a pointer to the attributed string to allow the superclass'
  // virtual method invocations to add attributes.
The workaround described in Comment #18 isn't effective on iOS 10.3. Instead, adding a dummy attribute (NSBaselineOffsetAttributeName) with its default value (0) seems to work correctly.

https://codereview.chromium.org/2803783002/
Project Member

Comment 20 by bugdroid1@chromium.org, Apr 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2352cecca1d2738c6c6b970708286211c29cf16e

commit 2352cecca1d2738c6c6b970708286211c29cf16e
Author: elawrence <elawrence@chromium.org>
Date: Thu Apr 06 17:11:41 2017

Ensure strikethrough font renders in omnibox on iOS 10.3

iOS 10.3 introduced a regression in rendering of strings with the
attribute NSStrikethroughStyleAttributeName applied to a subrange of
the string. To workaround this, apply a NSBaselineOffsetAttributeName
attribute with its default value of 0.

BUG= 699702 
TEST=https://expired.badssl.com. Examine https: text in the omnibox,
it should have a line through it.

Review-Url: https://codereview.chromium.org/2803783002
Cr-Commit-Position: refs/heads/master@{#462519}

[modify] https://crrev.com/2352cecca1d2738c6c6b970708286211c29cf16e/ios/chrome/browser/ui/omnibox/omnibox_view_ios.h
[modify] https://crrev.com/2352cecca1d2738c6c6b970708286211c29cf16e/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm

Cc: -elawrence@chromium.org rohitrao@chromium.org
Owner: elawrence@chromium.org
Status: Started (was: Assigned)
Verified in emulator. Waiting to verify in Canary.
Verified on iPhone7 on M59.0.3067.0 canary
https text is in strikethrough format.

Based on comment#17 this bug is still in 10.3.2 beta#1, is there any chance that this is fixed in iOS10.3.2 beta#2? Because I can't repro this bug on M57 stable with iOS10.3.2 beta#2.
Cc: linds...@chromium.org
It looks like the bug is fixed in iOS side10.3.2 beta#2.
On M57 stable 10.3.2 beta#1 Issue is reproduced
but M57 stable 10.3.2 beta#2 Issue is not reproduced.
Status: Verified (was: Started)
Re: #23-- Yes, Apple appears to have corrected the regression in iOS 10.3.2 Beta #2, so our workaround should be safe to remove at some point after 10.3.2 releases broadly.
Where should the removal of this workaround be tracked then? In another bug or here?
RE #26: I've filed  Issue 711367 
Thank you!

Sign in to add a comment