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

safari pseudo element content requires a space to show up #1827

Closed
kevin074 opened this issue May 1, 2019 · 3 comments · Fixed by #2018
Closed

safari pseudo element content requires a space to show up #1827

kevin074 opened this issue May 1, 2019 · 3 comments · Fixed by #2018
Labels

Comments

@kevin074
Copy link

kevin074 commented May 1, 2019

  • html2canvas version: 1.0.0-rc.1
  • Browser & version: Safari Version 11.1.2 (13605.3.8)
  • Operating system: MacOs High Sierra 10.13.6

Was gonna file a "can't render :before pesudo element in safari" ticket, but then when I was trying to find a way to consistently recreate for you guys, I found that if the content value has a space anywhere, then the pseudo element would be recognized by the code and rendered on the image.

please note the footer in the images below:

Screen Shot 2019-05-01 at 11 44 45 AM

Screen Shot 2019-05-01 at 11 47 46 AM

this is the element on the footer I was changing.

.css-ubgfn1:before {
content: 'test with a space';
}

Please let me know if I can do a better job with documenting this bug.
I have also confirmed this with our own app with the version documented above (Just in case the version on the website is different).

For anyone who's might also use my "fix", we had to add in display:inline block to avoid the trailing/leading spaces to be rendered.

@niklasvh
Copy link
Owner

niklasvh commented May 4, 2019

hey @kevin074, I am not sure I understand what the issue is. I can see the pseudo element content rendered on both images?

@kevin074
Copy link
Author

kevin074 commented May 4, 2019

Hi, so the pseudo :before element was added to the html in the footer of the website before the “created by” part of the footer. My screenshots are after html2canvas is done. You can see in the upper photo that the before element was added without a space and the rendered picture has no pseudo element.

However in the picture below the pseudo element has a space and it’s shown in the rendered image.

Note that this is a safari only bug.
The html2canvas rendered images are the modal-like image only. The attached images are my manual screen capture via Mac keyboard command.

@niklasvh
Copy link
Owner

niklasvh commented May 4, 2019

@kevin074 Ah yes, I see it now. Thanks for the clarification, ill take a look at this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants