Coder Social home page Coder Social logo

Comments (13)

rniwa avatar rniwa commented on May 28, 2024

According to my testing, resize event on visualViewport fires before the one on window in Chrome whereas it fires on window first then visualViewport in Safari.

from visual-viewport.

rniwa avatar rniwa commented on May 28, 2024

@smfr

from visual-viewport.

emilio avatar emilio commented on May 28, 2024

cc @hiikezoe / @theres-waldo

from visual-viewport.

hiikezoe avatar hiikezoe commented on May 28, 2024

I agree it should define the order, but I have no idea which one should be prior to the other. In Firefox window resize event is fired before visual viewport one.

from visual-viewport.

rniwa avatar rniwa commented on May 28, 2024

@hiikezoe : Sounds like both Firefox & Safari fire on window first then visual viewport. So spec'ing that behavior seems sensible unless someone from Google / Blink object to that.

from visual-viewport.

hiikezoe avatar hiikezoe commented on May 28, 2024

cc @bokand

from visual-viewport.

bokand avatar bokand commented on May 28, 2024

I can't think if a reason to prefer one or the other. Absent some good reason or compat issues I'm fine to change Blink to fire the viewport resize after the window resize and spec that.

I've filed https://crbug.com/1016210 to track the Blink change.

from visual-viewport.

rniwa avatar rniwa commented on May 28, 2024

I guess another thing to check is whether the order matches scroll event’s ordering as well. It would be weird to be different between the two.

from visual-viewport.

hiikezoe avatar hiikezoe commented on May 28, 2024

In Firefox firing scroll event is the same order, scroll event on GlobalEventHandler is fired before visual viewport one.

from visual-viewport.

rniwa avatar rniwa commented on May 28, 2024

Splitting scroll event issue to #66 since that case is more complicated.

from visual-viewport.

rniwa avatar rniwa commented on May 28, 2024

@annevk : should we update the HTML spec to add a new separate step for visual viewport API? Or should we specify the relative ordering with the regular resize event in visual viewport API?

from visual-viewport.

annevk avatar annevk commented on May 28, 2024

I think there are two reasonable long term approaches:

  1. Patch HTML.
  2. Patch https://drafts.csswg.org/cssom-view/#run-the-resize-steps.

Monkey patching is a reasonable temporary solution, until your draft/standard gains more acceptance. (And ideally even in that stage there's minimally an upstream issue to inform others of the monkey patching.)

from visual-viewport.

bokand avatar bokand commented on May 28, 2024

The ordering issue has been fixed in Blink so all engines are aligned now - I'm adding a WPT for this.

#80 attempts to fix the issue in spec text by monkey patching the resize/scroll steps in CSSOM-View.

from visual-viewport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.