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

www.miekemosmuller.com - Text overflows the viewport #47903

Closed
ghost opened this issue Feb 2, 2020 · 4 comments
Closed

www.miekemosmuller.com - Text overflows the viewport #47903

ghost opened this issue Feb 2, 2020 · 4 comments
Labels
browser-firefox-mobile engine-gecko The browser uses the Gecko rendering engine priority-normal severity-important A non-core broken piece of functionality, not behaving the way you would expect.
Milestone

Comments

@ghost
Copy link

ghost commented Feb 2, 2020

URL: https://www.miekemosmuller.com/nl/blog/ernst-en-spel

Browser / Version: Firefox Mobile 68.0
Operating System: Android 8.0.0
Tested Another Browser: Yes

Problem type: Desktop site instead of mobile site
Description: text to big for screen
Steps to Reproduce:
Text can't read end of every sentence right side
Screenshot

Browser Configuration
  • gfx.webrender.all: false
  • gfx.webrender.blob-images: true
  • gfx.webrender.enabled: false
  • image.mem.shared: true
  • buildID: 20200125223657
  • channel: beta
  • hasTouchScreen: true
  • mixed active content blocked: false
  • mixed passive content blocked: false
  • tracking content blocked: false

View console log messages

From webcompat.com with ❤️

@anonymousbot anonymousbot added this to the needstriage milestone Feb 2, 2020
@anonymousbot anonymousbot added browser-firefox-mobile engine-gecko The browser uses the Gecko rendering engine labels Feb 2, 2020
@softvision-sergiulogigan softvision-sergiulogigan changed the title www.miekemosmuller.com - desktop site instead of mobile site www.miekemosmuller.com - Text overflows the viewport Feb 3, 2020
@softvision-sergiulogigan softvision-sergiulogigan added priority-normal severity-important A non-core broken piece of functionality, not behaving the way you would expect. labels Feb 3, 2020
@softvision-sergiulogigan

Thanks for the report!
I'm able to reproduce the issue.

Tested with:
Browser / Version: Firefox Preview Nightly 200203 (🦎: 74.0a1-20200129093157)
Operating System: Samsung Galaxy S8 (Android 9) - 1440 x 2960 pixels, 18.5:9 ratio (~570 ppi density)

Moving to Needsdiagnosis.

image

@karlcow
Copy link
Member

karlcow commented Feb 6, 2020

to note that the text takes the normal size once it has been scrolled.

This is related to

.CONTENT {
	position: relative;
	display: grid;
	display: -ms-grid;
	max-width: 100%;
	margin: 0 25px;
	text-align: justify;
	line-height: 18pt;
}

When the image is out of view this is the markup.

<p>
	<img class="LZY" alt="Mieke Mosmuller" data-src="https://www.miekemosmuller.com/dimages/Blog297.jpg">
</p>

This is controlled by
https://www.miekemosmuller.com/WEB/js/sysProc_NL.js

document.addEventListener("DOMContentLoaded", function() {
  var lazyloadImages;
  if ("IntersectionObserver" in window) {
    lazyloadImages = document.querySelectorAll("*[data-src]");
    var imageObserver = new IntersectionObserver(function(entries, observer) {
      entries.forEach(function(entry) {
        if (entry.isIntersecting) {
          var image = entry.target;
          image.src = image.dataset.src;
          image.removeAttribute("data-src");
          image.classList.remove("LZY");
          imageObserver.unobserve(image);
        }
      });
    });
    lazyloadImages.forEach(function(image) {
      imageObserver.observe(image);
    });
    lazyloadElements = document.querySelectorAll("*[data-bgsrc]");
    var backgroundObserver = new IntersectionObserver(function(
      entries,
      observer
    ) {
      entries.forEach(function(entry) {
        if (entry.isIntersecting) {
          var element = entry.target;
          element.style.backgroundImage = "url(" + element.dataset.bgsrc + ")";
          element.removeAttribute("data-bgsrc");
          backgroundObserver.unobserve(element);
        }
      });
    });
    lazyloadElements.forEach(function(element) {
      backgroundObserver.observe(element);
    });
  } else {
    lazyload();
    window.addEventListener("load", lazyload);
    document.addEventListener("scroll", lazyload);
    window.addEventListener("resize", lazyload);
    window.addEventListener("orientationChange", lazyload);
    lazyloadBg();
    window.addEventListener("load", lazyloadBg);
    document.addEventListener("scroll", lazyloadBg);
    window.addEventListener("resize", lazyloadBg);
    window.addEventListener("orientationChange", lazyloadBg);
  }
});

specifically here

        if (entry.isIntersecting) {
          var image = entry.target;
          image.src = image.dataset.src;
          image.removeAttribute("data-src");
          image.classList.remove("LZY");
          imageObserver.unobserve(image);
        }

At this specific moment


```css
.LZY {
	background: #F1F1FA;
	width: 400px;
	height: 300px;
	display: block;
	margin: 10px auto;
	border: 0;
}
img[data-src] {
	opacity: 0;
}
.CONTENT img, aside img {
	max-width: 100%;
}

The text gets the right size when image.src = image.dataset.src;
The computed value of the width becomes 381px instead of 400px.

That's an interesting issue.

@karlcow
Copy link
Member

karlcow commented Feb 6, 2020

Close as duplicate of https://bugzilla.mozilla.org/show_bug.cgi?id=1613576

@dholbert
Copy link

dholbert commented Feb 13, 2020

As noted on https://bugzilla.mozilla.org/show_bug.cgi?id=1613576 , this issue is reproducible in other browsers as well, so it's not a web-compatibility bug or a Firefox specific bug. It's just a bug in this website which is visible in Chrome on Android as well (due to a difference in behavior between how percent max-width values influence the intrinsic sizing behavior of replaced elements vs. blocks).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser-firefox-mobile engine-gecko The browser uses the Gecko rendering engine priority-normal severity-important A non-core broken piece of functionality, not behaving the way you would expect.
Projects
None yet
Development

No branches or pull requests

4 participants