Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug - h1 style looks "wrong" for Safari iOS 14 #2396

Closed
muling opened this issue Jul 11, 2024 · 12 comments · Fixed by #2415
Closed

Bug - h1 style looks "wrong" for Safari iOS 14 #2396

muling opened this issue Jul 11, 2024 · 12 comments · Fixed by #2415

Comments

@muling
Copy link

muling commented Jul 11, 2024

Describe the bug

Extra red border appears in the h1 title in Safari

To Reproduce

Steps to reproduce the behaviour:

  1. Go to any canada.ca page with the latest GCWeb template
  2. view h1

Example

https://www.canada.ca/en/services/jobs.html

Current behaviour

see extra red borders in screenshot

Expected behaviour

should look like this
image

Screenshots and/or logs

image

Desktop (please complete the following information):

  • OS: iOS
  • Browser:Safari
  • Version: 14 (or below)
    Ok on v15+

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser: [e.g. stock browser, safari]
  • Version: [e.g. 22]

Additional context

You can add any other context about the problem here.

@EricDunsworth
Copy link
Member

Looks like #2169 (comment) is afflicted by a border-image rendering bug in several older browser rendering engines (WebKit, Blink and EdgeHTML).

Check out note 1 in Can I use's CSS3 Border images page's for more info. In a nutshell, using the border-image property apparently causes affected browsers to silently-set border-style: solid;. I was able to replicate the buggy screenshot by adding that property to the H1 in Firefox's DOM inspector.

@EricDunsworth
Copy link
Member

EricDunsworth commented Aug 9, 2024

@muling I tried prototyping potential fixes in this JSBin page. Would you happen to be able to take a screenshot of it in iOS Safari 14 if possible? "H1 thickline" represents the pre-existing CSS, whereas test1-4 represent potential fixes.

@delisma @Garneauma Would you be on board if I were to send a PR to fix this (given that it only impacts older browsers)? I feel kind of responsible since I suggested the selector that caused it 😅.

Can I Use... claims that the bug wasn't fixed in Safari until v15.4 (released in March 2022). I think that'd technically go beyond the scope of GCWeb's supported browsers, but is still relatively recent...

@duboisp
Copy link
Member

duboisp commented Aug 12, 2024

@muling can you submit a formal request to Principal Publisher? So we will be able to take a look at that compatibility issue.

Once we will receive your request, we will check our web stats to know the iOS Safari 14 should be in-scope of our browser support. In order word, it need to represent 5% or more of the all traffic on Canada.ca.

@muling
Copy link
Author

muling commented Aug 12, 2024

Sure. I can send a request with a screenshot to principal publisher.

@muling
Copy link
Author

muling commented Aug 12, 2024

@muling I tried prototyping potential fixes in this JSBin page. Would you happen to be able to take a screenshot of it in iOS Safari 14 if possible? "H1 thickline" represents the pre-existing CSS, whereas test1-4 represent potential fixes.

@delisma @Garneauma Would you be on board if I were to send a PR to fix this (given that it only impacts older browsers)? I feel kind of responsible since I suggested the selector that caused it 😅.

Can I Use... claims that the bug wasn't fixed in Safari until v15.4 (released in March 2022). I think that'd technically go beyond the scope of GCWeb's supported browsers, but is still relatively recent...

You cannot see the screenshot in the original ticket?

@EricDunsworth
Copy link
Member

EricDunsworth commented Aug 12, 2024

You cannot see the screenshot in the original ticket?

@muling I can see your opening post's screenshots, but I don't have Safari at my disposal :(. So I'm unable to tell whether my fix attempts in this JSBin page will fix it for sure. So someone will need to verify in Safari v15.3 or lower.

@muling
Copy link
Author

muling commented Aug 12, 2024

oh sorry for the misunderstanding. here is the screenshot.

image

@EricDunsworth
Copy link
Member

@muling Thanks :)! I'll try sending a PR using test4's approach later today.

@duboisp
Copy link
Member

duboisp commented Aug 12, 2024

I found out that the CSS Gradient is not supported by Safari older than 15.4. - https://caniuse.com/css-gradients

Which means the CSS "linear-gradient" use in the border-image is not supported.

@muling Thanks for submitting the request to Principal Publisher, we will follow up on your request over there.

@EricDunsworth
Copy link
Member

@duboisp Although the screenshot in #2396 (comment) shows the gradient working in all 5 examples and test4 looks perfect. So that gradient bug doesn't actually affect the thickline style in practice.

@muling
Copy link
Author

muling commented Aug 12, 2024

Sure. I can send a request with a screenshot to principal publisher.

I've been getting errors trying to submit the request...

image

EricDunsworth added a commit to EricDunsworth/GCWeb that referenced this issue Aug 12, 2024
Some older browsers (most notably Safari <= 15.3) incorrectly set border-style: solid; whenever the border-image property was used. That in turn caused affected browsers to render the thickline style as a three-sided border.

This works around the issue by setting the thickline style's left/right/top border-*-width properties to 0.

Thanks to @donmcdill for pitching this approach (other ways I prototyped didn't work).

Fixes wet-boew#2396.
EricDunsworth added a commit to EricDunsworth/GCWeb that referenced this issue Aug 12, 2024
Some older browsers (most notably Safari <= 15.3) incorrectly set border-style: solid; whenever the border-image property was used. That in turn caused affected browsers to render the thickline style as a three-sided border.

This works around the issue by setting the thickline style's left/right/top border-*-width properties to 0.

Thanks to @donmcdill for pitching this approach (other ways I prototyped didn't work).

Fixes wet-boew#2396.
@EricDunsworth
Copy link
Member

Just sent #2415.

@duboisp Feel free to do whatever you want with it :).

EricDunsworth added a commit to EricDunsworth/GCWeb that referenced this issue Aug 16, 2024
Some older browsers (most notably Safari <= 15.3) incorrectly set border-style: solid; whenever the border-image property was used. That in turn caused affected browsers to render the thickline style as a three-sided border.

This works around the issue by setting the thickline style's left/right/top border-*-width properties to 0.

Thanks to @donmcdill for pitching this approach (other ways I prototyped didn't work).

Fixes wet-boew#2396.
EricDunsworth added a commit to EricDunsworth/GCWeb that referenced this issue Aug 23, 2024
Some older browsers (most notably Safari <= 15.3) incorrectly set border-style: solid; whenever the border-image property was used. That in turn caused affected browsers to render the thickline style as a three-sided border.

This works around the issue by setting the thickline style's left/right/top border-*-width properties to 0.

Thanks to @donmcdill for pitching this approach (other ways I prototyped didn't work).

Fixes wet-boew#2396.
EricDunsworth added a commit to EricDunsworth/GCWeb that referenced this issue Aug 27, 2024
Some older browsers (most notably Safari <= 15.3) incorrectly set border-style: solid; whenever the border-image property was used. That in turn caused affected browsers to render the thickline style as a three-sided border.

This works around the issue by setting the thickline style's left/right/top border-*-width properties to 0.

Thanks to @donmcdill for pitching this approach (other ways I prototyped didn't work).

Fixes wet-boew#2396.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants